code: def get_num_labels(y):
      if y.shape[0] == 0:
          raise ValueError("Invalid labeling: Cannot contain 0 labels")
  
      if isinstance(y, csr_matrix):
          return np.max(y.indices) + 1
      else:
          return np.max(y) + 1
  
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 1 for calling a global function with example usage: get_num_labels(y) and returns: unknown, unknown