MCPcopy Index your code
hub / github.com/python/cpython / arbitrary_address

Function arbitrary_address

Lib/multiprocessing/connection.py:73–85  ·  view source on GitHub ↗

Return an arbitrary free address for the given family

(family)

Source from the content-addressed store, hash-verified

71#
72
73def arbitrary_address(family):
74 '''
75 Return an arbitrary free address for the given family
76 '''
77 if family == 'AF_INET':
78 return ('localhost', 0)
79 elif family == 'AF_UNIX':
80 return tempfile.mktemp(prefix='sock-', dir=util.get_temp_dir())
81 elif family == 'AF_PIPE':
82 return (r'\\.\pipe\pyc-%d-%d-%s' %
83 (os.getpid(), next(_mmap_counter), os.urandom(8).hex()))
84 else:
85 raise ValueError('unrecognized family')
86
87def _validate_family(family):
88 '''

Callers 2

__init__Method · 0.85
PipeFunction · 0.85

Calls 2

mktempMethod · 0.80
hexMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…