MCPcopy
hub / github.com/pydata/xarray / pop_to

Function pop_to

xarray/coding/common.py:124–135  ·  view source on GitHub ↗

A convenience function which pops a key k from source to dest. None values are not passed on. If k already exists in dest an error is raised.

(
    source: MutableMapping, dest: MutableMapping, key: Hashable, name: T_Name = None
)

Source from the content-addressed store, hash-verified

122
123
124def pop_to(
125 source: MutableMapping, dest: MutableMapping, key: Hashable, name: T_Name = None
126) -> Any:
127 """
128 A convenience function which pops a key k from source to dest.
129 None values are not passed on. If k already exists in dest an
130 error is raised.
131 """
132 value = source.pop(key, None)
133 if value is not None:
134 safe_setitem(dest, key, value, name=name)
135 return value
136
137
138def unpack_for_encoding(var: Variable) -> T_VarTuple:

Callers 11

decodeMethod · 0.90
decodeMethod · 0.90
_check_fill_valuesFunction · 0.90
encodeMethod · 0.90
decodeMethod · 0.90
encodeMethod · 0.90
decodeMethod · 0.90
encode_cf_variableFunction · 0.85
_encode_coordinatesFunction · 0.85
decodeMethod · 0.85
open_store_variableMethod · 0.85

Calls 1

safe_setitemFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…