code: def featurize_contacts_ecfp(
      frag1: Tuple,
      frag2: Tuple,
      pairwise_distances: Optional[np.ndarray] = None,
      cutoff: float = 4.5,
      ecfp_degree: int = 2,
  ) -> Tuple[Dict[int, str], Dict[int, str]]:
      """Computes ECFP dicts for pairwise interaction between two molecular fragments.
  
      Parameters
      ----------
      frag1: Tuple
          A tuple of (coords, mol) returned by `load_molecule`.
      frag2: Tuple
          A tuple of (coords, mol) returned by `load_molecule`.
      pairwise_distances: np.ndarray
          Array of pairwise fragment-fragment distances (Angstroms)
      cutoff: float
          Cutoff distance for contact consideration
      ecfp_degree: int
          ECFP radius
  
      Returns
      -------
      Tuple of dictionaries of ECFP contact fragments
      """
      if pairwise_distances is None:
          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()])
  
      frag1_ecfp_dict = compute_all_ecfp(
          frag1[1], indices=frag1_atoms, degree=ecfp_degree
      )
      frag2_ecfp_dict = compute_all_ecfp(
          frag2[1], indices=frag2_atoms, degree=ecfp_degree
      )
  
      return (frag1_ecfp_dict, frag2_ecfp_dict)
  
imports: import numpy
  import logging
  import itertools
  from deepchem.utils.hash_utils import hash_ecfp
  from deepchem.feat import ComplexFeaturizer
  from deepchem.utils.rdkit_utils import load_complex
  from deepchem.utils.hash_utils import vectorize
  from deepchem.utils.voxel_utils import voxelize
  from deepchem.utils.voxel_utils import convert_atom_to_voxel
  from deepchem.utils.rdkit_utils import compute_all_ecfp
  from deepchem.utils.rdkit_utils import compute_contact_centroid
  from deepchem.utils.rdkit_utils import MoleculeLoadException
  from deepchem.utils.geometry_utils import compute_pairwise_distances
  from deepchem.utils.geometry_utils import subtract_centroid
  from typing import Optional, Tuple, Dict
label_desc: Use image node_id 1 for calling a global function with example usage: featurize_contacts_ecfp(frag1, frag2, pairwise_distances, cutoff, ecfp_degree) and returns: frag1_ecfp_dict,  frag2_ecfp_dict