def _get_message(self, block=True, timeout=<NUM_LIT:0.1>, get_partition_info=None,<EOL>update_offset=True):
start_at = time.time()<EOL>while self.queue.empty():<EOL><INDENT>log.debug('<STR_LIT>')<EOL>with FetchContext(self, block, timeout):<EOL><INDENT>self._fetch()<EOL><DEDENT>if not block or time.time() > (start_at + timeout):<EOL><INDENT>break<EOL><DEDENT><DEDENT>try:<EOL><INDENT>partition, message = self.queue.get_nowait()<EOL>if update_offset:<EOL><INDENT>self.offsets[partition] = message.offset + <NUM_LIT:1><EOL>self.count_since_commit += <NUM_LIT:1><EOL>self._auto_commit()<EOL><DEDENT>if get_partition_info is None:<EOL><INDENT>get_partition_info = self.partition_info<EOL><DEDENT>if get_partition_info:<EOL><INDENT>return partition, message<EOL><DEDENT>else:<EOL><INDENT>return message<EOL><DEDENT><DEDENT>except queue.Empty:<EOL><INDENT>log.debug('<STR_LIT>')<EOL>return None<EOL><DEDENT>
If no messages can be fetched, returns None.
If get_partition_info is None, it defaults to self.partition_info
If get_partition_info is True, returns (partition, message)
If get_partition_info is False, returns message