code: def check_tag_is_valid(tag_name, tag_value):
      """Check validity of a tag value.
  
      Parameters
      ----------
      tag_name : string, name of the tag
      tag_value : object, value of the tag
  
      Raises
      ------
      KeyError - if tag_name is not a valid tag in ESTIMATOR_TAG_LIST
      ValueError - if the tag_valid is not a valid for the tag with name tag_name
      """
      if tag_name not in ESTIMATOR_TAG_LIST:
          raise KeyError(tag_name + " is not a valid tag")
  
      tag_type = ESTIMATOR_TAG_TABLE[2][
          ESTIMATOR_TAG_TABLE[0] == "tag_name"
      ]
  
      if tag_type == "bool" and not isinstance(tag_value, bool):
          raise ValueError(
              tag_name + " must be True/False, found " + tag_value
          )
  
      if tag_type == "int" and not isinstance(tag_value, int):
          raise ValueError(
              tag_name + " must be integer, found " + tag_value
          )
  
      if tag_type == "str" and not isinstance(tag_value, str):
          raise ValueError(
              tag_name + " must be string, found " + tag_value
          )
  
      if tag_type == "list" and not isinstance(tag_value, list):
          raise ValueError(
              tag_name + " must be list, found " + tag_value
          )
  
      if tag_type[0] == "str" and tag_value not in tag_type[1]:
          raise ValueError(
              tag_name
              + " must be one of "
              + tag_type[1]
              + " found "
              + tag_value
          )
  
      if tag_type[0] == "list" and not set(tag_value).issubset(
          tag_type[1]
      ):
          raise ValueError(
              tag_name
              + " must be subest of "
              + tag_type[1]
              + " found "
              + tag_value
          )
  
      if tag_type[0] == "list" and tag_type[1] == "str":
          msg = f"{tag_name} must be str or list of str, found {tag_value}"
          if not isinstance(tag_value, (str, list)):
              raise ValueError(msg)
          if isinstance(tag_value, list):
              if not all(isinstance(x, str) for x in tag_value):
                  raise ValueError(msg)
  
label_desc: Use image node_id 1 for calling a global function with example usage: check_tag_is_valid(tag_name, tag_value) without return types