code: def test_metrics_location_var_snapshot_enabled():
      """
      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=False)
      requests.post(
          "http://127.0.0.1:8081/models?url=mnist_custom_metrics.mar"
      )
      # 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"]
      # In case of snapshot enabled, we get these three config files additionally in the custom directory
      assert len(glob.glob("logs/config/*startup.cfg")) >= 1
      if platform.system() != "Windows":
          assert len(glob.glob("logs/config/*shutdown.cfg")) >= 1
      assert len(glob.glob("logs/config/*snap*.cfg")) >= 1
      for f in glob.glob(test_utils.ROOT_DIR + "*.log"):
          os.remove(f)
  
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 19 for calling a global function with example usage: test_metrics_location_var_snapshot_enabled() without return types