<commit_before>"""Handle transactions endpoints."""
from .apirequest import APIRequest, dyndoc_insert, get_endpoint_config

responses = {}

# op flags
TRANSACTION_LIST = 1
TRANSACTION_DETAILS = 2
TRANSACTION_IDRANGE = 4
TRANSACTION_SINCEID = 8

endp_conf = {
    TRANSACTION_LIST: {"path_comp": None, "method": "GET"},
    TRANSACTION_DETAILS: {"path_comp": None, "method": "GET"},
    TRANSACTION_IDRANGE: {"path_comp": "idrange", "method": "GET"},
    TRANSACTION_SINCEID: {"path_comp": "sinceid", "method": "GET"},
}


class Transactions(APIRequest):
    """Transactions - class to handle the transaction endpoints."""

    ENDPOINT = "/v3/accounts/{accountID}/transactions"

    @dyndoc_insert(responses)
    def __init__(self, accountID, transactionID=None, op=None):
        """Instantiate a Transactions APIRequest instance.

        Parameters
        ----------
        accountID : string (required)
            the id of the account.

        transactionID : string
            the id of the transaction

        op : operation flag (required)
            this flag acts as task identifier. It is used to construct the API
            endpoint and determine the HTTP method for the request.

            Possible flags::

                TRANSACTION_LIST
                TRANSACTION_DETAILS
                TRANSACTION_IDRANGE
                TRANSACTION_SINCEID
        """
        endpoint = self.ENDPOINT
        method, path_comp = get_endpoint_config(endp_conf, op)

        if op in [TRANSACTION_DETAILS]:
            endpoint = "{}/{{transactionID}}".format(endpoint)<commit_msg>ENDPOINT: relative instead of absolute<commit_after>"""Handle transactions endpoints."""
from .apirequest import APIRequest, dyndoc_insert, get_endpoint_config

responses = {}

# op flags
TRANSACTION_LIST = 1
TRANSACTION_DETAILS = 2
TRANSACTION_IDRANGE = 4
TRANSACTION_SINCEID = 8

endp_conf = {
    TRANSACTION_LIST: {"path_comp": None, "method": "GET"},
    TRANSACTION_DETAILS: {"path_comp": None, "method": "GET"},
    TRANSACTION_IDRANGE: {"path_comp": "idrange", "method": "GET"},
    TRANSACTION_SINCEID: {"path_comp": "sinceid", "method": "GET"},
}


class Transactions(APIRequest):
    """Transactions - class to handle the transaction endpoints."""

    ENDPOINT = "v3/accounts/{accountID}/transactions"

    @dyndoc_insert(responses)
    def __init__(self, accountID, transactionID=None, op=None):
        """Instantiate a Transactions APIRequest instance.

        Parameters
        ----------
        accountID : string (required)
            the id of the account.

        transactionID : string
            the id of the transaction

        op : operation flag (required)
            this flag acts as task identifier. It is used to construct the API
            endpoint and determine the HTTP method for the request.

            Possible flags::

                TRANSACTION_LIST
                TRANSACTION_DETAILS
                TRANSACTION_IDRANGE
                TRANSACTION_SINCEID
        """
        endpoint = self.ENDPOINT
        method, path_comp = get_endpoint_config(endp_conf, op)

        if op in [TRANSACTION_DETAILS]:
            endpoint = "{}/{{transactionID}}".format(endpoint)
{'fraction_non_alphanumeric': 0.1013681592039801, 'fraction_numerical': 0.003109452736318408, 'mean_word_length': 2.7406976744186045, 'pattern_counts': {'":': 16, '<': 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': '3851885', 'n_tokens_mistral': 961, 'n_tokens_neox': 899, 'n_words': 249}