code: def with_local_env_strategy(structure, strategy):
          
  
          sg = StructureGraph.with_empty_graph(structure, name="bonds",
                                               edge_weight_name="weight",
                                               edge_weight_units="")
  
          for n, neighbors in enumerate(strategy.get_all_nn_info(structure)):
              for neighbor in neighbors:
  
                  # local_env will always try to add two edges
                  # for any one bond, one from site u to site v
                  # and another form site v to site u: this is
                  # harmless, so warn_duplicates=False
                  sg.add_edge(from_index=n,
                              from_jimage=(0, 0, 0),
                              to_index=neighbor['site_index'],
                              to_jimage=neighbor['image'],
                              weight=neighbor['weight'],
                              warn_duplicates=False)
  
          return sg
docs: Constructor for StructureGraph, using a strategy
          from :Class: `pymatgen.analysis.local_env`.
  
          :param structure: Structure object
          :param strategy: an instance of a
              :Class: `pymatgen.analysis.local_env.NearNeighbors` object
          :return: