from typing import Callable
from typing import List


def get_random_weights(items, key: Callable[[int], float]) -> List[float]:
    """Returns the random weights of the items for the random function

    Parameters
    ----------
    items : List[Item]
        list of items to find weights of
    key : function : int -> float
        function that takes in rarity and returns the drop rate of the item

    Returns
    -------
    List[float]
        the list of weights of the items
    """
    weights = []
    for i in range(len(items)):
        weights.append(key(items[i].rarity))
    return weights