from datetime import datetime

from gevent.lock import RLock

STATS = {
    "started_on": datetime.utcnow(),
}
lock = RLock()


class State(object):
    def __init__(self):
        self.channels = {}
        self.connections = {}
        self.users = {}
        self.stats = {
            "total_messages": 0,
            "total_unique_messages": 0
        }
        self.lock = RLock()


STATES = {"0": State()}


def get_state(tenant_id="0"):
    """
    Grabs right state for specific tenant
    :param tenant_id:
    :return:
    """
    return STATES[tenant_id]

@@ -64,21 +64,16 @@
 TATS = %7B
-%0A    
 %22started
@@ -95,18 +95,16 @@
 utcnow()
-,%0A
 %7D%0Alock =
@@ -262,29 +262,16 @@
 tats = %7B
-%0A            
 %22total_m
@@ -286,20 +286,8 @@
 : 0,
-%0A           
  %22to
@@ -309,25 +309,16 @@
 ages%22: 0
-%0A        
 %7D%0A      

fix black