def _CheckListType(settings, allowed_type, name, allow_none=True):
 if (settings is None):
  if (not allow_none):
   raise TypeError(('%s is None, which is not allowed.' % name))
  return settings
 if (not isinstance(settings, (tuple, list))):
  raise TypeError(('%s is not a list.' % name))
 if (not all((isinstance(i, allowed_type) for i in settings))):
  type_list = list(set((type(setting) for setting in settings)))
  raise TypeError(("%s contains types that don't match %s: %s" % (name, allowed_type.__name__, type_list)))
 return settings

def _CheckListType ( settings , allowed_type , name , allow_none = True ) : if ( settings is None ) : if ( not allow_none ) : raise TypeError ( ( '%s is None, which is not allowed.' % name ) ) return settings if ( not isinstance ( settings , ( tuple , list ) ) ) : raise TypeError ( ( '%s is not a list.' % name ) ) if ( not all ( ( isinstance ( i , allowed_type ) for i in settings ) ) ) : type_list = list ( set ( ( type ( setting ) for setting in settings ) ) ) raise TypeError ( ( "%s contains types that don't match %s: %s" % ( name , allowed_type . __name__ , type_list ) ) ) return settings
verify that settings in list are of the allowed type or raise typeerror .