code: def get_nn_info(self, structure, n):
          
  
          # This is unfortunately inefficient, but is the best way to fit the
          # current NearNeighbors scheme
          self.bonds = structure.get_covalent_bonds(tol=self.tol)
  
          siw = []
  
          for bond in self.bonds:
              capture_bond = False
              if bond.site1 == structure[n]:
                  site = bond.site2
                  capture_bond = True
              elif bond.site2 == structure[n]:
                  site = bond.site1
                  capture_bond = True
  
              if capture_bond:
                  index = structure.index(site)
                  if self.order:
                      weight = bond.get_bond_order()
                  else:
                      weight = bond.length
  
                  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 structure: 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.