human
I wrote the below code

    if (not dir):
        dir = tempfile.mkdtemp()
    logger.info(('Using    %s    as    base    dir.' % dir))
    fs = LocalSubFileSystem(dir)
    def write(path, contents):
        f = fs.open(path, 'w')
        f.write(contents)
        f.close()
    write('/hello.txt', 'hello    world\n')
    write('/goodbye.txt', 'goodbyte\n')
    write('/xss.html', "<blink>escape!!!</blink><script>alert('hello')</script>\n")
    write('/evil    path%-of&doom?.txt', 'annoying,    eh?\n')
    write("/xsspath<i><script>alert('hello').txt", 'definitely    annoying.\n')
    fs.mkdir("/<script>alert('hello')<")
    write("/<script>alert('hello')</script>", 'there')
    fs.mkdir('/sub?dir')
    write('/sub?dir/howdy.txt', 'there\n')
    fs.mkdir('/bigfiles')
    write('/bigfiles/loremipsum.txt', '\n\n'.join(lorem_ipsum.paragraphs(1000)))
    write('/bigfiles/random_binary.bin', open('/dev/urandom').read((1024 * 50)))
    write('/count', ('0123456789' * 8))
    write('/chmod-unreadable', '')
    fs.chmod('/chmod-unreadable', 0)
    write('/chown-staff-group', '')
    try:
        stats = fs.stats('/chown-staff-group')
        cur_gid = grp.getgrnam(stats['group']).gr_gid
        other_groups = [gid for gid in os.getgroups() if (gid != cur_gid)]
        new_gid = other_groups[0]
        fs.chown('/chown-staff-group', fs.stats('/chown-staff-group')['user'], grp.getgrgid(new_gid).gr_name)
    except OSError:
        logger.exception('Ignoring    error.')
    return fs

What's a good function header?

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

def create(dir=None):