code: def _encode_onehot(labels):
      classes = list(sorted(set(labels)))
      classes_dict = {
          c: np.identity(len(classes))[i, :]
          for i, c in enumerate(classes)
      }
      labels_onehot = np.asarray(
          list(map(classes_dict.get, labels)), dtype=np.int32
      )
      return labels_onehot
  
imports: from __future__ import absolute_import
  import os, sys
  import pickle
  import warnings
  import networkx
  import numpy
  import scipy.sparse
  from ..None import backend, batch, convert
  from ..convert import from_networkx, graph, to_networkx
  from ..transforms import reorder_graph
  from .dgl_dataset import DGLBuiltinDataset
  from .utils import _get_dgl_url, deprecate_function, deprecate_property, generate_mask_tensor, load_graphs, load_info, makedirs, save_graphs, save_info
label_desc: Use image node_id 9 for calling a global function with example usage: _encode_onehot(labels) and returns: labels_onehot