class_docstr: A file object that provides read access to a part of an existing
  file (for example a TAR file).
class_docstr_tok: ["A","file","object","that","provides","read","access","to","a","part","of","an","existing","file","(","for","example","a","TAR","file",")","."]
docstr: Move file pointer.
  
  :param offset: Offset in bytes.
  :param mode: Starting position. Use 0 for beginning of region, 1
     for current offset, and 2 for end of region.  You cannot move
     the pointer outside the defined region.
docstr_tok: ["Move","file","pointer",".",":","param","offset",":","Offset","in","bytes",".",":","param","mode",":","Starting","position",".","Use","0","for","beginning","of","region",",","1","for","current","offset",",","and","2","for","end","of","region",".","You","can","not","move","the","pointer","outside","the","defined","region","."]
code: def seek(
      self, offset: int, mode: Literal[0, 1, 2] = io.SEEK_SET
  ) -> None:
      """
      Move file pointer.
  
      :param offset: Offset in bytes.
      :param mode: Starting position. Use 0 for beginning of region, 1
         for current offset, and 2 for end of region.  You cannot move
         the pointer outside the defined region.
      """
      if mode == 1:
          self.pos = self.pos + offset
      elif mode == 2:
          self.pos = self.length + offset
      else:
          self.pos = offset
      # clamp
      self.pos = max(0, min(self.pos, self.length))
      self.fh.seek(self.offset + self.pos)
  
file_path: pillow/src/PIL/ContainerIO.py
imports: from __future__ import annotations
  import io
  from typing import IO, AnyStr, Generic, Literal
label_desc: Use image node_id 3 for calling the ContainerIO obj's underlying member method code with example usage: obj.seek(offset, mode) without return types