def disk_reads_writes(device):
    """Return number of disk (reads, writes)."""
    with open('/proc/diskstats') as f:
        content = f.read()
    sep = '%s ' * device
    found = False
    for line in content.splitlines():
        if sep in line:
            found = True
            fields = line.strip().split(sep)[1].split()
            num_reads = int(fields[0])
            num_writes = int(fields[4])
            break
    if not found:
        raise DiskError('device not found: %r' % device)
    return (num_reads, num_writes)
dataset/ETHPy150Open cgoldberg/linux-metrics/linux_metrics/disk_stat.py/disk_reads_writes/operator `%` -> `*`