code: def img2gif(image_list, temporal_path="./tmp/"):
      tmp_file = Path(
          tempfile.NamedTemporaryFile(suffix=".gif").name
      ).name
      tmp_file = Path(temporal_path) / tmp_file
      Path(tmp_file.parent).mkdir(exist_ok=True)
      print("Write to {}".format(tmp_file))
      with open(tmp_file, "wb") as tmp:
          image_list[0].save(
              tmp,
              format="GIF",
              append_images=image_list[1:],
              save_all=True,
              duration=3,
              loop=0,
          )
      return tmp_file
  
file_path: mmf/mmf/datasets/builders/charades/_utils.py
imports: import logging
  import tempfile
  from pathlib import Path
  import pandas
  import torch
  from torchvision.datasets.video_utils import VideoClips
  from torchvision.io import read_video
label_desc: Use image node_id 2 for calling a global function with example usage: img2gif(image_list, temporal_path) and returns: tmp_file