Return any data available in the cooked queue (very lazy).

        Raise EOFError if connection closed and no data available.
        Return '' if no cooked data available otherwise.  Don't block.
543139
def read_very_lazy(self):
        
        buf = self.cookedq.getvalue()
        self.cookedq.seek(0)
        self.cookedq.truncate()
        if not buf and self.eof and not self.rawq:
            raise EOFError('telnet connection closed')
        return buf
1238888
def locked(self):
        
        conn = self._get_connection()
        try:
            self._lock(conn)
            yield conn
        finally:
            self._unlock(conn)
1254500
def requeue(self, queue=None, retry_count=0):
        

        if not queue:
            if not self.data or not self.data.get("queue"):
                self.fetch(full_data={"_id": 0, "queue": 1, "path": 1})
            queue = self.data["queue"]

        self._save_status("queued", updates={
            "queue": queue,
            "datequeued": datetime.datetime.utcnow(),
            "retry_count": retry_count
        })
238034
def getc(self, block=True):
        """"""
        try:
            return self.cookedq.get(block)
        except gevent.queue.Empty:
            return ''
1369843
def get(self, key: Any, default: Any=None) -> Any:
        ''''''

        return self.data.get(key, default)
782838
def get(self, session):
        
        idle = self.idle_connections
        if idle:
            connection = idle.pop(0)
            connection.lock(session)
            if self.idle_start:
                with self._lock:
                    self.idle_start = None
            return connection.handle
        raise NoIdleConnectionsError(self.id)
181266
def data(self):
        
        # Cache the data for next time .data is called.
        if self._data is None:
            self._data = self.to_value(self.instance)
        return self._data
21337
async def get_data(self, raw: bool=True) -> AnyStr:
        """"""
        try:
            body_future = asyncio.ensure_future(self.body)
            raw_data = await asyncio.wait_for(body_future, timeout=self.body_timeout)
        except asyncio.TimeoutError:
            body_future.cancel()
            from ..exceptions import RequestTimeout  # noqa Avoiding circular import
            raise RequestTimeout()

        if raw:
            return raw_data
        else:
            return raw_data.decode(self.charset)
101830
def _fetch(self):
        
        if self.closed():
            raise self.Error("Failed to read from closed connection {!r}".format(self.server.address))
        if self.defunct():
            raise self.Error("Failed to read from defunct connection {!r}".format(self.server.address))
        if not self.responses:
            return 0, 0

        self._receive()

        details, summary_signature, summary_metadata = self._unpack()

        if details:
            log_debug("[#%04X]  S: RECORD * %d", self.local_port, len(details))  # TODO
            self.responses[0].on_records(details)

        if summary_signature is None:
            return len(details), 0

        response = self.responses.popleft()
        response.complete = True
        if summary_signature == b"\x70":
            log_debug("[#%04X]  S: SUCCESS %r", self.local_port, summary_metadata)
            response.on_success(summary_metadata or {})
        elif summary_signature == b"\x7E":
            self._last_run_statement = None
            log_debug("[#%04X]  S: IGNORED", self.local_port)
            response.on_ignored(summary_metadata or {})
        elif summary_signature == b"\x7F":
            self._last_run_statement = None
            log_debug("[#%04X]  S: FAILURE %r", self.local_port, summary_metadata)
            response.on_failure(summary_metadata or {})
        else:
            self._last_run_statement = None
            raise ProtocolError("Unexpected response message with signature %02X" % summary_signature)

        return len(details), 1
100701
def none(self):
        
        return EmptyQuerySet(model=self.model, using=self._using, connection=self._connection)
226793
async def _read_data(self):
        """"""
        last_error = ConnectionClosedError(
            "Connection has been closed by server")
        while not self._reader.at_eof():
            try:
                obj = await self._reader.readobj()
            except asyncio.CancelledError:
                # NOTE: reader can get cancelled from `close()` method only.
                last_error = RuntimeError('this is unexpected')
                break
            except ProtocolError as exc:
                # ProtocolError is fatal
                # so connection must be closed
                if self._in_transaction is not None:
                    self._transaction_error = exc
                last_error = exc
                break
            except Exception as exc:
                # NOTE: for QUIT command connection error can be received
                #       before response
                last_error = exc
                break
            else:
                if (obj == b'' or obj is None) and self._reader.at_eof():
                    logger.debug("Connection has been closed by server,"
                                 " response: %r", obj)
                    last_error = ConnectionClosedError("Reader at end of file")
                    break

                if isinstance(obj, MaxClientsError):
                    last_error = obj
                    break
                if self._in_pubsub:
                    self._process_pubsub(obj)
                else:
                    self._process_data(obj)
        self._closing = True
        self._loop.call_soon(self._do_close, last_error)
490409
def read_some(self):
        
        self.process_rawq()
        while self.cookedq.tell() == 0 and not self.eof:
            self.fill_rawq()
            self.process_rawq()
        buf = self.cookedq.getvalue()
        self.cookedq.seek(0)
        self.cookedq.truncate()
        return buf
623918
def get_request(self):
        
        # Note that this class must be mixed with another class that implements get_request()
        request, client_addr = super(BoundedThreadingMixIn, self).get_request()
        overload = False
        with self._thread_guard:
            if self._threads is not None and len(self._threads) + 1 > MAX_RPC_THREADS:
                overload = True

        if overload:
            res = self.overloaded(client_addr)
            request.sendall(res)

            sys.stderr.write('{} - - [{}] "Overloaded"\n'.format(client_addr[0], time_str(time.time())))
            self.shutdown_request(request)
            return None, None

        return request, client_addr
305405
def get(self, *args, **kwargs):
        
        if not mqueue.qsize():
            return None
        message_data, content_type, content_encoding = mqueue.get()
        return self.Message(backend=self, body=message_data,
                       content_type=content_type,
                       content_encoding=content_encoding)
954311
def _receive(self):
        
        data_in = EMPTY_BUFFER
        try:
            data_in = self._read_from_socket()
        except socket.timeout:
            pass
        except (IOError, OSError) as why:
            if why.args[0] not in (EWOULDBLOCK, EAGAIN):
                self._exceptions.append(AMQPConnectionError(why))
                self._running.clear()
        return data_in
625584
def process(self, data=None):
        

        return super(RequestHandler, self).process(data=data or self.get_request_data())
892595
def get(self, max=None, timeout=None, wait=None):
        
        response = self.reserve(max, timeout, wait)
        return response