code: def _ImportHookBySuffix(
      name, globals=None, locals=None, fromlist=None, level=None):
    
    _IncrementNestLevel()
  
    if level is None:
      # A level of 0 means absolute import, positive values means relative
      # imports, and -1 means to try both an absolute and relative import.
      # Since imports were disambiguated in Python 3, -1 is not a valid value.
      # The default values are 0 and -1 for Python 3 and 3 respectively.
      # https://docs.python.org/2/library/functions.html#__import__
      # https://docs.python.org/3/library/functions.html#__import__
      level = 0 if six.PY3 else -1
  
    try:
      # Really import modules.
      module = _real_import(name, globals, locals, fromlist, level)
    finally:
      # This _real_import call may raise an exception (e.g., ImportError).
      # However, there might be several modules already loaded before the
      # exception was raised. For instance:
      #   a.py
      #     import b  # success
      #     import c  # ImportError exception.
      # In this case, an 'import a' statement would have the side effect of
      # importing module 'b'. This should trigger the import hooks for module
      # 'b'. To achieve this, we always search/invoke import callbacks (i.e.,
      # even when an exception is raised).
      #
      # Important Note: Do not use 'return' inside the finally block. It will
      # cause any pending exception to be discarded.
      _ProcessImportBySuffix(name, fromlist, globals)
  
    return module
docs: Callback when an import statement is executed by the Python interpreter.
  
    Argument names have to exactly match those of __import__. Otherwise calls
    to __import__ that use keyword syntax will fail: __import('a', fromlist=[]).