code: def luminoldetect():
      ts = urllib.unquote(request.args.get("ts_path")[1:])
      my_detector = anomaly_detector.AnomalyDetector(ts)
      score = my_detector.get_all_scores().values
  
      # Create a new csv file that contains both values and scores.
      anom_scores = list()
      for i, (timestamp, value) in enumerate(
          my_detector.time_series.iteritems()
      ):
          t_str = time.strftime(
              "%Y-%m-%d %H:%M:%S", time.localtime(timestamp / 1000)
          )
          anom_scores.append([t_str, value, score[i]])
      write_csv(anom_scores, ts.split("/")[-1])
  
      anoms = my_detector.get_anomalies()
      result = list()
      for anom in anoms:
          entry = list()
          anom_dict = anom.__dict__
          for key in anom_dict:
              entry.append(anom_dict[key])
          result.append(entry)
      return jsonify(anom=result, anom_score=anom_scores)
  
file_path: luminol/demo/src/start.py
imports: import csv
  import datetime
  import os
  import sys
  import time
  import urllib
  from flask import Flask, jsonify, render_template, request
  from luminol import utils, anomaly_detector, correlator
  from rca import RCA
label_desc: Use image node_id 3 for calling a global function with example usage: luminoldetect() and returns: jsonify