code: def _InstallImportHookBySuffix():
    
    global _real_import
  
    if _real_import:
      return  # Import hook already installed
  
    _real_import = getattr(builtins, '__import__')
    assert _real_import
    builtins.__import__ = _ImportHookBySuffix
  
    if six.PY3:
      # In Python 2, importlib.import_module calls __import__ internally so
      # overriding __import__ is enough. In Python 3, they are separate so it also
      # needs to be overwritten.
      global _real_import_module
      _real_import_module = importlib.import_module
      assert _real_import_module
      importlib.import_module = _ImportModuleHookBySuffix
docs: Lazily installs import hook.