code: def target(
      observation: Union[int, float], *, label: str = ""
  ) -> Union[int, float]:
      """Calling this function with an ``int`` or ``float`` observation gives it feedback
      with which to guide our search for inputs that will cause an error, in
      addition to all the usual heuristics.  Observations must always be finite.
  
      Hypothesis will try to maximize the observed value over several examples;
      almost any metric will work so long as it makes sense to increase it.
      For example, ``-abs(error)`` is a metric that increases as ``error``
      approaches zero.
  
      Example metrics:
  
      - Number of elements in a collection, or tasks in a queue
      - Mean or maximum runtime of a task (or both, if you use ``label``)
      - Compression ratio for data (perhaps per-algorithm or per-level)
      - Number of steps taken by a state machine
  
      The optional ``label`` argument can be used to distinguish between
      and therefore separately optimise distinct observations, such as the
      mean and standard deviation of a dataset.  It is an error to call
      ``target()`` with any label more than once per test case.
  
      .. note::
          **The more examples you run, the better this technique works.**
  
          As a rule of thumb, the targeting effect is noticeable above
          :obj:`max_examples=1000 <hypothesis.settings.max_examples>`,
          and immediately obvious by around ten thousand examples
          *per label* used by your test.
  
      :ref:`statistics` include the best score seen for each label,
      which can help avoid `the threshold problem
      <https://hypothesis.works/articles/threshold-problem/>`__ when the minimal
      example shrinks right down to the threshold of failure (:issue:`2180`).
      """
      check_type((int, float), observation, "observation")
      if not math.isfinite(observation):
          raise InvalidArgument(
              f"{observation=} must be a finite float."
          )
      check_type(str, label, "label")
  
      context = _current_build_context.value
      if context is None:
          raise InvalidArgument(
              "Calling target() outside of a test is invalid.  "
              "Consider guarding this call with `if currently_in_test_context(): ...`"
          )
      verbose_report(f"Saw target({observation!r}, {label=})")
  
      if label in context.data.target_observations:
          raise InvalidArgument(
              f"Calling target({observation!r}, {label=}) would overwrite "
              f"target({context.data.target_observations[label]!r}, {label=})"
          )
      else:
          context.data.target_observations[label] = observation
  
      return observation
  
imports: import math
  from collections import defaultdict
  from typing import NoReturn, Union
  from weakref import WeakKeyDictionary
  from hypothesis import Verbosity, settings
  from hypothesis._settings import note_deprecation
  from hypothesis.errors import InvalidArgument, UnsatisfiedAssumption
  from hypothesis.internal.compat import BaseExceptionGroup
  from hypothesis.internal.conjecture.data import ConjectureData
  from hypothesis.internal.reflection import get_pretty_function_description
  from hypothesis.internal.validation import check_type
  from hypothesis.reporting import report, verbose_report
  from hypothesis.utils.dynamicvariables import DynamicVariable
  from hypothesis.vendor.pretty import IDKey
label_desc: Use image node_id 10 for calling a global function with example usage: target(observation) and returns: observation