def _get_value_for_key(key, obj, default):
    if is_indexable_but_not_string(obj):
        try:
            return obj[key]
        except (IndexError, __HOLE__, KeyError):
            pass
    return getattr(obj, key, default)
dataset/ETHPy150Open flask-restful/flask-restful/flask_restful/fields.py/_get_value_for_key