# Path: canaryd/subprocess.py
# def get_command_output(command, *args, **kwargs):
#     logger.debug('Executing command: {0}'.format(command))
# 
#     if not kwargs.get('shell', False):
#         command = ensure_command_tuple(command)
# 
#     try:
#         output = check_output(  # noqa: F405
#             command,
#             close_fds=True,
#             stderr=STDOUT,  # noqa: F405
#             *args, **kwargs
#         )
#     except CalledProcessError as e:  # noqa: F405
#         e.output = decode_output(e.output)
#         raise e
# 
#     output = decode_output(output)
#     return output


import re
import sys
from multiprocessing import cpu_count
from os import path, sep as os_sep
from canaryd_packages import six
from canaryd.subprocess import get_command_output
        }

    return devices


def _get_device_speed(device):
    speed = 0
    speed_file = path.join(os_sep, 'sys', 'class', 'net', device, 'speed')

    if not path.exists(speed_file):
        return

    try:
        with open(speed_file, 'r') as f:
            data = f.read()
    except IOError:
        return

    speed = int(data)

    # Turn mbits -> bytes
    speed = speed * 125000
    return speed


def get_proc_network_stats():
    '''
    Gets + parses 2x `/proc/net/dev` output.
    '''


# Path: canaryd/subprocess.py
# def get_command_output(command, *args, **kwargs):
#     logger.debug('Executing command: {0}'.format(command))
# 
#     if not kwargs.get('shell', False):
#         command = ensure_command_tuple(command)
# 
#     try:
#         output = check_output(  # noqa: F405
#             command,
#             close_fds=True,
#             stderr=STDOUT,  # noqa: F405
#             *args, **kwargs
#         )
#     except CalledProcessError as e:  # noqa: F405
#         e.output = decode_output(e.output)
#         raise e
# 
#     output = decode_output(output)
#     return output


# Path: canaryd/plugins/monitor_util.py
import re
import sys
from multiprocessing import cpu_count
from os import path, sep as os_sep
from canaryd_packages import six
from canaryd.subprocess import get_command_output

        }

    return devices


def _get_device_speed(device):
    speed = 0
    speed_file = path.join(os_sep, 'sys', 'class', 'net', device, 'speed')

    if not path.exists(speed_file):
        return

    try:
        with open(speed_file, 'r') as f:
            data = f.read()
    except IOError:
        return

    speed = int(data)

    # Turn mbits -> bytes
    speed = speed * 125000
    return speed


def get_proc_network_stats():
    '''
    Gets + parses 2x `/proc/net/dev` output.
    '''


    output = get_command_output(