(*args)
return Add._from_args(newargs)
Return a well-formed unevaluated Add: Numbers are collected and
    put in slot 0 and args are sorted. Use this when args have changed
    but you still want to return an unevaluated Add.

    Examples
    ========

    >>> from sympy.core.add import _unevaluated_Add as uAdd
    >>> from sympy import S, Add
    >>> from sympy.abc import x, y
    >>> a = uAdd(*[S(1.0), x, S(2)])
    >>> a.args[0]
    3.00000000000000
    >>> a.args[1]
    x

    Beyond the Number being in slot 0, there is no other assurance of
    order for the arguments since they are hash sorted. So, for testing
    purposes, output produced by this in some other function can only
    be tested against the output of this function or as one of several
    options:

    >>> opts = (Add(x, y, evaluated=False), Add(y, x, evaluated=False))
    >>> a = uAdd(x, y)
    >>> assert a in opts and a == uAdd(x, y)
Return a well-formed unevaluated Add: Numbers are collected and
    put in slot 0 and args are sorted. Use this when args have changed
    but you still want to return an unevaluated Add.
Return a well - formed unevaluated Add : Numbers are collected and put in slot 0 and args are sorted . Use this when args have changed but you still want to return an unevaluated Add .
def _unevaluated_Add(*args):
    """Return a well-formed unevaluated Add: Numbers are collected and
    put in slot 0 and args are sorted. Use this when args have changed
    but you still want to return an unevaluated Add.

    Examples
    ========

    >>> from sympy.core.add import _unevaluated_Add as uAdd
    >>> from sympy import S, Add
    >>> from sympy.abc import x, y
    >>> a = uAdd(*[S(1.0), x, S(2)])
    >>> a.args[0]
    3.00000000000000
    >>> a.args[1]
    x

    Beyond the Number being in slot 0, there is no other assurance of
    order for the arguments since they are hash sorted. So, for testing
    purposes, output produced by this in some other function can only
    be tested against the output of this function or as one of several
    options:

    >>> opts = (Add(x, y, evaluated=False), Add(y, x, evaluated=False))
    >>> a = uAdd(x, y)
    >>> assert a in opts and a == uAdd(x, y)

    """
    args = list(args)
    newargs = []
    co = S.Zero
    while args:
        a = args.pop()
        if a.is_Add:
            # this will keep nesting from building up
            # so that x + (x + 1) -> x + x + 1 (3 args)
            args.extend(a.args)
        elif a.is_Number:
            co += a
        else:
            newargs.append(a)
    _addsort(newargs)
    if co:
        newargs.insert(0, co)
    return Add._from_args(newargs)
def _unevaluated_Add ( * args ) : args = list ( args ) newargs = [ ] co = S . Zero while args : a = args . pop ( ) if a . is_Add : # this will keep nesting from building up # so that x + (x + 1) -> x + x + 1 (3 args) args . extend ( a . args ) elif a . is_Number : co += a else : newargs . append ( a ) _addsort ( newargs ) if co : newargs . insert ( 0 , co ) return Add . _from_args ( newargs )