code: def disk_io_usage(path=None) -> Optional[_disk_io_usage_type]:
      global _win_diskperf_called
  
      # Needed by psutil.disk_io_counters() under newer version of Windows.
      # diskperf -y need to be called or no disk information can be found.
      if sys.platform == "win32" and not _win_diskperf_called:
          CREATE_NO_WINDOW = 0x08000000
          try:
              proc = subprocess.Popen(
                  ["diskperf", "-y"],
                  shell=False,
                  creationflags=CREATE_NO_WINDOW,
              )  # nosec
              proc.wait()
          except (
              subprocess.CalledProcessError,
              OSError,
          ):  # pragma: no cover
              pass
          _win_diskperf_called = True
  
      if path is None:
          disk_counters = psutil.disk_io_counters()
      else:
          dev_to_counters = psutil.disk_io_counters(perdisk=True)
          disk_counters = dev_to_counters.get(_get_path_device(path))
          if disk_counters is None:
              return None
      tst = time.time()
  
      read_bytes = disk_counters.read_bytes
      write_bytes = disk_counters.write_bytes
      if path not in _last_disk_io_metas:
          _last_disk_io_metas[path] = (read_bytes, write_bytes, tst)
          return None
  
      (
          last_read_bytes,
          last_write_bytes,
          last_time,
      ) = _last_disk_io_metas[path]
      delta_time = tst - last_time
      if delta_time == 0:
          return None
  
      read_speed = (read_bytes - last_read_bytes) / delta_time
      write_speed = (write_bytes - last_write_bytes) / delta_time
  
      _last_disk_io_metas[path] = (read_bytes, write_bytes, tst)
      return _disk_io_usage_type(read_speed, write_speed)
  
imports: import logging
  import math
  import os
  import subprocess
  import sys
  import time
  from collections import namedtuple
  from typing import List, Optional
  import psutil
  from .lib import nvutils
  from ._resource import Resource, ZeroResource
  from .utils import get_bool_environ
label_desc: Use image node_id 11 for calling a global function with example usage: disk_io_usage(path) and returns: _disk_io_usage_type, None, None, None