code: def _hypothesis_do_random(self, method, kwargs):
      if method == "choices":
          key = (method, len(kwargs["population"]), kwargs.get("k"))
      elif method == "choice":
          key = (method, len(kwargs["seq"]))
      elif method == "shuffle":
          key = (method, len(kwargs["x"]))
      else:
          key = (method, *sorted(kwargs))
  
      try:
          result, self.__state = self.__state.next_states[key]
      except KeyError:
          pass
      else:
          return self.__convert_result(method, kwargs, result)
  
      if method == "_randbelow":
          result = self.__data.draw_integer(0, kwargs["n"] - 1)
      elif method in ("betavariate", "random"):
          result = self.__data.draw(UNIFORM)
      elif method == "uniform":
          a = normalize_zero(kwargs["a"])
          b = normalize_zero(kwargs["b"])
          result = self.__data.draw(floats(a, b))
      elif method in ("weibullvariate", "gammavariate"):
          result = self.__data.draw(
              floats(min_value=0.0, allow_infinity=False)
          )
      elif method in ("gauss", "normalvariate"):
          mu = kwargs["mu"]
          result = mu + self.__data.draw(
              floats(allow_nan=False, allow_infinity=False)
          )
      elif method == "vonmisesvariate":
          result = self.__data.draw(floats(0, 2 * math.pi))
      elif method == "randrange":
          if kwargs["stop"] is None:
              stop = kwargs["start"]
              start = 0
          else:
              start = kwargs["start"]
              stop = kwargs["stop"]
  
          step = kwargs["step"]
          if start == stop:
              raise ValueError(
                  f"empty range for randrange({start}, {stop}, {step})"
              )
  
          if step != 1:
              endpoint = (stop - start) // step
              if (start - stop) % step == 0:
                  endpoint -= 1
  
              i = self.__data.draw_integer(0, endpoint)
              result = start + i * step
          else:
              result = self.__data.draw_integer(start, stop - 1)
      elif method == "randint":
          result = self.__data.draw_integer(kwargs["a"], kwargs["b"])
      # New in Python 3.12, so not taken by our coverage job
      elif method == "binomialvariate":  # pragma: no cover
          result = self.__data.draw_integer(0, kwargs["n"])
      elif method == "choice":
          seq = kwargs["seq"]
          result = self.__data.draw_integer(0, len(seq) - 1)
      elif method == "choices":
          k = kwargs["k"]
          result = self.__data.draw(
              lists(
                  integers(0, len(kwargs["population"]) - 1),
                  min_size=k,
                  max_size=k,
              )
          )
      elif method == "sample":
          k = kwargs["k"]
          seq = kwargs["population"]
  
          if k > len(seq) or k < 0:
              raise ValueError(
                  f"Sample size {k} not in expected range 0 <= k <= {len(seq)}"
              )
  
          if k == 0:
              result = []
          else:
              result = self.__data.draw(
                  lists(
                      sampled_from(range(len(seq))),
                      min_size=k,
                      max_size=k,
                      unique=True,
                  )
              )
  
      elif method == "getrandbits":
          result = self.__data.draw_integer(0, 2 ** kwargs["n"] - 1)
      elif method == "triangular":
          low = normalize_zero(kwargs["low"])
          high = normalize_zero(kwargs["high"])
          mode = normalize_zero(kwargs["mode"])
          if mode is None:
              result = self.__data.draw(floats(low, high))
          elif self.__data.draw_boolean(0.5):
              result = self.__data.draw(floats(mode, high))
          else:
              result = self.__data.draw(floats(low, mode))
      elif method in ("paretovariate", "expovariate", "lognormvariate"):
          result = self.__data.draw(floats(min_value=0.0))
      elif method == "shuffle":
          result = self.__data.draw(
              permutations(range(len(kwargs["x"])))
          )
      elif method == "randbytes":
          n = kwargs["n"]
          result = self.__data.draw(binary(min_size=n, max_size=n))
      else:
          raise NotImplementedError(method)
  
      new_state = RandomState()
      self.__state.next_states[key] = (result, new_state)
      self.__state = new_state
  
      return self.__convert_result(method, kwargs, result)
  
imports: import inspect
  import math
  from random import Random
  from typing import Any, Dict
  import attr
  from hypothesis.control import should_note
  from hypothesis.internal.reflection import define_function_signature
  from hypothesis.reporting import report
  from hypothesis.strategies._internal.core import binary, lists, permutations, sampled_from
  from hypothesis.strategies._internal.numbers import floats, integers
  from hypothesis.strategies._internal.strategies import SearchStrategy
label_desc: Use image node_id 5 for calling the ArtificialRandom obj's underlying member method code with example usage: obj._hypothesis_do_random(method, kwargs) and returns: self, self