def __get_dynamic_attr(self, attname, obj, default=None):
        try:
            attr = getattr(self, attname)
        except __HOLE__:
            return default
        if callable(attr):
            # Check __code__.co_argcount rather than try/excepting the
            # function and catching the TypeError, because something inside
            # the function may raise the TypeError. This technique is more
            # accurate.
            if hasattr(attr, '__code__'):
                argcount = attr.__code__.co_argcount
            else:
                argcount = attr.__call__.__code__.co_argcount
            if argcount == 2: # one argument is 'self'
                return attr(obj)
            else:
                return attr()
        return attr
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/syndication/views.py/Feed.__get_dynamic_attr