def read_hatpi_pklc(lcfile):
try:<EOL><INDENT>if lcfile.endswith('<STR_LIT>'):<EOL><INDENT>infd = gzip.open(lcfile,'<STR_LIT:rb>')<EOL><DEDENT>else:<EOL><INDENT>infd = open(lcfile,'<STR_LIT:rb>')<EOL><DEDENT>lcdict = pickle.load(infd)<EOL>infd.close()<EOL>return lcdict<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>if lcfile.endswith('<STR_LIT>'):<EOL><INDENT>infd = gzip.open(lcfile,'<STR_LIT:rb>')<EOL><DEDENT>else:<EOL><INDENT>infd = open(lcfile,'<STR_LIT:rb>')<EOL><DEDENT>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' % lcfile)<EOL>lcdict = pickle.load(infd, encoding='<STR_LIT>')<EOL>infd.close()<EOL>return lcdict<EOL><DEDENT>
This just reads a pickle LC. Returns an lcdict.