code: def get_pr_curve(log_reader, run, tag):
      run = (
          log_reader.name2tags[run]
          if run in log_reader.name2tags
          else run
      )
      log_reader.load_new_data()
      records = log_reader.data_manager.get_reservoir(
          "pr_curve"
      ).get_items(run, decode_tag(tag))
      results = []
      for item in records:
          pr_curve = item.pr_curve
          length = len(pr_curve.precision)
          num_thresholds = [
              float(v) / length for v in range(1, length + 1)
          ]
          results.append(
              [
                  s2ms(item.timestamp),
                  item.id,
                  list(pr_curve.precision),
                  list(pr_curve.recall),
                  list(pr_curve.TP),
                  list(pr_curve.FP),
                  list(pr_curve.TN),
                  list(pr_curve.FN),
                  num_thresholds,
              ]
          )
      return results
  
imports: import csv
  import io
  import math
  import os
  import sys
  import time
  from functools import partial
  import numpy
  from visualdl.component import components
  from visualdl.io import bfile
  from visualdl.server.log import logger
  from visualdl.utils.importance import calc_all_hyper_param_importance
  from visualdl.utils.list_util import duplicate_removal
  from visualdl.utils.string_util import decode_tag
  from visualdl.utils.string_util import encode_tag
label_desc: Use image node_id 21 for calling a global function with example usage: get_pr_curve(log_reader, run, tag) and returns: results