code: def get_val_dataset(
      val_df: pd.DataFrame, cfg: Any, verbose: bool = True
  ):
      """Prepares validation Dataset.
  
      Args:
          val_df: validation DataFrame
          cfg: input config
          verbose: verbose
  
      Returns:
          Validation Dataset
      """
  
      if verbose and cfg.environment._local_rank == 0:
          logger.info("Loading validation dataset...")
      val_dataset = cfg.dataset.dataset_class(
          df=val_df, cfg=cfg, mode="validation"
      )
  
      return val_dataset
  
imports: import logging
  import math
  import os
  from typing import Any, DefaultDict, Dict, List, Optional, Tuple, Union, no_type_check
  import networkx
  import numpy
  import pandas
  import pyarrow.parquet
  import torch
  from sklearn.model_selection import GroupShuffleSplit, train_test_split
  from torch import distributed
  from torch.utils.data import DataLoader, Sampler, SequentialSampler
  from llm_studio.src.datasets.conversation_chain_handler import ConversationChainHandler
  from llm_studio.src.utils.exceptions import LLMDataException
  from llm_studio.src.utils.utils import PatchedAttribute, set_seed
label_desc: Use image node_id 13 for calling a global function with example usage: get_val_dataset(val_df, cfg, verbose) and returns: val_dataset