def dictionary_merge(a, b):
 for (key, value) in b.items():
  if ((key in a) and isinstance(a[key], dict) and isinstance(value, dict)):
   dictionary_merge(a[key], b[key])
   continue
  a[key] = b[key]
 return a

def dictionary_merge ( a , b ) : for ( key , value ) in b . items ( ) : if ( ( key in a ) and isinstance ( a [ key ] , dict ) and isinstance ( value , dict ) ) : dictionary_merge ( a [ key ] , b [ key ] ) continue a [ key ] = b [ key ] return a
merges dictionary b into a like dict .