code: def validate_audio(path, source=None):
      """
      ## validate_audio
  
      Validates audio by retrieving audio-bitrate from file.
  
      Parameters:
          path (string): absolute path of FFmpeg binaries
          source (string/list): source to be validated.
  
      **Returns:** A string value, confirming whether audio is present, or not?.
      """
      if source is None or not (source):
          logger.warning("Audio input source is empty!")
          return ""
  
      # create ffmpeg command
      cmd = [path, "-hide_banner"] + (
          source if isinstance(source, list) else ["-i", source]
      )
      # extract metadata
      metadata = check_output(cmd, force_retrieve_stderr=True)
      # extract bitrate
      audio_bitrate_meta = [
          line.strip()
          for line in metadata.decode("utf-8").split("\n")
          if "Audio:" in line
      ]
      audio_bitrate = (
          re.findall(r"([0-9]+)\s(kb|mb|gb)\/s", audio_bitrate_meta[0])[
              -1
          ]
          if audio_bitrate_meta
          else ""
      )
      # extract samplerate
      audio_samplerate_metadata = [
          line.strip()
          for line in metadata.decode("utf-8").split("\n")
          if all(x in line for x in ["Audio:", "Hz"])
      ]
      audio_samplerate = (
          re.findall(r"[0-9]+\sHz", audio_samplerate_metadata[0])[0]
          if audio_samplerate_metadata
          else ""
      )
      # format into actual readable bitrate value
      if audio_bitrate:
          # return bitrate directly
          return "{}{}".format(
              int(audio_bitrate[0].strip()), audio_bitrate[1].strip()[0]
          )
      elif audio_samplerate:
          # convert samplerate to bitrate first
          sample_rate_value = int(audio_samplerate.split(" ")[0])
          channels_value = (
              1 if "mono" in audio_samplerate_metadata[0] else 2
          )
          bit_depth_value = re.findall(
              r"(u|s|f)([0-9]+)(le|be)", audio_samplerate_metadata[0]
          )[0][1]
          return (
              (
                  str(
                      get_audio_bitrate(
                          sample_rate_value,
                          channels_value,
                          int(bit_depth_value),
                      )
                  )
                  + "k"
              )
              if bit_depth_value
              else ""
          )
      else:
          return ""
  
imports: import os
  import re
  import sys
  import cv2
  import types
  import errno
  import stat
  import shutil
  import importlib
  import requests
  import numpy
  import logging
  import platform
  import socket
  from tqdm import tqdm
  from contextlib import closing
  from pathlib import Path
  from colorlog import ColoredFormatter
  from pkg_resources import parse_version
  from requests.adapters import HTTPAdapter, Retry
  from ..version import __version__
label_desc: Use image node_id 18 for calling a global function with example usage: validate_audio(path, source) and returns: str, str, unknown, str