code: def defines_strategy(
      *,
      force_reusable_values: bool = False,
      try_non_lazy: bool = False,
      never_lazy: bool = False,
  ) -> Callable[["T"], "T"]:
      """Returns a decorator for strategy functions.
  
      If ``force_reusable_values`` is True, the returned strategy will be marked
      with ``.has_reusable_values == True`` even if it uses maps/filters or
      non-reusable strategies internally. This tells our numpy/pandas strategies
      that they can implicitly use such strategies as background values.
  
      If ``try_non_lazy`` is True, attempt to execute the strategy definition
      function immediately, so that a LazyStrategy is only returned if this
      raises an exception.
  
      If ``never_lazy`` is True, the decorator performs no lazy-wrapping at all,
      and instead returns the original function.
      """
  
      def decorator(strategy_definition):
          """A decorator that registers the function as a strategy and makes it
          lazily evaluated."""
          _strategies[strategy_definition.__name__] = signature(
              strategy_definition
          )
  
          if never_lazy:
              assert not try_non_lazy
              # We could potentially support never_lazy + force_reusable_values
              # with a suitable wrapper, but currently there are no callers that
              # request this combination.
              assert not force_reusable_values
              return strategy_definition
  
          from hypothesis.strategies._internal.lazy import LazyStrategy
  
          @proxies(strategy_definition)
          def accept(*args, **kwargs):
              if try_non_lazy:
                  # Why not try this unconditionally?  Because we'd end up with very
                  # deep nesting of recursive strategies - better to be lazy unless we
                  # *know* that eager evaluation is the right choice.
                  try:
                      return strategy_definition(*args, **kwargs)
                  except Exception:
                      # If invoking the strategy definition raises an exception,
                      # wrap that up in a LazyStrategy so it happens again later.
                      pass
              result = LazyStrategy(strategy_definition, args, kwargs)
              if force_reusable_values:
                  # Setting `force_has_reusable_values` here causes the recursive
                  # property code to set `.has_reusable_values == True`.
                  result.force_has_reusable_values = True
                  assert result.has_reusable_values
              return result
  
          accept.is_hypothesis_strategy_function = True
          return accept
  
      return decorator
  
imports: import sys
  import threading
  from inspect import signature
  from typing import TYPE_CHECKING, Callable, Dict
  import attr
  from hypothesis.internal.cache import LRUReusedCache
  from hypothesis.internal.compat import dataclass_asdict
  from hypothesis.internal.floats import float_to_int
  from hypothesis.internal.reflection import proxies
  from hypothesis.vendor.pretty import pretty
label_desc: Use image node_id 5 for calling a global function with example usage: defines_strategy() and returns: decorator, accept, strategy_definition, result, strategy_definition