@classmethod<EOL><INDENT>def save(cls,instance,filename):<DEDENT>
filename = cls.correct_file_extension(filename)<EOL>try:<EOL><INDENT>with open(filename,'<STR_LIT:wb>') as f:<EOL><INDENT>pickle.dump(instance,f,protocol=pickle.HIGHEST_PROTOCOL)<EOL><DEDENT><DEDENT>except MemoryError as e:<EOL><INDENT>print ('<STR_LIT>'<EOL>.format(type(e).__name__))<EOL>copy_instance = instance.copy()<EOL>copy_instance.H = copy_instance.H[::<NUM_LIT:20>,:,:]<EOL>copy_instance.Y = copy_instance.Y[::<NUM_LIT:20>,:]<EOL>with open(filename,'<STR_LIT:wb>') as f:<EOL><INDENT>pickle.dump(copy_instance,f,protocol=pickle.HIGHEST_PROTOCOL)<EOL><DEDENT><DEDENT>
Class method save for saving TracingVariable.