code: def create_datasets(
      dataset_path_dict,
      cfg,
      preload_vid_feat: bool,
      preload_text_feat: bool,
      eval=False,
  ):
      if eval:
          val_set = VideoDatasetFeatures(
              dataset_path_dict,
              cfg.dataset.val_split,
              cfg.dataset.max_frames,
              False,
              preload_vid_feat,
              preload_text_feat,
              0,
          )
          return val_set
      train_set = VideoDatasetFeatures(
          dataset_path_dict,
          cfg.CONFIG.COOT_DATA.TRAIN_SPLIT,
          cfg.CONFIG.COOT_DATA.MAX_FRAMES,
          True,
          preload_vid_feat,
          preload_text_feat,
          False,
      )
      val_set = VideoDatasetFeatures(
          dataset_path_dict,
          cfg.CONFIG.COOT_DATA.VALIDATION_SPLIT,
          cfg.CONFIG.COOT_DATA.MAX_FRAMES,
          False,
          preload_vid_feat,
          preload_text_feat,
          0,
      )
      return train_set, val_set
  
imports: import json
  from collections import OrderedDict
  from pathlib import Path
  from typing import List
  import re
  import numpy
  import torch
  import torch.utils.data
  from tqdm import tqdm
  from gluoncv.torch.utils import coot_utils
label_desc: Use image node_id 2 for calling a global function with example usage: create_datasets(dataset_path_dict, cfg, preload_vid_feat, preload_text_feat, eval) and returns: train_set,  val_set, val_set