<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _change_property_with_validity_check(self, property_name, value):
 """Helper method to change a property and reset it if the validity check fails :param str property_name: The name of the property to be changed, e.g. '_data_flow_id' :param value: The new desired value for this property :raises exceptions.ValueError: if a property could not be changed """

        assert isinstance(property_name, string_types)
        old_value = getattr(self, property_name)
        setattr(self, property_name, value)

        valid, message = self._check_validity()
        if not valid:
            setattr(self, property_name, old_value)
            class_name = self.__class__.__name__
            raise ValueError("The {2}'s '{0}' could not be changed: {1}".format(property_name[1:], message, class_name))