#NEWLINE# def _FilesMatching( root , predicate = ( lambda f : True ) ) : #NEWLINE# #INDENT# 'Finds all files under the given root that match the given predicate.\n\n  Args:\n    root: a string that is the absolute or relative path to a directory.\n    predicate: a function that takes a file name (without a directory) and\n      returns a truth value.\n\n  Returns:\n    A list of strings that are the paths of every file under the given root\n    that satisfies the given predicate. The paths are absolute if and only if\n    the input root is absolute.\n  ' #NEWLINE# matches = [ ] #NEWLINE# for ( path , _ , files ) in os . walk ( root ) : #NEWLINE# #INDENT# matches += [ os . path . join ( path , f ) for f in files if predicate ( predicate ) ] #NEWLINE# #UNINDENT# return matches