code: def _checkMode(self, ax_args):
          
          mode = ax_args.get('mode')
          if isinstance(mode, bytes):
              mode = str(mode, encoding="utf-8")
          if mode != self.mode:
              if not mode:
                  raise NotAXMessage()
              else:
                  raise AXError('Expected mode %r; got %r' % (self.mode, mode))
docs: Raise an exception if the mode in the attribute exchange
          arguments does not match what is expected for this class.
  
          @raises NotAXMessage: When there is no mode value in ax_args at all.
  
          @raises AXError: When mode does not match.