code: def handle_test(
      *,
      fn_tree: Optional[str] = None,
      ground_truth_backend: str = "tensorflow",
      number_positional_args=None,
      test_instance_method=BuiltInstanceStrategy,
      test_with_out=BuiltWithOutStrategy,
      test_with_copy=BuiltWithCopyStrategy,
      test_gradients=BuiltGradientStrategy,
      test_trace=BuiltTraceStrategy,
      transpile=BuiltTranspileStrategy,
      precision_mode=BuiltPrecisionModeStrategy,
      as_variable_flags=BuiltAsVariableStrategy,
      native_array_flags=BuiltNativeArrayStrategy,
      container_flags=BuiltContainerStrategy,
      test_cython_wrapper=BuiltCythonWrapperStrategy,
      **_given_kwargs,
  ):
      """Test wrapper for Ivy functions.
  
      The wrapper sets the required test globals and creates test flags strategies.
  
      Parameters
      ----------
      fn_tree
          Full function import path
  
      ground_truth_backend
          The framework to assert test results are equal to
  
      number_positional_args
          A search strategy for determining the number of positional arguments to be
          passed to the function
  
      test_instance_method
          A search strategy that generates a boolean to test instance methods
  
      test_with_out
          A search strategy that generates a boolean to test the function with an `out`
          parameter
  
      test_with_copy
          A search strategy that generates a boolean to test the function with an `copy`
          parameter
  
      test_gradients
          A search strategy that generates a boolean to test the function with arrays as
          gradients
  
      test_trace
          A search strategy that generates a boolean to trace and test the
          function
  
      precision_mode
          A search strategy that generates a boolean to switch between two different
          precision modes supported by numpy and (torch, jax) and test the function
  
      as_variable_flags
          A search strategy that generates a list of boolean flags for array inputs to be
          passed as a Variable array
  
      native_array_flags
          A search strategy that generates a list of boolean flags for array inputs to be
          passed as a native array
  
      container_flags
          A search strategy that generates a list of boolean flags for array inputs to be
          passed as a Container
      """
      is_fn_tree_provided = fn_tree is not None
      if is_fn_tree_provided:
          fn_tree = f"ivy.{fn_tree}"
      is_hypothesis_test = len(_given_kwargs) != 0
  
      possible_arguments = {}
      if is_hypothesis_test and is_fn_tree_provided:
          # Use the default strategy
          if number_positional_args is None:
              number_positional_args = num_positional_args(
                  fn_name=fn_tree
              )
          # Generate the test flags strategy
          possible_arguments["test_flags"] = pf.function_flags(
              ground_truth_backend=st.just(ground_truth_backend),
              num_positional_args=number_positional_args,
              instance_method=_get_runtime_flag_value(
                  test_instance_method
              ),
              with_out=_get_runtime_flag_value(test_with_out),
              with_copy=_get_runtime_flag_value(test_with_copy),
              test_gradients=_get_runtime_flag_value(test_gradients),
              test_trace=_get_runtime_flag_value(test_trace),
              transpile=_get_runtime_flag_value(transpile),
              as_variable=_get_runtime_flag_value(as_variable_flags),
              native_arrays=_get_runtime_flag_value(native_array_flags),
              container_flags=_get_runtime_flag_value(container_flags),
              precision_mode=_get_runtime_flag_value(precision_mode),
              test_cython_wrapper=_get_runtime_flag_value(
                  test_cython_wrapper
              ),
          )
  
      def test_wrapper(test_fn):
          if is_fn_tree_provided:
              callable_fn, fn_name, fn_mod = _import_fn(fn_tree)
              supported_device_dtypes = _get_supported_devices_dtypes(
                  fn_name, fn_mod
              )
              possible_arguments["fn_name"] = st.just(fn_name)
  
          # If a test is not a Hypothesis test, we only set the test global data
          if is_hypothesis_test:
              param_names = inspect.signature(test_fn).parameters.keys()
              # Check if these arguments are being asked for
              filtered_args = set(param_names).intersection(
                  possible_arguments.keys()
              )
              for key in filtered_args:
                  _given_kwargs[key] = possible_arguments[key]
              # Wrap the test with the @given decorator
  
              hypothesis_test_fn = given(**_given_kwargs)(test_fn)
  
              @functools.wraps(hypothesis_test_fn)
              def wrapped_test(*args, **kwargs):
                  try:
                      hypothesis_test_fn(*args, **kwargs)
                  except Exception as e:
                      # A string matching is used instead of actual exception due to
                      # exception object in with_backend is different from global Ivy
                      if (
                          e.__class__.__qualname__
                          == "IvyNotImplementedException"
                      ):
                          pytest.skip(
                              "Function not implemented in backend."
                          )
                      else:
                          raise e
  
          else:
              wrapped_test = test_fn
  
          # Set the test data to be used by test helpers
          if is_fn_tree_provided:
              wrapped_test.test_data = TestData(
                  test_fn=wrapped_test,
                  fn_tree=fn_tree,
                  fn_name=fn_name,
                  supported_device_dtypes=supported_device_dtypes,
              )
          wrapped_test._ivy_test = True
          wrapped_test.ground_truth_backend = ground_truth_backend
  
          return wrapped_test
  
      return test_wrapper
  
imports: import json
  import os
  import pytest
  import importlib
  import inspect
  import functools
  from typing import List, Optional
  from hypothesis import given, strategies
  import ivy.functional.frontends.numpy
  from .hypothesis_helpers import number_helpers
  from .globals import TestData
  from .None import test_parameter_flags
  from .None import test_globals
  from .pipeline_helper import BackendHandler
  from ivy_tests.test_ivy.helpers.test_parameter_flags import DynamicFlag, BuiltInstanceStrategy, BuiltAsVariableStrategy, BuiltNativeArrayStrategy, BuiltGradientStrategy, BuiltContainerStrategy, BuiltWithOutStrategy, BuiltWithCopyStrategy, BuiltInplaceStrategy, BuiltTraceStrategy, BuiltFrontendArrayStrategy, BuiltTranspileStrategy, BuiltPrecisionModeStrategy, BuiltCythonWrapperStrategy
  from ivy_tests.test_ivy.helpers.structs import FrontendMethodData
  from ivy_tests.test_ivy.helpers.available_frameworks import available_frameworks
  from ivy_tests.test_ivy.helpers.hypothesis_helpers.dtype_helpers import _dtype_kind_keys, _get_type_dict
  from .globals import mod_backend
label_desc: Use image node_id 11 for calling a global function with example usage: handle_test() and returns: test_wrapper, wrapped_test