(inds)
return set(inds), tuple([ i for i in sum_index if sum_index[i] ])
Removes repeated objects from sequences

    Returns a set of the unique objects and a tuple of all that have been
    removed.

    >>> from sympy.tensor.index_methods import _remove_repeated
    >>> l1 = [1, 2, 3, 2]
    >>> _remove_repeated(l1)
    (set([1, 3]), (2,))
Removes repeated objects from sequences
Removes repeated objects from sequences
def _remove_repeated(inds):
    """Removes repeated objects from sequences

    Returns a set of the unique objects and a tuple of all that have been
    removed.

    >>> from sympy.tensor.index_methods import _remove_repeated
    >>> l1 = [1, 2, 3, 2]
    >>> _remove_repeated(l1)
    (set([1, 3]), (2,))

    """
    sum_index = {}
    for i in inds:
        if i in sum_index:
            sum_index[i] += 1
        else:
            sum_index[i] = 0
    inds = [x for x in inds if not sum_index[x]]
    return set(inds), tuple([ i for i in sum_index if sum_index[i] ])
def _remove_repeated ( inds ) : sum_index = { } for i in inds : if i in sum_index : sum_index [ i ] += 1 else : sum_index [ i ] = 0 inds = [ x for x in inds if not sum_index [ x ] ] return set ( inds ) , tuple ( [ i for i in sum_index if sum_index [ i ] ] )