def toParallelTargets(suite, targets):
targets = filter(lambda x: x != '<STR_LIT:.>', targets)<EOL>proto_test_list = toProtoTestList(suite)<EOL>modules = set([x.module for x in proto_test_list])<EOL>non_module_targets = []<EOL>for target in targets:<EOL><INDENT>if not list(filter(None, [target in x for x in modules])):<EOL><INDENT>non_module_targets.append(target)<EOL><DEDENT><DEDENT>parallel_targets = []<EOL>for test in proto_test_list:<EOL><INDENT>found = False<EOL>for target in non_module_targets:<EOL><INDENT>if (target in test.dotted_name):<EOL><INDENT>if target not in parallel_targets:<EOL><INDENT>parallel_targets.append(target)<EOL><DEDENT>found = True<EOL>break<EOL><DEDENT><DEDENT>if found:<EOL><INDENT>continue<EOL><DEDENT>if test.module not in parallel_targets:<EOL><INDENT>parallel_targets.append(test.module)<EOL><DEDENT><DEDENT>return parallel_targets<EOL>
Produce a list of targets which should be tested in parallel.

For the most part this will be a list of test modules.  The exception is
when a dotted name representing something more granular than a module
was input (like an individal test case or test method)