code: def image_resource(filename):
      try:
          if (
              os.path.join("cellprofiler", "docs", "frontend")
              in os.path.abspath(os.curdir).lower()
          ):
              # We're probably trying to buld the manual
              thepath = os.path.relpath(
                  os.path.abspath(
                      pkg_resources.resource_filename(
                          "cellprofiler",
                          os.path.join("..", "images", filename),
                      )
                  ),
                  os.path.abspath(os.curdir),
              )
          else:
              if hasattr(sys, "frozen"):
                  # Use relative paths if we're frozen.
                  thepath = os.path.relpath(
                      pkg_resources.resource_filename(
                          "cellprofiler",
                          os.path.join("data", "images", filename),
                      )
                  )
              else:
                  thepath = os.path.abspath(
                      pkg_resources.resource_filename(
                          "cellprofiler",
                          os.path.join("data", "images", filename),
                      )
                  )
          return thepath.replace("\\", "/")
      except ModuleNotFoundError:
          # CellProfiler is not installed so the assets are missing.
          # In theory an icon should never be called without the GUI anyway
          print("CellProfiler image assets were not found")
      return ""
  
imports: import logging
  import os
  import re
  import shutil
  import sys
  import tempfile
  import urllib.request
  from urllib.parse import parse_qs, unquote, urlparse
  from urllib.request import urlopen
  import boto3
  import numpy
  import pkg_resources
  import scipy.io
  from google.cloud import storage
  from google.cloud.exceptions import NotFound
  from google.auth.exceptions import DefaultCredentialsError
  from ..constants.image import ALL_IMAGE_EXTENSIONS, FILE_SCHEME, PASSTHROUGH_SCHEMES, SUPPORTED_MOVIE_EXTENSIONS
  from ..constants.measurement import FTR_WELL
  from .measurement import is_well_column_token, is_well_row_token
label_desc: Use image node_id 15 for calling a global function with example usage: image_resource(filename) and returns: str, thepath