def _glob(filenames):
if isinstance(filenames, string_types):<EOL><INDENT>filenames = [filenames]<EOL><DEDENT>matches = []<EOL>for name in filenames:<EOL><INDENT>matched_names = glob(name)<EOL>if not matched_names:<EOL><INDENT>matches.append(name)<EOL><DEDENT>else:<EOL><INDENT>matches.extend(matched_names)<EOL><DEDENT><DEDENT>return matches<EOL>
Glob a filename or list of filenames but always return the original
    string if the glob didn't match anything so URLs for remote file access
    are not clobbered.