code: def output_csv(entries, sorted_list, cmp_entries, args):
      print("time,size,file", end="")
      if cmp_entries:
          print(",diff", end="")
      print()
      for name in sorted_list:
          entry = entries[name]
          build_time = entry[1] - entry[0]
          file_size = entry[2]
          cmp_entry = (
              cmp_entries[name]
              if cmp_entries and name in cmp_entries
              else None
          )
          print(build_time, file_size, name, sep=",", end="")
          if cmp_entry:
              diff_time = build_time - (cmp_entry[1] - cmp_entry[0])
              print(",", diff_time, sep="", end="")
          print()
  
file_path: cudf/cpp/scripts/sort_ninja_log.py
imports: import argparse
  import os
  import sys
  import xml.etree.ElementTree
  from pathlib import Path
  from xml.dom import minidom
label_desc: Use image node_id 8 for calling a global function with example usage: output_csv(entries, sorted_list, cmp_entries, args) without return types