code: def get_cuda_memory(kind="available"):
      """Get the amount of free memory for CUDA operations.
  
      Parameters
      ----------
      kind : str
          Can be ``"available"`` or ``"total"``.
  
      Returns
      -------
      memory : str
          The amount of available or total memory as a human-readable string.
      """
      if not _cuda_capable:
          warn("CUDA not enabled, returning zero for memory")
          mem = 0
      else:
          import cupy
  
          mem = cupy.cuda.runtime.memGetInfo()[
              dict(available=0, total=1)[kind]
          ]
      return sizeof_fmt(mem)
  
file_path: mne-python/mne/cuda.py
imports: import numpy
  from scipy.fft import irfft, rfft
  from .utils import _check_option, _explain_exception, fill_doc, get_config, logger, sizeof_fmt, verbose, warn
label_desc: Use image node_id 1 for calling a global function with example usage: get_cuda_memory(kind) and returns: sizeof_fmt