

def get_value(key, obj, default=None):
    'Helper for pulling a keyed value off various types of objects'
    if isinstance(key, int):
        return _get_value_for_key(key, obj, default)
    elif callable(key):
        return key(obj)
    else:
        return _get_value_for_keys(key.split('.'), obj, default)

dataset/ETHPy150Open flask-restful/flask-restful/flask_restful/fields.py get_value/original