code: def escape(data):
          
  
          escaped_data = b""
          for byte in data:
              if intToByte(byteToInt(byte)) in APIFrame.ESCAPE_BYTES:
                  escaped_data += APIFrame.ESCAPE_BYTE
                  escaped_data += intToByte(0x20 ^ byteToInt(byte))
              else:
                  escaped_data += intToByte(byteToInt(byte))
  
          return escaped_data
docs: escape: byte string -> byte string
  
          When a 'special' byte is encountered in the given data string,
          it is preceded by an escape byte and XORed with 0x20.