python类latin_1_encode()的实例源码

bgzf.py 文件源码 项目:vcfpy 作者: bihealth 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def write(self, data):
        # TODO - Check bytes vs unicode
        if isinstance(data, str):
            data = codecs.latin_1_encode(data)[0]
        # block_size = 2**16 = 65536
        data_len = len(data)
        if len(self._buffer) + data_len < 65536:
            # print("Cached %r" % data)
            self._buffer += data
            return
        else:
            # print("Got %r, writing out some data..." % data)
            self._buffer += data
            while len(self._buffer) >= 65536:
                self._write_block(self._buffer[:65536])
                self._buffer = self._buffer[65536:]
latin_1.py 文件源码 项目:python- 作者: secondtonone1 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
latin_1.py 文件源码 项目:kinect-2-libras 作者: inessadl 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
compat.py 文件源码 项目:oscars2016 作者: 0x0ece 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def b(s):
        return codecs.latin_1_encode(s)[0]
py3compat.py 文件源码 项目:mongodb-monitoring 作者: jruaux 项目源码 文件源码 阅读 51 收藏 0 点赞 0 评论 0
def b(s):
        # BSON and socket operations deal in binary data. In
        # python 3 that means instances of `bytes`. In python
        # 2.6 and 2.7 you can create an alias for `bytes` using
        # the b prefix (e.g. b'foo').
        # See http://python3porting.com/problems.html#nicer-solutions
        return codecs.latin_1_encode(s)[0]
latin_1.py 文件源码 项目:swjtu-pyscraper 作者: Desgard 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
py3compat.py 文件源码 项目:noc-orchestrator 作者: DirceuSilvaLabs 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def b(s):
        # BSON and socket operations deal in binary data. In
        # python 3 that means instances of `bytes`. In python
        # 2.6 and 2.7 you can create an alias for `bytes` using
        # the b prefix (e.g. b'foo'). Python 2.4 and 2.5 don't
        # provide this marker so we provide this compat function.
        # In python 3.x b('foo') results in b'foo'.
        # See http://python3porting.com/problems.html#nicer-solutions
        return codecs.latin_1_encode(s)[0]
py3compat.py 文件源码 项目:noc-orchestrator 作者: DirceuSilvaLabs 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def b(s):
        # BSON and socket operations deal in binary data. In
        # python 3 that means instances of `bytes`. In python
        # 2.6 and 2.7 you can create an alias for `bytes` using
        # the b prefix (e.g. b'foo'). Python 2.4 and 2.5 don't
        # provide this marker so we provide this compat function.
        # In python 3.x b('foo') results in b'foo'.
        # See http://python3porting.com/problems.html#nicer-solutions
        return codecs.latin_1_encode(s)[0]
py3compat.py 文件源码 项目:noc-orchestrator 作者: DirceuSilvaLabs 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def b(s):
        # BSON and socket operations deal in binary data. In
        # python 3 that means instances of `bytes`. In python
        # 2.6 and 2.7 you can create an alias for `bytes` using
        # the b prefix (e.g. b'foo'). Python 2.4 and 2.5 don't
        # provide this marker so we provide this compat function.
        # In python 3.x b('foo') results in b'foo'.
        # See http://python3porting.com/problems.html#nicer-solutions
        return codecs.latin_1_encode(s)[0]
py3compat.py 文件源码 项目:noc-orchestrator 作者: DirceuSilvaLabs 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def b(s):
        # BSON and socket operations deal in binary data. In
        # python 3 that means instances of `bytes`. In python
        # 2.6 and 2.7 you can create an alias for `bytes` using
        # the b prefix (e.g. b'foo'). Python 2.4 and 2.5 don't
        # provide this marker so we provide this compat function.
        # In python 3.x b('foo') results in b'foo'.
        # See http://python3porting.com/problems.html#nicer-solutions
        return codecs.latin_1_encode(s)[0]
latin_1.py 文件源码 项目:hostapd-mana 作者: adde88 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
str_tools.py 文件源码 项目:llk 作者: Tycx2ry 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def _to_bytes_impl(msg):
    if isinstance(msg, str):
      return codecs.latin_1_encode(msg, 'replace')[0]
    else:
      return msg
str_tools.py 文件源码 项目:llk 作者: Tycx2ry 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def _to_bytes_impl(msg):
    if msg is not None and isinstance(msg, str_type):
      return codecs.latin_1_encode(msg, 'replace')[0]
    else:
      return msg
latin_1.py 文件源码 项目:Sci-Finder 作者: snverse 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
latin_1.py 文件源码 项目:Sci-Finder 作者: snverse 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
str_tools.py 文件源码 项目:spiderfoot 作者: wi-fi-analyzer 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def _to_bytes_impl(msg):
    if isinstance(msg, str):
      return codecs.latin_1_encode(msg, 'replace')[0]
    else:
      return msg
str_tools.py 文件源码 项目:spiderfoot 作者: wi-fi-analyzer 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def _to_bytes_impl(msg):
    if msg is not None and isinstance(msg, str_type):
      return codecs.latin_1_encode(msg, 'replace')[0]
    else:
      return msg
compat.py 文件源码 项目:eyeD3 作者: nicfit 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def b(x, encoder=None):
    if isinstance(x, BytesType):
        return x
    else:
        import codecs
        encoder = encoder or codecs.latin_1_encode
        return encoder(x)[0]
latin_1.py 文件源码 项目:ivaochdoc 作者: ivaoch 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
BlinkyTape.py 文件源码 项目:ambient-jenkins-statuuus 作者: polandy 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def encode(x):
        return codecs.latin_1_encode(x)[0]
latin_1.py 文件源码 项目:RPoint 作者: george17-meet 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
latin_1.py 文件源码 项目:habilitacion 作者: GabrielBD 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
latin_1.py 文件源码 项目:Intranet-Penetration 作者: yuxiaokui 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
latin_1.py 文件源码 项目:flasky 作者: RoseOu 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
compat.py 文件源码 项目:Orator-Google-App-Engine 作者: MakarenaLabs 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def b(s):
        return codecs.latin_1_encode(s)[0]
latin_1.py 文件源码 项目:MKFQ 作者: maojingios 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
latin_1.py 文件源码 项目:threatdetectionservice 作者: flyballlabs 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
latin_1.py 文件源码 项目:oa_qian 作者: sunqb 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
latin_1.py 文件源码 项目:Indushell 作者: SecarmaLabs 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]
compat.py 文件源码 项目:Liljimbo-Chatbot 作者: chrisjim316 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def b(s):
        return codecs.latin_1_encode(s)[0]


问题


面经


文章

微信
公众号

扫码关注公众号