code: def index():
      """
      Index view.
      """
      results = app.get_results()
      if not results.empty:
          all_ids = set(results["Trial-ID"])
          finished_ids = set(
              results.loc[
                  results["Status"] != "INTERMEDIATE", "Trial-ID"
              ]
          )
          active_ids = all_ids ^ finished_ids
          active_trials = [{"id": i} for i in active_ids]
          return render_template(
              "index.html",
              active_trials=active_trials,
              parameter_types=app.parameter_types,
              results=[
                  row.to_dict() for idx, row in results.iterrows()
              ],
          )
      else:
          return render_template(
              "index.html",
              active_trials=[],
              parameter_types=app.parameter_types,
              results=[],
          )
  
file_path: sherpa/sherpa/app/app.py
imports: import logging
  import pandas
  from flask import Flask
  from flask import render_template, flash, redirect
label_desc: Use image node_id 1 for calling a global function with example usage: index() and returns: render_template, render_template