@staticmethod
    def makeJobGraph(nodeNumber, childEdges, followOnEdges, outPath):
        """
        Converts a DAG into a job graph. childEdges and followOnEdges are
        the lists of child and followOn edges.
        """
        #Map of jobs to the list of promises they have
        jobsToPromisesMap = {}
        #Function for making job
        def makeJob(string):
            promises = []
            job = Job.wrapFn(fn2Test, promises, string, 
                             os.path.join(outPath, string) if outPath != None else None)
            jobsToPromisesMap[job] = promises
            return job
        #Make the jobs
        jobs = map(lambda i: makeJob(str(i)), xrange(nodeNumber))
        #Make the edges
        for fNode, tNode in childEdges:
            jobs[fNode].addChild(jobs[tNode])
        for fNode, tNode in followOnEdges:
            jobs[fNode].addFollowOn(jobs[tNode])
        #Function to get a random predecessor for a job
        def getRandomPredecessor(job):
            predecessor = random.choice(list(job._directPredecessors))
            while random.random() > 0.5 and len(predecessor._directPredecessors) > 0:
                predecessor = random.choice(list(predecessor._directPredecessors))
            return predecessor
        #Connect up set of random promises compatible with graph
        while random.random() > 0.01:
            job = random.choice(jobsToPromisesMap.keys())
            promises = jobsToPromisesMap[job]
            if len(job._directPredecessors) > 0:
                predecessor = getRandomPredecessor(job)
                promises.append(predecessor.rv())
                
        return jobs[0]
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/test/src/jobTest.py/JobTest.makeJobGraph/original