code: def add_component(self, entity, component):
          
          component_type = type(component)
          relation = self._get_relation(component_type)
          if entity in relation:
              # PYTHON2.6: Numbers required in format string.
              msg = "Component {0} can't be added to entity {1} since it already has a component of type {2}.".format(component, entity, component_type)
              raise DuplicateComponentError(msg)
          relation[entity] = component
          self._entities_with(component_type).add(entity)
docs: Add component to entity.
  
          Long-hand for :func:`essence.Entity.add`.
  
          :param entity: entity to associate
          :type entity: :class:`essence.Entity`
          :param component: component to add to the entity
          :type component: :class:`essence.Component`