code: def xfail_if_unseeded_model_chosen(request: SubRequest):
      """Adds a xfail mark on tests that relate to seeding when non-seeded model is chosen."""
      # TODO: Can't refer to the tests by reference because of `parametrize_this`: their `__name__`
      # becomes "method". If/when we rework `parametrize_this` or change the name of tests, it'll
      # be important to update this as well.
      # NOTE: Also, normally I'd add a fixture to only these tests, but that's not currently possible:
      # It seems like the signature of these tests can't be changed, because of `@phase` and/or
      # `parametrize_this`.
      tests_that_check_seeding = [
          TestHEBO.test_seed_rng,
          TestHEBO.test_seed_rng_init,
          TestHEBO.test_state_dict,
      ]
  
      model_name: str = request.getfixturevalue("model_name")
  
      if model_name in properly_seeded_models:
          return  # Don't add any mark, the test is expected to pass.
  
      # NOTE: We need to detect the phase. The reason for this is so we can avoid having a
      # bunch of tests XPASS when the test is ran in the random phase (where some do work).
      phase: TestPhase = request.getfixturevalue("phase")
      if phase.n_trials == 0:
          return
  
      # NOTE: Also can't use `request.function` because of `parametrize_this`, since it points
      # to the local closure inside `parametrize_this`.
      # if request.function in test_that_check_seeding:
      if any(
          func.__name__ == request.function.__name__
          for func in tests_that_check_seeding
      ):
          request.node.add_marker(
              pytest.mark.xfail(
                  reason=f"This model name {model_name} is not properly seeded.",
              )
          )
  
file_path: orion/tests/unittests/algo/long/hebo/test_hebo.py
imports: from __future__ import annotations
  import dataclasses
  import typing
  from typing import ClassVar
  import pytest
  from orion.algo.hebo.hebo_algo import HEBO, EvolutionStrategyName, ModelName, import_optional, properly_seeded_models
  from orion.testing.algo import BaseAlgoTests, TestPhase, first_phase_only
  from hebo.models.model_factory import model_dict
  from pymoo.factory import get_algorithm_options
label_desc: Use image node_id 5 for calling a global function with example usage: xfail_if_unseeded_model_chosen(request) without return types