def _archive_single_dir(archive):
common_root = None<EOL>for info in _list_archive_members(archive):<EOL><INDENT>fn = _info_name(info)<EOL>if fn in set(['<STR_LIT:.>', '<STR_LIT:/>']):<EOL><INDENT>continue<EOL><DEDENT>sep = None<EOL>if '<STR_LIT:/>' in fn:<EOL><INDENT>sep = '<STR_LIT:/>'<EOL><DEDENT>elif '<STR_LIT:\\>' in fn:<EOL><INDENT>sep = '<STR_LIT:\\>'<EOL><DEDENT>if sep is None:<EOL><INDENT>root_dir = fn<EOL><DEDENT>else:<EOL><INDENT>root_dir, _ = fn.split(sep, <NUM_LIT:1>)<EOL><DEDENT>if common_root is None:<EOL><INDENT>common_root = root_dir<EOL><DEDENT>else:<EOL><INDENT>if common_root != root_dir:<EOL><INDENT>return None<EOL><DEDENT><DEDENT><DEDENT>return common_root<EOL>
Check if all members of the archive are in a single top-level directory

:param archive:
    An archive from _open_archive()

:return:
    None if not a single top level directory in archive, otherwise a
    unicode string of the top level directory name