def key_checker(expected_keys):
 def check(actual_dict, raise_error=True):
  '\n        Function that checks whether all keys in the expected_keys object is in the given actual_dict object.\n        '
  missing = (set(expected_keys) - set(actual_dict.keys()))
  if (not missing):
   return True
  if raise_error:
   raise InvalidTabsException("Expected keys '{0}' are not present in the given dict: {1}".format(expected_keys, actual_dict))
  else:
   return False
 return check

def key_checker ( expected_keys ) : def check ( actual_dict , raise_error = True ) : missing = ( set ( expected_keys ) - set ( actual_dict . keys ( ) ) ) if ( not missing ) : return True if raise_error : raise InvalidTabsException ( "Expected keys '{0}' are not present in the given dict: {1}" . format ( expected_keys , actual_dict ) ) else : return False return check
returns a function that checks that specified keys are present in a dict .