code: def cache(self, dependency: Dependency, value):
          
          if dependency.threadlocal:
              setattr(self._local, dependency.name, value)
          elif dependency.singleton:
              self._singleton[dependency.name] = value
docs: Store an instance of dependency in the cache.
          Does nothing if dependency is NOT a threadlocal
          or a singleton.  
  
          :param dependency: The ``Dependency`` to cache
          :param value: The value to cache for dependency
  
          :type dependency: Dependency