code: def tfp_hp_settings(default_max_examples=None, **kwargs):
      """Default TFP-specific Hypothesis settings."""
      # Rationales for deviating from Hypothesis default settings
      # - Derandomize by default because flaky tests are horrible
      # - Turn off example database because
      #   - It makes tests flaky on our cluster even if derandomized at the current
      #     internal Hypothesis version.
      #   - In the future, derandomization will imply ignoring the database setting
      #     anyway
      #   - Having one can't make example runs any faster
      # - No deadline because our test functions are too slow
      # - No too_slow health check for the same reason
      # - Fewer examples by default for the same reason
      # - Always print `@reproduce_failure` blobs because one never doesn't want
      #   them in the logs
      kwds = dict(
          derandomize=not randomize_hypothesis(),
          database=None,
          deadline=None,
          suppress_health_check=[hp.HealthCheck.too_slow],
          max_examples=hypothesis_max_examples(
              default=default_max_examples
          ),
          timeout=hypothesis_timeout(),
          print_blob=True,
      )
      kwds.update(kwargs)
  
      def decorator(test_method):
          repro_seed = hypothesis_reproduction_seed()
          if repro_seed is not None:
              # This implements the semantics of TFP_HYPOTHESIS_REPRODUCE via
              # the `hp.reproduce_failure` decorator.
              # TODO(jburnim): Catch Hypothesis version mismatches.
              test_method = hp.reproduce_failure(
                  hp.__version__, repro_seed
              )(test_method)
          elif randomize_hypothesis():
              # Hypothesis defaults to seeding its internal PRNG from the system time,
              # so since we actually want randomization (including across machines) we
              # have to force it.
              entropy = os.urandom(64)
              test_method = hp.seed(int.from_bytes(entropy, "big"))(
                  test_method
              )
          if hp.__version_info__ >= (4,):
              # TODO(jburnim): Comment this.
              timeout = kwds.pop("timeout")
              ret = hp.settings(**kwds)(test_method)
              object.__setattr__(
                  ret._hypothesis_internal_use_settings,
                  "timeout",
                  timeout,
              )
          else:
              ret = hp.settings(**kwds)(test_method)
          return ret
  
      return decorator
  
imports: import contextlib
  import os
  import re
  import traceback
  import unittest
  import hypothesis
  from hypothesis.extra import numpy
  import hypothesis.strategies
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 6 for calling a global function with example usage: tfp_hp_settings(default_max_examples) and returns: decorator, ret