def rec_getattr(obj, attr, default=None):
    """
        Recursive getattr.

        :param attr:
            Dot delimited attribute name
        :param default:
            Default value

        Example::

            rec_getattr(obj, 'a.b.c')
    """
    try:
        return reduce(getattr, attr.split('.'), obj)
    except __HOLE__:
        return default
dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/tools.py/rec_getattr