def build_graph(git_dir, roles_dirs, aws_play_dirs, docker_play_dirs):
 graph = nx.DiGraph()
 _map_roles_to_roles(graph, roles_dirs, git_dir, 'dependencies', 'role', 'role')
 _map_plays_to_roles(graph, aws_play_dirs, git_dir, 'roles', 'aws_playbook', 'role')
 _map_plays_to_roles(graph, docker_play_dirs, git_dir, 'roles', 'docker_playbook', 'role')
 return graph

def build_graph ( git_dir , roles_dirs , aws_play_dirs , docker_play_dirs ) : graph = nx . DiGraph ( ) _map_roles_to_roles ( graph , roles_dirs , git_dir , 'dependencies' , 'role' , 'role' ) _map_plays_to_roles ( graph , aws_play_dirs , git_dir , 'roles' , 'aws_playbook' , 'role' ) _map_plays_to_roles ( graph , docker_play_dirs , git_dir , 'roles' , 'docker_playbook' , 'role' ) return graph
construct a counting graph from a set of input files .