def assert_list(obj, expected_type=string_types, can_be_none=True, default=(), key_arg=None, allowable=(list, Fileset, OrderedSet, set, tuple), raise_type=ValueError):
 def get_key_msg(key=None):
  if (key is None):
   return u''
  else:
   return u"In key '{}': ".format(key)
 allowable = tuple(allowable)
 key_msg = get_key_msg(key_arg)
 val = obj
 if (val is None):
  if can_be_none:
   val = list(default)
  else:
   raise raise_type(u'{}Expected an object of acceptable type {}, received None and can_be_none is False'.format(key_msg, allowable))
 if isinstance(val, allowable):
  lst = list(val)
  for e in lst:
   if (not isinstance(e, expected_type)):
    raise raise_type(u'{}Expected a list containing values of type {}, instead got a value {} of {}'.format(key_msg, expected_type, e, e.__class__))
  return lst
 else:
  raise raise_type(u'{}Expected an object of acceptable type {}, received {} instead'.format(key_msg, allowable, val))

def assert_list ( obj , expected_type = string_types , can_be_none = True , default = ( ) , key_arg = None , allowable = ( list , Fileset , OrderedSet , set , tuple ) , raise_type = ValueError ) : def get_key_msg ( key = None ) : if ( key is None ) : return u'' else : return u"In key '{}': " . format ( key ) allowable = tuple ( allowable ) key_msg = get_key_msg ( key_arg ) val = obj if ( val is None ) : if can_be_none : val = list ( default ) else : raise raise_type ( u'{}Expected an object of acceptable type {}, received None and can_be_none is False' . format ( key_msg , allowable ) ) if isinstance ( val , allowable ) : lst = list ( val ) for e in lst : if ( not isinstance ( e , expected_type ) ) : raise raise_type ( u'{}Expected a list containing values of type {}, instead got a value {} of {}' . format ( key_msg , expected_type , e , e . __class__ ) ) return lst else : raise raise_type ( u'{}Expected an object of acceptable type {}, received {} instead' . format ( key_msg , allowable , val ) )
this function is used to ensure that parameters set by users in build files are of acceptable types .