code: def get_experiments():
      with sql.connect(
          app.app.config["db_file"], check_same_thread=False
      ) as con:
          cur = con.cursor()
          experiment = query_db(
              cur,
              "SELECT *, json_extract(exp_config, '$.script') as script_name, \
                                      name as experiment_name,  \
                                      (SELECT case when (SELECT json_extract(exp_config, '$.target') from experiment where eid=experiment.eid) is \"min\" \
                                      then min(score) else max(score) end from job where job.eid=experiment.eid and typeof(score) is 'real') as best_score, \
                                      (SELECT json_group_array(job.score) from job where job.eid=experiment.eid) as scores, \
                                      (SELECT count(*) from job where (end_time is NULL or typeof(score) is not 'real') and job.eid=experiment.eid) as jobs_unfinished, \
                                      (SELECT count(*) from job where end_time is not NULL and typeof(score) = 'real' and job.eid=experiment.eid) as jobs_finished, \
                                      (SELECT json_group_array(json_object('jid', jid, 'score', score, \
                                          'start_time', start_time, 'end_time', end_time, 'job_config', job_config)) from \
                                      (SELECT * from job where eid=experiment.eid order by end_time)) as jobs \
                                      from experiment order by start_time DESC;",
          )
          for e in experiment:
              e["status"] = EXPERIMENT_STATUS_TRANSLATE_DICT[
                  e["status"]
              ]
  
          mult_res_labels = query_db(
              cur,
              "SELECT JSON_EXTRACT(exp_config, '$.resource_args.multi_res_labels') \
                                          AS labels FROM experiment ORDER BY start_time DESC",
          )
  
          list_mult_res_labels = None
          if mult_res_labels is not None:
              for i in range(len(mult_res_labels)):
                  labels_str = mult_res_labels[i]["labels"]
                  if labels_str is None:
                      continue
  
                  list_mult_res_labels = json.loads(labels_str)
                  experiment[i]["labels"] = list_mult_res_labels
  
          resource = query_db(
              cur, "SELECT * FROM resource WHERE type IS NOT 'passive';"
          )
          return jsonify(
              {"experiment": experiment, "resource": resource}
          )
      return None
  
imports: from flask import render_template, jsonify, request
  from flask_cors import CORS
  import connexion
  import click
  import logging
  import sys
  import sqlite3
  import os
  import os.path
  from six.moves.configparser import ConfigParser
  import json
  import signal
  import multiprocessing
  from aup.compression.utils import SERIALIZATION_SEPARATOR, run_non_automatic_experiment, verify_compression_config, adjust_compression_config
  from aup.setup import setup
  from aup.utils import get_default_username, set_default_keyvalue
  from ..ET.Connector.SQLiteConnector import SQLiteConnector
  from ..EE.Experiment import Experiment
  from ..aup import BasicConfig
  from aup.Proposer import get_proposer
  from threading import Lock
label_desc: Use image node_id 12 for calling a global function with example usage: get_experiments() and returns: None, jsonify