code: def metric_valid(key, obs_val, exp_val, threshold):
      # In case of throughput, higher is better
      # In case of memory, lower is better.
      # We ignore lower values for memory related metrices
      lower = False
      if "throughput" not in key:
          lower = True
      return check_if_within_threshold(exp_val, obs_val, threshold) or (
          (obs_val < exp_val and lower)
          or (obs_val > exp_val and not lower)
      )
  
file_path: serve/benchmarks/utils/report.py
imports: import csv
label_desc: Use image node_id 1 for calling a global function with example usage: metric_valid(key, obs_val, exp_val, threshold) and returns: unknown