code: def weak_promotion(request):
      """
      Fixture to ensure "legacy" promotion state or change it to use the new
      weak promotion (plus warning).  `old_promotion` should be used as a
      parameter in the function.
      """
      state = numpy._get_promotion_state()
      if request.param:
          numpy._set_promotion_state("weak_and_warn")
      else:
          numpy._set_promotion_state("legacy")
  
      yield request.param
      numpy._set_promotion_state(state)
  
file_path: catboost/contrib/python/numpy/py3/numpy/conftest.py
imports: import os
  import tempfile
  import hypothesis
  import pytest
  import numpy
  from numpy.core._multiarray_tests import get_fpu_mode
label_desc: Use image node_id 8 for calling a global function with example usage: weak_promotion(request) without return types