code: def test_jumpstart_metric_definitions_instance_variants():
      metric_definitions = INSTANCE_TYPE_VARIANT.get_instance_specific_metric_definitions(
          instance_type="ml.p2.2xlarge"
      )
      assert metric_definitions == [
          {
              "Name": "huggingface-textgeneration:wtafigo",
              "Regex": "'evasadfasdl_loss': ([0-9]+\\.[0-9]+)",
          },
          {
              "Name": "huggingface-textgeneration:eval-loss",
              "Regex": "'eval_loss': ([0-9]+\\.[0-9]+)",
          },
          {
              "Name": "huggingface-textgeneration:train-loss",
              "Regex": "'instance family specific': ([0-9]+\\.[0-9]+)",
          },
          {
              "Name": "huggingface-textgeneration:noneyourbusiness-loss",
              "Regex": "'loss-noyb': ([0-9]+\\.[0-9]+)",
          },
      ]
  
      metric_definitions = INSTANCE_TYPE_VARIANT.get_instance_specific_metric_definitions(
          instance_type="ml.p2.12xlarge"
      )
      assert metric_definitions == [
          {
              "Name": "huggingface-textgeneration:eval-loss",
              "Regex": "'eval_loss': ([0-9]+\\.[0-9]+)",
          },
          {
              "Name": "huggingface-textgeneration:instance-typemetric-loss",
              "Regex": "'eval_loss': ([0-9]+\\.[0-9]+)",
          },
          {
              "Name": "huggingface-textgeneration:train-loss",
              "Regex": "'instance type specific': ([0-9]+\\.[0-9]+)",
          },
          {
              "Name": "huggingface-textgeneration:noneyourbusiness-loss",
              "Regex": "'loss-noyb instance specific': ([0-9]+\\.[0-9]+)",
          },
          {
              "Name": "huggingface-textgeneration:wtafigo",
              "Regex": "'evasadfasdl_loss': ([0-9]+\\.[0-9]+)",
          },
      ]
  
      metric_definitions = INSTANCE_TYPE_VARIANT.get_instance_specific_metric_definitions(
          instance_type="ml.g77.2xlarge"
      )
      assert metric_definitions == []
  
      metric_definitions = INSTANCE_TYPE_VARIANT.get_instance_specific_metric_definitions(
          instance_type="ml.p3.2xlarge"
      )
      assert metric_definitions == []
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/jumpstart/test_types.py
imports: from __future__ import absolute_import
  import copy
  from sagemaker.jumpstart.types import JumpStartECRSpecs, JumpStartHyperparameter, JumpStartInstanceTypeVariants, JumpStartModelSpecs, JumpStartModelHeader
  from tests.unit.sagemaker.jumpstart.constants import BASE_SPEC
label_desc: Use image node_id 8 for calling a global function with example usage: test_jumpstart_metric_definitions_instance_variants() without return types