def _extract_table_type(type):
if isinstance(type, str):<EOL><INDENT>type = type.lower()<EOL>if type[<NUM_LIT:0>:<NUM_LIT:7>] == '<STR_LIT>':<EOL><INDENT>table_type = BINARY_TBL<EOL><DEDENT>elif type[<NUM_LIT:0>:<NUM_LIT:6>] == '<STR_LIT:ascii>':<EOL><INDENT>table_type = ASCII_TBL<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>type = int(type)<EOL>if type not in [BINARY_TBL, ASCII_TBL]:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (BINARY_TBL, ASCII_TBL))<EOL><DEDENT>table_type = type<EOL><DEDENT>return table_type<EOL>
Get the numerical table type