

def _name2idx(name):
    'Get the position of a network interface by its name.'
    match = re.search('eth(\\d+)', name, re.I)
    if (not match):
        raise exception.CloudbaseInitException('invalid NetworkDetails name {!r}'.format(name))
    return int(name.group(1))

dataset/ETHPy150Open openstack/cloudbase-init/cloudbaseinit/plugins/common/networkconfig.py _name2idx/VarMisuse@52/95 `match`->`name`