def get_value(values, keys: list, default=None):
    """
    returns value from json based on given key hierarchy
    Ex:
        val_map = {'one' : {'two' : 123 }}
        get_value(val_map, ['one', 'two']) returns 123

    @param values: json object
    @param keys: list keys from the hierarchy tree
    @param default: default value to return if the key is not found
    @return: value if exists
            default otherwise
    """
    if values is None:
        return default

    for key in keys:
        if key in values:
            values = values[key]
        else:
            return default
    return values if keys else default