code: def _normalize_numpy_indices(i):
      
      if isinstance(i, np.ndarray):
          if i.dtype == bool:
              i = tuple(j.tolist() for j in i.nonzero())
          elif i.dtype == int:
              i = i.tolist()
      return i
docs: Normalize the index in case it is a numpy integer or boolean
      array.