b985e691310c9a2d88b58be2dfecaf9197ea6f5e,parlai/mturk/core/mturk_manager.py,MTurkManager,_on_new_message,#MTurkManager#Any#,410

Before Change


        
        worker_id = pkt.sender_id
        assignment_id = pkt.assignment_id
        curr_state = self.worker_state[worker_id].assignments[assignment_id]
        if not curr_state.is_final():
            // Push the message to the message thread to send on a reconnect
            curr_state.messages.append(pkt.data)

            // Clear the send message command, as a message was recieved
            curr_state.last_command = None
            self.mturk_agents[worker_id][assignment_id].msg_queue.put(pkt.data)

    def _on_socket_dead(self, worker_id, assignment_id):
        Handle a disconnect event, update state as required and notifying

After Change


        
        worker_id = pkt.sender_id
        assignment_id = pkt.assignment_id
        agent = self._get_agent(worker_id, assignment_id)
        if agent is None:
            self._log_missing_agent(worker_id, assignment_id)
        elif not agent.state.is_final():
            // Push the message to the message thread to send on a reconnect
            agent.state.messages.append(pkt.data)

            // Clear the send message command, as a message was recieved
            agent.state.last_command = None
            agent.msg_queue.put(pkt.data)

    def _on_socket_dead(self, worker_id, assignment_id):
        Handle a disconnect event, update state as required and notifying
        other agents if the disconnected agent was in conversation with them
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: facebookresearch/ParlAI
Commit Name: b985e691310c9a2d88b58be2dfecaf9197ea6f5e
Time: 2017-09-15
Author: jju@fb.com
File Name: parlai/mturk/core/mturk_manager.py
Class Name: MTurkManager
Method Name: _on_new_message


Project Name: facebookresearch/ParlAI
Commit Name: b985e691310c9a2d88b58be2dfecaf9197ea6f5e
Time: 2017-09-15
Author: jju@fb.com
File Name: parlai/mturk/core/mturk_manager.py
Class Name: MTurkManager
Method Name: _handle_partner_disconnect


Project Name: facebookresearch/ParlAI
Commit Name: b985e691310c9a2d88b58be2dfecaf9197ea6f5e
Time: 2017-09-15
Author: jju@fb.com
File Name: parlai/mturk/core/mturk_manager.py
Class Name: MTurkManager
Method Name: _handle_worker_disconnect