code: def _open(self):
      # HEAD
      headlen = 512
      s = self.fp.read(headlen)
  
      if not _accept(s):
          msg = "Not an SGI image file"
          raise ValueError(msg)
  
      # compression : verbatim or RLE
      compression = s[2]
  
      # bpc : 1 or 2 bytes (8bits or 16bits)
      bpc = s[3]
  
      # dimension : 1, 2 or 3 (depending on xsize, ysize and zsize)
      dimension = i16(s, 4)
  
      # xsize : width
      xsize = i16(s, 6)
  
      # ysize : height
      ysize = i16(s, 8)
  
      # zsize : channels count
      zsize = i16(s, 10)
  
      # layout
      layout = bpc, dimension, zsize
  
      # determine mode from bits/zsize
      rawmode = ""
      try:
          rawmode = MODES[layout]
      except KeyError:
          pass
  
      if rawmode == "":
          msg = "Unsupported SGI image mode"
          raise ValueError(msg)
  
      self._size = xsize, ysize
      self._mode = rawmode.split(";")[0]
      if self.mode == "RGB":
          self.custom_mimetype = "image/rgb"
  
      # orientation -1 : scanlines begins at the bottom-left corner
      orientation = -1
  
      # decoder info
      if compression == 0:
          pagesize = xsize * ysize * bpc
          if bpc == 2:
              self.tile = [
                  (
                      "SGI16",
                      (0, 0) + self.size,
                      headlen,
                      (self.mode, 0, orientation),
                  )
              ]
          else:
              self.tile = []
              offset = headlen
              for layer in self.mode:
                  self.tile.append(
                      (
                          "raw",
                          (0, 0) + self.size,
                          offset,
                          (layer, 0, orientation),
                      )
                  )
                  offset += pagesize
      elif compression == 1:
          self.tile = [
              (
                  "sgi_rle",
                  (0, 0) + self.size,
                  headlen,
                  (rawmode, orientation, bpc),
              )
          ]
  
file_path: catboost/contrib/python/Pillow/py3/PIL/SgiImagePlugin.py
imports: import os
  import struct
  from .None import Image, ImageFile
  from ._binary import i16be
  from ._binary import o8
label_desc: Use image node_id 1 for calling the SgiImageFile obj's underlying member method code with example usage: obj._open() without return types