code: def print_results(keys, values, rank=None, num_print=1):
      print()
      start = rank * num_print if rank is not None else 0
      end = start + num_print
      values = [val[start:end] for val in values]
      for ex_idx in range(len(values[0])):
          for key_idx, key in enumerate(keys):
              value = values[key_idx][ex_idx]
              v = value[0] if isinstance(value, list) else value
              print(f"{key}: {repr(v)}")
          print()
  
file_path: decanlp/validate.py
imports: import torch
  from util import pad
  from metrics import compute_metrics
label_desc: Use image node_id 5 for calling a global function with example usage: print_results(keys, values, rank, num_print) without return types