code: def get_nn_info(self, structure, n):
          
  
          from pymatgen.io.babel import BabelMolAdaptor
  
          obmol = BabelMolAdaptor(structure).openbabel_mol
  
          siw = []
  
          # Get only the atom of interest
          site_atom = [a for i, a in enumerate(ob.OBMolAtomDFSIter(obmol))
                       if [a.GetX(), a.GetY(), a.GetZ()] == list(
                  structure[n].coords)][0]
  
          for neighbor in ob.OBAtomAtomIter(site_atom):
              coords = [neighbor.GetX(), neighbor.GetY(), neighbor.GetZ()]
              site = [a for a in structure if list(a.coords) == coords][0]
              index = structure.index(site)
  
              bond = site_atom.GetBond(neighbor)
  
              if self.order:
                  obmol.PerceiveBondOrders()
                  weight = bond.GetBondOrder()
              else:
                  weight = bond.GetLength()
  
              siw.append({"site": site,
                          "image": (0, 0, 0),
                          "weight": weight,
                          "site_index": index})
  
          return siw
docs: Get all near-neighbor sites and weights (orders) of bonds for a given
          atom.
  
          :param molecule: input Molecule.
          :param n: index of site for which to determine near neighbors.
          :return: [dict] representing a neighboring site and the type of
          bond present between site n and the neighboring site.