code: def upsert_comment(session, repo, pull_number, comment_body):
      comments = session.get(
          f"https://api.github.com/repos/{repo}/issues/{pull_number}/comments"
      )
      preview_docs_comment = next(
          filter(lambda c: MARKER in c["body"], comments), None
      )
      comment_body_with_marker = MARKER + "\n\n" + comment_body
      if preview_docs_comment is None:
          print("Creating comment")
          session.post(
              f"https://api.github.com/repos/{repo}/issues/{pull_number}/comments",
              json={"body": comment_body_with_marker},
          )
      else:
          print("Updating comment")
          session.patch(
              preview_docs_comment["url"],
              json={"body": comment_body_with_marker},
          )
  
file_path: mlflow/dev/preview_docs.py
imports: import argparse
  import os
  import time
  from urllib.parse import urlparse
  import requests
label_desc: Use image node_id 1 for calling a global function with example usage: upsert_comment(session, repo, pull_number, comment_body) without return types