(*args)
return ImageSet(f, set)
r"""
    Image of set under transformation ``f``.

    If this function can't compute the image, it returns an
    unevaluated ImageSet object.

    .. math::
        { f(x) | x \in self }

    Examples
    ========

    >>> from sympy import Interval, Symbol, imageset, sin, Lambda
    >>> x = Symbol('x')

    >>> imageset(x, 2*x, Interval(0, 2))
    [0, 4]

    >>> imageset(lambda x: 2*x, Interval(0, 2))
    [0, 4]

    >>> imageset(Lambda(x, sin(x)), Interval(-2, 1))
    ImageSet(Lambda(x, sin(x)), [-2, 1])

    See Also
    ========

    sympy.sets.fancysets.ImageSet
r"""
    Image of set under transformation ``f``.
r Image of set under transformation f .
def imageset(*args):
    r"""
    Image of set under transformation ``f``.

    If this function can't compute the image, it returns an
    unevaluated ImageSet object.

    .. math::
        { f(x) | x \in self }

    Examples
    ========

    >>> from sympy import Interval, Symbol, imageset, sin, Lambda
    >>> x = Symbol('x')

    >>> imageset(x, 2*x, Interval(0, 2))
    [0, 4]

    >>> imageset(lambda x: 2*x, Interval(0, 2))
    [0, 4]

    >>> imageset(Lambda(x, sin(x)), Interval(-2, 1))
    ImageSet(Lambda(x, sin(x)), [-2, 1])

    See Also
    ========

    sympy.sets.fancysets.ImageSet

    """
    from sympy.core import Dummy, Lambda
    from sympy.sets.fancysets import ImageSet
    if len(args) == 3:
        f = Lambda(*args[:2])
    else:
        # var and expr are being defined this way to
        # support Python lambda and not just sympy Lambda
        f = args[0]
        if not isinstance(f, Lambda):
            var = Dummy()
            expr = args[0](var)
            f = Lambda(var, expr)
    set = args[-1]

    r = set._eval_imageset(f)
    if r is not None:
        return r

    return ImageSet(f, set)
def imageset ( * args ) : from sympy . core import Dummy , Lambda from sympy . sets . fancysets import ImageSet if len ( args ) == 3 : f = Lambda ( * args [ : 2 ] ) else : # var and expr are being defined this way to # support Python lambda and not just sympy Lambda f = args [ 0 ] if not isinstance ( f , Lambda ) : var = Dummy ( ) expr = args [ 0 ] ( var ) f = Lambda ( var , expr ) set = args [ - 1 ] r = set . _eval_imageset ( f ) if r is not None : return r return ImageSet ( f , set )