Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __new__(cls, *args, **kwargs):
# override method to implement singleton
# source: http://alacret.blogspot.com/2015/04/python-thread-safe-singleton-pattern.html
if Request._instance is None:
with Request._lock:
if Request._instance is None:
Request._instance = super(Request, cls).__new__(cls)
return Request._instance