text: #
  # Autogenerated by Frugal Compiler (3.8.2)
  #
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  #
  
  from thrift.Thrift import TType, TMessageType, TException, TApplicationException
  import actual_base.python.ttypes
  import actual_base.python.constants
  import intermediate_include.ttypes
  import intermediate_include.constants
  import validStructs.ttypes
  import validStructs.constants
  import ValidTypes.ttypes
  import ValidTypes.constants
  import subdir_include.ttypes
  import subdir_include.constants
  
  from frugal.util import make_hashable
  from thrift.transport import TTransport
  from thrift.protocol import TBinaryProtocol, TProtocol
  
  
  class HealthCondition(int):
      """
      PASS: This docstring gets added to the generated code because it
      has the @ sign.
      WARN: This docstring also gets added to the generated code
      because it has the @ sign.
      FAIL: Deprecated: use something else
      UNKNOWN: This is a docstring comment for a deprecated enum value that has been
      spread across two lines.
      Deprecated: don't use this; use "something else"
      """
      PASS = 1
      WARN = 2
      FAIL = 3
      UNKNOWN = 4
  
      _VALUES_TO_NAMES = {
          1: "PASS",
          2: "WARN",
          3: "FAIL",
          4: "UNKNOWN",
      }
  
      _NAMES_TO_VALUES = {
          "PASS": 1,
          "WARN": 2,
          "FAIL": 3,
          "UNKNOWN": 4,
      }
  
  class ItsAnEnum(int):
      FIRST = 2
      SECOND = 3
      THIRD = 4
      fourth = 5
      Fifth = 6
      sIxItH = 7
  
      _VALUES_TO_NAMES = {
          2: "FIRST",
          3: "SECOND",
          4: "THIRD",
          5: "fourth",
          6: "Fifth",
          7: "sIxItH",
      }
  
      _NAMES_TO_VALUES = {
          "FIRST": 2,
          "SECOND": 3,
          "THIRD": 4,
          "fourth": 5,
          "Fifth": 6,
          "sIxItH": 7,
      }
  
  class TestBase(object):
      """
      Attributes:
       - base_struct
      """
      def __init__(self, base_struct=None):
          self.base_struct = base_struct
  
      def read(self, iprot):
          iprot.readStructBegin()
          while True:
              (fname, ftype, fid) = iprot.readFieldBegin()
              if ftype == TType.STOP:
                  break
              if fid == 1:
                  if ftype == TType.STRUCT:
                      self.base_struct = actual_base.python.ttypes.thing()
                      self.base_struct.read(iprot)
                  else:
                      iprot.skip(ftype)
              else:
                  iprot.skip(ftype)
              iprot.readFieldEnd()
          iprot.readStructEnd()
          self.validate()
  
      def write(self, oprot):
          self.validate()
          oprot.writeStructBegin('TestBase')
          if self.base_struct is not None:
              oprot.writeFieldBegin('base_struct', TType.STRUCT, 1)
              self.base_struct.write(oprot)
              oprot.writeFieldEnd()
          oprot.writeFieldStop()
          oprot.writeStructEnd()
  
      def validate(self):
          return
  
      def __hash__(self):
          value = 17
          value = (value * 31) ^ hash(make_hashable(self.base_struct))
          return value
  
      def __repr__(self):
          L = ['%s=%r' % (key, value)
              for key, value in self.__dict__.items()]
          return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  
      def __eq__(self, other):
          return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  
      def __ne__(self, other):
          return not (self == other)
  
  class TestLowercase(object):
      """
      Attributes:
       - lowercaseInt
      """
      def __init__(self, lowercaseInt=None):
          self.lowercaseInt = lowercaseInt
  
      def read(self, iprot):
          iprot.readStructBegin()
          while True:
              (fname, ftype, fid) = iprot.readFieldBegin()
              if ftype == TType.STOP:
                  break
              if fid == 1:
                  if ftype == TType.I32:
                      self.lowercaseInt = iprot.readI32()
                  else:
                      iprot.skip(ftype)
              else:
                  iprot.skip(ftype)
              iprot.readFieldEnd()
          iprot.readStructEnd()
          self.validate()
  
      def write(self, oprot):
          self.validate()
          oprot.writeStructBegin('TestLowercase')
          if self.lowercaseInt is not None:
              oprot.writeFieldBegin('lowercaseInt', TType.I32, 1)
              oprot.writeI32(self.lowercaseInt)
              oprot.writeFieldEnd()
          oprot.writeFieldStop()
          oprot.writeStructEnd()
  
      def validate(self):
          return
  
      def __hash__(self):
          value = 17
          value = (value * 31) ^ hash(make_hashable(self.lowercaseInt))
          return value
  
      def __repr__(self):
          L = ['%s=%r' % (key, value)
              for key, value in self.__dict__.items()]
          return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  
      def __eq__(self, other):
          return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  
      def __ne__(self, other):
          return not (self == other)
  
  class Event(object):
      """
      This docstring gets added to the generated code because it has
      the @ sign.
      
      Attributes:
       - ID: ID is a unique identifier for an event.
       - Message: Message contains the event payload.
      """
      from . import constants
      _DEFAULT_ID_MARKER = constants.DEFAULT_ID
      def __init__(self, ID=_DEFAULT_ID_MARKER, Message=None):
          self.ID = ID
          self.Message = Message
  
      def read(self, iprot):
          iprot.readStructBegin()
          while True:
              (fname, ftype, fid) = iprot.readFieldBegin()
              if ftype == TType.STOP:
                  break
              if fid == 1:
                  if ftype == TType.I64:
                      self.ID = iprot.readI64()
                  else:
                      iprot.skip(ftype)
              elif fid == 2:
                  if ftype == TType.STRING:
                      self.Message = iprot.readString()
                  else:
                      iprot.skip(ftype)
              else:
                  iprot.skip(ftype)
              iprot.readFieldEnd()
          iprot.readStructEnd()
          self.validate()
  
      def write(self, oprot):
          self.validate()
          oprot.writeStructBegin('Event')
          if self.ID is not None:
              oprot.writeFieldBegin('ID', TType.I64, 1)
              oprot.writeI64(self.ID)
              oprot.writeFieldEnd()
          if self.Message is not None:
              oprot.writeFieldBegin('Message', TType.STRING, 2)
              oprot.writeString(self.Message)
              oprot.writeFieldEnd()
          oprot.writeFieldStop()
          oprot.writeStructEnd()
  
      def validate(self):
          return
  
      def __hash__(self):
          value = 17
          value = (value * 31) ^ hash(make_hashable(self.ID))
          value = (value * 31) ^ hash(make_hashable(self.Message))
          return value
  
      def __repr__(self):
          L = ['%s=%r' % (key, value)
              for key, value in self.__dict__.items()]
          return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  
      def __eq__(self, other):
          return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  
      def __ne__(self, other):
          return not (self == other)
  
  class TestingDefaults(object):
      """
      Attributes:
       - ID2
       - ev1
       - ev2
       - ID
       - thing
       - thing2
       - listfield
       - ID3
       - bin_field
       - bin_field2
       - bin_field3
       - bin_field4
       - list2
       - list3
       - list4
       - a_map
       - status: Comment for enum field.
       - base_status
      """
      from . import constants
      _DEFAULT_ID2_MARKER = constants.DEFAULT_ID
      _DEFAULT_ev1_MARKER = object()
      _DEFAULT_ev2_MARKER = object()
      _DEFAULT_ID_MARKER = -2
      _DEFAULT_thing_MARKER = "a constant"
      _DEFAULT_thing2_MARKER = "another constant"
      _DEFAULT_listfield_MARKER = object()
      _DEFAULT_ID3_MARKER = constants.other_default
      _DEFAULT_bin_field4_MARKER = constants.bin_const
      _DEFAULT_list2_MARKER = object()
      _DEFAULT_list4_MARKER = object()
      _DEFAULT_a_map_MARKER = object()
      _DEFAULT_status_MARKER = HealthCondition.PASS
      _DEFAULT_base_status_MARKER = actual_base.python.ttypes.base_health_condition.FAIL
      def __init__(self, ID2=_DEFAULT_ID2_MARKER, ev1=_DEFAULT_ev1_MARKER, ev2=_DEFAULT_ev2_MARKER, ID=_DEFAULT_ID_MARKER, thing=_DEFAULT_thing_MARKER, thing2=_DEFAULT_thing2_MARKER, listfield=_DEFAULT_listfield_MARKER, ID3=_DEFAULT_ID3_MARKER, bin_field=None, bin_field2=None, bin_field3=None, bin_field4=_DEFAULT_bin_field4_MARKER, list2=_DEFAULT_list2_MARKER, list3=None, list4=_DEFAULT_list4_MARKER, a_map=_DEFAULT_a_map_MARKER, status=_DEFAULT_status_MARKER, base_status=_DEFAULT_base_status_MARKER):
          self.ID2 = ID2
          if ev1 is self._DEFAULT_ev1_MARKER:
              ev1 = Event(**{
                  "ID": DEFAULT_ID,
                  "Message": "a message",
              })
          self.ev1 = ev1
          if ev2 is self._DEFAULT_ev2_MARKER:
              ev2 = Event(**{
                  "ID": 5,
                  "Message": "a message2",
              })
          self.ev2 = ev2
          self.ID = ID
          self.thing = thing
          self.thing2 = thing2
          if listfield is self._DEFAULT_listfield_MARKER:
              listfield = [
                  1,
                  2,
                  3,
                  4,
                  5,
              ]
          self.listfield = listfield
          self.ID3 = ID3
          self.bin_field = bin_field
          self.bin_field2 = bin_field2
          self.bin_field3 = bin_field3
          self.bin_field4 = bin_field4
          if list2 is self._DEFAULT_list2_MARKER:
              list2 = [
                  1,
                  3,
                  4,
                  5,
                  8,
              ]
          self.list2 = list2
          self.list3 = list3
          if list4 is self._DEFAULT_list4_MARKER:
              list4 = [
                  1,
                  2,
                  3,
                  6,
              ]
          self.list4 = list4
          if a_map is self._DEFAULT_a_map_MARKER:
              a_map = {
                  "k1": "v1",
                  "k2": "v2",
              }
          self.a_map = a_map
          self.status = status
          self.base_status = base_status
  
      def read(self, iprot):
          iprot.readStructBegin()
          while True:
              (fname, ftype, fid) = iprot.readFieldBegin()
              if ftype == TType.STOP:
                  break
              if fid == 1:
                  if ftype == TType.I64:
                      self.ID2 = iprot.readI64()
                  else:
                      iprot.skip(ftype)
              elif fid == 2:
                  if ftype == TType.STRUCT:
                      self.ev1 = Event()
                      self.ev1.read(iprot)
                  else:
                      iprot.skip(ftype)
              elif fid == 3:
                  if ftype == TType.STRUCT:
                      self.ev2 = Event()
                      self.ev2.read(iprot)
                  else:
                      iprot.skip(ftype)
              elif fid == 4:
                  if ftype == TType.I64:
                      self.ID = iprot.readI64()
                  else:
                      iprot.skip(ftype)
              elif fid == 5:
                  if ftype == TType.STRING:
                      self.thing = iprot.readString()
                  else:
                      iprot.skip(ftype)
              elif fid == 6:
                  if ftype == TType.STRING:
                      self.thing2 = iprot.readString()
                  else:
                      iprot.skip(ftype)
              elif fid == 7:
                  if ftype == TType.LIST:
                      self.listfield = []
                      (_, elem0) = iprot.readListBegin()
                      for _ in range(elem0):
                          elem1 = iprot.readI32()
                          self.listfield.append(elem1)
                      iprot.readListEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 8:
                  if ftype == TType.I64:
                      self.ID3 = iprot.readI64()
                  else:
                      iprot.skip(ftype)
              elif fid == 9:
                  if ftype == TType.STRING:
                      self.bin_field = iprot.readBinary()
                  else:
                      iprot.skip(ftype)
              elif fid == 10:
                  if ftype == TType.STRING:
                      self.bin_field2 = iprot.readBinary()
                  else:
                      iprot.skip(ftype)
              elif fid == 11:
                  if ftype == TType.STRING:
                      self.bin_field3 = iprot.readBinary()
                  else:
                      iprot.skip(ftype)
              elif fid == 12:
                  if ftype == TType.STRING:
                      self.bin_field4 = iprot.readBinary()
                  else:
                      iprot.skip(ftype)
              elif fid == 13:
                  if ftype == TType.LIST:
                      self.list2 = []
                      (_, elem2) = iprot.readListBegin()
                      for _ in range(elem2):
                          elem3 = iprot.readI32()
                          self.list2.append(elem3)
                      iprot.readListEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 14:
                  if ftype == TType.LIST:
                      self.list3 = []
                      (_, elem4) = iprot.readListBegin()
                      for _ in range(elem4):
                          elem5 = iprot.readI32()
                          self.list3.append(elem5)
                      iprot.readListEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 15:
                  if ftype == TType.LIST:
                      self.list4 = []
                      (_, elem6) = iprot.readListBegin()
                      for _ in range(elem6):
                          elem7 = iprot.readI32()
                          self.list4.append(elem7)
                      iprot.readListEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 16:
                  if ftype == TType.MAP:
                      self.a_map = {}
                      (_, _, elem8) = iprot.readMapBegin()
                      for _ in range(elem8):
                          elem10 = iprot.readString()
                          elem9 = iprot.readString()
                          self.a_map[elem10] = elem9
                      iprot.readMapEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 17:
                  if ftype == TType.I32:
                      self.status = HealthCondition(iprot.readI32())
                  else:
                      iprot.skip(ftype)
              elif fid == 18:
                  if ftype == TType.I32:
                      self.base_status = actual_base.python.ttypes.base_health_condition(iprot.readI32())
                  else:
                      iprot.skip(ftype)
              else:
                  iprot.skip(ftype)
              iprot.readFieldEnd()
          iprot.readStructEnd()
          self.validate()
  
      def write(self, oprot):
          self.validate()
          oprot.writeStructBegin('TestingDefaults')
          if self.ID2 is not None:
              oprot.writeFieldBegin('ID2', TType.I64, 1)
              oprot.writeI64(self.ID2)
              oprot.writeFieldEnd()
          if self.ev1 is not None:
              oprot.writeFieldBegin('ev1', TType.STRUCT, 2)
              self.ev1.write(oprot)
              oprot.writeFieldEnd()
          if self.ev2 is not None:
              oprot.writeFieldBegin('ev2', TType.STRUCT, 3)
              self.ev2.write(oprot)
              oprot.writeFieldEnd()
          if self.ID is not None:
              oprot.writeFieldBegin('ID', TType.I64, 4)
              oprot.writeI64(self.ID)
              oprot.writeFieldEnd()
          if self.thing is not None:
              oprot.writeFieldBegin('thing', TType.STRING, 5)
              oprot.writeString(self.thing)
              oprot.writeFieldEnd()
          if self.thing2 is not None:
              oprot.writeFieldBegin('thing2', TType.STRING, 6)
              oprot.writeString(self.thing2)
              oprot.writeFieldEnd()
          if self.listfield is not None:
              oprot.writeFieldBegin('listfield', TType.LIST, 7)
              oprot.writeListBegin(TType.I32, len(self.listfield))
              for elem11 in self.listfield:
                  oprot.writeI32(elem11)
              oprot.writeListEnd()
              oprot.writeFieldEnd()
          if self.ID3 is not None:
              oprot.writeFieldBegin('ID3', TType.I64, 8)
              oprot.writeI64(self.ID3)
              oprot.writeFieldEnd()
          if self.bin_field is not None:
              oprot.writeFieldBegin('bin_field', TType.STRING, 9)
              oprot.writeBinary(self.bin_field)
              oprot.writeFieldEnd()
          if self.bin_field2 is not None:
              oprot.writeFieldBegin('bin_field2', TType.STRING, 10)
              oprot.writeBinary(self.bin_field2)
              oprot.writeFieldEnd()
          if self.bin_field3 is not None:
              oprot.writeFieldBegin('bin_field3', TType.STRING, 11)
              oprot.writeBinary(self.bin_field3)
              oprot.writeFieldEnd()
          if self.bin_field4 is not None:
              oprot.writeFieldBegin('bin_field4', TType.STRING, 12)
              oprot.writeBinary(self.bin_field4)
              oprot.writeFieldEnd()
          if self.list2 is not None:
              oprot.writeFieldBegin('list2', TType.LIST, 13)
              oprot.writeListBegin(TType.I32, len(self.list2))
              for elem12 in self.list2:
                  oprot.writeI32(elem12)
              oprot.writeListEnd()
              oprot.writeFieldEnd()
          if self.list3 is not None:
              oprot.writeFieldBegin('list3', TType.LIST, 14)
              oprot.writeListBegin(TType.I32, len(self.list3))
              for elem13 in self.list3:
                  oprot.writeI32(elem13)
              oprot.writeListEnd()
              oprot.writeFieldEnd()
          if self.list4 is not None:
              oprot.writeFieldBegin('list4', TType.LIST, 15)
              oprot.writeListBegin(TType.I32, len(self.list4))
              for elem14 in self.list4:
                  oprot.writeI32(elem14)
              oprot.writeListEnd()
              oprot.writeFieldEnd()
          if self.a_map is not None:
              oprot.writeFieldBegin('a_map', TType.MAP, 16)
              oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.a_map))
              for elem16, elem15 in self.a_map.items():
                  oprot.writeString(elem16)
                  oprot.writeString(elem15)
              oprot.writeMapEnd()
              oprot.writeFieldEnd()
          if self.status is not None:
              oprot.writeFieldBegin('status', TType.I32, 17)
              oprot.writeI32(self.status)
              oprot.writeFieldEnd()
          if self.base_status is not None:
              oprot.writeFieldBegin('base_status', TType.I32, 18)
              oprot.writeI32(self.base_status)
              oprot.writeFieldEnd()
          oprot.writeFieldStop()
          oprot.writeStructEnd()
  
      def validate(self):
          if self.status is None:
              raise TProtocol.TProtocolException(type=TProtocol.TProtocolException.INVALID_DATA, message='Required field \'status\' is not present in struct \'TestingDefaults\'')
          if self.base_status is None:
              raise TProtocol.TProtocolException(type=TProtocol.TProtocolException.INVALID_DATA, message='Required field \'base_status\' is not present in struct \'TestingDefaults\'')
          return
  
      def __hash__(self):
          value = 17
          value = (value * 31) ^ hash(make_hashable(self.ID2))
          value = (value * 31) ^ hash(make_hashable(self.ev1))
          value = (value * 31) ^ hash(make_hashable(self.ev2))
          value = (value * 31) ^ hash(make_hashable(self.ID))
          value = (value * 31) ^ hash(make_hashable(self.thing))
          value = (value * 31) ^ hash(make_hashable(self.thing2))
          value = (value * 31) ^ hash(make_hashable(self.listfield))
          value = (value * 31) ^ hash(make_hashable(self.ID3))
          value = (value * 31) ^ hash(make_hashable(self.bin_field))
          value = (value * 31) ^ hash(make_hashable(self.bin_field2))
          value = (value * 31) ^ hash(make_hashable(self.bin_field3))
          value = (value * 31) ^ hash(make_hashable(self.bin_field4))
          value = (value * 31) ^ hash(make_hashable(self.list2))
          value = (value * 31) ^ hash(make_hashable(self.list3))
          value = (value * 31) ^ hash(make_hashable(self.list4))
          value = (value * 31) ^ hash(make_hashable(self.a_map))
          value = (value * 31) ^ hash(make_hashable(self.status))
          value = (value * 31) ^ hash(make_hashable(self.base_status))
          return value
  
      def __repr__(self):
          L = ['%s=%r' % (key, value)
              for key, value in self.__dict__.items()]
          return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  
      def __eq__(self, other):
          return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  
      def __ne__(self, other):
          return not (self == other)
  
  class EventWrapper(object):
      """
      Attributes:
       - ID
       - Ev
       - Events
       - Events2
       - EventMap
       - Nums
       - Enums
       - aBoolField
       - a_union
       - typedefOfTypedef
       - depr: This is a docstring comment for a deprecated field that has been spread
         across two lines.
         Deprecated: use something else
       - deprBinary
         Deprecated: use something else
       - deprList
         Deprecated: use something else
       - EventsDefault
       - EventMapDefault
       - EventSetDefault
      """
      _DEFAULT_EventsDefault_MARKER = object()
      _DEFAULT_EventMapDefault_MARKER = object()
      _DEFAULT_EventSetDefault_MARKER = object()
      def __init__(self, ID=None, Ev=None, Events=None, Events2=None, EventMap=None, Nums=None, Enums=None, aBoolField=None, a_union=None, typedefOfTypedef=None, depr=None, deprBinary=None, deprList=None, EventsDefault=_DEFAULT_EventsDefault_MARKER, EventMapDefault=_DEFAULT_EventMapDefault_MARKER, EventSetDefault=_DEFAULT_EventSetDefault_MARKER):
          self.ID = ID
          self.Ev = Ev
          self.Events = Events
          self.Events2 = Events2
          self.EventMap = EventMap
          self.Nums = Nums
          self.Enums = Enums
          self.aBoolField = aBoolField
          self.a_union = a_union
          self.typedefOfTypedef = typedefOfTypedef
          self.depr = depr
          self.deprBinary = deprBinary
          self.deprList = deprList
          if EventsDefault is self._DEFAULT_EventsDefault_MARKER:
              EventsDefault = [
              ]
          self.EventsDefault = EventsDefault
          if EventMapDefault is self._DEFAULT_EventMapDefault_MARKER:
              EventMapDefault = {
              }
          self.EventMapDefault = EventMapDefault
          if EventSetDefault is self._DEFAULT_EventSetDefault_MARKER:
              EventSetDefault = set([
              ])
          self.EventSetDefault = EventSetDefault
  
      def read(self, iprot):
          iprot.readStructBegin()
          while True:
              (fname, ftype, fid) = iprot.readFieldBegin()
              if ftype == TType.STOP:
                  break
              if fid == 1:
                  if ftype == TType.I64:
                      self.ID = iprot.readI64()
                  else:
                      iprot.skip(ftype)
              elif fid == 2:
                  if ftype == TType.STRUCT:
                      self.Ev = Event()
                      self.Ev.read(iprot)
                  else:
                      iprot.skip(ftype)
              elif fid == 3:
                  if ftype == TType.LIST:
                      self.Events = []
                      (_, elem17) = iprot.readListBegin()
                      for _ in range(elem17):
                          elem18 = Event()
                          elem18.read(iprot)
                          self.Events.append(elem18)
                      iprot.readListEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 4:
                  if ftype == TType.SET:
                      self.Events2 = set()
                      (_, elem19) = iprot.readSetBegin()
                      for _ in range(elem19):
                          elem20 = Event()
                          elem20.read(iprot)
                          self.Events2.add(elem20)
                      iprot.readSetEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 5:
                  if ftype == TType.MAP:
                      self.EventMap = {}
                      (_, _, elem21) = iprot.readMapBegin()
                      for _ in range(elem21):
                          elem23 = iprot.readI64()
                          elem22 = Event()
                          elem22.read(iprot)
                          self.EventMap[elem23] = elem22
                      iprot.readMapEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 6:
                  if ftype == TType.LIST:
                      self.Nums = []
                      (_, elem24) = iprot.readListBegin()
                      for _ in range(elem24):
                          elem25 = []
                          (_, elem26) = iprot.readListBegin()
                          for _ in range(elem26):
                              elem27 = iprot.readI32()
                              elem25.append(elem27)
                          iprot.readListEnd()
                          self.Nums.append(elem25)
                      iprot.readListEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 7:
                  if ftype == TType.LIST:
                      self.Enums = []
                      (_, elem28) = iprot.readListBegin()
                      for _ in range(elem28):
                          elem29 = ItsAnEnum(iprot.readI32())
                          self.Enums.append(elem29)
                      iprot.readListEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 8:
                  if ftype == TType.BOOL:
                      self.aBoolField = iprot.readBool()
                  else:
                      iprot.skip(ftype)
              elif fid == 9:
                  if ftype == TType.STRUCT:
                      self.a_union = TestingUnions()
                      self.a_union.read(iprot)
                  else:
                      iprot.skip(ftype)
              elif fid == 10:
                  if ftype == TType.STRING:
                      self.typedefOfTypedef = iprot.readString()
                  else:
                      iprot.skip(ftype)
              elif fid == 11:
                  if ftype == TType.BOOL:
                      self.depr = iprot.readBool()
                  else:
                      iprot.skip(ftype)
              elif fid == 12:
                  if ftype == TType.STRING:
                      self.deprBinary = iprot.readBinary()
                  else:
                      iprot.skip(ftype)
              elif fid == 13:
                  if ftype == TType.LIST:
                      self.deprList = []
                      (_, elem30) = iprot.readListBegin()
                      for _ in range(elem30):
                          elem31 = iprot.readBool()
                          self.deprList.append(elem31)
                      iprot.readListEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 14:
                  if ftype == TType.LIST:
                      self.EventsDefault = []
                      (_, elem32) = iprot.readListBegin()
                      for _ in range(elem32):
                          elem33 = Event()
                          elem33.read(iprot)
                          self.EventsDefault.append(elem33)
                      iprot.readListEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 15:
                  if ftype == TType.MAP:
                      self.EventMapDefault = {}
                      (_, _, elem34) = iprot.readMapBegin()
                      for _ in range(elem34):
                          elem36 = iprot.readI64()
                          elem35 = Event()
                          elem35.read(iprot)
                          self.EventMapDefault[elem36] = elem35
                      iprot.readMapEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 16:
                  if ftype == TType.SET:
                      self.EventSetDefault = set()
                      (_, elem37) = iprot.readSetBegin()
                      for _ in range(elem37):
                          elem38 = Event()
                          elem38.read(iprot)
                          self.EventSetDefault.add(elem38)
                      iprot.readSetEnd()
                  else:
                      iprot.skip(ftype)
              else:
                  iprot.skip(ftype)
              iprot.readFieldEnd()
          iprot.readStructEnd()
          self.validate()
  
      def write(self, oprot):
          self.validate()
          oprot.writeStructBegin('EventWrapper')
          if self.ID is not None:
              oprot.writeFieldBegin('ID', TType.I64, 1)
              oprot.writeI64(self.ID)
              oprot.writeFieldEnd()
          if self.Ev is not None:
              oprot.writeFieldBegin('Ev', TType.STRUCT, 2)
              self.Ev.write(oprot)
              oprot.writeFieldEnd()
          if self.Events is not None:
              oprot.writeFieldBegin('Events', TType.LIST, 3)
              oprot.writeListBegin(TType.STRUCT, len(self.Events))
              for elem39 in self.Events:
                  elem39.write(oprot)
              oprot.writeListEnd()
              oprot.writeFieldEnd()
          if self.Events2 is not None:
              oprot.writeFieldBegin('Events2', TType.SET, 4)
              oprot.writeSetBegin(TType.STRUCT, len(self.Events2))
              for elem40 in self.Events2:
                  elem40.write(oprot)
              oprot.writeSetEnd()
              oprot.writeFieldEnd()
          if self.EventMap is not None:
              oprot.writeFieldBegin('EventMap', TType.MAP, 5)
              oprot.writeMapBegin(TType.I64, TType.STRUCT, len(self.EventMap))
              for elem42, elem41 in self.EventMap.items():
                  oprot.writeI64(elem42)
                  elem41.write(oprot)
              oprot.writeMapEnd()
              oprot.writeFieldEnd()
          if self.Nums is not None:
              oprot.writeFieldBegin('Nums', TType.LIST, 6)
              oprot.writeListBegin(TType.LIST, len(self.Nums))
              for elem43 in self.Nums:
                  oprot.writeListBegin(TType.I32, len(elem43))
                  for elem44 in elem43:
                      oprot.writeI32(elem44)
                  oprot.writeListEnd()
              oprot.writeListEnd()
              oprot.writeFieldEnd()
          if self.Enums is not None:
              oprot.writeFieldBegin('Enums', TType.LIST, 7)
              oprot.writeListBegin(TType.I32, len(self.Enums))
              for elem45 in self.Enums:
                  oprot.writeI32(elem45)
              oprot.writeListEnd()
              oprot.writeFieldEnd()
          if self.aBoolField is not None:
              oprot.writeFieldBegin('aBoolField', TType.BOOL, 8)
              oprot.writeBool(self.aBoolField)
              oprot.writeFieldEnd()
          if self.a_union is not None:
              oprot.writeFieldBegin('a_union', TType.STRUCT, 9)
              self.a_union.write(oprot)
              oprot.writeFieldEnd()
          if self.typedefOfTypedef is not None:
              oprot.writeFieldBegin('typedefOfTypedef', TType.STRING, 10)
              oprot.writeString(self.typedefOfTypedef)
              oprot.writeFieldEnd()
          if self.depr is not None:
              oprot.writeFieldBegin('depr', TType.BOOL, 11)
              oprot.writeBool(self.depr)
              oprot.writeFieldEnd()
          if self.deprBinary is not None:
              oprot.writeFieldBegin('deprBinary', TType.STRING, 12)
              oprot.writeBinary(self.deprBinary)
              oprot.writeFieldEnd()
          if self.deprList is not None:
              oprot.writeFieldBegin('deprList', TType.LIST, 13)
              oprot.writeListBegin(TType.BOOL, len(self.deprList))
              for elem46 in self.deprList:
                  oprot.writeBool(elem46)
              oprot.writeListEnd()
              oprot.writeFieldEnd()
          if self.EventsDefault is not None:
              oprot.writeFieldBegin('EventsDefault', TType.LIST, 14)
              oprot.writeListBegin(TType.STRUCT, len(self.EventsDefault))
              for elem47 in self.EventsDefault:
                  elem47.write(oprot)
              oprot.writeListEnd()
              oprot.writeFieldEnd()
          if self.EventMapDefault is not None:
              oprot.writeFieldBegin('EventMapDefault', TType.MAP, 15)
              oprot.writeMapBegin(TType.I64, TType.STRUCT, len(self.EventMapDefault))
              for elem49, elem48 in self.EventMapDefault.items():
                  oprot.writeI64(elem49)
                  elem48.write(oprot)
              oprot.writeMapEnd()
              oprot.writeFieldEnd()
          if self.EventSetDefault is not None:
              oprot.writeFieldBegin('EventSetDefault', TType.SET, 16)
              oprot.writeSetBegin(TType.STRUCT, len(self.EventSetDefault))
              for elem50 in self.EventSetDefault:
                  elem50.write(oprot)
              oprot.writeSetEnd()
              oprot.writeFieldEnd()
          oprot.writeFieldStop()
          oprot.writeStructEnd()
  
      def validate(self):
          if self.Ev is None:
              raise TProtocol.TProtocolException(type=TProtocol.TProtocolException.INVALID_DATA, message='Required field \'Ev\' is not present in struct \'EventWrapper\'')
          return
  
      def __hash__(self):
          value = 17
          value = (value * 31) ^ hash(make_hashable(self.ID))
          value = (value * 31) ^ hash(make_hashable(self.Ev))
          value = (value * 31) ^ hash(make_hashable(self.Events))
          value = (value * 31) ^ hash(make_hashable(self.Events2))
          value = (value * 31) ^ hash(make_hashable(self.EventMap))
          value = (value * 31) ^ hash(make_hashable(self.Nums))
          value = (value * 31) ^ hash(make_hashable(self.Enums))
          value = (value * 31) ^ hash(make_hashable(self.aBoolField))
          value = (value * 31) ^ hash(make_hashable(self.a_union))
          value = (value * 31) ^ hash(make_hashable(self.typedefOfTypedef))
          value = (value * 31) ^ hash(make_hashable(self.depr))
          value = (value * 31) ^ hash(make_hashable(self.deprBinary))
          value = (value * 31) ^ hash(make_hashable(self.deprList))
          value = (value * 31) ^ hash(make_hashable(self.EventsDefault))
          value = (value * 31) ^ hash(make_hashable(self.EventMapDefault))
          value = (value * 31) ^ hash(make_hashable(self.EventSetDefault))
          return value
  
      def __repr__(self):
          L = ['%s=%r' % (key, value)
              for key, value in self.__dict__.items()]
          return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  
      def __eq__(self, other):
          return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  
      def __ne__(self, other):
          return not (self == other)
  
  class FooArgs(object):
      """
      Attributes:
       - newMessage
       - messageArgs
       - messageResult
      """
      def __init__(self, newMessage=None, messageArgs=None, messageResult=None):
          self.newMessage = newMessage
          self.messageArgs = messageArgs
          self.messageResult = messageResult
  
      def read(self, iprot):
          iprot.readStructBegin()
          while True:
              (fname, ftype, fid) = iprot.readFieldBegin()
              if ftype == TType.STOP:
                  break
              if fid == 1:
                  if ftype == TType.STRING:
                      self.newMessage = iprot.readString()
                  else:
                      iprot.skip(ftype)
              elif fid == 2:
                  if ftype == TType.STRING:
                      self.messageArgs = iprot.readString()
                  else:
                      iprot.skip(ftype)
              elif fid == 3:
                  if ftype == TType.STRING:
                      self.messageResult = iprot.readString()
                  else:
                      iprot.skip(ftype)
              else:
                  iprot.skip(ftype)
              iprot.readFieldEnd()
          iprot.readStructEnd()
          self.validate()
  
      def write(self, oprot):
          self.validate()
          oprot.writeStructBegin('FooArgs')
          if self.newMessage is not None:
              oprot.writeFieldBegin('newMessage', TType.STRING, 1)
              oprot.writeString(self.newMessage)
              oprot.writeFieldEnd()
          if self.messageArgs is not None:
              oprot.writeFieldBegin('messageArgs', TType.STRING, 2)
              oprot.writeString(self.messageArgs)
              oprot.writeFieldEnd()
          if self.messageResult is not None:
              oprot.writeFieldBegin('messageResult', TType.STRING, 3)
              oprot.writeString(self.messageResult)
              oprot.writeFieldEnd()
          oprot.writeFieldStop()
          oprot.writeStructEnd()
  
      def validate(self):
          return
  
      def __hash__(self):
          value = 17
          value = (value * 31) ^ hash(make_hashable(self.newMessage))
          value = (value * 31) ^ hash(make_hashable(self.messageArgs))
          value = (value * 31) ^ hash(make_hashable(self.messageResult))
          return value
  
      def __repr__(self):
          L = ['%s=%r' % (key, value)
              for key, value in self.__dict__.items()]
          return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  
      def __eq__(self, other):
          return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  
      def __ne__(self, other):
          return not (self == other)
  
  class TestingUnions(object):
      """
      Attributes:
       - AnID
       - aString
       - someotherthing
       - AnInt16
       - Requests
       - bin_field_in_union
       - depr
         Deprecated: use something else
      """
      def __init__(self, AnID=None, aString=None, someotherthing=None, AnInt16=None, Requests=None, bin_field_in_union=None, depr=None):
          self.AnID = AnID
          self.aString = aString
          self.someotherthing = someotherthing
          self.AnInt16 = AnInt16
          self.Requests = Requests
          self.bin_field_in_union = bin_field_in_union
          self.depr = depr
  
      def read(self, iprot):
          iprot.readStructBegin()
          while True:
              (fname, ftype, fid) = iprot.readFieldBegin()
              if ftype == TType.STOP:
                  break
              if fid == 1:
                  if ftype == TType.I64:
                      self.AnID = iprot.readI64()
                  else:
                      iprot.skip(ftype)
              elif fid == 2:
                  if ftype == TType.STRING:
                      self.aString = iprot.readString()
                  else:
                      iprot.skip(ftype)
              elif fid == 3:
                  if ftype == TType.I32:
                      self.someotherthing = iprot.readI32()
                  else:
                      iprot.skip(ftype)
              elif fid == 4:
                  if ftype == TType.I16:
                      self.AnInt16 = iprot.readI16()
                  else:
                      iprot.skip(ftype)
              elif fid == 5:
                  if ftype == TType.MAP:
                      self.Requests = {}
                      (_, _, elem51) = iprot.readMapBegin()
                      for _ in range(elem51):
                          elem53 = iprot.readI32()
                          elem52 = iprot.readString()
                          self.Requests[elem53] = elem52
                      iprot.readMapEnd()
                  else:
                      iprot.skip(ftype)
              elif fid == 6:
                  if ftype == TType.STRING:
                      self.bin_field_in_union = iprot.readBinary()
                  else:
                      iprot.skip(ftype)
              elif fid == 7:
                  if ftype == TType.BOOL:
                      self.depr = iprot.readBool()
                  else:
                      iprot.skip(ftype)
              else:
                  iprot.skip(ftype)
              iprot.readFieldEnd()
          iprot.readStructEnd()
          self.validate()
  
      def write(self, oprot):
          self.validate()
          oprot.writeStructBegin('TestingUnions')
          if self.AnID is not None:
              oprot.writeFieldBegin('AnID', TType.I64, 1)
              oprot.writeI64(self.AnID)
              oprot.writeFieldEnd()
          if self.aString is not None:
              oprot.writeFieldBegin('aString', TType.STRING, 2)
              oprot.writeString(self.aString)
              oprot.writeFieldEnd()
          if self.someotherthing is not None:
              oprot.writeFieldBegin('someotherthing', TType.I32, 3)
              oprot.writeI32(self.someotherthing)
              oprot.writeFieldEnd()
          if self.AnInt16 is not None:
              oprot.writeFieldBegin('AnInt16', TType.I16, 4)
              oprot.writeI16(self.AnInt16)
              oprot.writeFieldEnd()
          if self.Requests is not None:
              oprot.writeFieldBegin('Requests', TType.MAP, 5)
              oprot.writeMapBegin(TType.I32, TType.STRING, len(self.Requests))
              for elem55, elem54 in self.Requests.items():
                  oprot.writeI32(elem55)
                  oprot.writeString(elem54)
              oprot.writeMapEnd()
              oprot.writeFieldEnd()
          if self.bin_field_in_union is not None:
              oprot.writeFieldBegin('bin_field_in_union', TType.STRING, 6)
              oprot.writeBinary(self.bin_field_in_union)
              oprot.writeFieldEnd()
          if self.depr is not None:
              oprot.writeFieldBegin('depr', TType.BOOL, 7)
              oprot.writeBool(self.depr)
              oprot.writeFieldEnd()
          oprot.writeFieldStop()
          oprot.writeStructEnd()
  
      def validate(self):
          set_fields = 0
          if self.AnID is not None:
              set_fields += 1
          if self.aString is not None:
              set_fields += 1
          if self.someotherthing is not None:
              set_fields += 1
          if self.AnInt16 is not None:
              set_fields += 1
          if self.Requests is not None:
              set_fields += 1
          if self.bin_field_in_union is not None:
              set_fields += 1
          if self.depr is not None:
              set_fields += 1
          if set_fields != 1:
              raise TProtocol.TProtocolException(type=TProtocol.TProtocolException.INVALID_DATA, message='The union did not have exactly one field set, {} were set'.format(set_fields))
          return
  
      def __hash__(self):
          value = 17
          value = (value * 31) ^ hash(make_hashable(self.AnID))
          value = (value * 31) ^ hash(make_hashable(self.aString))
          value = (value * 31) ^ hash(make_hashable(self.someotherthing))
          value = (value * 31) ^ hash(make_hashable(self.AnInt16))
          value = (value * 31) ^ hash(make_hashable(self.Requests))
          value = (value * 31) ^ hash(make_hashable(self.bin_field_in_union))
          value = (value * 31) ^ hash(make_hashable(self.depr))
          return value
  
      def __repr__(self):
          L = ['%s=%r' % (key, value)
              for key, value in self.__dict__.items()]
          return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  
      def __eq__(self, other):
          return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  
      def __ne__(self, other):
          return not (self == other)
  
  class AwesomeException(TException):
      """
      Attributes:
       - ID: ID is a unique identifier for an awesome exception.
       - Reason: Reason contains the error message.
       - depr
         Deprecated: use something else
      """
      def __init__(self, ID=None, Reason=None, depr=None):
          self.ID = ID
          self.Reason = Reason
          self.depr = depr
  
      def read(self, iprot):
          iprot.readStructBegin()
          while True:
              (fname, ftype, fid) = iprot.readFieldBegin()
              if ftype == TType.STOP:
                  break
              if fid == 1:
                  if ftype == TType.I64:
                      self.ID = iprot.readI64()
                  else:
                      iprot.skip(ftype)
              elif fid == 2:
                  if ftype == TType.STRING:
                      self.Reason = iprot.readString()
                  else:
                      iprot.skip(ftype)
              elif fid == 3:
                  if ftype == TType.BOOL:
                      self.depr = iprot.readBool()
                  else:
                      iprot.skip(ftype)
              else:
                  iprot.skip(ftype)
              iprot.readFieldEnd()
          iprot.readStructEnd()
          self.validate()
  
      def write(self, oprot):
          self.validate()
          oprot.writeStructBegin('AwesomeException')
          if self.ID is not None:
              oprot.writeFieldBegin('ID', TType.I64, 1)
              oprot.writeI64(self.ID)
              oprot.writeFieldEnd()
          if self.Reason is not None:
              oprot.writeFieldBegin('Reason', TType.STRING, 2)
              oprot.writeString(self.Reason)
              oprot.writeFieldEnd()
          if self.depr is not None:
              oprot.writeFieldBegin('depr', TType.BOOL, 3)
              oprot.writeBool(self.depr)
              oprot.writeFieldEnd()
          oprot.writeFieldStop()
          oprot.writeStructEnd()
  
      def validate(self):
          return
  
      def __str__(self):
          return repr(self)
  
      def __hash__(self):
          value = 17
          value = (value * 31) ^ hash(make_hashable(self.ID))
          value = (value * 31) ^ hash(make_hashable(self.Reason))
          value = (value * 31) ^ hash(make_hashable(self.depr))
          return value
  
      def __repr__(self):
          L = ['%s=%r' % (key, value)
              for key, value in self.__dict__.items()]
          return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  
      def __eq__(self, other):
          return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  
      def __ne__(self, other):
          return not (self == other)
  
  