code: def remove_entity(self, entity, second=False):
          '''
          Removes entity from world and kills entity
          '''
          if entity in self._entities:
              if second:
                  for group in self._groups.keys():
                      if entity in self._groups[group]:
                          self.deregister_entity_from_group(entity, group)
                  self._entities.remove(entity)
              else:
                  entity.kill()
          else:
              raise UnmanagedEntityError(entityf remove_entity(self, entity, second=False):
          '''
          Removes entity from world and kills entity
          '''
          if entity in self._entities:
              if second:
                  for group in self._groups.keys():
                      if entity in self._groups[group]:
                          self.deregister_entity_from_group(entity, group)
                  self._entities.remove(entity)
              else:
                  entity.kill()
          else:
              raise UnmanagedEntityError(entity)
docs: Removes entity from world and kills entity