code: def gen_hdf(
      fn, lshape, N, mean=None, autoencode=False, multidimout=False
  ):
      """
      generates the hdf file with the data for testing
      Arguments:
          fn (str): filename
          lshape (tuple/list): shape of the input data
          N (int): number of data points (input/output pairs)
          mean (optional, tuple/list or ndarray): mean values
      """
      (C, H, W) = lshape
  
      dat = np.arange(N * C * H * W).reshape((N, C * H * W))
  
      h5f = h5py.File(fn, "w")
      inp = h5f.create_dataset("input", dat.shape)
      inp[:] = dat.copy()
      inp.attrs["lshape"] = (C, H, W)
      if mean is not None:
          mean_ = h5f.create_dataset("mean", mean.shape)
          mean_[:] = mean
  
      if not autoencode:
          if multidimout:
              out = h5f.create_dataset("output", dat.shape)
              out[:] = dat[:, ::-1].copy()
          else:
              out = h5f.create_dataset("output", (N, 1), dtype="i8")
              out[:, 0] = np.arange(N)
              out.attrs["nclass"] = N
  
      h5f.close()
      return
  
file_path: neon/tests/test_hdf5iterator.py
imports: import os
  import math
  import h5py
  import pytest
  import logging
  import tempfile
  import numpy
  from neon import NervanaObject
  from neon.data import HDF5Iterator, HDF5IteratorOneHot, HDF5IteratorAutoencoder
  from utils import allclose_with_out
label_desc: Use image node_id 1 for calling a global function with example usage: gen_hdf(fn, lshape, N, mean, autoencode, multidimout) without return types