code: def GetRangeDataframe(
      prometheus_url,
      query_list,
      starttime,
      endtime,
      step,
      columns,
      **kwargs,
  ):
      """
      Convert the Prometheus data over the specified time period to dataframe and confirm
      dt_col, target_col, id_col and extra_feature_col.
  
      Return dataframe and col names.
      """
      from bigdl.chronos.data.utils.utils import _check_type
  
      _check_type(prometheus_url, "prometheus_url", str)
      _check_type(starttime, "starttime", (str, float))
      _check_type(endtime, "endtime", (str, float))
      _check_type(step, "step", (str, float))
  
      # Generate dataframe according query_list
      pro_client = Prometheus(prometheus_url)
      pro_df = pd.DataFrame()
      for query in query_list:
          query_df = pro_client.query_range(
              query, starttime, endtime, step, **kwargs
          )
          # TODO: whatif pro_df and query_df has different length
          # TODO: repair missing value when query Prometheus client
          pro_df = pd.concat([pro_df, query_df], axis=1)
  
      df = pd.DataFrame(columns=pro_df.columns.tolist())
      df.insert(0, "datetime", pro_df.index)
      for col in pro_df.columns.tolist():
          df[col] = pro_df[col].values
  
      # Clean columns
      output_columns = {
          "dt_col": "datetime",
          "target_col": pro_df.columns.tolist(),
          "id_col": None,
          "extra_feature_col": None,
      }
      output_col_list = ["datetime"]
      for col in ["target_col", "id_col", "extra_feature_col"]:
          # Check whether columns specified by user exist
          invalidInputError(
              len(columns[col]) == 0
              or set(columns[col]).issubset(df.columns.tolist()),
              "The input "
              + col
              + " is not found in collected Prometheus data.",
          )
  
          # If users specify target_col/id_col/extra_feature_col, update values in output_columns[]
          if len(columns[col]) == 1:
              output_columns[col] = columns[col][
                  0
              ]  # id_col must be str
          elif len(columns[col]) > 1:
              output_columns[col] = columns[col]
  
          # According to output_columns, confirm columns to be remained in df
          if output_columns[col] is not None:
              if isinstance(output_columns[col], list):
                  output_col_list = (
                      output_col_list + output_columns[col]
                  )
              else:
                  output_col_list.append(output_columns[col])
  
      df = df.loc[:, output_col_list]
      return df, output_columns
  
file_path: BigDL/python/chronos/src/bigdl/chronos/data/utils/prometheus_df.py
imports: import datetime
  import json
  from typing import Optional, Union
  from urllib.parse import urljoin
  import numpy
  import pandas
  import requests
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 5 for calling a global function with example usage: GetRangeDataframe(prometheus_url, query_list, starttime, endtime, step, columns) and returns: df,  output_columns