sample attrgetter code