code: def query(
      exclude_categories=(),
      include_categories=None,
      min_codepoint=None,
      max_codepoint=None,
      include_characters="",
      exclude_characters="",
  ):
      """Return a tuple of intervals covering the codepoints for all characters
      that meet the critera (min_codepoint <= codepoint(c) <= max_codepoint and
      any(cat in include_categories for cat in categories(c)) and all(cat not in
      exclude_categories for cat in categories(c)) or (c in include_characters)
  
      >>> query()
      ((0, 1114111),)
      >>> query(min_codepoint=0, max_codepoint=128)
      ((0, 128),)
      >>> query(min_codepoint=0, max_codepoint=128, include_categories=['Lu'])
      ((65, 90),)
      >>> query(min_codepoint=0, max_codepoint=128, include_categories=['Lu'],
      ...       include_characters=u'☃')
      ((65, 90), (9731, 9731))
      """
      if min_codepoint is None:
          min_codepoint = 0
      if max_codepoint is None:
          max_codepoint = sys.maxunicode
      catkey = _category_key(exclude_categories, include_categories)
      character_intervals = _intervals(include_characters or "")
      exclude_intervals = _intervals(exclude_characters or "")
      qkey = (
          catkey,
          min_codepoint,
          max_codepoint,
          character_intervals,
          exclude_intervals,
      )
      try:
          return limited_category_index_cache[qkey]
      except KeyError:
          pass
      base = _query_for_key(catkey)
      result = []
      for u, v in base:
          if v >= min_codepoint and u <= max_codepoint:
              result.append(
                  (max(u, min_codepoint), min(v, max_codepoint))
              )
      result = tuple(result)
      result = _union_intervals(result, character_intervals)
      result = _subtract_intervals(result, exclude_intervals)
      limited_category_index_cache[qkey] = result
      return result
  
file_path: catboost/contrib/python/hypothesis/py2/hypothesis/internal/charmap.py
imports: from __future__ import absolute_import, division, print_function
  import gzip
  import json
  import os
  import sys
  import tempfile
  import unicodedata
  from hypothesis.configuration import mkdir_p, storage_directory
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal.compat import hunichr
label_desc: Use image node_id 10 for calling a global function with example usage: query(exclude_categories, include_categories, min_codepoint, max_codepoint, include_characters, exclude_characters) and returns: result, limited_category_index_cache