Return a list of paths sorted by dirname & basename.

def _sorter(generated):
    """Return a list of paths sorted by dirname & basename."""
    pairs = [(os.path.dirname(f), os.path.basename(f))
             for f in set(list(generated))]

    pairs.sort()

    return [os.path.join(pair[0], pair[1]) for pair in pairs]