def test__pickle(self):
        signal1 = AnalogSignal([1, 2, 3, 4], sampling_period=1*pq.ms,
                               units=pq.S, channel_index=42)
        signal1.annotations['index'] = 2

        fobj = open('./pickle', 'wb')
        pickle.dump(signal1, fobj)
        fobj.close()

        fobj = open('./pickle', 'rb')
        try:
            signal2 = pickle.load(fobj)
        except __HOLE__:
            signal2 = None

        assert_arrays_equal(signal1, signal2)
        self.assertEqual(signal1.channel_index, signal2.channel_index, 42)
        fobj.close()
        os.remove('./pickle')
dataset/ETHPy150Open NeuralEnsemble/python-neo/neo/test/coretest/test_analogsignal.py/TestAnalogSignalFunctions.test__pickle