MCPcopy Create free account
hub / github.com/numpy/numpy / key_value_from_command

Function key_value_from_command

numpy/distutils/cpuinfo.py:54–62  ·  view source on GitHub ↗
(cmd, sep, successful_status=(0,),
                           stacklevel=1)

Source from the content-addressed store, hash-verified

52 yield line.strip()
53
54def key_value_from_command(cmd, sep, successful_status=(0,),
55 stacklevel=1):
56 d = {}
57 for line in command_by_line(cmd, successful_status=successful_status,
58 stacklevel=stacklevel+1):
59 l = [s.strip() for s in line.split(sep, 1)]
60 if len(l) == 2:
61 d[l[0]] = l[1]
62 return d
63
64class CPUInfoBase:
65 """Holds CPU information and provides methods for requiring

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls 3

command_by_lineFunction · 0.85
stripMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected