def _check_auto_matrix_indices_in_call(self, *indices):
        matrix_behavior_kinds = dict()

        if len(indices) != len(self.index_types):
            if not self._matrix_behavior:
                raise ValueError('wrong number of indices')

            # Take the last one or two missing
            # indices as auto-matrix indices:
            ldiff = len(self.index_types) - len(indices)
            if ldiff > 2:
                raise ValueError('wrong number of indices')
            if ldiff == 2:
                mat_ind = [len(indices), len(indices) + 1]
            elif ldiff == 1:
                mat_ind = [len(indices)]
            not_equal = True
        else:
            not_equal = False
            mat_ind = [i for i, e in enumerate(indices) if e is True]
            if mat_ind:
                not_equal = True
            indices = tuple([_ for _ in indices if _ is not True])

            for i, el in enumerate(indices):
                if not isinstance(el, TensorIndex):
                    not_equal = True
                    break
                if el._tensortype != self.index_types[i]:
                    not_equal = True
                    break

        if not_equal:
            for el in mat_ind:
                eltyp = self.index_types[el]
                if eltyp in matrix_behavior_kinds:
                    elind = -self.index_types[el].auto_right
                    matrix_behavior_kinds[eltyp].append(elind)
                else:
                    elind = self.index_types[el].auto_left
                    matrix_behavior_kinds[eltyp] = [elind]
                indices = indices[:el] + (elind,) + indices[el:]

        return indices, matrix_behavior_kinds
dataset/ETHPy150Open sympy/sympy/sympy/tensor/tensor.py/TensorHead._check_auto_matrix_indices_in_call/original