Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def unpack_host(host):
    if len(host) == 4:
        return socket.inet_ntop(socket.AF_INET, host)
    elif len(host) == 16: 
        return socket.inet_ntop(socket.AF_INET6, host)
        


src/d/h/dhtfck-HEAD/btdht/btdht.py   dhtfck(Download)
from .bencode import bdecode, BTFailure
from .node import Node
from .utils import decode_nodes, encode_nodes, random_node_id, unpack_host, unpack_hostport
 
logger = logging.getLogger(__name__)
 
        if "ip" in args:
            logger.debug("They try to SECURE me: %s", unpack_host(args["ip"]))
 
        t_name = trans["name"]

src/d/h/DHT-woodworm-HEAD/btdht/btdht.py   DHT-woodworm(Download)
from .bencode import bdecode, BTFailure
from .node import Node
from .utils import decode_nodes, encode_nodes, random_node_id, unpack_host, unpack_hostport
 
 
 
        if "ip" in args:
            logger.debug("They try to SECURE me: %s", unpack_host(args["ip"].encode('hex')))
 
        #the server thread competes "node" resource with the iterative_thread