MCPcopy
hub / github.com/mne-tools/mne-python / _handle_default

Function _handle_default

mne/defaults.py:359–374  ·  view source on GitHub ↗

Avoid dicts as default keyword arguments. Use this function instead to resolve default dict values. Example usage:: scalings = _handle_default('scalings', scalings)

(k, v=None)

Source from the content-addressed store, hash-verified

357
358
359def _handle_default(k, v=None):
360 """Avoid dicts as default keyword arguments.
361
362 Use this function instead to resolve default dict values. Example usage::
363
364 scalings = _handle_default('scalings', scalings)
365
366 """
367 this_mapping = deepcopy(DEFAULTS[k])
368 if v is not None:
369 if isinstance(v, dict):
370 this_mapping.update(v)
371 else:
372 for key in this_mapping:
373 this_mapping[key] = v
374 return this_mapping
375
376
377HEAD_SIZE_DEFAULT = 0.095 # in [m]

Callers 15

test_handle_defaultFunction · 0.90
test_si_unitsFunction · 0.90
test_consistencyFunction · 0.90
_validate_zoomsFunction · 0.85
_validate_niterFunction · 0.85
make_ad_hoc_covFunction · 0.85
_check_scalings_userFunction · 0.85
_smart_eighFunction · 0.85
regularizeFunction · 0.85
_regularized_covarianceFunction · 0.85
_estimate_rank_meeg_covFunction · 0.85
_compute_rankFunction · 0.85

Calls 1

updateMethod · 0.45

Tested by 3

test_handle_defaultFunction · 0.72
test_si_unitsFunction · 0.72
test_consistencyFunction · 0.72