code: def decode(self, encoded_packet):
          
          b64 = False
          if not isinstance(encoded_packet, binary_types):
              encoded_packet = encoded_packet.encode('utf-8')
          elif not isinstance(encoded_packet, bytes):
              encoded_packet = bytes(encoded_packet)
          self.packet_type = six.byte2int(encoded_packet[0:1])
          if self.packet_type == 98:  # 'b' --> binary base64 encoded packet
              self.binary = True
              encoded_packet = encoded_packet[1:]
              self.packet_type = six.byte2int(encoded_packet[0:1])
              self.packet_type -= 48
              b64 = True
          elif self.packet_type >= 48:
              self.packet_type -= 48
              self.binary = False
          else:
              self.binary = True
          self.data = None
          if len(encoded_packet) > 1:
              if self.binary:
                  if b64:
                      self.data = base64.b64decode(encoded_packet[1:])
                  else:
                      self.data = encoded_packet[1:]
              else:
                  try:
                      self.data = self.json.loads(
                          encoded_packet[1:].decode('utf-8'))
                      if isinstance(self.data, int):
                          # do not allow integer payloads, see
                          # github.com/miguelgrinberg/python-engineio/issues/75
                          # for background on this decision
                          raise ValueError
                  except ValueError:
                      self.data = encoded_packet[1:].decode('utf-8')
docs: Decode a transmitted package.