docstr: Run the test function once, using ``data`` as input.
  
  If the test raises an exception, it will propagate through to the
  caller of this method. Depending on its type, this could represent
  an ordinary test failure, or a fatal error, or a control exception.
  
  If this method returns normally, the test might have passed, or
  it might have placed ``data`` in an unsuccessful state and then
  swallowed the corresponding control exception.
docstr_tok: ["Run","the","test","function","once",",","using","``","data","``","as","input",".","If","the","test","raises","an","exception",",","it","will","propagate","through","to","the","caller","of","this","method",".","Depending","on","its","type",",","this","could","represent","an","ordinary","test","failure",",","or","a","fatal","error",",","or","a","control","exception",".","If","this","method","returns","normally",",","the","test","might","have","passed",",","or","it","might","have","placed","``","data","``","in","an","unsuccessful","state","and","then","swallowed","the","corresponding","control","exception","."]
code: def execute_once(
      self,
      data,
      print_example=False,
      is_final=False,
      expected_failure=None,
  ):
      """Run the test function once, using ``data`` as input.
  
      If the test raises an exception, it will propagate through to the
      caller of this method. Depending on its type, this could represent
      an ordinary test failure, or a fatal error, or a control exception.
  
      If this method returns normally, the test might have passed, or
      it might have placed ``data`` in an unsuccessful state and then
      swallowed the corresponding control exception.
      """
  
      data.is_find = self.is_find
  
      text_repr = [None]
      if self.settings.deadline is None:
          test = self.test
      else:
  
          @proxies(self.test)
          def test(*args, **kwargs):
              self.__test_runtime = None
              initial_draws = len(data.draw_times)
              start = benchmark_time()
              result = self.test(*args, **kwargs)
              finish = benchmark_time()
              internal_draw_time = sum(data.draw_times[initial_draws:])
              runtime = datetime.timedelta(
                  seconds=finish - start - internal_draw_time
              )
              self.__test_runtime = runtime
              current_deadline = self.settings.deadline
              if not is_final:
                  current_deadline = (current_deadline // 4) * 5
              if runtime >= current_deadline:
                  raise DeadlineExceeded(
                      runtime, self.settings.deadline
                  )
              return result
  
      def run(data):
          # Set up dynamic context needed by a single test run.
          with local_settings(self.settings):
              with deterministic_PRNG():
                  with BuildContext(data, is_final=is_final):
                      # Generate all arguments to the test function.
                      args, kwargs = data.draw(self.search_strategy)
                      if expected_failure is not None:
                          text_repr[0] = arg_string(test, args, kwargs)
  
                      if (
                          print_example
                          or current_verbosity() >= Verbosity.verbose
                      ):
                          output = CUnicodeIO()
  
                          printer = RepresentationPrinter(output)
                          if print_example:
                              printer.text("Falsifying example:")
                          else:
                              printer.text("Trying example:")
  
                          if self.print_given_args:
                              printer.text(" ")
                              printer.text(test.__name__)
                              with printer.group(
                                  indent=4, open="(", close=""
                              ):
                                  printer.break_()
                                  for v in args:
                                      printer.pretty(v)
                                      # We add a comma unconditionally because
                                      # generated arguments will always be
                                      # kwargs, so there will always be more
                                      # to come.
                                      printer.text(",")
                                      printer.breakable()
  
                                  # We need to make sure to print these in the argument order for
                                  # Python 2 and older versionf of Python 3.5. In modern versions
                                  # this isn't an issue because kwargs is ordered.
                                  arg_order = {
                                      v: i
                                      for i, v in enumerate(
                                          getfullargspec(self.test).args
                                      )
                                  }
                                  for i, (k, v) in enumerate(
                                      sorted(
                                          kwargs.items(),
                                          key=lambda t: (
                                              arg_order.get(
                                                  t[0], float("inf")
                                              ),
                                              t[0],
                                          ),
                                      )
                                  ):
                                      printer.text(k)
                                      printer.text("=")
                                      printer.pretty(v)
                                      printer.text(",")
                                      if i + 1 < len(kwargs):
                                          printer.breakable()
                              printer.break_()
                              printer.text(")")
                          printer.flush()
                          report(output.getvalue())
                      return test(*args, **kwargs)
  
      # Run the test function once, via the executor hook.
      # In most cases this will delegate straight to `run(data)`.
      result = self.test_runner(data, run)
  
      # If a failure was expected, it should have been raised already, so
      # instead raise an appropriate diagnostic error.
      if expected_failure is not None:
          exception, traceback = expected_failure
          if (
              isinstance(exception, DeadlineExceeded)
              and self.__test_runtime is not None
          ):
              report(
                  (
                      "Unreliable test timings! On an initial run, this "
                      "test took %.2fms, which exceeded the deadline of "
                      "%.2fms, but on a subsequent run it took %.2f ms, "
                      "which did not. If you expect this sort of "
                      "variability in your test timings, consider turning "
                      "deadlines off for this test by setting deadline=None."
                  )
                  % (
                      exception.runtime.total_seconds() * 1000,
                      self.settings.deadline.total_seconds() * 1000,
                      self.__test_runtime.total_seconds() * 1000,
                  )
              )
          else:
              report(
                  "Failed to reproduce exception. Expected: \n"
                  + traceback
              )
          self.__flaky(
              (
                  "Hypothesis %s(%s) produces unreliable results: Falsified"
                  " on the first call but did not on a subsequent one"
              )
              % (test.__name__, text_repr[0])
          )
      return result
  
imports: from __future__ import absolute_import, division, print_function
  import base64
  import contextlib
  import datetime
  import inspect
  import random
  import sys
  import traceback
  import warnings
  import zlib
  from random import Random
  from unittest import TestCase
  import attr
  import hypothesis.strategies
  from hypothesis._settings import HealthCheck, Phase, Verbosity, local_settings, settings
  from hypothesis.control import BuildContext
  from hypothesis.errors import DeadlineExceeded, DidNotReproduce, FailedHealthCheck, Flaky, Found, HypothesisDeprecationWarning, HypothesisWarning, InvalidArgument, MultipleFailures, NoSuchExample, Unsatisfiable, UnsatisfiedAssumption
  from hypothesis.executors import new_style_executor
  from hypothesis.internal.compat import PY2, bad_django_TestCase, benchmark_time, binary_type, get_type_hints, getfullargspec, hbytes, int_from_bytes, qualname
  from hypothesis.internal.conjecture.data import ConjectureData, StopTest
  from hypothesis.internal.conjecture.engine import ConjectureRunner, sort_key
  from hypothesis.internal.entropy import deterministic_PRNG
  from hypothesis.internal.escalation import escalate_hypothesis_internal_error, get_trimmed_traceback
  from hypothesis.internal.healthcheck import fail_health_check
  from hypothesis.internal.reflection import arg_string, convert_positional_arguments, define_function_signature, function_digest, get_pretty_function_description, impersonate, is_mock, proxies
  from hypothesis.reporting import current_verbosity, report, verbose_report, with_reporter
  from hypothesis.statistics import note_engine_for_statistics
  from hypothesis.strategies._internal.collections import TupleStrategy
  from hypothesis.strategies._internal.strategies import MappedSearchStrategy, SearchStrategy
  from hypothesis.utils.conventions import infer
  from hypothesis.vendor.pretty import CUnicodeIO, RepresentationPrinter
  from hypothesis.version import __version__
label_desc: Use image node_id 2 for calling the StateForActualGivenExecution obj's underlying member method code with example usage: obj.execute_once(data, print_example, is_final, expected_failure) and returns: result, result, test