code: def save(data, file_path):
      file_path = pathlib.Path(file_path)
      func_dict = {".txt": _save_txt, ".json": _save_json}
      assert file_path.suffix in func_dict
      return func_dict[file_path.suffix](data, file_path)
  
imports: import json
  import pathlib
  import time
  import os
  import glob
  import cv2
  import yaml
  from typing import Mapping
  import matplotlib.pyplot
  import numpy
  from argparse import ArgumentParser, RawDescriptionHelpFormatter
label_desc: Use image node_id 8 for calling a global function with example usage: save(data, file_path) and returns: func_dict