code: def test_metadata(Chart):
      """Test metadata values"""
      chart = Chart()
      v = range(7)
      if Chart in (pygal.Box,):
          return  # summary charts cannot display per-value metadata
      elif Chart == pygal.XY:
          v = list(map(lambda x: (x, x + 1), v))
      elif issubclass(Chart, BaseMap):
          v = [
              (k, i)
              for i, k in enumerate(Chart.x_labels)
              if k not in ["oecd", "nafta", "eur"]
          ]
  
      chart.add(
          "Serie with metadata",
          [
              v[0],
              {"value": v[1]},
              {"value": v[2], "label": "Three"},
              {"value": v[3], "xlink": "http://4.example.com/"},
              {
                  "value": v[4],
                  "xlink": "http://5.example.com/",
                  "label": "Five",
              },
              {
                  "value": v[5],
                  "xlink": {"href": "http://6.example.com/"},
                  "label": "Six",
              },
              {
                  "value": v[6],
                  "xlink": {
                      "href": "http://7.example.com/",
                      "target": "_blank",
                  },
                  "label": "Seven",
              },
          ],
      )
      q = chart.render_pyquery()
      for md in ("Three", "Five", "Seven"):
          assert md in cut(q("desc"), "text")
  
      for md in ("http://7.example.com/", "http://4.example.com/"):
          assert md in [e.attrib.get("xlink:href") for e in q("a")]
  
      if Chart in (pygal.Pie, pygal.Treemap, pygal.SolidGauge):
          # Slices with value 0 are not rendered
          assert len(v) - 1 == len(
              q(".tooltip-trigger").siblings(".value")
          )
      elif not issubclass(Chart, BaseMap):
          # Tooltip are not working on maps
          assert len(v) == len(q(".tooltip-trigger").siblings(".value"))
  
imports: import io
  import os
  import uuid
  import pytest
  import pygal
  from pygal.graph.map import BaseMap
  from pygal.test import make_data
  from pygal.util import cut
label_desc: Use image node_id 4 for calling a global function with example usage: test_metadata(Chart) without return types