code: def get_val_dataloader(val_ds: Any, cfg: Any, verbose: bool = True):
      """Prepares validation DataLoader.
  
      Args:
          val_ds: validation Dataset
          cfg: input config
          verbose: verbose
  
      Returns:
          Validation Dataloader
      """
  
      sampler: Sampler
      if (
          cfg.environment._distributed
          and cfg.environment._distributed_inference
      ):
          sampler = OrderedDistributedSampler(
              val_ds,
              num_replicas=cfg.environment._world_size,
              rank=cfg.environment._local_rank,
          )
      else:
          sampler = SequentialSampler(val_ds)
  
      batch_size = get_inference_batch_size(cfg)
  
      val_dataloader = DataLoader(
          val_ds,
          sampler=sampler,
          batch_size=batch_size,
          num_workers=cfg.environment.number_of_workers,
          pin_memory=True,
          collate_fn=val_ds.get_validation_collate_fn(),
          worker_init_fn=worker_init_fn,
      )
  
      if verbose and cfg.environment._local_rank == 0:
          logger.info(
              f"Number of observations in validation dataset: {len(val_ds)}"
          )
  
      return val_dataloader
  
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 14 for calling a global function with example usage: get_val_dataloader(val_ds, cfg, verbose) and returns: val_dataloader