code: def basek_string_to_base10_integer(k, x):
      
      assert 1 < k <= max_k_labeled
      return sum(numeral_index[c]*(k**i)
                 for i, c in enumerate(reversed(x)))
docs: Convert a base k string into an integer.