code: def virtual_memory():
      """System virtual memory as a namedtuple."""
      (
          total,
          active,
          inactive,
          wired,
          free,
          speculative,
      ) = cext.virtual_mem()
      # This is how Zabbix calculate avail and used mem:
      # https://github.com/zabbix/zabbix/blob/trunk/src/libs/zbxsysinfo/
      #     osx/memory.c
      # Also see: https://github.com/giampaolo/psutil/issues/1277
      avail = inactive + free
      used = active + wired
      # This is NOT how Zabbix calculates free mem but it matches "free"
      # cmdline utility.
      free -= speculative
      percent = usage_percent((total - avail), total, round_=1)
      return svmem(
          total, avail, percent, used, free, active, inactive, wired
      )
  
imports: import contextlib
  import errno
  import functools
  import os
  from collections import namedtuple
  from .None import _common
  from .None import _psposix
  from .None import _psutil_osx
  from .None import _psutil_posix
  from ._common import AccessDenied
  from ._common import conn_tmap
  from ._common import conn_to_ntuple
  from ._common import isfile_strict
  from ._common import memoize_when_activated
  from ._common import NoSuchProcess
  from ._common import parse_environ_block
  from ._common import usage_percent
  from ._common import ZombieProcess
  from ._compat import PermissionError
  from ._compat import ProcessLookupError
label_desc: Use image node_id 1 for calling a global function with example usage: virtual_memory() and returns: svmem