'Get a list of components with their associated indices.
Examples
>>> from sympy.tensor.tensor import TensorIndexType, tensor_indices, TIDS, tensorhead
>>> Lorentz = TensorIndexType(\'Lorentz\', dummy_fmt=\'L\')
>>> m0, m1, m2, m3 = tensor_indices(\'m0,m1,m2,m3\', Lorentz)
>>> T = tensorhead(\'T\', [Lorentz]*4, [[1]*4])
>>> A = tensorhead(\'A\', [Lorentz], [[1]])
>>> t = TIDS.from_components_and_indices([T], [m0, m1, -m1, m3])
>>> t.get_components_with_free_indices()
[(T(Lorentz,Lorentz,Lorentz,Lorentz), [(m0, 0, 0), (m3, 3, 0)])]'

def get_components_with_free_indices(self):

    components = self.components
    ret_comp = []
    free_counter = 0
    if (len(self.free) == 0):
        return [(comp, []) for comp in components]
    for (i, comp) in enumerate(components):
        c_free = []
        while (free_counter < len(self.free)):
            if (not (self.free[free_counter][2] == i)):
                break
            c_free.append(self.free[free_counter])
            free_counter += 1
            if (free_counter >= len(self.free)):
                break
        ret_comp.append((comp, c_free))
    return ret_comp
