This module provides the components needed to build your own import function. Undocumented functions are obsolete.
In most cases it is preferred you consider using the importlib module's functionality over this module.
Taken from CPython 3.7.0 and vendored to still have it when it gets completely removed.
Licensed under the PSF LICENSE AGREEMENT https://docs.python.org/3/license.html
Given the path to a .py file, return the path to its .pyc file.
The .py file does not need to exist; this simply returns the path to the .pyc file calculated as if the .py file were imported.
If debug_override is not None, then it must be a boolean and is used in place of sys.flags.optimize.
If sys.implementation.cache_tag is None then NotImplementedError is raised.
Search for a module.
If path is omitted or None, search for a built-in, frozen or special module and continue search in sys.path. The module name cannot contain '.'; to search for a submodule of a package, pass the submodule name and the package's path.
Return the magic number for .pyc files.
Return the magic tag for .pyc files.
Load and return a built-in module by name, or None is such module doesn't exist
load_compiled(name, pathname, file=None)
load_dynamic(name, path, file=None)
Load an extension module.
load_module(name, file, filename, details)
Load a module, given information returned by find_module().
The module name must include the full package name, if any.
Create a new module.
The module is not entered into sys.modules.
Reload the module and return it.
The module must have been successfully imported before.
Given the path to a .pyc. file, return the path to its .py file.
The .pyc file does not need to exist; this simply returns the path to the .py file calculated to correspond to the .pyc file. If path does not conform to PEP 3147 format, ValueError will be raised. If sys.implementation.cache_tag is None then NotImplementedError is raised.