from typing import Any
import random


def getKeyByWeights(array: dict, item: int = 0) -> Any:
    """
    Returns a weighted random key from array
    :param array: dict[Any: int | float]
    :param item: int
    :return:
        - key - Any
    """
    return random.choices(list(array.keys()), weights=list(array.values()))[item]