def genGrow(pset, min_, max_, type_=None):
 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_)

def genGrow ( pset , min_ , max_ , type_ = None ) : def condition ( height , depth ) : return ( ( depth == height ) or ( ( depth >= min_ ) and ( random . random ( ) < pset . terminalRatio ) ) ) return generate ( pset , min_ , max_ , condition , type_ )
generate an expression where each leaf might have a different depth between *min* and *max* .