Did I find the right examples for you? yes no

All Samples(15)  |  Call(9)  |  Derive(0)  |  Import(6)

src/g/e/gevent-fastcgi-HEAD/gevent_fastcgi/server.py   gevent-fastcgi(Download)
    StderrStream,
)
from .utils import (
    pack_pairs,
    unpack_pairs,
    def handle_get_values_record(self, record):
        pairs = ((name, self.capabilities.get(name)) for name, _ in
                 unpack_pairs(record.content))
        content = pack_pairs(
            (name, str(value)) for name, value in pairs)
    def handle_params_record(self, record, request):
        request._environ.feed(record.content)
        if not record.content:
            # EOF received
            request.environ = dict(unpack_pairs(request._environ.read()))

src/g/e/gevent-fastcgi-1.0/gevent_fastcgi/server.py   gevent-fastcgi(Download)
    StderrStream,
)
from .utils import (
    pack_pairs,
    unpack_pairs,
    def handle_get_values_record(self, record):
        pairs = ((name, self.capabilities.get(name)) for name, _ in
                 unpack_pairs(record.content))
        content = pack_pairs(
            (name, str(value)) for name, value in pairs)
    def handle_params_record(self, record, request):
        request._environ.feed(record.content)
        if not record.content:
            # EOF received
            request.environ = dict(unpack_pairs(request._environ.read()))

src/g/e/gevent-fastcgi-HEAD/gevent_fastcgi/test/base/test_utils.py   gevent-fastcgi(Download)
    def test_pack_unpack_pairs(self):
        from ...utils import pack_pairs, unpack_pairs
 
        pairs = os.environ.items()
        for pair_in, pair_out in zip(pairs, unpack_pairs(pack_pairs(pairs))):
            assert pair_in == pair_out
 
        pairs = list(unpack_pairs('\1\2ABC\2\5DEFGHJK'))
    def test_unpack_pairs_fail(self):
        from ...utils import unpack_pairs
 
        for data in (
            '\1',
        ):
            with self.assertRaises(ValueError):
                dict(unpack_pairs(data))
 
    def test_pack_unpack_header(self):

src/g/e/gevent-fastcgi-HEAD/gevent_fastcgi/test/server/test_server.py   gevent-fastcgi(Download)
)
from ...base import Record
from ...utils import (
    pack_pairs, unpack_pairs, pack_begin_request, unpack_end_request)
from ..utils import (
            self.assertFalse(done)
            self.assertEquals(record.type, FCGI_GET_VALUES_RESULT)
            values = dict(unpack_pairs(record.content))
            for name in names:
                self.assertIn(name, values)

src/g/e/gevent-fastcgi-HEAD/gevent_fastcgi/test/server/test_connection_handler.py   gevent-fastcgi(Download)
 
from ...base import InputStream, Record
from ...utils import (
    pack_begin_request,
    pack_pairs,
        handler.handle_get_values_record(record)
 
        response_caps = dict(unpack_pairs(''.join(
            record.content for record in handler.records_sent
            if record.type == FCGI_GET_VALUES_RESULT)))