code: def createFile(finalSize=2000000000):
      """Create a large HDF5 data file for testing.
      Data consists of 1M random samples tiled through the end of the array.
      """
  
      chunk = np.random.normal(size=1000000).astype(np.float32)
  
      f = h5py.File("test.hdf5", "w")
      f.create_dataset(
          "data", data=chunk, chunks=True, maxshape=(None,)
      )
      data = f["data"]
  
      nChunks = finalSize // (chunk.size * chunk.itemsize)
      with pg.ProgressDialog(
          "Generating test.hdf5...", 0, nChunks
      ) as dlg:
          for i in range(nChunks):
              newshape = [data.shape[0] + chunk.shape[0]]
              data.resize(newshape)
              data[-chunk.shape[0] :] = chunk
              dlg += 1
              if dlg.wasCanceled():
                  f.close()
                  os.remove("test.hdf5")
                  sys.exit()
          dlg += 1
      f.close()
  
file_path: pyqtgraph/pyqtgraph/examples/hdf5.py
imports: import os
  import sys
  import h5py
  import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtWidgets
label_desc: Use image node_id 1 for calling a global function with example usage: createFile(finalSize) without return types