def processData(config, stats, options):
    ##########################################
    # Collate the stats and report
    ##########################################
    if stats.get("total_time", None) is None:  # Hack to allow unfinished toils.
        stats.total_time = {"total_time": "0.0", "total_clock": "0.0"}
    else:
        stats.total_time = sum([float(number) for number in stats.total_time])
        stats.total_clock = sum([float(number) for number in stats.total_clock])

    collatedStatsTag = Expando(total_run_time=stats.total_time,
                               total_clock=stats.total_clock,
                               batch_system=config.batchSystem,
                               default_memory=str(config.defaultMemory),
                               default_cores=str(config.defaultCores),
                               max_cores=str(config.maxCores)
                               )

    # Add worker info
    worker = filter(None, stats.workers)
    jobs = filter(None, stats.jobs)
    jobs = [item for sublist in jobs for item in sublist]

    def fn4(job):
        try:
            return list(jobs)
        except __HOLE__:
            return []

    buildElement(collatedStatsTag, worker, "worker")
    createSummary(buildElement(collatedStatsTag, jobs, "jobs"),
                  stats.workers, "worker", fn4)
    # Get info for each job
    jobNames = set()
    for job in jobs:
        jobNames.add(job.class_name)
    jobTypesTag = Expando()
    collatedStatsTag.job_types = jobTypesTag
    for jobName in jobNames:
        jobTypes = [ job for job in jobs if job.class_name == jobName ]
        buildElement(jobTypesTag, jobTypes, jobName)
    collatedStatsTag.name = "collatedStatsTag"
    return collatedStatsTag
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/utils/toilStats.py/processData