code: def test_type_validate_genurl(self):
      ds_spec = {
          "text": types.TextSegment(),
      }
      out_spec = {
          "genurl": types.GeneratedURL(align="cands"),
          "cands": types.GeneratedTextCandidates(parent="text"),
      }
      example = {"text": "hi"}
      output = {
          "genurl": "https://blah",
          "cands": [("hi", 4), ("bye", None)],
      }
  
      genurl = types.GeneratedURL(align="cands")
      try:
          genurl.validate_output(
              "https://blah",
              out_spec,
              output,
              ds_spec,
              ds_spec,
              example,
          )
      except ValueError:
          self.fail("Raised unexpected error.")
  
      self.assertRaises(
          ValueError,
          genurl.validate_output,
          4,
          out_spec,
          output,
          ds_spec,
          ds_spec,
          example,
      )
      bad_genurl = types.GeneratedURL(align="wrong")
      self.assertRaises(
          ValueError,
          bad_genurl.validate_output,
          "https://blah",
          out_spec,
          output,
          ds_spec,
          ds_spec,
          example,
      )
  
imports: from collections.abc import Callable
  import os
  from typing import Any, Optional, Union
  from absl.testing import absltest
  from absl.testing import parameterized
  from etils import epath
  from lit_nlp.api import dtypes
  from lit_nlp.api import types
  import numpy
label_desc: Use image node_id 12 for calling the TypesTest obj's underlying member method code with example usage: obj.test_type_validate_genurl() without return types