code: def decode_response(client_message, to_object=None):
      
      parameters = dict(response=None)
      if not client_message.read_bool():
          parameters['response'] = to_object(client_message.read_data())
      return parameters
docs: Decode response from client message