<commit_before>import logging, time, uuid, requests
from pysnap import make_request_token, Snapchat
from snap import Snap
from constants import DEFAULT_TIMEOUT, STATIC_TOKEN, BASE_URL
from utils import save_snap

FORMAT = '[%(asctime)-15s] %(message)s'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger()
logger.level = logging.DEBUG

class SnapchatBot(object):
    def __init__(self, username, password, **kwargs):
        self.bot_id = uuid.uuid4().hex[0:4]

        self.auth_token = STATIC_TOKEN

        self.username = username
        self.password = password

        r = self._make_request("/loq/login", {
            'username': self.username,
            'password': <PASSWORD>
        })

        result = r.json()
        self.auth_token = result['updates_response']['auth_token']

        self.client = Snapchat()
        self.client.username = username
        self.client.auth_token = auth_token

        self.current_friends = self.get_friends()
        self.added_me = self.get_added_me()

        if hasattr(self, "initialize"):
            self.initialize(**kwargs)

    def log(self, message, level=logging.DEBUG):
        logger.log(level, "[%s-%s] %s" % (self.__class__.__name__, self.bot_id, message))

    @staticmethod
    def process_snap(snap_obj, data):<commit_msg>login works again re: #26<commit_after>import logging, time, uuid, requests
from pysnap import Snapchat
from pysnap.utils import make_request_token, timestamp
from snap import Snap
from constants import DEFAULT_TIMEOUT, STATIC_TOKEN, BASE_URL
from utils import save_snap

FORMAT = '[%(asctime)-15s] %(message)s'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger()
logger.level = logging.DEBUG

class SnapchatBot(object):
    def __init__(self, username, password, **kwargs):
        self.bot_id = uuid.uuid4().hex[0:4]

        self.auth_token = STATIC_TOKEN

        self.username = username
        self.password = password

        r = self._make_request("/loq/login", {
            'username': self.username,
            'password': <PASSWORD>
        })

        result = r.json()
        self.auth_token = result['updates_response']['auth_token']

        self.client = Snapchat()
        self.client.username = username
        self.client.auth_token = self.auth_token

        self.current_friends = self.get_friends()
        self.added_me = self.get_added_me()

        if hasattr(self, "initialize"):
            self.initialize(**kwargs)

    def log(self, message, level=logging.DEBUG):
        logger.log(level, "[%s-%s] %s" % (self.__class__.__name__, self.bot_id, message))

    @staticmethod
    def process_snap(snap_obj, data):
{'fraction_non_alphanumeric': 0.11861861861861862, 'fraction_numerical': 0.0045045045045045045, 'mean_word_length': 3.1190108191653785, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6160306', 'n_tokens_mistral': 826, 'n_tokens_neox': 799, 'n_words': 177}