from typing import List


def mock_random_choice(candidates: List, weights: List[float], *, k: int) -> List:
    """
    This is a mock function for random.choice(). It generates a deterministic sequence of the
    candidates, each one with frequency weights[i] (count: int(len(candidates) * k). If the
    sum of total count is less than number, then the deficiency is given to the candidates
    with the highest weight.
    :param candidates: candidates to choose from.
    :param weights: frequency of each candidate to be chosen.
    :param k: total number of output list.
    :return: a list of items in the candidates.
    """

    # normalization

    sum_of_weights = sum(weights)
    weights = [weight / sum_of_weights for weight in weights]

    counts: List[int] = [int(k * weights[i]) for i in range(len(weights))]

    if sum(counts) < k:
        max_idx: int = weights.index(max(weights))
        counts[max_idx] += k - sum(counts)

    result: List = list()
    for i in range(len(counts)):
        result += [candidates[i] for _ in range(counts[i])]
    return result