MCPcopy Create free account
hub / github.com/pydata/numexpr / _get_field

Function _get_field

numexpr3/cpuinfo.py:286–300  ·  view source on GitHub ↗
(cant_be_number, raw_string, convert_to, default_value, *field_names)

Source from the content-addressed store, hash-verified

284 return None
285
286def _get_field(cant_be_number, raw_string, convert_to, default_value, *field_names):
287 retval = _get_field_actual(cant_be_number, raw_string, field_names)
288
289 # Convert the return value
290 if retval and convert_to:
291 try:
292 retval = convert_to(retval)
293 except:
294 retval = default_value
295
296 # Return the default if there is no return value
297 if retval is None:
298 retval = default_value
299
300 return retval
301
302def _get_hz_string_from_brand(processor_brand):
303 # Just return 0 if the processor brand does not have the Hz

Callers 3

_get_cpu_info_from_lscpuFunction · 0.85

Calls 1

_get_field_actualFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…