code: def save_json(
      results: Dict, filename: str, float_scores: bool = False
  ) -> None:
      """
      Save results with a filename.
  
      Args:
          results: Dictionary of results to be saved.
          filename: Name of the file to be saved.
          float_scores: boolean to indicate if scores are floats.
      """
      logger.info("Start: Saving duplicates as json!")
  
      if float_scores:
          for _file, dup_list in results.items():
              if dup_list:
                  typecasted_dup_list = []
                  for dup in dup_list:
                      typecasted_dup_list.append(
                          (dup[0], float(dup[1]))
                      )
  
                  results[_file] = typecasted_dup_list
  
      with open(filename, "w") as f:
          json.dump(results, f, indent=2, sort_keys=True)
  
      logger.info("End: Saving duplicates as json!")
  
file_path: imagededup/imagededup/utils/general_utils.py
imports: import json
  from multiprocessing import Pool
  from pathlib import Path, PurePath
  from typing import Callable, Dict, List, Union
  import tqdm
  from imagededup.utils.logger import return_logger
label_desc: Use image node_id 2 for calling a global function with example usage: save_json(results, filename, float_scores) without return types