code: def get_metadata(
      metadata: Optional[List[Dict[str, Any]]],
      function_name: str,
      audio: np.ndarray,
      sample_rate: int,
      dst_audio: np.ndarray,
      dst_sample_rate: int,
      **kwargs,
  ) -> None:
      if metadata is None:
          return
  
      assert isinstance(
          metadata, list
      ), "Expected 'metadata' to be set to None or of type list"
  
      src_duration = audio.shape[-1] / sample_rate
      dst_duration = dst_audio.shape[-1] / dst_sample_rate
      src_segments, dst_segments = compute_segments(
          function_name, src_duration, dst_duration, metadata, **kwargs
      )
  
      metadata.append(
          {
              "name": function_name,
              "src_duration": src_duration,
              "dst_duration": dst_duration,
              "src_num_channels": 1
              if audio.ndim == 1
              else audio.shape[0],
              "dst_num_channels": 1
              if dst_audio.ndim == 1
              else dst_audio.shape[0],
              "src_sample_rate": sample_rate,
              "dst_sample_rate": dst_sample_rate,
              "src_segments": [
                  src_segment._asdict() for src_segment in src_segments
              ],
              "dst_segments": [
                  dst_segment._asdict() for dst_segment in dst_segments
              ],
              **kwargs,
          }
      )
  
      intensity_kwargs = {"metadata": metadata[-1], **kwargs}
      metadata[-1]["intensity"] = getattr(
          audintensity, f"{function_name}_intensity", lambda **_: 0.0
      )(**intensity_kwargs)
  
file_path: AugLy/augly/audio/utils.py
imports: import numbers
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from augly import utils
  from augly.audio import intensity
  from augly.utils.libsndfile import install_libsndfile
  import librosa
  import soundfile
  import torchaudio
label_desc: Use image node_id 4 for calling a global function with example usage: get_metadata(metadata, function_name, audio, sample_rate, dst_audio, dst_sample_rate) without return types