Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(22)  |  Call(20)  |  Derive(0)  |  Import(2)

        def fromByteString(byteStr):
    result = 0
    shiftCount = 0
    for b in reversed(byteStr):
        result = result | ((ord(b) & 0xff) << shiftCount)
        shiftCount = shiftCount + 8

    return result
        


src/p/y/pynuodb-2.1/pynuodb/encodedsession.py   pynuodb(Download)
__all__  = [ 'EncodedSession' ]
 
from crypt import toByteString, fromByteString, toSignedByteString, fromSignedByteString
from session import Session, SessionException
 
 
        if typeCode in range(protocol.SCALEDLEN0, protocol.SCALEDLEN8 + 1):
            scale = fromByteString(self._takeBytes(1))
            value = fromSignedByteString(self._takeBytes(typeCode - 60))
            return decimal.Decimal(value) / decimal.Decimal(10**scale)
 
        if typeCode in range(protocol.UTF8COUNT1, protocol.UTF8COUNT4 + 1):
            strLength = fromByteString(self._takeBytes(typeCode - 68))
            return self._takeBytes(strLength)
 
 
        if typeCode in range(protocol.TIMELEN0, protocol.TIMELEN4 + 1):
            return fromByteString(self._takeBytes(typeCode - 104))
 
        raise DataError('Not a time')
 
        if typeCode in range(protocol.OPAQUECOUNT1, protocol.OPAQUECOUNT4 + 1):
            strLength = fromByteString(self._takeBytes(typeCode - 72))
            return datatype.Binary(self._takeBytes(strLength))
 

src/n/u/nuodb-python-HEAD/pynuodb/encodedsession.py   nuodb-python(Download)
__all__  = [ 'EncodedSession' ]
 
from crypt import toByteString, fromByteString, toSignedByteString, fromSignedByteString
from session import Session, SessionException
 
 
        if typeCode in range(protocol.SCALEDLEN0, protocol.SCALEDLEN8 + 1):
            scale = fromByteString(self._takeBytes(1))
            value = fromSignedByteString(self._takeBytes(typeCode - 60))
            return decimal.Decimal(value) / decimal.Decimal(10**scale)
 
        if typeCode in range(protocol.UTF8COUNT1, protocol.UTF8COUNT4 + 1):
            strLength = fromByteString(self._takeBytes(typeCode - 68))
            return self._takeBytes(strLength)
 
 
        if typeCode in range(protocol.TIMELEN0, protocol.TIMELEN4 + 1):
            return fromByteString(self._takeBytes(typeCode - 104))
 
        raise DataError('Not a time')
 
        if typeCode in range(protocol.OPAQUECOUNT1, protocol.OPAQUECOUNT4 + 1):
            strLength = fromByteString(self._takeBytes(typeCode - 72))
            return datatype.Binary(self._takeBytes(strLength))