def nt_commonpath(paths):  
from ntpath import splitdrive<EOL>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>altsep = b'<STR_LIT:/>'<EOL>curdir = b'<STR_LIT:.>'<EOL><DEDENT>else:<EOL><INDENT>sep = '<STR_LIT:\\>'<EOL>altsep = '<STR_LIT:/>'<EOL>curdir = '<STR_LIT:.>'<EOL><DEDENT>drivesplits = [splitdrive(p.replace(altsep, sep).lower()) for p in paths]<EOL>split_paths = [p.split(sep) for d, p in drivesplits]<EOL>try:<EOL><INDENT>isabs, = set(p[:<NUM_LIT:1>] == sep for d, p in drivesplits)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if len(set(d for d, p in drivesplits)) != <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>drive, path = splitdrive(paths[<NUM_LIT:0>].replace(altsep, sep))<EOL>common = path.split(sep)<EOL>common = [c for c in common if c and c != curdir]<EOL>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>for i, run_c in enumerate(s_min):<EOL><INDENT>if run_c != s_max[i]:<EOL><INDENT>common = common[:i]<EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>common = common[:len(s_min)]<EOL><DEDENT>prefix = drive + sep if isabs else drive<EOL>return prefix + sep.join(common)<EOL>
Given a sequence of NT path names,
       return the longest common sub-path.