<commit_before># -*- coding: utf-8 -*-
import logging
import socket
import sys
import time
from abc import ABCMeta, abstractmethod, abstractproperty
from httplib import BadStatusLine
from ssl import SSLError

from requests.exceptions import ConnectionError

from .models import AccessToken, AccessTokenGettingError, AccessTokenRefreshingError

__all__ = ['NoActiveTokens', 'ApiAbstractBase', 'Singleton']


class NoActiveTokens(Exception):
    pass


class ApiAbstractBase(object):
    __metaclass__ = ABCMeta

    consistent_token = None
    error_class = Exception
    error_class_repeat = (SSLError, ConnectionError, socket.error, BadStatusLine)
    sleep_repeat_error_messages = []

    recursion_count = 0

    method = None
    token_tag = None
    token_tag_arg_name = 'methods_access_tag'
    used_access_tokens = None

    update_tokens_max_count = 5
    refresh_tokens_max_count = 5

    def __init__(self):
        self.used_access_tokens = []
        self.consistent_token = self.get_consistent_token()
        self.logger = self.get_logger()
        self.api = None
<commit_msg>new error_class_repeat value<commit_after># -*- coding: utf-8 -*-
import logging
import socket
import sys
import time
from abc import ABCMeta, abstractmethod, abstractproperty
from httplib import BadStatusLine, ResponseNotReady
from ssl import SSLError

from requests.exceptions import ConnectionError

from .models import AccessToken, AccessTokenGettingError, AccessTokenRefreshingError

__all__ = ['NoActiveTokens', 'ApiAbstractBase', 'Singleton']


class NoActiveTokens(Exception):
    pass


class ApiAbstractBase(object):
    __metaclass__ = ABCMeta

    consistent_token = None
    error_class = Exception
    error_class_repeat = (SSLError, ConnectionError, socket.error, BadStatusLine, ResponseNotReady)
    sleep_repeat_error_messages = []

    recursion_count = 0

    method = None
    token_tag = None
    token_tag_arg_name = 'methods_access_tag'
    used_access_tokens = None

    update_tokens_max_count = 5
    refresh_tokens_max_count = 5

    def __init__(self):
        self.used_access_tokens = []
        self.consistent_token = self.get_consistent_token()
        self.logger = self.get_logger()
        self.api = None

{'fraction_non_alphanumeric': 0.06896551724137931, 'fraction_numerical': 0.0035826242722794446, 'mean_word_length': 4.159353348729792, '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': '2805594', 'n_tokens_mistral': 665, 'n_tokens_neox': 642, 'n_words': 162}