def files_in_dir(directory, file_patterns=[]):
 files = []
 for file_pattern in file_patterns:
  files.extend(glob.glob(os.path.join(directory, file_pattern)))
 return files

def files_in_dir ( directory , file_patterns = [ ] ) : files = [ ] for file_pattern in file_patterns : files . extend ( glob . glob ( os . path . join ( directory , file_pattern ) ) ) return files
returns a list of files which match a pattern in given directory .