def recursive_glob(base_directory, regex='<STR_LIT>'):
files = glob(op.join(base_directory, regex))<EOL>for path, dirlist, filelist in os.walk(base_directory):<EOL><INDENT>for dir_name in dirlist:<EOL><INDENT>files.extend(glob(op.join(path, dir_name, regex)))<EOL><DEDENT><DEDENT>return files<EOL>
Uses glob to find all files or folders that match the regex
starting from the base_directory.

Parameters
----------
base_directory: str

regex: str

Returns
-------
files: list