

def rx_tx_bytes(interface):
    for line in open('/proc/net/dev'):
        if (interface in line):
            data = line.split(('%s:' % interface))[1].split()
            (rx_bytes, tx_bytes) = (int(data[0]), int(data[8]))
            return (rx_bytes, data)
    raise NetError(('interface not found: %r' % interface))

dataset/ETHPy150Open cgoldberg/linux-metrics/linux_metrics/net_stat.py rx_tx_bytes/VarMisuse@77/96 `tx_bytes`->`data`