def shared_directory(files, verbose=False):
    """
    Find the shared base directory amongst a list of files.

    Parameters
    ----------

    files : list
            A list of filenames.

    Returns
    -------

    shared : str
            A filepath that is the shared across all the files.
    """
    for i in range(len(files[0])):
        shared = files[0][:i + 1]
        if verbose:
            print('"{}"'.format(shared))
        for f in files:
            if f[:i + 1] != shared:
                if verbose:
                    print('Huzzah! "{}" is shared across {} files.'.format(
                        shared[:-1], len(files)))
                return shared[:-1]
