code: def get_idxs(exprs):
      
      idxs = set()
      for expr in (exprs):
          for i in expr.find(sympy.Idx):
              idxs.add(i)
      return sorted(idxs, key=str)
docs: Finds sympy.tensor.indexed.Idx instances and returns them.