code: def load_dataset(
      cf, logger, subset_ixs=None, pp_data_path=None, pp_name=None
  ):
      """
      loads the dataset. if deployed in cloud also copies and unpacks the data to the working directory.
      :param subset_ixs: subset indices to be loaded from the dataset. used e.g. for testing to only load the test folds.
      :return: data: dictionary with one entry per patient (in this case per patient-breast, since they are treated as
      individual images for training) each entry is a dictionary containing respective meta-info as well as paths to the preprocessed
      numpy arrays to be loaded during batch-generation
      """
      if pp_data_path is None:
          pp_data_path = cf.pp_data_path
      if pp_name is None:
          pp_name = cf.pp_name
      if cf.server_env:
          copy_data = True
          target_dir = os.path.join(cf.data_dest, pp_name)
          if not os.path.exists(target_dir):
              cf.data_source_dir = pp_data_path
              os.makedirs(target_dir)
              subprocess.call(
                  "rsync -av {} {}".format(
                      os.path.join(
                          cf.data_source_dir, cf.input_df_name
                      ),
                      os.path.join(target_dir, cf.input_df_name),
                  ),
                  shell=True,
              )
              logger.info(
                  "created target dir and info df at {}".format(
                      os.path.join(target_dir, cf.input_df_name)
                  )
              )
  
          elif subset_ixs is None:
              copy_data = False
  
          pp_data_path = target_dir
  
      p_df = pd.read_pickle(
          os.path.join(pp_data_path, cf.input_df_name)
      )
  
      if subset_ixs is not None:
          subset_pids = [
              np.unique(p_df.pid.tolist())[ix] for ix in subset_ixs
          ]
          p_df = p_df[p_df.pid.isin(subset_pids)]
          logger.info(
              "subset: selected {} instances from df".format(len(p_df))
          )
  
      if cf.server_env:
          if copy_data:
              copy_and_unpack_data(
                  logger,
                  p_df.pid.tolist(),
                  cf.fold_dir,
                  cf.data_source_dir,
                  target_dir,
              )
  
      class_targets = p_df["class_id"].tolist()
      pids = p_df.pid.tolist()
      imgs = [
          os.path.join(pp_data_path, "{}.npy".format(pid))
          for pid in pids
      ]
      segs = [
          os.path.join(pp_data_path, "{}.npy".format(pid))
          for pid in pids
      ]
  
      data = OrderedDict()
      for ix, pid in enumerate(pids):
          data[pid] = {
              "data": imgs[ix],
              "seg": segs[ix],
              "pid": pid,
              "class_target": [class_targets[ix]],
          }
  
      return data
  
imports: import numpy
  import os
  from collections import OrderedDict
  import pandas
  import pickle
  import time
  import subprocess
  import utils.dataloader_utils
  from batchgenerators.dataloading.data_loader import SlimDataLoaderBase
  from batchgenerators.transforms.spatial_transforms import MirrorTransform
  from batchgenerators.transforms.abstract_transforms import Compose
  from batchgenerators.dataloading.multi_threaded_augmenter import MultiThreadedAugmenter
  from batchgenerators.dataloading import SingleThreadedAugmenter
  from batchgenerators.transforms.spatial_transforms import SpatialTransform
  from batchgenerators.transforms.crop_and_pad_transforms import CenterCropTransform
  from batchgenerators.transforms.utility_transforms import ConvertSegToBoundingBoxCoordinates
label_desc: Use image node_id 3 for calling a global function with example usage: load_dataset(cf, logger, subset_ixs, pp_data_path, pp_name) and returns: data