def safe_get(d, key, def_val=None):
    """
    Helper function to fetch value from a dictionary

    * `d` - Dictionary to fetch value from
    * `key` - Key to lookup in dictionary
    * `def_val` - Default value to return if dict does not have a member with key
    """
    if key in d:
        return d[key]
    else:
        return def_val
dataset/ETHPy150Open StackHut/stackhut/stackhut_toolkit/common/barrister/runtime.py/safe_get/original