code: def setup_module(machinery, name, path=None):
      if machinery.WindowsRegistryFinder.DEBUG_BUILD:
          root = machinery.WindowsRegistryFinder.REGISTRY_KEY_DEBUG
      else:
          root = machinery.WindowsRegistryFinder.REGISTRY_KEY
      key = root.format(
          fullname=name, sys_version="%d.%d" % sys.version_info[:2]
      )
      base_key = "Software\\Python\\PythonCore\\{}.{}".format(
          sys.version_info.major, sys.version_info.minor
      )
      assert key.casefold().startswith(
          base_key.casefold()
      ), "expected key '{}' to start with '{}'".format(key, base_key)
      try:
          with temp_module(name, "a = 1") as location:
              try:
                  OpenKey(HKEY_CURRENT_USER, base_key)
                  if machinery.WindowsRegistryFinder.DEBUG_BUILD:
                      delete_key = os.path.dirname(key)
                  else:
                      delete_key = key
              except OSError:
                  delete_key = base_key
              subkey = CreateKey(HKEY_CURRENT_USER, key)
              if path is None:
                  path = location + ".py"
              SetValue(subkey, "", REG_SZ, path)
              yield
      finally:
          if delete_key:
              delete_registry_tree(HKEY_CURRENT_USER, delete_key)
  
imports: from test.test_importlib import util
  import os
  import re
  import sys
  import unittest
  from test import support
  from test.support import import_helper
  from contextlib import contextmanager
  from test.test_importlib.util import temp_module
  from winreg import CreateKey, HKEY_CURRENT_USER, SetValue, REG_SZ, KEY_ALL_ACCESS, EnumKey, CloseKey, DeleteKey, OpenKey
label_desc: Use image node_id 3 for calling a global function with example usage: setup_module(machinery, name, path) without return types