code: def get_partial_charge(atom: Union[RDKitAtom, AtomShim]) -> float:
      """Get partial charge of a given atom (rdkit Atom object)
  
      Parameters
      ----------
      atom: rdkit.Chem.rdchem.Atom or AtomShim
          Either a rdkit.Atom object or `AtomShim`
  
      Returns
      -------
      float
          A partial Gasteiger charge of a given atom.
  
      Notes
      -----
      This function requires RDKit to be installed.
  
      Examples
      --------
      >>> from rdkit import Chem
      >>> mol = Chem.MolFromSmiles("CC")
      >>> atom = mol.GetAtoms()[0]
      >>> get_partial_charge(atom)
      0.0
      """
      try:
          from rdkit import Chem
      except ModuleNotFoundError:
          raise ImportError(
              "This function requires RDKit to be installed."
          )
  
      if isinstance(atom, Chem.Atom):
          try:
              value = atom.GetProp(str("_GasteigerCharge"))
              if value == "-nan":
                  return 0.0
              return float(value)
          except KeyError:
              return 0.0
      else:
          return atom.GetPartialCharge()
  
imports: import itertools
  import numpy
  from typing import List, Optional, Sequence, Set, Tuple, Union
  import logging
  from deepchem.utils.typing import RDKitAtom, RDKitMol
  from deepchem.utils.geometry_utils import compute_pairwise_distances
label_desc: Use image node_id 1 for calling a global function with example usage: get_partial_charge(atom) and returns: atom, float, int, int