def save_reduce(self, func, args, state=None, <EOL>listitems=None, dictitems=None, obj=None):
<EOL>if not isinstance(args, tuple):<EOL><INDENT>raise pickle.PicklingError("<STR_LIT>")<EOL><DEDENT>if not hasattr(func, '<STR_LIT>'):<EOL><INDENT>raise pickle.PicklingError("<STR_LIT>")<EOL><DEDENT>save = self.save<EOL>write = self.write<EOL>if self.proto >= <NUM_LIT:2> and getattr(func, "<STR_LIT>", "<STR_LIT>") == "<STR_LIT>":<EOL><INDENT>cls = args[<NUM_LIT:0>]<EOL>if not hasattr(cls, "<STR_LIT>"):<EOL><INDENT>raise pickle.PicklingError(<EOL>"<STR_LIT>")<EOL><DEDENT>if obj is not None and cls is not obj.__class__:<EOL><INDENT>raise pickle.PicklingError(<EOL>"<STR_LIT>")<EOL><DEDENT>args = args[<NUM_LIT:1>:]<EOL>save(cls)<EOL>if hasattr(obj, '<STR_LIT>'):<EOL><INDENT>transient = obj.__transient__<EOL>state = state.copy()<EOL>for k in list(state.keys()):<EOL><INDENT>if k in transient:<EOL><INDENT>del state[k]<EOL><DEDENT><DEDENT><DEDENT>save(args)<EOL>write(pickle.NEWOBJ)<EOL><DEDENT>else:<EOL><INDENT>save(func)<EOL>save(args)<EOL>write(pickle.REDUCE)<EOL><DEDENT>if obj is not None:<EOL><INDENT>self.memoize(obj)<EOL><DEDENT>if listitems is not None:<EOL><INDENT>self._batch_appends(listitems)<EOL><DEDENT>if dictitems is not None:<EOL><INDENT>self._batch_setitems(dictitems)<EOL><DEDENT>if state is not None:<EOL><INDENT>save(state)<EOL>write(pickle.BUILD)<EOL><DEDENT>
Modified to support __transient__ on new objects
        Change only affects protocol level 2 (which is always used by PiCloud