code: def merge_task_lists(runset_results, tasks):
      
      for runset in runset_results:
          # create mapping from id to RunResult object
          # Use reversed list such that the first instance of equal tasks end up in dic
          dic = dict([(run_result.task_id, run_result) for run_result in reversed(runset.results)])
          runset.results = [] # clear and repopulate results
          for task in tasks:
              run_result = dic.get(task)
              if run_result is None:
                  logging.info("    No result for task '%s' in '%s'.",
                               task[0], Util.prettylist(runset.attributes['filename']))
                  # create an empty dummy element
                  run_result = RunResult(task, None, result.CATEGORY_MISSING, None, None,
                                         runset.columns, [None]*len(runset.columns))
              runset.results.append(run_result)
docs: Set the filelists of all RunSetResult elements so that they contain the same files
      in the same order. For missing files a dummy element is inserted.