def get_attr_value(path, func, attrs):
    """Gets attribute value from 'attrs' by specified path

    In case of nested list - list of found values will be returned

    :param path: list of keys for accessing the attribute value
    :param func: if not None - will be applied to the value
    :param attrs: attributes data
    :return: found value(s)
    """
    for idx, p in enumerate(path):
        if isinstance(attrs, (tuple, list)):
            result_list = []
            for cur_attr in attrs:
                try:
                    value = get_attr_value(path[idx:], func, cur_attr)
                    result_list.append(value)
                except (KeyError, TypeError):
                    pass
            return result_list
        else:
            attrs = attrs[p]
    if func is not None:
        attrs = func(attrs)
    return attrs