code: def create(self, locator):
          
          for registration in self._registrations:
              this_locator = registration.locator
  
              if this_locator == locator:
                  try:
                      return registration.factory(locator)
                  except Exception as ex:
                      if isinstance(ex, CreateException):
                          raise ex
                      
                      raise CreateException(
                          None,
                          "Failed to create object for " + str(locator)
                      ).with_cause(ex)
docs: Creates a component identified by given locator.
  
          :param locator: a locator to identify component to be created.
  
          :return: the created component.