parameters: (self, pos, whence=os.SEEK_SET)
docstring: Seek to a position in the file.
docstring_summary: Seek to a position in the file.
docstring_tokens: Seek to a position in the file .
function: def seek(self, pos, whence=os.SEEK_SET):
  
          """Seek to a position in the file.
  
          """
  
          if self.closed:
  
              raise ValueError("I/O operation on closed file")
  
  
  
          if whence == os.SEEK_SET:
  
              self.position = min(max(pos, 0), self.size)
  
          elif whence == os.SEEK_CUR:
  
              if pos < 0:
  
                  self.position = max(self.position + pos, 0)
  
              else:
  
                  self.position = min(self.position + pos, self.size)
  
          elif whence == os.SEEK_END:
  
              self.position = max(min(self.size + pos, self.size), 0)
  
          else:
  
              raise ValueError("Invalid argument")
  
  
  
          self.buffer = b""
  
          self.fileobj.seek(self.position)
function_tokens: def seek ( self , pos , whence = os . SEEK_SET ) : if self . closed : raise ValueError ( "I/O operation on closed file" ) if whence == os . SEEK_SET : self . position = min ( max ( pos , 0 ) , self . size ) elif whence == os . SEEK_CUR : if pos < 0 : self . position = max ( self . position + pos , 0 ) else : self . position = min ( self . position + pos , self . size ) elif whence == os . SEEK_END : self . position = max ( min ( self . size + pos , self . size ) , 0 ) else : raise ValueError ( "Invalid argument" ) self . buffer = b"" self . fileobj . seek ( self . position )