code: def on_report(event, dialog, traceback_text, pipeline):
      """Report an error to us"""
      import cellprofiler
  
      params = {
          "traceback": traceback_text,
          "revision": cellprofiler.__version__,
          "platform": str(platform.platform()),
      }
      try:
          obfuscated_pipeline = pipeline.copy()
          obfuscated_pipeline.obfuscate()
          fd = io.StringIO()
          obfuscated_pipeline.dump(fd)
          fd.seek(0)
          pipeline_text = fd.read()
          params["pipeline"] = pipeline_text
      except:
          pass
      headers = {"Accept": "text/plain"}
      data = urllib.parse.urlencode(params)
      req = urllib.request.Request(ERROR_URL, data, headers)
      import wx
  
      try:
          conn = urlopen(req)
          response = conn.read()
          wx.MessageBox(
              "Report successfully sent to CellProfiler.org. Thank you.",
              parent=dialog,
          )
      except HTTPError as e:
          wx.MessageBox(
              "Failed to upload, server reported code %d" % e.code
          )
      except URLError as e:
          wx.MessageBox("Failed to upload: %s" % e.reason)
  
file_path: CellProfiler/src/frontend/cellprofiler/gui/errordialog.py
imports: import functools
  import io
  import logging
  import os
  import platform
  import sys
  import traceback
  import urllib
  import urllib.parse
  import urllib.request
  from urllib.error import HTTPError, URLError
  from urllib.request import urlopen
  from cellprofiler_core.preferences import get_headless
label_desc: Use image node_id 4 for calling a global function with example usage: on_report(event, dialog, traceback_text, pipeline) without return types