def check_dict(ref_dict, tst_dict):
 def to_list(x):
  if isinstance(x, tuple):
   x = list(x)
  if isinstance(x, list):
   for (i, xel) in enumerate(x):
    x[i] = to_list(xel)
  return x
 failed_dict = {}
 for (key, value) in list(ref_dict.items()):
  newval = to_list(tst_dict[key])
  if (newval != value):
   failed_dict[key] = (value, newval)
 return failed_dict

def check_dict ( ref_dict , tst_dict ) : def to_list ( x ) : if isinstance ( x , tuple ) : x = list ( x ) if isinstance ( x , list ) : for ( i , xel ) in enumerate ( x ) : x [ i ] = to_list ( xel ) return x failed_dict = { } for ( key , value ) in list ( ref_dict . items ( ) ) : newval = to_list ( tst_dict [ key ] ) if ( newval != value ) : failed_dict [ key ] = ( value , newval ) return failed_dict
compare dictionaries of inputs and and those loaded from json files .