<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> import sys <EOL> class VendorAlias ( object ) : <EOL> def __init__ ( self ) : <EOL> self . _vendor_name = __name__ <EOL> self . _vendor_pkg = self . _vendor_name + "<STR_LIT:.>" <EOL> def find_module ( self , fullname , path = None ) : <EOL> if fullname . startswith ( self . _vendor_pkg ) : <EOL> return self <EOL> def load_module ( self , name ) : <EOL> if not name . startswith ( self . _vendor_pkg ) : <EOL> raise ImportError ( <EOL> "<STR_LIT>" % ( <EOL> name , self . _vendor_name , <EOL> ) <EOL> ) <EOL> if name in sys . modules : <EOL> return sys . modules [ name ] <EOL> try : <EOL> real_meta_path = sys . meta_path [ : ] <EOL> try : <EOL> sys . meta_path = [ <EOL> m for m in sys . meta_path <EOL> if not isinstance ( m , VendorAlias ) <EOL> ] <EOL> __import__ ( name ) <EOL> module = sys . modules [ name ] <EOL> finally : <EOL> for m in sys . meta_path : <EOL> if m not in real_meta_path : <EOL> real_meta_path . append ( m ) <EOL> sys . meta_path = real_meta_path <EOL> except ImportError : <EOL> real_name = name [ len ( self . _vendor_pkg ) : ] <EOL> try : <EOL> __import__ ( real_name ) <EOL> module = sys . modules [ real_name ] <EOL> except ImportError : <EOL> raise ImportError ( "<STR_LIT>" % ( name , ) ) <EOL> sys . modules [ name ] = module <EOL> return module <EOL> sys . meta_path . append ( VendorAlias ( ) ) </s>
