<commit_before>"""
mongoquery provides a straightforward API to match Python objects against
MongoDB Query Language queries.
"""

import re
from collections import Sequence, Mapping
from six import string_types

# pylint: disable=invalid-name
try:
    string_type = basestring
except NameError:
    string_type = str


class QueryError(Exception):
    """ Query error exception """
    pass


class _Undefined(object):
    # pylint: disable=too-few-public-methods
    pass


def is_non_string_sequence(entry):
    """ Returns True if entry is a Python sequence iterable, and not a string """
    return isinstance(entry, Sequence) and not isinstance(entry, string_type)


class Query(object):
    """ The Query class is used to match an object against a MongoDB-like query """
    # pylint: disable=too-few-public-methods<commit_msg>Fix import of abstract container classes to Python 3.9 compatible module<commit_after>"""
mongoquery provides a straightforward API to match Python objects against
MongoDB Query Language queries.
"""

import re
from collections.abc import Sequence, Mapping
from six import string_types

# pylint: disable=invalid-name
try:
    string_type = basestring
except NameError:
    string_type = str


class QueryError(Exception):
    """ Query error exception """
    pass


class _Undefined(object):
    # pylint: disable=too-few-public-methods
    pass


def is_non_string_sequence(entry):
    """ Returns True if entry is a Python sequence iterable, and not a string """
    return isinstance(entry, Sequence) and not isinstance(entry, string_type)


class Query(object):
    """ The Query class is used to match an object against a MongoDB-like query """
    # pylint: disable=too-few-public-methods
{'fraction_non_alphanumeric': 0.08097165991902834, 'fraction_numerical': 0.001156737998843262, 'mean_word_length': 4.356037151702786, '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': '2094190', 'n_tokens_mistral': 488, 'n_tokens_neox': 462, 'n_words': 179}