<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def FlipAllowed(self):
 """Raise an error if the not keyword is used where it is not allowed."""

    if not hasattr(self, 'flipped'):
      raise errors.ParseError('Not defined.')

    if not self.flipped:
      return

    if self.current_expression.operator:
      if not self.current_expression.operator.lower() in (
          'is', 'contains', 'inset', 'equals'):
        raise errors.ParseError(
            'Keyword \'not\' does not work against operator: {0:s}'.format(
                self.current_expression.operator))