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

Method arg_regex

numpy/distutils/tests/test_ccompiler_opt.py:144–173  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

142 return targets, gflags
143
144 def arg_regex(self, **kwargs):
145 map2origin = dict(
146 x64 = "x86",
147 ppc64le = "ppc64",
148 aarch64 = "armhf",
149 clang = "gcc",
150 )
151 march = self.march(); cc_name = self.cc_name()
152 map_march = map2origin.get(march, march)
153 map_cc = map2origin.get(cc_name, cc_name)
154 for key in (
155 march, cc_name, map_march, map_cc,
156 march + '_' + cc_name,
157 map_march + '_' + cc_name,
158 march + '_' + map_cc,
159 map_march + '_' + map_cc,
160 ) :
161 regex = kwargs.pop(key, None)
162 if regex is not None:
163 break
164 if regex:
165 if isinstance(regex, dict):
166 for k, v in regex.items():
167 if v[-1:] not in ')}$?\\.+*':
168 regex[k] = v + '$'
169 else:
170 assert(isinstance(regex, str))
171 if regex[-1:] not in ')}$?\\.+*':
172 regex += '$'
173 return regex
174
175 def expect(self, dispatch, baseline="", **kwargs):
176 match = self.arg_regex(**kwargs)

Callers 5

expectMethod · 0.95
expect_baselineMethod · 0.95
expect_flagsMethod · 0.95
expect_targetsMethod · 0.95
expect_target_flagsMethod · 0.95

Calls 3

marchMethod · 0.95
cc_nameMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected