from typing import List


def _sampling_from_alias(
    alias: List[int],
    probs: List[float],
    first_random: float,
    second_random: float,
) -> int:
    """
    This is aligned with the original node2vec implementation w/ 2 random numbers.

    :param alias: the pre-calculated alias list
    :param probs: the pre-calculated probs list
    :param first_random: 1st random floating point number in the range [0.0, 1.0)
    :param second_random: 2nd random floating point number in the range [0.0, 1.0)

    Return the picked index in the neighbor list as next vertex in the random walk path.
    """
    pick = int(first_random * len(alias))
    if second_random < probs[pick]:
        return pick
    else:
        return alias[pick]