def __init__(self, filename, compress=0, cache_size=10, protocol=None):
    self._filename = filename
    self._filenames = [filename]
    self.cache_size = cache_size
    self.compress = compress
    if (not self.compress):
        self.file = open(filename, 'wb')
    else:
        self.file = BytesIO()
    self._npy_counter = 1
    if (protocol is None):
        protocol = (pickle.DEFAULT_PROTOCOL if PY3_OR_LATER else pickle.HIGHEST_PROTOCOL)
    Pickler.__init__(self, self.file, protocol=protocol)
    try:
        import numpy as np
    except ImportError:
        np = None
    self.np = np
def __init__(self, filename, compress=0, cache_size=10, protocol=None):
    self._filename = filename
    self._filenames = [filename]
    self.cache_size = cache_size
    self.compress = compress
    if (not self.compress):
        self.file = open(filename, 'wb')
    else:
        self.file = BytesIO()
    self._npy_counter = 1
    if (protocol is None):
        protocol = (pickle.DEFAULT_PROTOCOL if PY3_OR_LATER else pickle.HIGHEST_PROTOCOL)
    Pickler.__init__(self, self.file, protocol=protocol)
    try:
        import numpy as np
    except ImportError:
        np = None
    self.np = np