code: def check_update_state_signature(
      metric_class, public_params, case_list
  ):
      error_msg = (
          "Class {} is missing the parameter {} in the `update_state` "
          "method. If the method doesn't use this argument, declare "
          "it anyway and raise a UserWarning if it is "
          "not None."
      )
  
      update_state_signature = inspect.signature(
          metric_class.update_state
      )
  
      for expected_param in public_params:
          if (
              expected_param
              not in update_state_signature.parameters.keys()
          ):
              raise ValueError(
                  error_msg.format(
                      metric_class.__name__, expected_param
                  )
              )
  
      missing_params = []
      for case in case_list:
          case_miss_params = []
          case_check = True
          for expected_param in case:
              if (
                  expected_param
                  not in update_state_signature.parameters.keys()
              ):
                  case_miss_params.append(expected_param)
                  case_check = False
                  break
          if case_check:
              return
          missing_params.append(case_miss_params)
      missing_params = [", ".join(p) for p in missing_params]
      missing_params = " or ".join(missing_params)
      raise ValueError(
          error_msg.format(metric_class.__name__, missing_params)
      )
  
imports: import inspect
  from tensorflow.keras.metrics import Metric
  from tensorflow_addons import metrics
label_desc: Use image node_id 2 for calling a global function with example usage: check_update_state_signature(metric_class, public_params, case_list) without return types