def recursive_glob(base_directory, regex=None):
if regex is None:<EOL><INDENT>regex = '<STR_LIT>'<EOL><DEDENT>files = glob(os.path.join(base_directory, regex))<EOL>for path, dirlist, filelist in os.walk(base_directory):<EOL><INDENT>for ignored in IGNORE:<EOL><INDENT>try:<EOL><INDENT>dirlist.remove(ignored)<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>for dir_name in dirlist:<EOL><INDENT>files.extend(glob(os.path.join(path, dir_name, regex)))<EOL><DEDENT><DEDENT>return files<EOL>
Uses glob to find all files that match the regex in base_directory.

    @param base_directory: string

    @param regex: string

    @return: set