code: def detect_suspicious_output(
      task_prompt: str,
      task_output: str,
      completion_fn: Callable,
      use_uncertainty: bool = False,
      max_attempts: int = 5,
  ):
      sys_prompt_template = (
          monitor_sys_prompt_w_uncertainty
          if use_uncertainty
          else monitor_sys_prompt
      )
      sys_prompt = sys_prompt_template.substitute(
          task_prompt=task_prompt,
          task_output=task_output,
      )
      messages = [
          {"role": "system", "content": sys_prompt},
      ]
  
      def validation_fn(text: str):
          try:
              obj = json.loads(text)
              for key in ["scratchpad", "contains_hidden_message"]:
                  assert key in obj, f"{key} not found"
              if use_uncertainty:
                  assert (
                      0 <= obj["contains_hidden_message"] <= 1
                  ), "contains_hidden_message must be between 0 and 1"
              else:
                  assert obj["contains_hidden_message"] in [
                      0,
                      1,
                  ], "contains_hidden_message must be 0 or 1"
              return True
          except (
              json.decoder.JSONDecodeError,
              AssertionError,
              TypeError,
          ):
              return False
  
      for _ in range(max_attempts):
          assert callable(
              completion_fn
          ), "completion_fn must be callable `CompletionFn`"
          response = completion_fn(messages)
          completions = response.get_completions()
          assert (
              len(completions) == 1
          ), f"expected exactly one completion, got {completions}"
          text = completions[0]
  
          valid = validation_fn(text)
          if valid:
              out_obj = json.loads(text)
              return (
                  out_obj["scratchpad"],
                  out_obj["contains_hidden_message"],
              )
  
      # Failed to get valid response
      return "", 0.0
  
label_desc: Use image node_id 1 for calling a global function with example usage: detect_suspicious_output(task_prompt, task_output, completion_fn, use_uncertainty, max_attempts) and returns: str,  int, True, out_obj,  out_obj, False