def METHOD_NAME(self, fullname: str, target: Optional[ModuleType] = None) -> Optional[importlib.machinery.ModuleSpec]:
    fullname_ = self.module_name_mapping.get(fullname, fullname)
    spec = super().METHOD_NAME(fullname_, target=target)
    cached_spec = None
    if (
        fullname_ != fullname
        and sys.modules.get(fullname_, None) is not None
        and sys.modules.get(fullname, None) is None
    ):
        cached_spec = self.spec_cache.get((fullname_, self._path_mtime))
    if cached_spec:
        return cached_spec
    if not spec:
        return spec
    self.spec_cache[(fullname_, self._path_mtime)] = spec
    if isinstance(spec.loader, ImportLoader):
        spec.loader.module_aliases.add(fullname_)
    for name in self.reversed_module_name_mapping.get(fullname_, []):
        self.spec_cache[(name, self._path_mtime)] = spec
        if isinstance(spec.loader, ImportLoader):
            spec.loader.module_aliases.add(name)
    return spec