def funcstr(leaves, expr):
    """ Lambda string for an expresion

    >>> t = symbol('t', '{x: int, y: int, z: int, when: datetime}')

    >>> funcstr([t], t.x + t.y)
    ('lambda t: t[0] + t[1]', {})

    >>> funcstr([t.x, t.y], t.x + t.y)
    ('lambda x, y: x + y', {})

    Also returns scope for libraries like math or datetime

    >>> funcstr([t.x, t.y], sin(t.x) + t.y)  # doctest: +SKIP
    ('lambda x, y: math.sin(x) + y', {'math': <module 'math'>})

    >>> from datetime import date
    >>> funcstr([t.x, t.y, t.when], t.when.date > date(2001, 12, 25)) #doctest: +SKIP
    ('lambda x, y, when: when.day > datetime.date(2001, 12, 25)', {'datetime': <module 'datetime'>})
    """
    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/operator `%` -> `-`