human
I wrote the below code

    pwent = pwd.getpwuid(os.getuid())
    grent = grp.getgrgid(os.getgid())
    database = UserDatabase()
    database.addUser(user, pwent.pw_passwd, uid, pwent.pw_gid, pwent.pw_gecos, pwent.pw_dir, pwent.pw_shell)
    def getgrnam(name):
        result = list(grent)
        result[result.index(grent.gr_name)] = group
        result[result.index(grent.gr_gid)] = gid
        result = tuple(result)
        return {group: result}[name]
    patch(pwd, 'getpwnam', database.getpwnam)
    patch(grp, 'getgrnam', getgrnam)

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

def patchUserDatabase(patch, user, uid, group, gid):