def procces_filters(all_needs, current_needlist):
if current_needlist["<STR_LIT>"] is not None:<EOL><INDENT>if current_needlist["<STR_LIT>"] == "<STR_LIT:id>":<EOL><INDENT>all_needs = sorted(all_needs, key=lambda node: node["<STR_LIT:id>"])<EOL><DEDENT>elif current_needlist["<STR_LIT>"] == "<STR_LIT:status>":<EOL><INDENT>all_needs = sorted(all_needs, key=status_sorter)<EOL><DEDENT><DEDENT>found_needs_by_options = []<EOL>all_needs_incl_parts = prepare_need_list(all_needs)<EOL>for need_info in all_needs_incl_parts:<EOL><INDENT>status_filter_passed = False<EOL>if current_needlist["<STR_LIT:status>"] is None or len(current_needlist["<STR_LIT:status>"]) == <NUM_LIT:0>:<EOL><INDENT>status_filter_passed = True<EOL><DEDENT>elif need_info["<STR_LIT:status>"] is not None and need_info["<STR_LIT:status>"] in current_needlist["<STR_LIT:status>"]:<EOL><INDENT>status_filter_passed = True<EOL><DEDENT>tags_filter_passed = False<EOL>if len(set(need_info["<STR_LIT>"]) & set(current_needlist["<STR_LIT>"])) > <NUM_LIT:0> or len(current_needlist["<STR_LIT>"]) == <NUM_LIT:0>:<EOL><INDENT>tags_filter_passed = True<EOL><DEDENT>type_filter_passed = False<EOL>if need_info["<STR_LIT:type>"] in current_needlist["<STR_LIT>"]or need_info["<STR_LIT>"] in current_needlist["<STR_LIT>"]or len(current_needlist["<STR_LIT>"]) == <NUM_LIT:0>:<EOL><INDENT>type_filter_passed = True<EOL><DEDENT>if status_filter_passed and tags_filter_passed and type_filter_passed:<EOL><INDENT>found_needs_by_options.append(need_info)<EOL><DEDENT><DEDENT>found_needs_by_string = filter_needs(all_needs_incl_parts, current_needlist["<STR_LIT>"])<EOL>found_needs = check_need_list(found_needs_by_options, found_needs_by_string)<EOL>return found_needs<EOL>
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