def find_common_prefix(<EOL>paths: Sequence[Union[str, pathlib.Path]]<EOL>) -> Optional[pathlib.Path]:
counter: collections.Counter = collections.Counter()<EOL>for path in paths:<EOL><INDENT>path = pathlib.Path(path)<EOL>counter.update([path])<EOL>counter.update(path.parents)<EOL><DEDENT>valid_paths = sorted(<EOL>[path for path, count in counter.items() if count >= len(paths)],<EOL>key=lambda x: len(x.parts),<EOL>)<EOL>if valid_paths:<EOL><INDENT>return valid_paths[-<NUM_LIT:1>]<EOL><DEDENT>return None<EOL>
Find the common prefix of two or more paths.

::

    >>> import pathlib
    >>> one = pathlib.Path('foo/bar/baz')
    >>> two = pathlib.Path('foo/quux/biz')
    >>> three = pathlib.Path('foo/quux/wuux')

::

    >>> import uqbar.io
    >>> str(uqbar.io.find_common_prefix([one, two, three]))
    'foo'

:param paths: paths to inspect