code: def test_optimizer_step_with_dict_same_as_step_with_numpy_array(
      optimizer,
  ):
      w_dict = {i: random.uniform(-5, 5) for i in range(10)}
      w_vector = np.asarray(list(w_dict.values()))
  
      g_dict = {i: random.uniform(-5, 5) for i in range(10)}
      g_vector = np.asarray(list(g_dict.values()))
  
      w_dict = optimizer._step_with_dict(w_dict, g_dict)
      try:
          w_vector = optimizer.clone()._step_with_vector(
              w_vector, g_vector
          )
      except NotImplementedError:
          pytest.skip("step_with_vector not implemented")
  
      for i, w in dict(enumerate(w_vector)).items():
          assert math.isclose(w, w_dict[i])
  
file_path: river/river/optim/test_.py
imports: from __future__ import annotations
  import importlib
  import inspect
  import math
  import random
  import typing
  import numpy
  import pytest
  from river import optim, utils
label_desc: Use image node_id 5 for calling a global function with example usage: test_optimizer_step_with_dict_same_as_step_with_numpy_array(optimizer) without return types