<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def basek_string_to_base10_integer(k, x):
 """Convert a base k string into an integer."""

    assert 1 < k <= max_k_labeled
    return sum(numeral_index[c]*(k**i)
               for i, c in enumerate(reversed(x)))