docs: def FinalizeConfigInit(config,
                         token,
                         admin_password = None,
                         redownload_templates = False,
                         repack_templates = True,
                         prompt = True):
    """Performs the final steps of config initialization."""
    config.Set("Server.initialized", True)
    print("\nWriting configuration to %s." % config["Config.writeback"])
    config.Write()
    print("Initializing the datastore.")
    # Reload the config and initialize the GRR database.
    server_startup.Init()
  
    print("\nStep 3: Adding GRR Admin User")
    try:
      CreateUser("admin", password=admin_password, is_admin=True)
    except UserAlreadyExistsError:
      if prompt:
        # pytype: disable=wrong-arg-count
        if ((builtins.input("User 'admin' already exists, do you want to "
                            "reset the password? [yN]: ").upper() or "N") == "Y"):
          UpdateUser("admin", password=admin_password, is_admin=True)
        # pytype: enable=wrong-arg-count
      else:
        UpdateUser("admin", password=admin_password, is_admin=True)
  
    print("\nStep 4: Repackaging clients with new configuration.")
    if prompt:
      redownload_templates = RetryBoolQuestion(
          "Server debs include client templates. Re-download templates?", False)
      repack_templates = RetryBoolQuestion("Repack client templates?", True)
    if redownload_templates:
      InstallTemplatePackage()
    # Build debug binaries, then build release binaries.
    if repack_templates:
      repacking.TemplateRepacker().RepackAllTemplates(upload=True, token=token)
    print("\nGRR Initialization complete! You can edit the new configuration "
          "in %s.\n" % config["Config.writeback"])
    print("Please restart the service for the new configuration to take "
          "effect.\n")