code: def add_component(self, alias: str, type: Union[str, type] = None, **config):
          
          assert check_argument_types()
          if not isinstance(alias, str) or not alias:
              raise TypeError('component_alias must be a nonempty string')
          if alias in self.child_components:
              raise ValueError('there is already a child component named "{}"'.format(alias))
  
          config['type'] = type or alias
  
          # Allow the external configuration to override the constructor arguments
          override_config = self.component_configs.get(alias) or {}
          config = merge_config(config, override_config)
  
          component = component_types.create_object(**config)
          self.child_components[alias] = component
docs: Add a child component.
  
          This will instantiate a component class, as specified by the ``type`` argument.
  
          If the second argument is omitted, the value of ``alias`` is used as its value.
  
          The locally given configuration can be overridden by component configuration parameters
          supplied to the constructor (via the ``components`` argument).
  
          When configuration values are provided both as keyword arguments to this method and
          component configuration through the ``components`` constructor argument, the configurations
          are merged together using :func:`~asphalt.core.util.merge_config` in a way that the
          configuration values from the ``components`` argument override the keyword arguments to
          this method.
  
          :param alias: a name for the component instance, unique within this container
          :param type: entry point name or :class:`Component` subclass or a ``module:varname``
              reference to one
          :param config: keyword arguments passed to the component's constructor