def filter_req_paths(paths, func):
if not isinstance(paths, list):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>libs = set()<EOL>junk = set(['<STR_LIT:\n>'])<EOL>for p in paths:<EOL><INDENT>with p.open(mode='<STR_LIT:r>') as reqs:<EOL><INDENT>lines = set([line for line in reqs if func(line)])<EOL>libs.update(lines)<EOL><DEDENT><DEDENT>return list(libs - junk)<EOL>
Return list of filtered libs.