code: def check_token_latency_step(response_details, token_index):
      P50_token_latency = np.percentile(
          [
              r.token_gen_time[token_index]
              for r in response_details
              if len(r.token_gen_time) > token_index
          ],
          50,
      )
      P90_token_latency = np.percentile(
          [
              r.token_gen_time[token_index]
              for r in response_details
              if len(r.token_gen_time) > token_index
          ],
          90,
      )
      P99_token_latency = np.percentile(
          [
              r.token_gen_time[token_index]
              for r in response_details
              if len(r.token_gen_time) > token_index
          ],
          99,
      )
  
      return P50_token_latency, P90_token_latency, P99_token_latency
  
file_path: deepspeedexamples/benchmarks/inference/mii/plot_effective_throughput.py
imports: import argparse
  from pathlib import Path
  import glob
  import matplotlib.pyplot
  import numpy
  import pandas
  from postprocess_results import read_json, get_tokenizer
label_desc: Use image node_id 2 for calling a global function with example usage: check_token_latency_step(response_details, token_index) and returns: P50_token_latency,  P90_token_latency,  P99_token_latency