code: def json_data(tmpdir, n_samples=5):
      path = Path(tmpdir) / "data.json"
      with path.open("w") as f:
          f.write(
              "\n".join([json.dumps(sample) for x in range(n_samples)])
          )
      return path
  
file_path: lightning-flash/tests/audio/speech_recognition/test_data.py
imports: import json
  import os
  from pathlib import Path
  import flash
  import pytest
  from flash.audio import SpeechRecognitionData
  from flash.core.data.io.input import DataKeys
  from flash.core.utilities.imports import _TOPIC_AUDIO_AVAILABLE
label_desc: Use image node_id 2 for calling a global function with example usage: json_data(tmpdir, n_samples) and returns: path