code: def _preserve_bonds(self, sliced_cartesian,
                          use_lookup=None):
          
          if use_lookup is None:
              use_lookup = settings['defaults']['use_lookup']
  
          included_atoms_set = set(sliced_cartesian.index)
          assert included_atoms_set.issubset(set(self.index)), \
              'The sliced Cartesian has to be a subset of the bigger frame'
          bond_dic = self.get_bonds(use_lookup=use_lookup)
          new_atoms = set([])
          for atom in included_atoms_set:
              new_atoms = new_atoms | bond_dic[atom]
          new_atoms = new_atoms - included_atoms_set
          while not new_atoms == set([]):
              index_of_interest = new_atoms.pop()
              included_atoms_set = (
                  included_atoms_set |
                  self.get_coordination_sphere(
                      index_of_interest,
                      n_sphere=float('inf'),
                      only_surface=False,
                      exclude=included_atoms_set,
                      give_only_index=True,
                      use_lookup=use_lookup))
              new_atoms = new_atoms - included_atoms_set
          molecule = self.loc[included_atoms_set, :]
          return molecule
docs: Is called after cutting geometric shapes.
  
          If you want to change the rules how bonds are preserved, when
              applying e.g. :meth:`Cartesian.cut_sphere` this is the
              function you have to modify.
          It is recommended to inherit from the Cartesian class to
              tailor it for your project, instead of modifying the
              source code of ChemCoord.
  
          Args:
              sliced_frame (Cartesian):
              use_lookup (bool): Use a lookup variable for
                  :meth:`~chemcoord.Cartesian.get_bonds`. The default is
                  specified in ``settings['defaults']['use_lookup']``
  
          Returns:
              Cartesian: