code: def load_data():
      mnist_transforms = transforms.Compose(
          [
              transforms.ToTensor(),
              transforms.Normalize((0.1307,), (0.3081,)),
          ]
      )
      with FileLock(os.path.expanduser("~/data.lock")):
          train_loader = torch.utils.data.DataLoader(
              datasets.MNIST(
                  "~/data",
                  train=True,
                  download=True,
                  transform=mnist_transforms,
              ),
              batch_size=64,
              shuffle=True,
          )
          test_loader = torch.utils.data.DataLoader(
              datasets.MNIST(
                  "~/data",
                  train=False,
                  download=True,
                  transform=mnist_transforms,
              ),
              batch_size=64,
              shuffle=True,
          )
      return train_loader, test_loader
  
file_path: ray/doc/source/tune/doc_code/pytorch_optuna.py
imports: import os
  from filelock import FileLock
  import torch.nn
  import torch.nn.functional
  from torchvision import datasets, transforms
  import torch
  from ray import train, tune
  from ray.tune.search.optuna import OptunaSearch
label_desc: Use image node_id 3 for calling a global function with example usage: load_data() and returns: train_loader,  test_loader