code: def decode(self, buffer):
      img = io.BytesIO()
      blank_line = bytearray((0xFF,) * ((self.state.xsize + 7) // 8))
      try:
          self.fd.seek(32)
          rowmap = struct.unpack_from(
              "<%dH" % (self.state.ysize),
              self.fd.read(self.state.ysize * 2),
          )
      except struct.error:
          raise IOError("Truncated MSP file in row map")
  
      for x, rowlen in enumerate(rowmap):
          try:
              if rowlen == 0:
                  img.write(blank_line)
                  continue
              row = self.fd.read(rowlen)
              if len(row) != rowlen:
                  raise IOError(
                      "Truncated MSP file, expected %d bytes on row %s",
                      (rowlen, x),
                  )
              idx = 0
              while idx < rowlen:
                  runtype = i8(row[idx])
                  idx += 1
                  if runtype == 0:
                      (runcount, runval) = struct.unpack_from(
                          "Bc", row, idx
                      )
                      img.write(runval * runcount)
                      idx += 2
                  else:
                      runcount = runtype
                      img.write(row[idx : idx + runcount])
                      idx += runcount
  
          except struct.error:
              raise IOError("Corrupted MSP file in row %d" % x)
  
      self.set_as_raw(img.getvalue(), ("1", 0, 1))
  
      return 0, 0
  
file_path: catboost/contrib/python/Pillow/py2/PIL/MspImagePlugin.py
imports: import io
  import struct
  from .None import Image, ImageFile
  from ._binary import i8, i16le, o16le
label_desc: Use image node_id 1 for calling the MspDecoder obj's underlying member method code with example usage: obj.decode(buffer) and returns: int,  int