def __getattr__(self, key):
        try:
            _aliased_insp = self.__dict__['_aliased_insp']
        except KeyError:
            raise AttributeError()
        else:
            for base in _aliased_insp._target.__mro__:
                try:
                    attr = object.__getattribute__(base, key)
                except __HOLE__:
                    continue
                else:
                    break
            else:
                raise AttributeError(key)

        if isinstance(attr, PropComparator):
            ret = attr.adapt_to_entity(_aliased_insp)
            setattr(self, key, ret)
            return ret
        elif hasattr(attr, 'func_code'):
            is_method = getattr(_aliased_insp._target, key, None)
            if is_method and is_method.__self__ is not None:
                return util.types.MethodType(attr.__func__, self, self)
            else:
                return None
        elif hasattr(attr, '__get__'):
            ret = attr.__get__(None, self)
            if isinstance(ret, PropComparator):
                return ret.adapt_to_entity(_aliased_insp)
            else:
                return ret
        else:
            return attr
dataset/ETHPy150Open goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/orm/util.py/AliasedClass.__getattr__