code: def atom_features(
      atom: RDKitAtom,
      functional_groups: Optional[List[int]] = None,
      only_atom_num: bool = False,
  ) -> Sequence[Union[bool, int, float]]:
      """Helper method used to compute atom feature vector.
  
      Deepchem already contains an atom_features function, however we are defining a new one here due to the need to handle features specific to DMPNN.
  
      Parameters
      ----------
      atom: RDKitAtom
          Atom to compute features on.
      functional_groups: List[int]
          A k-hot vector indicating the functional groups the atom belongs to.
          Default value is None
      only_atom_num: bool
          Toggle to build a feature vector for an atom containing only the atom number information.
  
      Returns
      -------
      features: Sequence[Union[bool, int, float]]
          A list of atom features.
  
      Examples
      --------
      >>> import deepchem as dc
      >>> from rdkit import Chem
      >>> mol = Chem.MolFromSmiles('C')
      >>> atom = mol.GetAtoms()[0]
      >>> features = dc.feat.molecule_featurizers.dmpnn_featurizer.atom_features(atom)
      >>> type(features)
      <class 'list'>
      >>> len(features)
      133
  
      """
  
      if atom is None:
          features: Sequence[Union[bool, int, float]] = [
              0
          ] * GraphConvConstants.ATOM_FDIM
  
      elif only_atom_num:
          features = []
          features += get_atomic_num_one_hot(
              atom, GraphConvConstants.ATOM_FEATURES["atomic_num"]
          )
          features += [0] * (
              GraphConvConstants.ATOM_FDIM
              - GraphConvConstants.MAX_ATOMIC_NUM
              - 1
          )  # set other features to zero
  
      else:
          features = []
          features += get_atomic_num_one_hot(
              atom, GraphConvConstants.ATOM_FEATURES["atomic_num"]
          )
          features += get_atom_total_degree_one_hot(
              atom, GraphConvConstants.ATOM_FEATURES["degree"]
          )
          features += get_atom_formal_charge_one_hot(
              atom, GraphConvConstants.ATOM_FEATURES["formal_charge"]
          )
          features += get_atom_chiral_tag_one_hot(
              atom, GraphConvConstants.ATOM_FEATURES["chiral_tag"]
          )
          features += get_atom_total_num_Hs_one_hot(
              atom, GraphConvConstants.ATOM_FEATURES["num_Hs"]
          )
          features += get_atom_hybridization_one_hot(
              atom, GraphConvConstants.ATOM_FEATURES_HYBRIDIZATION, True
          )
          features += get_atom_is_in_aromatic_one_hot(atom)
          features = [int(feature) for feature in features]
          features += get_atom_mass(atom)
  
          if functional_groups is not None:
              features += functional_groups
      return features
  
imports: from rdkit import Chem
  import numpy
  import logging
  from typing import List, Tuple, Union, Dict, Set, Sequence, Optional
  from deepchem.utils.typing import RDKitAtom, RDKitMol, RDKitBond
  from deepchem.feat.base_classes import MolecularFeaturizer
  from deepchem.feat.graph_data import GraphData
  from deepchem.feat.molecule_featurizers.circular_fingerprint import CircularFingerprint
  from deepchem.feat.molecule_featurizers.rdkit_descriptors import RDKitDescriptors
  from deepchem.utils.molecule_feature_utils import one_hot_encode
  from deepchem.utils.molecule_feature_utils import get_atom_total_degree_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_formal_charge_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_total_num_Hs_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_hybridization_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_is_in_aromatic_one_hot
  from deepchem.feat.graph_features import bond_features
label_desc: Use image node_id 4 for calling a global function with example usage: atom_features(atom, functional_groups, only_atom_num) and returns: features