code: def register_random(r):
      # type: (random.Random) -> None
      """Register the given Random instance for management by Hypothesis.
  
      You can pass ``random.Random`` instances (or other objects with seed,
      getstate, and setstate methods) to ``register_random(r)`` to have their
      states seeded and restored in the same way as the global PRNGs from the
      ``random`` and ``numpy.random`` modules.
  
      All global PRNGs, from e.g. simulation or scheduling frameworks, should
      be registered to prevent flaky tests.  Hypothesis will ensure that the
      PRNG state is consistent for all test runs, or reproducibly varied if you
      choose to use the :func:`~hypothesis.strategies.random_module` strategy.
      """
      if not (
          hasattr(r, "seed")
          and hasattr(r, "getstate")
          and hasattr(r, "setstate")
      ):
          raise InvalidArgument(
              "r=%r does not have all the required methods" % (r,)
          )
      if r not in RANDOMS_TO_MANAGE:
          RANDOMS_TO_MANAGE.append(r)
  
file_path: catboost/contrib/python/hypothesis/py2/hypothesis/internal/entropy.py
imports: from __future__ import absolute_import, division, print_function
  import contextlib
  import random
  import sys
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal.compat import integer_types
label_desc: Use image node_id 1 for calling a global function with example usage: register_random(r) without return types