code: def get_experiment(eid):
      with sql.connect(
          app.app.config["db_file"], check_same_thread=False
      ) as con:
          cur = con.cursor()
          experiment = experiment = query_db(
              cur,
              "SELECT *, name as experiment_name, \
                                          json_extract(exp_config, '$.script') as script_name \
                                      from experiment where eid={eid};".format(
                  eid=eid
              ),
          )
          experiment[0]["status"] = EXPERIMENT_STATUS_TRANSLATE_DICT[
              experiment[0]["status"]
          ]
          cur = con.cursor()
          cur.execute(
              "SELECT count(*) from job where (end_time is NULL or \
                      (typeof(score) is not 'real' and score is not 'EARLY STOPPED')) and eid={eid}".format(
                  eid=eid
              )
          )
          unfinished = int(cur.fetchone()[0])
          cur.execute(
              "SELECT count(*) from job where (end_time is not NULL and \
                      (typeof(score) is 'real' or score is 'EARLY STOPPED')) and eid={eid}".format(
                  eid=eid
              )
          )
          finished = int(cur.fetchone()[0])
  
          cur.execute(
              "SELECT json_extract(exp_config, '$.target') from experiment where eid={eid}".format(
                  eid=eid
              )
          )
          order = str(cur.fetchone()[0])
          order = fix_none_res(order, "max")
  
          cur.execute(
              "SELECT json_extract(exp_config, '$.proposer') from experiment where eid={eid}".format(
                  eid=eid
              )
          )
          proposer = str(cur.fetchone()[0])
  
          cur = con.cursor()
          cur.execute(
              "SELECT exp_config \
                      from experiment where eid={eid};".format(
                  eid=eid
              )
          )
          exp_config = json.loads(str(cur.fetchone()[0]))
          num_params = len(exp_config["parameter_config"])
  
          proposer_obj = None
          n_samples = 1
          if proposer is not None and proposer != "None":
              proposer_obj = get_proposer(proposer)
              n_samples = proposer_obj(exp_config).nSamples
  
          if (
              proposer == "bohb"
              and experiment[0]["status"] == "FINISHED"
          ):
              n_samples = finished
  
          param_names = []
          for p in range(0, num_params):
              cur.execute(
                  "SELECT json_extract(exp_config, '$.parameter_config[{idx}].name') \
                              from experiment where eid={eid};".format(
                      idx=p, eid=eid
                  )
              )
              param_names.append(str(cur.fetchone()[0]))
  
          is_compression_exp = is_compression_experiment(exp_config)
          best_metrics_vs_hparams = query_db(
              cur,
              "SELECT {order}(score) as score, job_config \
                              from job where eid={eid} and typeof(score) = 'real';".format(
                  order=order, eid=eid
              ),
          )
  
          params = get_params_for_experiment(cur, eid)
  
          new_best_score = {}
  
          best_job_config = best_metrics_vs_hparams[0]["job_config"]
          if is_compression_exp:
              display_names = get_display_names(params, exp_config)
              best_metrics_vs_hparams = fix_compression_job_config(
                  best_metrics_vs_hparams, params, display_names
              )
              for param in params:
                  if param["name"] in display_names:
                      param["name"] = display_names[param["name"]]
                  param["value"] = best_metrics_vs_hparams[0][
                      param["name"]
                  ]
          else:
              job_configs = [
                  json.loads(mvh["job_config"])
                  if "job_config" in mvh
                  and mvh["job_config"] is not None
                  else {}
                  for mvh in best_metrics_vs_hparams
              ]
              best_metrics_vs_hparams = [
                  {
                      "score": mvh["score"],
                      **{
                          param["name"]: job_config[param["name"]]
                          if param["name"] in job_config
                          else None
                          for param in params
                      },
                  }
                  for mvh, job_config in zip(
                      best_metrics_vs_hparams, job_configs
                  )
              ]
  
              for param in params:
                  param["value"] = best_metrics_vs_hparams[0][
                      param["name"]
                  ]
  
          new_best_score["params"] = params
          new_best_score["proposer"] = proposer
          new_best_score["score"] = best_metrics_vs_hparams[0]["score"]
  
          res = {
              "experiment": experiment[0],
              "best_score": new_best_score,
              "job_stats": {
                  "finished": finished,
                  "unfinished": unfinished,
                  "total": n_samples,
              },
          }
  
          if is_compression_exp and len(params) == 0:
              best_config_list = query_db(
                  cur,
                  "SELECT json_extract(exp_config, '$.compression.config_list') as 'config_list' \
                                           FROM experiment WHERE eid={eid} LIMIT 1;".format(
                      eid=eid
                  ),
              )
              best_config_list = best_config_list[0]["config_list"]
              res["best_score"] = {
                  "score": res["best_score"]["score"],
                  "config_list": best_config_list,
              }
  
          return res
  
      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 11 for calling a global function with example usage: get_experiment(eid) and returns: None, res