def get_plays(files, git_dir, playbooks_dirs):
 plays = set()
 for play_dir in playbooks_dirs:
  play_dir_path = pathlib2.Path(git_dir, play_dir)
  candidate_files = {f for f in play_dir_path.glob('*.yml')}
  for f in files:
   file_path = pathlib2.Path(git_dir, f)
   if (file_path in candidate_files):
    plays.add(_get_playbok_name_from_file(file_path))
 return plays

def get_plays ( files , git_dir , playbooks_dirs ) : plays = set ( ) for play_dir in playbooks_dirs : play_dir_path = pathlib2 . Path ( git_dir , play_dir ) candidate_files = { f for f in play_dir_path . glob ( '*.yml' ) } for f in files : file_path = pathlib2 . Path ( git_dir , f ) if ( file_path in candidate_files ) : plays . add ( _get_playbok_name_from_file ( file_path ) ) return plays
determines which files in the change set are aws playbooks files: a list of files modified by a commit range .