code: def split_observations(
      split=0.5,
      dir="/tmp",
      party1="alice",
      party2="bob",
      reduced=None,
      binary=False,
  ):
      """Splits observations between Party 1 and Party 2"""
      mnist_norm, mnist_labels = _get_norm_mnist(dir, reduced, binary)
      mnist_train_norm, mnist_test_norm = mnist_norm
      mnist_train_labels, mnist_test_labels = mnist_labels
  
      num_train_obs = mnist_train_norm.shape[0]
      obs_train_split = int(split * num_train_obs)
      num_test_obs = mnist_test_norm.shape[0]
      obs_test_split = int(split * num_test_obs)
  
      party1_train = mnist_train_norm[:obs_train_split, :, :]
      party2_train = mnist_train_norm[obs_train_split:, :, :]
      party1_test = mnist_test_norm[:obs_test_split, :, :]
      party2_test = mnist_test_norm[obs_test_split:, :, :]
      torch.save(party1_train, os.path.join(dir, party1 + "_train.pth"))
      torch.save(party2_train, os.path.join(dir, party2 + "_train.pth"))
      torch.save(party1_test, os.path.join(dir, party1 + "_test.pth"))
      torch.save(party2_test, os.path.join(dir, party2 + "_test.pth"))
  
      party1_train_labels = mnist_train_labels[:obs_train_split]
      party1_test_labels = mnist_test_labels[:obs_test_split]
      party2_train_labels = mnist_train_labels[obs_train_split:]
      party2_test_labels = mnist_test_labels[obs_test_split:]
  
      torch.save(
          party1_train_labels,
          os.path.join(dir, party1 + "_train_labels.pth"),
      )
      torch.save(
          party1_test_labels,
          os.path.join(dir, party1 + "_test_labels.pth"),
      )
      torch.save(
          party2_train_labels,
          os.path.join(dir, party2 + "_train_labels.pth"),
      )
      torch.save(
          party2_test_labels,
          os.path.join(dir, party2 + "_test_labels.pth"),
      )
  
file_path: CrypTen/tutorials/mnist_utils.py
imports: import argparse
  import os
  import torch
  from torchvision import datasets, transforms
label_desc: Use image node_id 3 for calling a global function with example usage: split_observations(split, dir, party1, party2, reduced, binary) without return types