def _hex_to_dec(ip, check=True):
if check and not is_hex(ip):<EOL><INDENT>raise ValueError('<STR_LIT>' % ip)<EOL><DEDENT>if isinstance(ip, int):<EOL><INDENT>ip = hex(ip)<EOL><DEDENT>return int(str(ip), <NUM_LIT:16>)<EOL>
Hexadecimal to decimal conversion.