<commit_before>from requests import get
from requests.auth import HTTPBasicAuth
from src.settings import DBAAS_URL, DBAAS_USER, DBAAS_PASSWORD, \
    DBAAS_HTTPS_VERIFY


class DBaaS(object):

    def __init__(self):
        self._base_auth = HTTPBasicAuth(DBAAS_USER, DBAAS_PASSWORD)
        self._verify = DBAAS_HTTPS_VERIFY

    def api_get(self, endpoint):
        final_url = '{}/api/{}'.format(DBAAS_URL, endpoint)
        return get(final_url, auth=self._base_auth, verify=self._verify)

    def latest_tasks(self, page_size=100):
        tasks_url = 'task/?ordering=-id&page_size={}'.format(page_size)
        response = self.api_get(tasks_url)
        content = response.json()

        tasks = []
        for task in content['taskhistory']:
            tasks.append(Task(task))
        return tasks

    def build_task_link(self, task_id):
        return '{}/admin/notification/taskhistory/?task_id={}'.format(
            DBAAS_URL, task_id
        )


class Task(object):

    STATUS_ERROR = 'ERROR'
    DBAAS_TASK_URL = '{}/admin/notification/taskhistory/{}'
    OBJ_CLASS_DATABASE = 'logical_database'

    def __init__(self, api_content):
        self.id = api_content['id']
        self.executor_id = api_content['task_id']
        self.status = api_content['task_status']<commit_msg>Removing useless code<commit_after>from requests import get
from requests.auth import HTTPBasicAuth
from src.settings import DBAAS_URL, DBAAS_USER, DBAAS_PASSWORD, \
    DBAAS_HTTPS_VERIFY


class DBaaS(object):

    def __init__(self):
        self._base_auth = HTTPBasicAuth(DBAAS_USER, DBAAS_PASSWORD)
        self._verify = DBAAS_HTTPS_VERIFY

    def api_get(self, endpoint):
        final_url = '{}/api/{}'.format(DBAAS_URL, endpoint)
        return get(final_url, auth=self._base_auth, verify=self._verify)

    def latest_tasks(self, page_size=100):
        tasks_url = 'task/?ordering=-id&page_size={}'.format(page_size)
        response = self.api_get(tasks_url)
        content = response.json()

        tasks = []
        for task in content['taskhistory']:
            tasks.append(Task(task))
        return tasks


class Task(object):

    STATUS_ERROR = 'ERROR'
    DBAAS_TASK_URL = '{}/admin/notification/taskhistory/{}'
    OBJ_CLASS_DATABASE = 'logical_database'

    def __init__(self, api_content):
        self.id = api_content['id']
        self.executor_id = api_content['task_id']
        self.status = api_content['task_status']
{'fraction_non_alphanumeric': 0.11323828920570264, 'fraction_numerical': 0.002443991853360489, 'mean_word_length': 3.271304347826087, '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': '80013', 'n_tokens_mistral': 827, 'n_tokens_neox': 796, 'n_words': 144}