<commit_before># -*- coding: utf-8 -*-
"""
h2/config
~~~~~~~~~

Objects for controlling the configuration of the HTTP/2 stack.
"""


class H2Configuration(object):
    """
    An object that controlls the way a single HTTP/2 connection behaves.

    This object allows the users to customize behaviour. In particular, it
    allows users to enable or disable optional features, or to otherwise handle
    various unusual behaviours.

    This object has very little behaviour of its own: it mostly just ensures
    that configuration is self-consistent.
    """
    def __init__(self):
        self._client_side = True
        self._header_encoding = 'utf-8'

    @property
    def client_side(self):
        """
        Whether this object is to be used on the client side of a connection,
        or on the server side. Affects the logic used by the state machine, the
        default settings values, the allowable stream IDs, and several other
        properties. Defaults to ``True``.
        """
        return self._client_side

    @client_side.setter
    def client_side(self, value):
        """
        Enforces constraints on the client side of the connection.
        """
        if not isinstance(value, bool):
            raise ValueError("client_side must be a bool")
        self._client_side = value

    @property
    def header_encoding(self):
        """
        Controls whether the headers emitted by this object in events are
        transparently decoded to ``unicode`` strings, and what encoding is used
        to do that decoding. For historical reasons, this defaults to
        ``'utf-8'``. To prevent the decoding of headers (that is, to force them
        to be returned as bytestrings), this can be set to ``False`` or the
        empty string.
        """
        return self._header_encoding

    @header_encoding.setter
    def header_encoding(self, value):
        """
        Enforces constraints on the value of header encoding.
        """
        if not isinstance(value, (bool, str, type(None))):
            raise ValueError("header_encoding must be bool, string, or None")
        self._header_encoding = value<commit_msg>Header encoding cannot be True<commit_after># -*- coding: utf-8 -*-
"""
h2/config
~~~~~~~~~

Objects for controlling the configuration of the HTTP/2 stack.
"""


class H2Configuration(object):
    """
    An object that controlls the way a single HTTP/2 connection behaves.

    This object allows the users to customize behaviour. In particular, it
    allows users to enable or disable optional features, or to otherwise handle
    various unusual behaviours.

    This object has very little behaviour of its own: it mostly just ensures
    that configuration is self-consistent.
    """
    def __init__(self):
        self._client_side = True
        self._header_encoding = 'utf-8'

    @property
    def client_side(self):
        """
        Whether this object is to be used on the client side of a connection,
        or on the server side. Affects the logic used by the state machine, the
        default settings values, the allowable stream IDs, and several other
        properties. Defaults to ``True``.
        """
        return self._client_side

    @client_side.setter
    def client_side(self, value):
        """
        Enforces constraints on the client side of the connection.
        """
        if not isinstance(value, bool):
            raise ValueError("client_side must be a bool")
        self._client_side = value

    @property
    def header_encoding(self):
        """
        Controls whether the headers emitted by this object in events are
        transparently decoded to ``unicode`` strings, and what encoding is used
        to do that decoding. For historical reasons, this defaults to
        ``'utf-8'``. To prevent the decoding of headers (that is, to force them
        to be returned as bytestrings), this can be set to ``False`` or the
        empty string.
        """
        return self._header_encoding

    @header_encoding.setter
    def header_encoding(self, value):
        """
        Enforces constraints on the value of header encoding.
        """
        if not isinstance(value, (bool, str, type(None))):
            raise ValueError("header_encoding must be bool, string, or None")
        if value is True:
            raise ValueError("header_encoding cannot be True")
        self._header_encoding = value
{'fraction_non_alphanumeric': 0.07728706624605679, 'fraction_numerical': 0.0031545741324921135, 'mean_word_length': 2.523015873015873, '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': '1941605', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1086, 'n_words': 490}