code: def download_mnist(split="train"):
      """
      Loads split from the MNIST dataset and returns data.
      """
      train = split == "train"
  
      # If need to downkload MNIST dataset and uncompress,
      # it is necessary to create a separate for each process.
      mnist_exists = os.path.exists(
          os.path.join(
              "/tmp/MNIST/processed",
              MNIST.training_file if train else MNIST.test_file,
          )
      )
  
      if mnist_exists:
          mnist_root = "/tmp"
      else:
          rank = "0" if "RANK" not in os.environ else os.environ["RANK"]
          mnist_root = os.path.join("tmp", "bandits", rank)
          os.makedirs(mnist_root, exist_ok=True)
  
      # download the MNIST dataset:
      with NoopContextManager():
          mnist = MNIST(
              mnist_root, download=not mnist_exists, train=train
          )
      return mnist
  
file_path: CrypTen/examples/bandits/launcher.py
imports: import argparse
  import logging
  import os
  import random
  import examples.util
  import torch
  import visdom
  from examples.multiprocess_launcher import MultiProcessLauncher
  from examples.util import NoopContextManager, process_mnist_files
  from torchvision.datasets.mnist import MNIST
label_desc: Use image node_id 2 for calling a global function with example usage: download_mnist(split) and returns: mnist