docs: def _extract_table_type(type):
      """
      Get the numerical table type
      """
      if isinstance(type, str):
          type = type.lower()
          if type[0:7] == 'binary':
              table_type = BINARY_TBL
          elif type[0:6] == 'ascii':
              table_type = ASCII_TBL
          else:
              raise ValueError(
                  "table type string should begin with 'binary' or 'ascii' "
                  "(case insensitive)")
      else:
          type = int(type)
          if type not in [BINARY_TBL, ASCII_TBL]:
              raise ValueError(
                  "table type num should be BINARY_TBL (%d) or "
                  "ASCII_TBL (%d)" % (BINARY_TBL, ASCII_TBL))
          table_type = type
  
      return table_type