def posix_commonpath(paths):
if not paths:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>check_arg_types('<STR_LIT>', *paths)<EOL>if isinstance(paths[<NUM_LIT:0>], bytes):<EOL><INDENT>sep = b'<STR_LIT:/>'<EOL>curdir = b'<STR_LIT:.>'<EOL><DEDENT>else:<EOL><INDENT>sep = '<STR_LIT:/>'<EOL>curdir = '<STR_LIT:.>'<EOL><DEDENT>split_paths = [path.split(sep) for path in paths]<EOL>try:<EOL><INDENT>isabs, = set(p[:<NUM_LIT:1>] == sep for p in paths)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>split_paths = [[c for c in s if c and c != curdir] for s in split_paths]<EOL>s_min = min(split_paths)<EOL>s_max = max(split_paths)<EOL>common = s_min<EOL>for i, run_c in enumerate(s_min):<EOL><INDENT>if run_c != s_max[i]:<EOL><INDENT>common = s_min[:i]<EOL>break<EOL><DEDENT><DEDENT>prefix = sep if isabs else sep[:<NUM_LIT:0>]<EOL>return prefix + sep.join(common)<EOL>
Given a sequence of POSIX path names,
       return the longest common sub-path.