<commit_before># coding: utf-8
import re
import logging
import time
import functools

import httpbroker
import exceptions


logger = logging.getLogger(__name__)

ITEMS_PER_REQUEST = 50
API_VERSIONS = ('v1',)


class Connector(object):
    """
    Encapsulates the HTTP requests layer.

    :param username: valid username that has access to manager.scielo.org.
    :param api_key: its respective api key.
    :param api_uri: (optional) if connecting to a non official instance of `SciELO Manager <https://github.com/scieloorg/SciELO-Manager>`_
    :param version: (optional) by default the newest version is used.
    :param http_broker: (optional) a module to deal with http stuff. The reference API is implemented at :module:`httpbroker`.
    """
    # caches endpoints definitions
    _cache = {}

    def __init__(self,
                 username,
                 api_key,
                 api_uri=None,
                 version=None,
                 http_broker=None):
        # dependencies
        self._time = time

        if http_broker:
            _httpbroker = http_broker
        else:
            _httpbroker = httpbroker  # module

        # setup
        self._create_http_methods(_httpbroker, username, api_key)
        self.api_uri = api_uri if api_uri else r'http://manager.scielo.org/api/'

        if version :
            if version in API_VERSIONS:
                self.version = version
            else:
                raise ValueError('unsupported api version. supported are: %s' % ', '.join(API_VERSIONS))
        else:
            self.version = sorted(API_VERSIONS)[-1]<commit_msg>Fixing module inline markup<commit_after># coding: utf-8
import re
import logging
import time
import functools

import httpbroker
import exceptions


logger = logging.getLogger(__name__)

ITEMS_PER_REQUEST = 50
API_VERSIONS = ('v1',)


class Connector(object):
    """
    Encapsulates the HTTP requests layer.

    :param username: valid username that has access to manager.scielo.org.
    :param api_key: its respective api key.
    :param api_uri: (optional) if connecting to a non official instance of `SciELO Manager <https://github.com/scieloorg/SciELO-Manager>`_
    :param version: (optional) by default the newest version is used.
    :param http_broker: (optional) a module to deal with http stuff. The reference API is implemented at :mod:`scieloapi.httpbroker`.
    """
    # caches endpoints definitions
    _cache = {}

    def __init__(self,
                 username,
                 api_key,
                 api_uri=None,
                 version=None,
                 http_broker=None):
        # dependencies
        self._time = time

        if http_broker:
            _httpbroker = http_broker
        else:
            _httpbroker = httpbroker  # module

        # setup
        self._create_http_methods(_httpbroker, username, api_key)
        self.api_uri = api_uri if api_uri else r'http://manager.scielo.org/api/'

        if version :
            if version in API_VERSIONS:
                self.version = version
            else:
                raise ValueError('unsupported api version. supported are: %s' % ', '.join(API_VERSIONS))
        else:
            self.version = sorted(API_VERSIONS)[-1]
{'fraction_non_alphanumeric': 0.0816137973514013, 'fraction_numerical': 0.003079765937788728, 'mean_word_length': 2.2974619289340104, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6237221', 'n_tokens_mistral': 932, 'n_tokens_neox': 906, 'n_words': 274}