human
Here's a good function header given the following:
I wrote the below code

    log = logging.getLogger('grizzled.os.daemon')
    def __fork():
        try:
            return _os.fork()
        except OSError as e:
            raise DaemonError, ('Cannot    fork', e.errno, e.strerror)
    def __redirect_file_descriptors():
        import resource
        maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
        if (maxfd == resource.RLIM_INFINITY):
            maxfd = MAXFD
        for fd in range(0, maxfd):
            try:
                _os.ttyname(fd)
            except:
                continue
            try:
                _os.close(fd)
            except OSError:
                pass
            _os.open(NULL_DEVICE, _os.O_RDWR)
            _os.dup2(0, 1)
            _os.dup2(0, 2)
    if (_os.name != 'posix'):
        import errno
        raise DaemonError, ('daemonize()    is    only    supported    on    Posix-compliant    systems.', errno.ENOSYS, _os.strerror(errno.ENOSYS))
    try:
        log.debug('Forking    first    child.')
        pid = __fork()
        if (pid != 0):
            _os._exit(0)
        log.debug('Creating    new    session')
        _os.setsid()
        log.debug('Forking    second    child.')
        pid = __fork()
        if (pid != 0):
            _os._exit(0)
        log.debug('Setting    umask')
        _os.umask(UMASK)
        log.debug(('Changing    working    directory    to    "%s"' % WORKDIR))
        _os.chdir(WORKDIR)
        if (not no_close):
            log.debug('Redirecting    file    descriptors')
            __redirect_file_descriptors()
        if pidfile:
            from string import Template
            t = Template(pidfile)
            pidfile = t.safe_substitute(pid=str(_os.getpid()))
            open(pidfile, 'w').write((str(_os.getpid()) + '\n'))
    except DaemonError:
        raise
    except OSError as e:
        raise DaemonError, ('Unable    to    daemonize()', e.errno, e.strerror)

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

def daemonize(no_close=False, pidfile=None):