<commit_before># coding=utf-8
"""
HTTP Client Library Adapters

"""
from abc import ABCMeta, abstractmethod

import requests
import requests.exceptions

from hvac import utils
from hvac.constants.client import *


class Adapter(object):
    """Abstract base class used when constructing adapters for use with the Client class."""

    __metaclass__ = ABCMeta

    def __init__(self, base_uri=DEFAULT_BASE_URI, token=None,
                 cert='\n'.join([VAULT_CLIENT_CERT, VAULT_CLIENT_KEY]) if VAULT_CLIENT_CERT else None,
                 verify=VAULT_CACERT if VAULT_CACERT else VAULT_CAPATH if VAULT_CAPATH else True, timeout=30,
                 proxies=None, allow_redirects=True, session=None, namespace=None, ignore_exceptions=False,
                 strict_http=False):
        """Create a new request adapter instance.

        :param base_uri: Base URL for the Vault instance being addressed.
        :type base_uri: str
        :param token: Authentication token to include in requests sent to Vault.
        :type token: str
        :param cert: Certificates for use in requests sent to the Vault instance. This should be a tuple with the
            certificate and then key.
        :type cert: tuple
        :param verify: Either a boolean to indicate whether TLS verification should be performed when sending requests to Vault,
            or a string pointing at the CA bundle to use for verification. See http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification.
        :type verify: Union[bool,str]
        :param timeout: The timeout value for requests sent to Vault.
        :type timeout: int
        :param proxies: Proxies to use when preforming requests.
            See: http://docs.python-requests.org/en/master/user/advanced/#proxies
        :type proxies: dict
        :param allow_redirects: Whether to follow redirects when sending requests to Vault.
        :type allow_redirects: bool<commit_msg>Move new cert-related logic out of adapters / constants<commit_after># coding=utf-8
"""
HTTP Client Library Adapters

"""
from abc import ABCMeta, abstractmethod

import requests
import requests.exceptions

from hvac import utils
from hvac.constants.client import DEFAULT_BASE_URI


class Adapter(object):
    """Abstract base class used when constructing adapters for use with the Client class."""

    __metaclass__ = ABCMeta

    def __init__(self, base_uri=DEFAULT_BASE_URI, token=None, cert=None, verify=True, timeout=30, proxies=None,
                 allow_redirects=True, session=None, namespace=None, ignore_exceptions=False, strict_http=False):
        """Create a new request adapter instance.

        :param base_uri: Base URL for the Vault instance being addressed.
        :type base_uri: str
        :param token: Authentication token to include in requests sent to Vault.
        :type token: str
        :param cert: Certificates for use in requests sent to the Vault instance. This should be a tuple with the
            certificate and then key.
        :type cert: tuple
        :param verify: Either a boolean to indicate whether TLS verification should be performed when sending requests to Vault,
            or a string pointing at the CA bundle to use for verification. See http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification.
        :type verify: Union[bool,str]
        :param timeout: The timeout value for requests sent to Vault.
        :type timeout: int
        :param proxies: Proxies to use when preforming requests.
            See: http://docs.python-requests.org/en/master/user/advanced/#proxies
        :type proxies: dict
        :param allow_redirects: Whether to follow redirects when sending requests to Vault.
        :type allow_redirects: bool
{'fraction_non_alphanumeric': 0.06894722885176346, 'fraction_numerical': 0.0015910898965791568, 'mean_word_length': 3.1224043715846994, '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': '60598', 'n_tokens_mistral': 1008, 'n_tokens_neox': 984, 'n_words': 392}