<commit_before>"""
KnackHQ Application Client.
"""
import collections
import json
import os

import requests
from . import exc


# pylint: disable=too-few-public-methods,abstract-method,no-init
class KnackIterable(collections.Iterable):
    """ Base KnackHQ Iterable Python object. """
    def __repr__(self):
        return "{cls}({self})".format(cls=type(self).__name__, self=self)


# pylint: disable=too-few-public-methods,abstract-method,no-init
class KnackMapping(collections.Mapping):
    """ Base KnackHQ Mapping Python object. """
    def __repr__(self):
        return "{cls}({self})".format(cls=type(self).__name__, self=self)


class KnackApp(KnackMapping):
    """ KnackHQ Application.

        Use arguments or ENV variables to initialize client.

        Optional ENV variables are:
            * KNACKHQ_APP_ID
            * KNACKHQ_API_KEY
            * KNACKHQ_ENDPOINT

        Arguments:
            app_id   (str):  Application ID string
            api_key  (str):  API key
            endpoint (str):  KnackHQ endpoint
    """
    APP_ID = os.getenv('KNACKHQ_APP_ID')
    API_KEY = os.getenv('KNACKHQ_API_KEY')
    ENDPOINT = os.getenv('KNACKHQ_ENDPOINT', 'https://api.knackhq.com/v1')

    # pylint: disable=super-init-not-called<commit_msg>use collections.abc<commit_after>"""
KnackHQ Application Client.
"""
import json
import os
from collections import abc

import requests
from . import exc


# pylint: disable=too-few-public-methods,abstract-method,no-init
class KnackIterable(abc.Iterable):
    """ Base KnackHQ Iterable Python object. """
    def __repr__(self):
        return "{cls}({self})".format(cls=type(self).__name__, self=self)


# pylint: disable=too-few-public-methods,abstract-method,no-init
class KnackMapping(abc.Mapping):
    """ Base KnackHQ Mapping Python object. """
    def __repr__(self):
        return "{cls}({self})".format(cls=type(self).__name__, self=self)


class KnackApp(KnackMapping):
    """ KnackHQ Application.

        Use arguments or ENV variables to initialize client.

        Optional ENV variables are:
            * KNACKHQ_APP_ID
            * KNACKHQ_API_KEY
            * KNACKHQ_ENDPOINT

        Arguments:
            app_id   (str):  Application ID string
            api_key  (str):  API key
            endpoint (str):  KnackHQ endpoint
    """
    APP_ID = os.getenv('KNACKHQ_APP_ID')
    API_KEY = os.getenv('KNACKHQ_API_KEY')
    ENDPOINT = os.getenv('KNACKHQ_ENDPOINT', 'https://api.knackhq.com/v1')

    # pylint: disable=super-init-not-called
{'fraction_non_alphanumeric': 0.11981020166073547, 'fraction_numerical': 0.0007908264136022143, 'mean_word_length': 3.1407528641571196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6156196', 'n_tokens_mistral': 862, 'n_tokens_neox': 804, 'n_words': 172}