import warnings


def get_weight(target_easy_negative, easy_negative, hard_negative):
    """
    Args:
        target_easy_negative ([type]): [description]
        easy_negative ([type]): [description]
        hard_negative ([type]): [description]

    Returns:
        w_h, w_e: scaling factor for hard and easy and negative for achieving the
        target_easy_negative
    """
    w_e = target_easy_negative / easy_negative
    transfer_weight = easy_negative - target_easy_negative
    if transfer_weight < 0:
        warnings.warn(
            "Transfering weight from hard negative to easy negative")
    w_h = 1 + transfer_weight / hard_negative
    return w_h, w_e