<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setFlag(self, flag, state=True):
 """ Sets whether or not this flag should be on. :param flag | <Column.Flags> state | <bool> """

        if state:
            self.__flags |= flag
        else:
            self.__flags &= ~flag