code: def di(self, func):
          
          func_name = func.__name__
          if func_name in self.exts:
              raise DuplicatedExtension
          self.exts[func_name] = func
          return func
docs: Decorator `@di`.