def _check_arity_and_homogeneity(sig, args, arity, return_type=None):
 assert (len(args) == arity)
 assert (len(sig.args) == arity)
 ty = sig.args[0]
 if (return_type is None):
  return_type = ty
 if (not (all(((arg == ty) for arg in sig.args)) and (sig.return_type == return_type))):
  import inspect
  fname = inspect.currentframe().f_back.f_code.co_name
  msg = '{0} called with invalid types: {1}'.format(fname, sig)
  assert False, msg

def _check_arity_and_homogeneity ( sig , args , arity , return_type = None ) : assert ( len ( args ) == arity ) assert ( len ( sig . args ) == arity ) ty = sig . args [ 0 ] if ( return_type is None ) : return_type = ty if ( not ( all ( ( ( arg == ty ) for arg in sig . args ) ) and ( sig . return_type == return_type ) ) ) : import inspect fname = inspect . currentframe ( ) . f_back . f_code . co_name msg = '{0} called with invalid types: {1}' . format ( fname , sig ) assert False , msg
checks that the following are true: - args and sig .