code: def toParallelTargets(suite, targets):
      
      targets = filter(lambda x: x != '.', targets)
      # First, convert the suite to a proto test list - proto tests nicely
      # parse things like the fully dotted name of the test and the
      # finest-grained module it belongs to, which simplifies our job.
      proto_test_list = toProtoTestList(suite)
      # Extract a list of the modules that all of the discovered tests are in
      modules = set([x.module for x in proto_test_list])
      # Get the list of user-specified targets that are NOT modules
      non_module_targets = []
      for target in targets:
          if not list(filter(None, [target in x for x in modules])):
              non_module_targets.append(target)
      # Main loop -- iterating through all loaded test methods
      parallel_targets = []
      for test in proto_test_list:
          found = False
          for target in non_module_targets:
              # target is a dotted name of either a test case or test method
              # here test.dotted name is always a dotted name of a method
              if (target in test.dotted_name):
                  if target not in parallel_targets:
                      # Explicitly specified targets get their own entry to
                      # run parallel to everything else
                      parallel_targets.append(target)
                  found = True
                  break
          if found:
              continue
          # This test does not appear to be part of a specified target, so
          # its entire module must have been discovered, so just add the
          # whole module to the list if we haven't already.
          if test.module not in parallel_targets:
              parallel_targets.append(test.module)
  
      return parallel_targets
docs: 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)