code: def parse_test_definition(
      test_definitions: List[TestDefinition],
  ) -> List[Test]:
      tests = []
      for test_definition in test_definitions:
          if "variations" not in test_definition:
              tests.append(Test(test_definition))
              continue
          variations = test_definition.pop("variations")
          _test_definition_invariant(
              test_definition,
              variations,
              "variations field cannot be empty in a test definition",
          )
          for variation in variations:
              _test_definition_invariant(
                  test_definition,
                  "__suffix__" in variation,
                  "missing __suffix__ field in a variation",
              )
              test = copy.deepcopy(test_definition)
              test[
                  "name"
              ] = f'{test["name"]}.{variation.pop("__suffix__")}'
              test = deep_update(test, variation)
              tests.append(Test(test))
      return tests
  
imports: import copy
  import json
  import os
  import re
  from typing import Dict, List, Optional, Tuple, Any
  import jsonschema
  import yaml
  from ray_release.test import Test, TestDefinition
  from ray_release.anyscale_util import find_cloud_by_name
  from ray_release.bazel import bazel_runfile
  from ray_release.exception import ReleaseTestCLIError, ReleaseTestConfigError
  from ray_release.logger import logger
  from ray_release.util import DeferredEnvVar, deep_update
label_desc: Use image node_id 3 for calling a global function with example usage: parse_test_definition(test_definitions) and returns: tests