def base_digits_decoder(alist: list, b: int) -> int:
    """
    The inverse function of 'to_base'. This
    function will take a list of integers, where each 
    element is a digit in a number encoded in base 'b',
    and return an integer in base 10
    """
    p = 0
    ret = 0
    for n in alist[::-1]:
        ret += n * b ** p
        p += 1
    return ret