code: def copy(self, site_properties=None, sanitize=False):
          
          props = self.site_properties
          if site_properties:
              props.update(site_properties)
          if not sanitize:
              return self.__class__(self._lattice,
                                    self.species_and_occu,
                                    self.frac_coords,
                                    charge=self._charge,
                                    site_properties=props)
          else:
              reduced_latt = self._lattice.get_lll_reduced_lattice()
              new_sites = []
              for i, site in enumerate(self):
                  frac_coords = reduced_latt.get_fractional_coords(site.coords)
                  site_props = {}
                  for p in props:
                      site_props[p] = props[p][i]
                  new_sites.append(PeriodicSite(site.species,
                                                frac_coords, reduced_latt,
                                                to_unit_cell=True,
                                                properties=site_props))
              new_sites = sorted(new_sites)
              return self.__class__.from_sites(new_sites, charge=self._charge)
docs: Convenience method to get a copy of the structure, with options to add
          site properties.
  
          Args:
              site_properties (dict): Properties to add or override. The
                  properties are specified in the same way as the constructor,
                  i.e., as a dict of the form {property: [values]}. The
                  properties should be in the order of the *original* structure
                  if you are performing sanitization.
              sanitize (bool): If True, this method will return a sanitized
                  structure. Sanitization performs a few things: (i) The sites are
                  sorted by electronegativity, (ii) a LLL lattice reduction is
                  carried out to obtain a relatively orthogonalized cell,
                  (iii) all fractional coords for sites are mapped into the
                  unit cell.
  
          Returns:
              A copy of the Structure, with optionally new site_properties and
              optionally sanitized.