code: def _get_train_data_loader(
      training_dir, is_distributed, batch_size, **kwargs
  ):
      logger.info("Get train data loader")
      dataset = datasets.MNIST(
          training_dir,
          train=True,
          transform=transforms.Compose(
              [
                  transforms.ToTensor(),
                  transforms.Normalize((0.1307,), (0.3081,)),
              ]
          ),
          download=False,  # True sets a dependency on an external site for our canaries.
      )
      train_sampler = (
          torch.utils.data.distributed.DistributedSampler(dataset)
          if is_distributed
          else None
      )
      train_loader = torch.utils.data.DataLoader(
          dataset,
          batch_size=batch_size,
          shuffle=train_sampler is None,
          sampler=train_sampler,
          **kwargs,
      )
      return train_sampler, train_loader
  
imports: import argparse
  import json
  import logging
  import os
  import sys
  import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
  import torch.optim
  import torch.utils.data
  import torch.utils.data.distributed
  from torchvision import datasets, transforms
label_desc: Use image node_id 1 for calling a global function with example usage: _get_train_data_loader(training_dir, is_distributed, batch_size) and returns: train_sampler,  train_loader