#!/usr/bin/python2 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] filters = [ ('select_with_attribute', select_with_attribute), ('get_os_name', get_os_name) ]