code: def preprocess_mnist(context_manager):
      if context_manager is None:
          context_manager = NoopContextManager()
  
      with context_manager:
          # each party gets a unique temp directory
          with tempfile.TemporaryDirectory() as data_dir:
              mnist_train = datasets.MNIST(
                  data_dir, download=True, train=True
              )
              mnist_test = datasets.MNIST(
                  data_dir, download=True, train=False
              )
  
      # modify labels so all non-zero digits have class label 1
      mnist_train.targets[mnist_train.targets != 0] = 1
      mnist_test.targets[mnist_test.targets != 0] = 1
      mnist_train.targets[mnist_train.targets == 0] = 0
      mnist_test.targets[mnist_test.targets == 0] = 0
  
      # compute normalization factors
      data_all = torch.cat([mnist_train.data, mnist_test.data]).float()
      data_mean, data_std = data_all.mean(), data_all.std()
      tensor_mean, tensor_std = data_mean.unsqueeze(
          0
      ), data_std.unsqueeze(0)
  
      # normalize data
      data_train_norm = transforms.functional.normalize(
          mnist_train.data.float(), tensor_mean, tensor_std
      )
  
      # partition features between Alice and Bob
      data_alice = data_train_norm[:, :, :20]
      data_bob = data_train_norm[:, :, 20:]
      train_labels = mnist_train.targets
  
      return data_alice, data_bob, train_labels
  
file_path: CrypTen/examples/mpc_autograd_cnn/mpc_autograd_cnn.py
imports: import tempfile
  import crypten
  import crypten.communicator
  import torch
  import torch.nn
  import torch.nn.functional
  from examples.util import NoopContextManager
  from torchvision import datasets, transforms
label_desc: Use image node_id 3 for calling a global function with example usage: preprocess_mnist(context_manager) and returns: data_alice,  data_bob,  train_labels