code: def pop_to(source, dest, key, name=None):
      
      value = source.pop(key, None)
      if value is not None:
          safe_setitem(dest, key, value, name=name)
      return value
docs: 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.