class_docstr: A file object providing transparent zlib (de)compression.
  
  TODO python2_drop: is it still needed since we dropped Python 2 support A
  BinaryZlibFile can act as a wrapper for an existing file object, or refer
  directly to a named file on disk.
  
  Note that BinaryZlibFile provides only a *binary* file interface: data read
  is returned as bytes, and data to be written should be given as bytes.
  
  This object is an adaptation of the BZ2File object and is compatible with
  versions of python >= 2.7.
  
  If filename is a str or bytes object, it gives the name
  of the file to be opened. Otherwise, it should be a file object,
  which will be used to read or write the compressed data.
  
  mode can be 'rb' for reading (default) or 'wb' for (over)writing
  
  If mode is 'wb', compresslevel can be a number between 1
  and 9 specifying the level of compression: 1 produces the least
  compression, and 9 produces the most compression. 3 is the default.
class_docstr_tok: ["A","file","object","providing","transparent","zlib","(","de",")","compression",".","TODO","python2_drop",":","is","it","still","needed","since","we","dropped","Python","2","support","A","BinaryZlibFile","can","act","as","a","wrapper","for","an","existing","file","object",",","or","refer","directly","to","a","named","file","on","disk",".","Note","that","BinaryZlibFile","provides","only","a","*","binary","*","file","interface",":","data","read","is","returned","as","bytes",",","and","data","to","be","written","should","be","given","as","bytes",".","This","object","is","an","adaptation","of","the","BZ2File","object","and","is","compatible","with","versions","of","python",">","=","2.7",".","If","filename","is","a","str","or","bytes","object",",","it","gives","the","name","of","the","file","to","be","opened",".","Otherwise",",","it","should","be","a","file","object",",","which","will","be","used","to","read","or","write","the","compressed","data",".","mode","can","be","'rb","'","for","reading","(","default",")","or","'wb","'","for","(","over",")","writing","If","mode","is","'wb","'",",","compresslevel","can","be","a","number","between","1","and","9","specifying","the","level","of","compression",":","1","produces","the","least","compression",",","and","9","produces","the","most","compression",".","3","is","the","default","."]
docstr: Change the file position.
  
  The new position is specified by offset, relative to the
  position indicated by whence. Values for whence are:
  
      0: start of stream (default); offset must not be negative
      1: current stream position
      2: end of stream; offset must not be positive
  
  Returns the new file position.
  
  Note that seeking is emulated, so depending on the parameters,
  this operation may be extremely slow.
docstr_tok: ["Change","the","file","position",".","The","new","position","is","specified","by","offset",",","relative","to","the","position","indicated","by","whence",".","Values","for","whence","are",":","0",":","start","of","stream","(","default",")",";","offset","must","not","be","negative","1",":","current","stream","position","2",":","end","of","stream",";","offset","must","not","be","positive","Returns","the","new","file","position",".","Note","that","seeking","is","emulated",",","so","depending","on","the","parameters",",","this","operation","may","be","extremely","slow","."]
code: def seek(self, offset, whence=0):
      """Change the file position.
  
      The new position is specified by offset, relative to the
      position indicated by whence. Values for whence are:
  
          0: start of stream (default); offset must not be negative
          1: current stream position
          2: end of stream; offset must not be positive
  
      Returns the new file position.
  
      Note that seeking is emulated, so depending on the parameters,
      this operation may be extremely slow.
      """
      with self._lock:
          self._check_can_seek()
  
          # Recalculate offset as an absolute file position.
          if whence == 0:
              pass
          elif whence == 1:
              offset = self._pos + offset
          elif whence == 2:
              # Seeking relative to EOF - we need to know the file's size.
              if self._size < 0:
                  self._read_all(return_data=False)
              offset = self._size + offset
          else:
              raise ValueError(
                  "Invalid value for whence: %s" % (whence,)
              )
  
          # Make it so that offset is the number of bytes to skip forward.
          if offset < self._pos:
              self._rewind()
          else:
              offset -= self._pos
  
          # Read and discard data until we reach the desired position.
          self._read_block(offset, return_data=False)
  
          return self._pos
  
imports: import io
  import zlib
  from joblib.backports import LooseVersion
label_desc: Use image node_id 19 for calling the BinaryZlibFile obj's underlying member method code with example usage: obj.seek(offset, whence) and returns: self