code: def fetch_mnist(tensors=False):
      parse = lambda file: np.frombuffer(
          gzip.open(file).read(), dtype=np.uint8
      ).copy()
      BASE_URL = "https://storage.googleapis.com/cvdf-datasets/mnist/"  # http://yann.lecun.com/exdb/mnist/ lacks https
      X_train = (
          parse(fetch(f"{BASE_URL}train-images-idx3-ubyte.gz"))[0x10:]
          .reshape((-1, 28 * 28))
          .astype(np.float32)
      )
      Y_train = parse(fetch(f"{BASE_URL}train-labels-idx1-ubyte.gz"))[
          8:
      ].astype(np.int8)
      X_test = (
          parse(fetch(f"{BASE_URL}t10k-images-idx3-ubyte.gz"))[0x10:]
          .reshape((-1, 28 * 28))
          .astype(np.float32)
      )
      Y_test = parse(fetch(f"{BASE_URL}t10k-labels-idx1-ubyte.gz"))[
          8:
      ].astype(np.int8)
      if tensors:
          return (
              Tensor(X_train).reshape(-1, 1, 28, 28),
              Tensor(Y_train),
              Tensor(X_test).reshape(-1, 1, 28, 28),
              Tensor(Y_test),
          )
      else:
          return X_train, Y_train, X_test, Y_test
  
imports: import os, gzip, tarfile, pickle
  import numpy
  from tinygrad import Tensor, dtypes
  from tinygrad.helpers import fetch
label_desc: Use image node_id 1 for calling a global function with example usage: fetch_mnist(tensors) and returns: Tensor,  Tensor,  Tensor,  Tensor, X_train,  Y_train,  X_test,  Y_test