def add_task(self, task):
        self.add_node(task['id'], **task)

        # standart direct and backward dependencies, should be used for
        # declaring dependencies on one level (group to group, task to task)
        for req in task.get('required_for', ()):
            self.add_edge(task['id'], req)
        for req in task.get('requires', ()):
            self.add_edge(req, task['id'])

        # FIXME(dshulyak) remove it after change in library will be merged
        if 'stage' in task:
            self.add_edge(task['id'], task['stage'])
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/orchestrator/orchestrator_graph.py/GraphSolver.add_task/original