code: def project_decode_latency(costs, prompt_len, gen_len):
      decode_costs = costs[1:]
  
      if gen_len / prompt_len < 0.1:
          warmup = 2
          decode_latency = sum(decode_costs[:warmup]) + np.mean(
              decode_costs[warmup:]
          ) * (gen_len - 1 - warmup)
      else:
          warmup = 2
          decode_latency = sum(decode_costs[:warmup]) + np.mean(
              decode_costs[warmup:]
          ) * (gen_len - 1 - warmup)
  
          # assert len(decode_costs) >= 4
          # warmup = 2
          # xs = np.arange(warmup, len(decode_costs))
          # ys = np.asarray(decode_costs[warmup:])
          # curve = np.poly1d(np.polyfit(xs, ys, deg=1))
          # ys_pred = [curve(x) for x in range(gen_len-1)]
          # decode_latency = sum(ys_pred)
  
          # print([round(x, 4) for x in decode_costs])
          # print([round(x, 4) for x in ys_pred])
  
      return decode_latency
  
imports: import argparse
  import dataclasses
  from attr import define, field
  from attr.setters import frozen
  import functools
  import gc
  import math
  import os
  from typing import Tuple, Union, Optional, Any, Sequence, List
  import numpy
  import psutil
  import torch
label_desc: Use image node_id 13 for calling a global function with example usage: project_decode_latency(costs, prompt_len, gen_len) and returns: decode_latency