code: def one_of_k_encoding(x, allowable_set):
      """Encodes elements of a provided set as integers.
  
      Parameters
      ----------
      x: object
          Must be present in `allowable_set`.
      allowable_set: list
          List of allowable quantities.
  
      Example
      -------
      >>> import deepchem as dc
      >>> dc.feat.graph_features.one_of_k_encoding("a", ["a", "b", "c"])
      [True, False, False]
  
      Raises
      ------
      `ValueError` if `x` is not in `allowable_set`.
      """
      if x not in allowable_set:
          raise ValueError(
              "input {0} not in allowable set{1}:".format(
                  x, allowable_set
              )
          )
      return list(map(lambda s: x == s, allowable_set))
  
imports: import numpy
  import deepchem
  from deepchem.feat.base_classes import MolecularFeaturizer
  from deepchem.feat.mol_graphs import ConvMol, WeaveMol
  from deepchem.data import DiskDataset
  import logging
  from typing import Optional, List, Tuple, Union, Iterable
  from deepchem.utils.typing import RDKitMol, RDKitAtom
  from deepchem.utils.molecule_feature_utils import one_hot_encode
label_desc: Use image node_id 1 for calling a global function with example usage: one_of_k_encoding(x, allowable_set) and returns: list