code: def net_connections(kind="inet"):
      """System-wide network connections."""
      # Note: on macOS this will fail with AccessDenied unless
      # the process is owned by root.
      ret = []
      for pid in pids():
          try:
              cons = Process(pid).connections(kind)
          except NoSuchProcess:
              continue
          else:
              if cons:
                  for c in cons:
                      c = list(c) + [pid]
                      ret.append(_common.sconn(*c))
      return ret
  
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 11 for calling a global function with example usage: net_connections(kind) and returns: ret