<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dyn(d, **kw):
 # {{{1 """ Pseudo-dynamic variables. 37 42 (3, 4) (1, 2) """


  old = { k:d[k] for k in kw }
  try:
    d.update(kw)
    yield
  finally:
    d.update(old)