@sync<EOL><INDENT>def get(self):<DEDENT>
<EOL>if self.is_shutdown():<EOL><INDENT>return None<EOL><DEDENT>while len(self._states) == <NUM_LIT:0>:<EOL><INDENT>if self.running == <NUM_LIT:0>:<EOL><INDENT>return None<EOL><DEDENT>if self.is_shutdown():<EOL><INDENT>return None<EOL><DEDENT>logger.debug("<STR_LIT>")<EOL>self._lock.wait()<EOL><DEDENT>state_id = self._policy.choice(list(self._states))<EOL>if state_id is None:<EOL><INDENT>return None<EOL><DEDENT>del self._states[self._states.index(state_id)]<EOL>return state_id<EOL>
Dequeue a state with the max priority