code: def write_stub(resource, pyfile):
      _stub_template = textwrap.dedent(
          """
          def __bootstrap__():
              global __bootstrap__, __loader__, __file__
              import sys, pkg_resources, importlib.util
              __file__ = pkg_resources.resource_filename(__name__, %r)
              __loader__ = None; del __bootstrap__, __loader__
              spec = importlib.util.spec_from_file_location(__name__,__file__)
              mod = importlib.util.module_from_spec(spec)
              spec.loader.exec_module(mod)
          __bootstrap__()
          """
      ).lstrip()
      with open(pyfile, "w") as f:
          f.write(_stub_template % resource)
  
imports: from distutils.dir_util import remove_tree, mkpath
  from distutils import log
  from types import CodeType
  import sys
  import os
  import re
  import textwrap
  import marshal
  from setuptools.extension import Library
  from setuptools import Command
  from .._path import ensure_directory
  from sysconfig import get_path, get_python_version
label_desc: Use image node_id 4 for calling a global function with example usage: write_stub(resource, pyfile) without return types