code: def as_general_categories(cats, name="cats"):
      """Return a tuple of Unicode categories in a normalised order.
  
      This function expands one-letter designations of a major class to include
      all subclasses:
  
      >>> as_general_categories(['N'])
      ('Nd', 'Nl', 'No')
  
      See section 4.5 of the Unicode standard for more on classes:
      https://www.unicode.org/versions/Unicode10.0.0/ch04.pdf
  
      If the collection ``cats`` includes any elements that do not represent a
      major class or a class with subclass, a deprecation warning is raised.
      """
      if cats is None:
          return None
      major_classes = ("L", "M", "N", "P", "S", "Z", "C")
      cs = categories()
      out = set(cats)
      for c in cats:
          if c in major_classes:
              out.discard(c)
              out.update(x for x in cs if x.startswith(c))
          elif c not in cs:
              raise InvalidArgument(
                  "In %s=%r, %r is not a valid Unicode category."
                  % (name, cats, c)
              )
      return tuple(c for c in cs if c in out)
  
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 4 for calling a global function with example usage: as_general_categories(cats, name) and returns: tuple, None