code: def _ensure_package_loaded(path, component):
      
  
      logger = logging.getLogger(__name__)
  
      packages = component.find_products('support_package')
      if len(packages) == 0:
          return None
      elif len(packages) > 1:
          raise ExternalError("Component had multiple products declared as 'support_package", products=packages)
  
      if len(path) > 2 and ':' in path[2:]:  # Don't flag windows C: type paths
          path, _, _ = path.rpartition(":")
  
      package_base = packages[0]
      relative_path = os.path.normpath(os.path.relpath(path, start=package_base))
      if relative_path.startswith('..'):
          raise ExternalError("Component had python product output of support_package",
                              package=package_base, product=path, relative_path=relative_path)
  
      if not relative_path.endswith('.py'):
          raise ExternalError("Python product did not end with .py", path=path)
  
      relative_path = relative_path[:-3]
      if os.pathsep in relative_path:
          raise ExternalError("Python support wheels with multiple subpackages not yet supported",
                              relative_path=relative_path)
  
      support_distro = component.support_distribution
      if support_distro not in sys.modules:
          logger.debug("Creating dynamic support wheel package: %s", support_distro)
          file, path, desc = imp.find_module(os.path.basename(package_base), [os.path.dirname(package_base)])
          imp.load_module(support_distro, file, path, desc)
  
      return "{}.{}".format(support_distro, relative_path)
docs: Ensure that the given module is loaded as a submodule.
  
      Returns:
          str: The name that the module should be imported as.