def _check_hex(dummy_option, opt, value):
    """
    Checks if a value is given in a decimal integer of hexadecimal reppresentation.
    Returns the converted value or rises an exception on error.
    """
    try:
        if value.lower().startswith("0x"):
            return int(value, 16)
        else:
            return int(value)
    except __HOLE__:
        raise OptionValueError(
            "option {0:s}: invalid integer or hexadecimal value: {1:s}.".format(opt, value))


# function _check_bool
###############################################################################
dataset/ETHPy150Open tpircher/pycrc/crc_opt.py/_check_hex