code: def verify_vega(
      versions,
      html_result,
      json_result,
      split_json_result,
      title,
      x_label,
      y_label,
  ):
      if isinstance(versions, str):
          versions = [versions]
  
      for j in [json_result, split_json_result]:
          assert len(j) == 1
          assert j[0]["type"] == "vega"
          assert set(j[0]["revisions"]) == set(versions)
  
      assert (
          json_result[0]["content"]["data"]["values"]
          == split_json_result[0][ANCHOR_DEFINITIONS][
              "<DVC_METRIC_DATA>"
          ]
      )
  
      assert set(versions) == set(json_result[0]["revisions"])
  
      assert json_result[0]["content"]["data"]["values"]
      assert html_result["data"]["values"]
  
      content_str = json.dumps(split_json_result[0]["content"])
      assert "<DVC_METRIC_DATA>" in content_str
      assert "<DVC_METRIC_X_LABEL>" in content_str
      assert "<DVC_METRIC_Y_LABEL>" in content_str
  
      def _assert_templates_equal(
          html_template,
          filled_template,
          split_template,
          title,
          x_label,
          y_label,
      ):
          # besides split anchors, json and split json should be equal
          paths = [["data", "values"], ["encoding", "color"]]
          tmp1 = deepcopy(html_template)
          tmp2 = deepcopy(filled_template)
          tmp3 = json.loads(
              json.dumps(split_template)
              .replace('"<DVC_METRIC_PLOT_HEIGHT>"', "300")
              .replace('"<DVC_METRIC_PLOT_WIDTH>"', "300")
              .replace("<DVC_METRIC_TITLE>", title)
              .replace("<DVC_METRIC_X_LABEL>", x_label)
              .replace("<DVC_METRIC_Y_LABEL>", y_label)
              .replace(
                  '"<DVC_METRIC_ZOOM_AND_PAN>"',
                  json.dumps(
                      {
                          "name": "grid",
                          "select": "interval",
                          "bind": "scales",
                      }
                  ),
              )
          )
          for path in paths:
              dpath.set(tmp1, path, {})
              dpath.set(tmp2, path, {})
              dpath.set(tmp3, path, {})
  
          assert tmp1 == tmp2 == tmp3
  
      _assert_templates_equal(
          html_result,
          json_result[0]["content"],
          split_json_result[0]["content"],
          title,
          x_label,
          y_label,
      )
  
imports: import json
  import os
  from copy import deepcopy
  from typing import Dict, List
  from urllib.parse import urlparse
  from urllib.request import url2pathname
  import dpath
  import pytest
  from bs4 import BeautifulSoup
  from funcy import first
  from dvc.cli import main
  from dvc.render import ANCHOR_DEFINITIONS, FILENAME, REVISION
label_desc: Use image node_id 6 for calling a global function with example usage: verify_vega(versions, html_result, json_result, split_json_result, title, x_label, y_label) without return types