<commit_before>"""
Deuce API
"""
import datetime
import json
import requests
import logging
from urllib.parse import urlparse, parse_qs

import msgpack
from stoplight import validate

import deuceclient.api.afile as api_file
import deuceclient.api.block as api_block
import deuceclient.api.blocks as api_blocks
import deuceclient.api.storageblocks as api_storageblocks
import deuceclient.api.vault as api_vault
import deuceclient.api.v1 as api_v1
from deuceclient.common.command import Command
from deuceclient.common.validation import *
from deuceclient.common.validation_instance import *
from deuceclient.utils.misc import set_qs_on_url


# Until urllib3 fixes its SSL warnings...
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()


class DeuceClient(Command):

    """
    Object defining HTTP REST API calls for interacting with Deuce.
    """

    def __init__(self, authenticator, apihost, sslenabled=False):
        """Initialize the Deuce Client access

        :param authenticator: instance of deuceclient.auth.Authentication
                              to use for retrieving auth tokens<commit_msg>Enhancement: Capture Warnings to the log<commit_after>"""
Deuce API
"""
import datetime
import json
import requests
import logging
from urllib.parse import urlparse, parse_qs

import msgpack
from stoplight import validate

import deuceclient.api.afile as api_file
import deuceclient.api.block as api_block
import deuceclient.api.blocks as api_blocks
import deuceclient.api.storageblocks as api_storageblocks
import deuceclient.api.vault as api_vault
import deuceclient.api.v1 as api_v1
from deuceclient.common.command import Command
from deuceclient.common.validation import *
from deuceclient.common.validation_instance import *
from deuceclient.utils.misc import set_qs_on_url


# So that we can simply capture the Security warnings
# generated by requests.urllib3....
logging.captureWarnings(True)


class DeuceClient(Command):

    """
    Object defining HTTP REST API calls for interacting with Deuce.
    """

    def __init__(self, authenticator, apihost, sslenabled=False):
        """Initialize the Deuce Client access

        :param authenticator: instance of deuceclient.auth.Authentication
                              to use for retrieving auth tokens
{'fraction_non_alphanumeric': 0.05895101863892501, 'fraction_numerical': 0.0034677069787602947, 'mean_word_length': 4.37995337995338, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5972768', 'n_tokens_mistral': 647, 'n_tokens_neox': 628, 'n_words': 212}