code: def save_audio_meta(
      path: tp.Union[str, Path], meta: tp.List[AudioMeta]
  ):
      """Save the audio metadata to the file pointer as json.
  
      Args:
          path (str or Path): Path to JSON file.
          metadata (list of BaseAudioMeta): List of audio meta to save.
      """
      Path(path).parent.mkdir(exist_ok=True, parents=True)
      open_fn = gzip.open if str(path).lower().endswith(".gz") else open
      with open_fn(path, "wb") as fp:  # type: ignore
          for m in meta:
              json_str = json.dumps(m.to_dict()) + "\n"
              json_bytes = json_str.encode("utf-8")
              fp.write(json_bytes)
  
imports: import argparse
  import copy
  from concurrent.futures import ThreadPoolExecutor, Future
  from dataclasses import dataclass, fields
  from contextlib import ExitStack
  from functools import lru_cache
  import gzip
  import json
  import logging
  import os
  from pathlib import Path
  import random
  import sys
  import typing
  import torch
  import torch.nn.functional
  from .audio import audio_read, audio_info
  from .audio_utils import convert_audio
  from .zip import PathInZip
label_desc: Use image node_id 5 for calling a global function with example usage: save_audio_meta(path, meta) without return types