<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def procces_filters(all_needs, current_needlist):
 """ Filters all needs with given configuration :param current_needlist: needlist object, which stores all filters :param all_needs: List of all needs inside document :return: list of needs, which passed the filters """


    if current_needlist["sort_by"] is not None:
        if current_needlist["sort_by"] == "id":
            all_needs = sorted(all_needs, key=lambda node: node["id"])
        elif current_needlist["sort_by"] == "status":
            all_needs = sorted(all_needs, key=status_sorter)

    found_needs_by_options = []

    # Add all need_parts of given needs to the search list
    all_needs_incl_parts = prepare_need_list(all_needs)

    for need_info in all_needs_incl_parts:
        status_filter_passed = False
        if current_needlist["status"] is None or len(current_needlist["status"]) == 0:
            # Filtering for status was not requested
            status_filter_passed = True
        elif need_info["status"] is not None and need_info["status"] in current_needlist["status"]:
            # Match was found
            status_filter_passed = True

        tags_filter_passed = False
        if len(set(need_info["tags"]) & set(current_needlist["tags"])) > 0 or len(current_needlist["tags"]) == 0:
            tags_filter_passed = True

        type_filter_passed = False
        if need_info["type"] in current_needlist["types"] \
                or need_info["type_name"] in current_needlist["types"] \
                or len(current_needlist["types"]) == 0:
            type_filter_passed = True

        if status_filter_passed and tags_filter_passed and type_filter_passed:
            found_needs_by_options.append(need_info)

    found_needs_by_string = filter_needs(all_needs_incl_parts, current_needlist["filter"])

    # found_needs = [x for x in found_needs_by_string if x in found_needs_by_options]

    found_needs = check_need_list(found_needs_by_options, found_needs_by_string)

    return found_needs