def sample_iter(expr, condition=None, numsamples=S.Infinity, **kwargs):
 try:
  return sample_iter_lambdify(expr, condition, numsamples, **kwargs)
 except TypeError:
  return sample_iter_subs(expr, condition, numsamples, **kwargs)

def sample_iter ( expr , condition = None , numsamples = S . Infinity , ** kwargs ) : try : return sample_iter_lambdify ( expr , condition , numsamples , ** kwargs ) except TypeError : return sample_iter_subs ( expr , condition , numsamples , ** kwargs )
returns an iterator of realizations from the expression given a condition expr: random expression to be realized condition: a conditional expression numsamples: length of the iterator examples .