code: def test_metrics_location_var_snapshot_disabled():
      """
      Validates that metrics related logs get saved in directory configured via METRICS_LOCATION
      environment variable.
      """
      # We stop torchserve here so that we can set METRICS_LOCATION in environment variable and
      # restart torchserve
      test_utils.stop_torchserve()
      os.environ["METRICS_LOCATION"] = test_utils.ROOT_DIR
      run_metrics_location_var(no_config_snapshots=True)
      # We stop torchserve again here so that we can remove the METRICS_LOCATION setting
      # from environment variable
      test_utils.stop_torchserve()
      del os.environ["METRICS_LOCATION"]
      for f in glob.glob(test_utils.ROOT_DIR + "*.log"):
          os.remove(f)
      # Remove any old snapshots
      test_utils.delete_all_snapshots()
  
imports: import glob
  import os
  import platform
  import re
  import shutil
  import subprocess
  import time
  from os import path
  import requests
  import test_utils
label_desc: Use image node_id 18 for calling a global function with example usage: test_metrics_location_var_snapshot_disabled() without return types