def find_files(globs):
last_cwd = os.getcwd()<EOL>os.chdir(config.cwd)<EOL>gex, gin = separate_globs(globs)<EOL>exclude = []<EOL>for glob in gex:<EOL><INDENT>parse_glob(glob, exclude)<EOL><DEDENT>files = []<EOL>include = []<EOL>order = <NUM_LIT:0><EOL>for glob in gin:<EOL><INDENT>order += <NUM_LIT:1><EOL>array = parse_glob(glob, include)<EOL>base = find_base(glob)<EOL>for file in array:<EOL><INDENT>if file not in exclude:<EOL><INDENT>files.append((order, base, file))<EOL><DEDENT><DEDENT><DEDENT>os.chdir(last_cwd)<EOL>return files<EOL>
Find files to include.