code: def test_multiple_steps(fun, x_min, param, num_freq):
      """Tests that repeated steps execute as expected."""
      param = tuple(np.array(p, requires_grad=True) for p in param)
      substep_optimizer = "brute"
      substep_kwargs = None
      opt = RotosolveOptimizer(substep_optimizer, substep_kwargs)
  
      for _ in range(3):
          param = opt.step(
              fun,
              *param,
              nums_frequency=num_freq,
          )
          # The following accounts for the unpacking functionality for length-one param
          if len(x_min) == 1:
              param = (param,)
  
      assert (np.isscalar(x_min) and np.isscalar(param)) or len(
          x_min
      ) == len(param)
      assert np.allclose(
          np.fromiter(_flatten(x_min), dtype=float),
          np.fromiter(_flatten(param), dtype=float),
          atol=1e-5,
      )
  
imports: import functools
  import pytest
  from scipy.optimize import shgo
  import pennylane
  from pennylane import numpy
  from pennylane.utils import _flatten, unflatten
  from pennylane.optimize import RotosolveOptimizer
label_desc: Use image node_id 8 for calling a global function with example usage: test_multiple_steps(fun, x_min, param, num_freq) without return types