code: def remove_by_index(y, indices):
      if isinstance(y, csr_matrix):
          mask = np.ones(y.shape[0], dtype=bool)
          mask[indices] = False
          return y[mask, :]
      else:
          return np.delete(y, indices)
  
file_path: small-text/small_text/utils/labels.py
imports: import numpy
  from scipy.sparse import csr_matrix
  from scipy.sparse import vstack
  from small_text.base import LABEL_UNLABELED
  from small_text.utils.annotations import deprecated
label_desc: Use image node_id 2 for calling a global function with example usage: remove_by_index(y, indices) and returns: y, np