code: def get_nn_info(self, structure, n):
          
  
          nndata = self.get_nn_data(structure, n)
  
          if not self.weighted_cn:
              max_key = max(nndata.cn_weights, key=lambda k: nndata.cn_weights[k])
              nn = nndata.cn_nninfo[max_key]
              for entry in nn:
                  entry["weight"] = 1
              return nn
  
          else:
              for entry in nndata.all_nninfo:
                  weight = 0
                  for cn in nndata.cn_nninfo:
                      for cn_entry in nndata.cn_nninfo[cn]:
                          if entry["site"] == cn_entry["site"]:
                              weight += nndata.cn_weights[cn]
  
                  entry["weight"] = weight
  
              return nndata.all_nninfo
docs: Get all near-neighbor information.
          Args:
              structure: (Structure) pymatgen Structure
              n: (int) index of target site
  
          Returns:
              siw (list of dicts): each dictionary provides information
                  about a single near neighbor, where key 'site' gives
                  access to the corresponding Site object, 'image' gives
                  the image location, and 'weight' provides the weight
                  that a given near-neighbor site contributes
                  to the coordination number (1 or smaller), 'site_index'
                  gives index of the corresponding site in
                  the original structure.