<commit_before>import discord, asyncio, collections, datetime, os, json
from search import bs_search
from tzlocal import get_localzone as glz

class bs_timer:
    def __init__( self, timeout, callback ):
        self.timeout = timeout
        self.callback = callback
        self.task = asyncio.ensure_future( self.job() )
        
    async def job( self ):
        await asyncio.sleep( self.timeout )
        await self.callback()
        return
        
    async def cancel( self ):
        self.task.cancel()
        return

class bs_user:
    def __init__( self, user ):
        self.user = user
        self.state = user.status
        self.last = datetime.datetime.now().astimezone( glz() )
    
class bs_server:
    def __init__( self, client, server, max_time, max_msg ):
        self.mode = None
        self.busy = False
        self.me = server
        self.client = client
        self.results = {}
        self.msg_q = collections.deque()
        self.cmd_q = collections.deque()
        self.helper = None
        self.server = server
        self.timer = None
        self.msg_lim = max_msg
        self.max_time = max_time
        self.users = {}
        self.game = None
        for m in server.members:
            self.users[int(m.id)] = bs_user( m )
        self.load_auth( "./authorized.json" )
    
    def load_auth( self, auth_file ):
        path = os.path.dirname( os.path.realpath( __file__ ) )
        with open( auth_file, 'r' ) as f:
            auth_data = json.load( f )
        self.auth = {}
        if self.me.id in auth_data:
            for e in auth_data[self.me.id]:
                self.auth[e] = auth_data[self.me.id][e]
        return
        
    def get_auth( self, user ):
        if int(user.id) in self.auth:
            return self.auth[int(user.id)]
        else:
            return None
    
    def queue_msg( self, msg ):
        if len( self.msg_q ) >= self.msg_lim:
            self.msg_q.popleft()
        self.msg_q.append( msg )
        return
    
    def queue_cmd( self, msg ):
        if len( self.cmd_q ) >= self.msg_lim:
            self.cmd_q.popleft()
        self.cmd_q.append( msg )
        return
    
    async def reset( self ):
        self.mode = None
        self.busy = False<commit_msg>fixing changes to auth storage (using strings instead of itns)<commit_after>import discord, asyncio, collections, datetime, os, json
from search import bs_search
from tzlocal import get_localzone as glz

class bs_timer:
    def __init__( self, timeout, callback ):
        self.timeout = timeout
        self.callback = callback
        self.task = asyncio.ensure_future( self.job() )
        
    async def job( self ):
        await asyncio.sleep( self.timeout )
        await self.callback()
        return
        
    async def cancel( self ):
        self.task.cancel()
        return

class bs_user:
    def __init__( self, user ):
        self.user = user
        self.state = user.status
        self.last = datetime.datetime.now().astimezone( glz() )
    
class bs_server:
    def __init__( self, client, server, max_time, max_msg ):
        self.mode = None
        self.busy = False
        self.me = server
        self.client = client
        self.results = {}
        self.msg_q = collections.deque()
        self.cmd_q = collections.deque()
        self.helper = None
        self.server = server
        self.timer = None
        self.msg_lim = max_msg
        self.max_time = max_time
        self.users = {}
        self.game = None
        for m in server.members:
            self.users[int(m.id)] = bs_user( m )
        self.load_auth( "./authorized.json" )
    
    def load_auth( self, auth_file ):
        path = os.path.dirname( os.path.realpath( __file__ ) )
        with open( auth_file, 'r' ) as f:
            auth_data = json.load( f )
        self.auth = {}
        if self.me.id in auth_data:
            for e in auth_data[self.me.id]:
                self.auth[e] = auth_data[self.me.id][e]
        return
        
    def get_auth( self, user ):
        if user.id in self.auth:
            return self.auth[user.id]
        else:
            return None
    
    def queue_msg( self, msg ):
        if len( self.msg_q ) >= self.msg_lim:
            self.msg_q.popleft()
        self.msg_q.append( msg )
        return
    
    def queue_cmd( self, msg ):
        if len( self.cmd_q ) >= self.msg_lim:
            self.cmd_q.popleft()
        self.cmd_q.append( msg )
        return
    
    async def reset( self ):
        self.mode = None
        self.busy = False
{'fraction_non_alphanumeric': 0.10247427195095249, 'fraction_numerical': 0.0, 'mean_word_length': 1.7255369928400954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4835731', 'n_tokens_mistral': 1423, 'n_tokens_neox': 1409, 'n_words': 364}