code: def get_train_dataset(
      dataset_root: str, args: argparse.Namespace
  ) -> torch.utils.data.Dataset:
      datasets = []
      for dataset_name in args.train_datasets:
          transform = make_train_transform(args)
          dataset = make_dataset(dataset_name, dataset_root, transform)
          datasets.append(dataset)
  
      if len(datasets) == 0:
          raise ValueError("No datasets specified for training")
  
      samples_per_step = args.world_size * args.batch_size
  
      for idx, (dataset, steps_per_dataset) in enumerate(
          zip(datasets, args.dataset_steps)
      ):
          datasets[idx] = resize_dataset_to_n_steps(
              dataset, steps_per_dataset, samples_per_step, args
          )
  
      dataset = torch.utils.data.ConcatDataset(datasets)
      if args.dataset_order_shuffle:
          dataset = shuffle_dataset(dataset)
  
      print(f"Training dataset: {len(dataset)} samples")
      return dataset
  
imports: import argparse
  import os
  import warnings
  from pathlib import Path
  from typing import List, Union
  import numpy
  import torch
  import torch.distributed
  import torchvision.models.optical_flow
  import torchvision.prototype.models.depth.stereo
  import utils
  import visualization
  from parsing import make_dataset, make_eval_transform, make_train_transform, VALID_DATASETS
  from torch import nn
  from torchvision.transforms.functional import get_dimensions, InterpolationMode, resize
  from utils.metrics import AVAILABLE_METRICS
  from utils.norm import freeze_batch_norm
label_desc: Use image node_id 5 for calling a global function with example usage: get_train_dataset(dataset_root, args) and returns: dataset