def _recv_message(self, expected_type=None):
    types = polo_pb2.OuterMessage
    message_types = {
        types.MESSAGE_TYPE_CONFIGURATION: polo_pb2.Configuration,
        types.MESSAGE_TYPE_CONFIGURATION_ACK: polo_pb2.ConfigurationAck,
        types.MESSAGE_TYPE_OPTIONS: polo_pb2.Options,
        types.MESSAGE_TYPE_PAIRING_REQUEST: polo_pb2.PairingRequest,
        types.MESSAGE_TYPE_PAIRING_REQUEST_ACK: polo_pb2.PairingRequestAck,
        types.MESSAGE_TYPE_SECRET: polo_pb2.Secret,
        types.MESSAGE_TYPE_SECRET_ACK: polo_pb2.SecretAck,
    }

    data = self.recv()
    req = polo_pb2.OuterMessage.FromString(data)
    # TODO: Check req.status and figure out how to deal with not OK.
    assert req.status == polo_pb2.OuterMessage.STATUS_OK

    # If an expected_type is provided, then verify the received type.
    if expected_type and expected_type != req.type:
      expected = message_types[expected_type].__name__
      actual = message_types[req.type].__name__
      raise MessageTypeError('Expected %s but received %s' % (expected, actual))

    message_type = message_types[req.type]
    message = message_type.FromString(req.payload)
    return message
Perform initialization of the lists for available and
dataset/ETHPy150Open stevenle/googletv-anymote/googletv/__init__.py/PairingProtocol._recv_message--crossover with--dataset/ETHPy150Open Morgawr/gogonlinux/gog_utils/gog_gui.py/GogTuxGUI.init_lists