def METHOD_NAME(inp):
    m = VENDOR_DEVICE_RE.match(inp)
    if not m:
        raise ValueError('wrong vendor/device format: {}'.format(inp))
    return dict((k, int(v, 16)) for k, v in m.groupdict().items() if v)