human
I wrote the below code

    def get_disk_devs(vm_):
        doc = minidom.parse(_StringIO(get_xml(vm_)))
        disks = []
        for elem in doc.getElementsByTagName('disk'):
            targets = elem.getElementsByTagName('target')
            target = targets[0]
            disks.append(target.getAttribute('dev'))
        return disks
    def _info(vm_):
        dom = _get_domain(vm_)
        disks = get_disk_devs(vm_)
        ret = {'rd_req': 0, 'rd_bytes': 0, 'wr_req': 0, 'wr_bytes': 0, 'errs': 0}
        for disk in disks:
            stats = dom.blockStats(disk)
            ret['rd_req'] += stats[0]
            ret['rd_bytes'] += stats[1]
            ret['wr_req'] += stats[2]
            ret['wr_bytes'] += stats[3]
            ret['errs'] += stats[4]
        return ret
    info = {}
    if vm_:
        info[vm_] = _info(vm_)
    else:
        for vm_ in list_active_vms():
            info[vm_] = _info(vm_)
    return info

What's a good function header?
assistant
#Here's a good function header.

def vm_diskstats(vm_=None):