def __getstate__(self):
        state = self.__dict__.copy()
        # If already open, restored recorder will append to reopened file.
        state['append'] = self.append or (self.outfile is not None)
        state['outfile'] = None
        state['csv_writer'] = None
        return state
Returns state as a dict.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/casehandlers/csvcase.py/CSVCaseRecorder.__getstate__