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
2603
def _get_message(self, block=True, timeout=0.1, get_partition_info=None,
                     update_offset=True):
        
        start_at = time.time()
        while self.queue.empty():
            # We're out of messages, go grab some more.
            log.debug('internal queue empty, fetching more messages')
            with FetchContext(self, block, timeout):
                self._fetch()

            if not block or time.time() > (start_at + timeout):
                break

        try:
            partition, message = self.queue.get_nowait()

            if update_offset:
                # Update partition offset
                self.offsets[partition] = message.offset + 1

                # Count, check and commit messages if necessary
                self.count_since_commit += 1
                self._auto_commit()

            if get_partition_info is None:
                get_partition_info = self.partition_info
            if get_partition_info:
                return partition, message
            else:
                return message
        except queue.Empty:
            log.debug('internal queue empty after fetch - returning None')
            return None
456674
def get_message(self, set_slave_ok, sock_info, use_cmd=False):
        """"""
        if set_slave_ok:
            # Set the slaveOk bit.
            flags = self.flags | 4
        else:
            flags = self.flags

        ns = self.namespace()
        spec = self.spec

        if use_cmd:
            spec = self.as_command(sock_info)[0]
            if sock_info.op_msg_enabled:
                request_id, msg, size, _ = _op_msg(
                    0, spec, self.db, self.read_preference,
                    set_slave_ok, False, self.codec_options,
                    ctx=sock_info.compression_context)
                return request_id, msg, size
            ns = _UJOIN % (self.db, "$cmd")
            ntoreturn = -1  # All DB commands return 1 document
        else:
            # OP_QUERY treats ntoreturn of -1 and 1 the same, return
            # one document and close the cursor. We have to use 2 for
            # batch size if 1 is specified.
            ntoreturn = self.batch_size == 1 and 2 or self.batch_size
            if self.limit:
                if ntoreturn:
                    ntoreturn = min(self.limit, ntoreturn)
                else:
                    ntoreturn = self.limit

        if sock_info.is_mongos:
            spec = _maybe_add_read_preference(spec,
                                              self.read_preference)

        return query(flags, ns, self.ntoskip, ntoreturn,
                     spec, None if use_cmd else self.fields,
                     self.codec_options, ctx=sock_info.compression_context)
913561
def GetFile(message=None, title=None, directory=None, fileName=None,
            allowsMultipleSelection=False, fileTypes=None):
    
    return dispatcher["GetFile"](message=message, title=title, directory=directory,
                                 fileName=fileName,
                                 allowsMultipleSelection=allowsMultipleSelection,
                                 fileTypes=fileTypes)
1301064
def get_message(self, dummy0, sock_info, use_cmd=False):
        """"""

        ns = self.namespace()
        ctx = sock_info.compression_context

        if use_cmd:
            spec = self.as_command(sock_info)[0]
            if sock_info.op_msg_enabled:
                request_id, msg, size, _ = _op_msg(
                    0, spec, self.db, ReadPreference.PRIMARY,
                    False, False, self.codec_options,
                    ctx=sock_info.compression_context)
                return request_id, msg, size
            ns = _UJOIN % (self.db, "$cmd")
            return query(0, ns, 0, -1, spec, None, self.codec_options, ctx=ctx)

        return get_more(ns, self.ntoreturn, self.cursor_id, ctx)
30992
def info(self):
        
        b = self.bin()
        for i in range(len(b), 0, -1):
            if b[:i] in self._range[self.v]:
                return self._range[self.v][b[:i]]
        return 'UNKNOWN'
789225
def _get_partition(self, org_name, part_name=None):
        
        if part_name is None:
            part_name = self._part_name
        url = self._update_part_url % (org_name, part_name)
        res = self._send_request("GET", url, '', 'partition')
        if res and res.status_code in self._resp_ok:
            return res.json()
681248
def GetTopicsTree(self):
        '''
        '''
        if self.topics is None:
            return None

        if self.topics:
            res, ui = chmlib.chm_resolve_object(self.file, self.topics)
            if (res != chmlib.CHM_RESOLVE_SUCCESS):
                return None

        size, text = chmlib.chm_retrieve_object(self.file, ui, 0l, ui.length)
        if (size == 0):
            sys.stderr.write('GetTopicsTree: file size = 0\n')
            return None
        return text
1218001
def info(self, text=None):
        
        return self.stop_and_persist(symbol=LogSymbols.INFO.value, text=text)
503586
def _find_unused_partition() -> RootPartitions:
    
    which = subprocess.check_output(['ot-unused-partition']).strip()
    return {b'2': RootPartitions.TWO,
            b'3': RootPartitions.THREE}[which]
1261539
def getMessage(self):
        
        msg = str(self.msg)
        if self.args:
            msg = msg % self.args

        if platform.system().lower() == 'windows' or self.levelno < 10:
            return msg
        elif self.levelno >= 50:
            return utils.return_colorized(msg, 'critical')
        elif self.levelno >= 40:
            return utils.return_colorized(msg, 'error')
        elif self.levelno >= 30:
            return utils.return_colorized(msg, 'warn')
        elif self.levelno >= 20:
            return utils.return_colorized(msg, 'info')
        else:
            return utils.return_colorized(msg, 'debug')
1108287
def get_statusmsg(self) -> str:
        
        if self._last_status is None:
            return self._last_status
        return self._last_status.decode()
1044913
def _get_info(self, host, port, unix_socket, auth):
        

        client = self._client(host, port, unix_socket, auth)
        if client is None:
            return None

        info = client.info()
        del client
        return info
895288
def exception_message(self) -> Union[str, None]:
        
        if self.has_error:
            exception_data = self._raw.get("exception", {})
            return exception_data.get("message")
        return None
1001845
def fetch_message(self, msgnum):
        
        self.imap_connect()
        status, data = self.mailbox.fetch(msgnum, "(RFC822)")
        self.imap_disconnect()

        for response_part in data:
            if isinstance(response_part, tuple):
                return email.message_from_string(response_part[1])
1307561
def get_partition_owner(self, partition_id):
        
        if partition_id not in self.partitions:
            self._do_refresh()
        return self.partitions.get(partition_id, None)
1329122
def get_messages(self, *args, **kwargs):
        
        return self.get_content(self.config['messages'], *args, **kwargs)
168340
def get(self):
        ''''''

        key = self.get_key_from_request()
        result = self.get_storage().get(key)

        return result if result else None