<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> try : <EOL> from importlib import import_module <EOL> except ImportError : <EOL> from django . utils . importlib import import_module <EOL> def load_object ( path ) : <EOL> """<STR_LIT>""" <EOL> i = path . rfind ( '<STR_LIT:.>' ) <EOL> module_name , object_name = path [ : i ] , path [ i + <NUM_LIT:1> : ] <EOL> try : <EOL> module = import_module ( module_name ) <EOL> except ImportError : <EOL> raise ImproperlyConfigured ( '<STR_LIT>' % module_name ) <EOL> except ValueError : <EOL> raise ImproperlyConfigured ( '<STR_LIT>' % module_name ) <EOL> try : <EOL> return getattr ( module , object_name ) <EOL> except AttributeError : <EOL> msg = '<STR_LIT>' <EOL> raise ImproperlyConfigured ( msg % ( module_name , object_name ) ) </s>
