Did I find the right examples for you? yes no

All Samples(12)  |  Call(5)  |  Derive(0)  |  Import(7)

src/w/s/wsaccel-0.6.2/wsaccel/__init__.py   wsaccel(Download)
def patch_autobahn():
    from wsaccel.utf8validator import Utf8Validator
    from wsaccel.xormask import XorMaskerNull, XorMaskerSimple
    import autobahn.websocket
 
def patch_ws4py():
    from wsaccel.utf8validator import Utf8Validator
    from wsaccel.xormask import XorMaskerSimple
    from ws4py import streaming, framing
 
    streaming.Utf8Validator = Utf8Validator
 
    def mask(self, data):
        if self.masking_key:
            masker = XorMaskerSimple(self.masking_key)
def patch_tornado():
    from tornado.websocket import WebSocketProtocol13
    from wsaccel.xormask import XorMaskerSimple
 
    def _apply_mask(self, mask, data):
        masker = XorMaskerSimple(mask)

src/w/s/wsaccel-HEAD/wsaccel/__init__.py   wsaccel(Download)
def patch_autobahn():
    from wsaccel.utf8validator import Utf8Validator
    from wsaccel.xormask import XorMaskerNull, XorMaskerSimple
    import autobahn.websocket
 
def patch_ws4py():
    from wsaccel.utf8validator import Utf8Validator
    from wsaccel.xormask import XorMaskerSimple
    from ws4py import streaming, framing
 
    streaming.Utf8Validator = Utf8Validator
 
    def mask(self, data):
        if self.masking_key:
            masker = XorMaskerSimple(self.masking_key)
def patch_tornado():
    from tornado.websocket import WebSocketProtocol13
    from wsaccel.xormask import XorMaskerSimple
 
    def _apply_mask(self, mask, data):
        masker = XorMaskerSimple(mask)

src/w/s/wsaccel-HEAD/tests/test_xormask.py   wsaccel(Download)
from wsaccel.xormask import XorMaskerSimple
 
def test_xormasker():
    masker = XorMaskerSimple(b'\xf0\xf0\x0f\x0f')
    assert b'\xf0\xf0\x0f\x0f\xf0\xf0' == masker.process(b'\x00'*6)