code: def take_samples(digits, n_samples=100):
      """Returns images and labels based on sample size"""
      images, labels = [], []
  
      for i, digit in enumerate(digits):
          if i == n_samples:
              break
          image, label = digit
          images.append(image)
          label_one_hot = torch.nn.functional.one_hot(
              torch.tensor(label), 10
          )
          labels.append(label_one_hot)
  
      images = torch.cat(images)
      labels = torch.stack(labels)
      return images, labels
  
file_path: CrypTen/pycon-workshop-2020/training_across_parties.py
imports: import sys
  import crypten
  import torch
  import torchvision
  from multiprocess_launcher import MultiProcessLauncher
label_desc: Use image node_id 2 for calling a global function with example usage: take_samples(digits, n_samples) and returns: images,  labels