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

Function combine_paths

numpy/distutils/system_info.py:3175–3199  ·  view source on GitHub ↗

Return a list of existing paths composed by all combinations of items from arguments.

(*args, **kws)

Source from the content-addressed store, hash-verified

3173
3174
3175def combine_paths(*args, **kws):
3176 """ Return a list of existing paths composed by all combinations of
3177 items from arguments.
3178 """
3179 r = []
3180 for a in args:
3181 if not a:
3182 continue
3183 if is_string(a):
3184 a = [a]
3185 r.append(a)
3186 args = r
3187 if not args:
3188 return []
3189 if len(args) == 1:
3190 result = reduce(lambda a, b: a + b, map(glob, args[0]), [])
3191 elif len(args) == 2:
3192 result = []
3193 for a0 in args[0]:
3194 for a1 in args[1]:
3195 result.extend(glob(os.path.join(a0, a1)))
3196 else:
3197 result = combine_paths(*(combine_paths(args[0], args[1]) + args[2:]))
3198 log.debug('(paths: %s)', ','.join(result))
3199 return result
3200
3201language_map = {'c': 0, 'c++': 1, 'f77': 2, 'f90': 3}
3202inv_language_map = {0: 'c', 1: 'c++', 2: 'f77', 3: 'f90'}

Callers 2

combine_pathsMethod · 0.85

Calls 2

is_stringFunction · 0.90
joinMethod · 0.45

Tested by

no test coverage detected