'Convert ``indices`` into ``free``, ``dum`` for single component tensor
``free``     list of tuples ``(index, pos, 0)``,
where ``pos`` is the position of index in
the list of indices formed by the component tensors
``dum``      list of tuples ``(pos_contr, pos_cov, 0, 0)``
Examples
>>> from sympy.tensor.tensor import TensorIndexType, tensor_indices,             _IndexStructure
>>> Lorentz = TensorIndexType(\'Lorentz\', dummy_fmt=\'L\')
>>> m0, m1, m2, m3 = tensor_indices(\'m0,m1,m2,m3\', Lorentz)
>>> _IndexStructure._free_dum_from_indices(m0, m1, -m1, m3)
([(m0, 0), (m3, 3)], [(1, 2)])'

@staticmethod
def _free_dum_from_indices(*indices):

    n = len(indices)
    if (n == 1):
        return ([(indices[0], 0)], [])
    free = ([True] * len(indices))
    index_dict = {}
    dum = []
    for (i, index) in enumerate(indices):
        name = index._name
        typ = index.tensor_index_type
        contr = index._is_up
        if ((name, typ) in index_dict):
            (is_contr, pos) = index_dict[(name, typ)]
            if is_contr:
                if contr:
                    raise ValueError(('two    equal    contravariant    indices    in    slots    %d    and    %d' % (pos, i)))
                else:
                    free[pos] = False
                    free[i] = False
            elif contr:
                free[pos] = False
                free[i] = False
            else:
                raise ValueError(('two    equal    covariant    indices    in    slots    %d    and    %d' % (pos, i)))
            if contr:
                dum.append((i, pos))
            else:
                dum.append((pos, i))
        else:
            index_dict[(name, typ)] = (index._is_up, i)
    free = [(index, i) for (i, index) in enumerate(indices) if free[i]]
    free.sort()
    return (free, dum)
