def filter_build_dirs(address_mapper, build_files):
 dirnames = set((dirname(f.stat.path) for f in build_files.dependencies))
 ignored_dirnames = address_mapper.build_ignore_patterns.match_files((u'{}/'.format(dirname) for dirname in dirnames))
 ignored_dirnames = set((d.rstrip(u'/') for d in ignored_dirnames))
 return BuildDirs(tuple((Dir(d) for d in dirnames if (d not in ignored_dirnames))))

def filter_build_dirs ( address_mapper , build_files ) : dirnames = set ( ( dirname ( f . stat . path ) for f in build_files . dependencies ) ) ignored_dirnames = address_mapper . build_ignore_patterns . match_files ( ( u'{}/' . format ( dirname ) for dirname in dirnames ) ) ignored_dirnames = set ( ( d . rstrip ( u'/' ) for d in ignored_dirnames ) ) return BuildDirs ( tuple ( ( Dir ( d ) for d in dirnames if ( d not in ignored_dirnames ) ) ) )
given files matching a build pattern .