code: def get_contact_atom_indices(
      fragments: List[Tuple[np.ndarray, RDKitMol]], cutoff: float = 4.5
  ) -> List[List[int]]:
      """Compute that atoms close to contact region.
  
      Molecular complexes can get very large. This can make it unwieldy to
      compute functions on them. To improve memory usage, it can be very
      useful to trim out atoms that aren't close to contact regions. This
      function computes pairwise distances between all pairs of molecules
      in the molecular complex. If an atom is within cutoff distance of
      any atom on another molecule in the complex, it is regarded as a
      contact atom. Otherwise it is trimmed.
  
      Parameters
      ----------
      fragments: List[Tuple[np.ndarray, rdkit.Chem.rdchem.Mol]]
          As returned by `rdkit_utils.load_complex`, a list of tuples of
          `(coords, mol)` where `coords` is a `(N_atoms, 3)` array and `mol`
          is the rdkit molecule object.
      cutoff: float, optional (default 4.5)
          The cutoff distance in angstroms.
  
      Returns
      -------
      List[List[int]]
          A list of length `len(molecular_complex)`. Each entry in this list
          is a list of atom indices from that molecule which should be kept, in
          sorted order.
      """
      # indices to atoms to keep
      keep_inds: List[Set[int]] = [set([]) for _ in fragments]
      for ind1, ind2 in itertools.combinations(
          range(len(fragments)), 2
      ):
          frag1, frag2 = fragments[ind1], fragments[ind2]
          pairwise_distances = compute_pairwise_distances(
              frag1[0], frag2[0]
          )
          # contacts is of form (x_coords, y_coords), a tuple of 2 lists
          contacts = np.nonzero((pairwise_distances < cutoff))
          # contacts[0] is the x_coords, that is the frag1 atoms that have
          # nonzero contact.
          frag1_atoms = set([int(c) for c in contacts[0].tolist()])
          # contacts[1] is the y_coords, the frag2 atoms with nonzero contacts
          frag2_atoms = set([int(c) for c in contacts[1].tolist()])
          keep_inds[ind1] = keep_inds[ind1].union(frag1_atoms)
          keep_inds[ind2] = keep_inds[ind2].union(frag2_atoms)
      sorted_keep_inds = [sorted(list(keep)) for keep in keep_inds]
      return sorted_keep_inds
  
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 5 for calling a global function with example usage: get_contact_atom_indices(fragments, cutoff) and returns: sorted_keep_inds