def _attributes_equal(new_attributes, old_attributes):
    """
    Compare attributes (dict) by value to determine if a state is changed

    :param new_attributes: dict containing attributes
    :param old_attributes: dict containing attributes
    :return bool: result of the comparison between new_attributes and
    old attributes
    """
    for key in new_attributes:
        if key not in old_attributes:
            return False
        elif new_attributes[key] != old_attributes[key]:
            return False
    return True