<commit_before>import os

try:
    import cPickle as pickle
except:
    import pickle

SETTINGS_PATH = os.path.abspath(os.path.expanduser("~/.cshare"))

class GDataFacade(object):
    def __init__(self, wrapped):
        self._api = wrapped
        self._autenticator = None
        self._auth_url = None
        self._auth_token = None
        self._token_path = os.path.join(SETTINGS_PATH, "token.dat")

        self._create_user_settings()

    def _create_user_settings(self):
        #TODO this isn't portable, use ENVIRON!
        if not os.path.exists(SETTINGS_PATH):
            os.mkdir(SETTINGS_PATH)

    def get_access_url(self):
        self._autenticator = self._api.create_auth()
        self._auth_url = self._autenticator.next()
        return self._auth_url

    def get_auth(self):
        self._auth_token = self._autenticator.next()
        self.store_credential()
        return self._auth_token

    def store_credential(self):
        with open(self._token_path, "w") as token_file:
            pickle.dump(self._auth_token, token_file)

    def login(self):
        if self._auth_token is None:
            with open(self._token_path) as token_file:
                self._auth_token = pickle.load(token_file)
        self._api.login(self._auth_token)
<commit_msg>Refactoring: Changed a variable name to a more fitting one<commit_after>import os

try:
    import cPickle as pickle
except:
    import pickle

SETTINGS_PATH = os.path.abspath(os.path.expanduser("~/.cshare"))

class GDataFacade(object):
    def __init__(self, accessor):
        self._api = accessor
        self._authenticator = None
        self._auth_url = None
        self._auth_token = None
        self._token_path = os.path.join(SETTINGS_PATH, "token.dat")

        self._create_user_settings()

    def _create_user_settings(self):
        #TODO this isn't portable, use ENVIRON!
        if not os.path.exists(SETTINGS_PATH):
            os.mkdir(SETTINGS_PATH)

    def get_access_url(self):
        self._authenticator = self._api.create_auth()
        self._auth_url = self._authenticator.next()
        return self._auth_url

    def get_auth(self):
        self._auth_token = self._authenticator.next()
        self.store_credential()
        return self._auth_token

    def store_credential(self):
        with open(self._token_path, "w") as token_file:
            pickle.dump(self._auth_token, token_file)

    def login(self):
        if self._auth_token is None:
            with open(self._token_path) as token_file:
                self._auth_token = pickle.load(token_file)
        self._api.login(self._auth_token)

{'fraction_non_alphanumeric': 0.09554625047582795, 'fraction_numerical': 0.0, 'mean_word_length': 2.6298342541436464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3811257', 'n_tokens_mistral': 846, 'n_tokens_neox': 829, 'n_words': 165}