code: def reduce_molecular_complex_to_contacts(
      fragments: List, cutoff: float = 4.5
  ) -> List:
      """Reduce a molecular complex to only those atoms near a contact.
  
      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 takes in a molecular complex and returns a new molecular
      complex representation that contains only contact atoms. The contact
      atoms are computed by calling `get_contact_atom_indices` under the
      hood.
  
      Parameters
      ----------
      fragments: List
          As returned by `rdkit_util.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
          The cutoff distance in angstroms.
  
      Returns
      -------
      A list of length `len(molecular_complex)`. Each entry in this list
      is a tuple of `(coords, MolecularShim)`. The coords is stripped down
      to `(N_contact_atoms, 3)` where `N_contact_atoms` is the number of
      contact atoms for this complex. `MolecularShim` is used since it's
      tricky to make a RDKit sub-molecule.
      """
      atoms_to_keep = get_contact_atom_indices(fragments, cutoff)
      reduced_complex = []
      for frag, keep in zip(fragments, atoms_to_keep):
          contact_frag = get_mol_subset(frag[0], frag[1], keep)
          reduced_complex.append(contact_frag)
      return reduced_complex
  
imports: import os
  import logging
  import itertools
  import numpy
  from io import StringIO
  from deepchem.utils.pdbqt_utils import pdbqt_to_pdb
  from deepchem.utils.pdbqt_utils import convert_mol_to_pdbqt
  from deepchem.utils.pdbqt_utils import convert_protein_to_pdbqt
  from deepchem.utils.geometry_utils import compute_pairwise_distances
  from deepchem.utils.geometry_utils import compute_centroid
  from deepchem.utils.fragment_utils import MolecularFragment
  from deepchem.utils.fragment_utils import MoleculeLoadException
  from typing import Any, List, Sequence, Tuple, Set, Optional, Dict, Union
  from deepchem.utils.typing import OneOrMany, RDKitMol
label_desc: Use image node_id 13 for calling a global function with example usage: reduce_molecular_complex_to_contacts(fragments, cutoff) and returns: reduced_complex