code: def add(app: web.Application,
          feature: Any,
          key: Hashable = None,
          exist_ok: bool = False
          ):
      
      if FEATURES_KEY not in app:
          app[FEATURES_KEY] = dict()
  
      key = key or type(feature)
  
      if key in app[FEATURES_KEY]:
          if exist_ok:
              return
          else:
              raise KeyError(f'Feature "{key}" already registered')
  
      app[FEATURES_KEY][key] = feature
docs: Adds a new feature to the app.
  
      Features can either be registered as the default feature for the class,
      or be given an explicit name.
  
      Args:
          app (web.Application):
              The current Aiohttp application.
  
          feature (Any):
              The new feature that should be registered.
              It is recommended, but not required to use a `ServiceFeature`.
  
          key (Hashable, optional):
              The key under which the feature should be registered.
              Defaults to `type(feature)`.
  
          exist_ok (bool):
              If truthy, this function will do nothing if a feature was already registered for `key`.
              Otherwise, an exception is raised.