code: def _IncrementNestLevel():
    
    # This is the top call to import (no nesting), init the per-thread nest level
    # and names set.
    if getattr(_import_local, 'nest_level', None) is None:
      _import_local.nest_level = 0
  
    if _import_local.nest_level == 0:
      # Re-initialize names set at each top-level import to prevent any
      # accidental unforeseen memory leak.
      _import_local.names = set()
  
    _import_local.nest_level += 1
docs: Increments the per thread nest level of imports.