class_docstr: Base AudioVideo Reader
  
  Args:
      opts: command line arguments
      is_training: Training or validation mode. Default: `False`.
class_docstr_tok: ["Base","AudioVideo","Reader","Args",":","opts",":","command","line","arguments","is_training",":","Training","or","validation","mode",".","Default",":","`","False","`","."]
docstr: For a given video, sample `clips_per_video` indices uniformly along with aligned
  audio indices (optionally).
  
  Args:
      total_video_frames : number of video frames in the given video.
      video_frames_per_clip : number of frames required per clip.
      clips_per_video : number of clips needed from a given video.
      total_audio_frames : number of audio frames in the given video.
  
  Return:
      vclip_ids : indices corresponding to video frames [Tensor (clips_per_video x
          video_frames_per_clip)].
      aclip_ids : indices corresponding to audio frames [Tensor (clips_per_video x
          audio_frames_per_clip)].
docstr_tok: ["For","a","given","video",",","sample","`","clips_per_video","`","indices","uniformly","along","with","aligned","audio","indices","(","optionally",")",".","Args",":","total_video_frames",":","number","of","video","frames","in","the","given","video",".","video_frames_per_clip",":","number","of","frames","required","per","clip",".","clips_per_video",":","number","of","clips","needed","from","a","given","video",".","total_audio_frames",":","number","of","audio","frames","in","the","given","video",".","Return",":","vclip_ids",":","indices","corresponding","to","video","frames","[","Tensor","(","clips_per_video","x","video_frames_per_clip",")","]",".","aclip_ids",":","indices","corresponding","to","audio","frames","[","Tensor","(","clips_per_video","x","audio_frames_per_clip",")","]","."]
code: def uniform_sampling(
      total_video_frames: int,
      video_frames_per_clip: int,
      clips_per_video: int,
      total_audio_frames: Optional[int] = None,
  ) -> Tuple[Tensor, Optional[Tensor]]:
      """
      For a given video, sample `clips_per_video` indices uniformly along with aligned
      audio indices (optionally).
  
      Args:
          total_video_frames : number of video frames in the given video.
          video_frames_per_clip : number of frames required per clip.
          clips_per_video : number of clips needed from a given video.
          total_audio_frames : number of audio frames in the given video.
  
      Return:
          vclip_ids : indices corresponding to video frames [Tensor (clips_per_video x
              video_frames_per_clip)].
          aclip_ids : indices corresponding to audio frames [Tensor (clips_per_video x
              audio_frames_per_clip)].
      """
      clip_start_frame_ids = torch.linspace(
          0, total_video_frames - video_frames_per_clip, clips_per_video
      )
      vclip_ids = (
          clip_start_frame_ids[:clips_per_video, None]
          + torch.arange(video_frames_per_clip)
      ).long()
  
      aclip_ids = None
      if total_audio_frames is not None:
          a_start_frame = (
              clip_start_frame_ids
              * total_audio_frames
              / total_video_frames
          ).long()
          a_step_size = int(
              video_frames_per_clip
              * total_audio_frames
              / total_video_frames
          )
          aclip_ids = a_start_frame[
              :clips_per_video, None
          ] + torch.arange(a_step_size)
      return vclip_ids, aclip_ids
  
imports: import argparse
  import random
  from typing import Dict, Optional, Tuple
  import av
  import numpy
  import torch
  import torch.nn.functional
  from torch import Tensor
  from data.transforms import BaseTransformation
  from data.transforms import image_pil
  from data.transforms.common import Compose
  from options.utils import extend_selected_args_with_prefix, extract_opts_with_prefix_replacement
  from utils import logger
label_desc: Use image node_id 9 for calling the BaseAVReader obj's underlying member method code with example usage: obj.uniform_sampling(total_video_frames, video_frames_per_clip, clips_per_video, total_audio_frames) and returns: vclip_ids,  aclip_ids