code: def singleton_per_scope(_cls, _scope=None, _renew=False, *args, **kwargs):
      
  
      result = None
  
      singletons = SINGLETONS_PER_SCOPES.setdefault(_scope, {})
  
      if _renew or _cls not in singletons:
          singletons[_cls] = _cls(*args, **kwargs)
  
      result = singletons[_cls]
  
      return result
docs: Instanciate a singleton per scope.