<s> import os <EOL> import gzip <EOL> import pickle <EOL> import sys <EOL> try : <EOL> from urllib . request import urlretrieve <EOL> except ImportError : <EOL> from urllib import urlretrieve <EOL> '''<STR_LIT>''' <EOL> def load_mnist ( data_file = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ) : <EOL> if not os . path . exists ( data_file ) : <EOL> origin = '<STR_LIT>' <EOL> print ( '<STR_LIT>' . format ( origin ) ) <EOL> urlretrieve ( origin , data_file ) <EOL> print ( '<STR_LIT>' ) <EOL> with gzip . open ( data_file , '<STR_LIT:rb>' ) as f : <EOL> if sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:3> : <EOL> return pickle . load ( f , encoding = '<STR_LIT>' ) <EOL> else : <EOL> return pickle . load ( f ) </s>
