code: def test_magnitude_to_decibel(dynamic_range, dtype: str):
      """test for backend_keras.magnitude_to_decibel"""
  
      x = np.array(
          [[1e-20, 1e-5, 1e-3, 5e-2], [0.3, 1.0, 20.5, 9999]],
          dtype=dtype,
      )  # random positive numbers
  
      amin = 1e-5
      x_decibel_ref = np.stack(
          (
              librosa.power_to_db(
                  x[0], amin=amin, ref=1.0, top_db=dynamic_range
              ),
              librosa.power_to_db(
                  x[1], amin=amin, ref=1.0, top_db=dynamic_range
              ),
          ),
          axis=0,
      )
  
      x_var = K.variable(x)
      x_decibel_kapre = magnitude_to_decibel(
          x_var, ref_value=1.0, amin=amin, dynamic_range=dynamic_range
      )
      if dtype == "float16":
          np.testing.assert_allclose(
              K.eval(x_decibel_kapre),
              x_decibel_ref,
              rtol=1e-3,
              atol=TOL,
          )
      else:
          np.testing.assert_allclose(
              K.eval(x_decibel_kapre), x_decibel_ref, atol=TOL
          )
  
file_path: kapre/tests/test_backend.py
imports: import pytest
  import numpy
  import librosa
  import tensorflow
  from tensorflow.keras import backend
  from kapre import backend
  from kapre.backend import magnitude_to_decibel, validate_data_format_str
  from utils import SRC
label_desc: Use image node_id 1 for calling a global function with example usage: test_magnitude_to_decibel(dynamic_range, dtype) without return types