def has_leading_dir(paths):
common_prefix = None<EOL>for path in paths:<EOL><INDENT>prefix, rest = split_leading_dir(path)<EOL>if not prefix:<EOL><INDENT>return False<EOL><DEDENT>elif common_prefix is None:<EOL><INDENT>common_prefix = prefix<EOL><DEDENT>elif prefix != common_prefix:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL>
Returns true if all the paths have the same leading path name
    (i.e., everything is in one subdirectory in an archive)