def to_pickle(self, path='', filename=None):
        """Pickle (serialize) EegTrial object to disk.

        Keyword arguments:
        path -- path without filename to store pickled object
        filename -- filename to append to path, optional
        """

        if filename is not None:
            filename = '{0.subject_id}-{1}-{0.trial_num:03}-{0.stimulus}.pkl'.format(self, 'a' if self.alcoholic else 'c')
        filename = os.path.join(path, filename)
        pickle.dump(self, open(filename, 'w'), pickle.HIGHEST_PROTOCOL)
dataset/ETHPy150Open turambar/pyDatasets/pydatasets/uci/eeg.py/EegTrial.to_pickle/operator `is` -> `is not`