MCPcopy Index your code
hub / github.com/data-apis/python-record-api / move

Function move

record_api/apis.py:765–782  ·  view source on GitHub ↗

Moves keys from right to left, making sure to use original ordering in r

(
    l: typing.Dict[K, V],
    r: typing.Dict[K, V],
    keys: typing.Iterable[K],
    f: typing.Callable[[V, V], V],
)

Source from the content-addressed store, hash-verified

763
764
765def move(
766 l: typing.Dict[K, V],
767 r: typing.Dict[K, V],
768 keys: typing.Iterable[K],
769 f: typing.Callable[[V, V], V],
770) -> None:
771 """
772 Moves keys from right to left, making sure to use original ordering in r
773 """
774 for k, v in r.items():
775 if k not in keys:
776 continue
777 if k in l:
778 v = f(l[k], v)
779 l[k] = v
780
781 for k in keys:
782 del r[k]
783
784
785def merge_intersection(

Callers 1

_copy_kw_onlyMethod · 0.85

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected