<s> from importlib import import_module <EOL> from zlib import crc32 <EOL> def load_object ( path ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> dot = path . rindex ( '<STR_LIT:.>' ) <EOL> except ValueError : <EOL> raise ValueError ( "<STR_LIT>" % path ) <EOL> module , name = path [ : dot ] , path [ dot + <NUM_LIT:1> : ] <EOL> try : <EOL> mod = import_module ( module ) <EOL> except ImportError as e : <EOL> raise ImportError ( "<STR_LIT>" % ( path , e ) ) <EOL> try : <EOL> obj = getattr ( mod , name ) <EOL> except AttributeError : <EOL> raise NameError ( "<STR_LIT>" % ( module , name ) ) <EOL> return obj <EOL> def get_crc32 ( name ) : <EOL> return crc32 ( name ) if type ( name ) is str else crc32 ( name . encode ( '<STR_LIT:utf-8>' , '<STR_LIT:ignore>' ) ) <EOL> def chunks ( l , n ) : <EOL> for i in xrange ( <NUM_LIT:0> , len ( l ) , n ) : <EOL> yield l [ i : i + n ] </s>
