parameters: (kind='inet')
return_statement: return ret
docstring: System-wide network connections.
docstring_summary: System-wide network connections.
docstring_tokens: System - wide network connections .
function: 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
function_tokens: def net_connections ( kind = 'inet' ) : # 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