MCPcopy Create free account
hub / github.com/dask/dask / pop

Function pop

dask/config.py:660–680  ·  view source on GitHub ↗

Like ``get``, but remove the element if found See Also -------- dask.config.get dask.config.set

(key: str, default: Any = no_default, config: dict = config)

Source from the content-addressed store, hash-verified

658
659
660def pop(key: str, default: Any = no_default, config: dict = config) -> Any:
661 """Like ``get``, but remove the element if found
662
663 See Also
664 --------
665 dask.config.get
666 dask.config.set
667 """
668 keys = key.split(".")
669 result = config
670 for i, k in enumerate(keys):
671 k = canonical_name(k, result)
672 try:
673 if i == len(keys) - 1:
674 return result.pop(k)
675 else:
676 result = result[k]
677 except (TypeError, IndexError, KeyError):
678 if default is no_default:
679 raise
680 return default
681
682
683def update_defaults(

Callers 2

test_popFunction · 0.90
renameFunction · 0.85

Calls 3

canonical_nameFunction · 0.85
splitMethod · 0.80
popMethod · 0.80

Tested by 1

test_popFunction · 0.72