code: def assert_matches(v, regex):
      """
      Assert that string variable matches the provided regular expression.
  
      :param v: variable to check.
      :param regex: regular expression to check against (can be either a string, or compiled regexp).
      """
      m = re.match(regex, v)
      if m is None:
          vn = _retrieve_assert_arguments()[0]
          message = "Argument `{var}` (= {val!r}) did not match /{regex}/".format(
              var=vn, regex=regex, val=v
          )
          raise H2OValueError(message, var_name=vn, skip_frames=1)
      return m
  
imports: from h2o.utils.compatibility import *
  import importlib
  import io
  import re
  import sys
  import tokenize
  from types import BuiltinFunctionType, FunctionType
  from h2o.exceptions import H2OTypeError, H2OValueError
label_desc: Use image node_id 4 for calling a global function with example usage: assert_matches(v, regex) and returns: m