code: def _load_json_data(data, data_folder, multi_label=False):
      """Utility method to extract data from Label Studio json files."""
      results = []
      test_results = []
      data_types = set()
      tag_types = set()
      classes = set()
      for task in data:
          for annotation in task["annotations"]:
              # extracting data types from tasks
              for key in task.get("data"):
                  data_types.add(key)
              # Adding ground_truth annotation to separate dataset
              result = annotation["result"]
              for res in result:
                  t = res["type"]
                  tag_types.add(t)
                  for label in res["value"][t]:
                      # check if labeling result is a list of labels
                      if isinstance(label, list) and not multi_label:
                          for sublabel in label:
                              classes.add(sublabel)
                              temp = {
                                  "file_upload": task.get(
                                      "file_upload"
                                  ),
                                  "data": task.get("data"),
                                  "label": sublabel,
                                  "result": res.get("value"),
                              }
                              if temp["file_upload"]:
                                  temp["file_upload"] = os.path.join(
                                      data_folder, temp["file_upload"]
                                  )
                              else:
                                  for key in temp["data"]:
                                      p = temp["data"].get(key)
                                  path = Path(p)
                                  if path and data_folder:
                                      temp[
                                          "file_upload"
                                      ] = os.path.join(
                                          data_folder, path.name
                                      )
                              if annotation["ground_truth"]:
                                  test_results.append(temp)
                              elif not annotation["ground_truth"]:
                                  results.append(temp)
                      else:
                          if isinstance(label, list):
                              for item in label:
                                  classes.add(item)
                          else:
                              classes.add(label)
                          temp = {
                              "file_upload": task.get("file_upload"),
                              "data": task.get("data"),
                              "label": label,
                              "result": res.get("value"),
                          }
                          if temp["file_upload"] and data_folder:
                              temp["file_upload"] = os.path.join(
                                  data_folder, temp["file_upload"]
                              )
                          else:
                              for key in temp["data"]:
                                  p = temp["data"].get(key)
                              path = Path(p)
                              if path and data_folder:
                                  temp["file_upload"] = os.path.join(
                                      data_folder, path.name
                                  )
                          if annotation["ground_truth"]:
                              test_results.append(temp)
                          elif not annotation["ground_truth"]:
                              results.append(temp)
      return results, test_results, classes, data_types, tag_types
  
imports: import json
  import os
  from copy import deepcopy
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Any, Dict, List, Mapping, Optional, Sequence, Set, Type
  import numpy
  import torch
  from pytorch_lightning.utilities.cloud_io import get_filesystem
  from torch.utils.data import Sampler
  from flash.core.data.io.input import DataKeys, Input, IterableInput
  from flash.core.data.properties import Properties
  from flash.core.data.utilities.loading import load_image
  from flash.core.utilities.imports import _PYTORCHVIDEO_AVAILABLE
  from flash.core.utilities.stages import RunningStage
label_desc: Use image node_id 2 for calling a global function with example usage: _load_json_data(data, data_folder, multi_label) and returns: results,  test_results,  classes,  data_types,  tag_types