def METHOD_NAME(self, states):
    # Read and Write policy
    action = None
    while action is None:
        if states["finished"]:
            # Finish the hypo by sending eos to server
            return self.finish_action()
        # Model make decision given current states
        decision = self.model.decision_from_states(states)
        if decision == 0 and not self.finish_read(states):
            # READ
            action = self.read_action(states)
        else:
            # WRITE
            action = self.write_action(states)
        # None means we make decision again but not sending server anything
        # This happened when read a bufffered token
        # Or predict a subword
    return action