def change_set_to_roles(files, git_dir, roles_dirs, playbooks_dirs, graph):
 items = set()
 for role_dir in roles_dirs:
  role_dir_path = pathlib2.Path(git_dir, role_dir)
  candidate_files = {f for f in role_dir_path.glob('**/*')}
  for f in files:
   file_path = pathlib2.Path(git_dir, f)
   if (file_path in candidate_files):
    items.add(_get_role_name_from_file(file_path))
 return items

def change_set_to_roles ( files , git_dir , roles_dirs , playbooks_dirs , graph ) : items = set ( ) for role_dir in roles_dirs : role_dir_path = pathlib2 . Path ( git_dir , role_dir ) candidate_files = { f for f in role_dir_path . glob ( '**/*' ) } for f in files : file_path = pathlib2 . Path ( git_dir , f ) if ( file_path in candidate_files ) : items . add ( _get_role_name_from_file ( file_path ) ) return items
converts change set consisting of a number of files to the roles that they represent/contain .