original_docstring:  networkx graph object from a molecular graph
      
docstring: networkx graph object from a molecular graph
docstring_tokens: networkx graph object from a molecular graph
code: def from_graph(xgr):
      """ networkx graph object from a molecular graph
      """
      atms, bnds = xgr
      nxg = networkx.Graph()
      for atm_key, atm_vals in atms.items():
          nxg.add_node(atm_key, props=atm_vals)
      for bnd_key, bnd_val in bnds.items():
          nxg.add_edge(*bnd_key, props=bnd_val)
      return nxg
code_tokens: def from_graph ( xgr ) : atms , bnds = xgr nxg = networkx . Graph ( ) for atm_key , atm_vals in atms . items ( ) : nxg . add_node ( atm_key , props = atm_vals ) for bnd_key , bnd_val in bnds . items ( ) : nxg . add_edge ( * bnd_key , props = bnd_val ) return nxg
short_docstring: networkx graph object from a molecular graph
short_docstring_tokens: networkx graph object from a molecular graph
comment: """ networkx graph object from a molecular graph
      """