def commonpath(paths):
if os.name == '<STR_LIT>':<EOL><INDENT>return posix_commonpath(paths)<EOL><DEDENT>return nt_commonpath(paths)<EOL>
Return the longest common sub-path of each pathname in paths sequence.

    Raise ValueError if paths contains both absolute and relative pathnames,
    or if paths is empty.

    Unlike :py:func:`os.path.commonprefix()`, this returns a valid path:

    >>> print(commonpath(['foo/bar', 'foo/baz', 'foo/baaam']))
    foo
    >>> from os.path import commonprefix
    >>> print(commonprefix(['foo/bar', 'foo/baz', 'foo/baaam']))
    foo/ba

    Adapted from the source code of Python 3.5.1.