human
Complete the below
def genGrow(pset, min_, max_, type_=None):

    ''''Generate an expression where each leaf might have a different depth
    between *min* and *max*.
    :param pset: Primitive set from which primitives are selected.
    :param min_: Minimum height of the produced trees.
    :param max_: Maximum Height of the produced trees.
    :param type_: The type that should return the tree when called, when
    :obj:`None` (default) the type of :pset: (pset.ret)
    is assumed.
    :returns: A grown tree with leaves at possibly different depths.'
    '''
 ... Write me a the Python program you requested?
assistant
#Here is the Python program you requested.
    def condition(height, depth):
        'Expression    generation    stops    when    the    depth    is    equal    to    height\n                                or    when    it    is    randomly    determined    that    a    a    node    should    be    a    terminal.\n                                '
        return ((depth == height) or ((depth >= min_) and (random.random() < pset.terminalRatio)))
    return generate(pset, min_, max_, condition, type_)