def is_rel(s):
 if (len(s) == 0):
  return True
 elif (all((isinstance(el, tuple) for el in s)) and (len(max(s)) == len(min(s)))):
  return True
 else:
  raise ValueError((u'Set %r contains sequences of different lengths' % s))

def is_rel ( s ) : if ( len ( s ) == 0 ) : return True elif ( all ( ( isinstance ( el , tuple ) for el in s ) ) and ( len ( max ( s ) ) == len ( min ( s ) ) ) ) : return True else : raise ValueError ( ( u'Set %r contains sequences of different lengths' % s ) )
check whether a set represents a relation .