def update_deviation(player_ratings, deviation_factors=None):
    """

    :param player_ratings: The previous rating period's data. The key must
        be hashable and uniquely identify a player.

        The dictionary and its values are not modified by this function.
    :type player_ratings: dict[Any, Rating]

    :param deviation_factors: Each player's inactivity factor. The key must
        be hashable and uniquely identify a player.

        A player that is not present in this dictionary is considered to have a
        factor of 1.0 (completely inactive).

        The dictionary and its values are not modified by this function.
    :type deviation_factors: dict[Any, float]

    :return: A new rating dictionary with updated deviations.
    :rtype: dict[Any, Rating]
    """
    deviation_factors = deviation_factors or dict()
    player_ratings = {p: r.clone() for p, r in player_ratings.items()}
    for player, rating in player_ratings.items():
        factor = deviation_factors.get(player, 1.0)
        rating.update_deviation(factor)
    return player_ratings