MCPcopy Create free account
hub / github.com/EasyIME/PIME / split

Method split

python/python3/tornado/tcpclient.py:76–98  ·  view source on GitHub ↗

Partition the ``addrinfo`` list by address family. Returns two lists. The first list contains the first entry from ``addrinfo`` and all others with the same family, and the second list contains all other addresses (normally one list will be AF_INET and the other AF_

(
        addrinfo: List[Tuple],
    )

Source from the content-addressed store, hash-verified

74
75 @staticmethod
76 def split(
77 addrinfo: List[Tuple],
78 ) -> Tuple[
79 List[Tuple[socket.AddressFamily, Tuple]],
80 List[Tuple[socket.AddressFamily, Tuple]],
81 ]:
82 """Partition the ``addrinfo`` list by address family.
83
84 Returns two lists. The first list contains the first entry from
85 ``addrinfo`` and all others with the same family, and the
86 second list contains all other addresses (normally one list will
87 be AF_INET and the other AF_INET6, although non-standard resolvers
88 may return additional families).
89 """
90 primary = []
91 secondary = []
92 primary_af = addrinfo[0][0]
93 for af, addr in addrinfo:
94 if af == primary_af:
95 primary.append((af, addr))
96 else:
97 secondary.append((af, addr))
98 return primary, secondary
99
100 def start(
101 self,

Callers 15

__init__Method · 0.95
runMethod · 0.80
safeSplitFunction · 0.80
rootSplitFunction · 0.80
safeSplitFunction · 0.80
safeSplitFunction · 0.80
onKeyDownMethod · 0.80
safeSplitFunction · 0.80
safeSplitFunction · 0.80
safeSplitFunction · 0.80
safeSplitFunction · 0.80
program_pathsFunction · 0.80

Calls 1

appendMethod · 0.45

Tested by 10

getMethod · 0.64
test_one_familyMethod · 0.64
test_mixedMethod · 0.64
test_break_continueMethod · 0.64
header_callbackMethod · 0.64
itFunction · 0.64
load_phrasesFunction · 0.64
prepare_testFunction · 0.64