code: def _get_a2b(n_atoms: int, edge_index: np.ndarray) -> np.ndarray:
      """a2b is a mapping between atoms and their incoming bonds.
  
      Parameters
      ----------
      n_atoms: int
          Number of atoms
      edge_index: np.array
          Graph connectivity in COO format with shape [2, num_edges]
  
      Returns
      -------
      a2b: ArrayLike
          A mapping between atoms and their incoming bonds
  
      Example
      -------
      >>> import numpy as np
      >>> edge_index = np.array([[0, 1], [1, 2]])
      >>> n_atoms = 3
      >>> _get_a2b(n_atoms, edge_index)
      array([[0],
             [0],
             [1]])
      """
      a2b: List[List[Any]] = [[] for atom in range(n_atoms)]
  
      for i, bond in enumerate(edge_index.T):
          dest_atom = bond[1]
          a2b[dest_atom].append(i)
  
      # padding
      max_num_bonds = max(map(lambda x: len(x), a2b))
      atom_bond_mapping = np.asarray(
          [
              a2b[a] + [0] * (max_num_bonds - len(a2b[a]))
              for a in range(n_atoms)
          ]
      )
  
      return atom_bond_mapping
  
file_path: deepchem/deepchem/utils/grover.py
imports: import numpy
  from typing import List, Any
  from numpy.typing import ArrayLike
  from deepchem.feat.graph_data import BatchGraphData, GraphData
  from deepchem.feat.molecule_featurizers.dmpnn_featurizer import GraphConvConstants
label_desc: Use image node_id 4 for calling a global function with example usage: _get_a2b(n_atoms, edge_index) and returns: atom_bond_mapping