code: def _save_fig(
      dst_path: str, figure: matplotlib.figure.Figure
  ) -> None:
      """Save the generated figures for the dataset in dst_dir."""
      # `savefig` do not support GCS, so first save the image locally.
      with tempfile.TemporaryDirectory() as tmp_dir:
          tmp_path = os.path.join(tmp_dir, "tmp.png")
          figure.savefig(tmp_path)
          tf.io.gfile.copy(
              tmp_path, dst_path, overwrite=FLAGS.overwrite
          )
      plt.close(figure)
  
file_path: datasets/tensorflow_datasets/scripts/documentation/generate_visualization.py
imports: import functools
  import os
  import tempfile
  from absl import flags
  import matplotlib
  import matplotlib.pyplot
  import tensorflow_datasets
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.scripts.documentation import script_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _save_fig(dst_path, figure) without return types