def get_prefix_dir(archive):
names = archive.namelist()<EOL>shortest_name = sorted(names, key=len)[<NUM_LIT:0>]<EOL>candidate_prefixes = [<EOL>shortest_name[:length]<EOL>for length in range(len(shortest_name), -<NUM_LIT:1>, -<NUM_LIT:1>)<EOL>]<EOL>for prefix in candidate_prefixes:<EOL><INDENT>if all(name.startswith(prefix) for name in names):<EOL><INDENT>return prefix<EOL><DEDENT><DEDENT>return '<STR_LIT>'<EOL>
Often, all files are in a single directory. If so, they'll all have
the same prefix. Determine any such prefix.
archive is a ZipFile