code: def vid_pipeline(num_frames, width, height, seq_layout):
      vid, _ = fn.readers.video_resize(
          filenames=[vid_file],
          labels=[],
          name="video reader",
          sequence_length=num_frames,
          file_list_include_preceding_frame=True,
          device="gpu",
          seed=42,
          resize_x=width,
          resize_y=height,
      )
      if seq_layout == "FCHW":
          vid = fn.transpose(vid, perm=[0, 3, 1, 2])
      elif seq_layout == "CFHW":
          vid = fn.transpose(vid, perm=[3, 0, 1, 2])
      else:
          assert seq_layout == "FHWC"
      return vid
  
imports: import os
  import random
  import numpy
  from typing import List, Union, Callable, Optional
  from dataclasses import dataclass, field
  from nvidia.dali import pipeline_def
  import nvidia.dali.fn
  from nvidia.dali import types
  import nvidia.dali.tensors
  from test_utils import get_dali_extra_path, check_batch
label_desc: Use image node_id 15 for calling a global function with example usage: vid_pipeline(num_frames, width, height, seq_layout) and returns: vid