def filter_single_need(need, filter_string="<STR_LIT>"):
filter_context = need.copy()<EOL>filter_context["<STR_LIT>"] = re.search<EOL>result = False<EOL>try:<EOL><INDENT>result = bool(eval(filter_string, None, filter_context))<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise NeedInvalidFilter("<STR_LIT>".format(filter_string, e))<EOL><DEDENT>return result<EOL>
Checks if a single need/need_part passes a filter_string

:param need: need or need_part
:param filter_string: string, which is used as input for eval()
:return: True, if need as passed the filter_string, else False