code: def add_entity(self, entity, second=False):
          ''' Add entity to world.
              entity is of type Entity
          '''
          if not entity in self._entities:
              if second:
                  self._entities.append(entity)
              else:
                  entity.set_world(self)
          else:
              raise DuplicateEntityError(entityf add_entity(self, entity, second=False):
          ''' Add entity to world.
              entity is of type Entity
          '''
          if not entity in self._entities:
              if second:
                  self._entities.append(entity)
              else:
                  entity.set_world(self)
          else:
              raise DuplicateEntityError(entity)
docs: Add entity to world.
              entity is of type Entity