human
I wrote the below code

    import logger
    traversed = [os.path.abspath(basedir)]
    def _inner(root, directories, files):
        for directory in directories:
            path = os.path.join(root, directory)
            if (followlinks and os.path.islink(path)):
                real_path = os.path.abspath(os.readlink(path))
                if (real_path in traversed):
                    logger.debug("Skipping    '%s'    since    it    is    a    symlink    to    '%s',    which    is    already    visited.", path, real_path)
                else:
                    traversed.append(real_path)
                    for args in os.walk(real_path):
                        for result in _inner(*args):
                            (yield result)
        (yield (root, directories, files))
    for args in os.walk(basedir):
        for result in _inner(*args):
            (yield result)

What's a good function header?
assistant
#Here's a good function header.

def walk_directory(basedir, followlinks=True):