code: def test_function(self, data):
      assert isinstance(data.observer, TreeRecordingObserver)
      self.call_count += 1
  
      interrupted = False
      try:
          self.__stoppable_test_function(data)
      except KeyboardInterrupt:
          interrupted = True
          raise
      except BaseException:
          self.save_buffer(data.buffer)
          raise
      finally:
          # No branch, because if we're interrupted we always raise
          # the KeyboardInterrupt, never continue to the code below.
          if not interrupted:  # pragma: no branch
              data.freeze()
              self.note_details(data)
  
      self.debug_data(data)
  
      if self.pareto_front is not None and self.pareto_front.add(
          data.as_result()
      ):
          self.save_buffer(data.buffer, sub_key=b"pareto")
  
      assert len(data.buffer) <= BUFFER_SIZE
  
      if data.status >= Status.VALID:
          for k, v in data.target_observations.items():
              self.best_observed_targets[k] = max(
                  self.best_observed_targets[k], v
              )
  
              if k not in self.best_examples_of_observed_targets:
                  self.best_examples_of_observed_targets[
                      k
                  ] = data.as_result()
                  continue
  
              existing_example = self.best_examples_of_observed_targets[
                  k
              ]
              existing_score = existing_example.target_observations[k]
  
              if v < existing_score:
                  continue
  
              if v > existing_score or sort_key(data.buffer) < sort_key(
                  existing_example.buffer
              ):
                  self.best_examples_of_observed_targets[
                      k
                  ] = data.as_result()
  
      if data.status == Status.VALID:
          self.valid_examples += 1
  
      if data.status == Status.INTERESTING:
          key = data.interesting_origin
          changed = False
          try:
              existing = self.interesting_examples[key]
          except KeyError:
              changed = True
              self.last_bug_found_at = self.call_count
              if self.first_bug_found_at is None:
                  self.first_bug_found_at = self.call_count
          else:
              if sort_key(data.buffer) < sort_key(existing.buffer):
                  self.shrinks += 1
                  self.downgrade_buffer(existing.buffer)
                  self.__data_cache.unpin(existing.buffer)
                  changed = True
  
          if changed:
              self.save_buffer(data.buffer)
              self.interesting_examples[key] = data.as_result()
              self.__data_cache.pin(data.buffer)
              self.shrunk_examples.discard(key)
  
          if self.shrinks >= MAX_SHRINKS:
              self.exit_with(ExitReason.max_shrinks)
  
      if not self.interesting_examples:
          # Note that this logic is reproduced to end the generation phase when
          # we have interesting examples.  Update that too if you change this!
          # (The doubled implementation is because here we exit the engine entirely,
          #  while in the other case below we just want to move on to shrinking.)
          if self.valid_examples >= self.settings.max_examples:
              self.exit_with(ExitReason.max_examples)
          if self.call_count >= max(
              self.settings.max_examples * 10,
              # We have a high-ish default max iterations, so that tests
              # don't become flaky when max_examples is too low.
              1000,
          ):
              self.exit_with(ExitReason.max_iterations)
  
      if self.__tree_is_exhausted():
          self.exit_with(ExitReason.finished)
  
      self.record_for_health_check(data)
  
imports: from __future__ import absolute_import, division, print_function
  from collections import Counter, defaultdict
  from enum import Enum
  from random import Random, getrandbits
  from weakref import WeakKeyDictionary
  import attr
  from hypothesis import HealthCheck, Phase, Verbosity, settings
  from hypothesis._settings import local_settings
  from hypothesis.internal.cache import LRUReusedCache
  from hypothesis.internal.compat import ceil, hbytes, int_from_bytes
  from hypothesis.internal.conjecture.data import ConjectureData, ConjectureResult, DataObserver, Overrun, Status, StopTest
  from hypothesis.internal.conjecture.datatree import DataTree, PreviouslyUnseenBehaviour, TreeRecordingObserver
  from hypothesis.internal.conjecture.junkdrawer import clamp
  from hypothesis.internal.conjecture.pareto import NO_SCORE, ParetoFront, ParetoOptimiser
  from hypothesis.internal.conjecture.shrinker import Shrinker, sort_key
  from hypothesis.internal.healthcheck import fail_health_check
  from hypothesis.reporting import base_report
label_desc: Use image node_id 5 for calling the ConjectureRunner obj's underlying member method code with example usage: obj.test_function(data) without return types