text: #
  # Autogenerated by Thrift Compiler (0.9.0)
  #
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  #
  #  options string: py
  #
  
  from thrift.Thrift import TType, TMessageType, TException, TApplicationException
  
  from thrift.transport import TTransport
  from thrift.protocol import TBinaryProtocol, TProtocol
  try:
    from thrift.protocol import fastbinary
  except:
    fastbinary = None
  
  
  class TEdgeType:
    PROJECTION = 0
    PREDICATE = 1
  
    _VALUES_TO_NAMES = {
      0: "PROJECTION",
      1: "PREDICATE",
    }
  
    _NAMES_TO_VALUES = {
      "PROJECTION": 0,
      "PREDICATE": 1,
    }
  
  
  class TVertex:
    """
    Attributes:
     - id
     - label
    """
  
    thrift_spec = (
      None, # 0
      (1, TType.I64, 'id', None, None, ), # 1
      (2, TType.STRING, 'label', None, None, ), # 2
    )
  
    def __init__(self, id=None, label=None,):
      self.id = id
      self.label = label
  
    def read(self, iprot):
      if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
        fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
        return
      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.label = iprot.readString();
          else:
            iprot.skip(ftype)
        else:
          iprot.skip(ftype)
        iprot.readFieldEnd()
      iprot.readStructEnd()
  
    def write(self, oprot):
      if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
        return
      oprot.writeStructBegin('TVertex')
      if self.id is not None:
        oprot.writeFieldBegin('id', TType.I64, 1)
        oprot.writeI64(self.id)
        oprot.writeFieldEnd()
      if self.label is not None:
        oprot.writeFieldBegin('label', TType.STRING, 2)
        oprot.writeString(self.label)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
  
    def validate(self):
      if self.id is None:
        raise TProtocol.TProtocolException(message='Required field id is unset!')
      if self.label is None:
        raise TProtocol.TProtocolException(message='Required field label is unset!')
      return
  
  
    def __repr__(self):
      L = ['%s=%r' % (key, value)
        for key, value in self.__dict__.iteritems()]
      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 TMultiEdge:
    """
    Attributes:
     - sources
     - targets
     - edgetype
    """
  
    thrift_spec = (
      None, # 0
      (1, TType.LIST, 'sources', (TType.STRUCT,(TVertex, TVertex.thrift_spec)), None, ), # 1
      (2, TType.LIST, 'targets', (TType.STRUCT,(TVertex, TVertex.thrift_spec)), None, ), # 2
      (3, TType.I32, 'edgetype', None, None, ), # 3
    )
  
    def __init__(self, sources=None, targets=None, edgetype=None,):
      self.sources = sources
      self.targets = targets
      self.edgetype = edgetype
  
    def read(self, iprot):
      if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
        fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
        return
      iprot.readStructBegin()
      while True:
        (fname, ftype, fid) = iprot.readFieldBegin()
        if ftype == TType.STOP:
          break
        if fid == 1:
          if ftype == TType.LIST:
            self.sources = []
            (_etype3, _size0) = iprot.readListBegin()
            for _i4 in xrange(_size0):
              _elem5 = TVertex()
              _elem5.read(iprot)
              self.sources.append(_elem5)
            iprot.readListEnd()
          else:
            iprot.skip(ftype)
        elif fid == 2:
          if ftype == TType.LIST:
            self.targets = []
            (_etype9, _size6) = iprot.readListBegin()
            for _i10 in xrange(_size6):
              _elem11 = TVertex()
              _elem11.read(iprot)
              self.targets.append(_elem11)
            iprot.readListEnd()
          else:
            iprot.skip(ftype)
        elif fid == 3:
          if ftype == TType.I32:
            self.edgetype = iprot.readI32();
          else:
            iprot.skip(ftype)
        else:
          iprot.skip(ftype)
        iprot.readFieldEnd()
      iprot.readStructEnd()
  
    def write(self, oprot):
      if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
        return
      oprot.writeStructBegin('TMultiEdge')
      if self.sources is not None:
        oprot.writeFieldBegin('sources', TType.LIST, 1)
        oprot.writeListBegin(TType.STRUCT, len(self.sources))
        for iter12 in self.sources:
          iter12.write(oprot)
        oprot.writeListEnd()
        oprot.writeFieldEnd()
      if self.targets is not None:
        oprot.writeFieldBegin('targets', TType.LIST, 2)
        oprot.writeListBegin(TType.STRUCT, len(self.targets))
        for iter13 in self.targets:
          iter13.write(oprot)
        oprot.writeListEnd()
        oprot.writeFieldEnd()
      if self.edgetype is not None:
        oprot.writeFieldBegin('edgetype', TType.I32, 3)
        oprot.writeI32(self.edgetype)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
  
    def validate(self):
      return
  
  
    def __repr__(self):
      L = ['%s=%r' % (key, value)
        for key, value in self.__dict__.iteritems()]
      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 TLineageGraph:
    """
    Attributes:
     - query_text
     - hash
     - user
     - started
     - ended
     - edges
     - vertices
    """
  
    thrift_spec = (
      None, # 0
      (1, TType.STRING, 'query_text', None, None, ), # 1
      (2, TType.STRING, 'hash', None, None, ), # 2
      (3, TType.STRING, 'user', None, None, ), # 3
      (4, TType.I64, 'started', None, None, ), # 4
      (5, TType.I64, 'ended', None, None, ), # 5
      (6, TType.LIST, 'edges', (TType.STRUCT,(TMultiEdge, TMultiEdge.thrift_spec)), None, ), # 6
      (7, TType.LIST, 'vertices', (TType.STRUCT,(TVertex, TVertex.thrift_spec)), None, ), # 7
    )
  
    def __init__(self, query_text=None, hash=None, user=None, started=None, ended=None, edges=None, vertices=None,):
      self.query_text = query_text
      self.hash = hash
      self.user = user
      self.started = started
      self.ended = ended
      self.edges = edges
      self.vertices = vertices
  
    def read(self, iprot):
      if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
        fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
        return
      iprot.readStructBegin()
      while True:
        (fname, ftype, fid) = iprot.readFieldBegin()
        if ftype == TType.STOP:
          break
        if fid == 1:
          if ftype == TType.STRING:
            self.query_text = iprot.readString();
          else:
            iprot.skip(ftype)
        elif fid == 2:
          if ftype == TType.STRING:
            self.hash = iprot.readString();
          else:
            iprot.skip(ftype)
        elif fid == 3:
          if ftype == TType.STRING:
            self.user = iprot.readString();
          else:
            iprot.skip(ftype)
        elif fid == 4:
          if ftype == TType.I64:
            self.started = iprot.readI64();
          else:
            iprot.skip(ftype)
        elif fid == 5:
          if ftype == TType.I64:
            self.ended = iprot.readI64();
          else:
            iprot.skip(ftype)
        elif fid == 6:
          if ftype == TType.LIST:
            self.edges = []
            (_etype17, _size14) = iprot.readListBegin()
            for _i18 in xrange(_size14):
              _elem19 = TMultiEdge()
              _elem19.read(iprot)
              self.edges.append(_elem19)
            iprot.readListEnd()
          else:
            iprot.skip(ftype)
        elif fid == 7:
          if ftype == TType.LIST:
            self.vertices = []
            (_etype23, _size20) = iprot.readListBegin()
            for _i24 in xrange(_size20):
              _elem25 = TVertex()
              _elem25.read(iprot)
              self.vertices.append(_elem25)
            iprot.readListEnd()
          else:
            iprot.skip(ftype)
        else:
          iprot.skip(ftype)
        iprot.readFieldEnd()
      iprot.readStructEnd()
  
    def write(self, oprot):
      if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
        return
      oprot.writeStructBegin('TLineageGraph')
      if self.query_text is not None:
        oprot.writeFieldBegin('query_text', TType.STRING, 1)
        oprot.writeString(self.query_text)
        oprot.writeFieldEnd()
      if self.hash is not None:
        oprot.writeFieldBegin('hash', TType.STRING, 2)
        oprot.writeString(self.hash)
        oprot.writeFieldEnd()
      if self.user is not None:
        oprot.writeFieldBegin('user', TType.STRING, 3)
        oprot.writeString(self.user)
        oprot.writeFieldEnd()
      if self.started is not None:
        oprot.writeFieldBegin('started', TType.I64, 4)
        oprot.writeI64(self.started)
        oprot.writeFieldEnd()
      if self.ended is not None:
        oprot.writeFieldBegin('ended', TType.I64, 5)
        oprot.writeI64(self.ended)
        oprot.writeFieldEnd()
      if self.edges is not None:
        oprot.writeFieldBegin('edges', TType.LIST, 6)
        oprot.writeListBegin(TType.STRUCT, len(self.edges))
        for iter26 in self.edges:
          iter26.write(oprot)
        oprot.writeListEnd()
        oprot.writeFieldEnd()
      if self.vertices is not None:
        oprot.writeFieldBegin('vertices', TType.LIST, 7)
        oprot.writeListBegin(TType.STRUCT, len(self.vertices))
        for iter27 in self.vertices:
          iter27.write(oprot)
        oprot.writeListEnd()
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
  
    def validate(self):
      if self.query_text is None:
        raise TProtocol.TProtocolException(message='Required field query_text is unset!')
      if self.hash is None:
        raise TProtocol.TProtocolException(message='Required field hash is unset!')
      if self.user is None:
        raise TProtocol.TProtocolException(message='Required field user is unset!')
      if self.started is None:
        raise TProtocol.TProtocolException(message='Required field started is unset!')
      return
  
  
    def __repr__(self):
      L = ['%s=%r' % (key, value)
        for key, value in self.__dict__.iteritems()]
      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)
  