def get_docker_plays(roles, graph):
 coverage = dict.fromkeys(roles, False)
 items = set()
 docker_plays = {node.name for node in graph.nodes() if (node.type == 'docker_playbook')}
 for play in docker_plays:
  roles_nodes = nx.all_neighbors(graph, (play, 'docker_playbook'))
  docker_roles = {role.name for role in roles_nodes}
  common_roles = (roles & docker_roles)
  if common_roles:
   items.add(play)
   for role in common_roles:
    coverage[role] = True
 for role in coverage:
  if (not coverage[role]):
   LOGGER.warning(("role '%s' is not covered." % role))
 return items

def get_docker_plays ( roles , graph ) : coverage = dict . fromkeys ( roles , False ) items = set ( ) docker_plays = { node . name for node in graph . nodes ( ) if ( node . type == 'docker_playbook' ) } for play in docker_plays : roles_nodes = nx . all_neighbors ( graph , ( play , 'docker_playbook' ) ) docker_roles = { role . name for role in roles_nodes } common_roles = ( roles & docker_roles ) if common_roles : items . add ( play ) for role in common_roles : coverage [ role ] = True for role in coverage : if ( not coverage [ role ] ) : LOGGER . warning ( ( "role '%s' is not covered." % role ) ) return items
gets all docker plays that contain at least role in common with roles .