code: def download_dataset(train: bool) -> Any:
      download_directory = "data"
      os.makedirs(download_directory, exist_ok=True)
      # Use a file lock so that workers on the same node attempt the download one at a time.
      # The first worker will actually perform the download, while the subsequent workers will
      # see that the dataset is downloaded and skip.
      with filelock.FileLock(os.path.join(download_directory, "lock")):
          return datasets.MNIST(
              download_directory,
              train=train,
              transform=transforms.Compose(
                  [
                      transforms.ToTensor(),
                      # These are the precomputed mean and standard deviation of the
                      # MNIST data; this normalizes the data to have zero mean and unit
                      # standard deviation.
                      transforms.Normalize((0.1307,), (0.3081,)),
                  ]
              ),
              download=True,
          )
  
file_path: determined/examples/features/inference_mnist_pytorch/inference.py
imports: import os
  from typing import Any
  import filelock
  import torch
  from torchvision import datasets, transforms
  from determined import pytorch
  from determined.experimental import client
  from determined.pytorch import experimental
label_desc: Use image node_id 1 for calling a global function with example usage: download_dataset(train) and returns: datasets