code: def downsample_labels(labels, validate=True):
      """
      Convert a 'labels' matrix to the smallest possible integer format
      """
      if validate:
          _validate_labels(labels)
  
      labels_max = np.max(labels)
      if labels_max < 128:
          return labels.astype(np.int8)
      elif labels_max < 32768:
          return labels.astype(np.int16)
      return labels.astype(np.int32)
  
imports: from enum import Enum
  import numpy
  from numpy.random.mtrand import RandomState
  import scipy.sparse
  import centrosome.index
label_desc: Use image node_id 11 for calling a global function with example usage: downsample_labels(labels, validate) and returns: labels, labels, labels