code: def _auto_parametrize_target(metafunc):
      """Automatically applies parametrize_targets
  
      Used if a test function uses the "target" fixture, but isn't
      already marked with @tvm.testing.parametrize_targets.  Intended
      for use in the pytest_generate_tests() handler of a conftest.py
      file.
  
      """
  
      if "target" in metafunc.fixturenames:
          # Check if any explicit parametrizations exist, and apply one
          # if they do not.  If the function is marked with either
          # excluded or known failing targets, use these to determine
          # the targets to be used.
          parametrized_args = [
              arg.strip()
              for mark in metafunc.definition.iter_markers(
                  "parametrize"
              )
              for arg in mark.args[0].split(",")
          ]
          if "target" not in parametrized_args:
              excluded_targets = getattr(
                  metafunc.function, "tvm_excluded_targets", []
              )
  
              # Add a parametrize marker instead of calling
              # metafunc.parametrize so that the parametrize rewriting
              # can still occur.
              mark = pytest.mark.parametrize(
                  "target",
                  [
                      t["target"]
                      for t in utils._get_targets()
                      if t["target_kind"] not in excluded_targets
                  ],
                  scope="session",
              )
              metafunc.definition.add_marker(mark)
  
file_path: tvm/python/tvm/testing/plugin.py
imports: import pytest
  import _pytest
  import tvm
  from tvm.testing import utils
label_desc: Use image node_id 7 for calling a global function with example usage: _auto_parametrize_target(metafunc) without return types