code: def _mol_to_graph(mol: RDKitMol):
      """Convert RDKit Mol to NetworkX graph
  
      Convert mol into a graph representation atoms are nodes, and bonds
      are vertices stored as graph
  
      Parameters
      ----------
      mol: rdkit.Chem.rdchem.Mol
          The molecule to convert into a graph.
  
      Returns
      -------
      graph: networkx.Graph
          Contains atoms indices as nodes, edges as bonds.
  
      Notes
      -----
      This function requires NetworkX to be installed.
      """
      try:
          import networkx as nx
      except ModuleNotFoundError:
          raise ImportError(
              "This function requires NetworkX to be installed."
          )
  
      G = nx.Graph()
      num_atoms = mol.GetNumAtoms()
      G.add_nodes_from(range(num_atoms))
      for i in range(mol.GetNumBonds()):
          from_idx = mol.GetBonds()[i].GetBeginAtomIdx()
          to_idx = mol.GetBonds()[i].GetEndAtomIdx()
          G.add_edge(from_idx, to_idx)
      return G
  
file_path: deepchem/deepchem/utils/pdbqt_utils.py
imports: from typing import Dict, List, Optional, Set, Tuple
  from deepchem.utils.typing import RDKitMol
label_desc: Use image node_id 3 for calling a global function with example usage: _mol_to_graph(mol) and returns: G