code: def test_gen_loop_control_cases(cases):
      d, s, params = cases
      if not os.path.exists(d):
          os.makedirs(d)
      with open(os.path.join(d, "net.nntxt"), "w") as f:
          f.write(s)
  
      with h5py.File(os.path.join(d, "parameters.h5"), "w") as f:
          if params:
              for i, (param_name, shape) in enumerate(params):
                  f[param_name] = np.random.random(shape)
                  f[param_name].attrs["need_grad"] = 1
                  f[param_name].attrs["index"] = i
  
imports: import os
  import pytest
  import h5py
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: test_gen_loop_control_cases(cases) without return types