code: def make_batched(videos) -> List[List[ImageInput]]:
      if (
          isinstance(videos, (list, tuple))
          and isinstance(videos[0], (list, tuple))
          and is_valid_image(videos[0][0])
      ):
          return videos
  
      elif isinstance(videos, (list, tuple)) and is_valid_image(
          videos[0]
      ):
          return [videos]
  
      elif is_valid_image(videos):
          return [[videos]]
  
      raise ValueError(f"Could not make batched video from {videos}")
  
file_path: transformers/src/transformers/models/vivit/image_processing_vivit.py
imports: from typing import Dict, List, Optional, Union
  import numpy
  from transformers.utils import is_vision_available
  from transformers.utils.generic import TensorType
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import get_resize_output_image_size, rescale, resize, to_channel_dimension_format
  from ...image_utils import IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD, ChannelDimension, ImageInput, PILImageResampling, infer_channel_dimension_format, is_scaled_image, is_valid_image, to_numpy_array, valid_images
  from ...utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: make_batched(videos) and returns: videos, list, list