class_docstr: Helper object that allows to configure `characters` strategy with
  various unicode categories and characters. Also allows negation of
  configured set.
  
  :param negate: If True, configure :func:`hypothesis.strategies.characters`
      to match anything other than configured character set
  :param flags: Regex flags. They affect how and which characters are matched
docstr: Update unicode state to match sre_parse object ``category``.
docstr_tok: ["Update","unicode","state","to","match","sre_parse","object","``","category","``","."]
code: def add_category(self, category):
      """Update unicode state to match sre_parse object ``category``."""
      if category == sre.CATEGORY_DIGIT:
          self._categories |= UNICODE_DIGIT_CATEGORIES
      elif category == sre.CATEGORY_NOT_DIGIT:
          self._categories |= (
              UNICODE_CATEGORIES - UNICODE_DIGIT_CATEGORIES
          )
      elif category == sre.CATEGORY_SPACE:
          self._categories |= UNICODE_SPACE_CATEGORIES
          self._whitelist_chars |= (
              UNICODE_SPACE_CHARS if self._unicode else SPACE_CHARS
          )
      elif category == sre.CATEGORY_NOT_SPACE:
          self._categories |= (
              UNICODE_CATEGORIES - UNICODE_SPACE_CATEGORIES
          )
          self._blacklist_chars |= (
              UNICODE_SPACE_CHARS if self._unicode else SPACE_CHARS
          )
      elif category == sre.CATEGORY_WORD:
          self._categories |= UNICODE_WORD_CATEGORIES
          self._whitelist_chars.add("_")
          if self._unicode and not PY3:  # pragma: no cover
              self._blacklist_chars |= UNICODE_WEIRD_NONWORD_CHARS
      elif category == sre.CATEGORY_NOT_WORD:
          self._categories |= (
              UNICODE_CATEGORIES - UNICODE_WORD_CATEGORIES
          )
          self._blacklist_chars.add("_")
          if self._unicode and not PY3:  # pragma: no cover
              self._whitelist_chars |= UNICODE_WEIRD_NONWORD_CHARS
      else:  # pragma: no cover
          raise AssertionError(
              "Unknown character category: %s" % category
          )
  
imports: from __future__ import absolute_import, division, print_function
  import operator
  import re
  import sre_constants
  import sre_parse
  import sys
  import hypothesis.strategies
  from hypothesis import reject
  from hypothesis.internal.charmap import as_general_categories, categories
  from hypothesis.internal.compat import PY3, hrange, hunichr, int_to_byte, text_type
label_desc: Use image node_id 3 for calling the CharactersBuilder obj's underlying member method code with example usage: obj.add_category(category) without return types