def _ensure_tuple_or_list(arg_name, tuple_or_list):
 if (not isinstance(tuple_or_list, (tuple, list))):
  raise TypeError(('Expected %s to be a tuple or list. Received %r' % (arg_name, tuple_or_list)))
 return list(tuple_or_list)

def _ensure_tuple_or_list ( arg_name , tuple_or_list ) : if ( not isinstance ( tuple_or_list , ( tuple , list ) ) ) : raise TypeError ( ( 'Expected %s to be a tuple or list. Received %r' % ( arg_name , tuple_or_list ) ) ) return list ( tuple_or_list )
ensures an input is a tuple or list .