code: def json_data(tmpdir, multilabel: bool):
      path = Path(tmpdir) / "data.json"
      if multilabel:
          path.write_text(TEST_JSON_DATA_MULTILABEL)
      else:
          path.write_text(TEST_JSON_DATA)
      return path
  
imports: import os
  from pathlib import Path
  import pandas
  import pytest
  from flash.core.data.io.input import DataKeys
  from flash.core.utilities.imports import _TOPIC_TEXT_AVAILABLE
  from flash.text import TextClassificationData
label_desc: Use image node_id 2 for calling a global function with example usage: json_data(tmpdir, multilabel) and returns: path