def METHOD_NAME(self, choices: t.Dict[t.Any, float]) -> t.Any:
    """Returns a random element according to the specified weights.
    :param choices: A dictionary where keys are choices and values are weights.
    :raises ValueError: if choices is empty.
    :return: Random key from dictionary.
    """
    if not choices:
        raise ValueError("Choices cannot be empty.")
    population = list(choices.keys())
    weights = list(choices.values())
    return self.choices(population, weights=weights, k=1)[0]