code: def comment_failure(
      self, msg: str, exceptions: Union[Exception, List[Exception]]
  ):
      if not isinstance(exceptions, list):
          exceptions = [exceptions]
  
      logging.info(f"Failed, commenting {exceptions}")
  
      # Extract all the traceback strings
      for item in exceptions:
          try:
              raise item
          except Exception:
              item.exception_msg = traceback.format_exc()
  
      comment = f"{msg} in {args.run_url}\n\n"
      for exception in exceptions:
          comment += (
              f"<details>\n\n```\n{exception.exception_msg}\n```\n\n"
          )
          if hasattr(exception, "read"):
              comment += f"with response\n\n```\n{exception.read().decode()}\n```\n\n"
          comment += "</details>"
  
      pr.comment(comment)
      pr.has_error = True
      return exception
  
imports: import os
  import json
  import argparse
  import sys
  import warnings
  import logging
  import traceback
  import re
  from typing import Dict, Any, List, Optional, Callable, Union
  from pathlib import Path
  from git_utils import git, GitHubRepo, parse_remote, post
  from cmd_utils import init_log
label_desc: Use image node_id 26 for calling the PR obj's underlying member method code with example usage: obj.comment_failure(msg, exceptions) and returns: exception