code: def gen_local_selector(data_dicts, round=3, is_classification=True):
      records = []
  
      for data_dict in data_dicts:
          perf_dict = data_dict["perf"]
          record = {}
          record["PrScore"] = perf_dict["predicted_score"]
          record["AcScore"] = perf_dict["actual_score"]
  
          record["Predicted"] = perf_dict["predicted"]
          record["Actual"] = perf_dict["actual"]
  
          record["Resid"] = record["AcScore"] - record["PrScore"]
          record["AbsResid"] = abs(record["Resid"])
  
          records.append(record)
  
      if is_classification:
          columns = [
              "Actual",
              "Predicted",
              "PrScore",
              "AcScore",
              "Resid",
              "AbsResid",
          ]
      else:
          columns = ["Actual", "Predicted", "Resid", "AbsResid"]
  
      df = pd.DataFrame.from_records(records, columns=columns)
      if round is not None:
          return df.round(round)
      else:  # pragma: no cover
          return df
  
imports: from itertools import count
  import numpy
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: gen_local_selector(data_dicts, round, is_classification) and returns: df, df