code: def assert_parameters_equal(ref_params, params):
      def iter_all_param(parameters):
          for k in sorted(parameters.keys()):
              param_dict = parameters[k]
              yield len(param_dict)
              for param_name in sorted(param_dict.keys()):
                  yield param_name, param_dict[param_name]
  
      for a, b in zip(
          iter_all_param(ref_params), iter_all_param(params)
      ):
          if isinstance(a, tuple):
              ref_n, ref_v = a
              n, v = b
              assert ref_n == n
              assert ref_v.need_grad == v.need_grad
              assert ref_v.d.shape == v.d.shape
              assert_allclose(ref_v.d, v.d)
          else:
              print("{} <--> {}".format(a, b))
              assert a == b
  
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  import nnabla.parametric_functions
  from nnabla.testing import assert_allclose
  from helper import get_saved_test_model, forward_variable_and_check_equal, forward_variable, assert_topology, dump_network_topology
  import legacy_nnp_graph
  from nnabla.utils import nnp_graph
label_desc: Use image node_id 10 for calling a global function with example usage: assert_parameters_equal(ref_params, params) without return types