code: def generate_csv_png(num_of_data, img_size):
      with create_temp_with_dir("test.csv") as csvfilename:
          imgdir = os.path.dirname(csvfilename)
          with open(csvfilename, "w") as f:
              f.write("x:image,y\n")
              for n in range(0, num_of_data):
                  x = np.identity(img_size).astype(numpy.uint8) * n
                  img_name = "image_{}.png".format(n)
                  with warnings.catch_warnings():
                      warnings.simplefilter("ignore")
                      imsave(os.path.join(imgdir, img_name), x)
                  f.write("{}, {}\n".format(img_name, n % 10))
          yield csvfilename
  
imports: import io
  import os
  import tempfile
  import warnings
  import numpy
  import nnabla
  import numpy
  from shutil import rmtree
  from contextlib import contextmanager
  from nnabla.utils import nnabla_pb2
  from nnabla.utils.image_utils import imsave
  import google.protobuf.text_format
  from nnabla.utils.nnp_format import nnp_version
  from nnabla.parameter import get_parameter_or_create
  from nnabla.utils.get_file_handle import get_file_handle_save
  from nnabla.utils.converter.nnabla import NnpExpander
  from nnabla.initializer import NormalInitializer, UniformInitializer, ConstantInitializer, RangeInitializer, calc_normal_std_he_forward, calc_normal_std_he_backward, calc_normal_std_glorot, calc_uniform_lim_glorot
label_desc: Use image node_id 3 for calling a global function with example usage: generate_csv_png(num_of_data, img_size) without return types