def filter_needs(needs, filter_string="<STR_LIT>", filter_parts=True, merge_part_with_parent=True):
if filter_string is None or filter_string == "<STR_LIT>":<EOL><INDENT>return needs<EOL><DEDENT>found_needs = []<EOL>for filter_need in needs:<EOL><INDENT>try:<EOL><INDENT>if filter_single_need(filter_need, filter_string):<EOL><INDENT>found_needs.append(filter_need)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>logger.warning("<STR_LIT>".format(filter_string, e))<EOL><DEDENT><DEDENT>return found_needs<EOL>
Filters given needs based on a given filter string.
Returns all needs, which pass the given filter.

:param merge_part_with_parent: If True, need_parts inherit options from their parent need
:param filter_parts: If True, need_parts get also filtered
:param filter_string: strings, which gets evaluated against each need
:param needs: list of needs, which shall be filtered
:return: