def __getitem__(self, name):
        '''Allow access to instance variables and methods via dictionary syntax.
           This allows us to use class instances as a data source
           for our HTML templates (which want a dictionary-like object)'''
        try:
            return super(GenericItem, self).__getitem__(name)
        except KeyError, err:
            try:
                attr = getattr(self, name)
            except __HOLE__:
                raise KeyError(err)
            if callable(attr):
                return attr()
            else:
                return attr
dataset/ETHPy150Open munki/munki/code/apps/Managed Software Center/Managed Software Center/MunkiItems.py/GenericItem.__getitem__