class_docstr: Object that can be used to control a number of feature flags for a
  given test run.
  
  This enables an approach to data generation called swarm testing (
  see Groce, Alex, et al. "Swarm testing." Proceedings of the 2012
  International Symposium on Software Testing and Analysis. ACM, 2012), in
  which generation is biased by selectively turning some features off for
  each test case generated. When there are many interacting features this can
  find bugs that a pure generation strategy would otherwise have missed.
  
  FeatureFlags are designed to "shrink open", so that during shrinking they
  become less restrictive. This allows us to potentially shrink to smaller
  test cases that were forbidden during the generation phase because they
  required disabled features.
code: def __init__(self, data=None, enabled=(), disabled=()):
      self.__data = data
      self.__is_disabled = {}
  
      for f in enabled:
          self.__is_disabled[f] = False
  
      for f in disabled:
          self.__is_disabled[f] = True
  
      # In the original swarm testing paper they turn features on or off
      # uniformly at random. Instead we decide the probability with which to
      # enable features up front. This can allow for scenarios where all or
      # no features are enabled, which are vanishingly unlikely in the
      # original model.
      #
      # We implement this as a single 8-bit integer and enable features which
      # score >= that value. In particular when self.__baseline is 0, all
      # features will be enabled. This is so that we shrink in the direction
      # of more features being enabled.
      if self.__data is not None:
          self.__p_disabled = data.draw_integer(0, 255) / 255.0
      else:
          # If data is None we're in example mode so all that matters is the
          # enabled/disabled lists above. We set this up so that everything
          # else is enabled by default.
          self.__p_disabled = 0.0
  
file_path: catboost/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/featureflags.py
imports: from hypothesis.internal.conjecture import utils
  from hypothesis.strategies._internal.strategies import SearchStrategy
label_desc: Use image node_id 1 to create a new FeatureFlags object  with example: obj = FeatureFlags(data, enabled, disabled)