code: def get_mnist(path, name):
      path = pathlib.Path(path)
      x_path = str(path / "{}-images-idx3-ubyte.gz".format(name))
      y_path = str(path / "{}-labels-idx1-ubyte.gz".format(name))
  
      with gzip.open(x_path, "rb") as fx:
          fx.read(16)  # skip header
          # read/frombuffer is used instead of fromfile because fromfile does not
          # handle gzip file correctly
          x = np.frombuffer(fx.read(), dtype=np.uint8).reshape(-1, 784)
  
      with gzip.open(y_path, "rb") as fy:
          fy.read(8)  # skip header
          y = np.frombuffer(fy.read(), dtype=np.uint8)
  
      assert x.shape[0] == y.shape[0]
  
      x = x.astype(np.float32)
      x /= 255
      y = y.astype(np.int32)
      return chx.array(x), chx.array(y)
  
file_path: chainer/chainerx_cc/examples/mnist_py/train_mnist.py
imports: import argparse
  import gzip
  import pathlib
  import time
  import numpy
  import chainerx
label_desc: Use image node_id 4 for calling a global function with example usage: get_mnist(path, name) and returns: chx,  chx