code: def update_anno(
      sample: DataSample, new_sample: DataSample, time_pair: (int, int)
  ):
      start_time, end_time = time_pair
      for ts, entities in sample.time_entity_dict.items():
          if ts >= start_time and ts < end_time:
              for entity in entities:
                  new_entity = pickle.loads(pickle.dumps(entity))
                  new_entity.time = entity.time - start_time
                  # This assumes constant fps
                  new_entity.frame_num = round(
                      (new_entity.time / 1000) * new_sample.fps
                  )
                  new_sample.add_entity(new_entity)
      return new_sample
  
file_path: gluon-cv/gluoncv/torch/data/gluoncv_motion_dataset/ingestion/video_chunker.py
imports: import logging
  import os
  import pickle
  import tqdm
  from pathlib import Path
  from ..dataset import GluonCVMotionDataset, DataSample, FieldNames, SplitNames
  from ..utils.ingestion_utils import crop_video, process_dataset_splits, crop_fn_ffmpeg, crop_fn_frame_folder
label_desc: Use image node_id 4 for calling a global function with example usage: update_anno(sample, new_sample, time_pair) and returns: new_sample