code: def new_plugin(self, config, *args, **kwargs):
          
          typ = None
          obj = None
  
          # if type is defined, create a new instance
          if 'type' in config:
              typ = config['type']
  
          # single key is overriding an existing plugin instance
          elif isinstance(config, collections.Mapping) and len(config) == 1:
              # get type name and shift out config to parent level
              (typ, config) = list(config.items())[0]
  
          obj = self._ctor(typ, config, *args, **kwargs)
  
          # store if named
          if 'name' in config:
              self._instance[config['name']] = obj
          else:
              # this could dupe on .name, make name=''?
              config['name'] = typ
  
          return obj
docs: instantiate a plugin
          creates the object, stores it in _instance