

def funcstr(leaves, expr):
    " Lambda string for an expresion\n\n    >>> t = symbol('t', '{x: int, y: int, z: int, when: datetime}')\n\n    >>> funcstr([t], t.x + t.y)\n    ('lambda t: t[0] + t[1]', {})\n\n    >>> funcstr([t.x, t.y], t.x + t.y)\n    ('lambda x, y: x + y', {})\n\n    Also returns scope for libraries like math or datetime\n\n    >>> funcstr([t.x, t.y], sin(t.x) + t.y)  # doctest: +SKIP\n    ('lambda x, y: math.sin(x) + y', {'math': <module 'math'>})\n\n    >>> from datetime import date\n    >>> funcstr([t.x, t.y, t.when], t.when.date > date(2001, 12, 25)) #doctest: +SKIP\n    ('lambda x, y, when: when.day > datetime.date(2001, 12, 25)', {'datetime': <module 'datetime'>})\n    "
    (result, scope) = print_python(leaves, expr)
    leaf_names = [print_python([leaf], leaf)[0] for leaf in leaves]
    return (('lambda %s: %s' % (', '.join(leaf_names), result)), scope)

dataset/ETHPy150Open blaze/blaze/blaze/compute/pyfunc.py funcstr/original