/usr/share/pyshared/neo/io/pickleio.py is in python-neo 0.3.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # -*- coding: utf-8 -*-
"""
Module for reading/writing data from/to Python pickle format.
Class:
PickleIO
Supported: Read/Write
Authors: Andrew Davison
"""
try:
import cPickle as pickle # Python 2
except ImportError:
import pickle # Python 3
from neo.io.baseio import BaseIO
from neo.core import (Block, Segment,
AnalogSignal, AnalogSignalArray, SpikeTrain)
class PickleIO(BaseIO):
"""
"""
is_readable = True
is_writable = True
has_header = False
is_streameable = False # TODO - correct spelling to "is_streamable"
supported_objects = [Block, Segment, AnalogSignal, AnalogSignalArray, SpikeTrain] # should extend to Epoch, etc.
readable_objects = supported_objects
writeable_objects = supported_objects
mode = 'file'
name = "Python pickle file"
extensions = ['pkl', 'pickle']
def read_block(self, lazy=False, cascade=True):
with open(self.filename, "rb") as fp:
block = pickle.load(fp)
return block
def write_block(self, block):
with open(self.filename, "wb") as fp:
pickle.dump(block, fp)
|