def put_recon_cache_entry(cache_entry, key, item):
 if isinstance(item, dict):
  if ((key not in cache_entry) or ((key in cache_entry) and (not isinstance(cache_entry[key], dict)))):
   cache_entry[key] = {}
  elif ((key in cache_entry) and (item == {})):
   cache_entry.pop(key, None)
   return
  for (k, v) in item.items():
   if (v == {}):
    cache_entry[key].pop(k, None)
   else:
    cache_entry[key][k] = v
 else:
  cache_entry[key] = item

def put_recon_cache_entry ( cache_entry , key , item ) : if isinstance ( item , dict ) : if ( ( key not in cache_entry ) or ( ( key in cache_entry ) and ( not isinstance ( cache_entry [ key ] , dict ) ) ) ) : cache_entry [ key ] = { } elif ( ( key in cache_entry ) and ( item == { } ) ) : cache_entry . pop ( key , None ) return for ( k , v ) in item . items ( ) : if ( v == { } ) : cache_entry [ key ] . pop ( k , None ) else : cache_entry [ key ] [ k ] = v else : cache_entry [ key ] = item
function that will check if item is a dict .