class_docstr: Global W&B settings stored under $WANDB_CONFIG_DIR/settings.
class_docstr_tok: ["Global","W","&","B","settings","stored","under","$","WANDB_CONFIG_DIR\/settings","."]
code: def _persist_settings(self, settings, settings_path) -> None:
      # write a temp file and then move it to the settings path
      target_dir = os.path.dirname(settings_path)
      with tempfile.NamedTemporaryFile(
          "w+", suffix=".tmp", delete=False, dir=target_dir
      ) as fp:
          path = os.path.abspath(fp.name)
          with open(path, "w+") as f:
              settings.write(f)
      try:
          os.replace(path, settings_path)
      except AttributeError:
          os.rename(path, settings_path)
  
file_path: wandb/wandb/old/settings.py
imports: import configparser
  import getpass
  import os
  import tempfile
  from typing import Any, Optional
  from wandb import env
  from wandb.old import core
  from wandb.sdk.lib import filesystem
  from wandb.sdk.lib.runid import generate_id
label_desc: Use image node_id 3 for calling the Settings obj's underlying member method code with example usage: obj._persist_settings(settings, settings_path) without return types