<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def key_to_int(key, base=BASE62):
 """ Convert the following key to an integer. @param key: a key. @param base: a sequence of characters that was used to encode the integer value. @return: the integer value corresponding to the given key. @raise ValueError: if one character of the specified key doesn't match any character of the specified base. """

    base_length = len(base)

    value = 0
    for c in reversed(key):
        value = (value * base_length) + base.index(c)

    return value