def get_attribute_or_callable(o, name):
    try:
        a = getattr(o, name)
        # Might be attribute or callable
        if callable(a):
            try:
                a = a()
            except TypeError:
                a = None
    except __HOLE__:
        a = None
    return a
dataset/ETHPy150Open tow/sunburnt/sunburnt/schema.py/get_attribute_or_callable