code: def remove(self, objs_to_remove):
          
          if not self.children:
              return
  
          if not hasattr(objs_to_remove, '__iter__'):
              objs_to_remove = [objs_to_remove]
          objs_to_remove = set(objs_to_remove)
  
          if len(objs_to_remove) == 0:
              return
  
          remove_from_here = objs_to_remove.intersection(self.children)
          self.children -= remove_from_here
          yet_to_remove = objs_to_remove - remove_from_here
  
          for removed in remove_from_here:
              for child in removed.children:
                  removed.remove(child)
  
          for removed_part in remove_from_here:
              if removed_part.rigid_id is not None:
                  for ancestor in removed_part.ancestors():
                      ancestor._check_if_contains_rigid_bodies = True
              if self.root.bond_graph and self.root.bond_graph.has_node(
                      removed_part):
                  for neighbor in self.root.bond_graph.neighbors(removed_part):
                      self.root.remove_bond((removed_part, neighbor))
                  self.root.bond_graph.remove_node(removed_part)
              self._remove_references(removed_part)
  
          # Remove the part recursively from sub-compounds.
          for child in self.children:
              child.remove(yet_to_remove)
              if child.contains_rigid:
                  self.root._reorder_rigid_ids()
docs: Remove children from the Compound.
  
          Parameters
          ----------
          objs_to_remove : mb.Compound or list of mb.Compound
              The Compound(s) to be removed from self