<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_port_profile_created(self, vlan_id, profile_name, device_id):
 """Sets created_on_ucs flag to True."""

        with self.session.begin(subtransactions=True):
            port_profile = self.session.query(
                ucsm_model.PortProfile).filter_by(
                    vlan_id=vlan_id, profile_id=profile_name,
                    device_id=device_id).first()
            if port_profile:
                port_profile.created_on_ucs = True
                self.session.merge(port_profile)
            else:
                new_profile = ucsm_model.PortProfile(profile_id=profile_name,
                                          vlan_id=vlan_id,
                                          device_id=device_id,
                                          created_on_ucs=True)
                self.session.add(new_profile)