<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_table_size(p_alphabet, p_num):
 """ Returns a prime number that is suitable for the hash table size. The size is dependent on the alphabet used, and the number of items that need to be hashed. The table size is at least 100 times larger than the number of items to be hashed, to avoid collisions. When the alphabet is too little or too large, then _TableSizeException is raised. Currently an alphabet of 10 to 40 characters is supported. """

    try:
        for width, size in sorted(_TABLE_SIZES[len(p_alphabet)].items()):
            if p_num < size * 0.01:
                return width, size
    except KeyError:
        pass

    raise _TableSizeException('Could not find appropriate table size for given alphabet')