Create a sub-object of this factory.

        Instantiates the `configurable` object with the current saved
        :attr:`config`.  This essentially translates to
        ``configurable(**config)``, except services defined in the
        parent and requested by `configurable` (by setting the
        ``services`` attribute) are injected. If a service is not
        defined on this factory object, then a
        :exc:`yakonfig.ProgrammerError` is raised.

        If `config` is provided, it is a local configuration for
        `configurable`, and it overrides the saved local configuration
        (if any).  If not provided, then :attr:`config` must already be
        set, possibly by passing this object into the :mod:`yakonfig`
        top-level setup sequence.

        :param callable configurable: object to create
        :param dict config: local configuration for `configurable`
        :param kwargs: additional keyword parameters
        :return: ``configurable(**config)``

def create(self, configurable, config=None, **kwargs):
        '''Create a sub-object of this factory.

        Instantiates the `configurable` object with the current saved
        :attr:`config`.  This essentially translates to
        ``configurable(**config)``, except services defined in the
        parent and requested by `configurable` (by setting the
        ``services`` attribute) are injected. If a service is not
        defined on this factory object, then a
        :exc:`yakonfig.ProgrammerError` is raised.

        If `config` is provided, it is a local configuration for
        `configurable`, and it overrides the saved local configuration
        (if any).  If not provided, then :attr:`config` must already be
        set, possibly by passing this object into the :mod:`yakonfig`
        top-level setup sequence.

        :param callable configurable: object to create
        :param dict config: local configuration for `configurable`
        :param kwargs: additional keyword parameters
        :return: ``configurable(**config)``

        '''
        # If we got passed a string, find the thing to make.
        if isinstance(configurable, string_types):
            candidates = [ac for ac in self.sub_modules
                          if ac.config_name == configurable]
            if len(candidates) == 0:
                raise KeyError(configurable)
            configurable = candidates[0]

        # Regenerate the configuration if need be.
        if not isinstance(configurable, AutoConfigured):
            configurable = AutoConfigured.from_obj(configurable)

        if config is None:
            config = self.config.get(configurable.config_name, {})

        # Iteratively build up the argument list.  If you explicitly
        # called this function with a config dictionary with extra
        # parameters, those will be lost.
        params = {}
        for other, default in iteritems(configurable.default_config):
            params[other] = kwargs.get(other, config.get(other, default))
        for other in getattr(configurable, 'services', []):
            # AutoConfigured.check_config() validates that this key
            # wasn't in the global config, so this must have come from
            # either our own config parameter, a keyword arg, or the
            # caller setting factory.config; trust those paths.
            if other == 'config':
                params[other] = dict(config, **kwargs)
            elif other in kwargs:
                params[other] = kwargs[other]
            elif other in config:
                params[other] = config[other]
            else:
                # We're not catching an `AttributeError` exception
                # here because it may case a net too wide which makes
                # debugging underlying errors more difficult.
                params[other] = getattr(self, other)
        return configurable(**params)