#!/usr/bin/python2 import collections def get_os_name(name): try: return name.split(' ')[0].lower() except: pass def select_with_attribute(iterable, attribute, result=True): return [value for value in iterable if (attribute in value) == result] def is_iterable(obj): if isinstance(obj, collections.Iterable): return True return False filters = [ ('select_with_attribute', select_with_attribute), ('get_os_name', get_os_name) ] tests = [ ('iterable', is_iterable) ]