Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(7) | Call(6) | Derive(0) | Import(1)
src/d/h/DHTBot-HEAD/dhtbot/coding/krpc_coder.py DHTBot(Download)
# Attach the transaction id rpc._transaction_id = basic_coder.btol(rpc_dict['t']) return rpc
basic_coder.encode_port(rpc_dict['a']['port']) q.port = rpc_dict['a']['port'] q.token = basic_coder.btol(rpc_dict['a']['token']) else: raise _ProtocolFormatError()
# get_peers returns a token if 'token' in rpc_dict['r']: r.token = basic_coder.btol(rpc_dict['r']['token']) return r
src/d/h/DHTBot-HEAD/dhtbot/protocols/krpc_responder.py DHTBot(Download)
hash.update(secret) # Return the hash as a number rather than a string numeric_hash_value = basic_coder.btol(hash.digest()) return numeric_hash_value
src/d/h/DHTBot-HEAD/dhtbot/contact.py DHTBot(Download)
def __hash__(self): return basic_coder.btol(encode_node(self)) def __ne__(self, other): return other.__hash__() ^ self.__hash__()
src/d/h/DHTBot-HEAD/dhtbot/test/coding/test_basic_coder.py DHTBot(Download)
from twisted.trial import unittest # Functions being tested from dhtbot.coding.basic_coder import (ltob, btol, encode_address, decode_address, encode_port, decode_port, encode_network_id, decode_network_id, InvalidDataError) class LongNumberCodingTestCase(unittest.TestCase): def test_ltob_and_btol(self): bijection = lambda num: btol(ltob(num))