code: def json_data(tmpdir, data):
      json_data = ""
      for example in data:
          json_data += json.dumps(example) + "\n"
      path = Path(tmpdir) / "data.json"
      path.write_text(json_data)
      return path
  
file_path: lightning-flash/tests/text/question_answering/test_data.py
imports: import json
  import os
  from pathlib import Path
  import pandas
  import pytest
  from flash.core.utilities.imports import _TOPIC_TEXT_AVAILABLE
  from flash.text import QuestionAnsweringData
label_desc: Use image node_id 3 for calling a global function with example usage: json_data(tmpdir, data) and returns: path