code: def seek(self, offset, whence=os.SEEK_SET):
      
      if not self._is_open:
        raise IOError('Not opened.')
  
      # For a yet unknown reason a Python file-like object on Windows allows for
      # invalid whence values to be passed to the seek function. This check
      # makes sure the behavior of the function is the same on all platforms.
      if whence not in [os.SEEK_SET, os.SEEK_CUR, os.SEEK_END]:
        raise IOError('Unsupported whence.')
  
      self._file_object.seek(offset, whence)
docs: Seeks to an offset within the file-like object.
  
      Args:
        offset (int): offset to seek to.
        whence (Optional(int)): value that indicates whether offset is an absolute
            or relative position within the file.
  
      Raises:
        IOError: if the seek failed.
        OSError: if the seek failed.