code: def get_search_datasets(config):
      train_data, test_data = _imagenet_dataset(config)
      num_train = len(train_data)
      indices = list(range(num_train))
      split_mid = int(np.floor(0.5 * num_train))
  
      if config.distributed:
          train_sampler = SubsetDistributedSampler(
              train_data, indices[:split_mid]
          )
          valid_sampler = SubsetDistributedSampler(
              train_data, indices[split_mid:num_train]
          )
      else:
          train_sampler = torch.utils.data.sampler.SubsetRandomSampler(
              indices[:split_mid]
          )
          valid_sampler = torch.utils.data.sampler.SubsetRandomSampler(
              indices[split_mid:num_train]
          )
  
      train_loader = torch.utils.data.DataLoader(
          train_data,
          batch_size=config.batch_size,
          sampler=train_sampler,
          pin_memory=True,
          num_workers=config.workers,
      )
  
      valid_loader = torch.utils.data.DataLoader(
          train_data,
          batch_size=config.batch_size,
          sampler=valid_sampler,
          pin_memory=True,
          num_workers=config.workers,
      )
  
      return [train_loader, valid_loader], [
          train_sampler,
          valid_sampler,
      ]
  
file_path: nni/examples/nas/legacy/cdarts/datasets/imagenet.py
imports: import os
  import numpy
  import torch
  import torchvision.datasets
  import torchvision.transforms
  from datasets.data_utils import ImageNetPolicy
  from datasets.data_utils import SubsetDistributedSampler
label_desc: Use image node_id 2 for calling a global function with example usage: get_search_datasets(config) and returns: list,  list