code: def process_charades_label(x, mode, num_classes):
      """
      Process the video label for Charades dataset. Use video-level label for
      training mode, otherwise use clip-level label. Then convert the label into
      a binary vector.
      Args:
          x (dict): a video clip including label index.
          mode (string): Options includes `train`, `val`, or `test` mode.
          num_classes (int): Number of classes in the dataset.
  
      Returns:
          x (dict): video clip with updated label information.
      """
      label = (
          utils.aggregate_labels(x["label"])
          if mode == "train"
          else x["video_label"]
      )
      x["label"] = torch.as_tensor(
          utils.as_binary_vector(label, num_classes)
      )
  
      return x
  
imports: import functools
  import os
  from typing import Dict
  import torch
  from torch.utils.data import DistributedSampler, RandomSampler, SequentialSampler
  from torchvision.transforms import Compose, Lambda
  from torchvision.transforms._transforms_video import NormalizeVideo, RandomCropVideo, RandomHorizontalFlipVideo
  import slowfast.utils.logging
  from pytorchvideo.data import Charades, LabeledVideoDataset, SSv2, make_clip_sampler
  from pytorchvideo.data.labeled_video_paths import LabeledVideoPaths
  from pytorchvideo.transforms import ApplyTransformToKey, RandomShortSideScale, ShortSideScale, UniformCropVideo, UniformTemporalSubsample
  from .None import utils
  from .build import DATASET_REGISTRY
label_desc: Use image node_id 3 for calling a global function with example usage: process_charades_label(x, mode, num_classes) and returns: x