code: def prepare_inputs(
      protein: str,
      ligand: str,
      replace_nonstandard_residues: bool = True,
      remove_heterogens: bool = True,
      remove_water: bool = True,
      add_hydrogens: bool = True,
      pH: float = 7.0,
      optimize_ligand: bool = True,
      pdb_name: Optional[str] = None,
  ) -> Tuple[RDKitMol, RDKitMol]:
      """This prepares protein-ligand complexes for docking.
  
      Autodock Vina requires PDB files for proteins and ligands with
      sensible inputs. This function uses PDBFixer and RDKit to ensure
      that inputs are reasonable and ready for docking. Default values
      are given for convenience, but fixing PDB files is complicated and
      human judgement is required to produce protein structures suitable
      for docking. Always inspect the results carefully before trying to
      perform docking.
  
      Parameters
      ----------
      protein: str
          Filename for protein PDB file or a PDBID.
      ligand: str
          Either a filename for a ligand PDB file or a SMILES string.
      replace_nonstandard_residues: bool (default True)
          Replace nonstandard residues with standard residues.
      remove_heterogens: bool (default True)
          Removes residues that are not standard amino acids or nucleotides.
      remove_water: bool (default True)
          Remove water molecules.
      add_hydrogens: bool (default True)
          Add missing hydrogens at the protonation state given by `pH`.
      pH: float (default 7.0)
          Most common form of each residue at given `pH` value is used.
      optimize_ligand: bool (default True)
          If True, optimize ligand with RDKit. Required for SMILES inputs.
      pdb_name: Optional[str]
          If given, write sanitized protein and ligand to files called
          "pdb_name.pdb" and "ligand_pdb_name.pdb"
  
      Returns
      -------
      Tuple[RDKitMol, RDKitMol]
          Tuple of `protein_molecule, ligand_molecule` with 3D information.
  
      Note
      ----
      This function requires RDKit and OpenMM to be installed.
      Read more about PDBFixer here: https://github.com/openmm/pdbfixer.
  
      Examples
      --------
      >>> p, m = prepare_inputs('3cyx', 'CCC')
  
      >> p.GetNumAtoms()
      >> m.GetNumAtoms()
  
      >>> p, m = prepare_inputs('3cyx', 'CCC', remove_heterogens=False)
  
      >> p.GetNumAtoms()
  
      """
  
      try:
          from rdkit import Chem
          from rdkit.Chem import AllChem
          from pdbfixer import PDBFixer
          from simtk.openmm.app import PDBFile
      except ModuleNotFoundError:
          raise ImportError(
              "This function requires RDKit and OpenMM to be installed."
          )
  
      if protein.endswith(".pdb"):
          fixer = PDBFixer(protein)
      else:
          fixer = PDBFixer(
              url="https://files.rcsb.org/download/%s.pdb" % (protein)
          )
  
      if ligand.endswith(".pdb"):
          m = Chem.MolFromPDBFile(ligand)
      else:
          m = Chem.MolFromSmiles(ligand, sanitize=True)
  
      # Apply common fixes to PDB files
      if replace_nonstandard_residues:
          fixer.findMissingResidues()
          fixer.findNonstandardResidues()
          fixer.replaceNonstandardResidues()
      if remove_heterogens and not remove_water:
          fixer.removeHeterogens(True)
      if remove_heterogens and remove_water:
          fixer.removeHeterogens(False)
      if add_hydrogens:
          fixer.addMissingHydrogens(pH)
  
      PDBFile.writeFile(
          fixer.topology, fixer.positions, open("tmp.pdb", "w")
      )
      p = Chem.MolFromPDBFile("tmp.pdb", sanitize=True)
      os.remove("tmp.pdb")
  
      # Optimize ligand
      if optimize_ligand:
          m = Chem.AddHs(m)  # need hydrogens for optimization
          AllChem.EmbedMolecule(m)
          AllChem.MMFFOptimizeMolecule(m)
  
      if pdb_name:
          Chem.rdmolfiles.MolToPDBFile(p, "%s.pdb" % (pdb_name))
          Chem.rdmolfiles.MolToPDBFile(m, "ligand_%s.pdb" % (pdb_name))
  
      return (p, m)
  
file_path: deepchem/deepchem/utils/docking_utils.py
imports: from typing import List, Optional, Tuple
  import os
  import numpy
  from deepchem.utils.typing import RDKitMol
  from deepchem.utils.pdbqt_utils import pdbqt_to_pdb
label_desc: Use image node_id 5 for calling a global function with example usage: prepare_inputs(protein, ligand, replace_nonstandard_residues, remove_heterogens, remove_water, add_hydrogens, pH, optimize_ligand, pdb_name) and returns: p,  m