<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_property(self, name, value, update_session=True):
 """Create or set the value of a property. Returns `True` if the property was created or updated, or `False` if there were no changes to the value of the property. Args: name (str):
 Name of the property to create or update value (any):
 Value of the property. This can be any type of JSON serializable data update_session (bool):
 Automatically add the change to the SQLAlchemy session. Default: True Returns: `bool` """

        if type(value) == datetime:
            value = value.isoformat()
        else:
            value = value

        try:
            prop = self.get_property(name)
            if prop.value == value:
                return False

            prop.value = value

        except AttributeError:
            prop = ResourceProperty()
            prop.resource_id = self.id
            prop.name = name
            prop.value = value

        if update_session:
            db.session.add(prop)

        return True