<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _add_or_remove_flag(self, flag, add):
 """ Add the given `flag` if `add` is True, remove it otherwise. """

        meth = self.add_flag if add else self.remove_flag
        meth(flag)