def _check_sets(result, expected, msg, path, type_):
 if (result != expected):
  if (result > expected):
   diff = (result - expected)
   msg = ('extra %s in result: %r' % (_s(type_, diff), diff))
  elif (result < expected):
   diff = (expected - result)
   msg = ('result is missing %s: %r' % (_s(type_, diff), diff))
  else:
   in_result = (result - expected)
   in_expected = (expected - result)
   msg = ('%s only in result: %s\n%s only in expected: %s' % (_s(type_, in_result), in_result, _s(type_, in_expected), in_expected))
  raise AssertionError(('%s%ss do not match\n%s' % (_fmt_msg(msg), type_, _fmt_path(path))))

def _check_sets ( result , expected , msg , path , type_ ) : if ( result != expected ) : if ( result > expected ) : diff = ( result - expected ) msg = ( 'extra %s in result: %r' % ( _s ( type_ , diff ) , diff ) ) elif ( result < expected ) : diff = ( expected - result ) msg = ( 'result is missing %s: %r' % ( _s ( type_ , diff ) , diff ) ) else : in_result = ( result - expected ) in_expected = ( expected - result ) msg = ( '%s only in result: %s\n%s only in expected: %s' % ( _s ( type_ , in_result ) , in_result , _s ( type_ , in_expected ) , in_expected ) ) raise AssertionError ( ( '%s%ss do not match\n%s' % ( _fmt_msg ( msg ) , type_ , _fmt_path ( path ) ) ) )
compare two sets .