code: def register(self, func, singleton=False, threadlocal=False, name=None):
          
          func._giveme_singleton = singleton
          func._giveme_threadlocal = threadlocal
  
          if name is None:
              name = func.__name__
          self._registered[name] = func
          return func
docs: Register a dependency function