docstr: Check a variety of trainer options with exp_manager
docstr_tok: ["Check","a","variety","of","trainer","options","with","exp_manager"]
code: def test_log_dir_overrides(self, monkeypatch, tmp_path):
      """Check a variety of trainer options with exp_manager"""
      # Checks that explicit_log_dir ignores exp_dir, name, and version
      test_trainer = pl.Trainer(
          accelerator="cpu", enable_checkpointing=False, logger=False
      )
      log_dir = exp_manager(
          test_trainer,
          {
              "explicit_log_dir": str(
                  tmp_path / "test_log_dir_overrides"
              )
          },
      )
      assert (
          log_dir.resolve()
          == (tmp_path / "test_log_dir_overrides").resolve()
      )
      assert Path(tmp_path).exists()
      assert Path(tmp_path / "test_log_dir_overrides").exists()
  
      # Checks that exp_manager uses exp_dir, default name, and explicit version
      test_trainer = pl.Trainer(
          accelerator="cpu", enable_checkpointing=False, logger=False
      )
      log_dir = exp_manager(
          test_trainer,
          {"exp_dir": str(tmp_path / "test_no_name"), "version": 957},
      )
      assert (
          log_dir.resolve()
          == (tmp_path / "test_no_name" / "default" / "957").resolve()
      )
      assert Path(tmp_path).exists()
      assert Path(
          tmp_path / "test_no_name" / "default" / "957"
      ).exists()
  
      monkeypatch.delenv(NEMO_ENV_VARNAME_VERSION)
      # Checks that use_datetime_version False toggle works
      test_trainer = pl.Trainer(
          accelerator="cpu", enable_checkpointing=False, logger=False
      )
      log_dir = exp_manager(
          test_trainer,
          {
              "exp_dir": str(tmp_path / "test_no_name"),
              "use_datetime_version": False,
          },
      )
      assert (
          log_dir.resolve()
          == (
              tmp_path / "test_no_name" / "default" / "version_0"
          ).resolve()
      )
      assert Path(tmp_path).exists()
      assert Path(
          tmp_path / "test_no_name" / "default" / "version_0"
      ).exists()
  
      monkeypatch.delenv(NEMO_ENV_VARNAME_VERSION)
      # Checks that use_datetime_version False toggle works and version increments
      test_trainer = pl.Trainer(
          accelerator="cpu", enable_checkpointing=False, logger=False
      )
      log_dir = exp_manager(
          test_trainer,
          {
              "exp_dir": str(tmp_path / "test_no_name"),
              "use_datetime_version": False,
          },
      )
      assert (
          log_dir.resolve()
          == (
              tmp_path / "test_no_name" / "default" / "version_1"
          ).resolve()
      )
      assert Path(tmp_path).exists()
      assert Path(
          tmp_path / "test_no_name" / "default" / "version_1"
      ).exists()
  
imports: import math
  import os
  import re
  from pathlib import Path
  from typing import Any
  import pytest
  import pytorch_lightning
  import torch
  from omegaconf import OmegaConf
  from omegaconf.errors import OmegaConfBaseException
  from pytorch_lightning import Callback
  from pytorch_lightning.loops import _TrainingEpochLoop
  from nemo.constants import NEMO_ENV_VARNAME_VERSION
  from nemo.core.classes import ModelPT
  from nemo.utils.exp_manager import CheckpointMisconfigurationError, LoggerMisconfigurationError, NotFoundError, exp_manager
label_desc: Use image node_id 5 for calling the TestExpManager obj's underlying member method code with example usage: obj.test_log_dir_overrides(monkeypatch, tmp_path) without return types