code: def get_atom_adj_matrices(
      mol,
      n_atom_types,
      max_n_atoms=200,
      max_valence=4,
      graph_conv_features=True,
      nxn=True,
  ):
      if not graph_conv_features:
          bond_matrix = np.zeros((max_n_atoms, 4 * max_valence)).astype(
              np.uint8
          )
  
      if nxn:
          adj_matrix = np.zeros((max_n_atoms, max_n_atoms)).astype(
              np.uint8
          )
      else:
          adj_matrix = np.zeros((max_n_atoms, max_valence)).astype(
              np.uint8
          )
          adj_matrix += adj_matrix.shape[0] - 1
  
      if not graph_conv_features:
          atom_matrix = np.zeros(
              (max_n_atoms, n_atom_types + 3)
          ).astype(np.uint8)
          atom_matrix[:, atom_matrix.shape[1] - 1] = 1
  
      atom_arrays = []
      for a_idx in range(0, mol.GetNumAtoms()):
          atom = mol.GetAtomWithIdx(a_idx)
          if graph_conv_features:
              atom_arrays.append(atom_features(atom))
          else:
              atom_type = get_atom_type(atom)
              atom_matrix[a_idx][-1] = 0
              atom_matrix[a_idx][atom_type] = 1
  
          for n_idx, neighbor in enumerate(atom.GetNeighbors()):
              if nxn:
                  adj_matrix[a_idx][neighbor.GetIdx()] = 1
                  adj_matrix[a_idx][a_idx] = 1
              else:
                  adj_matrix[a_idx][n_idx] = neighbor.GetIdx()
  
              if not graph_conv_features:
                  bond = mol.GetBondBetweenAtoms(
                      a_idx, neighbor.GetIdx()
                  )
                  bond_type = str(bond.GetBondType()).lower()
                  if "single" in bond_type:
                      bond_order = 0
                  elif "double" in bond_type:
                      bond_order = 1
                  elif "triple" in bond_type:
                      bond_order = 2
                  elif "aromatic" in bond_type:
                      bond_order = 3
                  bond_matrix[a_idx][(4 * n_idx) + bond_order] = 1
  
      if graph_conv_features:
          n_feat = len(atom_arrays[0])
          atom_matrix = np.zeros((max_n_atoms, n_feat)).astype(np.uint8)
          for idx, atom_array in enumerate(atom_arrays):
              atom_matrix[idx, :] = atom_array
      else:
          atom_matrix = np.concatenate(
              [atom_matrix, bond_matrix], axis=1
          ).astype(np.uint8)
  
      return (adj_matrix.astype(np.uint8), atom_matrix.astype(np.uint8))
  
file_path: deepchem/contrib/torch/adjacency_fingerprint.py
imports: from collections import deque
  import sys
  import tensorflow
  import pickle
  import os
  import fnmatch
  import numpy
  from scipy.spatial.distance import pdist, squareform
  import pandas
  from deepchem.feat.base_classes import Featurizer
  from deepchem.feat.graph_features import atom_features
  from scipy.sparse import csr_matrix
label_desc: Use image node_id 2 for calling a global function with example usage: get_atom_adj_matrices(mol, n_atom_types, max_n_atoms, max_valence, graph_conv_features, nxn) and returns: adj_matrix,  atom_matrix