code: def _open(self):
      # check magic
      s = self.fp.read(1)
      if s != b"P":
          raise SyntaxError("not a PPM file")
      magic_number = self._token(s)
      mode = MODES[magic_number]
  
      self.custom_mimetype = {
          b"P4": "image/x-portable-bitmap",
          b"P5": "image/x-portable-graymap",
          b"P6": "image/x-portable-pixmap",
      }.get(magic_number)
  
      if mode == "1":
          self.mode = "1"
          rawmode = "1;I"
      else:
          self.mode = rawmode = mode
  
      for ix in range(3):
          while True:
              while True:
                  s = self.fp.read(1)
                  if s not in b_whitespace:
                      break
                  if s == b"":
                      raise ValueError(
                          "File does not extend beyond magic number"
                      )
              if s != b"#":
                  break
              s = self.fp.readline()
          s = int(self._token(s))
          if ix == 0:
              xsize = s
          elif ix == 1:
              ysize = s
              if mode == "1":
                  break
          elif ix == 2:
              # maxgrey
              if s > 255:
                  if not mode == "L":
                      raise ValueError(
                          "Too many colors for band: %s" % s
                      )
                  if s < 2**16:
                      self.mode = "I"
                      rawmode = "I;16B"
                  else:
                      self.mode = "I"
                      rawmode = "I;32B"
  
      self._size = xsize, ysize
      self.tile = [
          ("raw", (0, 0, xsize, ysize), self.fp.tell(), (rawmode, 0, 1))
      ]
  
imports: from .None import Image, ImageFile
label_desc: Use image node_id 2 for calling the PpmImageFile obj's underlying member method code with example usage: obj._open() without return types