code: def check(frame) -> None:
          
          # The first parameter is called `frame` rather than `self`,
          # but it's the instance of class to which this method is bound.
  
          if frame.rsv1 or frame.rsv2 or frame.rsv3:
              raise WebSocketProtocolError("Reserved bits must be 0")
  
          if frame.opcode in DATA_OPCODES:
              return
          elif frame.opcode in CTRL_OPCODES:
              if len(frame.data) > 125:
                  raise WebSocketProtocolError("Control frame too long")
              if not frame.fin:
                  raise WebSocketProtocolError("Fragmented control frame")
          else:
              raise WebSocketProtocolError(f"Invalid opcode: {frame.opcode}")
docs: Check that this frame contains acceptable values.
  
          Raise :exc:`~websockets.exceptions.WebSocketProtocolError` if this
          frame contains incorrect values.