<commit_before>import requests
import json
from yoci.utils import import_config

USER_AGENT = 'MyClient/1.0.0'
ACCEPT = 'application/vnd.travis-ci.2+json'
LOG_ACCEPT = 'text/plain'
HEADERS = {'Accept': ACCEPT, 'User-Agent': USER_AGENT}
LOG_HEADERS = {
    'Accept': LOG_ACCEPT,
    'User-Agent': USER_AGENT
}

DEFAULT_CONFIG_PATH = '/home/adaml/.travis-config.yml'

C = import_config(DEFAULT_CONFIG_PATH)['Travis']


def get_token(lgr, auth_url, hs_url, token):
    lgr.debug('requesting for auth token from: {} with token: {}'.format(
        auth_url, token))
    r_token = requests.post(auth_url, data={'github_token': token})
    if r_token.status_code == requests.codes.NOT_FOUND:
        raise AttributeError("token problem")
    lgr.debug('token is: {}'.format(r_token.json()['access_token']))
    return json.loads(r_token.content)
    r_hs = requests.get(hs_url)
    if r_hs.status_code == requests.codes.NOT_FOUND:
        raise AttributeError("token problem2")


def default_props(func):
    def inner(*args, **kwargs):
        c = kwargs.get('c', None)
        # if config is given, use it, if not, use default
        c = c if c else C
        kwargs.update({'c': c})<commit_msg>changed default config path<commit_after>import requests
import json
from yoci.utils import import_config

USER_AGENT = 'MyClient/1.0.0'
ACCEPT = 'application/vnd.travis-ci.2+json'
LOG_ACCEPT = 'text/plain'
HEADERS = {'Accept': ACCEPT, 'User-Agent': USER_AGENT}
LOG_HEADERS = {
    'Accept': LOG_ACCEPT,
    'User-Agent': USER_AGENT
}

DEFAULT_CONFIG_PATH = '../config.yml'

C = import_config(None)['Travis']


def get_token(lgr, auth_url, hs_url, token):
    lgr.debug('requesting for auth token from: {} with token: {}'.format(
        auth_url, token))
    r_token = requests.post(auth_url, data={'github_token': token})
    if r_token.status_code == requests.codes.NOT_FOUND:
        raise AttributeError("token problem")
    lgr.debug('token is: {}'.format(r_token.json()['access_token']))
    return json.loads(r_token.content)
    r_hs = requests.get(hs_url)
    if r_hs.status_code == requests.codes.NOT_FOUND:
        raise AttributeError("token problem2")


def default_props(func):
    def inner(*args, **kwargs):
        c = kwargs.get('c', None)
        # if config is given, use it, if not, use default
        c = c if c else C
        kwargs.update({'c': c})
{'fraction_non_alphanumeric': 0.14116652578191038, 'fraction_numerical': 0.00422654268808115, 'mean_word_length': 3.8109756097560976, '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': '2060187', 'n_tokens_mistral': 822, 'n_tokens_neox': 824, 'n_words': 186}