def _clear_special_values(d):
 l = [d]
 while l:
  i = l.pop()
  pops = []
  for (k, v) in i.items():
   if (v is REMOVE_THIS_KEY):
    pops.append(k)
   elif isinstance(v, dict):
    l.append(v)
  for k in pops:
   i.pop(k)

def _clear_special_values ( d ) : l = [ d ] while l : i = l . pop ( ) pops = [ ] for ( k , v ) in i . items ( ) : if ( v is REMOVE_THIS_KEY ) : pops . append ( k ) elif isinstance ( v , dict ) : l . append ( v ) for k in pops : i . pop ( k )
remove remove_this_key values from dictionary .