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

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 d.has_key(key):
        return d[key]
    else:
        return def_val