code: def generate_thumbnail(data_sample: DataSample, overwrite=False):
      video_thumbnail_frame = get_vis_thumb_location(data_sample)
      if os.path.isfile(video_thumbnail_frame) and not overwrite:
          return
      os.makedirs(os.path.dirname(video_thumbnail_frame), exist_ok=True)
  
      video_file = get_vis_video_location(data_sample)
  
      #### Generate Thumbnail ####
      vid = VideoFrameReader(video_file)
      img, ts = vid.get_frame(30) if len(vid) > 30 else vid.get_frame(0)
      img.thumbnail((300, 300))
      img.save(video_thumbnail_frame)
  
      return video_thumbnail_frame
  
file_path: gluon-cv/gluoncv/torch/data/gluoncv_motion_dataset/dataset_pre_processor.py
imports: import os
  import random
  import logging
  import ray
  from pathlib import Path
  from tqdm import tqdm
  from .io.video_io import VideoFrameReader, write_img_files_to_vid_ffmpeg, resize_and_write_video_ffmpeg, convert_vid_ffmpeg
  from .utils.serialization_utils import save_json
  from .dataset import GluonCVMotionDataset, DataSample, FieldNames, get_resized_video_location, get_vis_gt_location, get_vis_thumb_location, get_vis_video_location
label_desc: Use image node_id 3 for calling a global function with example usage: generate_thumbnail(data_sample, overwrite) and returns: video_thumbnail_frame