parameters: (self,offset,whence=0)
docstring: Seek within the byte range.
          Positioning is identical to that described under tell().
docstring_summary: Seek within the byte range.
          Positioning is identical to that described under tell().
docstring_tokens: Seek within the byte range . Positioning is identical to that described under tell () .
function: def seek(self,offset,whence=0):
          """Seek within the byte range.
          Positioning is identical to that described under tell().
          """
          assert whence in (0, 1, 2)
          if whence == 0:   # absolute seek
              realoffset = self.firstbyte + offset
          elif whence == 1: # relative seek
              realoffset = self.realpos + offset
          elif whence == 2: # absolute from end of file
              # XXX: are we raising the right Error here?
              raise IOError('seek from end of file not supported.')
          
          # do not allow seek past lastbyte in range
          if self.lastbyte and (realoffset >= self.lastbyte):
              realoffset = self.lastbyte
          
          self._do_seek(realoffset - self.realpos)
function_tokens: def seek ( self , offset , whence = 0 ) : assert whence in ( 0 , 1 , 2 ) if whence == 0 : # absolute seek realoffset = self . firstbyte + offset elif whence == 1 : # relative seek realoffset = self . realpos + offset elif whence == 2 : # absolute from end of file # XXX: are we raising the right Error here? raise IOError ( 'seek from end of file not supported.' ) # do not allow seek past lastbyte in range if self . lastbyte and ( realoffset >= self . lastbyte ) : realoffset = self . lastbyte self . _do_seek ( realoffset - self . realpos )