code: def _calc_disk_stats(last, cur):
      stats = {}
      seconds = cur["timestamp"] - last["timestamp"]
      writes = cur["write_count"] - last["write_count"]
      reads = cur["read_count"] - last["read_count"]
      bytes_written = cur["write_bytes"] - last["write_bytes"]
      bytes_read = cur["read_bytes"] - last["read_bytes"]
      stats["wps"] = writes / seconds
      stats["rps"] = reads / seconds
      stats["wkbps"] = bytes_written / 1024 / seconds
      stats["rkbps"] = bytes_read / 1024 / seconds
      try:
          busy_time_ms = cur["busy_time"] - last["busy_time"]
      except KeyError:
          pass
      else:
          stats["util"] = busy_time_ms / (seconds * 1000)
      return stats
  
file_path: guildai/guild/plugins/disk.py
imports: import os
  import platform
  import re
  import sys
  import time
  from guild.plugins.summary_util import SummaryPlugin
label_desc: Use image node_id 3 for calling a global function with example usage: _calc_disk_stats(last, cur) and returns: stats