blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
616
content_id
stringlengths
40
40
detected_licenses
listlengths
0
69
license_type
stringclasses
2 values
repo_name
stringlengths
5
118
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
63
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
2.91k
686M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
23 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
213 values
src_encoding
stringclasses
30 values
language
stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
2
10.3M
extension
stringclasses
246 values
content
stringlengths
2
10.3M
authors
listlengths
1
1
author_id
stringlengths
0
212
ef467bca48eebe77e034672f59ad0d7f8f0914da
57b4ee27801c23cdd6a6d974dbc278f49740f770
/0CTF_monkey.py
b6c42ded368e7a888c38de1f5bf4e6114416a26c
[]
no_license
zwhubuntu/CTF-chal-code
4de9fc0fe9ee85eab3906b36b8798ec959db628c
8c912e165f9cc294b3b85fab3d776cd63acc203e
refs/heads/master
2021-01-20T18:39:26.961563
2017-09-25T14:07:56
2017-09-25T14:07:56
62,563,092
7
2
null
null
null
null
UTF-8
Python
false
false
585
py
''' Created on 2016-3-12 @author: wenhuizone ''' import itertools,hashlib test='' if __name__ == '__main__': chars = '0123456789abcdefghijklmnopqrstuvwxyz_{}()!@#$%^&*[] ' print "cracking....." for t in itertools.product(chars, repeat=5): w = ''.join(t) # print w test=hashlib.md5(w).hexdigest() #print str if test[0:6]=='2bcf21': # if hashlib.md5(test).hexdigest()=='0e408306536730731920197920342119': print "secret is :" print w print "accomplished!" break print "not found!"
[ "zwhubuntu@hotmail.com" ]
zwhubuntu@hotmail.com
162a693e0392a3ae21c96a1416cd8980fb3c2af3
4dfa6232cf91f1c04d50809915078dc71fb371b4
/python_module/test/unit/module/test_batchnorm.py
7f1b1b04a2a257bb51d9d399a8be48fb04e8f52c
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
hookex/MegEngine
81c0539a3247873bdabe0e6f22e265e22249e98a
47fd33880d2db3cae98c55911bb29328cdd5d7e4
refs/heads/master
2022-08-01T02:04:06.431689
2020-05-22T11:10:17
2020-05-22T11:10:17
250,200,281
1
0
NOASSERTION
2020-03-26T08:22:39
2020-03-26T08:22:39
null
UTF-8
Python
false
false
5,952
py
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. import numpy as np import pytest import megengine as mge from megengine.core import tensor from megengine.module import BatchNorm1d, BatchNorm2d from megengine.test import assertTensorClose def test_batchnorm(): nr_chan = 8 data_shape = (3, nr_chan, 4) momentum = 0.9 bn = BatchNorm1d(nr_chan, momentum=momentum) running_mean = np.zeros((1, nr_chan, 1), dtype=np.float32) running_var = np.ones((1, nr_chan, 1), dtype=np.float32) data = tensor() for i in range(3): xv = np.random.normal(loc=2.3, size=data_shape).astype(np.float32) mean = np.mean(np.mean(xv, axis=0, keepdims=True), axis=2, keepdims=True) xv_transposed = np.transpose(xv, [0, 2, 1]).reshape( (data_shape[0] * data_shape[2], nr_chan) ) var_biased = np.var(xv_transposed, axis=0).reshape((1, nr_chan, 1)) sd = np.sqrt(var_biased + bn.eps) var_unbiased = np.var(xv_transposed, axis=0, ddof=1).reshape((1, nr_chan, 1)) running_mean = running_mean * momentum + mean * (1 - momentum) running_var = running_var * momentum + var_unbiased * (1 - momentum) data.set_value(xv) yv = bn(data) yv_expect = (xv - mean) / sd assertTensorClose(yv_expect, yv.numpy(), max_err=5e-6) assertTensorClose( running_mean.reshape(-1), bn.running_mean.numpy().reshape(-1), max_err=5e-6 ) assertTensorClose( running_var.reshape(-1), bn.running_var.numpy().reshape(-1), max_err=5e-6 ) # test set 'training' flag to False mean_backup = bn.running_mean.numpy() var_backup = bn.running_var.numpy() bn.training = False xv = np.random.normal(loc=2.3, size=data_shape).astype(np.float32) data.set_value(xv) yv1 = bn(data) yv2 = bn(data) assertTensorClose(yv1.numpy(), yv2.numpy(), max_err=0) assertTensorClose(mean_backup, bn.running_mean.numpy(), max_err=0) assertTensorClose(var_backup, bn.running_var.numpy(), max_err=0) yv_expect = (xv - running_mean) / np.sqrt(running_var + bn.eps) assertTensorClose(yv_expect, yv1.numpy(), max_err=5e-6) def test_batchnorm2d(): nr_chan = 8 data_shape = (3, nr_chan, 16, 16) momentum = 0.9 bn = BatchNorm2d(nr_chan, momentum=momentum) running_mean = np.zeros((1, nr_chan, 1, 1), dtype=np.float32) running_var = np.ones((1, nr_chan, 1, 1), dtype=np.float32) data = tensor() for i in range(3): xv = np.random.normal(loc=2.3, size=data_shape).astype(np.float32) xv_transposed = np.transpose(xv, [0, 2, 3, 1]).reshape( (data_shape[0] * data_shape[2] * data_shape[3], nr_chan) ) mean = np.mean(xv_transposed, axis=0).reshape(1, nr_chan, 1, 1) var_biased = np.var(xv_transposed, axis=0).reshape((1, nr_chan, 1, 1)) sd = np.sqrt(var_biased + bn.eps) var_unbiased = np.var(xv_transposed, axis=0, ddof=1).reshape((1, nr_chan, 1, 1)) running_mean = running_mean * momentum + mean * (1 - momentum) running_var = running_var * momentum + var_unbiased * (1 - momentum) data.set_value(xv) yv = bn(data) yv_expect = (xv - mean) / sd assertTensorClose(yv_expect, yv.numpy(), max_err=5e-6) assertTensorClose(running_mean, bn.running_mean.numpy(), max_err=5e-6) assertTensorClose(running_var, bn.running_var.numpy(), max_err=5e-6) # test set 'training' flag to False mean_backup = bn.running_mean.numpy() var_backup = bn.running_var.numpy() bn.training = False xv = np.random.normal(loc=2.3, size=data_shape).astype(np.float32) data.set_value(xv) yv1 = bn(data) yv2 = bn(data) assertTensorClose(yv1.numpy(), yv2.numpy(), max_err=0) assertTensorClose(mean_backup, bn.running_mean.numpy(), max_err=0) assertTensorClose(var_backup, bn.running_var.numpy(), max_err=0) yv_expect = (xv - running_mean) / np.sqrt(running_var + bn.eps) assertTensorClose(yv_expect, yv1.numpy(), max_err=5e-6) def test_batchnorm_no_stats(): nr_chan = 8 data_shape = (3, nr_chan, 4) bn = BatchNorm1d(8, track_running_stats=False) data = tensor() for i in range(4): if i == 2: bn.training = False xv = np.random.normal(loc=2.3, size=data_shape).astype(np.float32) mean = np.mean(np.mean(xv, axis=0, keepdims=True), axis=2, keepdims=True) var = np.var( np.transpose(xv, [0, 2, 1]).reshape( (data_shape[0] * data_shape[2], nr_chan) ), axis=0, ).reshape((1, nr_chan, 1)) sd = np.sqrt(var + bn.eps) data.set_value(xv) yv = bn(data) yv_expect = (xv - mean) / sd assertTensorClose(yv_expect, yv.numpy(), max_err=5e-6) def test_batchnorm2d_no_stats(): nr_chan = 8 data_shape = (3, nr_chan, 16, 16) bn = BatchNorm2d(8, track_running_stats=False) data = tensor() for i in range(4): if i == 2: bn.training = False xv = np.random.normal(loc=2.3, size=data_shape).astype(np.float32) xv_transposed = np.transpose(xv, [0, 2, 3, 1]).reshape( (data_shape[0] * data_shape[2] * data_shape[3], nr_chan) ) mean = np.mean(xv_transposed, axis=0).reshape(1, nr_chan, 1, 1) var = np.var(xv_transposed, axis=0).reshape((1, nr_chan, 1, 1)) sd = np.sqrt(var + bn.eps) data.set_value(xv) yv = bn(data) yv_expect = (xv - mean) / sd assertTensorClose(yv_expect, yv.numpy(), max_err=5e-6)
[ "megengine@megvii.com" ]
megengine@megvii.com
ddcabf5550bee338cf143d60b1f0f8e2e9dd7548
ad40134e2e3114b99d579286da5fe07afcca207d
/reindeergames.py
0f3b1aaeb9c3768369f7882ec751956b072e1ef7
[]
no_license
mamday/scripts
b645f061a0400f48ae6f37672de22e45a44b7dca
ba5a987879ecab2d873e01b69df114fc3227da55
refs/heads/master
2021-01-24T10:12:37.568669
2017-10-05T03:48:42
2017-10-05T03:48:42
44,767,372
0
0
null
null
null
null
UTF-8
Python
false
false
1,856
py
import sys import copy from copy import deepcopy r_list = [{'speed':8,'m_time':8,'res_time':53,'r_dist':0,'r_base':0,'r_time':0}, {'speed':13,'m_time':4,'res_time':49,'r_dist':0,'r_base':0,'r_time':0}, {'speed':20,'m_time':7,'res_time':132,'r_dist':0,'r_base':0,'r_time':0}, {'speed':12,'m_time':4,'res_time':43,'r_dist':0,'r_base':0,'r_time':0}, {'speed':9,'m_time':5,'res_time':38,'r_dist':0,'r_base':0,'r_time':0}, {'speed':10,'m_time':4,'res_time':37,'r_dist':0,'r_base':0,'r_time':0}, {'speed':3,'m_time':37,'res_time':76,'r_dist':0,'r_base':0,'r_time':0}, {'speed':9,'m_time':12,'res_time':97,'r_dist':0,'r_base':0,'r_time':0}, {'speed':37,'m_time':1,'res_time':36,'r_dist':0,'r_base':0,'r_time':0}] #r_list=[{'speed':14,'m_time':10,'res_time':127,'r_dist':0,'r_base':0,'r_time':0}, #{'speed':16,'m_time':11,'res_time':162,'r_dist':0,'r_base':0,'r_time':0}] r_time = int(sys.argv[1]) def TrackDeer(in_dict1,in_time): for i in xrange(1,in_time+1): DistCalc(in_dict1) def DistCalc(in_dict): in_dict['r_time']+=1 if(in_dict['r_time']==in_dict['m_time']): in_dict['r_base']+=(in_dict['m_time']*in_dict['speed']) in_dict['r_dist']=in_dict['r_base'] elif(in_dict['r_time']<in_dict['m_time']): in_dict['r_dist']=in_dict['r_base']+(in_dict['r_time']*in_dict['speed']) if(in_dict['r_time']==in_dict['m_time']+in_dict['res_time']): in_dict['r_time']=0 score = [0 for i in r_list] for i_time in xrange(1,r_time+1): n_list = deepcopy(r_list) win_list = [] for rdeer in n_list: TrackDeer(rdeer,i_time) win_list.append(rdeer['r_dist']) winner = max(win_list) if(len([i for i in win_list if(i==winner)])==1): win_ind=win_list.index(winner) score[win_ind]+=1 else: for ind,val in enumerate(win_list): if(val==winner): score[ind]+=1 #print score,winner,win_list,i_time print score
[ "m.amday@gmail.com" ]
m.amday@gmail.com
69bba9d656616befba7ab765730050172ddb641f
548839b575be41eb2eef827ce1ce75d5592db87a
/semana-09/Extra/2-2-sin_senales.py
fc1a46d3af74d091d8587cb853aeef205a3803c4
[]
no_license
fpaez7/contenidos
52287ec4240eaf6f3b6c64f86c654f070f6c1c3b
db9b74781294eb699a9e4d43640fbf07bb78bf16
refs/heads/master
2022-04-16T18:10:29.729349
2020-03-24T21:09:51
2020-03-24T21:09:51
202,588,563
0
0
null
null
null
null
UTF-8
Python
false
false
2,896
py
from PyQt5.QtWidgets import QLabel, QMainWindow, QApplication from PyQt5.QtCore import QThread, QTimer from PyQt5.QtGui import QPixmap from time import sleep from random import randint class Food(QThread): def __init__(self, parent, x, y, max_width, max_height): """ Un Food es un QThread que movera una imagen de comida en una ventana. El __init__ recibe los parametros: parent: ventana x e y: posicion inicial en la ventana """ super().__init__() # Guardamos el path de la imagen que tendrá el Label self.food_image = "images/food/{}.png".format(randint(1, 9)) # Creamos el Label y definimos su tamaño self.label = QLabel(parent) self.label.setGeometry(x, y, 50, 50) self.label.setPixmap(QPixmap(self.food_image)) self.label.setScaledContents(True) self.label.show() self.label.setVisible(True) # Seteamos la posición inicial y la guardamos para usarla como una property self.__position = (0, 0) self.position = (x, y) #Guardamos los limites de la ventana para que no pueda salirse de ella self.max_width = max_width self.max_height = max_height self.start() @property def position(self): return self.__position @position.setter def position(self, value): self.__position = value self.label.move(*self.position) def run(self): while True: sleep(0.1) new_x = self.position[0] + 1 if new_x > self.max_width: new_x = randint(0, self.max_width) new_y = self.position[1] + 1 if new_y > self.max_height: new_y = randint(0, self.max_height) self.position = (new_x, new_y) class MyWindow(QMainWindow): def __init__(self): super().__init__() self.titulo = QLabel(self) self.titulo.setText("Ejemplo") self.titulo.move(160, 10) self.titulo.show() self.setGeometry(100, 100, 600, 600) self.show() # Contador de cuanta comida hemos creado self.food_created = 0 # Creamos un Timer que se encargara de crear la comida self.food_creator_timer = QTimer(self) self.food_creator_timer.timeout.connect(self.food_creator) self.food_creator_timer.start(50) self.foods = [] def food_creator(self): new_food = Food(parent=self, x=randint(0, self.width()), y=randint(0, self.height()), max_width=self.width(), max_height=self.height()) self.foods.append(new_food) self.food_created += 1 print("Has creado {} unidades de comida\n".format(self.food_created)) if __name__ == '__main__': app = QApplication([]) ex = MyWindow() app.exec_()
[ "fpaez1@uc.cl" ]
fpaez1@uc.cl
c0af91abcbacbb0d27b4e56aab17dcf7fa001e01
a7f4cffdd43bc94c1f8b2a989537331aaedcd63f
/POCs/RegressionAnalysis/LinearRegression.py
9aef9439847fc60711c68481a60569cc4b770c32
[ "Apache-2.0" ]
permissive
rkthakur/mediamixmodeling
57753670ad1add5917467d6e684031f75b0467db
a9438381c411fcbd33824529986aa6f34d97b4d0
refs/heads/development
2022-12-15T03:00:26.168473
2020-02-10T17:34:17
2020-02-10T17:34:17
61,939,680
23
7
Apache-2.0
2022-12-09T05:49:29
2016-06-25T11:09:55
JavaScript
UTF-8
Python
false
false
2,897
py
import pymongo from pymongo import MongoClient import json import time from datetime import datetime # imports import pandas as pd import matplotlib.pyplot as plt # this allows plots to appear directly in the notebook import matplotlib.pyplot as plt import statsmodels.formula.api as smf # Connect mongodb client = MongoClient() client = MongoClient("mongodb://localhost:27017/") #load Sample date for media mix modeling db = client.mediamixmodeling collection = db.SampleData data = pd.DataFrame(list(collection.find())) # read data into a DataFrame dependentVariable ="Sales" features = "TV + Radio + Newspaper" # create a fitted model with all three features lm = smf.ols(formula=dependentVariable+" ~ "+features, data=data).fit() # Summarize the model lm.summary() # Calcualte Vertical Sum of DataFrame dSum = data.sum(axis=0) dSum = json.loads(dSum.to_json()) curr_datetime = datetime.today() params = json.loads(lm.params.to_json()) bse = json.loads(lm.bse.to_json()) pvalues = json.loads(lm.pvalues.to_json()) conf_int = json.loads(lm.conf_int().to_json()) diagn = lm.diagn uid = datetime.now().strftime("%Y%m%d%H%M%S%Z") # Prepare testModel data testModelData = "[" featuresShare = 0 for key, value in params.items(): if value > 0: # Ignore negative coef if key != "Intercept": # Ignore Intercept feature featuresShare=featuresShare+value rec = '{"media":"'+key+'", "share" :'+str(dSum.get(dependentVariable)*value)+"}," testModelData = testModelData+rec #testModelData = testModelData+'"'+key+'" :'+str(dSum.get(dependentVariable)*value)+"," baseSales = (dSum.get(dependentVariable) * (1 - featuresShare)) rec = '{"media":"Base Sales", "share" :'+str(baseSales)+"}]" testModelData = testModelData+rec #'"Base Sales":'+str(baseSales)+"}" testModelData = json.loads(testModelData) # Prepare model JSON model = {"_id" : uid, "summary" : [{ "head": { "cov_type": "nonrobust", "method": "Least Squares", "aic": lm.aic, "datetime": curr_datetime, "bic": lm.bic, "f_statistic": "lm.F-statistic", "df_model": lm.df_model, "dep_var": dependentVariable, "features": features, "no_of_observations": data.shape[0] - 1, "rsquared": lm.rsquared, "llf": lm.llf, "model": "OLS", "rsquared_adj": lm.rsquared_adj, "df_resid": lm.df_resid, "fvalue": lm.fvalue } }, { "values": { "params": params, "conf_int": conf_int, "bse": bse, "pvalues": pvalues } }, { "diagn": diagn }], "modelResult" : testModelData } result = db.mixModels.insert_one(model) result = db.mixModels.update_many({},{"$set" : {"isActive": "NO"}}) result = db.mixModels.update_many({"_id": uid},{"$set" : {"isActive": "YES"}}) #db.getCollection('mixModels').find({}).sort({_id:-1}).limit(1) print(result.raw_result['ok'])
[ "rthakur@sapient.com" ]
rthakur@sapient.com
23346caa347aaaa963958b7c4215bb7e724269fe
060ee3619ef23ab6e1f332ed9e445f132c8065d4
/talkProject/wsgi.py
777cf6a350193f32e23637ae33e3b6bff65c433c
[]
no_license
venothx7/talkDjango
788fe95b3a11574bcc31d4e5def50943b9f23964
bb0113465eb9638e11606b237aad8060696f85e3
refs/heads/master
2020-06-01T02:47:27.086580
2019-06-06T15:20:56
2019-06-06T15:20:56
190,603,020
0
0
null
null
null
null
UTF-8
Python
false
false
399
py
""" WSGI config for talkProject project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'talkProject.settings') application = get_wsgi_application()
[ "venothx7@hotmail.com" ]
venothx7@hotmail.com
cceb7fc372778448efd0c51666c8a0332506ecd1
6ec08db44ab78b73a0e5d07521906935504daf3a
/data/data_processor.py
0809b27f6267e83ae55750f0c3cdb6f7a4b23402
[]
no_license
michaellu2019/Frens-Where-U-At
0938ba1a28d4ad7b8ec09a362e82a9064e6c5e5b
e8fc0b556d2220a21baf24fd2c4f509e0d896499
refs/heads/master
2021-01-28T00:15:54.912472
2020-02-27T10:42:29
2020-02-27T10:42:29
243,489,843
1
0
null
null
null
null
UTF-8
Python
false
false
1,245
py
import requests import json import googlemaps # load scraped data to process for locations print('Loading Data...') with open('data.json') as json_file: data = json.load(json_file) coordinates = { 'schools': {}, 'current_cities': {}, 'hometowns': {} } raw_place_data = { 'schools': {}, 'current_cities': {}, 'hometowns': {} } # use google geocode API to get latitude and longitude coordinates for all locations api_key = input('Enter Your API Key: ') url = 'https://maps.googleapis.com/maps/api/geocode/json?' gmaps = googlemaps.Client(key = api_key) print('Fetching Location Data...') for key in coordinates: for place in data['friend_places'][key]: if place != None: print('Fetching Location Data for ' + place + '...') res = gmaps.geocode(place) if len(res) > 0: coordinates[key][place] = res[0]['geometry']['location'] coordinates[key][place]['people'] = data['friend_places'][key][place] raw_place_data[key][place] = res[0] print(raw_place_data[key][place]) # save coordinates and raw data to files print('Saving Data...') with open('coordinate_data.json', 'w') as outfile: json.dump(coordinates, outfile) with open('raw_places_data.json', 'w') as outfile: json.dump(raw_place_data, outfile)
[ "porkythemorky@gmail.com" ]
porkythemorky@gmail.com
d7fb914ef8dd85bf7fe70d3541f4377878c43c33
352bd9f2d9857e48cf81873c2079e50651125d55
/tkinter/读写csv.py
68b60c37d155bf009a0742729b10b36b1c324118
[]
no_license
xxzzxxzzzzs/pythonDemo
0e0534ce05c40d9dc608c3a37f082b67b42408a5
124cbac4a9dd66e239e144c1819e2f697e4200f0
refs/heads/master
2020-03-18T19:45:15.480756
2019-06-17T16:25:22
2019-06-17T16:25:22
135,175,726
0
0
null
null
null
null
UTF-8
Python
false
false
618
py
# -*- coding: UTF-8 -*- import csv # "/Users/zzs/Downloads/淘宝综合数据包.csv" path="/Users/zzs/Desktop/python/淘宝综合数据包.csv" def readCsv(path): infolist=[] with open(path,"r") as f: allFileInfo=csv.reader(f) for row in allFileInfo: infolist.append(row) # print(row) # print(allFileInfo) pass def writeCsv(path,data): with open(path,"w")as f: writer=csv.writer(f) for rowData in data: writer.writerow(rowData) pass # readCsv(path) writeCsv("/Users/zzs/Desktop/python/1.csv",[["1","2","3"],[4,5,6]])
[ "740866631@qq.com" ]
740866631@qq.com
eac74402b6f6bf1efcd4230ca20fa1805c7b8b4b
4bd9117f24600b3190f7310f9fea111157583e5b
/study/migrations/0003_auto_20200724_1602.py
b184eec0328dcf76ea0abaa46ad199769ed43b39
[]
no_license
mohammadamin16/school-back
3e36a23c556b16069aef967b1cdcee4edd0cae52
c55071c01e86786829bca2fd3a262ab580ae8859
refs/heads/master
2023-08-02T04:14:44.435841
2020-08-06T08:31:12
2020-08-06T08:31:12
280,162,641
0
0
null
2021-09-22T19:32:24
2020-07-16T13:34:00
Python
UTF-8
Python
false
false
374
py
# Generated by Django 3.0.8 on 2020-07-24 16:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('study', '0002_day_items'), ] operations = [ migrations.AlterField( model_name='item', name='course', field=models.CharField(max_length=100), ), ]
[ "toutounchi.ma@gmail.com" ]
toutounchi.ma@gmail.com
263d1c4b93e145ea7b16c3d3daa27d2ee2247f69
2f54faa8fea018a369caa74983083197cab0ee8d
/0-50/000012.py
3a332e4c07d03ed1e6fe4d4c5334a3f4d37b5f84
[]
no_license
davaponte/ProjectEuler
629f9213b35c6c83a1476c55f672db3b83d2678d
c7ac1fd6c23b18a63c3ec59fa6dcf32103f7aa26
refs/heads/master
2020-09-20T16:04:53.684519
2019-12-17T23:06:16
2019-12-17T23:06:16
224,531,684
0
0
null
null
null
null
UTF-8
Python
false
false
1,410
py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # 000001.py # # Copyright 2019 data <data@ASUS-LAPTOP> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # # ANSWER: 12375 76576500 576 import math def Dividers(n): acum = 0 for k in range(1, int(math.sqrt(n)) + 1): if n % k == 0: acum += 1 return acum def main(args): limit = 10 k = 1 n = 0 while True: #k <= limit: n = n + k div = Dividers(n) * 2 if (div > 500): print('ANSWER: ', n, ', ', div) break if (k % 500 == 0): print(k, n, div) k += 1 return 0 if __name__ == '__main__': import sys sys.exit(main(sys.argv))
[ "david.aponte@outlook.com" ]
david.aponte@outlook.com
ddd4cbb0a7b8393ee3cfebe119f7e8e653b7b937
ee63f0bace8d31da3383b9a5c89f3bc1a3b98807
/Facebook/Facebook-101/main.py
b2943325d0485df8795ad57e15c2a5357ee54405
[ "Unlicense" ]
permissive
Alain-T/SocialNetworks
cf3468bb3be61e8c193105747ab4958332c27a9b
6e51c5d9d33ebededc54f438ea4aa2cc4ac68886
refs/heads/master
2021-05-12T15:42:04.934451
2018-06-14T09:58:47
2018-06-14T09:58:47
116,991,357
0
0
Unlicense
2018-01-21T22:29:16
2018-01-10T17:50:46
Python
UTF-8
Python
false
false
814
py
from urllib2 import urlopen, Request import time import datetime # https://github.com/minimaxir/facebook-page-post-scraper/ # https://www.norconex.com/how-to-crawl-facebook/ # https://developers.facebook.com/tools-and-support/ def request_until_succeed(url): req = Request(url) success = False while success is False: try: response = urlopen(req) if response.getcode() == 200: success = True except Exception as e: print(e) time.sleep(5) print("Error for URL {}: {}".format(url, datetime.datetime.now())) print("Retrying.") return response.read() access_token = "" url = "https://graph.facebook.com/v2.11/me?fields=id,name&access_token=" + access_token print(request_until_succeed(url))
[ "noreply@github.com" ]
Alain-T.noreply@github.com
ecdede69f1d6e9cb1acc5fb71ce4e15015937bb8
a544ea4c2faeabd722ba5f4968b348270a16f789
/i5_only_index_counter/testCountIndexes_i5_only.py
e241aba754390ca173f381f91e1bd66b5acb61ca
[ "MIT" ]
permissive
faircloth-lab/index-counters
1a963e7e85d0364b996f9e31cabb0f9faac4e7df
8f16239f9e5e7c53915133988a0857eeea05cdc0
refs/heads/master
2021-01-02T09:36:12.132783
2017-08-03T17:26:02
2017-08-03T17:26:02
99,258,269
0
0
null
null
null
null
UTF-8
Python
false
false
2,818
py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ (c) 2014 Brant Faircloth || http://faircloth-lab.org/ All rights reserved. This code is distributed under a 3-clause BSD license. Please see LICENSE.txt for more information. Created on 14 October 2014 09:35 CDT (-0500) print commands & additional comments for idiots added by TCG in November 2014. This program assumes that you have an undetermined.fasta.gz file with dual indexes You need to put this file wherever your IDLE points (default = documents) I strongly suggest that you use the UndeterminedTestFile.fasta.gz to ensure all is well before searching a big file! In this program, you will need to change the input file name to whatever is appropriate. The input fileName is currently: UndeterminedTestFile.fastq.gz That inputFileName is on line 43 (IMPORTANT) & then copied to line 38 so you know the filename you used The print function of line 38 confirms that your script is running (or at least started correctly) The UndeterminedTestFile.fasta.gz runs in just a few seconds. A real file (3 GB, 30M reads) takes 20 minutes to run (your mileage may vary). I have this set to print the 50 most common indexes, but you can change that to any number you want """ import gzip from collections import Counter from pprint import pprint #this is the input filename - COPIED from 7 lines below (in the line that starts: with gzip.open...) print print "You are now searching the file UndeterminedTestFile.fastq.gz" print #Change the Undetermined fileName 2 lines below this line!!! barcode_combo_count = Counter() with gzip.open('UndeterminedTestFile.fastq.gz', 'rb') as infile: for line in infile: if line.startswith('@'): ls =line.strip().split(' ') barcodes = ls[-1] barcode_combo_count.update([barcodes.split("+")[-1]]) # get most common 10 [commented out by TCG because we're printing these below] #barcode_combo_count.most_common(10) # get total count of all reads [commented out by TCG because we're printing these below] #sum(barcode_combo_count.values()) # get a subset of reads matching some barcode pattern [commented out by TCG because I'm not using this option] # assumes dual-indexes # new_counter = Counter({i:j for i,j in barcode_combo_count.iteritems() if "+AGATCTCG" in i}) #More TCG comments and output for idiots -- #print the total count of all reads - comment the next line if you don't want to see it print "Here is the sum of all sequences in the file with i5 indexes:" print sum(barcode_combo_count.values()) print #print the most common 50 barcodes - comment the next line if you don't want to see it print "This isn't quite right, but here are the 50 most common i7 (Indexing Read 1's) in the file:" print pprint (barcode_combo_count.most_common(50)) print
[ "brant@faircloth-lab.org" ]
brant@faircloth-lab.org
f4bc8aff58f087289a76c4ac2394b45010138259
34bffe1c0b2443535415adfe6d3bc6e880da4ab7
/sim_setups/random_mating.py
c98d1bfdd23b19281300ec416e78c6fd5e5d04b8
[]
no_license
JeDeveloper/SimulationThingy
ad0f73ae7e498cb6eab17ff7b91e7a053c8ad968
f2aea97b172fb9f0488f7f0e6570dddcf45d36b0
refs/heads/master
2023-06-12T19:09:43.921800
2021-07-02T04:42:18
2021-07-02T04:42:18
381,186,772
0
0
null
null
null
null
UTF-8
Python
false
false
222
py
from random import uniform def choose_mates(e, options): """ :param e: :param options: :return: """ options.sort(key=lambda x: uniform(0, 1)) return options[:min(e.num_mates(), len(options))]
[ "joshuaevanslowell@gmail.com" ]
joshuaevanslowell@gmail.com
95126c4364b3bc4a15ad640c598a3e1a6da0b4bd
3b16925760bfe1797a33b7cf20a090ac807e7683
/gdal223/autotest/ogr/ogr_dgnv8.py
cb05b40e201d3042493707832dcbbf607414efab
[]
no_license
ghsourcecode/rastershp_gdal_python
a0a751989adf45c5e5f714e29af234d79a3f485b
506f11625aa0b72350e6b64619c6809fc0ee476a
refs/heads/master
2020-03-17T17:42:28.340585
2018-09-26T03:02:56
2018-09-26T03:02:56
133,798,972
0
0
null
null
null
null
UTF-8
Python
false
false
7,545
py
#!/usr/bin/env python ############################################################################### # $Id: ogr_dgnv8.py 40618 2017-11-02 15:30:27Z goatbar $ # # Project: GDAL/OGR Test Suite # Purpose: Test DGNv8 Driver. # Author: Even Rouault <even dot rouault at spatialys dot com> # ############################################################################### # Copyright (c) 2017, Even Rouault <even dot rouault at spatialys dot com> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. ############################################################################### import os import shutil import sys sys.path.append( '../pymod' ) import gdaltest import ogrtest from osgeo import gdal, ogr ############################################################################### # Verify we can open the test file. def ogr_dgnv8_1(): gdaltest.dgnv8_drv = ogr.GetDriverByName('DGNv8') if gdaltest.dgnv8_drv is None: return 'skip' ds = ogr.Open( 'data/test_dgnv8.dgn' ) if ds is None: gdaltest.post_reason( 'failed to open test file.' ) return 'fail' return 'success' ############################################################################### # Compare with a reference CSV dump def ogr_dgnv8_2(): if gdaltest.dgnv8_drv is None: return 'skip' gdal.VectorTranslate('/vsimem/ogr_dgnv8_2.csv', 'data/test_dgnv8.dgn', options = '-f CSV -dsco geometry=as_wkt -sql "select *, ogr_style from my_model"') ds_ref = ogr.Open('/vsimem/ogr_dgnv8_2.csv') lyr_ref = ds_ref.GetLayer(0) ds = ogr.Open( 'data/test_dgnv8_ref.csv' ) lyr = ds.GetLayer(0) ret = ogrtest.compare_layers(lyr, lyr_ref, excluded_fields = ['WKT']) gdal.Unlink('/vsimem/ogr_dgnv8_2.csv') return ret ############################################################################### # Run test_ogrsf def ogr_dgnv8_3(): if gdaltest.dgnv8_drv is None: return 'skip' import test_cli_utilities if test_cli_utilities.get_test_ogrsf_path() is None: return 'skip' ret = gdaltest.runexternal(test_cli_utilities.get_test_ogrsf_path() + ' -ro data/test_dgnv8.dgn') if ret.find('INFO') == -1 or ret.find('ERROR') != -1: gdaltest.post_reason('fail') print(ret) return 'fail' shutil.copy( 'data/test_dgnv8.dgn', 'tmp/test_dgnv8.dgn' ) ret = gdaltest.runexternal(test_cli_utilities.get_test_ogrsf_path() + ' tmp/test_dgnv8.dgn') os.unlink('tmp/test_dgnv8.dgn') if ret.find('INFO') == -1 or ret.find('ERROR') != -1: gdaltest.post_reason('fail') print(ret) return 'fail' return 'success' ############################################################################### # Test creation code def ogr_dgnv8_4(): if gdaltest.dgnv8_drv is None: return 'skip' tmp_dgn = 'tmp/ogr_dgnv8_4.dgn' gdal.VectorTranslate(tmp_dgn, 'data/test_dgnv8.dgn', format = 'DGNv8') tmp_csv = '/vsimem/ogr_dgnv8_4.csv' gdal.VectorTranslate(tmp_csv, tmp_dgn, options = '-f CSV -dsco geometry=as_wkt -sql "select *, ogr_style from my_model"') gdal.Unlink(tmp_dgn) ds_ref = ogr.Open(tmp_csv) lyr_ref = ds_ref.GetLayer(0) ds = ogr.Open( 'data/test_dgnv8_write_ref.csv' ) lyr = ds.GetLayer(0) ret = ogrtest.compare_layers(lyr, lyr_ref, excluded_fields = ['WKT']) gdal.Unlink(tmp_csv) return ret ############################################################################### # Test creation options def ogr_dgnv8_5(): if gdaltest.dgnv8_drv is None: return 'skip' tmp_dgn = 'tmp/ogr_dgnv8_5.dgn' options = [ 'APPLICATION=application', 'TITLE=title', 'SUBJECT=subject', 'AUTHOR=author', 'KEYWORDS=keywords', 'TEMPLATE=template', 'COMMENTS=comments', 'LAST_SAVED_BY=last_saved_by', 'REVISION_NUMBER=revision_number', 'CATEGORY=category', 'MANAGER=manager', 'COMPANY=company' ] ds = gdaltest.dgnv8_drv.CreateDataSource(tmp_dgn, options = options) lyr = ds.CreateLayer('my_layer') f = ogr.Feature(lyr.GetLayerDefn()) f.SetGeometry(ogr.CreateGeometryFromWkt('POINT(0 1)')) lyr.CreateFeature(f) ds = None ds = ogr.Open(tmp_dgn) got_md = ds.GetMetadata_List('DGN') if got_md != options: gdaltest.post_reason('fail') print(got_md) return 'fail' ds = None tmp2_dgn = 'tmp/ogr_dgnv8_5_2.dgn' gdaltest.dgnv8_drv.CreateDataSource(tmp2_dgn, options = ['SEED=' + tmp_dgn, 'TITLE=another_title']) ds = ogr.Open(tmp2_dgn) if ds.GetMetadataItem('TITLE', 'DGN') != 'another_title' or ds.GetMetadataItem('APPLICATION', 'DGN') != 'application': gdaltest.post_reason('fail') print(ds.GetMetadata('DGN')) return 'fail' lyr = ds.GetLayer(0) if lyr.GetName() != 'my_layer': gdaltest.post_reason('fail') print(lyr.GetName()) return 'fail' if lyr.GetFeatureCount() != 0: gdaltest.post_reason('fail') print(lyr.GetFeatureCount()) return 'fail' ds = None ds = gdaltest.dgnv8_drv.CreateDataSource(tmp2_dgn, options = ['SEED=' + tmp_dgn]) lyr = ds.CreateLayer('a_layer', options = ['DESCRIPTION=my_layer', 'DIM=2']) f = ogr.Feature(lyr.GetLayerDefn()) f.SetGeometry(ogr.CreateGeometryFromWkt('POINT(2 3)')) lyr.CreateFeature(f) ds = None ds = ogr.Open(tmp2_dgn, update = 1) lyr = ds.GetLayer(0) if lyr.GetName() != 'a_layer': gdaltest.post_reason('fail') print(lyr.GetName()) return 'fail' if lyr.GetFeatureCount() != 1: gdaltest.post_reason('fail') print(lyr.GetFeatureCount()) return 'fail' f = lyr.GetNextFeature() if f.GetGeometryRef().ExportToWkt() != 'POINT (2 3)': gdaltest.post_reason('fail') f.DumpReadable() return 'fail' ds = None gdal.Unlink(tmp_dgn) gdal.Unlink(tmp2_dgn) return 'success' ############################################################################### # Cleanup def ogr_dgnv8_cleanup(): return 'success' gdaltest_list = [ ogr_dgnv8_1, ogr_dgnv8_2, ogr_dgnv8_3, ogr_dgnv8_4, ogr_dgnv8_5, ogr_dgnv8_cleanup ] if __name__ == '__main__': gdaltest.setup_run( 'ogr_dgnv8' ) gdaltest.run_tests( gdaltest_list ) gdaltest.summarize()
[ "daih1632010@163.com" ]
daih1632010@163.com
0f6943101c367d3d517ed0b139238eed0b1d44ed
d71687efd35e51d205b5a3bbc3c9b8e1aedb2208
/testing/test_add.py
c982ed6ca4c1cc5e939df5115dda0d9c409daf3e
[]
no_license
SusanLovely/Test
bcbf1a162deebef4b20d9a55762dbd09abd67109
f71b073d0c523f9c1c30f7a23d7b711046f72245
refs/heads/master
2023-01-31T00:25:11.486487
2020-12-10T08:18:38
2020-12-10T09:11:57
320,149,218
0
0
null
null
null
null
UTF-8
Python
false
false
1,296
py
from decimal import Decimal import pytest import yaml from study.calc import Calc class Test_Cal: with open('../datas/cal.yml') as f: params = yaml.safe_load(f) def setup_class(self): self.cal = Calc() @pytest.mark.add @pytest.mark.parametrize(params[0], params[1], ids=params[2]['ids']) # ('a', 'b', 'result'), # [(1, 1, 2), # (2, 2, 4), # (1000, 1000, 2000), # (1.2, 2.2, Decimal('3.4')), # (0.01, 0.00, Decimal('0.01')), # ], # ids=['int', 'int', 'bigint', 'float', 'double']) def test_add(self, calcomment, a, b, result): assert result == self.cal.add(a, b) @pytest.mark.div @pytest.mark.parametrize(('a', 'b', 'result'), [(1, 1, 1), (4, 5, Decimal('0.8')), (5, 3, Decimal('1.6666666666667')), (1.2, 2.2, Decimal('0.54545454545455')) ], ids=['int', 'int', 'bigint', 'double']) def test_div(self, calcomment, a, b, result): assert result == self.cal.div(a, b)
[ "1192456213@qq.com" ]
1192456213@qq.com
c1d762b0170e9348bee48f2ccb9ab99dfd859ee7
6ff85b80c6fe1b3ad5416a304b93551a5e80de10
/Python/Algorithm/Prefixes.py
b9c8303dc674d2cf957a9ff6995ef153d7d51559
[ "MIT" ]
permissive
maniero/SOpt
c600cc2333e0a47ce013be3516bbb8080502ff2a
5d17e1a9cbf115eaea6d30af2079d0c92ffff7a3
refs/heads/master
2023-08-10T16:48:46.058739
2023-08-10T13:42:17
2023-08-10T13:42:17
78,631,930
1,002
136
MIT
2023-01-28T12:10:01
2017-01-11T11:19:24
C#
UTF-8
Python
false
false
214
py
prefixes = "JKLMNOPQ" for letter in prefixes: if letter[0] == "Q" or letter[0] == "O": print(letter + "uack") else: print(letter + "ack") #https://pt.stackoverflow.com/q/305011/101
[ "noreply@github.com" ]
maniero.noreply@github.com
599ef1d079eeed1fde99eb731ce24ed5d4279016
98f04386bc12c5f6419a217f6651d25f363f6e13
/pgame-16070/code71.py
78e9745c8bc6975208f4944a635f07f668c17417
[]
no_license
iintrn/pgame
3070c71d8dd61f54fceb2c5483b641fd2c1813cb
18a1ed0856f58bbc3ee6b5e116733fe5e2a45a1a
refs/heads/master
2020-08-27T01:07:34.423386
2020-01-08T06:27:02
2020-01-08T06:27:02
217,201,600
0
0
null
2019-10-24T03:15:43
2019-10-24T03:15:43
null
UTF-8
Python
false
false
385
py
# Pemrograman Game Praktikum 7 # latihan code 7.1 : PyGame import pygame, sys from pygame.locals import * pygame.init() DISPLAYSURF = pygame.display.set_mode((400, 300)) pygame.display.set_caption('Hello World!') while True: # main game loop for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() pygame.display.update()
[ "noreply@github.com" ]
iintrn.noreply@github.com
af93c42439155456b892ec46aa14067158094b57
776c8a5821eb8cd1357439454c9c20c9da239afb
/November,2020~July,2021/2020-12-25/10708_이승민_크리스마스파티.py
b3b2a0dd0f360771834e24cb3dc3d05a2dfb197f
[]
no_license
JinYeJin/algorithm-study
85d84a726e0f7bb78a2da37504bc04a42b3906ea
538c911e6adcdad3bfed3d9f76ccb30804dfb768
refs/heads/master
2023-07-04T16:09:12.101837
2021-08-14T02:23:44
2021-08-14T02:23:44
272,363,049
8
2
null
null
null
null
UTF-8
Python
false
false
633
py
# 크리스마스 파티 import sys def solution(): input = sys.stdin.readline n = int(input()) m = int(input()) target = list(map(int, input().split())) ans = [0] * n for i in range(m): guys = list(map(int, input().split())) for j in range(n): if guys[j] == target[i]: ans[j] += 1 else: ans[target[i] - 1] += 1 print("\n".join(list(map(str, ans)))) # s 로 출력하는 것과 시간 똑같음 solution() # for i in range(1, len(ans)): # s += str(ans[i]) + "\n" # print(s) # print("\n".join(list(map(str, ans))))
[ "yeen0606@gmail.com" ]
yeen0606@gmail.com
3326d1f0d7a904c49e75028dbb4d9a1ab3146e7a
e9aa329640c6286d0e48fb411ec93fec8a3cb44b
/Bucles_While.py
f51661096a69af083870bb958aec7b2007345b24
[]
no_license
francechi/Python
4c16c8db32a4c44007407679f2ed0bc0a294a966
d3872fb4fec61dbf1702c502d1d4fbb18722056d
refs/heads/master
2020-04-17T21:38:17.861852
2019-01-22T13:01:32
2019-01-22T13:02:32
166,959,239
0
0
null
null
null
null
UTF-8
Python
false
false
1,236
py
i=1 while i<=10: print('Ejecución ' + str(i)) i=i+1 print('Terminó la Ejecución') # While = mientras edad=int(input("indroduce tu edad: ")) while edad<15 or edad>100: print("Has introducido una edad Incorrecta, Vuelve a intentarlo") edad=int(input("indroduce tu edad: ")) print("Gracias por colaborar. Puedes pasar") print("Edad del aspirante " + str(edad)) # Se ejecuta como una condicion if, la diferencia es que while es infinito mientras no se cumplan # - los requisitos import math print("Programa de cálculo de raíz cuadrada") numero=int(input("Introduce un número: ")) intentos=0 while numero<0: print("No se pude hallar la raíz de un número negativo") if intentos== 2: print("Has consumido demasiados intentos. El programa ha finalizado") break; numero=int(input("Introduce un número: ")) if numero<0: intentos=intentos+ 1 if intentos<2: solucion=math.sqrt(numero) # Lo que hace esta clase maht.sqrt es almacenar la raiz cuadrada # - de numero en una variable llamada solucion # Por lo que al principio para poder usar la clase maht, es necesario importarla con import print("La raíz cuadrada de " + str(numero) + " es " + str(solucion)) # Y break; es para terminar con el bucle while
[ "ivanfrancechi@hotmail.com" ]
ivanfrancechi@hotmail.com
47b2feab087e40048eb404c8146b5b18431e88af
1cfafec5935522b386d40ab7bb7246f39da89fcc
/algorithm/swacademy/no-complete/voca.py
7724fa2c60d882916c60be7ee596f8e0ea8a83c4
[]
no_license
madfalc0n/my_coding_labs
0d9e13e2d1579607d5481c6a78baa70a2c7c374a
b38fd988a5e3ebb8d8b66bf5a0b15eb3eaa20578
refs/heads/master
2021-07-03T17:33:16.801207
2021-06-18T06:24:09
2021-06-18T06:24:09
241,097,976
1
0
null
null
null
null
UTF-8
Python
false
false
454
py
""" 단어 몇개를 뽑아 단어셋트를 만들어야 함 셋트 안에는 모든 소문자 알파벳 26개가 포함되어야 함 """ for test_case in range(1,int(input())+1): voca_list = int(input()) temp_list = [] for _ in range(voca_list): temp_list.append(input()) temp_set = {} for v in temp_list: for vv in v: temp_set[vv] = temp_set.get(vv,0) +1 print(temp_set) print(sorted(temp_set))
[ "chadool116@naver.com" ]
chadool116@naver.com
41df512f180bf0ac765027cf3822f77c24b3f9a2
dc562b8400662f2987c56a42d4504c18adf507ef
/rmtk/plotting/loss_curves/parse_loss_curves.py
b5174a5a909996b9c53fc1cc93476f4c8b48ffc1
[]
no_license
VSilva/RMTK
34da956a779e1de3cf8b5bc42597d7094b6afba5
99aa1c93026ff56cd602a020fca42e80ce3048ac
refs/heads/master
2021-01-22T16:31:10.295963
2015-02-24T14:21:37
2015-02-24T14:22:06
25,680,488
0
0
null
2014-11-07T16:21:21
2014-10-24T09:10:38
Python
UTF-8
Python
false
false
4,277
py
''' Post-process risk calculation data to convert loss curves into different formats ''' import os import csv import argparse import numpy as np from lxml import etree from collections import OrderedDict xmlNRML='{http://openquake.org/xmlns/nrml/0.4}' xmlGML = '{http://www.opengis.net/gml}' def parse_single_loss_curve(element): ''' Reads the loss curve element to return the longitude, latitude and poes and losses ''' for e in element.iter(): ref = element.attrib.get('assetRef') if e.tag == '%spos' % xmlGML: coords = str(e.text).split() lon = float(coords[0]) lat = float(coords[1]) elif e.tag == '%spoEs' % xmlNRML: poes = str(e.text).split() poes = map(float, poes) elif e.tag == '%slosses' % xmlNRML: losses = str(e.text).split() losses = map(float, losses) else: continue return lon, lat, ref, poes, losses def parse_metadata(element): ''' Returns the statistics ''' metadata = {} metadata['statistics'] = element.attrib.get('statistics') metadata['quantile_value'] = element.attrib.get('quantileValue') metadata['investigationTime'] = element.attrib.get('investigationTime') metadata['unit'] = element.attrib.get('unit') metadata['lossType'] = element.attrib.get('lossType') return metadata def LossCurveParser(input_file): refs = [] longitude = [] latitude = [] losses = [] poes = [] metadata = {} for _, element in etree.iterparse(input_file): if element.tag == '%slossCurves' % xmlNRML: metadata = parse_metadata(element) elif element.tag == '%slossCurve' % xmlNRML: lon, lat, ref, poe, loss = parse_single_loss_curve(element) longitude.append(lon) latitude.append(lat) refs.append(ref) poes.append(poe) losses.append(loss) else: continue longitude = np.array(longitude) latitude = np.array(latitude) return refs, longitude, latitude, poes, losses def parse_loss_file(input_file): ''' Reads an xml loss curves file and returns a dictionary with asset (refs) as keys and (lon,lat,poe,loss) as values ''' loss_curves = {} asset_refs = [] for _, element in etree.iterparse(input_file): if element.tag == '%slossCurves' % xmlNRML: metadata = parse_metadata(element) elif element.tag == '%slossCurve' % xmlNRML: lon, lat, ref, poe, loss = parse_single_loss_curve(element) asset_refs.append(ref) loss_curves[ref] = loss, poe else: continue return metadata, asset_refs, loss_curves def LossCurves2Csv(nrml_loss_curves): ''' Writes the Loss curve set to csv ''' refs, longitude, latitude, poes, losses = LossCurveParser(nrml_loss_curves) output_file = open(nrml_loss_curves.replace('xml','csv'),'w') for iloc in range(len(refs)): print len(poes) poes_list = ','.join(map(str, poes[iloc])) losses_list = ','.join(map(str, losses[iloc])) output_file.write(str(refs[iloc])+','+str(longitude[iloc])+','+str(latitude[iloc])+','+poes_list+','+losses_list+'\n') output_file.close() def set_up_arg_parser(): """ Can run as executable. To do so, set up the command line parser """ parser = argparse.ArgumentParser( description='Convert NRML loss curves file to tab delimited ' ' .txt files. Inside the specified output directory, create a .txt ' 'file for each stochastic event set.' 'To run just type: python parse_loss_curves.py ' '--input-file=PATH_TO_LOSS_CURVE_NRML_FILE ', add_help=False) flags = parser.add_argument_group('flag arguments') flags.add_argument('-h', '--help', action='help') flags.add_argument('--input-file', help='path to loss curves NRML file (Required)', default=None, required=True) return parser if __name__ == "__main__": parser = set_up_arg_parser() args = parser.parse_args() if args.input_file: metadata, asset_refs, loss_curves = parse_loss_file(args.input_file)
[ "anirudh.rao@globalquakemodel.org" ]
anirudh.rao@globalquakemodel.org
c7567cd22bf7fd8094c4bdba7cbd5810a54004c8
08f863cadbec37e05f3bb732353742ddc3301f52
/connection.py
c5ee383f5de8bb27cff145a80417060662513260
[]
no_license
chches/hackathon06_reto1
e034f77576f8789b77b1ad1116e8cf5affa1dc4f
470a61a14aa0c420c4464a6e1f7b98e32b329e6f
refs/heads/master
2022-12-15T21:13:29.127230
2020-09-17T03:22:40
2020-09-17T03:22:40
295,168,451
0
0
null
null
null
null
UTF-8
Python
false
false
745
py
from psycopg2 import connect class Connection: def __init__(self, server='127.0.0.1', user='postgres', password='R0s@N3gr@', database='colegio_reto_6_g2_prueba', port=5432): self.db = connect(host=server, user=user, password=password, database=database, port=port) self.cursor = self.db.cursor() # print(f'Conexión a la base de datos {database}, exitosa') def execute_query(self, sql): self.cursor.execute(sql) return self.cursor def close_connection(self): self.db.close() print("Se ha desconectado de la base de datos") def commit(self): self.db.commit() return True # connection = Connection()
[ "charlycris.che@gmail.com" ]
charlycris.che@gmail.com
07360f528871877e82963e232c3aca6d8f857861
7bde204fc269b3a28983194f7856928603f4762c
/zvt/domain/quotes/stock/stock_5m_kdata.py
ca4ed3497fc930328183528abe95919208787457
[ "MIT" ]
permissive
joyjarod163/zvt
e0b01333854b1751f3f9361331618d2467e1b588
3e03af11c7043bd5f848621219d3485662fc5132
refs/heads/master
2020-09-28T22:53:29.190824
2019-12-17T10:56:38
2019-12-17T10:56:38
224,348,018
1
0
MIT
2019-12-09T12:05:55
2019-11-27T05:00:05
Python
UTF-8
Python
false
false
430
py
# -*- coding: utf-8 -*- from sqlalchemy.ext.declarative import declarative_base from zvdata.contract import register_schema from zvt.domain.quotes.stock import StockKdataCommon # 股票5分钟k线 Stock5MKdataBase = declarative_base() class Stock5mKdata(Stock5MKdataBase, StockKdataCommon): __tablename__ = 'stock_5m_kdata' register_schema(providers=['joinquant'], db_name='stock_5m_kdata', schema_base=Stock5MKdataBase)
[ "5533061@qq.com" ]
5533061@qq.com
7b82da4dcc2cdc39dd5ca121bde166722940279b
fc39420bab255421ace7057eab3cbc5c51eac508
/Hari 14/Catatan14.py
13b2d64ec3074193dfe77347c114053250eb22a9
[]
no_license
MuhamadAhsanul/JCDS_-_Modul_1_Fundamental
27d3e32a7237b36e435458d5092386060e3962b5
f3def06b727ffd056a274b187d9c1ba99303a4c5
refs/heads/master
2020-09-08T04:52:38.265190
2019-11-11T16:03:05
2019-11-11T16:03:05
221,021,041
0
0
null
null
null
null
UTF-8
Python
false
false
387
py
# Fibonacci # 0,1,1,2,3,5,8,13,21,34,55,89,144 class fibo: def fibo1(self, x): a = range(101) ac = [] for i in a: if i <= 1: ac.append(1) else: rumus = ac[i - 1]+ac[i - 2] ac.append(rumus) Fi = ac[x] return Fi Objek = fibo() print(Objek.fibo1(2)) print(Objek.fibo1(40))
[ "aahsaann@gmail.com" ]
aahsaann@gmail.com
974a7bc8b7e11cd5af7140176e44fd5e366c4a1f
60502a0f6337a710de6fd28354482981708af658
/setup.py
694424495c8e1e5282c9fe30c16d80e52e3a0eeb
[ "MIT" ]
permissive
inventree/inventree-python
373f0c710617e9c8127351c25067b96b6149db4f
eddb2ad4920236ca9155abccc2e4c3ae0637a8ef
refs/heads/master
2023-08-09T22:05:56.363714
2023-07-26T04:31:51
2023-07-26T04:31:51
187,025,596
13
26
MIT
2023-08-23T08:38:57
2019-05-16T12:40:50
Python
UTF-8
Python
false
false
939
py
# -*- coding: utf-8 -*- import setuptools from inventree.base import INVENTREE_PYTHON_VERSION with open('README.md', encoding='utf-8') as f: long_description = f.read() setuptools.setup( name="inventree", version=INVENTREE_PYTHON_VERSION, author="Oliver Walters", author_email="oliver.henry.walters@gmail.com", description="Python interface for InvenTree inventory management system", long_description=long_description, long_description_content_type='text/markdown', keywords="bom, bill of materials, stock, inventory, management, barcode", url="https://github.com/inventree/inventree-python/", license="MIT", packages=setuptools.find_packages( exclude=[ 'ci', 'scripts', 'test', ] ), install_requires=[ "requests>=2.27.0" ], setup_requires=[ "wheel", ], python_requires=">=3.8" )
[ "oliver.henry.walters@gmail.com" ]
oliver.henry.walters@gmail.com
7e0d037a89c0b43fe54356a1e8bed2819deaa4ab
34b03f704a948ac4b7d63ad7a79c413422e4fe9a
/main.py
00e71282e694c6e61c028fb637f59e337475ce1e
[]
no_license
Ksenouter/cbps
580c87149318df7a58149760700b62db974196ea
817a307a0f804a70cdf0c5fa2197ec74a1e823d4
refs/heads/main
2023-04-20T21:49:11.362391
2021-05-05T21:00:48
2021-05-05T21:00:48
314,164,076
0
0
null
null
null
null
UTF-8
Python
false
false
255
py
from scraper import Scraper from dbf_parser import Parser def main(): scraper = Scraper() scraper.download_files(reload=False) scraper.extract_downloads() Parser.pars_forms(recreate_sources=False) if __name__ == '__main__': main()
[ "ProhorovIlyaDm@gmail.com" ]
ProhorovIlyaDm@gmail.com
604e479c7d19f3b1f557d2bbff9fee052f9743ef
51f887286aa3bd2c3dbe4c616ad306ce08976441
/pybind/slxos/v17s_1_02/brocade_mpls_rpc/show_mpls_bypass_lsp_name_debug/output/bypass_lsp/show_mpls_lsp_extensive_info/show_mpls_lsp_sec_path_info/sec_path/lsp_sec_path_config_admin_groups/__init__.py
391e3e1c63903ed7744664646f5f08830e3d3613
[ "Apache-2.0" ]
permissive
b2220333/pybind
a8c06460fd66a97a78c243bf144488eb88d7732a
44c467e71b2b425be63867aba6e6fa28b2cfe7fb
refs/heads/master
2020-03-18T09:09:29.574226
2018-04-03T20:09:50
2018-04-03T20:09:50
null
0
0
null
null
null
null
UTF-8
Python
false
false
6,560
py
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from decimal import Decimal from bitarray import bitarray import __builtin__ import lsp_admin_group class lsp_sec_path_config_admin_groups(PybindBase): """ This class was auto-generated by the PythonClass plugin for PYANG from YANG module brocade-mpls - based on the path /brocade_mpls_rpc/show-mpls-bypass-lsp-name-debug/output/bypass-lsp/show-mpls-lsp-extensive-info/show-mpls-lsp-sec-path-info/sec-path/lsp-sec-path-config-admin-groups. Each member element of the container is represented as a class variable - with a specific YANG type. """ __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__lsp_admin_group',) _yang_name = 'lsp-sec-path-config-admin-groups' _rest_name = 'lsp-sec-path-config-admin-groups' _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): path_helper_ = kwargs.pop("path_helper", None) if path_helper_ is False: self._path_helper = False elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper): self._path_helper = path_helper_ elif hasattr(self, "_parent"): path_helper_ = getattr(self._parent, "_path_helper", False) self._path_helper = path_helper_ else: self._path_helper = False extmethods = kwargs.pop("extmethods", None) if extmethods is False: self._extmethods = False elif extmethods is not None and isinstance(extmethods, dict): self._extmethods = extmethods elif hasattr(self, "_parent"): extmethods = getattr(self._parent, "_extmethods", None) self._extmethods = extmethods else: self._extmethods = False self.__lsp_admin_group = YANGDynClass(base=lsp_admin_group.lsp_admin_group, is_container='container', presence=False, yang_name="lsp-admin-group", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='container', is_config=True) load = kwargs.pop("load", None) if args: if len(args) > 1: raise TypeError("cannot create a YANG container with >1 argument") all_attr = True for e in self._pyangbind_elements: if not hasattr(args[0], e): all_attr = False break if not all_attr: raise ValueError("Supplied object did not have the correct attributes") for e in self._pyangbind_elements: nobj = getattr(args[0], e) if nobj._changed() is False: continue setmethod = getattr(self, "_set_%s" % e) if load is None: setmethod(getattr(args[0], e)) else: setmethod(getattr(args[0], e), load=load) def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: return [u'brocade_mpls_rpc', u'show-mpls-bypass-lsp-name-debug', u'output', u'bypass-lsp', u'show-mpls-lsp-extensive-info', u'show-mpls-lsp-sec-path-info', u'sec-path', u'lsp-sec-path-config-admin-groups'] def _rest_path(self): if hasattr(self, "_parent"): if self._rest_name: return self._parent._rest_path()+[self._rest_name] else: return self._parent._rest_path() else: return [u'show-mpls-bypass-lsp-name-debug', u'output', u'bypass-lsp', u'sec-path', u'lsp-sec-path-config-admin-groups'] def _get_lsp_admin_group(self): """ Getter method for lsp_admin_group, mapped from YANG variable /brocade_mpls_rpc/show_mpls_bypass_lsp_name_debug/output/bypass_lsp/show_mpls_lsp_extensive_info/show_mpls_lsp_sec_path_info/sec_path/lsp_sec_path_config_admin_groups/lsp_admin_group (container) """ return self.__lsp_admin_group def _set_lsp_admin_group(self, v, load=False): """ Setter method for lsp_admin_group, mapped from YANG variable /brocade_mpls_rpc/show_mpls_bypass_lsp_name_debug/output/bypass_lsp/show_mpls_lsp_extensive_info/show_mpls_lsp_sec_path_info/sec_path/lsp_sec_path_config_admin_groups/lsp_admin_group (container) If this variable is read-only (config: false) in the source YANG file, then _set_lsp_admin_group is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_lsp_admin_group() directly. """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=lsp_admin_group.lsp_admin_group, is_container='container', presence=False, yang_name="lsp-admin-group", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='container', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """lsp_admin_group must be of a type compatible with container""", 'defined-type': "container", 'generated-type': """YANGDynClass(base=lsp_admin_group.lsp_admin_group, is_container='container', presence=False, yang_name="lsp-admin-group", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='container', is_config=True)""", }) self.__lsp_admin_group = t if hasattr(self, '_set'): self._set() def _unset_lsp_admin_group(self): self.__lsp_admin_group = YANGDynClass(base=lsp_admin_group.lsp_admin_group, is_container='container', presence=False, yang_name="lsp-admin-group", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='container', is_config=True) lsp_admin_group = __builtin__.property(_get_lsp_admin_group, _set_lsp_admin_group) _pyangbind_elements = {'lsp_admin_group': lsp_admin_group, }
[ "badaniya@brocade.com" ]
badaniya@brocade.com
04a716c52c72639bc03bee083069585c9f503a1a
f3eae017c3c0206cdac604e40ef3b1fc9e7e62f6
/20200303/21.py
c7a84d61eed7412b6c1da482c583bcf293f98773
[]
no_license
doonguk/algorithm
b6d126286f7fff170979c62f2b2378d5a03438e9
981a1457106c244a13ef3cde8e944cb81888755f
refs/heads/master
2021-02-08T09:54:40.185496
2020-04-15T14:30:53
2020-04-15T14:30:53
244,138,985
0
0
null
null
null
null
UTF-8
Python
false
false
872
py
import sys sys.stdin = open("input21.txt", "rt") a = [list(map(int, input().split())) for _ in range(7)] cnt = 0 for i in range(3): for j in range(7): tmp = a[j][i:i+5] if tmp == tmp[::-1]: cnt += 1 for k in range(2): if a[i+k][j] != a[i+5-k-1][j]: break else: cnt += 1 print(cnt) #두번째 # def check(list): # for i in range(2): # if list[i] != list[4-i]: # return False # else: # return True # # cnt = 0 # # for y in range(7): # for x in range(3): # tmp = a[y][x:5+x] # if check(tmp): # cnt += 1 # #행 # # for x in range(7): # for i in range(3): # tmp = list() # for y in range(5): # tmp.append(a[y+i][x]) # if(check(tmp)): # cnt += 1 # # # print(cnt)
[ "mbxd1@naver.com" ]
mbxd1@naver.com
61574607016da36d0a3ad71604696ea90676f6a1
02dcaae5131ce4349c27a8b832d9f414c48f98d7
/src/collective/folderlogo/docs/conf.py
c694b1872c80c8bcfaf178247284f3415ec3971a
[ "BSD-3-Clause" ]
permissive
collective/collective.folderlogo
2f1712970ad9bde380850d39969e63e8e901b6ab
b6bb9a2fd2e7525b9c88ed7fff73f79075326e4f
refs/heads/master
2023-09-02T02:15:12.158430
2013-05-06T16:39:20
2013-05-06T16:39:20
null
0
0
null
null
null
null
UTF-8
Python
false
false
7,158
py
# -*- coding: utf-8 -*- # TODO documentation build configuration file, created by # sphinx-quickstart on Tue May 3 09:45:38 2011. # This file is execfile()d with the current directory set to its containing dir. # Note that not all possible configuration values are present in this # autogenerated file. # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'collective.folderlogo' copyright = u'2012, Taito Horiuchi' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # The short X.Y version. version = '1.1' # The full version, including alpha/beta/rc tags. release = '1.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'projectdoc' html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = ['../../../../../sphinx-taito-themes'] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%d.%m.%Y %H:%M' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'collective.folderlogodoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). latex_paper_size = 'a4' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [( 'index', 'collective.folderlogo.tex', u'collective.folderlogo Documentation', u'Taito Horiuchi', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ( 'index', 'todo', u'collective.folderlogo Documentation', [u'Taito Horiuchi'], 1)]
[ "taito.horiuchi@gmail.com" ]
taito.horiuchi@gmail.com
741ff6d16f64f666b5fe9cf731a9824f463ac9ca
599bf1b841520e11d0449f7d1578e015d7509e43
/rps.py
6272e19fe43ff285a5c0539217a06706e9019dc9
[]
no_license
spencerleff/rock-paper-scissors
832dcfbe80910d9cf18dccf2d0fe8faaba223737
7fb70391b5d0d7d30032faf4d8b8a813fdf5afa5
refs/heads/master
2022-11-18T20:48:14.277830
2020-07-16T22:12:49
2020-07-16T22:12:49
null
0
0
null
null
null
null
UTF-8
Python
false
false
6,909
py
#!/usr/bin/env python3 import random import time #output print("\n") print("Welcome to Rock, Paper, Scissors!") print("=================================") #for winner text bold = '\033[1m' end = '\033[0m' #variable to determine whether the user wishes to play again or not play = "y" #scoreboard variables wins=0 losses=0 ties=0 urockCounter=0 upaperCounter=0 uscissorsCounter=0 uWinWithRock=0 uWinWithPaper=0 uWinWithScissors=0 cWinWithRock=0 cWinWithPaper=0 cWinWithScissors=0 cpuRCount=0 cpuPCount=0 cpuSCount=0 rBestPick=0 pBestPick=0 sBestPick=0 while (play == "y") : #player move playerChoice = input("\nEnter 1 (Rock), 2 (Paper), or 3 (Scissors): ") #computer move cpuChoice = random.randint(1, 3) #player chooses rock if playerChoice == "1": urockCounter+=1 if cpuChoice == 1: cpuRCount+=1 print("Rock vs Rock...") pBestPick+=1 print(bold + "Its a tie!" + end,"\n") ties+=1 elif cpuChoice == 2: cpuPCount+=1 print("Rock vs Paper...") sBestPick+=1 print(bold + "You lost!" + end,"Paper covers rock.\n") cWinWithPaper+=1 losses+=1 elif cpuChoice == 3: cpuSCount+=3 print("Rock vs Scissors...") rBestPick+=1 print(bold + "You won!" + end,"Rock smashes scissors.\n") uWinWithRock+=1 wins+=1 elif playerChoice == "2": upaperCounter+=1 if cpuChoice == 1: cpuRCount+=1 print("Paper vs Rock...") pBestPick+=1 print(bold + "You won!" + end,"Paper covers rock.\n") uWinWithPaper+=1 wins+=1 elif cpuChoice == 2: cpuPCount+=1 print("Paper vs Paper...") sBestPick+=1 print(bold + "Its a tie!" + end,"\n") ties+=1 elif cpuChoice == 3: cpuSCount+=1 print("Paper vs Scissors...") rBestPick+=1 print(bold + "You lost!" + end,"Scissors cuts paper.\n") cWinWithScissors+=1 losses+=1 elif playerChoice == "3": uscissorsCounter+=1 if cpuChoice == 1: cpuRCount+=1 print("Scissors vs Rock...") pBestPick+=1 print(bold + "You lost!" + end,"Rock smashes scissors.\n") cWinWithRock+=1 losses+=1 elif cpuChoice == 2: cpuPCount+=1 print("Scissors vs Paper...") sBestPick+=1 print(bold + "You won!" + end,"scissors cuts paper.\n") uWinWithScissors+=1 wins+=1 elif cpuChoice == 3: cpuSCount+=1 print("Scissors vs Scissors...") rBestPick+=1 print(bold + "Its a tie!" + end,"\n") ties+=1 #invalid input check else: print("Invalid Input. Please try again and enter 1, 2, or 3\n") #play again check play = input("Do you wish to play again? (y = yes, n = no): ") ############################################################### #statistics output print("\n") print("Statistics:") print("===========") ############################################################### print("\nWins & Losses:") print("Wins: ",wins) print("Losses: ",losses) print("Ties: ",ties) ############################################################### print("\nUser Choices:") print("Rock: ",urockCounter) print("Paper: ",upaperCounter) print("Scissors: ",uscissorsCounter) ############################################################### print("\nGame Data Log:") userMostWon = "temp" cpuMostWon = "temp" ###User most won calculation### if (uWinWithRock > uWinWithPaper) and (uWinWithRock > uWinWithScissors): userMostWon = "Rock" elif (uWinWithPaper > uWinWithRock) and (uWinWithPaper > uWinWithScissors): userMostWon = "Paper" elif (uWinWithScissors > uWinWithRock) and (uWinWithScissors > uWinWithPaper): userMostWon = "Scissors" #2 = most won if (uWinWithRock == uWinWithPaper) and (uWinWithRock > uWinWithScissors): userMostWon = "Rock and Paper" elif (uWinWithRock == uWinWithScissors) and (uWinWithRock > uWinWithPaper): userMostWon = "Rock and Scissors" elif (uWinWithPaper == uWinWithScissors) and (uWinWithPaper > uWinWithRock): userMostWon = "Paper and Scissors" #all 3 = most won if (uWinWithRock == uWinWithPaper) and (uWinWithRock == uWinWithScissors): userMostWon = "Rock, Paper, and Scissors" ###Cpu most won calculation### if (cWinWithRock > cWinWithPaper) and (cWinWithRock > cWinWithScissors): cpuMostWon = "Rock" elif (cWinWithPaper > cWinWithRock) and (cWinWithPaper > cWinWithScissors): cpuMostWon = "Paper" elif (cWinWithScissors > cWinWithRock) and (cWinWithScissors > cWinWithPaper): cpuMostWon = "Scissors" #2 = most won if (cWinWithRock == cWinWithPaper) and (cWinWithRock > cWinWithScissors): cpuMostWon = "Rock and Paper" elif (cWinWithRock == cWinWithScissors) and (cWinWithRock > cWinWithPaper): cpuMostWon = "Rock and Scissors" elif (cWinWithPaper == cWinWithScissors) and (cWinWithPaper > cWinWithRock): cpuMostWon = "Paper and Scissors" #all 3 = most won if (cWinWithRock == cWinWithPaper) and (cWinWithRock == cWinWithScissors): cpuMostWon = "Rock, Paper, and Scissors" if wins > losses: print("The player won more rounds (",wins,")") print("They won with",userMostWon,"the most") elif wins < losses: print("The CPU won more rounds (",losses,")") print("They won with",cpuMostWon,"the most") elif wins == losses: print("The Player and CPU had the same number of wins (",wins,")") print("The Player won with",userMostWon,"the most") print("The CPU won with",cpuMostWon,"the most") ############################################################### #Checking for 1 best pick bestPossiblePick = "temp" if (rBestPick > pBestPick) and (rBestPick > sBestPick): bestPossiblePick = "Rock" elif (pBestPick > rBestPick) and (pBestPick > sBestPick): bestPossiblePick = "Paper" elif (sBestPick > rBestPick) and (sBestPick > pBestPick): bestPossiblePick = "Scissors" #Checking for 2 best picks if (rBestPick == pBestPick) and (rBestPick > sBestPick): bestPossiblePick = "Rock and Paper" elif (rBestPick == sBestPick) and (rBestPick > pBestPick): bestPossiblePick = "Rock and Scissors" elif (pBestPick == sBestPick) and (pBestPick > rBestPick): bestPossiblePick = "Paper and Scissors" #Checking for 3 best picks if (rBestPick == pBestPick) and (rBestPick == sBestPick): bestPossiblePick = "Rock, Paper, and Scissors all" print(bestPossiblePick,"would have had the most success against the CPU.\n") #end statistics output print("==============================================================================\n") ###END PROGRAM###
[ "noreply@github.com" ]
spencerleff.noreply@github.com
9f0846571f7f6f33eb7b3942c0efdb24085ae717
df8a2399a4221cc6a26599da2b54f7514c92c12b
/workers/admin.py
7a5de1c377536f47c6c01883010b6ed7dffe6627
[]
no_license
arviesan24/work-order
0b01a188e36c70a9f8c643d28f4ab850187cd3bd
8eb7c627ec184825775fac8e003136d9901e0e69
refs/heads/master
2022-12-10T12:33:30.376655
2019-07-05T12:39:58
2019-07-05T12:39:58
194,810,230
0
0
null
null
null
null
UTF-8
Python
false
false
140
py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from . import models admin.site.register(models.Worker)
[ "ctechnology24@gmail.com" ]
ctechnology24@gmail.com
1052fda9f08b17c87f2793ce873de2d347081517
e4a05504b7e60dc0cae94d3490970f67892bc2cb
/portal/settings/__init__.py
ab0db52b4263617d19492e102f6174207c55042b
[]
no_license
e-kolpakov/enforta
74d86a6b26a0154f7e19a8d051b78da2443f08db
d2251ff0918d3f4db44010e140837e0012347964
refs/heads/master
2016-08-07T08:50:32.069579
2014-07-24T09:35:03
2014-07-24T09:35:03
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,141
py
__author__ = 'john' import os import sys from base import * local_settings_file = os.environ.get('EnvironmentType', 'development') suppress_logging = ('migrate' in sys.argv or 'syncdb' in sys.argv) or \ os.environ.get('SuppressLogging', 'false') != 'false' if 'test' in sys.argv: local_settings_file = 'testing' sys.stderr.write("Importing local settings from {0}\n".format(local_settings_file)) try: _imported = __import__(local_settings_file, globals(), locals(), [], -1) for setting in dir(_imported): if setting == setting.upper(): locals()[setting] = getattr(_imported, setting) except ImportError: pass privileged_db_commands = ('schemamigration', 'migrate', 'syncdb') if any([command in sys.argv for command in privileged_db_commands]): locals()['DATABASES']['default']['USER'] = 'sa' locals()['DATABASES']['default']['PASSWORD'] = 'sa!v3ry_str0ng_p@ssw0rd#!' if suppress_logging: locals()['LOGGING'] = {} # a little fix to allow a slightly larger than limit files to still hit the form validations FILE_UPLOAD_MAX_MEMORY_SIZE = MAX_FILE_SIZE + 15 * 2 ** 20
[ "_john_@bk.ru" ]
_john_@bk.ru
a2100cac7941cd19dcee2530c093b2b1ba6b137b
a684cabb6db764055494e744752599c2d978f26b
/Lista 3/1.31.py
54260f51f99bff0df033339b54cc7049a7d748c2
[]
no_license
jarelio/FUP
c603c2264d160aca2a2e8a6dc7ba3af2baf6c04c
78555fe49e9046937483f7e4fcc6f1f135746d50
refs/heads/master
2020-04-17T04:53:04.097058
2019-01-17T18:06:38
2019-01-17T18:06:38
166,250,981
0
0
null
null
null
null
UTF-8
Python
false
false
112
py
N = int(input("Digite o valor de N: ")) S = 0 for i in range(1,N+1): S = S + (1/(i**i)) print("S =",S)
[ "jareliofilho@gmail.com" ]
jareliofilho@gmail.com
b6b46f05cb8776a297280f6cf9e0595b66791878
09e57dd1374713f06b70d7b37a580130d9bbab0d
/benchmark/startQiskit_Class3145.py
bb869a4f4a295214050862418c101162c39b79c1
[ "BSD-3-Clause" ]
permissive
UCLA-SEAL/QDiff
ad53650034897abb5941e74539e3aee8edb600ab
d968cbc47fe926b7f88b4adf10490f1edd6f8819
refs/heads/main
2023-08-05T04:52:24.961998
2021-09-19T02:56:16
2021-09-19T02:56:16
405,159,939
2
0
null
null
null
null
UTF-8
Python
false
false
4,412
py
# qubit number=4 # total number=47 import cirq import qiskit from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import FakeVigo from math import log2 import numpy as np import networkx as nx def bitwise_xor(s: str, t: str) -> str: length = len(s) res = [] for i in range(length): res.append(str(int(s[i]) ^ int(t[i]))) return ''.join(res[::-1]) def bitwise_dot(s: str, t: str) -> str: length = len(s) res = 0 for i in range(length): res += int(s[i]) * int(t[i]) return str(res % 2) def build_oracle(n: int, f) -> QuantumCircuit: # implement the oracle O_f # NOTE: use multi_control_toffoli_gate ('noancilla' mode) # https://qiskit.org/documentation/_modules/qiskit/aqua/circuits/gates/multi_control_toffoli_gate.html # https://quantumcomputing.stackexchange.com/questions/3943/how-do-you-implement-the-toffoli-gate-using-only-single-qubit-and-cnot-gates # https://quantumcomputing.stackexchange.com/questions/2177/how-can-i-implement-an-n-bit-toffoli-gate controls = QuantumRegister(n, "ofc") target = QuantumRegister(1, "oft") oracle = QuantumCircuit(controls, target, name="Of") for i in range(2 ** n): rep = np.binary_repr(i, n) if f(rep) == "1": for j in range(n): if rep[j] == "0": oracle.x(controls[j]) oracle.mct(controls, target[0], None, mode='noancilla') for j in range(n): if rep[j] == "0": oracle.x(controls[j]) # oracle.barrier() return oracle def make_circuit(n:int,f) -> QuantumCircuit: # circuit begin input_qubit = QuantumRegister(n,"qc") classical = ClassicalRegister(n, "qm") prog = QuantumCircuit(input_qubit, classical) prog.h(input_qubit[3]) # number=16 prog.cz(input_qubit[0],input_qubit[3]) # number=17 prog.h(input_qubit[3]) # number=18 prog.cx(input_qubit[0],input_qubit[3]) # number=44 prog.x(input_qubit[3]) # number=45 prog.cx(input_qubit[0],input_qubit[3]) # number=46 prog.h(input_qubit[3]) # number=24 prog.cz(input_qubit[0],input_qubit[3]) # number=25 prog.h(input_qubit[3]) # number=26 prog.h(input_qubit[1]) # number=2 prog.h(input_qubit[2]) # number=3 prog.h(input_qubit[3]) # number=4 prog.h(input_qubit[0]) # number=5 oracle = build_oracle(n-1, f) prog.append(oracle.to_gate(),[input_qubit[i] for i in range(n-1)]+[input_qubit[n-1]]) prog.h(input_qubit[1]) # number=6 prog.h(input_qubit[2]) # number=30 prog.cz(input_qubit[0],input_qubit[2]) # number=31 prog.h(input_qubit[2]) # number=32 prog.x(input_qubit[2]) # number=28 prog.h(input_qubit[2]) # number=39 prog.cz(input_qubit[0],input_qubit[2]) # number=40 prog.h(input_qubit[2]) # number=41 prog.h(input_qubit[2]) # number=7 prog.h(input_qubit[3]) # number=8 prog.h(input_qubit[0]) # number=9 prog.h(input_qubit[2]) # number=36 prog.cz(input_qubit[3],input_qubit[2]) # number=37 prog.h(input_qubit[2]) # number=38 prog.cx(input_qubit[2],input_qubit[0]) # number=10 prog.h(input_qubit[0]) # number=19 prog.cz(input_qubit[2],input_qubit[0]) # number=20 prog.h(input_qubit[0]) # number=21 prog.h(input_qubit[3]) # number=33 prog.cz(input_qubit[2],input_qubit[3]) # number=34 prog.h(input_qubit[3]) # number=35 prog.x(input_qubit[2]) # number=42 prog.x(input_qubit[2]) # number=43 # circuit end return prog if __name__ == '__main__': a = "111" b = "0" f = lambda rep: bitwise_xor(bitwise_dot(a, rep), b) prog = make_circuit(4,f) backend = BasicAer.get_backend('statevector_simulator') sample_shot =8000 info = execute(prog, backend=backend).result().get_statevector() qubits = round(log2(len(info))) info = { np.binary_repr(i, qubits): round((info[i]*(info[i].conjugate())).real,3) for i in range(2 ** qubits) } backend = FakeVigo() circuit1 = transpile(prog,backend,optimization_level=2) writefile = open("../data/startQiskit_Class3145.csv","w") print(info,file=writefile) print("results end", file=writefile) print(circuit1.__len__(),file=writefile) print(circuit1,file=writefile) writefile.close()
[ "wangjiyuan123@yeah.net" ]
wangjiyuan123@yeah.net
dccdeed268be18dba9142290de732b5e20ad30c8
3e7fc64d3498229b8d4dcf7d12a2e90788f84e94
/python/basic/numpy/test02_array.py
3a6beff98aa8b84795429f83e2aaed9bb915b46e
[]
no_license
elim168/study
22574bdd30eace794238f3dcc226e5ea9f482245
370e5bd3dc89bc68ac1f2f2f3af816db60da6f43
refs/heads/master
2023-03-30T16:10:20.783312
2022-03-05T15:05:15
2022-03-05T15:05:15
164,266,016
2
1
null
2023-03-08T17:28:40
2019-01-06T01:38:03
Java
UTF-8
Python
false
false
498
py
import numpy # 创建一维的数组,基于一维的列表 ndarray = numpy.array([1, 2, 3, 4, 5, 6]) print(ndarray) print(type(ndarray)) # <class 'numpy.ndarray'> # 创建二维的数组,基于二维的列表。三维/四维等也是类似的道理 ndarray = numpy.array([[1, 2, 3, 4, 5], [2, 3, 4, 5, 6], [3, 4, 5, 6, 7]]) print(ndarray) # 通过ndmin指定最小维度 ndarray = numpy.array([1, 2, 3], ndmin=5) # 指定创建的数组最小为5维 print(ndarray) # [[[[[1 2 3]]]]]
[ "yeelimzhang@163.com" ]
yeelimzhang@163.com
341a80e3c6a827e23cdef7a5523dfa7ecd574848
1bad7d2b7fc920ecf2789755ed7f44b039d4134d
/ABC/49/C.py
be898c73880a7966daa9ae201ead9692637f967a
[]
no_license
kanekyo1234/AtCoder_solve
ce95caafd31f7c953c0fc699f0f4897dddd7a159
e5ea7b080b72a2a2fd3fcb826cd10c4ab2e2720e
refs/heads/master
2023-04-01T04:01:15.885945
2021-04-06T04:03:31
2021-04-06T04:03:31
266,151,065
0
0
null
null
null
null
UTF-8
Python
false
false
311
py
print("日本語を入力してください:", end="") s = input() while 0 < len(s): if s[-5:] == 'erase' or s[-5:] == 'dream': s = s[0:-5] elif s[-6:] == 'eraser': s = s[0:-6] elif s[-7:] == 'dreamer': s = s[0:-7] else: print("NO") exit() print("YES")
[ "kanekyohunter.0314@softbank.ne.jp" ]
kanekyohunter.0314@softbank.ne.jp
e0b5cf36da9ef9b9aefe160d824197ecb05c33ee
a09b1ce1122f93d16d8169d8422261bd0123aeb9
/Konjac.py
29d7d79b8806d0c521c9d904be0fd7852ccbacc8
[]
no_license
ZhouYunYong/ChatBot_Wiki
4e888fd97a86c8577a525a497348b5c5d8c51663
4d04e35336ab36964af18e4668e3ac7ce7748e26
refs/heads/master
2020-03-28T22:59:53.728295
2018-10-05T02:02:58
2018-10-05T02:02:58
149,270,136
0
0
null
null
null
null
UTF-8
Python
false
false
435
py
# -*- coding: utf8 -*- import ChatBot_Wiki # 安裝套件 pip install googletrans from googletrans import Translator trans_lang = 'ja' # zh-tw, ja translator = Translator() # 建立翻譯物件 #result = translator.translate('你好嗎', dest='en').text #print(result) speech = ChatBot_Wiki.stt() print(speech) result = translator.translate(speech, dest=trans_lang).text print(result) ChatBot_Wiki.speak(result, trans_lang)
[ "u9822113@gm.nuu.edu.tw" ]
u9822113@gm.nuu.edu.tw
c72a9cb5585570868125f3f330690dd77f6a82be
f4ae212a2c5698e761b6b58fdf9a18031ec724b0
/mini_fb/admin.py
8b0825d2de5882c44bb661e81eb82ab3b0121bf0
[]
no_license
jnothaft/Biobank-Covid19
47dc3748c7e22d5a8f6e91a56675bf5b99764e0a
5b7b4625e126862769cb3893700b6682738e6baf
refs/heads/main
2023-04-19T10:49:13.607248
2021-04-29T02:26:43
2021-04-29T02:26:43
343,625,827
0
0
null
null
null
null
UTF-8
Python
false
false
229
py
# mini_fb/admin.py # Julia Santos Nothaft (jnothaft@bu.edu) # Register models from django.contrib import admin # Register your models here. from .models import * admin.site.register(Profile) admin.site.register(StatusMessage)
[ "jnothaft@bu.edu" ]
jnothaft@bu.edu
55b854f4988479288a26767419ba9b1ecdade4aa
12e09350c484ac3e9858c8f6799d575ad5cff449
/baselines/baselines/ppo_moba/defaults.py
2490804008470b4a12c040b03469e29444e569e6
[ "MIT" ]
permissive
gerrysonx/moba_env
94e0e5cca7202be103523a8d91b1003af6eb6f56
b1426397d8863f72d4db5db52208509e745a175d
refs/heads/master
2023-06-13T09:03:39.493833
2021-07-01T09:24:22
2021-07-01T09:24:22
218,009,980
4
2
null
2022-06-13T20:17:06
2019-10-28T09:25:29
Python
UTF-8
Python
false
false
237
py
def gym_moba(): return dict( nsteps=2048*8, nminibatches=32, lam=0.95, gamma=0.99, noptepochs=4, log_interval=1, ent_coef=0.01, vf_coef=1.0, lr=lambda f : f * 3e-3, cliprange=0.2, )
[ "1755914811@qq.com" ]
1755914811@qq.com
d8d29bd818c802f35d4fc7e835f9d9be37379d3b
d5468f9cc80f2de38e871e232fa85a1e9b61e9f5
/python練習/GeometricObject_Inheritance/GeometricObject.py
7d45008c8fffc5c63b007d48d7e10a2af6dec996
[]
no_license
SamSSY/ObjectAndClass
1cf46368c6301b61eb0e2d942b92a7d191dc6d90
13a3db7349df38a77806009ddfbb1e748f4ee453
refs/heads/master
2023-06-02T21:07:25.463620
2021-06-23T13:14:55
2021-06-23T13:14:55
null
0
0
null
null
null
null
UTF-8
Python
false
false
569
py
class GeometricObject: def __init__(self, color, filled): self.__color = color self.__filled = filled def setColor(self, color): self.__color = color def setFilled(self, filled): self.__filled = filled def getColor(self): return self.__color def isFilled(self): return self.__filled def __str__(self): print("color: {} and filled: {}\n".format(self.__color, self.__filled)) #return "color: "+str(self.__color)+" and filled: "+str(self.__filled)
[ "45253893+hoopizs1452@users.noreply.github.com" ]
45253893+hoopizs1452@users.noreply.github.com
5f00af26807bbbde59d01c330e96f1d5daa3d74c
7559c169f9460a0806c7c1976f1dca7edd1ed1df
/metabolinks/elementcomp.py
c7fe86b1b4bc742d969137089ac73866c719e3f7
[ "MIT" ]
permissive
AspirinCode/metabolinks
88615d0a5479d2e1b76e54db4ed80d549cb74406
60d3e8f462801078ad0759cee191ab144daf2982
refs/heads/master
2020-04-17T17:29:20.859008
2018-05-01T18:35:43
2018-05-01T18:35:43
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,019
py
from collections import Counter def element_composition(df, column=None, compositions = ('CHO', 'CHOS', 'CHON', 'CHONS', 'CHOP', 'CHONP', 'CHONSP'), verbose=True): formulae = df[column].str.split('#').apply(set).apply(list) # print(formulas) # remove unambigous formulae is_1 = [True if len(f) == 1 else False for f in formulae.values] formulae = formulae[is_1] #print(formulae) # convert to list of strings and remove duplicates formulae = list(set([f[0] for f in formulae.values])) #print(formulae) if verbose: print(len(formulae), 'formulae') # Calculate element compositions comps = [] for formula in formulae: # remove numbers exclude = "0123456789,.[]() " for chr in exclude: formula = formula.replace(chr,'') # count according to composition groups for c in compositions: if set(formula) == set(c): comps.append(c) break else: comps.append('other') elem_comp = Counter(comps) ## for f, c in zip(formulae, comps): ## print(f, c) return elem_comp if __name__ == '__main__': from metabolinks.masstrix import read_MassTRIX testfile_name = '../example_data/masses.annotated.reformat.tsv' df = read_MassTRIX(testfile_name).cleanup_cols() print("File {} was read\n".format(testfile_name)) df.info() print('\n+++++++++++++++++++++++++++++++') compositions = ['CHO', 'CHOS', 'CHON', 'CHONS', 'CHOP', 'CHONP', 'CHONSP'] elem_comp = element_composition(df, column='KEGG_formula', compositions=compositions) for c in compositions + ['other']: print(c, elem_comp[c])
[ "ferreiae@gmail.com" ]
ferreiae@gmail.com
9e24893392a09c88810197dace74fcdb4efaefbe
94fe232eb83cad3dac43f1e629f4aef8f5018d58
/recursive_index.py
4b4a0c0cc5cd2eceb499bf9edd8cacc994589946
[]
no_license
anulachoudhary/Leetcode
64717840a2e0cd01f44ca10c8acabbcc91a4b5df
9bc48cb0bfa747f0334ed996db8565edbfb50135
refs/heads/master
2020-03-08T01:17:09.859569
2018-04-04T15:51:18
2018-04-04T15:51:18
127,826,559
0
0
null
null
null
null
UTF-8
Python
false
false
1,019
py
# Find the index of an item in a list using recursion. # Given a list of items: # >>> lst = ["hey", "there", "you"] # You should have a function that returns the 0-based index of a sought item: # >>> recursive_search("hey", lst) # 0 # >>> recursive_search("you") # 2 # If the item isn’t in the list, return None: # >>> recursive_search("porcupine", lst) is None # True def recursive_index(needle, haystack): """Given list (haystack), return index (0-based) of needle in the list. Return None if needle is not in haystack. Do this with recursion. You MAY NOT USE A `for` OR `while` LOOP. """ # START SOLUTION def _recursive_index(needle, haystack, start_at): # Check if not found (we've gone too far) if start_at == len(haystack): return None # Have we found it? if haystack[start_at] == needle: return start_at return _recursive_index(needle, haystack, start_at + 1) return _recursive_index(needle, haystack, 0)
[ "vagrant@vagrant.vm" ]
vagrant@vagrant.vm
db844400490fdc527aed8075c5134890918470b2
5bc13c594a855601c1498dbd5631c203b5741521
/Examples/pandasTesting.py
dd73c3820beb1c0dd315a3423728e2b725c25bf5
[ "MIT" ]
permissive
shinn5112/Load-Testing
68debd0eebc1136291cab7136484468d76c01b7a
582210974aca1acf79ce216a64cd830c8c1b313a
refs/heads/master
2022-05-04T04:59:40.651619
2018-05-21T22:47:03
2018-05-21T22:47:03
null
0
0
null
null
null
null
UTF-8
Python
false
false
484
py
# @author Patrick Shinn # @version 5/21/18 from pandas import read_csv from matplotlib import pyplot as plt # reading in the data df = read_csv("/home/patrick/Github/research/Load-Testing/LoadTest/n1/linux_bare/test1/Driver-2017-07-19_16:15:26.csv", sep='\t') print(type(df)) # shows that df is a pandas data frame print(df.head(5)) # prints the first 5 entries print(df.dtypes) # prints data types of columns df.reset_index().plot(y=" write_bytes") plt.show()
[ "shinn16@marshall.edu" ]
shinn16@marshall.edu
f90ecbb09813f36f5339f1a1046d8b79103e6efd
4d24ec56c1ca3f65ab2ef07e3053bf940da45ca3
/utils/word_util.py
c02d02b5e790824e942fccfc486e92b556aeb5d5
[]
no_license
ming99999/docs
3e1b34267f7cdd0fe9e56e0c2a6cc495d6451692
d981e251e557486fab18907e9d1987c17cf0e552
refs/heads/main
2023-07-28T03:35:12.914130
2021-09-07T05:46:08
2021-09-07T05:46:08
349,616,941
0
0
null
null
null
null
UTF-8
Python
false
false
3,441
py
import re, os, math import collections from collections import Counter from pymongo import MongoClient doublespace_pattern = re.compile(u"\s+", re.UNICODE) bracket_pattern = re.compile(r"\([^()]*?\)|\[.*?\]|\<.*?\>|\{.*?\}|\【.*?】|\(.*?\(.*?\).*?\)") junk_filter = re.compile(u"^[a-zA-Z0-9?><;,.{}()[\]\-_+=!@#$%\^&*|/\n\t\s']{8,}", re.UNICODE) head_filter = re.compile(u"[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9\.\?\!\s]+= ", re.UNICODE) text_filter = re.compile(u'[^ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9\.\?\!-%]', re.UNICODE) delete_filter = re.compile(r"[\'\"″“”‘’\?\!\.,…▲△□■※☆★▷▶▽▼『』#○●☆★#◇◆ㅁ]") space_filter = re.compile(r"[*·…‥♡♥\:=]|\.{2}") #Basic def only_text(text): return doublespace_pattern.sub(' ',text_filter.sub(' ', text)).strip() def text_clearing(text): return doublespace_pattern.sub(' ', space_filter.sub(' ', delete_filter.sub('', text))).strip() def clear_bracket_regex(text): return bracket_pattern.sub("", text) def xplit(value, delimiters): return re.split('|'.join([re.escape(delimiter) for delimiter in delimiters]), value) # Application def sentence_prep(text): cleared_sentences = [] cleared = xplit(clear_bracket_regex(text), ['. ', '\n', '.\n', '\r\n', '.\r\n']) for sentence in cleared : if sentence and not junk_filter.match(sentence) : sentence_h = head_filter.sub(" ", sentence.strip()) if sentence_h : cleared_sentences.append(re.sub(r"[.]$", "" , doublespace_pattern.sub(" ", sentence_h.replace("&apos;", "")))) return cleared_sentences def sentence_prep2(text): cleared_sentences = [] cleared = xplit(clear_bracket_regex(text), ['. ', '\n', '.\n', '\r\n', '.\r\n']) for sentence in cleared : if sentence and not junk_filter.match(sentence) : cleared_sentences.append(re.sub(r"[.]$", "", text_clearing(sentence))) return cleared_sentences def sentence_prep_str(text) : cleared_content = sentence_prep2(text) return "\n".join([x.strip() for x in cleared_content]) def tag_sellector(text, tagger, tag_list): return [x[0] for x in tagger.pos(text) if x[1] in tag_list] def make_batch(list, batch_num = 5) : custom_batch = [] period = int(len(list) / batch_num) for i in range(0, batch_num) : custom_batch.append(list[i * period : (i+1) * period]) return custom_batch # Trick pos_set = ['Noun', 'Verb', 'Alpha'] ''' def selected_tokenizer(sent, pos = pos_set) : return [x[0] for x in _twitter.pos(sent) if len(x[0]) > 1 and x[1] in pos] ''' # Sentence def word_count(text, tagger) : tokenized = ["/".join(t) for t in tagger.pos(text, norm=True, stem=True)] word_counter = collections.Counter(tokenized) return word_counter def cosine_similar(sent1, sent2, tokenizer = False) : vec1 = Counter() vec2 = Counter() if not tokenizer : tokenizer = lambda x : x.split() vec1.update(tokenizer(sent1)) vec2.update(tokenizer(sent2)) intersection = set(vec1.keys()) & set(vec2.keys()) numerator = sum([vec1[x] * vec2[x] for x in intersection]) sum1 = sum([vec1[x]**2 for x in vec1.keys()]) sum2 = sum([vec2[x]**2 for x in vec2.keys()]) denominator = math.sqrt(sum1) * math.sqrt(sum2) if not denominator: return 0.0 else: return round(float(numerator) / denominator, 3)
[ "mink99999@gmail.com" ]
mink99999@gmail.com
e695c19a5f1f720efecf7d4107bf3b879b05aeeb
acb8e84e3b9c987fcab341f799f41d5a5ec4d587
/langs/0/ac6.py
6fea4f057dfb2a21d646372ebf21d889ec20e7f7
[]
no_license
G4te-Keep3r/HowdyHackers
46bfad63eafe5ac515da363e1c75fa6f4b9bca32
fb6d391aaecb60ab5c4650d4ae2ddd599fd85db2
refs/heads/master
2020-08-01T12:08:10.782018
2016-11-13T20:45:50
2016-11-13T20:45:50
73,624,224
0
1
null
null
null
null
UTF-8
Python
false
false
486
py
import sys def printFunction(lineRemaining): if lineRemaining[0] == '"' and lineRemaining[-1] == '"': if len(lineRemaining) > 2: #data to print lineRemaining = lineRemaining[1:-1] print ' '.join(lineRemaining) else: print def main(fileName): with open(fileName) as f: for line in f: data = line.split() if data[0] == 'aC6': printFunction(data[1:]) else: print 'ERROR' return if __name__ == '__main__': main(sys.argv[1])
[ "juliettaylorswift@gmail.com" ]
juliettaylorswift@gmail.com
75e2f4092285301045763dea8c953c8f952bf37d
a2b6bc9bdd2bdbe5871edb613065dd2397175cb3
/简单/汉明距离.py
d3bf05069015bf75a53db11d6434f6872af53a63
[]
no_license
Asunqingwen/LeetCode
ed8d2043a31f86e9e256123439388d7d223269be
b7c59c826bcd17cb1333571eb9f13f5c2b89b4ee
refs/heads/master
2022-09-26T01:46:59.790316
2022-09-01T08:20:37
2022-09-01T08:20:37
95,668,066
0
0
null
null
null
null
UTF-8
Python
false
false
672
py
""" 两个整数之间的汉明距离指的是这两个数字对应二进制位不同的位置的数目。 给出两个整数 x 和 y,计算它们之间的汉明距离。 注意: 0 ≤ x, y < 231. 示例: 输入: x = 1, y = 4 输出: 2 解释: 1 (0 0 0 1) 4 (0 1 0 0) ↑ ↑ 上面的箭头指出了对应二进制位不同的位置。 """ class Solution: def hammingDistance(self, x: int, y: int) -> int: num = x ^ y res = 0 while num > 0: res += 1 num &= (num - 1) return res if __name__ == '__main__': x = 1 y = 4 sol = Solution() print(sol.hammingDistance(x, y))
[ "sqw123az@sina.com" ]
sqw123az@sina.com
248b7891fe92ae3a3344e30b2e68e718f14b7542
7d999d526e8fd1b0face4ee52da55f75c64319d2
/test/servo-test-3.py
5943848c456760c23425a93f1bd4fb81956bf51c
[]
no_license
katiehsieh/candy-machine
6c23c6e67454c7ccb5033786aaa4e3f4dd396631
5e409de8579cfcdc1da93f63f1b8e7783c24af47
refs/heads/main
2023-04-29T08:48:43.814739
2021-05-23T03:00:36
2021-05-23T03:00:36
364,779,614
0
0
null
null
null
null
UTF-8
Python
false
false
521
py
# https://www.instructables.com/Servo-Motor-Control-With-Raspberry-Pi/ import RPi.GPIO as GPIO import time servoPIN = 16 GPIO.setmode(GPIO.BCM) GPIO.setup(servoPIN, GPIO.OUT) p = GPIO.PWM(servoPIN, 50) # GPIO 16 for PWM with 50Hz p.start(2.5) # Initialization def SetAngle(angle): duty = angle / 18 + 2 GPIO.output(servoPIN, True) p.ChangeDutyCycle(duty) time.sleep(1) GPIO.output(servoPIN, False) p.ChangeDutyCycle(0) SetAngle(90) time.sleep(5) SetAngle(0) time.sleep(5) SetAngle(180) p.stop() GPIO.cleanup()
[ "kjhsieh@ucsd.edu" ]
kjhsieh@ucsd.edu
32346064c822176b39158d2eb263b3fe1878a121
9cbd523cdedc727f62c887612e8ae2c25c909964
/tests/lib/steps/check_TID_030.py
1c1345b2ce0889bd6a26b58d396a7d1d3e99fb1e
[]
no_license
louiscklaw/QA_test_scripts
8a71d0bed99fae3b0dac4cd9414b3e34dcf5beed
58b73594332053272d8dce2c812c93297259c782
refs/heads/master
2023-01-27T15:48:29.477848
2020-12-06T10:05:19
2020-12-06T10:05:19
null
0
0
null
null
null
null
UTF-8
Python
false
false
954
py
import random from pprint import pprint import please_take_seat_first_dialogue import line_up_page import food_menu import line_up_confirmation_dialogue import item_add_page import cart_page from config import * from time import sleep from assert_check_point import assertCheckPoint from stubs.server.assign_table.assign_table_by_name import assignTableByName import restaurant_manage.admin_page def run_check(json_metadata, browser): TEST_ERR_MSG='test failed at TID_030' assertCheckPoint(browser, 'TID_030_1', TEST_ERR_MSG) admin_page_po = restaurant_manage.admin_page.Main(browser) admin_page_po.tapSiteNavigator() assertCheckPoint(browser, 'TID_030_2', TEST_ERR_MSG) admin_page_with_site_nav_po = restaurant_manage.admin_page.SiteNavigatorPopup(browser) # click food control admin_page_with_site_nav_po.tapOrderManagmentButton() assertCheckPoint(browser, 'TID_030_3', TEST_ERR_MSG) json_metadata['TID_030'] = 'passed'
[ "louiscklaw@gmail.com" ]
louiscklaw@gmail.com
6ea5632e8877e1819cf57e9d53cbf6fb9de7992c
17d9c5801970d8e3a6d24465c061ef34e40290ee
/probe/lib/__init__.py
65a9980f069319334f016e173f1eea1366176395
[ "MIT" ]
permissive
krstnschwpwr/speedcontrol
02490ab5d769e26579f7b0a4cbef76892db1ae5d
2de5900a6a74038ea1f36739d26a6fd815732c2f
refs/heads/master
2021-01-13T15:00:40.435914
2017-03-06T08:35:49
2017-03-06T08:35:49
79,347,058
2
1
null
null
null
null
UTF-8
Python
false
false
12
py
flags="test"
[ "schwabauer.kristine@me.com" ]
schwabauer.kristine@me.com
2b42014f9e3ae9cecc498c3bdd0888eab9c42893
e6dab5aa1754ff13755a1f74a28a201681ab7e1c
/.parts/lib/requests/requests/status_codes.py
9c9c3a6459327f4822ea365551f103b1e4a25db5
[]
no_license
ronkagan/Euler_1
67679203a9510147320f7c6513eefd391630703e
022633cc298475c4f3fd0c6e2bde4f4728713995
refs/heads/master
2021-01-06T20:45:52.901025
2014-09-06T22:34:16
2014-09-06T22:34:16
23,744,842
0
1
null
null
null
null
UTF-8
Python
false
false
88
py
/home/action/.parts/packages/googleappengine/1.9.4/lib/requests/requests/status_codes.py
[ "ron.y.kagan@gmail.com" ]
ron.y.kagan@gmail.com
f215a56a4eb5cbe10b5b04efa4c7762c7c08897a
056ce350bf4f56a8047e673a5458632debd9802b
/benchmark/experiments/submission_scripts/2_systems.py
3bf14e562e244561b91f97fb59672b5c42715822
[ "MIT" ]
permissive
LaYeqa/integrator-benchmark
a2402d37754682f442298fbe2554ae25f7af063d
bb307e6ebf476b652e62e41ae49730f530732da3
refs/heads/master
2021-09-10T15:41:31.040482
2018-02-12T19:49:29
2018-02-12T19:49:29
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,686
py
import os import numpy as np from simtk import unit from benchmark import DATA_PATH from benchmark.experiments.driver import ExperimentDescriptor, Experiment from benchmark.testsystems import dhfr_constrained, alanine_constrained, t4_constrained, waterbox_constrained splittings = {"OVRVO": "O V R V O", "ORVRO": "O R V R O", "RVOVR": "R V O V R", "VRORV": "V R O R V", } systems = {"Alanine dipeptide in vacuum (constrained)": alanine_constrained, "T4 lysozyme in implicit solvent (constrained)": t4_constrained, "DHFR in explicit solvent (constrained)": dhfr_constrained, "TIP3P water (rigid)": waterbox_constrained } dt_range = np.array([0.1] + list(np.arange(0.5, 10.001, 0.5))) marginals = ["configuration", "full"] collision_rates = {"low": 1.0 / unit.picoseconds} n_protocol_samples = {"Alanine dipeptide in vacuum (constrained)": 10000, "T4 lysozyme in implicit solvent (constrained)": 1000, "DHFR in explicit solvent (constrained)": 1000, "TIP3P water (rigid)": 1000 } protocol_length = 1000 experiment_name = "2_systems" experiments = [] i = 1 for splitting_name in sorted(splittings.keys()): for system_name in sorted(systems.keys()): for dt in dt_range: for marginal in marginals: for collision_rate_name in sorted(collision_rates.keys()): partial_fname = "{}_{}.pkl".format(experiment_name, i) full_filename = os.path.join(DATA_PATH, partial_fname) experiment_descriptor = ExperimentDescriptor( experiment_name=experiment_name, system_name=system_name, equilibrium_simulator=systems[system_name], splitting_name=splitting_name, splitting_string=splittings[splitting_name], timestep_in_fs=dt, marginal=marginal, collision_rate_name=collision_rate_name, collision_rate=collision_rates[collision_rate_name], n_protocol_samples=n_protocol_samples[system_name], protocol_length=protocol_length, h_mass_factor=1 ) experiments.append(Experiment(experiment_descriptor, full_filename)) i += 1 if __name__ == "__main__": print(len(experiments)) import sys job_id = int(sys.argv[1]) experiments[job_id].run_and_save()
[ "jf694@cornell.edu" ]
jf694@cornell.edu
eebd4a56a759ebbe78f353d92cd9279ccfc73aa7
dc9283f4ce9bc5b7be3685970c477f7058251531
/python/omnisci/thrift/OmniSci.py
fd2d7dfeb4e52b67872b3ae4b946187f56cfa3df
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
ngocbd/omniscidb
24df8b02c656d2682f59b8fa2f42c6ffd18c3ded
9dd4500d9d1d635cccf770b69f7ee236ea4ef9dc
refs/heads/master
2023-01-19T16:53:47.721143
2020-11-24T09:36:44
2020-11-24T09:36:44
283,070,278
0
0
Apache-2.0
2020-11-24T09:36:45
2020-07-28T02:03:42
null
UTF-8
Python
false
true
670,378
py
# # Autogenerated by Thrift Compiler (0.13.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport all_structs = [] class Iface(object): def connect(self, user, passwd, dbname): """ Parameters: - user - passwd - dbname """ pass def krb5_connect(self, inputToken, dbname): """ Parameters: - inputToken - dbname """ pass def disconnect(self, session): """ Parameters: - session """ pass def switch_database(self, session, dbname): """ Parameters: - session - dbname """ pass def clone_session(self, session): """ Parameters: - session """ pass def get_server_status(self, session): """ Parameters: - session """ pass def get_status(self, session): """ Parameters: - session """ pass def get_hardware_info(self, session): """ Parameters: - session """ pass def get_tables(self, session): """ Parameters: - session """ pass def get_physical_tables(self, session): """ Parameters: - session """ pass def get_views(self, session): """ Parameters: - session """ pass def get_tables_meta(self, session): """ Parameters: - session """ pass def get_table_details(self, session, table_name): """ Parameters: - session - table_name """ pass def get_internal_table_details(self, session, table_name): """ Parameters: - session - table_name """ pass def get_users(self, session): """ Parameters: - session """ pass def get_databases(self, session): """ Parameters: - session """ pass def get_version(self): pass def start_heap_profile(self, session): """ Parameters: - session """ pass def stop_heap_profile(self, session): """ Parameters: - session """ pass def get_heap_profile(self, session): """ Parameters: - session """ pass def get_memory(self, session, memory_level): """ Parameters: - session - memory_level """ pass def clear_cpu_memory(self, session): """ Parameters: - session """ pass def clear_gpu_memory(self, session): """ Parameters: - session """ pass def set_table_epoch(self, session, db_id, table_id, new_epoch): """ Parameters: - session - db_id - table_id - new_epoch """ pass def set_table_epoch_by_name(self, session, table_name, new_epoch): """ Parameters: - session - table_name - new_epoch """ pass def get_table_epoch(self, session, db_id, table_id): """ Parameters: - session - db_id - table_id """ pass def get_table_epoch_by_name(self, session, table_name): """ Parameters: - session - table_name """ pass def get_session_info(self, session): """ Parameters: - session """ pass def sql_execute(self, session, query, column_format, nonce, first_n, at_most_n): """ Parameters: - session - query - column_format - nonce - first_n - at_most_n """ pass def sql_execute_df(self, session, query, device_type, device_id, first_n, transport_method): """ Parameters: - session - query - device_type - device_id - first_n - transport_method """ pass def sql_execute_gdf(self, session, query, device_id, first_n): """ Parameters: - session - query - device_id - first_n """ pass def deallocate_df(self, session, df, device_type, device_id): """ Parameters: - session - df - device_type - device_id """ pass def interrupt(self, query_session, interrupt_session): """ Parameters: - query_session - interrupt_session """ pass def sql_validate(self, session, query): """ Parameters: - session - query """ pass def get_completion_hints(self, session, sql, cursor): """ Parameters: - session - sql - cursor """ pass def set_execution_mode(self, session, mode): """ Parameters: - session - mode """ pass def render_vega(self, session, widget_id, vega_json, compression_level, nonce): """ Parameters: - session - widget_id - vega_json - compression_level - nonce """ pass def get_result_row_for_pixel(self, session, widget_id, pixel, table_col_names, column_format, pixelRadius, nonce): """ Parameters: - session - widget_id - pixel - table_col_names - column_format - pixelRadius - nonce """ pass def get_dashboard(self, session, dashboard_id): """ Parameters: - session - dashboard_id """ pass def get_dashboards(self, session): """ Parameters: - session """ pass def create_dashboard(self, session, dashboard_name, dashboard_state, image_hash, dashboard_metadata): """ Parameters: - session - dashboard_name - dashboard_state - image_hash - dashboard_metadata """ pass def replace_dashboard(self, session, dashboard_id, dashboard_name, dashboard_owner, dashboard_state, image_hash, dashboard_metadata): """ Parameters: - session - dashboard_id - dashboard_name - dashboard_owner - dashboard_state - image_hash - dashboard_metadata """ pass def delete_dashboard(self, session, dashboard_id): """ Parameters: - session - dashboard_id """ pass def share_dashboards(self, session, dashboard_ids, groups, permissions): """ Parameters: - session - dashboard_ids - groups - permissions """ pass def delete_dashboards(self, session, dashboard_ids): """ Parameters: - session - dashboard_ids """ pass def share_dashboard(self, session, dashboard_id, groups, objects, permissions, grant_role): """ Parameters: - session - dashboard_id - groups - objects - permissions - grant_role """ pass def unshare_dashboard(self, session, dashboard_id, groups, objects, permissions): """ Parameters: - session - dashboard_id - groups - objects - permissions """ pass def unshare_dashboards(self, session, dashboard_ids, groups, permissions): """ Parameters: - session - dashboard_ids - groups - permissions """ pass def get_dashboard_grantees(self, session, dashboard_id): """ Parameters: - session - dashboard_id """ pass def get_link_view(self, session, link): """ Parameters: - session - link """ pass def create_link(self, session, view_state, view_metadata): """ Parameters: - session - view_state - view_metadata """ pass def load_table_binary(self, session, table_name, rows): """ Parameters: - session - table_name - rows """ pass def load_table_binary_columnar(self, session, table_name, cols): """ Parameters: - session - table_name - cols """ pass def load_table_binary_arrow(self, session, table_name, arrow_stream): """ Parameters: - session - table_name - arrow_stream """ pass def load_table(self, session, table_name, rows): """ Parameters: - session - table_name - rows """ pass def detect_column_types(self, session, file_name, copy_params): """ Parameters: - session - file_name - copy_params """ pass def create_table(self, session, table_name, row_desc, file_type, create_params): """ Parameters: - session - table_name - row_desc - file_type - create_params """ pass def import_table(self, session, table_name, file_name, copy_params): """ Parameters: - session - table_name - file_name - copy_params """ pass def import_geo_table(self, session, table_name, file_name, copy_params, row_desc, create_params): """ Parameters: - session - table_name - file_name - copy_params - row_desc - create_params """ pass def import_table_status(self, session, import_id): """ Parameters: - session - import_id """ pass def get_first_geo_file_in_archive(self, session, archive_path, copy_params): """ Parameters: - session - archive_path - copy_params """ pass def get_all_files_in_archive(self, session, archive_path, copy_params): """ Parameters: - session - archive_path - copy_params """ pass def get_layers_in_geo_file(self, session, file_name, copy_params): """ Parameters: - session - file_name - copy_params """ pass def query_get_outer_fragment_count(self, session, query): """ Parameters: - session - query """ pass def check_table_consistency(self, session, table_id): """ Parameters: - session - table_id """ pass def start_query(self, leaf_session, parent_session, query_ra, just_explain, outer_fragment_indices): """ Parameters: - leaf_session - parent_session - query_ra - just_explain - outer_fragment_indices """ pass def execute_query_step(self, pending_query): """ Parameters: - pending_query """ pass def broadcast_serialized_rows(self, serialized_rows, row_desc, query_id): """ Parameters: - serialized_rows - row_desc - query_id """ pass def start_render_query(self, session, widget_id, node_idx, vega_json): """ Parameters: - session - widget_id - node_idx - vega_json """ pass def execute_next_render_step(self, pending_render, merged_data): """ Parameters: - pending_render - merged_data """ pass def insert_data(self, session, insert_data): """ Parameters: - session - insert_data """ pass def checkpoint(self, session, db_id, table_id): """ Parameters: - session - db_id - table_id """ pass def get_roles(self, session): """ Parameters: - session """ pass def get_db_objects_for_grantee(self, session, roleName): """ Parameters: - session - roleName """ pass def get_db_object_privs(self, session, objectName, type): """ Parameters: - session - objectName - type """ pass def get_all_roles_for_user(self, session, userName): """ Parameters: - session - userName """ pass def has_role(self, session, granteeName, roleName): """ Parameters: - session - granteeName - roleName """ pass def has_object_privilege(self, session, granteeName, ObjectName, objectType, permissions): """ Parameters: - session - granteeName - ObjectName - objectType - permissions """ pass def set_license_key(self, session, key, nonce): """ Parameters: - session - key - nonce """ pass def get_license_claims(self, session, nonce): """ Parameters: - session - nonce """ pass def get_device_parameters(self, session): """ Parameters: - session """ pass def register_runtime_extension_functions(self, session, udfs, udtfs, device_ir_map): """ Parameters: - session - udfs - udtfs - device_ir_map """ pass class Client(Iface): def __init__(self, iprot, oprot=None): self._iprot = self._oprot = iprot if oprot is not None: self._oprot = oprot self._seqid = 0 def connect(self, user, passwd, dbname): """ Parameters: - user - passwd - dbname """ self.send_connect(user, passwd, dbname) return self.recv_connect() def send_connect(self, user, passwd, dbname): self._oprot.writeMessageBegin('connect', TMessageType.CALL, self._seqid) args = connect_args() args.user = user args.passwd = passwd args.dbname = dbname args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_connect(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = connect_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "connect failed: unknown result") def krb5_connect(self, inputToken, dbname): """ Parameters: - inputToken - dbname """ self.send_krb5_connect(inputToken, dbname) return self.recv_krb5_connect() def send_krb5_connect(self, inputToken, dbname): self._oprot.writeMessageBegin('krb5_connect', TMessageType.CALL, self._seqid) args = krb5_connect_args() args.inputToken = inputToken args.dbname = dbname args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_krb5_connect(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = krb5_connect_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "krb5_connect failed: unknown result") def disconnect(self, session): """ Parameters: - session """ self.send_disconnect(session) self.recv_disconnect() def send_disconnect(self, session): self._oprot.writeMessageBegin('disconnect', TMessageType.CALL, self._seqid) args = disconnect_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_disconnect(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = disconnect_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def switch_database(self, session, dbname): """ Parameters: - session - dbname """ self.send_switch_database(session, dbname) self.recv_switch_database() def send_switch_database(self, session, dbname): self._oprot.writeMessageBegin('switch_database', TMessageType.CALL, self._seqid) args = switch_database_args() args.session = session args.dbname = dbname args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_switch_database(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = switch_database_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def clone_session(self, session): """ Parameters: - session """ self.send_clone_session(session) return self.recv_clone_session() def send_clone_session(self, session): self._oprot.writeMessageBegin('clone_session', TMessageType.CALL, self._seqid) args = clone_session_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_clone_session(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = clone_session_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "clone_session failed: unknown result") def get_server_status(self, session): """ Parameters: - session """ self.send_get_server_status(session) return self.recv_get_server_status() def send_get_server_status(self, session): self._oprot.writeMessageBegin('get_server_status', TMessageType.CALL, self._seqid) args = get_server_status_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_server_status(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_server_status_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_server_status failed: unknown result") def get_status(self, session): """ Parameters: - session """ self.send_get_status(session) return self.recv_get_status() def send_get_status(self, session): self._oprot.writeMessageBegin('get_status', TMessageType.CALL, self._seqid) args = get_status_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_status(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_status_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_status failed: unknown result") def get_hardware_info(self, session): """ Parameters: - session """ self.send_get_hardware_info(session) return self.recv_get_hardware_info() def send_get_hardware_info(self, session): self._oprot.writeMessageBegin('get_hardware_info', TMessageType.CALL, self._seqid) args = get_hardware_info_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_hardware_info(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_hardware_info_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_hardware_info failed: unknown result") def get_tables(self, session): """ Parameters: - session """ self.send_get_tables(session) return self.recv_get_tables() def send_get_tables(self, session): self._oprot.writeMessageBegin('get_tables', TMessageType.CALL, self._seqid) args = get_tables_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_tables(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_tables_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_tables failed: unknown result") def get_physical_tables(self, session): """ Parameters: - session """ self.send_get_physical_tables(session) return self.recv_get_physical_tables() def send_get_physical_tables(self, session): self._oprot.writeMessageBegin('get_physical_tables', TMessageType.CALL, self._seqid) args = get_physical_tables_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_physical_tables(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_physical_tables_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_physical_tables failed: unknown result") def get_views(self, session): """ Parameters: - session """ self.send_get_views(session) return self.recv_get_views() def send_get_views(self, session): self._oprot.writeMessageBegin('get_views', TMessageType.CALL, self._seqid) args = get_views_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_views(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_views_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_views failed: unknown result") def get_tables_meta(self, session): """ Parameters: - session """ self.send_get_tables_meta(session) return self.recv_get_tables_meta() def send_get_tables_meta(self, session): self._oprot.writeMessageBegin('get_tables_meta', TMessageType.CALL, self._seqid) args = get_tables_meta_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_tables_meta(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_tables_meta_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_tables_meta failed: unknown result") def get_table_details(self, session, table_name): """ Parameters: - session - table_name """ self.send_get_table_details(session, table_name) return self.recv_get_table_details() def send_get_table_details(self, session, table_name): self._oprot.writeMessageBegin('get_table_details', TMessageType.CALL, self._seqid) args = get_table_details_args() args.session = session args.table_name = table_name args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_table_details(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_table_details_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_table_details failed: unknown result") def get_internal_table_details(self, session, table_name): """ Parameters: - session - table_name """ self.send_get_internal_table_details(session, table_name) return self.recv_get_internal_table_details() def send_get_internal_table_details(self, session, table_name): self._oprot.writeMessageBegin('get_internal_table_details', TMessageType.CALL, self._seqid) args = get_internal_table_details_args() args.session = session args.table_name = table_name args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_internal_table_details(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_internal_table_details_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_internal_table_details failed: unknown result") def get_users(self, session): """ Parameters: - session """ self.send_get_users(session) return self.recv_get_users() def send_get_users(self, session): self._oprot.writeMessageBegin('get_users', TMessageType.CALL, self._seqid) args = get_users_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_users(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_users_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_users failed: unknown result") def get_databases(self, session): """ Parameters: - session """ self.send_get_databases(session) return self.recv_get_databases() def send_get_databases(self, session): self._oprot.writeMessageBegin('get_databases', TMessageType.CALL, self._seqid) args = get_databases_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_databases(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_databases_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_databases failed: unknown result") def get_version(self): self.send_get_version() return self.recv_get_version() def send_get_version(self): self._oprot.writeMessageBegin('get_version', TMessageType.CALL, self._seqid) args = get_version_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_version(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_version_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_version failed: unknown result") def start_heap_profile(self, session): """ Parameters: - session """ self.send_start_heap_profile(session) self.recv_start_heap_profile() def send_start_heap_profile(self, session): self._oprot.writeMessageBegin('start_heap_profile', TMessageType.CALL, self._seqid) args = start_heap_profile_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_start_heap_profile(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = start_heap_profile_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def stop_heap_profile(self, session): """ Parameters: - session """ self.send_stop_heap_profile(session) self.recv_stop_heap_profile() def send_stop_heap_profile(self, session): self._oprot.writeMessageBegin('stop_heap_profile', TMessageType.CALL, self._seqid) args = stop_heap_profile_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_stop_heap_profile(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = stop_heap_profile_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def get_heap_profile(self, session): """ Parameters: - session """ self.send_get_heap_profile(session) return self.recv_get_heap_profile() def send_get_heap_profile(self, session): self._oprot.writeMessageBegin('get_heap_profile', TMessageType.CALL, self._seqid) args = get_heap_profile_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_heap_profile(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_heap_profile_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_heap_profile failed: unknown result") def get_memory(self, session, memory_level): """ Parameters: - session - memory_level """ self.send_get_memory(session, memory_level) return self.recv_get_memory() def send_get_memory(self, session, memory_level): self._oprot.writeMessageBegin('get_memory', TMessageType.CALL, self._seqid) args = get_memory_args() args.session = session args.memory_level = memory_level args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_memory(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_memory_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_memory failed: unknown result") def clear_cpu_memory(self, session): """ Parameters: - session """ self.send_clear_cpu_memory(session) self.recv_clear_cpu_memory() def send_clear_cpu_memory(self, session): self._oprot.writeMessageBegin('clear_cpu_memory', TMessageType.CALL, self._seqid) args = clear_cpu_memory_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_clear_cpu_memory(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = clear_cpu_memory_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def clear_gpu_memory(self, session): """ Parameters: - session """ self.send_clear_gpu_memory(session) self.recv_clear_gpu_memory() def send_clear_gpu_memory(self, session): self._oprot.writeMessageBegin('clear_gpu_memory', TMessageType.CALL, self._seqid) args = clear_gpu_memory_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_clear_gpu_memory(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = clear_gpu_memory_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def set_table_epoch(self, session, db_id, table_id, new_epoch): """ Parameters: - session - db_id - table_id - new_epoch """ self.send_set_table_epoch(session, db_id, table_id, new_epoch) self.recv_set_table_epoch() def send_set_table_epoch(self, session, db_id, table_id, new_epoch): self._oprot.writeMessageBegin('set_table_epoch', TMessageType.CALL, self._seqid) args = set_table_epoch_args() args.session = session args.db_id = db_id args.table_id = table_id args.new_epoch = new_epoch args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_set_table_epoch(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = set_table_epoch_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def set_table_epoch_by_name(self, session, table_name, new_epoch): """ Parameters: - session - table_name - new_epoch """ self.send_set_table_epoch_by_name(session, table_name, new_epoch) self.recv_set_table_epoch_by_name() def send_set_table_epoch_by_name(self, session, table_name, new_epoch): self._oprot.writeMessageBegin('set_table_epoch_by_name', TMessageType.CALL, self._seqid) args = set_table_epoch_by_name_args() args.session = session args.table_name = table_name args.new_epoch = new_epoch args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_set_table_epoch_by_name(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = set_table_epoch_by_name_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def get_table_epoch(self, session, db_id, table_id): """ Parameters: - session - db_id - table_id """ self.send_get_table_epoch(session, db_id, table_id) return self.recv_get_table_epoch() def send_get_table_epoch(self, session, db_id, table_id): self._oprot.writeMessageBegin('get_table_epoch', TMessageType.CALL, self._seqid) args = get_table_epoch_args() args.session = session args.db_id = db_id args.table_id = table_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_table_epoch(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_table_epoch_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "get_table_epoch failed: unknown result") def get_table_epoch_by_name(self, session, table_name): """ Parameters: - session - table_name """ self.send_get_table_epoch_by_name(session, table_name) return self.recv_get_table_epoch_by_name() def send_get_table_epoch_by_name(self, session, table_name): self._oprot.writeMessageBegin('get_table_epoch_by_name', TMessageType.CALL, self._seqid) args = get_table_epoch_by_name_args() args.session = session args.table_name = table_name args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_table_epoch_by_name(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_table_epoch_by_name_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "get_table_epoch_by_name failed: unknown result") def get_session_info(self, session): """ Parameters: - session """ self.send_get_session_info(session) return self.recv_get_session_info() def send_get_session_info(self, session): self._oprot.writeMessageBegin('get_session_info', TMessageType.CALL, self._seqid) args = get_session_info_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_session_info(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_session_info_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_session_info failed: unknown result") def sql_execute(self, session, query, column_format, nonce, first_n, at_most_n): """ Parameters: - session - query - column_format - nonce - first_n - at_most_n """ self.send_sql_execute(session, query, column_format, nonce, first_n, at_most_n) return self.recv_sql_execute() def send_sql_execute(self, session, query, column_format, nonce, first_n, at_most_n): self._oprot.writeMessageBegin('sql_execute', TMessageType.CALL, self._seqid) args = sql_execute_args() args.session = session args.query = query args.column_format = column_format args.nonce = nonce args.first_n = first_n args.at_most_n = at_most_n args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sql_execute(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sql_execute_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "sql_execute failed: unknown result") def sql_execute_df(self, session, query, device_type, device_id, first_n, transport_method): """ Parameters: - session - query - device_type - device_id - first_n - transport_method """ self.send_sql_execute_df(session, query, device_type, device_id, first_n, transport_method) return self.recv_sql_execute_df() def send_sql_execute_df(self, session, query, device_type, device_id, first_n, transport_method): self._oprot.writeMessageBegin('sql_execute_df', TMessageType.CALL, self._seqid) args = sql_execute_df_args() args.session = session args.query = query args.device_type = device_type args.device_id = device_id args.first_n = first_n args.transport_method = transport_method args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sql_execute_df(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sql_execute_df_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "sql_execute_df failed: unknown result") def sql_execute_gdf(self, session, query, device_id, first_n): """ Parameters: - session - query - device_id - first_n """ self.send_sql_execute_gdf(session, query, device_id, first_n) return self.recv_sql_execute_gdf() def send_sql_execute_gdf(self, session, query, device_id, first_n): self._oprot.writeMessageBegin('sql_execute_gdf', TMessageType.CALL, self._seqid) args = sql_execute_gdf_args() args.session = session args.query = query args.device_id = device_id args.first_n = first_n args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sql_execute_gdf(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sql_execute_gdf_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "sql_execute_gdf failed: unknown result") def deallocate_df(self, session, df, device_type, device_id): """ Parameters: - session - df - device_type - device_id """ self.send_deallocate_df(session, df, device_type, device_id) self.recv_deallocate_df() def send_deallocate_df(self, session, df, device_type, device_id): self._oprot.writeMessageBegin('deallocate_df', TMessageType.CALL, self._seqid) args = deallocate_df_args() args.session = session args.df = df args.device_type = device_type args.device_id = device_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_deallocate_df(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = deallocate_df_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def interrupt(self, query_session, interrupt_session): """ Parameters: - query_session - interrupt_session """ self.send_interrupt(query_session, interrupt_session) self.recv_interrupt() def send_interrupt(self, query_session, interrupt_session): self._oprot.writeMessageBegin('interrupt', TMessageType.CALL, self._seqid) args = interrupt_args() args.query_session = query_session args.interrupt_session = interrupt_session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_interrupt(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = interrupt_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def sql_validate(self, session, query): """ Parameters: - session - query """ self.send_sql_validate(session, query) return self.recv_sql_validate() def send_sql_validate(self, session, query): self._oprot.writeMessageBegin('sql_validate', TMessageType.CALL, self._seqid) args = sql_validate_args() args.session = session args.query = query args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sql_validate(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sql_validate_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "sql_validate failed: unknown result") def get_completion_hints(self, session, sql, cursor): """ Parameters: - session - sql - cursor """ self.send_get_completion_hints(session, sql, cursor) return self.recv_get_completion_hints() def send_get_completion_hints(self, session, sql, cursor): self._oprot.writeMessageBegin('get_completion_hints', TMessageType.CALL, self._seqid) args = get_completion_hints_args() args.session = session args.sql = sql args.cursor = cursor args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_completion_hints(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_completion_hints_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_completion_hints failed: unknown result") def set_execution_mode(self, session, mode): """ Parameters: - session - mode """ self.send_set_execution_mode(session, mode) self.recv_set_execution_mode() def send_set_execution_mode(self, session, mode): self._oprot.writeMessageBegin('set_execution_mode', TMessageType.CALL, self._seqid) args = set_execution_mode_args() args.session = session args.mode = mode args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_set_execution_mode(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = set_execution_mode_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def render_vega(self, session, widget_id, vega_json, compression_level, nonce): """ Parameters: - session - widget_id - vega_json - compression_level - nonce """ self.send_render_vega(session, widget_id, vega_json, compression_level, nonce) return self.recv_render_vega() def send_render_vega(self, session, widget_id, vega_json, compression_level, nonce): self._oprot.writeMessageBegin('render_vega', TMessageType.CALL, self._seqid) args = render_vega_args() args.session = session args.widget_id = widget_id args.vega_json = vega_json args.compression_level = compression_level args.nonce = nonce args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_render_vega(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = render_vega_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "render_vega failed: unknown result") def get_result_row_for_pixel(self, session, widget_id, pixel, table_col_names, column_format, pixelRadius, nonce): """ Parameters: - session - widget_id - pixel - table_col_names - column_format - pixelRadius - nonce """ self.send_get_result_row_for_pixel(session, widget_id, pixel, table_col_names, column_format, pixelRadius, nonce) return self.recv_get_result_row_for_pixel() def send_get_result_row_for_pixel(self, session, widget_id, pixel, table_col_names, column_format, pixelRadius, nonce): self._oprot.writeMessageBegin('get_result_row_for_pixel', TMessageType.CALL, self._seqid) args = get_result_row_for_pixel_args() args.session = session args.widget_id = widget_id args.pixel = pixel args.table_col_names = table_col_names args.column_format = column_format args.pixelRadius = pixelRadius args.nonce = nonce args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_result_row_for_pixel(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_result_row_for_pixel_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_result_row_for_pixel failed: unknown result") def get_dashboard(self, session, dashboard_id): """ Parameters: - session - dashboard_id """ self.send_get_dashboard(session, dashboard_id) return self.recv_get_dashboard() def send_get_dashboard(self, session, dashboard_id): self._oprot.writeMessageBegin('get_dashboard', TMessageType.CALL, self._seqid) args = get_dashboard_args() args.session = session args.dashboard_id = dashboard_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_dashboard(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_dashboard_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_dashboard failed: unknown result") def get_dashboards(self, session): """ Parameters: - session """ self.send_get_dashboards(session) return self.recv_get_dashboards() def send_get_dashboards(self, session): self._oprot.writeMessageBegin('get_dashboards', TMessageType.CALL, self._seqid) args = get_dashboards_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_dashboards(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_dashboards_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_dashboards failed: unknown result") def create_dashboard(self, session, dashboard_name, dashboard_state, image_hash, dashboard_metadata): """ Parameters: - session - dashboard_name - dashboard_state - image_hash - dashboard_metadata """ self.send_create_dashboard(session, dashboard_name, dashboard_state, image_hash, dashboard_metadata) return self.recv_create_dashboard() def send_create_dashboard(self, session, dashboard_name, dashboard_state, image_hash, dashboard_metadata): self._oprot.writeMessageBegin('create_dashboard', TMessageType.CALL, self._seqid) args = create_dashboard_args() args.session = session args.dashboard_name = dashboard_name args.dashboard_state = dashboard_state args.image_hash = image_hash args.dashboard_metadata = dashboard_metadata args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_create_dashboard(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = create_dashboard_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "create_dashboard failed: unknown result") def replace_dashboard(self, session, dashboard_id, dashboard_name, dashboard_owner, dashboard_state, image_hash, dashboard_metadata): """ Parameters: - session - dashboard_id - dashboard_name - dashboard_owner - dashboard_state - image_hash - dashboard_metadata """ self.send_replace_dashboard(session, dashboard_id, dashboard_name, dashboard_owner, dashboard_state, image_hash, dashboard_metadata) self.recv_replace_dashboard() def send_replace_dashboard(self, session, dashboard_id, dashboard_name, dashboard_owner, dashboard_state, image_hash, dashboard_metadata): self._oprot.writeMessageBegin('replace_dashboard', TMessageType.CALL, self._seqid) args = replace_dashboard_args() args.session = session args.dashboard_id = dashboard_id args.dashboard_name = dashboard_name args.dashboard_owner = dashboard_owner args.dashboard_state = dashboard_state args.image_hash = image_hash args.dashboard_metadata = dashboard_metadata args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_replace_dashboard(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = replace_dashboard_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def delete_dashboard(self, session, dashboard_id): """ Parameters: - session - dashboard_id """ self.send_delete_dashboard(session, dashboard_id) self.recv_delete_dashboard() def send_delete_dashboard(self, session, dashboard_id): self._oprot.writeMessageBegin('delete_dashboard', TMessageType.CALL, self._seqid) args = delete_dashboard_args() args.session = session args.dashboard_id = dashboard_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_delete_dashboard(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = delete_dashboard_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def share_dashboards(self, session, dashboard_ids, groups, permissions): """ Parameters: - session - dashboard_ids - groups - permissions """ self.send_share_dashboards(session, dashboard_ids, groups, permissions) self.recv_share_dashboards() def send_share_dashboards(self, session, dashboard_ids, groups, permissions): self._oprot.writeMessageBegin('share_dashboards', TMessageType.CALL, self._seqid) args = share_dashboards_args() args.session = session args.dashboard_ids = dashboard_ids args.groups = groups args.permissions = permissions args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_share_dashboards(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = share_dashboards_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def delete_dashboards(self, session, dashboard_ids): """ Parameters: - session - dashboard_ids """ self.send_delete_dashboards(session, dashboard_ids) self.recv_delete_dashboards() def send_delete_dashboards(self, session, dashboard_ids): self._oprot.writeMessageBegin('delete_dashboards', TMessageType.CALL, self._seqid) args = delete_dashboards_args() args.session = session args.dashboard_ids = dashboard_ids args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_delete_dashboards(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = delete_dashboards_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def share_dashboard(self, session, dashboard_id, groups, objects, permissions, grant_role): """ Parameters: - session - dashboard_id - groups - objects - permissions - grant_role """ self.send_share_dashboard(session, dashboard_id, groups, objects, permissions, grant_role) self.recv_share_dashboard() def send_share_dashboard(self, session, dashboard_id, groups, objects, permissions, grant_role): self._oprot.writeMessageBegin('share_dashboard', TMessageType.CALL, self._seqid) args = share_dashboard_args() args.session = session args.dashboard_id = dashboard_id args.groups = groups args.objects = objects args.permissions = permissions args.grant_role = grant_role args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_share_dashboard(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = share_dashboard_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def unshare_dashboard(self, session, dashboard_id, groups, objects, permissions): """ Parameters: - session - dashboard_id - groups - objects - permissions """ self.send_unshare_dashboard(session, dashboard_id, groups, objects, permissions) self.recv_unshare_dashboard() def send_unshare_dashboard(self, session, dashboard_id, groups, objects, permissions): self._oprot.writeMessageBegin('unshare_dashboard', TMessageType.CALL, self._seqid) args = unshare_dashboard_args() args.session = session args.dashboard_id = dashboard_id args.groups = groups args.objects = objects args.permissions = permissions args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_unshare_dashboard(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = unshare_dashboard_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def unshare_dashboards(self, session, dashboard_ids, groups, permissions): """ Parameters: - session - dashboard_ids - groups - permissions """ self.send_unshare_dashboards(session, dashboard_ids, groups, permissions) self.recv_unshare_dashboards() def send_unshare_dashboards(self, session, dashboard_ids, groups, permissions): self._oprot.writeMessageBegin('unshare_dashboards', TMessageType.CALL, self._seqid) args = unshare_dashboards_args() args.session = session args.dashboard_ids = dashboard_ids args.groups = groups args.permissions = permissions args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_unshare_dashboards(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = unshare_dashboards_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def get_dashboard_grantees(self, session, dashboard_id): """ Parameters: - session - dashboard_id """ self.send_get_dashboard_grantees(session, dashboard_id) return self.recv_get_dashboard_grantees() def send_get_dashboard_grantees(self, session, dashboard_id): self._oprot.writeMessageBegin('get_dashboard_grantees', TMessageType.CALL, self._seqid) args = get_dashboard_grantees_args() args.session = session args.dashboard_id = dashboard_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_dashboard_grantees(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_dashboard_grantees_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_dashboard_grantees failed: unknown result") def get_link_view(self, session, link): """ Parameters: - session - link """ self.send_get_link_view(session, link) return self.recv_get_link_view() def send_get_link_view(self, session, link): self._oprot.writeMessageBegin('get_link_view', TMessageType.CALL, self._seqid) args = get_link_view_args() args.session = session args.link = link args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_link_view(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_link_view_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_link_view failed: unknown result") def create_link(self, session, view_state, view_metadata): """ Parameters: - session - view_state - view_metadata """ self.send_create_link(session, view_state, view_metadata) return self.recv_create_link() def send_create_link(self, session, view_state, view_metadata): self._oprot.writeMessageBegin('create_link', TMessageType.CALL, self._seqid) args = create_link_args() args.session = session args.view_state = view_state args.view_metadata = view_metadata args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_create_link(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = create_link_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "create_link failed: unknown result") def load_table_binary(self, session, table_name, rows): """ Parameters: - session - table_name - rows """ self.send_load_table_binary(session, table_name, rows) self.recv_load_table_binary() def send_load_table_binary(self, session, table_name, rows): self._oprot.writeMessageBegin('load_table_binary', TMessageType.CALL, self._seqid) args = load_table_binary_args() args.session = session args.table_name = table_name args.rows = rows args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_load_table_binary(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = load_table_binary_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def load_table_binary_columnar(self, session, table_name, cols): """ Parameters: - session - table_name - cols """ self.send_load_table_binary_columnar(session, table_name, cols) self.recv_load_table_binary_columnar() def send_load_table_binary_columnar(self, session, table_name, cols): self._oprot.writeMessageBegin('load_table_binary_columnar', TMessageType.CALL, self._seqid) args = load_table_binary_columnar_args() args.session = session args.table_name = table_name args.cols = cols args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_load_table_binary_columnar(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = load_table_binary_columnar_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def load_table_binary_arrow(self, session, table_name, arrow_stream): """ Parameters: - session - table_name - arrow_stream """ self.send_load_table_binary_arrow(session, table_name, arrow_stream) self.recv_load_table_binary_arrow() def send_load_table_binary_arrow(self, session, table_name, arrow_stream): self._oprot.writeMessageBegin('load_table_binary_arrow', TMessageType.CALL, self._seqid) args = load_table_binary_arrow_args() args.session = session args.table_name = table_name args.arrow_stream = arrow_stream args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_load_table_binary_arrow(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = load_table_binary_arrow_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def load_table(self, session, table_name, rows): """ Parameters: - session - table_name - rows """ self.send_load_table(session, table_name, rows) self.recv_load_table() def send_load_table(self, session, table_name, rows): self._oprot.writeMessageBegin('load_table', TMessageType.CALL, self._seqid) args = load_table_args() args.session = session args.table_name = table_name args.rows = rows args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_load_table(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = load_table_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def detect_column_types(self, session, file_name, copy_params): """ Parameters: - session - file_name - copy_params """ self.send_detect_column_types(session, file_name, copy_params) return self.recv_detect_column_types() def send_detect_column_types(self, session, file_name, copy_params): self._oprot.writeMessageBegin('detect_column_types', TMessageType.CALL, self._seqid) args = detect_column_types_args() args.session = session args.file_name = file_name args.copy_params = copy_params args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_detect_column_types(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = detect_column_types_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "detect_column_types failed: unknown result") def create_table(self, session, table_name, row_desc, file_type, create_params): """ Parameters: - session - table_name - row_desc - file_type - create_params """ self.send_create_table(session, table_name, row_desc, file_type, create_params) self.recv_create_table() def send_create_table(self, session, table_name, row_desc, file_type, create_params): self._oprot.writeMessageBegin('create_table', TMessageType.CALL, self._seqid) args = create_table_args() args.session = session args.table_name = table_name args.row_desc = row_desc args.file_type = file_type args.create_params = create_params args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_create_table(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = create_table_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def import_table(self, session, table_name, file_name, copy_params): """ Parameters: - session - table_name - file_name - copy_params """ self.send_import_table(session, table_name, file_name, copy_params) self.recv_import_table() def send_import_table(self, session, table_name, file_name, copy_params): self._oprot.writeMessageBegin('import_table', TMessageType.CALL, self._seqid) args = import_table_args() args.session = session args.table_name = table_name args.file_name = file_name args.copy_params = copy_params args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_import_table(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = import_table_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def import_geo_table(self, session, table_name, file_name, copy_params, row_desc, create_params): """ Parameters: - session - table_name - file_name - copy_params - row_desc - create_params """ self.send_import_geo_table(session, table_name, file_name, copy_params, row_desc, create_params) self.recv_import_geo_table() def send_import_geo_table(self, session, table_name, file_name, copy_params, row_desc, create_params): self._oprot.writeMessageBegin('import_geo_table', TMessageType.CALL, self._seqid) args = import_geo_table_args() args.session = session args.table_name = table_name args.file_name = file_name args.copy_params = copy_params args.row_desc = row_desc args.create_params = create_params args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_import_geo_table(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = import_geo_table_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def import_table_status(self, session, import_id): """ Parameters: - session - import_id """ self.send_import_table_status(session, import_id) return self.recv_import_table_status() def send_import_table_status(self, session, import_id): self._oprot.writeMessageBegin('import_table_status', TMessageType.CALL, self._seqid) args = import_table_status_args() args.session = session args.import_id = import_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_import_table_status(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = import_table_status_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "import_table_status failed: unknown result") def get_first_geo_file_in_archive(self, session, archive_path, copy_params): """ Parameters: - session - archive_path - copy_params """ self.send_get_first_geo_file_in_archive(session, archive_path, copy_params) return self.recv_get_first_geo_file_in_archive() def send_get_first_geo_file_in_archive(self, session, archive_path, copy_params): self._oprot.writeMessageBegin('get_first_geo_file_in_archive', TMessageType.CALL, self._seqid) args = get_first_geo_file_in_archive_args() args.session = session args.archive_path = archive_path args.copy_params = copy_params args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_first_geo_file_in_archive(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_first_geo_file_in_archive_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_first_geo_file_in_archive failed: unknown result") def get_all_files_in_archive(self, session, archive_path, copy_params): """ Parameters: - session - archive_path - copy_params """ self.send_get_all_files_in_archive(session, archive_path, copy_params) return self.recv_get_all_files_in_archive() def send_get_all_files_in_archive(self, session, archive_path, copy_params): self._oprot.writeMessageBegin('get_all_files_in_archive', TMessageType.CALL, self._seqid) args = get_all_files_in_archive_args() args.session = session args.archive_path = archive_path args.copy_params = copy_params args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_all_files_in_archive(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_all_files_in_archive_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_all_files_in_archive failed: unknown result") def get_layers_in_geo_file(self, session, file_name, copy_params): """ Parameters: - session - file_name - copy_params """ self.send_get_layers_in_geo_file(session, file_name, copy_params) return self.recv_get_layers_in_geo_file() def send_get_layers_in_geo_file(self, session, file_name, copy_params): self._oprot.writeMessageBegin('get_layers_in_geo_file', TMessageType.CALL, self._seqid) args = get_layers_in_geo_file_args() args.session = session args.file_name = file_name args.copy_params = copy_params args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_layers_in_geo_file(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_layers_in_geo_file_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_layers_in_geo_file failed: unknown result") def query_get_outer_fragment_count(self, session, query): """ Parameters: - session - query """ self.send_query_get_outer_fragment_count(session, query) return self.recv_query_get_outer_fragment_count() def send_query_get_outer_fragment_count(self, session, query): self._oprot.writeMessageBegin('query_get_outer_fragment_count', TMessageType.CALL, self._seqid) args = query_get_outer_fragment_count_args() args.session = session args.query = query args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_query_get_outer_fragment_count(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = query_get_outer_fragment_count_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "query_get_outer_fragment_count failed: unknown result") def check_table_consistency(self, session, table_id): """ Parameters: - session - table_id """ self.send_check_table_consistency(session, table_id) return self.recv_check_table_consistency() def send_check_table_consistency(self, session, table_id): self._oprot.writeMessageBegin('check_table_consistency', TMessageType.CALL, self._seqid) args = check_table_consistency_args() args.session = session args.table_id = table_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_check_table_consistency(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = check_table_consistency_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "check_table_consistency failed: unknown result") def start_query(self, leaf_session, parent_session, query_ra, just_explain, outer_fragment_indices): """ Parameters: - leaf_session - parent_session - query_ra - just_explain - outer_fragment_indices """ self.send_start_query(leaf_session, parent_session, query_ra, just_explain, outer_fragment_indices) return self.recv_start_query() def send_start_query(self, leaf_session, parent_session, query_ra, just_explain, outer_fragment_indices): self._oprot.writeMessageBegin('start_query', TMessageType.CALL, self._seqid) args = start_query_args() args.leaf_session = leaf_session args.parent_session = parent_session args.query_ra = query_ra args.just_explain = just_explain args.outer_fragment_indices = outer_fragment_indices args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_start_query(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = start_query_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "start_query failed: unknown result") def execute_query_step(self, pending_query): """ Parameters: - pending_query """ self.send_execute_query_step(pending_query) return self.recv_execute_query_step() def send_execute_query_step(self, pending_query): self._oprot.writeMessageBegin('execute_query_step', TMessageType.CALL, self._seqid) args = execute_query_step_args() args.pending_query = pending_query args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_execute_query_step(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = execute_query_step_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "execute_query_step failed: unknown result") def broadcast_serialized_rows(self, serialized_rows, row_desc, query_id): """ Parameters: - serialized_rows - row_desc - query_id """ self.send_broadcast_serialized_rows(serialized_rows, row_desc, query_id) self.recv_broadcast_serialized_rows() def send_broadcast_serialized_rows(self, serialized_rows, row_desc, query_id): self._oprot.writeMessageBegin('broadcast_serialized_rows', TMessageType.CALL, self._seqid) args = broadcast_serialized_rows_args() args.serialized_rows = serialized_rows args.row_desc = row_desc args.query_id = query_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_broadcast_serialized_rows(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = broadcast_serialized_rows_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def start_render_query(self, session, widget_id, node_idx, vega_json): """ Parameters: - session - widget_id - node_idx - vega_json """ self.send_start_render_query(session, widget_id, node_idx, vega_json) return self.recv_start_render_query() def send_start_render_query(self, session, widget_id, node_idx, vega_json): self._oprot.writeMessageBegin('start_render_query', TMessageType.CALL, self._seqid) args = start_render_query_args() args.session = session args.widget_id = widget_id args.node_idx = node_idx args.vega_json = vega_json args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_start_render_query(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = start_render_query_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "start_render_query failed: unknown result") def execute_next_render_step(self, pending_render, merged_data): """ Parameters: - pending_render - merged_data """ self.send_execute_next_render_step(pending_render, merged_data) return self.recv_execute_next_render_step() def send_execute_next_render_step(self, pending_render, merged_data): self._oprot.writeMessageBegin('execute_next_render_step', TMessageType.CALL, self._seqid) args = execute_next_render_step_args() args.pending_render = pending_render args.merged_data = merged_data args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_execute_next_render_step(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = execute_next_render_step_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "execute_next_render_step failed: unknown result") def insert_data(self, session, insert_data): """ Parameters: - session - insert_data """ self.send_insert_data(session, insert_data) self.recv_insert_data() def send_insert_data(self, session, insert_data): self._oprot.writeMessageBegin('insert_data', TMessageType.CALL, self._seqid) args = insert_data_args() args.session = session args.insert_data = insert_data args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_insert_data(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = insert_data_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def checkpoint(self, session, db_id, table_id): """ Parameters: - session - db_id - table_id """ self.send_checkpoint(session, db_id, table_id) self.recv_checkpoint() def send_checkpoint(self, session, db_id, table_id): self._oprot.writeMessageBegin('checkpoint', TMessageType.CALL, self._seqid) args = checkpoint_args() args.session = session args.db_id = db_id args.table_id = table_id args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_checkpoint(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = checkpoint_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return def get_roles(self, session): """ Parameters: - session """ self.send_get_roles(session) return self.recv_get_roles() def send_get_roles(self, session): self._oprot.writeMessageBegin('get_roles', TMessageType.CALL, self._seqid) args = get_roles_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_roles(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_roles_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_roles failed: unknown result") def get_db_objects_for_grantee(self, session, roleName): """ Parameters: - session - roleName """ self.send_get_db_objects_for_grantee(session, roleName) return self.recv_get_db_objects_for_grantee() def send_get_db_objects_for_grantee(self, session, roleName): self._oprot.writeMessageBegin('get_db_objects_for_grantee', TMessageType.CALL, self._seqid) args = get_db_objects_for_grantee_args() args.session = session args.roleName = roleName args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_db_objects_for_grantee(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_db_objects_for_grantee_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_db_objects_for_grantee failed: unknown result") def get_db_object_privs(self, session, objectName, type): """ Parameters: - session - objectName - type """ self.send_get_db_object_privs(session, objectName, type) return self.recv_get_db_object_privs() def send_get_db_object_privs(self, session, objectName, type): self._oprot.writeMessageBegin('get_db_object_privs', TMessageType.CALL, self._seqid) args = get_db_object_privs_args() args.session = session args.objectName = objectName args.type = type args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_db_object_privs(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_db_object_privs_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_db_object_privs failed: unknown result") def get_all_roles_for_user(self, session, userName): """ Parameters: - session - userName """ self.send_get_all_roles_for_user(session, userName) return self.recv_get_all_roles_for_user() def send_get_all_roles_for_user(self, session, userName): self._oprot.writeMessageBegin('get_all_roles_for_user', TMessageType.CALL, self._seqid) args = get_all_roles_for_user_args() args.session = session args.userName = userName args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_all_roles_for_user(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_all_roles_for_user_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_all_roles_for_user failed: unknown result") def has_role(self, session, granteeName, roleName): """ Parameters: - session - granteeName - roleName """ self.send_has_role(session, granteeName, roleName) return self.recv_has_role() def send_has_role(self, session, granteeName, roleName): self._oprot.writeMessageBegin('has_role', TMessageType.CALL, self._seqid) args = has_role_args() args.session = session args.granteeName = granteeName args.roleName = roleName args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_has_role(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = has_role_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "has_role failed: unknown result") def has_object_privilege(self, session, granteeName, ObjectName, objectType, permissions): """ Parameters: - session - granteeName - ObjectName - objectType - permissions """ self.send_has_object_privilege(session, granteeName, ObjectName, objectType, permissions) return self.recv_has_object_privilege() def send_has_object_privilege(self, session, granteeName, ObjectName, objectType, permissions): self._oprot.writeMessageBegin('has_object_privilege', TMessageType.CALL, self._seqid) args = has_object_privilege_args() args.session = session args.granteeName = granteeName args.ObjectName = ObjectName args.objectType = objectType args.permissions = permissions args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_has_object_privilege(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = has_object_privilege_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "has_object_privilege failed: unknown result") def set_license_key(self, session, key, nonce): """ Parameters: - session - key - nonce """ self.send_set_license_key(session, key, nonce) return self.recv_set_license_key() def send_set_license_key(self, session, key, nonce): self._oprot.writeMessageBegin('set_license_key', TMessageType.CALL, self._seqid) args = set_license_key_args() args.session = session args.key = key args.nonce = nonce args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_set_license_key(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = set_license_key_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "set_license_key failed: unknown result") def get_license_claims(self, session, nonce): """ Parameters: - session - nonce """ self.send_get_license_claims(session, nonce) return self.recv_get_license_claims() def send_get_license_claims(self, session, nonce): self._oprot.writeMessageBegin('get_license_claims', TMessageType.CALL, self._seqid) args = get_license_claims_args() args.session = session args.nonce = nonce args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_license_claims(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_license_claims_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_license_claims failed: unknown result") def get_device_parameters(self, session): """ Parameters: - session """ self.send_get_device_parameters(session) return self.recv_get_device_parameters() def send_get_device_parameters(self, session): self._oprot.writeMessageBegin('get_device_parameters', TMessageType.CALL, self._seqid) args = get_device_parameters_args() args.session = session args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_get_device_parameters(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = get_device_parameters_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "get_device_parameters failed: unknown result") def register_runtime_extension_functions(self, session, udfs, udtfs, device_ir_map): """ Parameters: - session - udfs - udtfs - device_ir_map """ self.send_register_runtime_extension_functions(session, udfs, udtfs, device_ir_map) self.recv_register_runtime_extension_functions() def send_register_runtime_extension_functions(self, session, udfs, udtfs, device_ir_map): self._oprot.writeMessageBegin('register_runtime_extension_functions', TMessageType.CALL, self._seqid) args = register_runtime_extension_functions_args() args.session = session args.udfs = udfs args.udtfs = udtfs args.device_ir_map = device_ir_map args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_register_runtime_extension_functions(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = register_runtime_extension_functions_result() result.read(iprot) iprot.readMessageEnd() if result.e is not None: raise result.e return class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["connect"] = Processor.process_connect self._processMap["krb5_connect"] = Processor.process_krb5_connect self._processMap["disconnect"] = Processor.process_disconnect self._processMap["switch_database"] = Processor.process_switch_database self._processMap["clone_session"] = Processor.process_clone_session self._processMap["get_server_status"] = Processor.process_get_server_status self._processMap["get_status"] = Processor.process_get_status self._processMap["get_hardware_info"] = Processor.process_get_hardware_info self._processMap["get_tables"] = Processor.process_get_tables self._processMap["get_physical_tables"] = Processor.process_get_physical_tables self._processMap["get_views"] = Processor.process_get_views self._processMap["get_tables_meta"] = Processor.process_get_tables_meta self._processMap["get_table_details"] = Processor.process_get_table_details self._processMap["get_internal_table_details"] = Processor.process_get_internal_table_details self._processMap["get_users"] = Processor.process_get_users self._processMap["get_databases"] = Processor.process_get_databases self._processMap["get_version"] = Processor.process_get_version self._processMap["start_heap_profile"] = Processor.process_start_heap_profile self._processMap["stop_heap_profile"] = Processor.process_stop_heap_profile self._processMap["get_heap_profile"] = Processor.process_get_heap_profile self._processMap["get_memory"] = Processor.process_get_memory self._processMap["clear_cpu_memory"] = Processor.process_clear_cpu_memory self._processMap["clear_gpu_memory"] = Processor.process_clear_gpu_memory self._processMap["set_table_epoch"] = Processor.process_set_table_epoch self._processMap["set_table_epoch_by_name"] = Processor.process_set_table_epoch_by_name self._processMap["get_table_epoch"] = Processor.process_get_table_epoch self._processMap["get_table_epoch_by_name"] = Processor.process_get_table_epoch_by_name self._processMap["get_session_info"] = Processor.process_get_session_info self._processMap["sql_execute"] = Processor.process_sql_execute self._processMap["sql_execute_df"] = Processor.process_sql_execute_df self._processMap["sql_execute_gdf"] = Processor.process_sql_execute_gdf self._processMap["deallocate_df"] = Processor.process_deallocate_df self._processMap["interrupt"] = Processor.process_interrupt self._processMap["sql_validate"] = Processor.process_sql_validate self._processMap["get_completion_hints"] = Processor.process_get_completion_hints self._processMap["set_execution_mode"] = Processor.process_set_execution_mode self._processMap["render_vega"] = Processor.process_render_vega self._processMap["get_result_row_for_pixel"] = Processor.process_get_result_row_for_pixel self._processMap["get_dashboard"] = Processor.process_get_dashboard self._processMap["get_dashboards"] = Processor.process_get_dashboards self._processMap["create_dashboard"] = Processor.process_create_dashboard self._processMap["replace_dashboard"] = Processor.process_replace_dashboard self._processMap["delete_dashboard"] = Processor.process_delete_dashboard self._processMap["share_dashboards"] = Processor.process_share_dashboards self._processMap["delete_dashboards"] = Processor.process_delete_dashboards self._processMap["share_dashboard"] = Processor.process_share_dashboard self._processMap["unshare_dashboard"] = Processor.process_unshare_dashboard self._processMap["unshare_dashboards"] = Processor.process_unshare_dashboards self._processMap["get_dashboard_grantees"] = Processor.process_get_dashboard_grantees self._processMap["get_link_view"] = Processor.process_get_link_view self._processMap["create_link"] = Processor.process_create_link self._processMap["load_table_binary"] = Processor.process_load_table_binary self._processMap["load_table_binary_columnar"] = Processor.process_load_table_binary_columnar self._processMap["load_table_binary_arrow"] = Processor.process_load_table_binary_arrow self._processMap["load_table"] = Processor.process_load_table self._processMap["detect_column_types"] = Processor.process_detect_column_types self._processMap["create_table"] = Processor.process_create_table self._processMap["import_table"] = Processor.process_import_table self._processMap["import_geo_table"] = Processor.process_import_geo_table self._processMap["import_table_status"] = Processor.process_import_table_status self._processMap["get_first_geo_file_in_archive"] = Processor.process_get_first_geo_file_in_archive self._processMap["get_all_files_in_archive"] = Processor.process_get_all_files_in_archive self._processMap["get_layers_in_geo_file"] = Processor.process_get_layers_in_geo_file self._processMap["query_get_outer_fragment_count"] = Processor.process_query_get_outer_fragment_count self._processMap["check_table_consistency"] = Processor.process_check_table_consistency self._processMap["start_query"] = Processor.process_start_query self._processMap["execute_query_step"] = Processor.process_execute_query_step self._processMap["broadcast_serialized_rows"] = Processor.process_broadcast_serialized_rows self._processMap["start_render_query"] = Processor.process_start_render_query self._processMap["execute_next_render_step"] = Processor.process_execute_next_render_step self._processMap["insert_data"] = Processor.process_insert_data self._processMap["checkpoint"] = Processor.process_checkpoint self._processMap["get_roles"] = Processor.process_get_roles self._processMap["get_db_objects_for_grantee"] = Processor.process_get_db_objects_for_grantee self._processMap["get_db_object_privs"] = Processor.process_get_db_object_privs self._processMap["get_all_roles_for_user"] = Processor.process_get_all_roles_for_user self._processMap["has_role"] = Processor.process_has_role self._processMap["has_object_privilege"] = Processor.process_has_object_privilege self._processMap["set_license_key"] = Processor.process_set_license_key self._processMap["get_license_claims"] = Processor.process_get_license_claims self._processMap["get_device_parameters"] = Processor.process_get_device_parameters self._processMap["register_runtime_extension_functions"] = Processor.process_register_runtime_extension_functions self._on_message_begin = None def on_message_begin(self, func): self._on_message_begin = func def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if self._on_message_begin: self._on_message_begin(name, type, seqid) if name not in self._processMap: iprot.skip(TType.STRUCT) iprot.readMessageEnd() x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) x.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() return else: self._processMap[name](self, seqid, iprot, oprot) return True def process_connect(self, seqid, iprot, oprot): args = connect_args() args.read(iprot) iprot.readMessageEnd() result = connect_result() try: result.success = self._handler.connect(args.user, args.passwd, args.dbname) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("connect", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_krb5_connect(self, seqid, iprot, oprot): args = krb5_connect_args() args.read(iprot) iprot.readMessageEnd() result = krb5_connect_result() try: result.success = self._handler.krb5_connect(args.inputToken, args.dbname) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("krb5_connect", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_disconnect(self, seqid, iprot, oprot): args = disconnect_args() args.read(iprot) iprot.readMessageEnd() result = disconnect_result() try: self._handler.disconnect(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("disconnect", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_switch_database(self, seqid, iprot, oprot): args = switch_database_args() args.read(iprot) iprot.readMessageEnd() result = switch_database_result() try: self._handler.switch_database(args.session, args.dbname) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("switch_database", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_clone_session(self, seqid, iprot, oprot): args = clone_session_args() args.read(iprot) iprot.readMessageEnd() result = clone_session_result() try: result.success = self._handler.clone_session(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("clone_session", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_server_status(self, seqid, iprot, oprot): args = get_server_status_args() args.read(iprot) iprot.readMessageEnd() result = get_server_status_result() try: result.success = self._handler.get_server_status(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_server_status", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_status(self, seqid, iprot, oprot): args = get_status_args() args.read(iprot) iprot.readMessageEnd() result = get_status_result() try: result.success = self._handler.get_status(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_status", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_hardware_info(self, seqid, iprot, oprot): args = get_hardware_info_args() args.read(iprot) iprot.readMessageEnd() result = get_hardware_info_result() try: result.success = self._handler.get_hardware_info(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_hardware_info", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_tables(self, seqid, iprot, oprot): args = get_tables_args() args.read(iprot) iprot.readMessageEnd() result = get_tables_result() try: result.success = self._handler.get_tables(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_tables", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_physical_tables(self, seqid, iprot, oprot): args = get_physical_tables_args() args.read(iprot) iprot.readMessageEnd() result = get_physical_tables_result() try: result.success = self._handler.get_physical_tables(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_physical_tables", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_views(self, seqid, iprot, oprot): args = get_views_args() args.read(iprot) iprot.readMessageEnd() result = get_views_result() try: result.success = self._handler.get_views(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_views", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_tables_meta(self, seqid, iprot, oprot): args = get_tables_meta_args() args.read(iprot) iprot.readMessageEnd() result = get_tables_meta_result() try: result.success = self._handler.get_tables_meta(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_tables_meta", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_table_details(self, seqid, iprot, oprot): args = get_table_details_args() args.read(iprot) iprot.readMessageEnd() result = get_table_details_result() try: result.success = self._handler.get_table_details(args.session, args.table_name) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_table_details", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_internal_table_details(self, seqid, iprot, oprot): args = get_internal_table_details_args() args.read(iprot) iprot.readMessageEnd() result = get_internal_table_details_result() try: result.success = self._handler.get_internal_table_details(args.session, args.table_name) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_internal_table_details", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_users(self, seqid, iprot, oprot): args = get_users_args() args.read(iprot) iprot.readMessageEnd() result = get_users_result() try: result.success = self._handler.get_users(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_users", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_databases(self, seqid, iprot, oprot): args = get_databases_args() args.read(iprot) iprot.readMessageEnd() result = get_databases_result() try: result.success = self._handler.get_databases(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_databases", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_version(self, seqid, iprot, oprot): args = get_version_args() args.read(iprot) iprot.readMessageEnd() result = get_version_result() try: result.success = self._handler.get_version() msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_version", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_start_heap_profile(self, seqid, iprot, oprot): args = start_heap_profile_args() args.read(iprot) iprot.readMessageEnd() result = start_heap_profile_result() try: self._handler.start_heap_profile(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("start_heap_profile", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_stop_heap_profile(self, seqid, iprot, oprot): args = stop_heap_profile_args() args.read(iprot) iprot.readMessageEnd() result = stop_heap_profile_result() try: self._handler.stop_heap_profile(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("stop_heap_profile", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_heap_profile(self, seqid, iprot, oprot): args = get_heap_profile_args() args.read(iprot) iprot.readMessageEnd() result = get_heap_profile_result() try: result.success = self._handler.get_heap_profile(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_heap_profile", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_memory(self, seqid, iprot, oprot): args = get_memory_args() args.read(iprot) iprot.readMessageEnd() result = get_memory_result() try: result.success = self._handler.get_memory(args.session, args.memory_level) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_memory", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_clear_cpu_memory(self, seqid, iprot, oprot): args = clear_cpu_memory_args() args.read(iprot) iprot.readMessageEnd() result = clear_cpu_memory_result() try: self._handler.clear_cpu_memory(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("clear_cpu_memory", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_clear_gpu_memory(self, seqid, iprot, oprot): args = clear_gpu_memory_args() args.read(iprot) iprot.readMessageEnd() result = clear_gpu_memory_result() try: self._handler.clear_gpu_memory(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("clear_gpu_memory", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_set_table_epoch(self, seqid, iprot, oprot): args = set_table_epoch_args() args.read(iprot) iprot.readMessageEnd() result = set_table_epoch_result() try: self._handler.set_table_epoch(args.session, args.db_id, args.table_id, args.new_epoch) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("set_table_epoch", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_set_table_epoch_by_name(self, seqid, iprot, oprot): args = set_table_epoch_by_name_args() args.read(iprot) iprot.readMessageEnd() result = set_table_epoch_by_name_result() try: self._handler.set_table_epoch_by_name(args.session, args.table_name, args.new_epoch) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("set_table_epoch_by_name", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_table_epoch(self, seqid, iprot, oprot): args = get_table_epoch_args() args.read(iprot) iprot.readMessageEnd() result = get_table_epoch_result() try: result.success = self._handler.get_table_epoch(args.session, args.db_id, args.table_id) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_table_epoch", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_table_epoch_by_name(self, seqid, iprot, oprot): args = get_table_epoch_by_name_args() args.read(iprot) iprot.readMessageEnd() result = get_table_epoch_by_name_result() try: result.success = self._handler.get_table_epoch_by_name(args.session, args.table_name) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_table_epoch_by_name", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_session_info(self, seqid, iprot, oprot): args = get_session_info_args() args.read(iprot) iprot.readMessageEnd() result = get_session_info_result() try: result.success = self._handler.get_session_info(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_session_info", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_sql_execute(self, seqid, iprot, oprot): args = sql_execute_args() args.read(iprot) iprot.readMessageEnd() result = sql_execute_result() try: result.success = self._handler.sql_execute(args.session, args.query, args.column_format, args.nonce, args.first_n, args.at_most_n) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("sql_execute", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_sql_execute_df(self, seqid, iprot, oprot): args = sql_execute_df_args() args.read(iprot) iprot.readMessageEnd() result = sql_execute_df_result() try: result.success = self._handler.sql_execute_df(args.session, args.query, args.device_type, args.device_id, args.first_n, args.transport_method) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("sql_execute_df", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_sql_execute_gdf(self, seqid, iprot, oprot): args = sql_execute_gdf_args() args.read(iprot) iprot.readMessageEnd() result = sql_execute_gdf_result() try: result.success = self._handler.sql_execute_gdf(args.session, args.query, args.device_id, args.first_n) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("sql_execute_gdf", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_deallocate_df(self, seqid, iprot, oprot): args = deallocate_df_args() args.read(iprot) iprot.readMessageEnd() result = deallocate_df_result() try: self._handler.deallocate_df(args.session, args.df, args.device_type, args.device_id) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("deallocate_df", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_interrupt(self, seqid, iprot, oprot): args = interrupt_args() args.read(iprot) iprot.readMessageEnd() result = interrupt_result() try: self._handler.interrupt(args.query_session, args.interrupt_session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("interrupt", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_sql_validate(self, seqid, iprot, oprot): args = sql_validate_args() args.read(iprot) iprot.readMessageEnd() result = sql_validate_result() try: result.success = self._handler.sql_validate(args.session, args.query) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("sql_validate", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_completion_hints(self, seqid, iprot, oprot): args = get_completion_hints_args() args.read(iprot) iprot.readMessageEnd() result = get_completion_hints_result() try: result.success = self._handler.get_completion_hints(args.session, args.sql, args.cursor) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_completion_hints", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_set_execution_mode(self, seqid, iprot, oprot): args = set_execution_mode_args() args.read(iprot) iprot.readMessageEnd() result = set_execution_mode_result() try: self._handler.set_execution_mode(args.session, args.mode) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("set_execution_mode", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_render_vega(self, seqid, iprot, oprot): args = render_vega_args() args.read(iprot) iprot.readMessageEnd() result = render_vega_result() try: result.success = self._handler.render_vega(args.session, args.widget_id, args.vega_json, args.compression_level, args.nonce) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("render_vega", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_result_row_for_pixel(self, seqid, iprot, oprot): args = get_result_row_for_pixel_args() args.read(iprot) iprot.readMessageEnd() result = get_result_row_for_pixel_result() try: result.success = self._handler.get_result_row_for_pixel(args.session, args.widget_id, args.pixel, args.table_col_names, args.column_format, args.pixelRadius, args.nonce) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_result_row_for_pixel", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_dashboard(self, seqid, iprot, oprot): args = get_dashboard_args() args.read(iprot) iprot.readMessageEnd() result = get_dashboard_result() try: result.success = self._handler.get_dashboard(args.session, args.dashboard_id) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_dashboard", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_dashboards(self, seqid, iprot, oprot): args = get_dashboards_args() args.read(iprot) iprot.readMessageEnd() result = get_dashboards_result() try: result.success = self._handler.get_dashboards(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_dashboards", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_create_dashboard(self, seqid, iprot, oprot): args = create_dashboard_args() args.read(iprot) iprot.readMessageEnd() result = create_dashboard_result() try: result.success = self._handler.create_dashboard(args.session, args.dashboard_name, args.dashboard_state, args.image_hash, args.dashboard_metadata) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("create_dashboard", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_replace_dashboard(self, seqid, iprot, oprot): args = replace_dashboard_args() args.read(iprot) iprot.readMessageEnd() result = replace_dashboard_result() try: self._handler.replace_dashboard(args.session, args.dashboard_id, args.dashboard_name, args.dashboard_owner, args.dashboard_state, args.image_hash, args.dashboard_metadata) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("replace_dashboard", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_delete_dashboard(self, seqid, iprot, oprot): args = delete_dashboard_args() args.read(iprot) iprot.readMessageEnd() result = delete_dashboard_result() try: self._handler.delete_dashboard(args.session, args.dashboard_id) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("delete_dashboard", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_share_dashboards(self, seqid, iprot, oprot): args = share_dashboards_args() args.read(iprot) iprot.readMessageEnd() result = share_dashboards_result() try: self._handler.share_dashboards(args.session, args.dashboard_ids, args.groups, args.permissions) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("share_dashboards", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_delete_dashboards(self, seqid, iprot, oprot): args = delete_dashboards_args() args.read(iprot) iprot.readMessageEnd() result = delete_dashboards_result() try: self._handler.delete_dashboards(args.session, args.dashboard_ids) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("delete_dashboards", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_share_dashboard(self, seqid, iprot, oprot): args = share_dashboard_args() args.read(iprot) iprot.readMessageEnd() result = share_dashboard_result() try: self._handler.share_dashboard(args.session, args.dashboard_id, args.groups, args.objects, args.permissions, args.grant_role) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("share_dashboard", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_unshare_dashboard(self, seqid, iprot, oprot): args = unshare_dashboard_args() args.read(iprot) iprot.readMessageEnd() result = unshare_dashboard_result() try: self._handler.unshare_dashboard(args.session, args.dashboard_id, args.groups, args.objects, args.permissions) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("unshare_dashboard", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_unshare_dashboards(self, seqid, iprot, oprot): args = unshare_dashboards_args() args.read(iprot) iprot.readMessageEnd() result = unshare_dashboards_result() try: self._handler.unshare_dashboards(args.session, args.dashboard_ids, args.groups, args.permissions) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("unshare_dashboards", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_dashboard_grantees(self, seqid, iprot, oprot): args = get_dashboard_grantees_args() args.read(iprot) iprot.readMessageEnd() result = get_dashboard_grantees_result() try: result.success = self._handler.get_dashboard_grantees(args.session, args.dashboard_id) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_dashboard_grantees", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_link_view(self, seqid, iprot, oprot): args = get_link_view_args() args.read(iprot) iprot.readMessageEnd() result = get_link_view_result() try: result.success = self._handler.get_link_view(args.session, args.link) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_link_view", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_create_link(self, seqid, iprot, oprot): args = create_link_args() args.read(iprot) iprot.readMessageEnd() result = create_link_result() try: result.success = self._handler.create_link(args.session, args.view_state, args.view_metadata) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("create_link", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_load_table_binary(self, seqid, iprot, oprot): args = load_table_binary_args() args.read(iprot) iprot.readMessageEnd() result = load_table_binary_result() try: self._handler.load_table_binary(args.session, args.table_name, args.rows) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("load_table_binary", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_load_table_binary_columnar(self, seqid, iprot, oprot): args = load_table_binary_columnar_args() args.read(iprot) iprot.readMessageEnd() result = load_table_binary_columnar_result() try: self._handler.load_table_binary_columnar(args.session, args.table_name, args.cols) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("load_table_binary_columnar", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_load_table_binary_arrow(self, seqid, iprot, oprot): args = load_table_binary_arrow_args() args.read(iprot) iprot.readMessageEnd() result = load_table_binary_arrow_result() try: self._handler.load_table_binary_arrow(args.session, args.table_name, args.arrow_stream) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("load_table_binary_arrow", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_load_table(self, seqid, iprot, oprot): args = load_table_args() args.read(iprot) iprot.readMessageEnd() result = load_table_result() try: self._handler.load_table(args.session, args.table_name, args.rows) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("load_table", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_detect_column_types(self, seqid, iprot, oprot): args = detect_column_types_args() args.read(iprot) iprot.readMessageEnd() result = detect_column_types_result() try: result.success = self._handler.detect_column_types(args.session, args.file_name, args.copy_params) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("detect_column_types", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_create_table(self, seqid, iprot, oprot): args = create_table_args() args.read(iprot) iprot.readMessageEnd() result = create_table_result() try: self._handler.create_table(args.session, args.table_name, args.row_desc, args.file_type, args.create_params) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("create_table", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_import_table(self, seqid, iprot, oprot): args = import_table_args() args.read(iprot) iprot.readMessageEnd() result = import_table_result() try: self._handler.import_table(args.session, args.table_name, args.file_name, args.copy_params) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("import_table", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_import_geo_table(self, seqid, iprot, oprot): args = import_geo_table_args() args.read(iprot) iprot.readMessageEnd() result = import_geo_table_result() try: self._handler.import_geo_table(args.session, args.table_name, args.file_name, args.copy_params, args.row_desc, args.create_params) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("import_geo_table", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_import_table_status(self, seqid, iprot, oprot): args = import_table_status_args() args.read(iprot) iprot.readMessageEnd() result = import_table_status_result() try: result.success = self._handler.import_table_status(args.session, args.import_id) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("import_table_status", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_first_geo_file_in_archive(self, seqid, iprot, oprot): args = get_first_geo_file_in_archive_args() args.read(iprot) iprot.readMessageEnd() result = get_first_geo_file_in_archive_result() try: result.success = self._handler.get_first_geo_file_in_archive(args.session, args.archive_path, args.copy_params) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_first_geo_file_in_archive", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_all_files_in_archive(self, seqid, iprot, oprot): args = get_all_files_in_archive_args() args.read(iprot) iprot.readMessageEnd() result = get_all_files_in_archive_result() try: result.success = self._handler.get_all_files_in_archive(args.session, args.archive_path, args.copy_params) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_all_files_in_archive", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_layers_in_geo_file(self, seqid, iprot, oprot): args = get_layers_in_geo_file_args() args.read(iprot) iprot.readMessageEnd() result = get_layers_in_geo_file_result() try: result.success = self._handler.get_layers_in_geo_file(args.session, args.file_name, args.copy_params) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_layers_in_geo_file", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_query_get_outer_fragment_count(self, seqid, iprot, oprot): args = query_get_outer_fragment_count_args() args.read(iprot) iprot.readMessageEnd() result = query_get_outer_fragment_count_result() try: result.success = self._handler.query_get_outer_fragment_count(args.session, args.query) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("query_get_outer_fragment_count", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_check_table_consistency(self, seqid, iprot, oprot): args = check_table_consistency_args() args.read(iprot) iprot.readMessageEnd() result = check_table_consistency_result() try: result.success = self._handler.check_table_consistency(args.session, args.table_id) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("check_table_consistency", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_start_query(self, seqid, iprot, oprot): args = start_query_args() args.read(iprot) iprot.readMessageEnd() result = start_query_result() try: result.success = self._handler.start_query(args.leaf_session, args.parent_session, args.query_ra, args.just_explain, args.outer_fragment_indices) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("start_query", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_execute_query_step(self, seqid, iprot, oprot): args = execute_query_step_args() args.read(iprot) iprot.readMessageEnd() result = execute_query_step_result() try: result.success = self._handler.execute_query_step(args.pending_query) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("execute_query_step", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_broadcast_serialized_rows(self, seqid, iprot, oprot): args = broadcast_serialized_rows_args() args.read(iprot) iprot.readMessageEnd() result = broadcast_serialized_rows_result() try: self._handler.broadcast_serialized_rows(args.serialized_rows, args.row_desc, args.query_id) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("broadcast_serialized_rows", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_start_render_query(self, seqid, iprot, oprot): args = start_render_query_args() args.read(iprot) iprot.readMessageEnd() result = start_render_query_result() try: result.success = self._handler.start_render_query(args.session, args.widget_id, args.node_idx, args.vega_json) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("start_render_query", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_execute_next_render_step(self, seqid, iprot, oprot): args = execute_next_render_step_args() args.read(iprot) iprot.readMessageEnd() result = execute_next_render_step_result() try: result.success = self._handler.execute_next_render_step(args.pending_render, args.merged_data) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("execute_next_render_step", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_insert_data(self, seqid, iprot, oprot): args = insert_data_args() args.read(iprot) iprot.readMessageEnd() result = insert_data_result() try: self._handler.insert_data(args.session, args.insert_data) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("insert_data", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_checkpoint(self, seqid, iprot, oprot): args = checkpoint_args() args.read(iprot) iprot.readMessageEnd() result = checkpoint_result() try: self._handler.checkpoint(args.session, args.db_id, args.table_id) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("checkpoint", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_roles(self, seqid, iprot, oprot): args = get_roles_args() args.read(iprot) iprot.readMessageEnd() result = get_roles_result() try: result.success = self._handler.get_roles(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_roles", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_db_objects_for_grantee(self, seqid, iprot, oprot): args = get_db_objects_for_grantee_args() args.read(iprot) iprot.readMessageEnd() result = get_db_objects_for_grantee_result() try: result.success = self._handler.get_db_objects_for_grantee(args.session, args.roleName) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_db_objects_for_grantee", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_db_object_privs(self, seqid, iprot, oprot): args = get_db_object_privs_args() args.read(iprot) iprot.readMessageEnd() result = get_db_object_privs_result() try: result.success = self._handler.get_db_object_privs(args.session, args.objectName, args.type) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_db_object_privs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_all_roles_for_user(self, seqid, iprot, oprot): args = get_all_roles_for_user_args() args.read(iprot) iprot.readMessageEnd() result = get_all_roles_for_user_result() try: result.success = self._handler.get_all_roles_for_user(args.session, args.userName) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_all_roles_for_user", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_has_role(self, seqid, iprot, oprot): args = has_role_args() args.read(iprot) iprot.readMessageEnd() result = has_role_result() try: result.success = self._handler.has_role(args.session, args.granteeName, args.roleName) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("has_role", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_has_object_privilege(self, seqid, iprot, oprot): args = has_object_privilege_args() args.read(iprot) iprot.readMessageEnd() result = has_object_privilege_result() try: result.success = self._handler.has_object_privilege(args.session, args.granteeName, args.ObjectName, args.objectType, args.permissions) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("has_object_privilege", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_set_license_key(self, seqid, iprot, oprot): args = set_license_key_args() args.read(iprot) iprot.readMessageEnd() result = set_license_key_result() try: result.success = self._handler.set_license_key(args.session, args.key, args.nonce) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("set_license_key", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_license_claims(self, seqid, iprot, oprot): args = get_license_claims_args() args.read(iprot) iprot.readMessageEnd() result = get_license_claims_result() try: result.success = self._handler.get_license_claims(args.session, args.nonce) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_license_claims", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_get_device_parameters(self, seqid, iprot, oprot): args = get_device_parameters_args() args.read(iprot) iprot.readMessageEnd() result = get_device_parameters_result() try: result.success = self._handler.get_device_parameters(args.session) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("get_device_parameters", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_register_runtime_extension_functions(self, seqid, iprot, oprot): args = register_runtime_extension_functions_args() args.read(iprot) iprot.readMessageEnd() result = register_runtime_extension_functions_result() try: self._handler.register_runtime_extension_functions(args.session, args.udfs, args.udtfs, args.device_ir_map) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise except TOmniSciException as e: msg_type = TMessageType.REPLY result.e = e except TApplicationException as ex: logging.exception('TApplication exception in handler') msg_type = TMessageType.EXCEPTION result = ex except Exception: logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') oprot.writeMessageBegin("register_runtime_extension_functions", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class connect_args(object): """ Attributes: - user - passwd - dbname """ def __init__(self, user=None, passwd=None, dbname=None,): self.user = user self.passwd = passwd self.dbname = dbname def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.user = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.passwd = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.dbname = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('connect_args') if self.user is not None: oprot.writeFieldBegin('user', TType.STRING, 1) oprot.writeString(self.user.encode('utf-8') if sys.version_info[0] == 2 else self.user) oprot.writeFieldEnd() if self.passwd is not None: oprot.writeFieldBegin('passwd', TType.STRING, 2) oprot.writeString(self.passwd.encode('utf-8') if sys.version_info[0] == 2 else self.passwd) oprot.writeFieldEnd() if self.dbname is not None: oprot.writeFieldBegin('dbname', TType.STRING, 3) oprot.writeString(self.dbname.encode('utf-8') if sys.version_info[0] == 2 else self.dbname) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(connect_args) connect_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'user', 'UTF8', None, ), # 1 (2, TType.STRING, 'passwd', 'UTF8', None, ), # 2 (3, TType.STRING, 'dbname', 'UTF8', None, ), # 3 ) class connect_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('connect_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(connect_result) connect_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class krb5_connect_args(object): """ Attributes: - inputToken - dbname """ def __init__(self, inputToken=None, dbname=None,): self.inputToken = inputToken self.dbname = dbname def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.inputToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.dbname = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('krb5_connect_args') if self.inputToken is not None: oprot.writeFieldBegin('inputToken', TType.STRING, 1) oprot.writeString(self.inputToken.encode('utf-8') if sys.version_info[0] == 2 else self.inputToken) oprot.writeFieldEnd() if self.dbname is not None: oprot.writeFieldBegin('dbname', TType.STRING, 2) oprot.writeString(self.dbname.encode('utf-8') if sys.version_info[0] == 2 else self.dbname) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(krb5_connect_args) krb5_connect_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'inputToken', 'UTF8', None, ), # 1 (2, TType.STRING, 'dbname', 'UTF8', None, ), # 2 ) class krb5_connect_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TKrb5Session() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('krb5_connect_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(krb5_connect_result) krb5_connect_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TKrb5Session, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class disconnect_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('disconnect_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(disconnect_args) disconnect_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class disconnect_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('disconnect_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(disconnect_result) disconnect_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class switch_database_args(object): """ Attributes: - session - dbname """ def __init__(self, session=None, dbname=None,): self.session = session self.dbname = dbname def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.dbname = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('switch_database_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dbname is not None: oprot.writeFieldBegin('dbname', TType.STRING, 2) oprot.writeString(self.dbname.encode('utf-8') if sys.version_info[0] == 2 else self.dbname) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(switch_database_args) switch_database_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'dbname', 'UTF8', None, ), # 2 ) class switch_database_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('switch_database_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(switch_database_result) switch_database_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class clone_session_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('clone_session_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(clone_session_args) clone_session_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class clone_session_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('clone_session_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(clone_session_result) clone_session_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_server_status_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_server_status_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_server_status_args) get_server_status_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_server_status_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TServerStatus() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_server_status_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_server_status_result) get_server_status_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TServerStatus, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_status_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_status_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_status_args) get_status_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_status_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype258, _size255) = iprot.readListBegin() for _i259 in range(_size255): _elem260 = TServerStatus() _elem260.read(iprot) self.success.append(_elem260) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_status_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter261 in self.success: iter261.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_status_result) get_status_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TServerStatus, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_hardware_info_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_hardware_info_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_hardware_info_args) get_hardware_info_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_hardware_info_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TClusterHardwareInfo() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_hardware_info_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_hardware_info_result) get_hardware_info_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TClusterHardwareInfo, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_tables_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_tables_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_tables_args) get_tables_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_tables_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype265, _size262) = iprot.readListBegin() for _i266 in range(_size262): _elem267 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success.append(_elem267) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_tables_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter268 in self.success: oprot.writeString(iter268.encode('utf-8') if sys.version_info[0] == 2 else iter268) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_tables_result) get_tables_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_physical_tables_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_physical_tables_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_physical_tables_args) get_physical_tables_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_physical_tables_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype272, _size269) = iprot.readListBegin() for _i273 in range(_size269): _elem274 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success.append(_elem274) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_physical_tables_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter275 in self.success: oprot.writeString(iter275.encode('utf-8') if sys.version_info[0] == 2 else iter275) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_physical_tables_result) get_physical_tables_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_views_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_views_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_views_args) get_views_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_views_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype279, _size276) = iprot.readListBegin() for _i280 in range(_size276): _elem281 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success.append(_elem281) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_views_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter282 in self.success: oprot.writeString(iter282.encode('utf-8') if sys.version_info[0] == 2 else iter282) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_views_result) get_views_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_tables_meta_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_tables_meta_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_tables_meta_args) get_tables_meta_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_tables_meta_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype286, _size283) = iprot.readListBegin() for _i287 in range(_size283): _elem288 = TTableMeta() _elem288.read(iprot) self.success.append(_elem288) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_tables_meta_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter289 in self.success: iter289.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_tables_meta_result) get_tables_meta_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TTableMeta, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_table_details_args(object): """ Attributes: - session - table_name """ def __init__(self, session=None, table_name=None,): self.session = session self.table_name = table_name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_table_details_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_table_details_args) get_table_details_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 ) class get_table_details_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TTableDetails() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_table_details_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_table_details_result) get_table_details_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TTableDetails, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_internal_table_details_args(object): """ Attributes: - session - table_name """ def __init__(self, session=None, table_name=None,): self.session = session self.table_name = table_name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_internal_table_details_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_internal_table_details_args) get_internal_table_details_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 ) class get_internal_table_details_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TTableDetails() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_internal_table_details_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_internal_table_details_result) get_internal_table_details_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TTableDetails, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_users_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_users_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_users_args) get_users_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_users_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype293, _size290) = iprot.readListBegin() for _i294 in range(_size290): _elem295 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success.append(_elem295) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_users_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter296 in self.success: oprot.writeString(iter296.encode('utf-8') if sys.version_info[0] == 2 else iter296) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_users_result) get_users_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_databases_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_databases_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_databases_args) get_databases_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_databases_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype300, _size297) = iprot.readListBegin() for _i301 in range(_size297): _elem302 = TDBInfo() _elem302.read(iprot) self.success.append(_elem302) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_databases_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter303 in self.success: iter303.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_databases_result) get_databases_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TDBInfo, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_version_args(object): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_version_args') oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_version_args) get_version_args.thrift_spec = ( ) class get_version_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_version_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_version_result) get_version_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class start_heap_profile_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('start_heap_profile_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(start_heap_profile_args) start_heap_profile_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class start_heap_profile_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('start_heap_profile_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(start_heap_profile_result) start_heap_profile_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class stop_heap_profile_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('stop_heap_profile_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(stop_heap_profile_args) stop_heap_profile_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class stop_heap_profile_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('stop_heap_profile_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(stop_heap_profile_result) stop_heap_profile_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_heap_profile_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_heap_profile_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_heap_profile_args) get_heap_profile_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_heap_profile_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_heap_profile_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_heap_profile_result) get_heap_profile_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_memory_args(object): """ Attributes: - session - memory_level """ def __init__(self, session=None, memory_level=None,): self.session = session self.memory_level = memory_level def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.memory_level = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_memory_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.memory_level is not None: oprot.writeFieldBegin('memory_level', TType.STRING, 2) oprot.writeString(self.memory_level.encode('utf-8') if sys.version_info[0] == 2 else self.memory_level) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_memory_args) get_memory_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'memory_level', 'UTF8', None, ), # 2 ) class get_memory_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype307, _size304) = iprot.readListBegin() for _i308 in range(_size304): _elem309 = TNodeMemoryInfo() _elem309.read(iprot) self.success.append(_elem309) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_memory_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter310 in self.success: iter310.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_memory_result) get_memory_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TNodeMemoryInfo, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class clear_cpu_memory_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('clear_cpu_memory_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(clear_cpu_memory_args) clear_cpu_memory_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class clear_cpu_memory_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('clear_cpu_memory_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(clear_cpu_memory_result) clear_cpu_memory_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class clear_gpu_memory_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('clear_gpu_memory_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(clear_gpu_memory_args) clear_gpu_memory_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class clear_gpu_memory_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('clear_gpu_memory_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(clear_gpu_memory_result) clear_gpu_memory_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class set_table_epoch_args(object): """ Attributes: - session - db_id - table_id - new_epoch """ def __init__(self, session=None, db_id=None, table_id=None, new_epoch=None,): self.session = session self.db_id = db_id self.table_id = table_id self.new_epoch = new_epoch def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.db_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.table_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.new_epoch = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('set_table_epoch_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.db_id is not None: oprot.writeFieldBegin('db_id', TType.I32, 2) oprot.writeI32(self.db_id) oprot.writeFieldEnd() if self.table_id is not None: oprot.writeFieldBegin('table_id', TType.I32, 3) oprot.writeI32(self.table_id) oprot.writeFieldEnd() if self.new_epoch is not None: oprot.writeFieldBegin('new_epoch', TType.I32, 4) oprot.writeI32(self.new_epoch) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(set_table_epoch_args) set_table_epoch_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'db_id', None, None, ), # 2 (3, TType.I32, 'table_id', None, None, ), # 3 (4, TType.I32, 'new_epoch', None, None, ), # 4 ) class set_table_epoch_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('set_table_epoch_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(set_table_epoch_result) set_table_epoch_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class set_table_epoch_by_name_args(object): """ Attributes: - session - table_name - new_epoch """ def __init__(self, session=None, table_name=None, new_epoch=None,): self.session = session self.table_name = table_name self.new_epoch = new_epoch def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.new_epoch = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('set_table_epoch_by_name_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() if self.new_epoch is not None: oprot.writeFieldBegin('new_epoch', TType.I32, 3) oprot.writeI32(self.new_epoch) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(set_table_epoch_by_name_args) set_table_epoch_by_name_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 (3, TType.I32, 'new_epoch', None, None, ), # 3 ) class set_table_epoch_by_name_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('set_table_epoch_by_name_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(set_table_epoch_by_name_result) set_table_epoch_by_name_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_table_epoch_args(object): """ Attributes: - session - db_id - table_id """ def __init__(self, session=None, db_id=None, table_id=None,): self.session = session self.db_id = db_id self.table_id = table_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.db_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.table_id = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_table_epoch_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.db_id is not None: oprot.writeFieldBegin('db_id', TType.I32, 2) oprot.writeI32(self.db_id) oprot.writeFieldEnd() if self.table_id is not None: oprot.writeFieldBegin('table_id', TType.I32, 3) oprot.writeI32(self.table_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_table_epoch_args) get_table_epoch_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'db_id', None, None, ), # 2 (3, TType.I32, 'table_id', None, None, ), # 3 ) class get_table_epoch_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.I32: self.success = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_table_epoch_result') if self.success is not None: oprot.writeFieldBegin('success', TType.I32, 0) oprot.writeI32(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_table_epoch_result) get_table_epoch_result.thrift_spec = ( (0, TType.I32, 'success', None, None, ), # 0 ) class get_table_epoch_by_name_args(object): """ Attributes: - session - table_name """ def __init__(self, session=None, table_name=None,): self.session = session self.table_name = table_name def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_table_epoch_by_name_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_table_epoch_by_name_args) get_table_epoch_by_name_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 ) class get_table_epoch_by_name_result(object): """ Attributes: - success """ def __init__(self, success=None,): self.success = success def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.I32: self.success = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_table_epoch_by_name_result') if self.success is not None: oprot.writeFieldBegin('success', TType.I32, 0) oprot.writeI32(self.success) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_table_epoch_by_name_result) get_table_epoch_by_name_result.thrift_spec = ( (0, TType.I32, 'success', None, None, ), # 0 ) class get_session_info_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_session_info_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_session_info_args) get_session_info_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_session_info_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TSessionInfo() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_session_info_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_session_info_result) get_session_info_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TSessionInfo, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class sql_execute_args(object): """ Attributes: - session - query - column_format - nonce - first_n - at_most_n """ def __init__(self, session=None, query=None, column_format=None, nonce=None, first_n=-1, at_most_n=-1,): self.session = session self.query = query self.column_format = column_format self.nonce = nonce self.first_n = first_n self.at_most_n = at_most_n def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.query = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.BOOL: self.column_format = iprot.readBool() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.nonce = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.first_n = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.I32: self.at_most_n = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sql_execute_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.query is not None: oprot.writeFieldBegin('query', TType.STRING, 2) oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() if self.column_format is not None: oprot.writeFieldBegin('column_format', TType.BOOL, 3) oprot.writeBool(self.column_format) oprot.writeFieldEnd() if self.nonce is not None: oprot.writeFieldBegin('nonce', TType.STRING, 4) oprot.writeString(self.nonce.encode('utf-8') if sys.version_info[0] == 2 else self.nonce) oprot.writeFieldEnd() if self.first_n is not None: oprot.writeFieldBegin('first_n', TType.I32, 5) oprot.writeI32(self.first_n) oprot.writeFieldEnd() if self.at_most_n is not None: oprot.writeFieldBegin('at_most_n', TType.I32, 6) oprot.writeI32(self.at_most_n) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(sql_execute_args) sql_execute_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'query', 'UTF8', None, ), # 2 (3, TType.BOOL, 'column_format', None, None, ), # 3 (4, TType.STRING, 'nonce', 'UTF8', None, ), # 4 (5, TType.I32, 'first_n', None, -1, ), # 5 (6, TType.I32, 'at_most_n', None, -1, ), # 6 ) class sql_execute_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TQueryResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sql_execute_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(sql_execute_result) sql_execute_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TQueryResult, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class sql_execute_df_args(object): """ Attributes: - session - query - device_type - device_id - first_n - transport_method """ def __init__(self, session=None, query=None, device_type=None, device_id=0, first_n=-1, transport_method=None,): self.session = session self.query = query self.device_type = device_type self.device_id = device_id self.first_n = first_n self.transport_method = transport_method def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.query = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.device_type = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.device_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: self.first_n = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.I32: self.transport_method = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sql_execute_df_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.query is not None: oprot.writeFieldBegin('query', TType.STRING, 2) oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() if self.device_type is not None: oprot.writeFieldBegin('device_type', TType.I32, 3) oprot.writeI32(self.device_type) oprot.writeFieldEnd() if self.device_id is not None: oprot.writeFieldBegin('device_id', TType.I32, 4) oprot.writeI32(self.device_id) oprot.writeFieldEnd() if self.first_n is not None: oprot.writeFieldBegin('first_n', TType.I32, 5) oprot.writeI32(self.first_n) oprot.writeFieldEnd() if self.transport_method is not None: oprot.writeFieldBegin('transport_method', TType.I32, 6) oprot.writeI32(self.transport_method) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(sql_execute_df_args) sql_execute_df_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'query', 'UTF8', None, ), # 2 (3, TType.I32, 'device_type', None, None, ), # 3 (4, TType.I32, 'device_id', None, 0, ), # 4 (5, TType.I32, 'first_n', None, -1, ), # 5 (6, TType.I32, 'transport_method', None, None, ), # 6 ) class sql_execute_df_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TDataFrame() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sql_execute_df_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(sql_execute_df_result) sql_execute_df_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TDataFrame, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class sql_execute_gdf_args(object): """ Attributes: - session - query - device_id - first_n """ def __init__(self, session=None, query=None, device_id=0, first_n=-1,): self.session = session self.query = query self.device_id = device_id self.first_n = first_n def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.query = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.device_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.first_n = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sql_execute_gdf_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.query is not None: oprot.writeFieldBegin('query', TType.STRING, 2) oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() if self.device_id is not None: oprot.writeFieldBegin('device_id', TType.I32, 3) oprot.writeI32(self.device_id) oprot.writeFieldEnd() if self.first_n is not None: oprot.writeFieldBegin('first_n', TType.I32, 4) oprot.writeI32(self.first_n) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(sql_execute_gdf_args) sql_execute_gdf_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'query', 'UTF8', None, ), # 2 (3, TType.I32, 'device_id', None, 0, ), # 3 (4, TType.I32, 'first_n', None, -1, ), # 4 ) class sql_execute_gdf_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TDataFrame() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sql_execute_gdf_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(sql_execute_gdf_result) sql_execute_gdf_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TDataFrame, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class deallocate_df_args(object): """ Attributes: - session - df - device_type - device_id """ def __init__(self, session=None, df=None, device_type=None, device_id=0,): self.session = session self.df = df self.device_type = device_type self.device_id = device_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.df = TDataFrame() self.df.read(iprot) else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.device_type = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.device_id = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('deallocate_df_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.df is not None: oprot.writeFieldBegin('df', TType.STRUCT, 2) self.df.write(oprot) oprot.writeFieldEnd() if self.device_type is not None: oprot.writeFieldBegin('device_type', TType.I32, 3) oprot.writeI32(self.device_type) oprot.writeFieldEnd() if self.device_id is not None: oprot.writeFieldBegin('device_id', TType.I32, 4) oprot.writeI32(self.device_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(deallocate_df_args) deallocate_df_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRUCT, 'df', [TDataFrame, None], None, ), # 2 (3, TType.I32, 'device_type', None, None, ), # 3 (4, TType.I32, 'device_id', None, 0, ), # 4 ) class deallocate_df_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('deallocate_df_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(deallocate_df_result) deallocate_df_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class interrupt_args(object): """ Attributes: - query_session - interrupt_session """ def __init__(self, query_session=None, interrupt_session=None,): self.query_session = query_session self.interrupt_session = interrupt_session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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_session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.interrupt_session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('interrupt_args') if self.query_session is not None: oprot.writeFieldBegin('query_session', TType.STRING, 1) oprot.writeString(self.query_session.encode('utf-8') if sys.version_info[0] == 2 else self.query_session) oprot.writeFieldEnd() if self.interrupt_session is not None: oprot.writeFieldBegin('interrupt_session', TType.STRING, 2) oprot.writeString(self.interrupt_session.encode('utf-8') if sys.version_info[0] == 2 else self.interrupt_session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(interrupt_args) interrupt_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'query_session', 'UTF8', None, ), # 1 (2, TType.STRING, 'interrupt_session', 'UTF8', None, ), # 2 ) class interrupt_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('interrupt_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(interrupt_result) interrupt_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class sql_validate_args(object): """ Attributes: - session - query """ def __init__(self, session=None, query=None,): self.session = session self.query = query def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.query = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sql_validate_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.query is not None: oprot.writeFieldBegin('query', TType.STRING, 2) oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(sql_validate_args) sql_validate_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'query', 'UTF8', None, ), # 2 ) class sql_validate_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype314, _size311) = iprot.readListBegin() for _i315 in range(_size311): _elem316 = TColumnType() _elem316.read(iprot) self.success.append(_elem316) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('sql_validate_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter317 in self.success: iter317.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(sql_validate_result) sql_validate_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TColumnType, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_completion_hints_args(object): """ Attributes: - session - sql - cursor """ def __init__(self, session=None, sql=None, cursor=None,): self.session = session self.sql = sql self.cursor = cursor def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.sql = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.cursor = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_completion_hints_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.sql is not None: oprot.writeFieldBegin('sql', TType.STRING, 2) oprot.writeString(self.sql.encode('utf-8') if sys.version_info[0] == 2 else self.sql) oprot.writeFieldEnd() if self.cursor is not None: oprot.writeFieldBegin('cursor', TType.I32, 3) oprot.writeI32(self.cursor) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_completion_hints_args) get_completion_hints_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'sql', 'UTF8', None, ), # 2 (3, TType.I32, 'cursor', None, None, ), # 3 ) class get_completion_hints_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype321, _size318) = iprot.readListBegin() for _i322 in range(_size318): _elem323 = omnisci.completion_hints.ttypes.TCompletionHint() _elem323.read(iprot) self.success.append(_elem323) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_completion_hints_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter324 in self.success: iter324.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_completion_hints_result) get_completion_hints_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [omnisci.completion_hints.ttypes.TCompletionHint, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class set_execution_mode_args(object): """ Attributes: - session - mode """ def __init__(self, session=None, mode=None,): self.session = session self.mode = mode def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.mode = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('set_execution_mode_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.mode is not None: oprot.writeFieldBegin('mode', TType.I32, 2) oprot.writeI32(self.mode) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(set_execution_mode_args) set_execution_mode_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'mode', None, None, ), # 2 ) class set_execution_mode_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('set_execution_mode_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(set_execution_mode_result) set_execution_mode_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class render_vega_args(object): """ Attributes: - session - widget_id - vega_json - compression_level - nonce """ def __init__(self, session=None, widget_id=None, vega_json=None, compression_level=None, nonce=None,): self.session = session self.widget_id = widget_id self.vega_json = vega_json self.compression_level = compression_level self.nonce = nonce def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: self.widget_id = iprot.readI64() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.vega_json = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.compression_level = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.nonce = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('render_vega_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.widget_id is not None: oprot.writeFieldBegin('widget_id', TType.I64, 2) oprot.writeI64(self.widget_id) oprot.writeFieldEnd() if self.vega_json is not None: oprot.writeFieldBegin('vega_json', TType.STRING, 3) oprot.writeString(self.vega_json.encode('utf-8') if sys.version_info[0] == 2 else self.vega_json) oprot.writeFieldEnd() if self.compression_level is not None: oprot.writeFieldBegin('compression_level', TType.I32, 4) oprot.writeI32(self.compression_level) oprot.writeFieldEnd() if self.nonce is not None: oprot.writeFieldBegin('nonce', TType.STRING, 5) oprot.writeString(self.nonce.encode('utf-8') if sys.version_info[0] == 2 else self.nonce) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(render_vega_args) render_vega_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I64, 'widget_id', None, None, ), # 2 (3, TType.STRING, 'vega_json', 'UTF8', None, ), # 3 (4, TType.I32, 'compression_level', None, None, ), # 4 (5, TType.STRING, 'nonce', 'UTF8', None, ), # 5 ) class render_vega_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TRenderResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('render_vega_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(render_vega_result) render_vega_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TRenderResult, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_result_row_for_pixel_args(object): """ Attributes: - session - widget_id - pixel - table_col_names - column_format - pixelRadius - nonce """ def __init__(self, session=None, widget_id=None, pixel=None, table_col_names=None, column_format=None, pixelRadius=None, nonce=None,): self.session = session self.widget_id = widget_id self.pixel = pixel self.table_col_names = table_col_names self.column_format = column_format self.pixelRadius = pixelRadius self.nonce = nonce def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: self.widget_id = iprot.readI64() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.pixel = TPixel() self.pixel.read(iprot) else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.table_col_names = {} (_ktype326, _vtype327, _size325) = iprot.readMapBegin() for _i329 in range(_size325): _key330 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val331 = [] (_etype335, _size332) = iprot.readListBegin() for _i336 in range(_size332): _elem337 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val331.append(_elem337) iprot.readListEnd() self.table_col_names[_key330] = _val331 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BOOL: self.column_format = iprot.readBool() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.I32: self.pixelRadius = iprot.readI32() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.nonce = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_result_row_for_pixel_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.widget_id is not None: oprot.writeFieldBegin('widget_id', TType.I64, 2) oprot.writeI64(self.widget_id) oprot.writeFieldEnd() if self.pixel is not None: oprot.writeFieldBegin('pixel', TType.STRUCT, 3) self.pixel.write(oprot) oprot.writeFieldEnd() if self.table_col_names is not None: oprot.writeFieldBegin('table_col_names', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.table_col_names)) for kiter338, viter339 in self.table_col_names.items(): oprot.writeString(kiter338.encode('utf-8') if sys.version_info[0] == 2 else kiter338) oprot.writeListBegin(TType.STRING, len(viter339)) for iter340 in viter339: oprot.writeString(iter340.encode('utf-8') if sys.version_info[0] == 2 else iter340) oprot.writeListEnd() oprot.writeMapEnd() oprot.writeFieldEnd() if self.column_format is not None: oprot.writeFieldBegin('column_format', TType.BOOL, 5) oprot.writeBool(self.column_format) oprot.writeFieldEnd() if self.pixelRadius is not None: oprot.writeFieldBegin('pixelRadius', TType.I32, 6) oprot.writeI32(self.pixelRadius) oprot.writeFieldEnd() if self.nonce is not None: oprot.writeFieldBegin('nonce', TType.STRING, 7) oprot.writeString(self.nonce.encode('utf-8') if sys.version_info[0] == 2 else self.nonce) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_result_row_for_pixel_args) get_result_row_for_pixel_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I64, 'widget_id', None, None, ), # 2 (3, TType.STRUCT, 'pixel', [TPixel, None], None, ), # 3 (4, TType.MAP, 'table_col_names', (TType.STRING, 'UTF8', TType.LIST, (TType.STRING, 'UTF8', False), False), None, ), # 4 (5, TType.BOOL, 'column_format', None, None, ), # 5 (6, TType.I32, 'pixelRadius', None, None, ), # 6 (7, TType.STRING, 'nonce', 'UTF8', None, ), # 7 ) class get_result_row_for_pixel_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TPixelTableRowResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_result_row_for_pixel_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_result_row_for_pixel_result) get_result_row_for_pixel_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TPixelTableRowResult, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_dashboard_args(object): """ Attributes: - session - dashboard_id """ def __init__(self, session=None, dashboard_id=None,): self.session = session self.dashboard_id = dashboard_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.dashboard_id = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_dashboard_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_id is not None: oprot.writeFieldBegin('dashboard_id', TType.I32, 2) oprot.writeI32(self.dashboard_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_dashboard_args) get_dashboard_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'dashboard_id', None, None, ), # 2 ) class get_dashboard_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TDashboard() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_dashboard_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_dashboard_result) get_dashboard_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TDashboard, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_dashboards_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_dashboards_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_dashboards_args) get_dashboards_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_dashboards_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype344, _size341) = iprot.readListBegin() for _i345 in range(_size341): _elem346 = TDashboard() _elem346.read(iprot) self.success.append(_elem346) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_dashboards_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter347 in self.success: iter347.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_dashboards_result) get_dashboards_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TDashboard, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class create_dashboard_args(object): """ Attributes: - session - dashboard_name - dashboard_state - image_hash - dashboard_metadata """ def __init__(self, session=None, dashboard_name=None, dashboard_state=None, image_hash=None, dashboard_metadata=None,): self.session = session self.dashboard_name = dashboard_name self.dashboard_state = dashboard_state self.image_hash = image_hash self.dashboard_metadata = dashboard_metadata def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.dashboard_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.dashboard_state = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.image_hash = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.dashboard_metadata = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('create_dashboard_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_name is not None: oprot.writeFieldBegin('dashboard_name', TType.STRING, 2) oprot.writeString(self.dashboard_name.encode('utf-8') if sys.version_info[0] == 2 else self.dashboard_name) oprot.writeFieldEnd() if self.dashboard_state is not None: oprot.writeFieldBegin('dashboard_state', TType.STRING, 3) oprot.writeString(self.dashboard_state.encode('utf-8') if sys.version_info[0] == 2 else self.dashboard_state) oprot.writeFieldEnd() if self.image_hash is not None: oprot.writeFieldBegin('image_hash', TType.STRING, 4) oprot.writeString(self.image_hash.encode('utf-8') if sys.version_info[0] == 2 else self.image_hash) oprot.writeFieldEnd() if self.dashboard_metadata is not None: oprot.writeFieldBegin('dashboard_metadata', TType.STRING, 5) oprot.writeString(self.dashboard_metadata.encode('utf-8') if sys.version_info[0] == 2 else self.dashboard_metadata) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(create_dashboard_args) create_dashboard_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'dashboard_name', 'UTF8', None, ), # 2 (3, TType.STRING, 'dashboard_state', 'UTF8', None, ), # 3 (4, TType.STRING, 'image_hash', 'UTF8', None, ), # 4 (5, TType.STRING, 'dashboard_metadata', 'UTF8', None, ), # 5 ) class create_dashboard_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.I32: self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('create_dashboard_result') if self.success is not None: oprot.writeFieldBegin('success', TType.I32, 0) oprot.writeI32(self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(create_dashboard_result) create_dashboard_result.thrift_spec = ( (0, TType.I32, 'success', None, None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class replace_dashboard_args(object): """ Attributes: - session - dashboard_id - dashboard_name - dashboard_owner - dashboard_state - image_hash - dashboard_metadata """ def __init__(self, session=None, dashboard_id=None, dashboard_name=None, dashboard_owner=None, dashboard_state=None, image_hash=None, dashboard_metadata=None,): self.session = session self.dashboard_id = dashboard_id self.dashboard_name = dashboard_name self.dashboard_owner = dashboard_owner self.dashboard_state = dashboard_state self.image_hash = image_hash self.dashboard_metadata = dashboard_metadata def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.dashboard_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.dashboard_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.dashboard_owner = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: self.dashboard_state = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: self.image_hash = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: self.dashboard_metadata = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('replace_dashboard_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_id is not None: oprot.writeFieldBegin('dashboard_id', TType.I32, 2) oprot.writeI32(self.dashboard_id) oprot.writeFieldEnd() if self.dashboard_name is not None: oprot.writeFieldBegin('dashboard_name', TType.STRING, 3) oprot.writeString(self.dashboard_name.encode('utf-8') if sys.version_info[0] == 2 else self.dashboard_name) oprot.writeFieldEnd() if self.dashboard_owner is not None: oprot.writeFieldBegin('dashboard_owner', TType.STRING, 4) oprot.writeString(self.dashboard_owner.encode('utf-8') if sys.version_info[0] == 2 else self.dashboard_owner) oprot.writeFieldEnd() if self.dashboard_state is not None: oprot.writeFieldBegin('dashboard_state', TType.STRING, 5) oprot.writeString(self.dashboard_state.encode('utf-8') if sys.version_info[0] == 2 else self.dashboard_state) oprot.writeFieldEnd() if self.image_hash is not None: oprot.writeFieldBegin('image_hash', TType.STRING, 6) oprot.writeString(self.image_hash.encode('utf-8') if sys.version_info[0] == 2 else self.image_hash) oprot.writeFieldEnd() if self.dashboard_metadata is not None: oprot.writeFieldBegin('dashboard_metadata', TType.STRING, 7) oprot.writeString(self.dashboard_metadata.encode('utf-8') if sys.version_info[0] == 2 else self.dashboard_metadata) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(replace_dashboard_args) replace_dashboard_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'dashboard_id', None, None, ), # 2 (3, TType.STRING, 'dashboard_name', 'UTF8', None, ), # 3 (4, TType.STRING, 'dashboard_owner', 'UTF8', None, ), # 4 (5, TType.STRING, 'dashboard_state', 'UTF8', None, ), # 5 (6, TType.STRING, 'image_hash', 'UTF8', None, ), # 6 (7, TType.STRING, 'dashboard_metadata', 'UTF8', None, ), # 7 ) class replace_dashboard_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('replace_dashboard_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(replace_dashboard_result) replace_dashboard_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class delete_dashboard_args(object): """ Attributes: - session - dashboard_id """ def __init__(self, session=None, dashboard_id=None,): self.session = session self.dashboard_id = dashboard_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.dashboard_id = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('delete_dashboard_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_id is not None: oprot.writeFieldBegin('dashboard_id', TType.I32, 2) oprot.writeI32(self.dashboard_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(delete_dashboard_args) delete_dashboard_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'dashboard_id', None, None, ), # 2 ) class delete_dashboard_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('delete_dashboard_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(delete_dashboard_result) delete_dashboard_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class share_dashboards_args(object): """ Attributes: - session - dashboard_ids - groups - permissions """ def __init__(self, session=None, dashboard_ids=None, groups=None, permissions=None,): self.session = session self.dashboard_ids = dashboard_ids self.groups = groups self.permissions = permissions def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.dashboard_ids = [] (_etype351, _size348) = iprot.readListBegin() for _i352 in range(_size348): _elem353 = iprot.readI32() self.dashboard_ids.append(_elem353) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.groups = [] (_etype357, _size354) = iprot.readListBegin() for _i358 in range(_size354): _elem359 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.groups.append(_elem359) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRUCT: self.permissions = TDashboardPermissions() self.permissions.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('share_dashboards_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_ids is not None: oprot.writeFieldBegin('dashboard_ids', TType.LIST, 2) oprot.writeListBegin(TType.I32, len(self.dashboard_ids)) for iter360 in self.dashboard_ids: oprot.writeI32(iter360) oprot.writeListEnd() oprot.writeFieldEnd() if self.groups is not None: oprot.writeFieldBegin('groups', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.groups)) for iter361 in self.groups: oprot.writeString(iter361.encode('utf-8') if sys.version_info[0] == 2 else iter361) oprot.writeListEnd() oprot.writeFieldEnd() if self.permissions is not None: oprot.writeFieldBegin('permissions', TType.STRUCT, 4) self.permissions.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(share_dashboards_args) share_dashboards_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.LIST, 'dashboard_ids', (TType.I32, None, False), None, ), # 2 (3, TType.LIST, 'groups', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.STRUCT, 'permissions', [TDashboardPermissions, None], None, ), # 4 ) class share_dashboards_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('share_dashboards_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(share_dashboards_result) share_dashboards_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class delete_dashboards_args(object): """ Attributes: - session - dashboard_ids """ def __init__(self, session=None, dashboard_ids=None,): self.session = session self.dashboard_ids = dashboard_ids def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.dashboard_ids = [] (_etype365, _size362) = iprot.readListBegin() for _i366 in range(_size362): _elem367 = iprot.readI32() self.dashboard_ids.append(_elem367) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('delete_dashboards_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_ids is not None: oprot.writeFieldBegin('dashboard_ids', TType.LIST, 2) oprot.writeListBegin(TType.I32, len(self.dashboard_ids)) for iter368 in self.dashboard_ids: oprot.writeI32(iter368) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(delete_dashboards_args) delete_dashboards_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.LIST, 'dashboard_ids', (TType.I32, None, False), None, ), # 2 ) class delete_dashboards_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('delete_dashboards_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(delete_dashboards_result) delete_dashboards_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class share_dashboard_args(object): """ Attributes: - session - dashboard_id - groups - objects - permissions - grant_role """ def __init__(self, session=None, dashboard_id=None, groups=None, objects=None, permissions=None, grant_role=False,): self.session = session self.dashboard_id = dashboard_id self.groups = groups self.objects = objects self.permissions = permissions self.grant_role = grant_role def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.dashboard_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.groups = [] (_etype372, _size369) = iprot.readListBegin() for _i373 in range(_size369): _elem374 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.groups.append(_elem374) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.objects = [] (_etype378, _size375) = iprot.readListBegin() for _i379 in range(_size375): _elem380 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.objects.append(_elem380) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRUCT: self.permissions = TDashboardPermissions() self.permissions.read(iprot) else: iprot.skip(ftype) elif fid == 6: if ftype == TType.BOOL: self.grant_role = iprot.readBool() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('share_dashboard_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_id is not None: oprot.writeFieldBegin('dashboard_id', TType.I32, 2) oprot.writeI32(self.dashboard_id) oprot.writeFieldEnd() if self.groups is not None: oprot.writeFieldBegin('groups', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.groups)) for iter381 in self.groups: oprot.writeString(iter381.encode('utf-8') if sys.version_info[0] == 2 else iter381) oprot.writeListEnd() oprot.writeFieldEnd() if self.objects is not None: oprot.writeFieldBegin('objects', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.objects)) for iter382 in self.objects: oprot.writeString(iter382.encode('utf-8') if sys.version_info[0] == 2 else iter382) oprot.writeListEnd() oprot.writeFieldEnd() if self.permissions is not None: oprot.writeFieldBegin('permissions', TType.STRUCT, 5) self.permissions.write(oprot) oprot.writeFieldEnd() if self.grant_role is not None: oprot.writeFieldBegin('grant_role', TType.BOOL, 6) oprot.writeBool(self.grant_role) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(share_dashboard_args) share_dashboard_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'dashboard_id', None, None, ), # 2 (3, TType.LIST, 'groups', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.LIST, 'objects', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.STRUCT, 'permissions', [TDashboardPermissions, None], None, ), # 5 (6, TType.BOOL, 'grant_role', None, False, ), # 6 ) class share_dashboard_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('share_dashboard_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(share_dashboard_result) share_dashboard_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class unshare_dashboard_args(object): """ Attributes: - session - dashboard_id - groups - objects - permissions """ def __init__(self, session=None, dashboard_id=None, groups=None, objects=None, permissions=None,): self.session = session self.dashboard_id = dashboard_id self.groups = groups self.objects = objects self.permissions = permissions def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.dashboard_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.groups = [] (_etype386, _size383) = iprot.readListBegin() for _i387 in range(_size383): _elem388 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.groups.append(_elem388) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.objects = [] (_etype392, _size389) = iprot.readListBegin() for _i393 in range(_size389): _elem394 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.objects.append(_elem394) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRUCT: self.permissions = TDashboardPermissions() self.permissions.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('unshare_dashboard_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_id is not None: oprot.writeFieldBegin('dashboard_id', TType.I32, 2) oprot.writeI32(self.dashboard_id) oprot.writeFieldEnd() if self.groups is not None: oprot.writeFieldBegin('groups', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.groups)) for iter395 in self.groups: oprot.writeString(iter395.encode('utf-8') if sys.version_info[0] == 2 else iter395) oprot.writeListEnd() oprot.writeFieldEnd() if self.objects is not None: oprot.writeFieldBegin('objects', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.objects)) for iter396 in self.objects: oprot.writeString(iter396.encode('utf-8') if sys.version_info[0] == 2 else iter396) oprot.writeListEnd() oprot.writeFieldEnd() if self.permissions is not None: oprot.writeFieldBegin('permissions', TType.STRUCT, 5) self.permissions.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(unshare_dashboard_args) unshare_dashboard_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'dashboard_id', None, None, ), # 2 (3, TType.LIST, 'groups', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.LIST, 'objects', (TType.STRING, 'UTF8', False), None, ), # 4 (5, TType.STRUCT, 'permissions', [TDashboardPermissions, None], None, ), # 5 ) class unshare_dashboard_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('unshare_dashboard_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(unshare_dashboard_result) unshare_dashboard_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class unshare_dashboards_args(object): """ Attributes: - session - dashboard_ids - groups - permissions """ def __init__(self, session=None, dashboard_ids=None, groups=None, permissions=None,): self.session = session self.dashboard_ids = dashboard_ids self.groups = groups self.permissions = permissions def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.dashboard_ids = [] (_etype400, _size397) = iprot.readListBegin() for _i401 in range(_size397): _elem402 = iprot.readI32() self.dashboard_ids.append(_elem402) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.groups = [] (_etype406, _size403) = iprot.readListBegin() for _i407 in range(_size403): _elem408 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.groups.append(_elem408) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRUCT: self.permissions = TDashboardPermissions() self.permissions.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('unshare_dashboards_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_ids is not None: oprot.writeFieldBegin('dashboard_ids', TType.LIST, 2) oprot.writeListBegin(TType.I32, len(self.dashboard_ids)) for iter409 in self.dashboard_ids: oprot.writeI32(iter409) oprot.writeListEnd() oprot.writeFieldEnd() if self.groups is not None: oprot.writeFieldBegin('groups', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.groups)) for iter410 in self.groups: oprot.writeString(iter410.encode('utf-8') if sys.version_info[0] == 2 else iter410) oprot.writeListEnd() oprot.writeFieldEnd() if self.permissions is not None: oprot.writeFieldBegin('permissions', TType.STRUCT, 4) self.permissions.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(unshare_dashboards_args) unshare_dashboards_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.LIST, 'dashboard_ids', (TType.I32, None, False), None, ), # 2 (3, TType.LIST, 'groups', (TType.STRING, 'UTF8', False), None, ), # 3 (4, TType.STRUCT, 'permissions', [TDashboardPermissions, None], None, ), # 4 ) class unshare_dashboards_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('unshare_dashboards_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(unshare_dashboards_result) unshare_dashboards_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_dashboard_grantees_args(object): """ Attributes: - session - dashboard_id """ def __init__(self, session=None, dashboard_id=None,): self.session = session self.dashboard_id = dashboard_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.dashboard_id = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_dashboard_grantees_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.dashboard_id is not None: oprot.writeFieldBegin('dashboard_id', TType.I32, 2) oprot.writeI32(self.dashboard_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_dashboard_grantees_args) get_dashboard_grantees_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'dashboard_id', None, None, ), # 2 ) class get_dashboard_grantees_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype414, _size411) = iprot.readListBegin() for _i415 in range(_size411): _elem416 = TDashboardGrantees() _elem416.read(iprot) self.success.append(_elem416) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_dashboard_grantees_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter417 in self.success: iter417.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_dashboard_grantees_result) get_dashboard_grantees_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TDashboardGrantees, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_link_view_args(object): """ Attributes: - session - link """ def __init__(self, session=None, link=None,): self.session = session self.link = link def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.link = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_link_view_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.link is not None: oprot.writeFieldBegin('link', TType.STRING, 2) oprot.writeString(self.link.encode('utf-8') if sys.version_info[0] == 2 else self.link) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_link_view_args) get_link_view_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'link', 'UTF8', None, ), # 2 ) class get_link_view_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TFrontendView() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_link_view_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_link_view_result) get_link_view_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TFrontendView, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class create_link_args(object): """ Attributes: - session - view_state - view_metadata """ def __init__(self, session=None, view_state=None, view_metadata=None,): self.session = session self.view_state = view_state self.view_metadata = view_metadata def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.view_state = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.view_metadata = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('create_link_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.view_state is not None: oprot.writeFieldBegin('view_state', TType.STRING, 2) oprot.writeString(self.view_state.encode('utf-8') if sys.version_info[0] == 2 else self.view_state) oprot.writeFieldEnd() if self.view_metadata is not None: oprot.writeFieldBegin('view_metadata', TType.STRING, 3) oprot.writeString(self.view_metadata.encode('utf-8') if sys.version_info[0] == 2 else self.view_metadata) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(create_link_args) create_link_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'view_state', 'UTF8', None, ), # 2 (3, TType.STRING, 'view_metadata', 'UTF8', None, ), # 3 ) class create_link_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('create_link_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(create_link_result) create_link_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class load_table_binary_args(object): """ Attributes: - session - table_name - rows """ def __init__(self, session=None, table_name=None, rows=None,): self.session = session self.table_name = table_name self.rows = rows def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.rows = [] (_etype421, _size418) = iprot.readListBegin() for _i422 in range(_size418): _elem423 = TRow() _elem423.read(iprot) self.rows.append(_elem423) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('load_table_binary_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() if self.rows is not None: oprot.writeFieldBegin('rows', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.rows)) for iter424 in self.rows: iter424.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(load_table_binary_args) load_table_binary_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 (3, TType.LIST, 'rows', (TType.STRUCT, [TRow, None], False), None, ), # 3 ) class load_table_binary_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('load_table_binary_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(load_table_binary_result) load_table_binary_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class load_table_binary_columnar_args(object): """ Attributes: - session - table_name - cols """ def __init__(self, session=None, table_name=None, cols=None,): self.session = session self.table_name = table_name self.cols = cols def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.cols = [] (_etype428, _size425) = iprot.readListBegin() for _i429 in range(_size425): _elem430 = TColumn() _elem430.read(iprot) self.cols.append(_elem430) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('load_table_binary_columnar_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() if self.cols is not None: oprot.writeFieldBegin('cols', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.cols)) for iter431 in self.cols: iter431.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(load_table_binary_columnar_args) load_table_binary_columnar_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 (3, TType.LIST, 'cols', (TType.STRUCT, [TColumn, None], False), None, ), # 3 ) class load_table_binary_columnar_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('load_table_binary_columnar_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(load_table_binary_columnar_result) load_table_binary_columnar_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class load_table_binary_arrow_args(object): """ Attributes: - session - table_name - arrow_stream """ def __init__(self, session=None, table_name=None, arrow_stream=None,): self.session = session self.table_name = table_name self.arrow_stream = arrow_stream def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.arrow_stream = iprot.readBinary() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('load_table_binary_arrow_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() if self.arrow_stream is not None: oprot.writeFieldBegin('arrow_stream', TType.STRING, 3) oprot.writeBinary(self.arrow_stream) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(load_table_binary_arrow_args) load_table_binary_arrow_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 (3, TType.STRING, 'arrow_stream', 'BINARY', None, ), # 3 ) class load_table_binary_arrow_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('load_table_binary_arrow_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(load_table_binary_arrow_result) load_table_binary_arrow_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class load_table_args(object): """ Attributes: - session - table_name - rows """ def __init__(self, session=None, table_name=None, rows=None,): self.session = session self.table_name = table_name self.rows = rows def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.rows = [] (_etype435, _size432) = iprot.readListBegin() for _i436 in range(_size432): _elem437 = TStringRow() _elem437.read(iprot) self.rows.append(_elem437) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('load_table_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() if self.rows is not None: oprot.writeFieldBegin('rows', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.rows)) for iter438 in self.rows: iter438.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(load_table_args) load_table_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 (3, TType.LIST, 'rows', (TType.STRUCT, [TStringRow, None], False), None, ), # 3 ) class load_table_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('load_table_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(load_table_result) load_table_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class detect_column_types_args(object): """ Attributes: - session - file_name - copy_params """ def __init__(self, session=None, file_name=None, copy_params=None,): self.session = session self.file_name = file_name self.copy_params = copy_params def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.file_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.copy_params = TCopyParams() self.copy_params.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('detect_column_types_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.file_name is not None: oprot.writeFieldBegin('file_name', TType.STRING, 2) oprot.writeString(self.file_name.encode('utf-8') if sys.version_info[0] == 2 else self.file_name) oprot.writeFieldEnd() if self.copy_params is not None: oprot.writeFieldBegin('copy_params', TType.STRUCT, 3) self.copy_params.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(detect_column_types_args) detect_column_types_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'file_name', 'UTF8', None, ), # 2 (3, TType.STRUCT, 'copy_params', [TCopyParams, None], None, ), # 3 ) class detect_column_types_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TDetectResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('detect_column_types_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(detect_column_types_result) detect_column_types_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TDetectResult, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class create_table_args(object): """ Attributes: - session - table_name - row_desc - file_type - create_params """ def __init__(self, session=None, table_name=None, row_desc=None, file_type=0, create_params=None,): self.session = session self.table_name = table_name self.row_desc = row_desc self.file_type = file_type self.create_params = create_params def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.row_desc = [] (_etype442, _size439) = iprot.readListBegin() for _i443 in range(_size439): _elem444 = TColumnType() _elem444.read(iprot) self.row_desc.append(_elem444) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.file_type = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRUCT: self.create_params = TCreateParams() self.create_params.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('create_table_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() if self.row_desc is not None: oprot.writeFieldBegin('row_desc', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.row_desc)) for iter445 in self.row_desc: iter445.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.file_type is not None: oprot.writeFieldBegin('file_type', TType.I32, 4) oprot.writeI32(self.file_type) oprot.writeFieldEnd() if self.create_params is not None: oprot.writeFieldBegin('create_params', TType.STRUCT, 5) self.create_params.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(create_table_args) create_table_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 (3, TType.LIST, 'row_desc', (TType.STRUCT, [TColumnType, None], False), None, ), # 3 (4, TType.I32, 'file_type', None, 0, ), # 4 (5, TType.STRUCT, 'create_params', [TCreateParams, None], None, ), # 5 ) class create_table_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('create_table_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(create_table_result) create_table_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class import_table_args(object): """ Attributes: - session - table_name - file_name - copy_params """ def __init__(self, session=None, table_name=None, file_name=None, copy_params=None,): self.session = session self.table_name = table_name self.file_name = file_name self.copy_params = copy_params def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.file_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRUCT: self.copy_params = TCopyParams() self.copy_params.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('import_table_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() if self.file_name is not None: oprot.writeFieldBegin('file_name', TType.STRING, 3) oprot.writeString(self.file_name.encode('utf-8') if sys.version_info[0] == 2 else self.file_name) oprot.writeFieldEnd() if self.copy_params is not None: oprot.writeFieldBegin('copy_params', TType.STRUCT, 4) self.copy_params.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(import_table_args) import_table_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 (3, TType.STRING, 'file_name', 'UTF8', None, ), # 3 (4, TType.STRUCT, 'copy_params', [TCopyParams, None], None, ), # 4 ) class import_table_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('import_table_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(import_table_result) import_table_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class import_geo_table_args(object): """ Attributes: - session - table_name - file_name - copy_params - row_desc - create_params """ def __init__(self, session=None, table_name=None, file_name=None, copy_params=None, row_desc=None, create_params=None,): self.session = session self.table_name = table_name self.file_name = file_name self.copy_params = copy_params self.row_desc = row_desc self.create_params = create_params def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.table_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.file_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRUCT: self.copy_params = TCopyParams() self.copy_params.read(iprot) else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.row_desc = [] (_etype449, _size446) = iprot.readListBegin() for _i450 in range(_size446): _elem451 = TColumnType() _elem451.read(iprot) self.row_desc.append(_elem451) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRUCT: self.create_params = TCreateParams() self.create_params.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('import_geo_table_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_name is not None: oprot.writeFieldBegin('table_name', TType.STRING, 2) oprot.writeString(self.table_name.encode('utf-8') if sys.version_info[0] == 2 else self.table_name) oprot.writeFieldEnd() if self.file_name is not None: oprot.writeFieldBegin('file_name', TType.STRING, 3) oprot.writeString(self.file_name.encode('utf-8') if sys.version_info[0] == 2 else self.file_name) oprot.writeFieldEnd() if self.copy_params is not None: oprot.writeFieldBegin('copy_params', TType.STRUCT, 4) self.copy_params.write(oprot) oprot.writeFieldEnd() if self.row_desc is not None: oprot.writeFieldBegin('row_desc', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.row_desc)) for iter452 in self.row_desc: iter452.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.create_params is not None: oprot.writeFieldBegin('create_params', TType.STRUCT, 6) self.create_params.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(import_geo_table_args) import_geo_table_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'table_name', 'UTF8', None, ), # 2 (3, TType.STRING, 'file_name', 'UTF8', None, ), # 3 (4, TType.STRUCT, 'copy_params', [TCopyParams, None], None, ), # 4 (5, TType.LIST, 'row_desc', (TType.STRUCT, [TColumnType, None], False), None, ), # 5 (6, TType.STRUCT, 'create_params', [TCreateParams, None], None, ), # 6 ) class import_geo_table_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('import_geo_table_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(import_geo_table_result) import_geo_table_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class import_table_status_args(object): """ Attributes: - session - import_id """ def __init__(self, session=None, import_id=None,): self.session = session self.import_id = import_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.import_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('import_table_status_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.import_id is not None: oprot.writeFieldBegin('import_id', TType.STRING, 2) oprot.writeString(self.import_id.encode('utf-8') if sys.version_info[0] == 2 else self.import_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(import_table_status_args) import_table_status_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'import_id', 'UTF8', None, ), # 2 ) class import_table_status_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TImportStatus() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('import_table_status_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(import_table_status_result) import_table_status_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TImportStatus, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_first_geo_file_in_archive_args(object): """ Attributes: - session - archive_path - copy_params """ def __init__(self, session=None, archive_path=None, copy_params=None,): self.session = session self.archive_path = archive_path self.copy_params = copy_params def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.archive_path = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.copy_params = TCopyParams() self.copy_params.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_first_geo_file_in_archive_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.archive_path is not None: oprot.writeFieldBegin('archive_path', TType.STRING, 2) oprot.writeString(self.archive_path.encode('utf-8') if sys.version_info[0] == 2 else self.archive_path) oprot.writeFieldEnd() if self.copy_params is not None: oprot.writeFieldBegin('copy_params', TType.STRUCT, 3) self.copy_params.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_first_geo_file_in_archive_args) get_first_geo_file_in_archive_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'archive_path', 'UTF8', None, ), # 2 (3, TType.STRUCT, 'copy_params', [TCopyParams, None], None, ), # 3 ) class get_first_geo_file_in_archive_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRING: self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_first_geo_file_in_archive_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_first_geo_file_in_archive_result) get_first_geo_file_in_archive_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_all_files_in_archive_args(object): """ Attributes: - session - archive_path - copy_params """ def __init__(self, session=None, archive_path=None, copy_params=None,): self.session = session self.archive_path = archive_path self.copy_params = copy_params def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.archive_path = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.copy_params = TCopyParams() self.copy_params.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_all_files_in_archive_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.archive_path is not None: oprot.writeFieldBegin('archive_path', TType.STRING, 2) oprot.writeString(self.archive_path.encode('utf-8') if sys.version_info[0] == 2 else self.archive_path) oprot.writeFieldEnd() if self.copy_params is not None: oprot.writeFieldBegin('copy_params', TType.STRUCT, 3) self.copy_params.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_all_files_in_archive_args) get_all_files_in_archive_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'archive_path', 'UTF8', None, ), # 2 (3, TType.STRUCT, 'copy_params', [TCopyParams, None], None, ), # 3 ) class get_all_files_in_archive_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype456, _size453) = iprot.readListBegin() for _i457 in range(_size453): _elem458 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success.append(_elem458) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_all_files_in_archive_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter459 in self.success: oprot.writeString(iter459.encode('utf-8') if sys.version_info[0] == 2 else iter459) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_all_files_in_archive_result) get_all_files_in_archive_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_layers_in_geo_file_args(object): """ Attributes: - session - file_name - copy_params """ def __init__(self, session=None, file_name=None, copy_params=None,): self.session = session self.file_name = file_name self.copy_params = copy_params def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.file_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.copy_params = TCopyParams() self.copy_params.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_layers_in_geo_file_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.file_name is not None: oprot.writeFieldBegin('file_name', TType.STRING, 2) oprot.writeString(self.file_name.encode('utf-8') if sys.version_info[0] == 2 else self.file_name) oprot.writeFieldEnd() if self.copy_params is not None: oprot.writeFieldBegin('copy_params', TType.STRUCT, 3) self.copy_params.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_layers_in_geo_file_args) get_layers_in_geo_file_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'file_name', 'UTF8', None, ), # 2 (3, TType.STRUCT, 'copy_params', [TCopyParams, None], None, ), # 3 ) class get_layers_in_geo_file_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype463, _size460) = iprot.readListBegin() for _i464 in range(_size460): _elem465 = TGeoFileLayerInfo() _elem465.read(iprot) self.success.append(_elem465) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_layers_in_geo_file_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter466 in self.success: iter466.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_layers_in_geo_file_result) get_layers_in_geo_file_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TGeoFileLayerInfo, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class query_get_outer_fragment_count_args(object): """ Attributes: - session - query """ def __init__(self, session=None, query=None,): self.session = session self.query = query def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.query = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('query_get_outer_fragment_count_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.query is not None: oprot.writeFieldBegin('query', TType.STRING, 2) oprot.writeString(self.query.encode('utf-8') if sys.version_info[0] == 2 else self.query) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(query_get_outer_fragment_count_args) query_get_outer_fragment_count_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'query', 'UTF8', None, ), # 2 ) class query_get_outer_fragment_count_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.I64: self.success = iprot.readI64() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('query_get_outer_fragment_count_result') if self.success is not None: oprot.writeFieldBegin('success', TType.I64, 0) oprot.writeI64(self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(query_get_outer_fragment_count_result) query_get_outer_fragment_count_result.thrift_spec = ( (0, TType.I64, 'success', None, None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class check_table_consistency_args(object): """ Attributes: - session - table_id """ def __init__(self, session=None, table_id=None,): self.session = session self.table_id = table_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.table_id = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('check_table_consistency_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.table_id is not None: oprot.writeFieldBegin('table_id', TType.I32, 2) oprot.writeI32(self.table_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(check_table_consistency_args) check_table_consistency_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'table_id', None, None, ), # 2 ) class check_table_consistency_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TTableMeta() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('check_table_consistency_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(check_table_consistency_result) check_table_consistency_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TTableMeta, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class start_query_args(object): """ Attributes: - leaf_session - parent_session - query_ra - just_explain - outer_fragment_indices """ def __init__(self, leaf_session=None, parent_session=None, query_ra=None, just_explain=None, outer_fragment_indices=None,): self.leaf_session = leaf_session self.parent_session = parent_session self.query_ra = query_ra self.just_explain = just_explain self.outer_fragment_indices = outer_fragment_indices def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.leaf_session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.parent_session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.query_ra = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: self.just_explain = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.LIST: self.outer_fragment_indices = [] (_etype470, _size467) = iprot.readListBegin() for _i471 in range(_size467): _elem472 = iprot.readI64() self.outer_fragment_indices.append(_elem472) iprot.readListEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('start_query_args') if self.leaf_session is not None: oprot.writeFieldBegin('leaf_session', TType.STRING, 1) oprot.writeString(self.leaf_session.encode('utf-8') if sys.version_info[0] == 2 else self.leaf_session) oprot.writeFieldEnd() if self.parent_session is not None: oprot.writeFieldBegin('parent_session', TType.STRING, 2) oprot.writeString(self.parent_session.encode('utf-8') if sys.version_info[0] == 2 else self.parent_session) oprot.writeFieldEnd() if self.query_ra is not None: oprot.writeFieldBegin('query_ra', TType.STRING, 3) oprot.writeString(self.query_ra.encode('utf-8') if sys.version_info[0] == 2 else self.query_ra) oprot.writeFieldEnd() if self.just_explain is not None: oprot.writeFieldBegin('just_explain', TType.BOOL, 4) oprot.writeBool(self.just_explain) oprot.writeFieldEnd() if self.outer_fragment_indices is not None: oprot.writeFieldBegin('outer_fragment_indices', TType.LIST, 5) oprot.writeListBegin(TType.I64, len(self.outer_fragment_indices)) for iter473 in self.outer_fragment_indices: oprot.writeI64(iter473) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(start_query_args) start_query_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'leaf_session', 'UTF8', None, ), # 1 (2, TType.STRING, 'parent_session', 'UTF8', None, ), # 2 (3, TType.STRING, 'query_ra', 'UTF8', None, ), # 3 (4, TType.BOOL, 'just_explain', None, None, ), # 4 (5, TType.LIST, 'outer_fragment_indices', (TType.I64, None, False), None, ), # 5 ) class start_query_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TPendingQuery() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('start_query_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(start_query_result) start_query_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TPendingQuery, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class execute_query_step_args(object): """ Attributes: - pending_query """ def __init__(self, pending_query=None,): self.pending_query = pending_query def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.pending_query = TPendingQuery() self.pending_query.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('execute_query_step_args') if self.pending_query is not None: oprot.writeFieldBegin('pending_query', TType.STRUCT, 1) self.pending_query.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(execute_query_step_args) execute_query_step_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'pending_query', [TPendingQuery, None], None, ), # 1 ) class execute_query_step_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TStepResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('execute_query_step_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(execute_query_step_result) execute_query_step_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TStepResult, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class broadcast_serialized_rows_args(object): """ Attributes: - serialized_rows - row_desc - query_id """ def __init__(self, serialized_rows=None, row_desc=None, query_id=None,): self.serialized_rows = serialized_rows self.row_desc = row_desc self.query_id = query_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.serialized_rows = omnisci.serialized_result_set.ttypes.TSerializedRows() self.serialized_rows.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.row_desc = [] (_etype477, _size474) = iprot.readListBegin() for _i478 in range(_size474): _elem479 = TColumnType() _elem479.read(iprot) self.row_desc.append(_elem479) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: self.query_id = iprot.readI64() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('broadcast_serialized_rows_args') if self.serialized_rows is not None: oprot.writeFieldBegin('serialized_rows', TType.STRUCT, 1) self.serialized_rows.write(oprot) oprot.writeFieldEnd() if self.row_desc is not None: oprot.writeFieldBegin('row_desc', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.row_desc)) for iter480 in self.row_desc: iter480.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.query_id is not None: oprot.writeFieldBegin('query_id', TType.I64, 3) oprot.writeI64(self.query_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(broadcast_serialized_rows_args) broadcast_serialized_rows_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'serialized_rows', [omnisci.serialized_result_set.ttypes.TSerializedRows, None], None, ), # 1 (2, TType.LIST, 'row_desc', (TType.STRUCT, [TColumnType, None], False), None, ), # 2 (3, TType.I64, 'query_id', None, None, ), # 3 ) class broadcast_serialized_rows_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('broadcast_serialized_rows_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(broadcast_serialized_rows_result) broadcast_serialized_rows_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class start_render_query_args(object): """ Attributes: - session - widget_id - node_idx - vega_json """ def __init__(self, session=None, widget_id=None, node_idx=None, vega_json=None,): self.session = session self.widget_id = widget_id self.node_idx = node_idx self.vega_json = vega_json def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: self.widget_id = iprot.readI64() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I16: self.node_idx = iprot.readI16() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: self.vega_json = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('start_render_query_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.widget_id is not None: oprot.writeFieldBegin('widget_id', TType.I64, 2) oprot.writeI64(self.widget_id) oprot.writeFieldEnd() if self.node_idx is not None: oprot.writeFieldBegin('node_idx', TType.I16, 3) oprot.writeI16(self.node_idx) oprot.writeFieldEnd() if self.vega_json is not None: oprot.writeFieldBegin('vega_json', TType.STRING, 4) oprot.writeString(self.vega_json.encode('utf-8') if sys.version_info[0] == 2 else self.vega_json) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(start_render_query_args) start_render_query_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I64, 'widget_id', None, None, ), # 2 (3, TType.I16, 'node_idx', None, None, ), # 3 (4, TType.STRING, 'vega_json', 'UTF8', None, ), # 4 ) class start_render_query_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TPendingRenderQuery() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('start_render_query_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(start_render_query_result) start_render_query_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TPendingRenderQuery, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class execute_next_render_step_args(object): """ Attributes: - pending_render - merged_data """ def __init__(self, pending_render=None, merged_data=None,): self.pending_render = pending_render self.merged_data = merged_data def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.pending_render = TPendingRenderQuery() self.pending_render.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.MAP: self.merged_data = {} (_ktype482, _vtype483, _size481) = iprot.readMapBegin() for _i485 in range(_size481): _key486 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val487 = {} (_ktype489, _vtype490, _size488) = iprot.readMapBegin() for _i492 in range(_size488): _key493 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val494 = {} (_ktype496, _vtype497, _size495) = iprot.readMapBegin() for _i499 in range(_size495): _key500 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val501 = {} (_ktype503, _vtype504, _size502) = iprot.readMapBegin() for _i506 in range(_size502): _key507 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val508 = [] (_etype512, _size509) = iprot.readListBegin() for _i513 in range(_size509): _elem514 = TRenderDatum() _elem514.read(iprot) _val508.append(_elem514) iprot.readListEnd() _val501[_key507] = _val508 iprot.readMapEnd() _val494[_key500] = _val501 iprot.readMapEnd() _val487[_key493] = _val494 iprot.readMapEnd() self.merged_data[_key486] = _val487 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('execute_next_render_step_args') if self.pending_render is not None: oprot.writeFieldBegin('pending_render', TType.STRUCT, 1) self.pending_render.write(oprot) oprot.writeFieldEnd() if self.merged_data is not None: oprot.writeFieldBegin('merged_data', TType.MAP, 2) oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.merged_data)) for kiter515, viter516 in self.merged_data.items(): oprot.writeString(kiter515.encode('utf-8') if sys.version_info[0] == 2 else kiter515) oprot.writeMapBegin(TType.STRING, TType.MAP, len(viter516)) for kiter517, viter518 in viter516.items(): oprot.writeString(kiter517.encode('utf-8') if sys.version_info[0] == 2 else kiter517) oprot.writeMapBegin(TType.STRING, TType.MAP, len(viter518)) for kiter519, viter520 in viter518.items(): oprot.writeString(kiter519.encode('utf-8') if sys.version_info[0] == 2 else kiter519) oprot.writeMapBegin(TType.STRING, TType.LIST, len(viter520)) for kiter521, viter522 in viter520.items(): oprot.writeString(kiter521.encode('utf-8') if sys.version_info[0] == 2 else kiter521) oprot.writeListBegin(TType.STRUCT, len(viter522)) for iter523 in viter522: iter523.write(oprot) oprot.writeListEnd() oprot.writeMapEnd() oprot.writeMapEnd() oprot.writeMapEnd() oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(execute_next_render_step_args) execute_next_render_step_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'pending_render', [TPendingRenderQuery, None], None, ), # 1 (2, TType.MAP, 'merged_data', (TType.STRING, 'UTF8', TType.MAP, (TType.STRING, 'UTF8', TType.MAP, (TType.STRING, 'UTF8', TType.MAP, (TType.STRING, 'UTF8', TType.LIST, (TType.STRUCT, [TRenderDatum, None], False), False), False), False), False), None, ), # 2 ) class execute_next_render_step_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TRenderStepResult() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('execute_next_render_step_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(execute_next_render_step_result) execute_next_render_step_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TRenderStepResult, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class insert_data_args(object): """ Attributes: - session - insert_data """ def __init__(self, session=None, insert_data=None,): self.session = session self.insert_data = insert_data def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.insert_data = TInsertData() self.insert_data.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('insert_data_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.insert_data is not None: oprot.writeFieldBegin('insert_data', TType.STRUCT, 2) self.insert_data.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(insert_data_args) insert_data_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRUCT, 'insert_data', [TInsertData, None], None, ), # 2 ) class insert_data_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('insert_data_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(insert_data_result) insert_data_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class checkpoint_args(object): """ Attributes: - session - db_id - table_id """ def __init__(self, session=None, db_id=None, table_id=None,): self.session = session self.db_id = db_id self.table_id = table_id def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: self.db_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.table_id = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('checkpoint_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.db_id is not None: oprot.writeFieldBegin('db_id', TType.I32, 2) oprot.writeI32(self.db_id) oprot.writeFieldEnd() if self.table_id is not None: oprot.writeFieldBegin('table_id', TType.I32, 3) oprot.writeI32(self.table_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(checkpoint_args) checkpoint_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.I32, 'db_id', None, None, ), # 2 (3, TType.I32, 'table_id', None, None, ), # 3 ) class checkpoint_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('checkpoint_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(checkpoint_result) checkpoint_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_roles_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_roles_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_roles_args) get_roles_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_roles_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype527, _size524) = iprot.readListBegin() for _i528 in range(_size524): _elem529 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success.append(_elem529) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_roles_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter530 in self.success: oprot.writeString(iter530.encode('utf-8') if sys.version_info[0] == 2 else iter530) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_roles_result) get_roles_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_db_objects_for_grantee_args(object): """ Attributes: - session - roleName """ def __init__(self, session=None, roleName=None,): self.session = session self.roleName = roleName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.roleName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_db_objects_for_grantee_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.roleName is not None: oprot.writeFieldBegin('roleName', TType.STRING, 2) oprot.writeString(self.roleName.encode('utf-8') if sys.version_info[0] == 2 else self.roleName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_db_objects_for_grantee_args) get_db_objects_for_grantee_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'roleName', 'UTF8', None, ), # 2 ) class get_db_objects_for_grantee_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype534, _size531) = iprot.readListBegin() for _i535 in range(_size531): _elem536 = TDBObject() _elem536.read(iprot) self.success.append(_elem536) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_db_objects_for_grantee_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter537 in self.success: iter537.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_db_objects_for_grantee_result) get_db_objects_for_grantee_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TDBObject, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_db_object_privs_args(object): """ Attributes: - session - objectName - type """ def __init__(self, session=None, objectName=None, type=None,): self.session = session self.objectName = objectName self.type = type def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.objectName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.type = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_db_object_privs_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.objectName is not None: oprot.writeFieldBegin('objectName', TType.STRING, 2) oprot.writeString(self.objectName.encode('utf-8') if sys.version_info[0] == 2 else self.objectName) oprot.writeFieldEnd() if self.type is not None: oprot.writeFieldBegin('type', TType.I32, 3) oprot.writeI32(self.type) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_db_object_privs_args) get_db_object_privs_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'objectName', 'UTF8', None, ), # 2 (3, TType.I32, 'type', None, None, ), # 3 ) class get_db_object_privs_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype541, _size538) = iprot.readListBegin() for _i542 in range(_size538): _elem543 = TDBObject() _elem543.read(iprot) self.success.append(_elem543) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_db_object_privs_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) for iter544 in self.success: iter544.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_db_object_privs_result) get_db_object_privs_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, [TDBObject, None], False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_all_roles_for_user_args(object): """ Attributes: - session - userName """ def __init__(self, session=None, userName=None,): self.session = session self.userName = userName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.userName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_all_roles_for_user_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.userName is not None: oprot.writeFieldBegin('userName', TType.STRING, 2) oprot.writeString(self.userName.encode('utf-8') if sys.version_info[0] == 2 else self.userName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_all_roles_for_user_args) get_all_roles_for_user_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'userName', 'UTF8', None, ), # 2 ) class get_all_roles_for_user_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.LIST: self.success = [] (_etype548, _size545) = iprot.readListBegin() for _i549 in range(_size545): _elem550 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success.append(_elem550) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_all_roles_for_user_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) for iter551 in self.success: oprot.writeString(iter551.encode('utf-8') if sys.version_info[0] == 2 else iter551) oprot.writeListEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_all_roles_for_user_result) get_all_roles_for_user_result.thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING, 'UTF8', False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class has_role_args(object): """ Attributes: - session - granteeName - roleName """ def __init__(self, session=None, granteeName=None, roleName=None,): self.session = session self.granteeName = granteeName self.roleName = roleName def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.granteeName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.roleName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('has_role_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.granteeName is not None: oprot.writeFieldBegin('granteeName', TType.STRING, 2) oprot.writeString(self.granteeName.encode('utf-8') if sys.version_info[0] == 2 else self.granteeName) oprot.writeFieldEnd() if self.roleName is not None: oprot.writeFieldBegin('roleName', TType.STRING, 3) oprot.writeString(self.roleName.encode('utf-8') if sys.version_info[0] == 2 else self.roleName) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(has_role_args) has_role_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'granteeName', 'UTF8', None, ), # 2 (3, TType.STRING, 'roleName', 'UTF8', None, ), # 3 ) class has_role_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('has_role_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(has_role_result) has_role_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class has_object_privilege_args(object): """ Attributes: - session - granteeName - ObjectName - objectType - permissions """ def __init__(self, session=None, granteeName=None, ObjectName=None, objectType=None, permissions=None,): self.session = session self.granteeName = granteeName self.ObjectName = ObjectName self.objectType = objectType self.permissions = permissions def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.granteeName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.ObjectName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: self.objectType = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRUCT: self.permissions = TDBObjectPermissions() self.permissions.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('has_object_privilege_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.granteeName is not None: oprot.writeFieldBegin('granteeName', TType.STRING, 2) oprot.writeString(self.granteeName.encode('utf-8') if sys.version_info[0] == 2 else self.granteeName) oprot.writeFieldEnd() if self.ObjectName is not None: oprot.writeFieldBegin('ObjectName', TType.STRING, 3) oprot.writeString(self.ObjectName.encode('utf-8') if sys.version_info[0] == 2 else self.ObjectName) oprot.writeFieldEnd() if self.objectType is not None: oprot.writeFieldBegin('objectType', TType.I32, 4) oprot.writeI32(self.objectType) oprot.writeFieldEnd() if self.permissions is not None: oprot.writeFieldBegin('permissions', TType.STRUCT, 5) self.permissions.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(has_object_privilege_args) has_object_privilege_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'granteeName', 'UTF8', None, ), # 2 (3, TType.STRING, 'ObjectName', 'UTF8', None, ), # 3 (4, TType.I32, 'objectType', None, None, ), # 4 (5, TType.STRUCT, 'permissions', [TDBObjectPermissions, None], None, ), # 5 ) class has_object_privilege_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.BOOL: self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('has_object_privilege_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(has_object_privilege_result) has_object_privilege_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class set_license_key_args(object): """ Attributes: - session - key - nonce """ def __init__(self, session=None, key=None, nonce="",): self.session = session self.key = key self.nonce = nonce def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: self.nonce = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('set_license_key_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.key is not None: oprot.writeFieldBegin('key', TType.STRING, 2) oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key) oprot.writeFieldEnd() if self.nonce is not None: oprot.writeFieldBegin('nonce', TType.STRING, 3) oprot.writeString(self.nonce.encode('utf-8') if sys.version_info[0] == 2 else self.nonce) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(set_license_key_args) set_license_key_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'key', 'UTF8', None, ), # 2 (3, TType.STRING, 'nonce', 'UTF8', "", ), # 3 ) class set_license_key_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TLicenseInfo() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('set_license_key_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(set_license_key_result) set_license_key_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TLicenseInfo, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_license_claims_args(object): """ Attributes: - session - nonce """ def __init__(self, session=None, nonce="",): self.session = session self.nonce = nonce def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: self.nonce = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_license_claims_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.nonce is not None: oprot.writeFieldBegin('nonce', TType.STRING, 2) oprot.writeString(self.nonce.encode('utf-8') if sys.version_info[0] == 2 else self.nonce) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_license_claims_args) get_license_claims_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.STRING, 'nonce', 'UTF8', "", ), # 2 ) class get_license_claims_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.STRUCT: self.success = TLicenseInfo() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_license_claims_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_license_claims_result) get_license_claims_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TLicenseInfo, None], None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class get_device_parameters_args(object): """ Attributes: - session """ def __init__(self, session=None,): self.session = session def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_device_parameters_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_device_parameters_args) get_device_parameters_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 ) class get_device_parameters_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 0: if ftype == TType.MAP: self.success = {} (_ktype553, _vtype554, _size552) = iprot.readMapBegin() for _i556 in range(_size552): _key557 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val558 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.success[_key557] = _val558 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('get_device_parameters_result') if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success)) for kiter559, viter560 in self.success.items(): oprot.writeString(kiter559.encode('utf-8') if sys.version_info[0] == 2 else kiter559) oprot.writeString(viter560.encode('utf-8') if sys.version_info[0] == 2 else viter560) oprot.writeMapEnd() oprot.writeFieldEnd() if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(get_device_parameters_result) get_device_parameters_result.thrift_spec = ( (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) class register_runtime_extension_functions_args(object): """ Attributes: - session - udfs - udtfs - device_ir_map """ def __init__(self, session=None, udfs=None, udtfs=None, device_ir_map=None,): self.session = session self.udfs = udfs self.udtfs = udtfs self.device_ir_map = device_ir_map def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.session = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.udfs = [] (_etype564, _size561) = iprot.readListBegin() for _i565 in range(_size561): _elem566 = omnisci.extension_functions.ttypes.TUserDefinedFunction() _elem566.read(iprot) self.udfs.append(_elem566) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.udtfs = [] (_etype570, _size567) = iprot.readListBegin() for _i571 in range(_size567): _elem572 = omnisci.extension_functions.ttypes.TUserDefinedTableFunction() _elem572.read(iprot) self.udtfs.append(_elem572) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.device_ir_map = {} (_ktype574, _vtype575, _size573) = iprot.readMapBegin() for _i577 in range(_size573): _key578 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() _val579 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() self.device_ir_map[_key578] = _val579 iprot.readMapEnd() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('register_runtime_extension_functions_args') if self.session is not None: oprot.writeFieldBegin('session', TType.STRING, 1) oprot.writeString(self.session.encode('utf-8') if sys.version_info[0] == 2 else self.session) oprot.writeFieldEnd() if self.udfs is not None: oprot.writeFieldBegin('udfs', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.udfs)) for iter580 in self.udfs: iter580.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.udtfs is not None: oprot.writeFieldBegin('udtfs', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.udtfs)) for iter581 in self.udtfs: iter581.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.device_ir_map is not None: oprot.writeFieldBegin('device_ir_map', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.device_ir_map)) for kiter582, viter583 in self.device_ir_map.items(): oprot.writeString(kiter582.encode('utf-8') if sys.version_info[0] == 2 else kiter582) oprot.writeString(viter583.encode('utf-8') if sys.version_info[0] == 2 else viter583) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(register_runtime_extension_functions_args) register_runtime_extension_functions_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'session', 'UTF8', None, ), # 1 (2, TType.LIST, 'udfs', (TType.STRUCT, [omnisci.extension_functions.ttypes.TUserDefinedFunction, None], False), None, ), # 2 (3, TType.LIST, 'udtfs', (TType.STRUCT, [omnisci.extension_functions.ttypes.TUserDefinedTableFunction, None], False), None, ), # 3 (4, TType.MAP, 'device_ir_map', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 ) class register_runtime_extension_functions_result(object): """ Attributes: - e """ def __init__(self, e=None,): self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [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.STRUCT: self.e = TOmniSciException() self.e.read(iprot) else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('register_runtime_extension_functions_result') if self.e is not None: oprot.writeFieldBegin('e', TType.STRUCT, 1) self.e.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): return 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) all_structs.append(register_runtime_extension_functions_result) register_runtime_extension_functions_result.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'e', [TOmniSciException, None], None, ), # 1 ) fix_spec(all_structs) del all_structs
[ "dev@aas.io" ]
dev@aas.io
4b2efa07e52cebade9b8cc24cd219a9bc1b74941
b3e99aa9ceea0bdfb762080ad96d65d741fdea47
/hacker_rank/30_days_of_code/day_17.py
d5e736590574bd2eb242902abb44f57265231af7
[]
no_license
nomanarshad94/online_coding_problems_and_solutions
6f921a982b2c931772c8c36434eb2cccf364f5eb
b87d0979bd916337cd8785ffe093e8b4c4f44774
refs/heads/master
2020-12-21T18:49:02.630224
2020-02-25T18:26:44
2020-02-25T18:26:44
236,527,159
0
0
null
null
null
null
UTF-8
Python
false
false
416
py
# Write your code here class Calculator(): def power(self, a, b): if a >= 0 and b >= 0: return a ** b else: raise Exception("n and p should be non-negative") myCalculator = Calculator() T = int(input()) for i in range(T): n, p = map(int, input().split()) try: ans = myCalculator.power(n, p) print(ans) except Exception as e: print(e)
[ "nomanarshad94@yahoo.com" ]
nomanarshad94@yahoo.com
154cf1aec35d056d7902662bbff1559c033d649d
acf12c7c1c89a80e34cf13dc8355f432bb189fdb
/automation/zip/view_creation3.py
d88342780a17ccc3c4a3184526bbb2106a395742
[]
no_license
louis-noname/COMP90019-Distributed-Computing-Project
5b1d6e514462aad0de44df0a221f28a5a111355b
3b02234599b4cdd65f0c869a76ee8246ef0d701f
refs/heads/master
2023-04-08T10:50:38.714330
2018-10-30T06:08:28
2018-10-30T06:08:28
null
0
0
null
null
null
null
UTF-8
Python
false
false
303
py
import couchdb from couchdb.design import ViewDefinition #abc couch = couchdb.Server('http://admin:password@115.146.85.196:5984/') database = couch['distance'] view = ViewDefinition('topuser', 'distance', 'function (doc) { emit(doc.user_id, doc.user_id);}') view.get_doc(database) view.sync(database)
[ "noreply@github.com" ]
louis-noname.noreply@github.com
f9b52cd3f2f046e1e518a37954c436cd8ac2a1ff
728d616ffb33a27ba00bd1a331d199f4434029b2
/msgpack/_version.py
e7504851aab50ecce7f7c3a747243c6b8a36f2d0
[ "Apache-2.0" ]
permissive
Lion4ee/msgpack-python
4a81670b7c38977f9bd2d636f9caba34c1613f40
301ad4cd54522bc49b16e5b1b65e7ecbb7864572
refs/heads/master
2021-01-17T08:46:21.675629
2013-02-04T06:21:15
2013-02-04T06:21:15
null
0
0
null
null
null
null
UTF-8
Python
false
false
28
py
version = (0, 3, 0, 'dev1')
[ "inada-n@klab.com" ]
inada-n@klab.com
1bd3de69a046b08bd7b6387d19269886e8c9f96d
33530d8d56379832c5bcfa36f7d48f977bdbf1e8
/Vowpal_Wabbit/auc.py
aa591b53268532334b773e8a80edefc56b0ce802
[]
no_license
allensussman/Kaggle_StumbleUpon
310ee9d00f054364a8268f0a7c94ee65353c7ff1
69078b515ac91efe9d3f27c093d1cb7ea0e47f79
refs/heads/master
2020-04-02T16:45:13.356070
2014-02-14T07:24:34
2014-02-14T07:24:34
null
0
0
null
null
null
null
UTF-8
Python
false
false
529
py
'compute AUC from VW validation and predictions file' import sys, csv, math # from ml_metrics import auc test_file = sys.argv[1] predictions_file = sys.argv[2] test_reader = csv.reader( open( test_file ), delimiter = " " ) p_reader = csv.reader( open( predictions_file ), delimiter = "\n" ) ys = [] ps = [] for p_line in p_reader: test_line = test_reader.next() p = float( p_line[0] ) p = math.tanh( p ) ps.append( p ) y = float( test_line[0] ) ys.append( y ) AUC = auc( ys, ps ) print "AUC: %s" % ( AUC ) print
[ "allen.sussman@gmail.com" ]
allen.sussman@gmail.com
3c53fb8611b15d1f11a492d30ed3328312fca0ae
e8df26dcf93f6f43ba2581d3fdaa6d190dd9c5f1
/evaluate_resnet_pytorch_valid_set.py
159e3d5238c00d4b79af51f050bf401e94ae28fb
[]
no_license
SealLive/ISIC2017
9c5d20d48ab155c3af603e0c39caf6ea95a2e5ff
abf12aa1fad7727e259da1179627c561cdded1ef
refs/heads/main
2023-02-17T07:33:18.852535
2021-01-18T03:19:34
2021-01-18T03:19:34
330,538,187
0
0
null
null
null
null
UTF-8
Python
false
false
6,634
py
import torch import torch.nn as nn from global_variables import GVS from seal_datasets import get_filename_list, MalignantFolder from seal_utils import MyConfusionMatrix import torchvision.transforms as transforms from net_model import NetModel import datetime, time, os import logging import numpy as np from sklearn.metrics import confusion_matrix from sklearn.metrics import auc from sklearn import metrics import pickle # -------- Setting logger -------- # # Time zone is set to Asia/BeiJing(which is UTC-8) # logger.info() outputs logs to both console and file # logger.debug() outputs logs only to console tmp_gvs = GVS() log_filename_prefix = "Evaluate_" + tmp_gvs.exp_target + "_Test" + str(tmp_gvs.test_index) + "_" + tmp_gvs.net.replace(" ", "_") + "_" os.environ['TZ'] = 'UTC-8' time.tzset() date_and_time = time.strftime('%Y%m%d_%H%M%S', time.localtime(time.time())) log_filename = "Logs/" + log_filename_prefix + date_and_time + ".log" if not os.path.exists("Logs"): os.makedirs("Logs") if os.path.exists(log_filename): os.remove(log_filename) logger = logging.getLogger() fh = logging.FileHandler(log_filename) ch = logging.StreamHandler() fh.setLevel(logging.INFO) ch.setLevel(logging.DEBUG) formatter = logging.Formatter('[%(asctime)s] %(message)s', datefmt="%Y-%m-%d %A %H:%M:%S") fh.setFormatter(formatter) ch.setFormatter(formatter) logger.addHandler(fh) logger.addHandler(ch) logger.setLevel(logging.DEBUG) # -------------------------------- # def main(): train_gvs, valid_gvs, train_loader, test_loader = load_data() model = NetModel(valid_gvs) model.load_params(epoch=149) max_valid_acc = -1.0 max_valid_auc = -1.0 max_valid_epoch = -1 train_acc, train_loss, valid_acc, valid_loss = 0.0, 0.0, 0.0, 0.0 train_cm, valid_cm = np.zeros((train_gvs.num_classes, train_gvs.num_classes)), np.zeros((valid_gvs.num_classes, valid_gvs.num_classes)) for epoch in range(149, 150): logger.info("Epoch:%4d" % (epoch)) # train_acc, train_cm, train_loss = valid(train_gvs, model, train_loader, epoch+1) valid_acc, valid_cm, valid_loss, valid_auc = valid(valid_gvs, model, test_loader, epoch) mc = MyConfusionMatrix(train_cm) md = MyConfusionMatrix(valid_cm) if valid_auc > max_valid_auc: max_valid_auc = valid_auc max_valid_epoch = epoch + 1 logger.info("[Valid] Epoch:%4d, Train AUC: %.4f" % (epoch, train_acc)) logger.info("[Valid] Epoch:%4d, Valid AUC: %.4f" % (epoch, valid_auc)) logger.info("[Valid] Epoch:%4d, Max valid AUC is: %.4f at Epoch %d" % (epoch, max_valid_auc, max_valid_epoch)) logger.info("[Valid] Epoch:%4d, Train CM: %s, Loss:%.6f" % (epoch+1, mc.paper_log(), train_loss)) logger.info("[Valid] Epoch:%4d, Valid CM: %s, Loss:%.6f" % (epoch+1, md.paper_log(), valid_loss)) def train(gvs, model, data_loader, epoch): batch_size = gvs.batch_size all_cost = [] count = 0 start_time = time.time() y_predict = [] y_truth = [] for sidx, [data, label] in enumerate(data_loader, 0): error, model_output = model.train(data, label) # ----- collect predicts and labels ----- # y_predict.append(model_output.cpu().numpy()[:, 1]) y_truth.append(label.numpy()) # --------------------------------------- # all_cost.append(error) count += model.is_correct(label, model_output) if (sidx+1) % 10 == 0: logger.info("[Train] Epoch:%4d, BatchIdx:%4d, Cost:%.6f, Acc:%.4f, Speed: %.2f samples/sec" % (epoch, sidx+1, \ np.mean(all_cost), count/((sidx+1)*batch_size), (sidx+1)*batch_size/(time.time()-start_time))) y_predict = np.concatenate(y_predict) y_predict = (y_predict>=0.5).astype("int") y_truth = np.concatenate(y_truth) cm = confusion_matrix(y_truth, y_predict) return count/((sidx+1)*batch_size), cm, np.mean(all_cost) def valid(gvs, model, data_loader, epoch): batch_size = gvs.batch_size all_cost = [] count = 0 start_time = time.time() y_predict = [] y_truth = [] for sidx, [data, label, image_path] in enumerate(data_loader, 0): error, model_output = model.predict(data, label) # ----- collect predicts and labels ----- # y_predict.append(model_output.cpu().numpy()[:, 1]) y_truth.append(label.numpy()) # --------------------------------------- # all_cost.append(error) count += model.is_correct(label, model_output) if (sidx+1) % 10 == 0: logger.info("[Valid] Epoch:%4d, BatchIdx:%4d, Cost:%.6f, Acc:%.4f, Speed: %.2f samples/sec" % (epoch, sidx+1, \ np.mean(all_cost), count/((sidx+1)*batch_size), (sidx+1)*batch_size/(time.time()-start_time))) y_predict = np.concatenate(y_predict) y_truth = np.concatenate(y_truth) # calculate auc fpr, tpr, thresholds = metrics.roc_curve(y_truth, y_predict) auc_value = metrics.auc(fpr, tpr) # get confusion matrix y_predict = (y_predict>=0.5).astype("int") cm = confusion_matrix(y_truth, y_predict) return count/((sidx+1)*batch_size), cm, np.mean(all_cost), auc_value def load_data(): train_gvs = GVS() test_gvs = GVS() train_gvs.batch_size = 1 test_gvs.batch_size = 1 train_list, test_list = get_filename_list(train_gvs) print("Loaded %d train and %d test samples!" % (len(train_list), len(test_list))) # transform train_transform = transforms.Compose([transforms.Resize(size=(train_gvs.width, train_gvs.height)), transforms.RandomHorizontalFlip(), transforms.RandomVerticalFlip(), transforms.RandomResizedCrop(size=train_gvs.width, scale=(0.8, 1.0)), transforms.RandomRotation(degrees=10), transforms.ToTensor()]) test_transform = transforms.Compose([transforms.Resize(size=(test_gvs.width, test_gvs.height)), transforms.ToTensor()]) train_dataset = MalignantFolder(train_list, train_transform) train_loader = torch.utils.data.DataLoader(dataset=train_dataset, batch_size=train_gvs.batch_size, num_workers=0) test_dataset = MalignantFolder(test_list, test_transform) test_loader = torch.utils.data.DataLoader(dataset=test_dataset, batch_size=test_gvs.batch_size, num_workers=0) return train_gvs, test_gvs, train_loader, test_loader if __name__ == "__main__": main()
[ "noreply@github.com" ]
SealLive.noreply@github.com
3e3b184fda790b57c61441e8c6985db9d1337f2a
9644a76350bee937eb3342f8ff468acbf561742d
/env/Scripts/f2py.py
6d7a1584658e188c6a2aacd2c9a1d80741af5236
[]
no_license
maxyo11/YOOP
1e476d0e211ad9a5581596d3129db52fbbba6364
232ea9a5cf16920b7701c7e841aa8dd4a2435862
refs/heads/master
2021-07-06T23:18:58.745257
2018-05-22T03:23:02
2018-05-22T03:23:02
131,172,002
0
1
null
2020-07-23T02:42:03
2018-04-26T14:59:03
Python
UTF-8
Python
false
false
772
py
#!c:\yoop\env\scripts\python.exe # See http://cens.ioc.ee/projects/f2py2e/ from __future__ import division, print_function import os import sys for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]: try: i = sys.argv.index("--" + mode) del sys.argv[i] break except ValueError: pass os.environ["NO_SCIPY_IMPORT"] = "f2py" if mode == "g3-numpy": sys.stderr.write("G3 f2py support is not implemented, yet.\\n") sys.exit(1) elif mode == "2e-numeric": from f2py2e import main elif mode == "2e-numarray": sys.argv.append("-DNUMARRAY") from f2py2e import main elif mode == "2e-numpy": from numpy.f2py import main else: sys.stderr.write("Unknown mode: " + repr(mode) + "\\n") sys.exit(1) main()
[ "38761335+CarimK@users.noreply.github.com" ]
38761335+CarimK@users.noreply.github.com
223fe59a9f035cb41b6bc268e2d99ed9bfe74511
2919e89b3f1ab0b40ad39b4759725b5bab45d864
/articles/migrations/0002_auto_20181226_0112.py
69a49b98edb7fd0ebc293463942711182d8cdb54
[]
no_license
AbelKinkela/ahmedBlog
89eb0c51d22d8f9aa137c9857eb73c010fb1cc0f
2cd8fd6d89448817f0a295079d68f939afe03805
refs/heads/master
2021-07-17T17:26:14.536228
2020-05-25T18:39:48
2020-05-25T18:39:48
164,930,607
0
0
null
null
null
null
UTF-8
Python
false
false
965
py
# Generated by Django 2.1.2 on 2018-12-25 21:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('articles', '0001_initial'), ] operations = [ migrations.AddField( model_name='article', name='fithSectionTitile', field=models.CharField(blank=True, max_length=100), ), migrations.AddField( model_name='article', name='fourthSectionTitile', field=models.CharField(blank=True, max_length=100), ), migrations.AddField( model_name='article', name='secondSectionTitile', field=models.CharField(blank=True, max_length=100), ), migrations.AddField( model_name='article', name='thirdSectionTitile', field=models.CharField(blank=True, max_length=100), ), ]
[ "akinkela16@alustudent.com" ]
akinkela16@alustudent.com
f7c39da94c4554f4f1ba61961bc25568815ef7ad
88a81e5f8f0b18412e25b34e5b16ba74cc0df59e
/src/test_radix_sort.py
3bd24676c281972679e3cc501c57ad7c01dcbef9
[ "MIT" ]
permissive
thejohnjensen/data-structures
b83feadaef1d0f11a2520d32cf574042d27fb8af
94e1d1cd4ac793e995910812d78fa1b46fd88a4d
refs/heads/master
2021-09-09T09:48:44.526977
2018-03-14T21:34:28
2018-03-14T21:34:28
111,492,248
0
0
MIT
2018-02-27T04:13:27
2017-11-21T03:09:04
Python
UTF-8
Python
false
false
895
py
"""Test mod for radix sort.""" from radix_sort import radix_sort from random import randint import pytest def test_insertion(): """Test with random list.""" unsorted = [randint(0, 1000000) for i in range(1000)] assert radix_sort(unsorted) == sorted(unsorted) def test_radix_sort_worse_case(): """Test with reversed list.""" reverse = [i for i in range(1000)] reverse.reverse() assert radix_sort(reverse) == sorted(reverse) def test_radix_sort_passed_a_string(): """Test that raises error.""" with pytest.raises(TypeError): assert radix_sort('hello') def test_radix_sort_empty_list(): """Test that properly handles an empty list.""" assert radix_sort([]) == [] def test_radix_sort_in_order(): """Test doesn't mess with my list when in order.""" in_order = [i for i in range(1000)] assert radix_sort(in_order) == in_order
[ "johnnyj2439@gmail.com" ]
johnnyj2439@gmail.com
a391d624b84e5e8a7196058cf4ed8c984669f4fc
e802bb0c63a6715665dfadd6750946e338ee66c4
/market/listeners.py
065b0a5788a412a9b9648645836e8e2590c079b9
[ "MIT" ]
permissive
bankonme/OpenBazaar-Server
d0073cf1dcfc07bb1c3b90bbc2cc6c72ef284c87
462e15c41e67c3382b07aa9bd02d6858c37a8473
refs/heads/master
2021-01-17T11:45:35.963453
2015-08-22T00:52:24
2015-08-22T00:52:24
41,285,818
1
2
null
2015-08-24T06:19:24
2015-08-24T06:19:23
Python
UTF-8
Python
false
false
2,637
py
__author__ = 'chris' import json import time from interfaces import MessageListener, NotificationListener from zope.interface import implements from db.datastore import MessageStore, NotificationStore, FollowData from protos.objects import Plaintext_Message, Following class MessageListenerImpl(object): implements(MessageListener) def __init__(self, web_socket_factory): self.ws = web_socket_factory self.db = MessageStore() def notify(self, plaintext, signature): self.db.save_message(plaintext.sender_guid, plaintext.handle, plaintext.signed_pubkey, plaintext.encryption_pubkey, plaintext.subject, Plaintext_Message.Type.Name(plaintext.type), plaintext.message, plaintext.avatar_hash, plaintext.timestamp, signature) # TODO: should probably resolve the handle and make sure it matches the guid so the sender can't spoof it message_json = { "message": { "sender": plaintext.sender_guid.encode("hex"), "subject": plaintext.subject, "message_type": Plaintext_Message.Type.Name(plaintext.type), "message": plaintext.message, "timestamp": plaintext.timestamp, "avatar_hash": plaintext.avatar_hash.encode("hex") } } if plaintext.handle: message_json["message"]["handle"] = plaintext.handle self.ws.push(json.dumps(message_json, indent=4)) class NotificationListenerImpl(object): implements(NotificationListener) def __init__(self, web_socket_factory): self.ws = web_socket_factory def notify(self, guid, message): # pull the metadata for this node from the db f = Following() ser = FollowData().get_following() if ser is not None: f.ParseFromString(ser) for user in f.users: if user.guid == guid: avatar_hash = user.metadata.avatar_hash handle = user.metadata.handle timestamp = int(time.time()) NotificationStore().save_notification(guid, handle, message, timestamp, avatar_hash) notification_json = { "notification": { "guid": guid.encode("hex"), "message": message, "timestamp": timestamp, "avatar_hash": avatar_hash.encode("hex") } } if handle: notification_json["notification"]["handle"] = handle self.ws.push(json.dumps(notification_json, indent=4))
[ "ctpacia@gmail.com" ]
ctpacia@gmail.com
a281db91c2e186f510ec71dd5308d6c22ea95189
ee3f85669ba34b189a15d05a6e0bb18ccfef8f3c
/Kaggle_Project/Crimes_on_friday.py
5fafaa37c3175270126a3092b6ab22c7700225b8
[ "Unlicense" ]
permissive
SatyaChipp/Kaggle
649d93f35a2264dc3d6801dd80240b7d05d0399b
e4f1d444c0493c29d26bfb1f6216a8d755609e5f
refs/heads/master
2020-03-23T23:47:49.781404
2018-07-25T06:25:11
2018-07-25T06:25:11
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,931
py
#!/usr/bin/env python ''' Program for bar plot for the crimes occurring on friday after 7 PM Larceny/Theft have the highest occurance on friday nights ''' import pandas as pd import matplotlib.pyplot as plt try: df = pd.read_csv('C:\\Users\\Jen\\Desktop\\train.csv', parse_dates=['Dates']) except (IOError, OSError) as e: print("check file path and location!") #making new columns by parsing the datetime ... gives hour of the day df['Hour'] = df['Dates'].map(lambda x: x.hour) df['Minutes'] = df['Dates'].map(lambda x: x.minute) colors = ['b', 'r', 'g', 'y', 'k'] def plotting(dfd): try: bar = dfd.plot( kind='barh', fontsize=10, figsize=(10,16), stacked=False, width=1, color=colors ) except Exception as e: print (e, "Recheck bar plot parameters!") else: plt.title("Crimes occuring on Friday after 7PM") bar.figure.savefig("Crimes_on_friday.png") plt.show() def sorting_grping(fre): try: df1 = df[(df['DayOfWeek'] == 'Friday')] #crimes which occured on friday df2 = df1[(df1['Hour'] > 19)] #selecting time after 7PM on fridays df3 = df2[['Category', 'DayOfWeek']] # making a dataframe with just two columns for plotting grp = df3.groupby('Category') #grouping by category to determine the number of each type crime occurred freq = grp.size() freq.sort(ascending=True, inplace=True) #sorting them by size except TypeError as ty: print("Empty dataframe...recheck dataframe!") except Exception as e: print(e, "Check columns!") else: plotting(freq[slice(-1, - fre, -1)]) testing_pandas(freq[slice(-1, - fre, -1)]) def testing_pandas(dff): try: if (dff.empty == False): #checking if dataframe is empty print ("Test passed!") except Exception as e: print(e, "Failed!..Recheck!") if __name__ == "__main__": sorting_grping(fre=0)
[ "noreply@github.com" ]
SatyaChipp.noreply@github.com
9469b92fa6341ff3e1abe6415bd17e8da6597b66
dd5aa34eb734a26539319bf55ad1c385d9483fab
/stack/EqualStacks.py
a31f06dc48da9516d9979127f570903002962d07
[]
no_license
wsapiens/PyCodeChallenge
3e09c7c7946a4b1b78c373dab84cf3390b5b6f84
c74beb2630c34ab603244c91dc923bb86aa0605b
refs/heads/master
2021-01-10T01:55:16.389477
2019-06-13T01:30:20
2019-06-13T01:30:20
45,787,684
0
0
null
null
null
null
UTF-8
Python
false
false
1,346
py
#!/bin/python3 import os import sys # # Complete the equalStacks function below. # def equalStacks(h1, h2, h3): # # Write your code here. # s1 = [] s2 = [] s3 = [] th1 = 0 th2 = 0 th3 = 0 for i in range(len(h1)-1, -1, -1): th1 += h1[i] s1.append(h1[i]) for i in range(len(h2)-1, -1, -1): th2 += h2[i] s2.append(h2[i]) for i in range(len(h3)-1, -1, -1): th3 += h3[i] s3.append(h3[i]) while True: sz1 = len(s1) sz2 = len(s2) sz3 = len(s3) if sz1 == 0 or sz2 == 0 or sz3 == 0: return 0 if th1 == th2 and th2 == th3: return th1 if th1 >= th2 and th1 >= th3: th1 -= s1.pop() elif th2 >= th1 and th2 >= th3: th2 -= s2.pop() elif th3 >= th1 and th3 >= th2: th3 -= s3.pop() if __name__ == '__main__': fptr = open('test.txt', 'w') n1N2N3 = input().split() n1 = int(n1N2N3[0]) n2 = int(n1N2N3[1]) n3 = int(n1N2N3[2]) h1 = list(map(int, input().rstrip().split())) h2 = list(map(int, input().rstrip().split())) h3 = list(map(int, input().rstrip().split())) result = equalStacks(h1, h2, h3) fptr.write(str(result) + '\n') fptr.close() # 5 3 4 # 3 2 1 1 1 # 4 3 2 # 1 1 4 1
[ "wsapiens@hotmail.com" ]
wsapiens@hotmail.com
b0bf37071936a9adc0ab5a9a1a8c1472e43a370c
e1e08ca2df1caadc30b5b62263fa1e769d4904d8
/cba/models/db_wizard_30.py
0494b23f1ef46cd9f768dbcdf1d1d3811a6dc832
[]
no_license
tiench189/ClassbookStore
509cedad5cc4109b8fb126ad59e25b922dfae6be
4fff9bc6119d9ec922861cbecf23a3f676551485
refs/heads/master
2020-12-02T07:48:26.575023
2017-07-10T02:45:09
2017-07-10T02:45:09
96,728,874
0
0
null
null
null
null
UTF-8
Python
false
false
30,196
py
# -*- coding: utf-8 -*- """ Định nghĩa databases cho store 3.0 """ __author__ = 'manhtd' ######################################### db.define_table('clsb30_product_history', Field('product_title', type='string', notnull=True, label=T('Product Title')), Field('product_price', type='integer', default=0, label=T('Product Price')), Field('product_id', type='reference clsb_product', notnull=True, label=T('Product')), Field('category_id', type='reference clsb_category', notnull=True, label=T('Category')), Field('user_id', type='reference clsb_user', notnull=True, label=T('User')), auth.signature, format='%(product_title)s') db.clsb20_dic_creator_cp._singular = 'Product History' db.clsb20_dic_creator_cp._plural = 'Product Histories' ######################################### db.define_table('clsb30_category_classbook_device', Field('product_category', type='reference clsb_category', notnull=True, label=T('Product category')), Field('per_value', type='integer', default=0, label=T('Per for free')), Field('description', type='string', label=T('Description')), auth.signature, format='%(product_category)s') db.clsb20_dic_creator_cp._singular = 'Product Category Free' db.clsb20_dic_creator_cp._plural = 'Product Categories Free' ######################################### db.define_table('clsb30_link_download_app', Field('title', type='string', notnull=True, label=T('Title')), Field('description', type='string', label=T('Description')), Field('code', type='string', label=T('Code')), Field('creator_name', type='string', label=T('Creator name')), Field('link', type='string', label=T('Link')), auth.signature, format='%(title)s') db.clsb30_link_download_app._singular = 'Download app' db.clsb30_link_download_app._plural = 'Download apps' ########################################## db.define_table('clsb30_set_purchase', Field('set_code', type='string', label=T('Set code'), notnull=True), Field('set_name', type='string', label=T('Set name'), notnull=True), Field('description', type='string', label=T('Description')), auth.signature, format='%(set_name)s') db.clsb30_set_purchase._singular = "Set purchase" db.clsb30_set_purchase._plural = "Sets purchase" ############################################ db.define_table('clsb30_set_purchase_product', Field('set_purchase_id', type='reference clsb30_set_purchase', notnull=True, label=T('Set purchase id')), Field('product_id', type='reference clsb_product', notnull=True, label=T('Product id')), auth.signature, format='%(id)s' ) db.clsb30_set_purchase_product._singular = "Set purchase product" db.clsb30_set_purchase_product._plural = "Sets purchase product" db.define_table('clsb30_set_product', Field('set_purchase_id', type='reference clsb30_set_purchase', notnull=True, label=T('Set purchase id')), Field('product_id', type='reference clsb_product', notnull=True, label=T('Product id')), auth.signature, format='%(id)s' ) db.clsb30_set_product._singular = "Set product" db.clsb30_set_product._plural = "Sets product" ################################################### db.define_table('clsb30_media_history', Field('product_title', type='string', notnull=True, label=T('Product Title')), Field('product_price', type='integer', default=0, label=T('Product Price')), Field('product_id', type='reference clsb_product', notnull=True, label=T('Product')), Field('category_id', type='reference clsb_category', notnull=True, label=T('Category')), Field('user_id', type='reference clsb_user', notnull=True, label=T('User')), auth.signature, format='%(product_title)s') db.clsb20_dic_creator_cp._singular = 'Product History' db.clsb20_dic_creator_cp._plural = 'Product Histories' ###################3A-project########################## db.define_table('clsb30_3a_register', Field('device_serial', type='string', notnull=True, label=T('Device Serial')), Field('user_id', type='string', notnull=True, label=T('User')), Field('insert_time', type='datetime', notnull=True, label=T('Time')), Field('desctiption', type='string', default="", label=T('Description')), auth.signature) ###################3A-project########################## ################## apns ############################### db.define_table('clsb30_apns', Field('user_email', type='string', notnull=True, label=T('User Email')), Field('apns_token', type='string', notnull=True, label=T('APNS Token')), Field('date_created', type='datetime', notnull=True, label=T('Date Created')), Field('date_modify', type='datetime', notnull=True, label=T('Date Modify')), Field('description', type='string', default="", label=T('Description')), auth.signature) ################## apsn ############################### db.define_table('clsb30_ios_identifier', Field('user_id', type='reference clsb_user', notnull=True, label=T('User')), Field('unique_id', type='string', notnull=True, label=T('Account')), Field('ios_id', type='string', notnull=True, label=T('iOS Identifier')), Field('requested_time', type='integer', notnull=False, label=T('Request times')), Field('date_created', type='datetime', notnull=True, label=T('Date Created')), Field('des', type='string', notnull=False, label=T('Description')), auth.signature) ####################direct download########################## db.define_table('clsb30_direct', Field('product_code', type='string', notnull=True, label=T('Code')), Field('download_time', type='datetime', notnull=True, label=T('Download Time')), Field('des', type='string', notnull=False, label=T('Description')), auth.signature) ############### Dinh nghia du lieu mo rong #################### db.define_table('clsb30_data_extend', Field('name', type='string', notnull=True, label=T('Name')), Field('data_type', type='string', notnull=False, label=T('Type')), Field('description', type='string', notnull=False, label=T('Description')), auth.signature) db.define_table('clsb30_product_extend', Field('product_id', type='reference clsb_product', notnull=True, label=T('Product')), Field('extend_id', type='reference clsb30_data_extend', notnull=True, label=T('Extend')), Field('price', type='integer', default=0, label=T('Data Price')), Field('description', type='string', notnull=False, label=T('Description')), auth.signature) db.define_table('clsb30_fake_ios', Field('fake_name', type='string', label=T('Name')), Field('fake_value', type='integer', label=T('value'))) ####################SYNC################################## db.define_table('clsb30_sync_log', Field('record_id', type='string', label=T('Record ID')), Field('table_name', type='string', label=T('Table Name')), Field('data_source', type='string', label=T('Source')), Field('status', type='string', label=T('Status')), Field('key_unique', type='string', label=T('Unique Key')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_sync_log._singular = 'Log Sync' db.clsb30_sync_log._plural = 'Logs Sync' db.define_table('clsb30_sync_temp', Field('record_id', type='string', label=T('Record ID')), Field('table_name', type='string', label=T('Table Name')), Field('status', type='string', label=T('Status')), Field('key_unique', type='string', label=T('Unique Key')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_sync_temp._singular = 'Temp Sync' db.clsb30_sync_temp._plural = 'Temp Sync' ################GIFT CODE LOG ############################### db.define_table('clsb30_gift_code_log', Field('user_id', type='reference clsb_user', notnull=True, label=T('User')), Field('gift_code', type='string', notnull=True, label=T('Gift Code')), Field('code_suffix', type='string', label=T('Suffix')), Field('code_value', type='integer', label=T('Code Value')), Field('project_code', type='string', notnull=True, default="01", label=T('Project Code')), Field('created_on', type='datetime', notnull=False, label=T('Created On')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_gift_code_log._singular = 'Gift Code' db.clsb30_gift_code_log._plural = 'Gift Code' ###############New pay log############################## db.define_table('clsb30_payment_log', Field('user_id', type='reference clsb_user', notnull=True, label=T('User')), Field('product_id', type='reference clsb_product', notnull=True, label=T('Product')), Field('product_type', type='string', label=T('Type')), Field('pay', type='integer', notnull=True, default=0, label=T('Pay')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_payment_log._singular = 'Payment Log' db.clsb30_payment_log._plural = 'Payment Log' ###############khuyen mai######################### db.define_table('clsb30_samsung_promotion', Field('device_serial', type='string', notnull=True, label=T('Device Serial')), Field('description', type='string', label=T('Description')), Field('user_id', type='reference clsb_user', notnull=True, label=T('User')), auth.signature) db.clsb30_samsung_promotion._singular = 'Promotion Log' db.clsb30_samsung_promotion._plural = 'Promotion Log' ################ Log register device ##################### db.define_table('clsb30_device_log', Field('user_id', type='reference clsb_user', notnull=True, label=T('User')), Field('device_serial', type='string', notnull=True, label=T('Device Serial')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_device_log._singular = 'Device Log' db.clsb30_device_log._plural = 'Device Log' ################ interactive ############################### db.define_table('clsb30_interactive', Field('interactive_title', type='string', notnull=True, label=T('Title')), Field('interactive_code', type='string', notnull=True, label=T('Code')), Field('interactive_data', type='text', notnull=True, label=T('Data')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_interactive._singular = 'Interactive' db.clsb30_interactive._plural = 'Interactive' ################GIFT CODE LOG ############################### db.define_table('clsb30_gift_code_test', Field('user_id', type='reference clsb_user', notnull=True, label=T('User')), Field('gift_code', type='string', notnull=True, label=T('Gift Code')), Field('project_code', type='string', notnull=True, default="01", label=T('Project Code')), Field('created_on', type='datetime', notnull=False, label=T('Created On')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_gift_code_test._singular = 'Gift Code' db.clsb30_gift_code_test._plural = 'Gift Code' ##############LOG UPLOAD######################### db.define_table('clsb30_log_upload', Field('product_code', type='string', notnull=True, label=T('Product Code')), Field('product_category', type='string', notnull=True, label=T('Product Category')), Field('upload_status', type='string', notnull=True, default="FAIL", label=T('Status')), Field('created_on', type='datetime', notnull=False, label=T('Created On')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_log_upload._singular = 'Log Upload' db.clsb30_log_upload._plural = 'Log Upload' #############Hen gio push gcm################# db.define_table('clsb30_gcm_timer', Field('group_type', type='string', notnull=True, requires=IS_IN_SET(['ANDROID_APP', 'CB_DEVICE']), label=T('Group Type')), Field('gcm_timer', type='datetime', notnull=True, label=T('Timer')), Field('gcm_message', type='text', notnull=True, label=T('Message')), Field('gcm_link', type='string', label=T('Link')), auth.signature) db.clsb30_gcm_timer._singular = 'clsb30_gcm_timer' db.clsb30_gcm_timer._plural = 'clsb30_gcm_timer' #############Update solr################# db.define_table('clsb30_update_product_log', Field('record_id', type='integer', notnull=True, label=T('Record ID')), Field('table_name', type='string', notnull=True, label=T('Table')), Field('update_action', type='string', notnull=True, label=T('Action')), Field('update_status', type='string', notnull=True, default="FAIL", label=T('Status')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_gcm_timer._singular = 'Log Update Product' db.clsb30_gcm_timer._plural = 'Log Update Product' #############Dang ki email################# db.define_table('clsb30_support_email', Field('email', type='string', notnull=True, label=T('Email')), Field("from_site", type='string', label=T('Site')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_support_email._singular = 'Support Email' db.clsb30_support_email._plural = 'Support Email' #############Back up price################# db.define_table('clsb30_backup_price', Field('product_id', type='integer', notnull=True, label=T('Product id')), Field('product_price', type='integer', notnull=True, label=T('Product Price')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_backup_price._singular = 'clsb30_backup_price' db.clsb30_backup_price._plural = 'clsb30_backup_price' ##############mua bo sach######################### db.define_table('clsb30_set_of_product', Field('set_name', type='string', notnull=True, label=T('Name')), Field('set_code', type='string', unique=True, notnull=True, label=T('Code')), Field('set_status', type='string', notnull=True, default='show', requires=IS_IN_SET(['show', 'hide']), label=T('Code')), Field('description', type='string', label=T('Description')), auth.signature, format='%(set_name)s') db.clsb30_set_of_product._singular = 'clsb30_set_of_product' db.clsb30_set_of_product._plural = 'clsb30_set_of_product' ##############mua bo sach######################### db.define_table('clsb30_product_in_set', Field('product_id', type='integer', notnull=True, label=T('Product')), Field('set_id', type='reference clsb30_set_of_product', notnull=True, label=T('set')), Field('description', type='string', label=T('Description')), auth.signature) db.clsb30_product_in_set._singular = 'clsb30_product_in_set' db.clsb30_product_in_set._plural = 'clsb30_product_in_set' ##############Log Preview######################### db.define_table('clsb30_preview_log', Field('product_id', type='reference clsb_product', notnull=True, label=T('Product')), Field('client_type', type='string', notnull=True, default="ANDROID", label=T('Client Type')), Field('created_on', type='datetime', notnull=False, label=T('Created On')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_preview_log._singular = 'clsb30_preview_log' db.clsb30_preview_log._plural = 'clsb30_preview_log' ###################Event khuyen mai################### db.define_table('clsb30_event_promotion', Field('product_id', type='integer', notnull=True, label=T('Product')), Field('user_id', type='integer', notnull=True, label=T('User')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_event_promotion._singular = 'eventpromotion' db.clsb30_event_promotion._plural = 'event promotion' db.define_table('clsb30_user_get_promotion', Field('product_id', type='integer', notnull=True, label=T('Product')), Field('user_id', type='integer', notnull=True, label=T('User')), Field('time_get', type='datetime', notnull=True, label=T('Time')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_user_get_promotion._singular = 'clsb30_user_get_promotion' db.clsb30_user_get_promotion._plural = 'clsb30_user_get_promotion' db.define_table('clsb30_third_party_log', Field('username', type='string', notnull=True, label=T('User')), Field('time_set', type='datetime', notnull=True, label=T('Time')), Field('party_code', type='string', label=T('Code')), Field('party_name', type='string', label=T('Name')), Field('party_type', type='string', label=T('Type')), Field('price', type='integer', label=T('Price')), Field('from_system', type='string', label=T('System')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_third_party_log._singular = 'clsb30_third_party_log' db.clsb30_third_party_log._plural = 'clsb30_third_party_log' db.define_table('clsb30_elearning_transaction', Field('user_id', type='integer', notnull=True, label=T('User')), Field('package_code', type='string', label=T('Package')), Field('purchase_type', type='string', label=T('Purchase Type')), Field('email_receiver', type='string', label=T('Email Receiver')), Field('pack_type', type='string', label=T('Package Type')), Field('transaction_id', type='integer', label=T('Transaction')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_elearning_transaction._singular = 'clsb30_elearning_transaction' db.clsb30_elearning_transaction._plural = 'clsb30_elearning_transaction' ## Bo de thi# db.define_table('clsb30_chuyen_de', Field('cate_code', type='string', label=T('Code')), Field('cate_title', type='string', notnull=True, label=T('Title')), Field('cate_parent', type='reference clsb30_chuyen_de', label=T('Parent')), Field('show_status', type='integer', notnull=True, default=1, label=T('Show Status')), Field('description', type='text', label=T('Description')), auth.signature, format='%(cate_title)s') db.clsb30_chuyen_de._singular = 'clsb30_chuyen_de' db.clsb30_chuyen_de._plural = 'clsb30_chuyen_de' db.define_table('clsb30_bt_chuyen_de', Field('exer_code', type='string', notnull=True, unique=True, label=T('Code')), Field('exer_title', type='string', notnull=True, label=T('Title')), Field('chuyen_de', type='reference clsb30_chuyen_de', notnull=True, label=T('Chuyen de')), Field('show_status', type='integer', notnull=True, default=1, label=T('Show Status')), Field('description', type='text', label=T('Description')), auth.signature, format='%(exer_title)s') db.clsb30_bt_chuyen_de._singular = 'clsb30_bt_chuyen_de' db.clsb30_bt_chuyen_de._plural = 'clsb30_bt_chuyen_de' ################# db.define_table('clsb30_tqg_log_tranfer', Field('user_id', type='reference clsb_user', notnull=True, label=T('User')), Field('fund', type='integer', notnull=True, label=T('Fund')), Field('status', type='string', notnull=True, label=T('Status')), Field('created_on', type='string', notnull=True, label=T('Created On')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_tqg_log_tranfer._singular = 'clsb30_tqg_log_tranfer' db.clsb30_tqg_log_tranfer._plural = 'clsb30_tqg_log_tranfer' ############## Define thi quoc gia card ############################ db.define_table('clsb30_tqg_card', Field('hash_code', type='string', notnull=True, unique=True, label=T('Hash Code')), Field('card_serial', type='string', notnull=True, label=T('Card Serial')), Field('card_value', type='string', notnull=True, label=T('Card value')), Field('serial_activate', type='integer', notnull=True, default=0, label=T('Serial Activate')), Field('time_valid', type='datetime', notnull=False, label=T('Time valid')), Field('actived_by', type='reference auth_user', notnull=False, label=T('Actived By')), Field('actived_on', type='datetime', notnull=False, label=T('Activated On')), Field('card_gift', type='integer', notnull=True, default=0, label=T('Gift')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_tqg_log_tranfer._singular = 'clsb30_tqg_card' db.clsb30_tqg_log_tranfer._plural = 'clsb30_tqg_card' db.define_table('clsb30_tqg_card_log', Field('user_id', type='integer', notnull=True, label=T('User')), Field('card_serial', type='string', notnull=True, label=T('Card Serial')), Field('card_pin', type='string', notnull=True, label=T('Card Pin')), Field('card_value', type='integer', notnull=True, label=T('Card Value')), Field('created_on', type='string', notnull=True, label=T('Created On')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_tqg_card_log._singular = 'clsb30_tqg_card_log' db.clsb30_tqg_card_log._plural = 'clsb30_tqg_card_log' ############tvt promotion code##################### db.define_table('clsb30_tvt_promotion_code', Field('user_id', type='integer', label=T('User')), Field('promotion_code', type='string', notnull=True, label=T('Card Serial')), Field('action_type', type='string', label=T('Action Type')), Field('before_discount', type='integer', label=T('Before')), Field('after_discount', type='integer', label=T('After')), Field('time_used', type='datetime', label=T('Time Used')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_tvt_promotion_code._singular = 'clsb30_tvt_promotion_code' db.clsb30_tvt_promotion_code._plural = 'clsb30_tvt_promotion_code' db.define_table('clsb30_tvt_log', Field('user_id', type='integer', label=T('User')), Field('discount_code', type='string', notnull=True, label=T('Promotion Code')), Field('action_type', type='string', label=T('Action Type')), Field('before_discount', type='integer', label=T('Before')), Field('after_discount', type='integer', label=T('After')), Field('time_used', type='datetime', label=T('Time Used')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_tvt_log._singular = 'clsb30_tvt_log' db.clsb30_tvt_log._plural = 'clsb30_tvt_log' db.define_table('clsb30_tvt_code', Field('promotion_code', type='string', notnull=True, label=T('Code')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_tvt_code._singular = 'clsb30_tvt_code' db.clsb30_tvt_code._plural = 'clsb30_tvt_code' ################################################### ####################Thi thu################## db.define_table('clsb30_ki_thi_thu', Field('exam_name', type='string', notnull=True, label=T('Name')), Field('exam_index', type='integer', notnull=True, label=T('Index')), Field('start_date', type='datetime', notnull=True, label=T('Start')), Field('end_date', type='datetime', notnull=True, label=T('End')), Field('exam_time', type='integer', notnull=True, default=90, label=T('Time')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_ki_thi_thu._singular = 'clsb30_ki_thi_thu' db.clsb30_ki_thi_thu._plural = 'clsb30_ki_thi_thu' ################Banner home page######################### db.define_table('clsb30_banner', Field('banner_title', type='string', label=T('Title')), Field('banner_url', type='string', notnull=True, label=T('URL')), Field('active_status', type='integer', notnull=True, default=1, label=T('Status')), Field('action_type', type='string', notnull=True, label=T('Action Type')), Field('action_data', type='string', label=T('Action Data')), Field('banner_order', type='integer', notnull=True, default=0, label=T('Order')), Field('banner_site', type='string', label=T('Site')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_banner._singular = 'clsb30_banner' db.clsb30_banner._plural = 'clsb30_banner' ##################Dinh nghia bo sach de tai################################# db.define_table('clsb30_bo_sach', Field('bs_name', type='string', notnull=True, label=T('Name')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_bo_sach._singular = 'clsb30_bo_sach' db.clsb30_bo_sach._plural = 'clsb30_bo_sach' db.define_table('clsb30_sach_trong_bo', Field('bs_id', type='reference clsb30_bo_sach', notnull=True, label=T('Bo sach')), Field('product_id', type='integer', notnull=True, label=T('Sach')), Field('description', type='text', label=T('Description')), auth.signature) db.clsb30_sach_trong_bo._singular = 'clsb30_sach_trong_bo' db.clsb30_sach_trong_bo._plural = 'clsb30_sach_trong_bo' ''' DB phuv vu du an ban the mua cac goi lop cap 1 ''' db.define_table('cbcode_collection', Field('collection_name', type='string', notnull=True, label=T('Name')), Field('description', type='text', label=T('Description')), auth.signature) db.cbcode_collection._singular = 'cbcode_collection' db.cbcode_collection._plural = 'cbcode_collection' db.define_table('cbcode_product_collection', Field('collection_id', type='reference cbcode_collection', notnull=True, label=T('Collection')), Field('product_id', type='integer', notnull=True, label=T('Product')), Field('description', type='text', label=T('Description')), auth.signature) db.cbcode_product_collection._singular = 'cbcode_product_collection' db.cbcode_product_collection._plural = 'cbcode_product_collection' db.define_table('cbcode_log', Field('user_id', type='integer', notnull=True, label=T('User')), Field('collection_id', type='integer', notnull=True, label=T('Collection')), Field('pin_code', type='string', label=T('Code')), Field('serial', type='string', label=T('Serial')), Field('code_value', type='integer', label=T('Value')), Field('project', type='string', label=T('Value')), Field('created_on', type='datetime', notnull=False, label=T('Created On')), Field('description', type='text', label=T('Description')), auth.signature) db.cbcode_log._singular = 'cbcode_log' db.cbcode_log._plural = 'cbcode_log' ##Vstep atempts db.define_table('vstep_attempts', Field('id', type='integer', notnull=True, label=T('ID')), Field('user_id', type='integer', notnull=True, label=T('User')), Field('subject', type='string', label=T('Subject')), Field('grade', type='double', label=T('Grade')), Field('timestart', type='integer', label=T('Time Start')), Field('timefinish', type='integer', label=T('Time Finish')), Field('duration', type='integer', label=T('Duration')), Field('exam_id', type='integer', label=T('Exam')), Field('vstep_format', type='string', label=T('Format'))) db.vstep_attempts._singular = 'vstep_attempts' db.vstep_attempts._plural = 'vstep_attempts'
[ "caotien189@gmail.com" ]
caotien189@gmail.com
3c39b60b248281ff45d4d0f90c7cd1fdb5d4f4d2
c9bc27f70a4bca5ce6acf346bfc25b5407502d00
/ATIVIDADE G - FÁBIO 2b - CONDICIONAIS/fabio2b_q05.py
986a3386bed0356330b24f60799aab2cbf26c521
[]
no_license
lucascoelho33/ifpi-ads-algoritmos2020
2197bbc84ce9c027b3f1da006728448a846d7ffb
1ce20a489adbfe7321817acd98d35f2efc0360ca
refs/heads/master
2021-03-01T23:03:10.293013
2020-10-17T14:35:19
2020-10-17T14:35:19
245,650,273
0
0
null
null
null
null
UTF-8
Python
false
false
452
py
#5. Leia o preço de três produtos e informe qual produto deve ser comprado, sabendo que a decisão é sempre pelo mais barato. def main(): p1 = float(input()) p2 = float(input()) p3 = float(input()) if p1 < p2 and p1 < p3: print('O primeiro produto é o mais barato') elif p2 < p1 and p2 < p3: print('O segundo produto é o mais barato') else: print('O terceiro produto é o mais barato') main()
[ "llucascoelho33@gmail.com" ]
llucascoelho33@gmail.com
c6ccf5fcc4798e7c370ac339fd224954e2d13a9b
3e2cc503f713ffdd6cbb24d47e21323221f80a64
/test/test_av.py
cd1f6e58b3f518946094f4df264bde51987f5635
[ "MIT" ]
permissive
cosmin/siti
05a6105cb4df932ad47190437f4dd30eed1aee47
0b93fdf0ba0dad02764e1889963b9e61ef638878
refs/heads/master
2022-12-28T12:36:50.919298
2020-10-17T13:13:55
2020-10-17T13:13:55
null
0
0
null
null
null
null
UTF-8
Python
false
false
592
py
#!/usr/bin/env python3 import numpy as np import av import sys import skvideo.io input_file = sys.argv[1] container = av.open(input_file) for packet in container.demux(): for frame in packet.decode(): if isinstance(frame, av.video.frame.VideoFrame): frame_data_raw = np.frombuffer(frame.planes[0], np.uint8) print(np.mean(frame_data_raw)) for frame in skvideo.io.vreader(sys.argv[1], as_grey=True): width = frame.shape[-2] height = frame.shape[-3] frame_data_raw = frame.reshape((height, width)) print(np.mean(frame_data_raw)) break
[ "werner.robitza@gmail.com" ]
werner.robitza@gmail.com
b32210a47d8437c66aec6b911d96a76f2395c4b1
1446ba991034652370c9d64df08caa817735e1f6
/office365/graph/one_drive_actions.py
a7a9df006ac576aed602e26d3c2f69199385e31a
[ "MIT" ]
permissive
kakaruna/Office365-REST-Python-Client
3ab949bc8d48a604e534c902883af62fd089a87d
9f2f564972b988f1f41a3080c99684b4f6ce2164
refs/heads/master
2022-09-26T15:32:40.326036
2020-06-02T13:24:04
2020-06-02T13:24:04
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,234
py
from office365.graph.onedrive.driveItem import DriveItem from office365.runtime.client_result import ClientResult from office365.graph.resource_path_url import ResourcePathUrl from office365.runtime.serviceOperationQuery import ServiceOperationQuery class DownloadContentQuery(ServiceOperationQuery): def __init__(self, entity_type, format_name=None): result = ClientResult(None) action_name = "content" if format_name is not None: action_name = action_name + r"?format={0}".format(format_name) super(DownloadContentQuery, self).__init__(entity_type, action_name, None, None, None, result) class ReplaceMethodQuery(ServiceOperationQuery): pass class UploadContentQuery(ServiceOperationQuery): def __init__(self, parent_entity, name, content): return_type = DriveItem(parent_entity.context, ResourcePathUrl(name, parent_entity.resource_path)) super(UploadContentQuery, self).__init__(return_type, "content", None, content, None, return_type) class SearchQuery(ServiceOperationQuery): def __init__(self, entity_type, query_text, return_type): super(SearchQuery, self).__init__(entity_type, "search", {"q": query_text}, None, None, return_type)
[ "Ajilon80!" ]
Ajilon80!
cc57e8637846f5c1bded34264f35dce145782036
e5afbbd2b8d6c05ade1ca62114f20e1d1415924c
/cryptocurrency/user/migrations/0005_auto_20210305_0052.py
c0a4dcf0a8913a5c0c332f04abd258087654de38
[]
no_license
Quuuops/CryptBtc3
dcd6f83981fe3a8958c12da40ecdcd92ca2867c9
51c26f54eb8745e0751251be171cc5622d4098f1
refs/heads/master
2023-03-27T04:25:55.590362
2021-03-18T16:46:21
2021-03-18T16:46:21
349,109,488
1
0
null
null
null
null
UTF-8
Python
false
false
990
py
# Generated by Django 3.1.7 on 2021-03-05 00:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user', '0004_auto_20210305_0050'), ] operations = [ migrations.RemoveField( model_name='profile', name='bio', ), migrations.RemoveField( model_name='profile', name='birth_date', ), migrations.RemoveField( model_name='profile', name='location', ), migrations.AddField( model_name='profile', name='avatar', field=models.ImageField(default=1, upload_to='image/users', verbose_name='Изображение'), preserve_default=False, ), migrations.AddField( model_name='profile', name='user_balance', field=models.FloatField(blank=True, default=0, verbose_name='Баланс'), ), ]
[ "artur7borisovskiy@gmail.com" ]
artur7borisovskiy@gmail.com
2b26374d479945853d623e1cb319db8080a8e511
990e7c8f8132af3ff23bba649d35baf3fab6e7ed
/game/flappy_bird_utils.py
653179228d6b0c5a2c81fa391d039bc6c6f95bd4
[]
no_license
LeslieHoloway/RL_FlappyBird
53e0447e4b20b7179842c292398fd27c54789d03
66fac22b735507550d6630dd3772b5598f7c99c2
refs/heads/master
2022-11-16T16:46:18.638827
2020-06-28T06:50:59
2020-06-28T06:50:59
274,094,380
0
0
null
null
null
null
UTF-8
Python
false
false
3,037
py
import pygame import sys def load(): # path of player with different states PLAYER_PATH = ( 'assets/sprites/redbird-upflap.png', 'assets/sprites/redbird-midflap.png', 'assets/sprites/redbird-downflap.png' ) # path of background # BACKGROUND_PATH = 'assets/sprites/background-night.png' BACKGROUND_PATH = 'assets/sprites/background-black.png' # path of pipe PIPE_PATH = 'assets/sprites/pipe-green.png' IMAGES, SOUNDS, HITMASKS = {}, {}, {} # numbers sprites for score display IMAGES['numbers'] = ( pygame.image.load('assets/sprites/0.png').convert_alpha(), pygame.image.load('assets/sprites/1.png').convert_alpha(), pygame.image.load('assets/sprites/2.png').convert_alpha(), pygame.image.load('assets/sprites/3.png').convert_alpha(), pygame.image.load('assets/sprites/4.png').convert_alpha(), pygame.image.load('assets/sprites/5.png').convert_alpha(), pygame.image.load('assets/sprites/6.png').convert_alpha(), pygame.image.load('assets/sprites/7.png').convert_alpha(), pygame.image.load('assets/sprites/8.png').convert_alpha(), pygame.image.load('assets/sprites/9.png').convert_alpha() ) # base (ground) sprite IMAGES['base'] = pygame.image.load('assets/sprites/base.png').convert_alpha() # sounds if 'win' in sys.platform: soundExt = '.wav' else: soundExt = '.ogg' SOUNDS['die'] = pygame.mixer.Sound('assets/audio/die' + soundExt) SOUNDS['hit'] = pygame.mixer.Sound('assets/audio/hit' + soundExt) SOUNDS['point'] = pygame.mixer.Sound('assets/audio/point' + soundExt) SOUNDS['swoosh'] = pygame.mixer.Sound('assets/audio/swoosh' + soundExt) SOUNDS['wing'] = pygame.mixer.Sound('assets/audio/wing' + soundExt) # select random background sprites IMAGES['background'] = pygame.image.load(BACKGROUND_PATH).convert() # select random player sprites IMAGES['player'] = ( pygame.image.load(PLAYER_PATH[0]).convert_alpha(), pygame.image.load(PLAYER_PATH[1]).convert_alpha(), pygame.image.load(PLAYER_PATH[2]).convert_alpha(), ) # select random pipe sprites IMAGES['pipe'] = ( pygame.transform.rotate( pygame.image.load(PIPE_PATH).convert_alpha(), 180), pygame.image.load(PIPE_PATH).convert_alpha(), ) # hismask for pipes HITMASKS['pipe'] = ( getHitmask(IMAGES['pipe'][0]), getHitmask(IMAGES['pipe'][1]), ) # hitmask for player HITMASKS['player'] = ( getHitmask(IMAGES['player'][0]), getHitmask(IMAGES['player'][1]), getHitmask(IMAGES['player'][2]), ) return IMAGES, SOUNDS, HITMASKS def getHitmask(image): """returns a hitmask using an image's alpha.""" mask = [] for x in range(image.get_width()): mask.append([]) for y in range(image.get_height()): mask[x].append(bool(image.get_at((x,y))[3])) return mask
[ "894018067@qq.com" ]
894018067@qq.com
7ad286cb647d8bb131896f8e84f1434b9fbd7613
fcc66636d1b2032d7b4978595148b2c98ccd9b07
/Javascript/Plotly/app.py
73067f6241d426d5c8a065744706053dca15c308
[]
no_license
Eric-Pacheco95/BootCampProjects
e2c76ee5fde91c1dcd7ed6b6ea04a521bf7d952f
a96503b664f769158c1678124199e9239d2bdfbd
refs/heads/master
2022-12-14T02:26:49.407484
2020-09-14T03:47:15
2020-09-14T03:47:15
295,289,623
0
0
null
null
null
null
UTF-8
Python
false
false
1,843
py
from flask import Flask, render_template, url_for, jsonify import json import pandas as pd #Load samples.json file into variable 'data' with open('data/samples.json') as f: data = json.load(f) #Create dataframes for metadata & samples which can easily filtered through with .loc Metadata = pd.DataFrame(data['metadata']) Samples = pd.DataFrame(data['samples']) #Create dictionary which contains the list of names/ids under the key 'names' Names = {'names':data['names']} app = Flask(__name__) @app.route('/') def home(): return render_template('index.html') #Returns dictionary of metadata for specific sample id which can be called in app.js using d3.json @app.route('/metadata/<sample>') def metadata(sample): sample_metadata = Metadata.loc[Metadata['id'] == int(sample),:] return sample_metadata.to_dict('records')[0] #Returns dictionary of sample data for specific sample id which can be called in app.js using d3.json @app.route('/samples/<sample>') def sample(sample): #Filter Samples dataframe to find row containing corresponding sample id specified in the url endpoint sample_data = Samples.loc[Samples['id'] == sample,:] #Create new dataframe which has each otu_id,otu_label, and sample_value indexed sample_otu_data = pd.DataFrame(data={'otu_ids':sample_data['otu_ids'].values, 'otu_labels':sample_data['otu_labels'].values,'sample_values':sample_data['sample_values'].values}) #Return sorted dict based on sample_values sorted_otu_data = sample_otu_data.sort_values('sample_values',ascending=False) return sorted_otu_data.to_dict('records')[0] #Returns dictionary which contains list of names under key 'names' which can be called in app.js using d3.json @app.route('/names') def names(): return Names if __name__ == '__main__': app.run(debug=True)
[ "eric.pacheco@mail.utoronto.ca" ]
eric.pacheco@mail.utoronto.ca
83d41da79e82c1992c1e3a6b6b82a11294284546
a984dd21746880890da72c39cd4163dc4f7b97f3
/tools/book_test.py
6efe84e2e3bdd4bef2de30ff124e6e0735936611
[ "Python-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
stan-xrex/cryptofeed
c28c3970e09ddf5f2a252553b2367a6124863951
6ce30a7640f8078ffa0f355e6875b3d12b98c488
refs/heads/master
2020-07-05T16:18:03.531433
2019-10-09T06:54:25
2019-10-09T06:54:25
202,696,966
0
1
NOASSERTION
2019-08-16T09:13:09
2019-08-16T09:13:09
null
UTF-8
Python
false
false
1,304
py
''' Copyright (C) 2017-2019 Bryant Moscon - bmoscon@gmail.com Please see the LICENSE file for the terms and conditions associated with this software. ''' import time from cryptofeed.callback import BookCallback from cryptofeed import FeedHandler from cryptofeed.exchanges import Bitmex from cryptofeed.defines import L2_BOOK, BID, ASK counter = 0 avg = 0 START = time.time() STATS = 1000 async def book(feed, pair, book, timestamp): global counter global avg t = time.time() counter += 1 bids = list(book[BID].keys()) asks = list(book[ASK].keys()) avg += (t - timestamp) try: assert (t - timestamp) < 2 assert bids[-1] < asks[0] except: print("FAILED") print("BID", bids[-1]) print("ASKS", asks[0]) print("DELTA", t - timestamp) print*("COUNTER", counter) if counter % STATS == 0: print("Checked", counter, "updates") print("Runtime", t - START) print("Current spread", asks[0] - bids[-1]) print("Average book update handle time", avg / counter) print("\n") def main(): f = FeedHandler() f.add_feed(Bitmex(pairs=['XBTUSD'], channels=[L2_BOOK], callbacks={L2_BOOK: BookCallback(book)})) f.run() if __name__ == '__main__': main()
[ "bmoscon@gmail.com" ]
bmoscon@gmail.com
28e44bb620ec87fdb7022b6ac69466fe944a1eb3
fad23cd35e5b2d353916ac65981b50fbcad3c0d6
/arguebuf/load/_load_microtexts.py
acc90b14016a17b9243253e36646dde43720cc91
[ "MIT" ]
permissive
recap-utr/arguebuf-python
95e699a6f32894d2f8939e154a135845d38e5823
a7e27c188e58694b0d4bf42b7d64f19e4630af01
refs/heads/main
2023-09-04T06:08:03.668923
2023-07-18T06:20:22
2023-07-18T06:20:22
224,925,689
4
7
MIT
2023-09-12T09:09:15
2019-11-29T21:42:14
Python
UTF-8
Python
false
false
4,208
py
import typing as t from dataclasses import dataclass from lxml import etree from arguebuf.model import Graph, utils from arguebuf.model.node import Attack, Support from arguebuf.schemas.microtexts import EdgeType from ._config import Config, DefaultConfig __all__ = ("load_microtexts",) @dataclass class _Edge: source: str target: str type: EdgeType def transform_edges(elems: t.Iterable[t.Any]) -> dict[str, _Edge]: return { str(elem.attrib["id"]): _Edge( str(elem.attrib["src"]), str(elem.attrib["trg"]), EdgeType(str(elem.attrib["type"])), ) for elem in elems if isinstance(elem, etree._Element) } def load_microtexts( obj: t.IO, name: t.Optional[str] = None, config: Config = DefaultConfig ) -> Graph: """ Generate Graph structure from AML argument graph file ElementTree XML API: https://docs.python.org/3/library/xml.etree.elementtree.html# """ tree = etree.parse(obj) root = tree.getroot() id = root.get("id") g = config.GraphClass(name or id) g.userdata = {"stance": root.get("stance"), "topic": root.get("topic_id")} segmentation_edge_tags = root.xpath("//edge[@type='seg']") atom_edge_tags = root.xpath("//edge[@type='sup' or @type='exa' or @type='reb']") scheme_edge_tags = root.xpath("//edge[@type='add']") edge_edge_tags = root.xpath("//edge[@type='und']") edu_tags = root.xpath("//edu") joint_tags = root.xpath("//joint") adu_tags = root.xpath("//adu") assert ( isinstance(edu_tags, list) and isinstance(joint_tags, list) and isinstance(adu_tags, list) and isinstance(segmentation_edge_tags, list) and isinstance(atom_edge_tags, list) and isinstance(edge_edge_tags, list) and isinstance(scheme_edge_tags, list) ) source_tags = { str(elem.attrib["id"]): elem for elem in [*edu_tags, *joint_tags] if isinstance(elem, etree._Element) } adu2source = { edge.target: edge.source for edge in transform_edges(segmentation_edge_tags).values() } atom_edges = transform_edges(atom_edge_tags) scheme_edges = transform_edges(scheme_edge_tags) edge_edges = transform_edges(edge_edge_tags) for adu in adu_tags: if isinstance(adu, etree._Element) and (adu_id := adu.get("id")): adu_source_id = adu2source[adu_id] adu_source = source_tags[adu_source_id] if adu_source.text is not None: atom = config.AtomNodeClass( utils.parse(adu_source.text, config.nlp), id=adu_id ) if type := adu.get("type"): atom.userdata["type"] = type g.add_node(atom) if adu_source.get("implicit"): g.major_claim = atom for edge_id, edge in atom_edges.items(): scheme_node = config.SchemeNodeClass(id=edge_id) if edge.type == EdgeType.SUPPORT_DEFAULT: scheme_node.scheme = Support.DEFAULT elif edge.type == EdgeType.SUPPORT_EXAMPLE: scheme_node.scheme = Support.EXAMPLE elif edge.type == EdgeType.ATTACK_ATOM: scheme_node.scheme = Attack.DEFAULT if (source_atom := g.atom_nodes.get(edge.source)) and ( target_atom := g.atom_nodes.get(edge.target) ): g.add_edge(config.EdgeClass(source_atom, scheme_node)) g.add_edge(config.EdgeClass(scheme_node, target_atom)) for edge_id, edge in edge_edges.items(): if (target_scheme := g.scheme_nodes.get(edge.target)) and ( atom_node := g.atom_nodes.get(edge.source) ): source_scheme = config.SchemeNodeClass(id=edge_id, scheme=Attack.DEFAULT) g.add_edge(config.EdgeClass(atom_node, source_scheme)) g.add_edge(config.EdgeClass(source_scheme, target_scheme)) for edge in scheme_edges.values(): if (scheme_node := g.scheme_nodes.get(edge.target)) and ( atom_node := g.atom_nodes.get(edge.source) ): g.add_edge(config.EdgeClass(atom_node, scheme_node)) return g
[ "mirko@mirkolenz.com" ]
mirko@mirkolenz.com
42efa7b5c841e6dd1b95847db303f55bd4e5e1a7
293a28855e66358a454e2d8d38d84394a3cf0ede
/Yeast, Wheat and Rice/noise_contamination/std/gbm.py
6383c782669f947cc2762c874f8fd548e6ddafdd
[]
no_license
juanelenter/DNAi
cbfe8aa3424f57d93c9e6250a8fb153090514a7c
5d41961df6efcde5ead5003b247d7d5260e25128
refs/heads/main
2023-02-18T09:15:50.994200
2021-01-23T18:39:30
2021-01-23T18:39:30
331,697,588
0
0
null
null
null
null
UTF-8
Python
false
false
2,932
py
import pandas as pd import numpy as np import os import pickle from sklearn.ensemble import GradientBoostingRegressor from sklearn.model_selection import train_test_split from sklearn.metrics import r2_score from IPython.display import clear_output from add_noise import add_noise pheno = pd.read_csv(r"../feno.txt") geno = pd.read_csv(r"../geno.txt") pheno_names = ["Cadmium_Chloride", 'Congo_red', 'Cycloheximide', 'Diamide', 'Ethanol', 'Hydroquinone', 'Lithium_Chloride', 'Maltose', 'Neomycin', 'Tunicamycin', "Galactose", "YNB:ph3"] pheno_12 = pheno[pheno_names] results = [] for filename in os.listdir('../params/gbm/'): if filename[-6:] == 'pickle': with open('../params/gbm/' + filename, 'rb') as f: results.append(pickle.load(f)) #%% i = 0 M = 10 noise_ratios = np.array([5, 10, 20, 30, 40, 50, 75, 90])*0.01 for name, y in pheno_12.iteritems(): print('Analyzing environment: ' + name + '.') params = results[i][1] n_estimators = params['n_estimators'] min_samples_split = params['min_samples_split'] min_samples_leaf = params['min_samples_leaf'] max_features = params['max_features'] max_depth = params['max_depth'] loss = params['loss'] learning_rate = params['learning_rate'] missing_phenos = y[ y.isnull() ].index.values y = y.drop(missing_phenos, axis = 0) geno_c = geno.copy() geno_c = geno_c.drop(missing_phenos, axis = 0) r2s = [] y = y.to_numpy() for (j, noise_ratio) in enumerate(noise_ratios): r2s_n = [] for k in np.arange(M): y_n = add_noise(y, noise_ratio) X_train, X_test, y_train, y_test = train_test_split(geno_c, y_n, test_size=0.3) X_train = X_train.drop(columns = ["Unnamed: 0"]).values X_test = X_test.drop(columns = ["Unnamed: 0"]).values # ESTANADRIZANDO COMO SE DEBE y_train_std = (y_train - np.mean(y_train)) / np.std(y_train) y_test_std = (y_test - np.mean(y_train)) / np.std(y_train) rf = GradientBoostingRegressor(n_estimators = n_estimators, min_samples_split = min_samples_split,\ min_samples_leaf = min_samples_leaf, max_features = max_features,\ max_depth = max_depth, loss = loss, learning_rate = learning_rate, subsample = 1) rf.fit(X_train, y_train_std) rf_predictions = rf.predict(X_test) r2 = r2_score(y_test_std, rf_predictions) r2s_n.append(r2) r2s.append(np.mean(np.array(r2s_n))) #promedio print('Noise ratio = {} complete.'.format(noise_ratio)) clear_output() with open('results/gbm/r2_gbm_std_{}.pickle'.format(name), 'wb') as f: pickle.dump(r2s, f) i+=1
[ "pachi@pablosmac.local" ]
pachi@pablosmac.local
695f78552d98fbe3cbfc38700c1d30124e0ede41
b1ae970407052db7527bdf0372653ad2ee2f19b2
/module_1/case_study_1.1.2/svilda.py
761c6cf09a849b30d2d943a3605409e485d713c7
[]
no_license
ganijon/mitx-ds
c51707d4159445ee6b25fa040e6b8c6329018cdf
d3182b65048f8717b81c41febc001d796343f736
refs/heads/master
2020-07-23T17:55:18.812908
2019-09-12T22:14:23
2019-09-12T22:14:23
207,657,488
0
0
null
null
null
null
UTF-8
Python
false
false
7,744
py
import sys, re, time, string, random, csv, argparse import numpy as n from scipy.special import psi from nltk.tokenize import wordpunct_tokenize from utils import * # import matplotlib.pyplot as plt n.random.seed(10000001) meanchangethresh = 1e-3 MAXITER = 10000 class SVILDA(): def __init__(self, vocab, K, D, alpha, eta, tau, kappa, docs, iterations, parsed = False): self._vocab = vocab self._V = len(vocab) self._K = K self._D = D self._alpha = alpha self._eta = eta self._tau = tau self._kappa = kappa self._lambda = 1* n.random.gamma(100., 1./100., (self._K, self._V)) self._Elogbeta = dirichlet_expectation(self._lambda) self._expElogbeta = n.exp(self._Elogbeta) self._docs = docs self.ct = 0 self._iterations = iterations self._parsed = parsed print(self._lambda.shape) self._trace_lambda = {} for i in range(self._K): self._trace_lambda[i] = [self.computeProbabilities()[i]] self._x = [0] def updateLocal(self, doc): #word_dn is an indicator variable with dimension V (words, counts) = doc newdoc = [] N_d = sum(counts) phi_d = n.zeros((self._K, N_d)) gamma_d = n.random.gamma(100., 1./100., (self._K)) Elogtheta_d = dirichlet_expectation(gamma_d) expElogtheta_d = n.exp(Elogtheta_d) for i, item in enumerate(counts): for j in range(item): newdoc.append(words[i]) assert len(newdoc) == N_d, "error" for i in range(self._iterations): for m, word in enumerate(newdoc): phi_d[:, m] = n.multiply(expElogtheta_d, self._expElogbeta[:, word]) + 1e-100 phi_d[:, m] = phi_d[:, m]/n.sum(phi_d[:, m]) gamma_new = self._alpha + n.sum(phi_d, axis = 1) meanchange = n.mean(abs(gamma_d - gamma_new)) if (meanchange < meanchangethresh): break gamma_d = gamma_new Elogtheta_d = dirichlet_expectation(gamma_d) expElogtheta_d = n.exp(Elogtheta_d) newdoc = n.asarray(newdoc) return phi_d, newdoc, gamma_d def updateGlobal(self, phi_d, doc): # print 'updating global parameters' lambda_d = n.zeros((self._K, self._V)) for k in range(self._K): phi_dk = n.zeros(self._V) for m, word in enumerate(doc): # print word phi_dk[word] += phi_d[k][m] lambda_d[k] = self._eta + self._D * phi_dk rho = (self.ct + self._tau) **(-self._kappa) self._lambda = (1-rho) * self._lambda + rho * lambda_d self._Elogbeta = dirichlet_expectation(self._lambda) self._expElogbeta = n.exp(self._Elogbeta) if self.ct % 10 == 9: for i in range(self._K): self._trace_lambda[i].append(self.computeProbabilities()[i]) self._x.append(self.ct) def runSVI(self): for i in range(self._iterations): randint = random.randint(0, self._D-1) print("ITERATION", i, " running document number ", randint) if self._parsed == False: doc = parseDocument(self._docs[randint],self._vocab) phi_doc, newdoc, gamma_d = self.updateLocal(doc) self.updateGlobal(phi_doc, newdoc) self.ct += 1 def computeProbabilities(self): prob_topics = n.sum(self._lambda, axis = 1) prob_topics = prob_topics/n.sum(prob_topics) return prob_topics def getTopics(self, docs = None): prob_topics = self.computeProbabilities() prob_words = n.sum(self._lambda, axis = 0) if docs == None: docs = self._docs results = n.zeros((len(docs), self._K)) for i, doc in enumerate(docs): parseddoc = parseDocument(doc, self._vocab) for j in range(self._K): aux = [self._lambda[j][word]/prob_words[word] for word in parseddoc[0]] doc_probability = [n.log(aux[k]) * parseddoc[1][k] for k in range(len(aux))] results[i][j] = sum(doc_probability) + n.log(prob_topics[j]) finalresults = n.zeros(len(docs)) for k in range(len(docs)): finalresults[k] = n.argmax(results[k]) return finalresults, prob_topics def calcPerplexity(self, docs = None): perplexity = 0. doclen = 0. if docs == None: docs = self._docs for doc in docs: parseddoc = parseDocument(doc, self._vocab) _, newdoc, gamma_d = self.updateLocal(parseddoc) approx_mixture = n.dot(gamma_d, self._lambda) # print n.shape(approx_mixture) approx_mixture = approx_mixture / n.sum(approx_mixture) log_doc_prob = 0. for word in newdoc: log_doc_prob += n.log(approx_mixture[word]) perplexity += log_doc_prob doclen += len(newdoc) # print perplexity, doclen perplexity = n.exp( - perplexity / doclen) print (perplexity) return perplexity def plotTopics(self, perp): plottrace(self._x, self._trace_lambda, self._K, self._iterations, perp) def test(k, iterations): allmydocs = getalldocs("alldocs2.txt") vocab = getVocab("dictionary2.csv") testset = SVILDA(vocab = vocab, K = k, D = 847, alpha = 0.2, eta = 0.2, tau = 1024, kappa = 0.7, docs = allmydocs, iterations= iterations) testset.runSVI() finallambda = testset._lambda heldoutdocs = getalldocs("testdocs.txt") perplexity = testset.calcPerplexity(docs = heldoutdocs) with open("temp/%i_%i_%f_results.csv" %(k, iterations, perplexity), "w+") as f: writer = csv.writer(f) for i in range(k): bestwords = sorted(range(len(finallambda[i])), key=lambda j:finallambda[i, j]) # print bestwords bestwords.reverse() writer.writerow([i]) for j, word in enumerate(bestwords): writer.writerow([word, vocab.keys()[vocab.values().index(word)]]) if j >= 15: break topics, topic_probs = testset.getTopics() testset.plotTopics(perplexity) for kk in range(0, len(finallambda)): lambdak = list(finallambda[kk, :]) lambdak = lambdak / sum(lambdak) temp = zip(lambdak, range(0, len(lambdak))) temp = sorted(temp, key = lambda x: x[0], reverse=True) # print temp print('topic %d:' % (kk)) # feel free to change the "53" here to whatever fits your screen nicely. for i in range(0, 10): print('%20s \t---\t %.4f' % (vocab.keys()[vocab.values().index(temp[i][1])], temp[i][0])) print with open("temp/%i_%i_%f_raw.txt" %(k, iterations, perplexity), "w+") as f: # f.write(finallambda) for result in topics: f.write(str(result) + " \n") f.write(str(topic_probs) + " \n") def main(): parser = argparse.ArgumentParser() parser.add_argument('-K','--topics', help='number of topics, defaults to 10',required=True) parser.add_argument('-m','--mode', help='mode, test | normal',required=True) parser.add_argument('-v','--vocab', help='Vocab file name, .csv', default = "dictionary.csv", required=False) parser.add_argument('-d','--docs', help='file with list of docs, .txt', default = "alldocs.txt", required=False) parser.add_argument('-a','--alpha', help='alpha parameter, defaults to 0.2',default = 0.2, required=False) parser.add_argument('-e','--eta', help='eta parameter, defaults to 0.2',default= 0.2, required=False) parser.add_argument('-t','--tau', help='tau parameter, defaults to 0.7',default= 0.7, required=False) parser.add_argument('-k','--kappa', help='kappa parameter, defaults to 1024',default = 1024, required=False) parser.add_argument('-n','--iterations', help='number of iterations, defaults to 10000',default = 10000, required=False) args = parser.parse_args() mode = str(args.mode) vocab = str(args.vocab) K = int(args.topics) alpha = float(args.alpha) eta = float(args.eta) tau = float(args.tau) kappa = float(args.kappa) iterations = int(args.iterations) docs = str(args.docs) vocab = str(args.vocab) if mode == "test": test(K, iterations) if mode == "normal": assert vocab is not None, "no vocab" assert docs is not None, "no docs" D = len(docs) docs = getalldocs(docs) vocab = getVocab(vocab) lda = SVILDA(vocab = vocab, K = K, D = D, alpha = alpha, eta = eta, tau = tau, kappa = kappa, docs = docs, iterations = iterations) lda.runSVI() return lda if __name__ == '__main__': main()
[ "ganijon.rahimov@se.com" ]
ganijon.rahimov@se.com
261e7f6822153e865e474c711d1184319e3a594d
85f14b16182e49027bc0b1214efd49bcfd1163a1
/admm_research/dataset/remap_values.py
8ea16e371d31bdf928b12fc99f534271344f7d03
[]
no_license
jizongFox/DGA1033
83d1b4f5a68e3483864bdbddebd3da5f176e061b
3b1849d986df06b68d4b55adbb49aeecccf2e002
refs/heads/master
2022-02-27T18:55:18.129274
2019-01-17T20:12:13
2019-01-17T20:43:41
153,524,259
2
1
null
2019-01-02T13:12:52
2018-10-17T21:11:00
Python
UTF-8
Python
false
false
933
py
#!/usr/bin/env python3.6 import warnings from sys import argv from typing import Dict, Iterable from pathlib import Path from functools import partial from multiprocessing import Pool import numpy as np from skimage.io import imread, imsave def mmap_(func, iter): return Pool(1).map(func, iter) def remap(changes: Dict[int, int], filename: str): with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=UserWarning) acc = imread(filename) assert set(np.unique(acc)).issubset(changes), (set(changes), np.unique(acc)) for a, b in changes.items(): acc[acc == a] = b imsave(filename, acc) def main(): assert len(argv) == 3 folder = Path(argv[1]) changes = eval(argv[2]) remap_ = partial(remap, changes) targets: Iterable[str] = map(str, folder.glob("*.png")) mmap_(remap_, targets) if __name__ == "__main__": main()
[ "jizong.peng.1@etsmtl.net" ]
jizong.peng.1@etsmtl.net
2d710a0bc85d1d5158d4683f0182cd1ab61baa52
903d7f9286e82905472da316a6185f8f44d7a10e
/code/car.spec
030c278e1b99f3366c4f7e2b8cb54bfef0afdda8
[]
no_license
paul1015/NCU_CE6126_Assignment1
9eabb0769e07397e82e89c045bc6a860e2915ebc
5097b0de91cefcc1fd342ca4c41b20b03cd4124d
refs/heads/master
2022-12-31T07:56:02.843107
2020-10-26T02:52:52
2020-10-26T02:52:52
250,200,558
0
0
null
null
null
null
UTF-8
Python
false
false
897
spec
# -*- mode: python ; coding: utf-8 -*- block_cipher = None a = Analysis(['car.py'], pathex=['C:\\Users\\paul\\Desktop\\computing tellegence\\NCU_CE6126_Assignment1\\code'], binaries=[], datas=[], hiddenimports=[], hookspath=[], runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, [], name='car', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, upx_exclude=[], runtime_tmpdir=None, console=True )
[ "chungpaul1015@gmail.com" ]
chungpaul1015@gmail.com
519e5f41a029fe97c0b2ae69dd541aad6bc2cf78
b3995c0ef04833f348be8bdc85d877fe9342663b
/imbreports.py
8a1d0d1c44fe0954160704f2b35d35c631d79bc2
[ "Apache-2.0" ]
permissive
dgilros/TFM-Fraude
6f428433f761ffbdd911c9f554a983543e47146d
777fb054c0a687edb7baa6522ffe9cc067036299
refs/heads/main
2023-02-20T09:14:15.479555
2021-01-19T14:14:36
2021-01-19T14:14:36
308,249,757
0
0
null
null
null
null
UTF-8
Python
false
false
14,197
py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 16 10:44:39 2020 @author: David Gil del Rosal """ #imbreports.py from collections import defaultdict import numpy as np import pandas as pd import matplotlib.pyplot as plt """Genera una tabla LaTeX a partir de un diccionario con informes.""" def reports_to_tex(filename, reports, headers, metrics, caption, label, inc_report_name=False): def write_line(line, is_row=False): file.write(line) if is_row: file.write(' \\\\\n') file.write('\\hline') file.write('\n') def tex_escape(value): if type(value)==float: text = '$%.4f$' % value else: text = str(value) text = text.replace('%', '\\%') text = text.replace('#', '\\#') text = text.replace('_', '\\_') return text def textbf(text): return '\\textbf{' + text + '}' def write_tex_row(row, header=False, first_row='', nrows=1): row = list([tex_escape(cell) for cell in row]) if header == True: cells = [textbf(col) for col in row] elif inc_report_name and first_row != '': cells = ['\\multirow{' + str(nrows) + '}{*}{' + first_row + '}'] cells+= row elif inc_report_name: cells = [' '] + row else: cells = row #print(cells) write_line(' & '.join(cells), is_row=True) n_headers = len(headers) n_metrics = len(metrics) with open(filename,'w') as file: write_line('\\begin{table}[H]') write_line('\\resizebox{\\textwidth}{!}{%\centering') write_line('\\begin{tabular}{|'+('l|'*n_headers)+('r|'*n_metrics)+'}') write_line('\\hline') write_tex_row(list(headers)+list(metrics), header=True) #write_line('\\hline') for report, data in reports.items(): first_row, nrows = report, data.shape[0] for _,row in data.iterrows(): write_tex_row(row, first_row=first_row, nrows=nrows) first_row = '' write_line('\\end{tabular}}') write_line('\\caption{'+ caption + '}') write_line('\\label{tab:' + label + '}') write_line('\\end{table}') print('Created', filename) """Superclase abstracta para la generación de informes a partir de un dataset.""" class ImbalancedReport: def __init__(self, dataset, report_title): self._dataset = dataset self._report_title = report_title """Devuelve la ruta de un fichero relativa al directorio del dataset.""" def get_path(self, filename): return self._dataset.get_path(filename) """Genera un nombre de fichero prefijado por el nombre del informe.""" def get_filename(self, filename): return self.get_path(self._report_title + '-' + filename) """Genera una tabla LaTex a partir de un diccionario con los informes.""" def create_tex_table(self, reports, headers, metrics, caption, label, inc_report_name=False): filename = self.get_filename(label+'.tex') reports_to_tex(filename, reports, headers, metrics, caption, label, inc_report_name=inc_report_name) """Genera una tabla LaTex a partir de un DataFrame de Pandas.""" def df_to_tex_table(self, df, *args, **kwargs): self.create_tex_table({'Report':df}, *args, **kwargs) """Guarda la figura actual de MatPlotLib con el nombre dado.""" def save_figure(self, filename): plt.savefig(self.get_filename(filename)) """Clase para la generación de estadísticas descriptivas sobre un dataset.""" class StatsReport(ImbalancedReport): def __init__(self, dataset, report_title): super().__init__(dataset, report_title) """Genera una tabla LaTeX con los estadísticos de los atributos numéricos.""" def create_stats_table(self, ds_name, headers, metrics, caption, features=None): from scipy.stats import ttest_ind columns = headers + metrics df = self._dataset.load_dataframe(ds_name) label_attr = self._dataset.get_label_attr() labels = self._dataset.get_maj_min() df_class = {label:df[df[label_attr]==label] for label in labels} df_licit = df_class[labels[0]] df_fraud = df_class[labels[1]] print_test = True reports = {} if features is None: features = df.columns for column in features: if column != label_attr: rows = [] for label,label_attr in zip(labels, ['0','1']): values = df_class[label][column].to_numpy() q1 = np.percentile(values, 25) q3 = np.percentile(values, 75) median = np.percentile(values, 50) row = [label_attr, values.mean(), values.std(), values.min(), q1, median, q3, values.max(), q3-q1] for i in range(1, len(row)): row[i] = round(float(row[i]), 2) if print_test: tstat, pvalue = ttest_ind(df_licit[column], df_fraud[column]) tstat = round(tstat, 2) pvalue = round(pvalue, 2) row.append(tstat) row.append(pvalue) rows.append(row) print_test = not print_test reports[column] = pd.DataFrame(rows, columns=columns) self.create_tex_table(reports, headers, metrics, caption, 'Stats', inc_report_name=True) """Clase para la generación de estadísticas sobre las muestras""" class SamplingReport(ImbalancedReport): def __init__(self, dataset, report_title): super().__init__(dataset, report_title) rows = [] label_attr = dataset.get_label_attr() neg, pos = dataset.get_maj_min() for sample_name in dataset.get_sample_names(all_samples=True): df = dataset.load_dataframe(sample_name) y = df[label_attr].to_numpy() neg_count = len(y[y==neg]) pos_count = len(y[y==pos]) rows.append([sample_name, df.shape[0], neg_count, pos_count]) df = pd.DataFrame(rows, columns=['Sample','#Obs','#Neg','#Pos']) df['%Pos'] = 100.0 * df['#Pos'] / df['#Obs'] df['IR'] = df['#Neg'] / df['#Pos'] self._stats_df = df def get_stats_df(self): return self._stats_df def plot_statistics(self, filename, xlabel, colors=['b','r']): stats_df = self.get_stats_df() fig, ax = plt.subplots(figsize=(12,6)) ax.barh(stats_df['Sample'], stats_df['#Neg'], color=colors[0]) ax.barh(stats_df['Sample'], stats_df['#Pos'], left=stats_df['#Neg'], color=colors[1]) ax.set_xlabel(xlabel) self.save_figure('Samples.png') def plot_tsne_samples(self, filename, cols=4, colors=['b','r']): maj, _ = self._dataset.get_maj_min() sample_names = self._dataset.get_sample_names(all=True) n = len(sample_names) rows = int(n / cols) if n % cols != 0: rows+= 1 fig, axs = plt.subplots(rows, cols, figsize=(12,10)) row, col = 0, 0 for sampling_method in sample_names: df = self._dataset.load_dataframe('tsne-'+sampling_method) colors = [colors[0] if label == maj else colors[1] for label in df[self._dataset.get_label_attr()]] axs[row,col].scatter(df['X1'], df['X2'], c=colors) axs[row,col].set_title(sampling_method) col = (col+1) % cols if col == 0: row+= 1 for c in range(col,cols): try: fig.delaxes(ax=axs[row,c]) except: pass fig.tight_layout() self.save_figure('Samples-tSNE.png') def create_sampling_table(self, caption): df = self.get_stats_df() self.df_to_tex_table(df, [df.columns[0]], df.columns[1:], caption, 'Samples', inc_report_name=False) class CrossValReport(ImbalancedReport): def __init__(self, dataset, model_name): super().__init__(dataset, model_name+'-CrossVal') ds_name = model_name+'-Scores' self._model_name = model_name self._df = dataset.load_dataframe(ds_name) self._df_scores = self._df[self._df['Task']=='CrossVal'] def create_scores_table(self, header, caption): rows = [] sample_names = self._dataset.get_sample_names() metrics = self._df_scores.columns[4:] for sample_name in sample_names: df = self._df_scores df_sample = df[df['Sample']==sample_name] row = [sample_name] for metric in metrics: mean, std = df_sample[metric].mean(), df_sample[metric].std() row.append('$%.4f \pm %.2f$' % (mean,std)) rows.append(row) df = pd.DataFrame(rows) tab_label = 'Scores' self.df_to_tex_table(df, [header], metrics, caption, tab_label) def plot_scores(self, metric, figsize=(12,10)): scores = defaultdict(list) for _,row in self._df_scores.iterrows(): scores[row['Sample']].append(row[metric]) plt.figure(figsize=figsize) plt.boxplot(scores.values(), labels=scores.keys(), showmeans=True) self.save_figure(metric+'.png') class EvalReport(CrossValReport): def __init__(self, dataset, model_name): super().__init__(dataset, model_name) self._report_title = self._report_title.replace('-CrossVal','-Eval') self._df_scores = self._df[self._df['Task']=='Eval'] def create_scores_table(self, header, caption): rows = [] sample_names = self._dataset.get_sample_names() metrics = self._df_scores.columns[4:] for sample_name in sample_names: df = self._df_scores df_sample = df[df['Sample']==sample_name] row = [sample_name] for metric in metrics: row.append(df_sample[metric].values[0]) rows.append(row) df = pd.DataFrame(rows) tab_label = 'Scores' self.df_to_tex_table(df, [header], metrics, caption, tab_label) def plot_tree_model(self, sample_name, figsize=(15,12), **kwargs): from sklearn import tree model = self._dataset.load_model(self._model_name, sample_name) df = self._dataset.load_dataframe(sample_name, nrows=1) df = df.drop([self._dataset.get_label_attr()], axis=1) plt.figure(figsize=(15,12)) tree.plot_tree(model, feature_names=df.columns, filled=True, label='none', **kwargs) self.save_figure(sample_name+'-Tree.png') def get_feature_importances(self, sample_name): model = self._dataset.load_model(self._model_name, sample_name) df = self._dataset.load_dataframe(sample_name, nrows=1) features = df.drop(['Class'], axis=1).columns yerr = None if hasattr(model, 'coef_'): # es un modelo de regresión, los coeficientes estiman la importancia importances = model.coef_[0] elif hasattr(model, 'feature_importances_'): # es un modelo basado en árboles de decisión importances = model.feature_importances_ if hasattr(model, 'estimators_'): # es un modelo de ensamblaje: Random Forest, Extra Trees, etc. # mostrar también desviación estándar yerr = np.std([tree.feature_importances_ for tree in model.estimators_], axis=0) else: raise ValueError('Model does not allow to estimate importances') return features, importances, yerr def plot_feature_importances(self, sample_name, **kwargs): # generar grafico de barras features, importances, yerr = self.get_feature_importances(sample_name) plt.figure(figsize=(18,10)) plt.bar(features, importances, yerr=yerr) self.save_figure(sample_name+'-Importances.png') def feature_importance_table(self, sample_name, caption, n_feat=10): features, importances, _ = self.get_feature_importances(sample_name) df = pd.DataFrame({'Feature':features, 'Importance': importances}) df = df.sort_values(by='Importance', ascending=False).head(n_feat) tab_label = self._model_name + '-' + sample_name + '-Importances' self.df_to_tex_table(df, ['Feature'], df.columns[1:], caption, tab_label) def plot_confusion_matrices(self, *labels, cols=4, figsize=(12,10), normalize=False): import seaborn as sns df = self._df_scores n = df.shape[0] rows = int(n / cols) if n % cols != 0: rows+= 1 fig, axs = plt.subplots(rows, cols, figsize=(12,10)) row, col = 0, 0 for _,orow in df.iterrows(): sampling_method = orow['Sample'] tn, fp, fn, tp = orow['TN'], orow['FP'], orow['FN'], orow['TP'] if normalize: tnr = round(float(tn)/float(tn+fp), 2) fpr = 1.0 - tnr fnr = round(float(fn)/float(fn+tp), 2) tpr = 1.0 - fnr tn, fp, fn, tp = tnr, fpr, fnr, tpr fmt='2g' else: fmt='d' conf_mat = np.array([[tn,fp],[fn,tp]]) sns.heatmap(conf_mat, cbar=False, annot=True, cmap='Blues', xticklabels=labels, yticklabels=labels, ax=axs[row,col], fmt=fmt) axs[row,col].set_title(sampling_method) col = (col+1) % cols if col == 0: row+= 1 for c in range(col,cols): try: fig.delaxes(ax=axs[row,c]) except: pass fig.tight_layout() self.save_figure('-CM.png')
[ "noreply@github.com" ]
dgilros.noreply@github.com
934f6cc65bb5102cb2a33a42e4ac7d5b7bd08355
b5c92150b0fb76daf9b8725c7a64ba1b54f2d9c7
/auth_ldap_update/models/__init__.py
11fcf5522c5097f4417cf1c613fb658948a8730c
[]
no_license
hashemalycore/CMNT_00107_2017_SAR_addons
63da3c66eddc99b585671cc85a53661a497771aa
071646e495fcd9563f72a02f6630ee4d70afa438
refs/heads/master
2020-04-02T10:25:32.457793
2018-02-12T13:09:16
2018-02-12T13:09:16
null
0
0
null
null
null
null
UTF-8
Python
false
false
65
py
# -*- coding: utf-8 -*- import res_company_ldap import res_user
[ "javierjcf@gmail.com" ]
javierjcf@gmail.com
ad014d37a3f02b6d7adf9e256074512d236d625d
8ffd9c444be1c4f836fe2a0d39199a4c8a495632
/Rnn_mcmc/elman_rnn_mcmc.py
22e62afe026e307815f56af7056ee648ab23f9f9
[]
no_license
sydney-machine-learning/Elman-RNN-python
fbe334fb45c3668876813c86384db3b6ec68eb80
23452cd48db8aa507887626c7a78e520b5e41fcf
refs/heads/master
2020-05-23T12:07:41.808307
2019-06-14T06:19:03
2019-06-14T06:19:03
186,751,551
4
3
null
null
null
null
UTF-8
Python
false
false
21,270
py
# Rohitash Chandra, 2017 c.rohitash@gmail.conm #!/usr/bin/python #Feedforward Neural Network in Python (Classification Problem used for teaching and learning purpose) #Sigmoid units used in hidden and output layer. gradient descent and stocastic gradient descent functions implemented # this is best for teaching and learning as numpy arrays are not used in Forward and Backward Pass. #numpy implymentation with momemtum is given here: https://github.com/rohitash-chandra/VanillaFNN-Python #corresponding C++ implementation which is generalised to any number of hidden layers is given here: # https://github.com/rohitash-chandra/feedforward-neural-network #problems: https://en.wikipedia.org/wiki/XOR_gate, (4 Bit Parity) https://en.wikipedia.org/wiki/Parity_bit #wine classification: https://archive.ics.uci.edu/ml/datasets/wine # infor: https://en.wikipedia.org/wiki/Feedforward_neural_network #http://media.wiley.com/product_data/excerpt/19/04713491/0471349119.pdf ''' Elman RNN with mcmc single core this is a single core mcmc applied on weights of RNN. (without langevin) an issue - need to find some better heuristics values as it still converges to a local minimum. found this when running on mackey dataset ''' import matplotlib.pyplot as plt import numpy as np import random import time import math #np.random.seed(1) import numpy as np import rnn_mcmc_plots as mcmcplt mplt = mcmcplt.Mcmcplot() MinimumError = 0.00001 trainsize=299 testsize=99 weightdecay = 0.01 class Network: def __init__(self,LearnRate, Topo, train_x,train_y,test_x,test_y): self.Top = Topo # NN topology [input, hidden, output] self.Train_x = train_x self.Train_y = train_y self.Test_x = test_x self.Test_y = test_y self.learn_rate = LearnRate #initialize weights ( W1 W2 ) and bias ( b1 b2 ) of the network self.W1 = np.random.randn(self.Top[0] , self.Top[1]) self.B1 = np.random.randn(self.Top[1]) # bias first layer self.W2 = np.random.randn(self.Top[1] , self.Top[2]) self.B2 = np.random.randn(self.Top[2]) # bias second layer self.StateW = np.random.randn(self.Top[1] , self.Top[1]) # for feedback self.StateOut = np.ones(self.Top[1]) self.hid_out = np.zeros(self.Top[1]) # output of first hidden layer self.hid_delta = np.zeros(self.Top[1]) # gradient of first hidden layer self.out = np.zeros(self.Top[2]) # output last (output) layer self.out_delta = np.zeros(self.Top[2]) # gradient of output layer self.pred_class=0 self.InlayerOutL0=[] # to store output from the first layer which is the input itself self.ErL1 = [] # to store gradients or error for layer 1 which is hidden layer self.OutputSlideL1=[] # to store output corresponding to each ith element(x[0..i]) in the input sequence self.OutputSlideL2=[] # to store output from layer 2 output layer for x[0..i] def sigmoid(self,x): return 1 / (1 + np.exp(-x)) def ForwardPass(self, sample,slide): sample_time = sample[slide] layer = 0 weightsum = 0.0 StateWeightSum = 0.0 forwardout=0.0 # if self.InlayerOutL0 == []: # print('blah') # quit() # self.InlayerOutL0 = np.zeros((len(sample)+1,self.Top[0])) for row in range(0,self.Top[0]): self.InlayerOutL0[slide+1][row] = sample_time[row] for y in range(0, self.Top[1]): for x in range(0, self.Top[0]): #print(sample_time) #print() weightsum += self.InlayerOutL0[slide+1][x] * self.W1[x,y] #weightsum = 0 for x in range(0,self.Top[1]): StateWeightSum += self.OutputSlideL1[slide][x] * self.StateW[x,y] #print(weightsum,StateWeightSum,self.B1[y],y) #print(self.B1) #self.StateOut[y] = (weightsum + StateWeightSum) - self.B1[y] forwardout = (weightsum + StateWeightSum) - self.B1[y] # if self.OutputSlideL1 == []: # print('blah2') # quit() # self.OutputSlideL1 = np.zeros((len(sample)+1,self.Top[1])) self.OutputSlideL1[slide+1][y] = self.sigmoid(forwardout) weightsum=0 StateWeightSum=0 layer = 1 # hidden layer to output weightsum = 0.0 #print(self.out,end=' ') for y in range(0, self.Top[layer+1]): for x in range(0, self.Top[layer]): weightsum += self.OutputSlideL1[slide+1][x] * self.W2[x,y] forwardout = (weightsum - self.B2[y]) self.OutputSlideL2[slide+1][y] = self.sigmoid(forwardout) weightsum = 0.0 StateWeightSum=0.0 self.pred_class = max(self.out)#added new for classification #print(self.out, 'is out') # for regression type for i in range(0,self.Top[2]): self.out[i] = self.OutputSlideL2[slide+1][i] #for i in range(0,self.Top[2]): # self.out[i] = 1 if self.OutputSlideL2[slide+1][i] > 0.5 else 0 #just one going forward for all the input data to find fx def evaluate_proposal(self,x,w): self.decode(w) fx = [] for i,sample in enumerate(x): self.StateOut = np.ones(self.Top[1]) self.ErL1 = np.zeros((len(sample)+1,self.Top[1])) # need to modify for multiple layers self.OutputSlideL1 = np.zeros((len(sample)+1,self.Top[1])) for z in range(0,self.Top[1]): self.OutputSlideL1[0][z] = self.StateOut[z] self.InlayerOutL0 = np.zeros((len(sample)+1,self.Top[0])) self.OutputSlideL2 = np.zeros((len(sample)+1,self.Top[2])) for slide in range(0,len(sample)): self.ForwardPass(sample,slide) temp=np.copy(self.out) #print(self.out) fx.append(temp) #print(fx[0:5]) return np.array(fx) def sampleEr(self,actualout): error = np.subtract(self.out, actualout) sqerror= np.sum(np.square(error))/self.Top[2] return sqerror def decode(self,w): w_layer1size = self.Top[0] * self.Top[1] w_layer2size = self.Top[1] * self.Top[2] w_layer1 = w[0:w_layer1size] self.W1 = np.reshape(w_layer1, (self.Top[0], self.Top[1])) w_layer2 = w[w_layer1size:w_layer1size + w_layer2size] self.W2 = np.reshape(w_layer2, (self.Top[1], self.Top[2])) self.B1 = w[w_layer1size + w_layer2size:w_layer1size + w_layer2size + self.Top[1]].reshape(self.Top[1]) self.B2 = w[w_layer1size + w_layer2size + self.Top[1]:w_layer1size + w_layer2size + self.Top[1] + self.Top[2]].reshape(self.Top[2]) w_state = w[w_layer1size + w_layer2size + self.Top[1] + self.Top[2]:w_layer1size + w_layer2size + self.Top[1] + self.Top[2]+self.Top[1]*self.Top[1]] self.StateW = np.reshape(w_state,(self.Top[1],self.Top[1])) #print(self.B1,' after decode') #print(self.W1.shape,self.W2.shape,self.StateW.shape,self.B1.shape,self.B2.shape, ' is shape') def data_loader(filename): f=open(filename,'r') x=[[[]]] count=0 y=[[]] while(True): count+=1 #print(count) text = f.readline() #print(text) if(text==''): break if(len(text.split()) == 0): #print(text) text=f.readline() if(text==''): break #print(text) t=int(text) a=[[]] ya=[] for i in range(0,t): temp=f.readline().split(' ') b=[] for j in range(0,len(temp)): b.append(float(temp[j])) a.append(b) del a[0] x.append(a) temp=f.readline().split(' ') #print(temp) for j in range(0,len(temp)): if temp[j] != "\n": ya.append(float(temp[j])) y.append(ya) del x[0] del y[0] return x,y def print_data(x,y): # assuming x is 3 dimensional and y is 2 dimensional for i in range(0,len(x)): for j in range(0,len(x[i])): print(x[i][j]) print(y[i]) print(' ') def loadersunspot(fname): f = open(fname,'r') x=[[]] count=0 y=[] while(True): count+=1 #print(count) text = f.readline() #print(text) if(text==''): break if(len(text.split()) == 0): #print(text) text=f.readline() if(text==''): break #print(text) a=[] for i in range(0,len(text.split(' '))-1): #print(text.split(' ')[i].strip()) temp = float(text.split(' ')[i].strip()) a.append([temp]) y.append([float(text.split(' ')[-1].strip())]) if a[0] == []: del a[0] x.append(a) #print(count) if (x[0]) == [] or x[0] == [[]] : del x[0] if y[0] == [] or y[0] == [[]]: del y[0] return x,y def shuffledata(x,y): a=[] for i in range(0,len(x)): a.append(i) random.shuffle(a) x1 = [] y1=[] for item in a: x1.append(x[item]) y1.append(y[item]) return x1,y1 class MCMC: def __init__(self, samples, learnrate, train_x, train_y,test_x,test_y, topology): self.samples = samples # max epocs self.topology = topology # NN topology [input, hidden, output] self.train_x = train_x# self.test_x = test_x self.train_y=train_y self.test_y=test_y self.learnrate = learnrate # ---------------- def rmse(self, predictions, targets): predictions = np.array(predictions) targets=np.array(targets) return np.sqrt(((predictions - targets) ** 2).mean()) def likelihood_func(self, neuralnet, x,y, w, tausq): #y = data[:, self.topology[0]] y=y fx = neuralnet.evaluate_proposal(x, w) rmse = self.rmse(fx, y) loss = -0.5 * np.log(2 * math.pi * tausq) - 0.5 * np.square(np.array(y) - np.array(fx)) / tausq return [np.sum(loss), fx, rmse] def prior_likelihood(self, sigma_squared, nu_1, nu_2, w, tausq): h = self.topology[1] # number hidden neurons d = self.topology[0] # number input neurons part1 = -1 * ((d * h + h + 2) / 2) * np.log(sigma_squared) part2 = 1 / (2 * sigma_squared) * (sum(np.square(w))) log_loss = part1 - part2 - (1 + nu_1) * np.log(tausq) - (nu_2 / tausq) return log_loss def sampler(self): # ------------------- initialize MCMC testsize = len(self.test_x) #self.testdata.shape[0] trainsize = len(self.train_x) samples = self.samples x_test = np.linspace(0, 1, num=testsize) x_train = np.linspace(0, 1, num=trainsize) netw = self.topology # [input, hidden, output] y_test = self.test_y #self.testdata[:, netw[0]] y_train = self.train_y #self.traindata[:, netw[0]] #print(len(y_train)) #print(len(y_test)) # here w_size = (netw[0] * netw[1]) + (netw[1] * netw[2]) + netw[1] + netw[2] + (netw[1] * netw[1]) # num of weights and bias pos_w = np.ones((samples, w_size)) # posterior of all weights and bias over all samples pos_tau = np.ones((samples, 1)) # original --> fxtrain_samples = np.ones((samples, trainsize)) # fx of train data over all samples #print('shape: ',np.array(y_train).shape[1]) fxtrain_samples = np.ones((samples, trainsize,int(np.array(y_train).shape[1]))) # fx of train data over all samples # original --> fxtest_samples = np.ones((samples, testsize)) # fx of test data over all samples || probably for 1 dimensional data fxtest_samples = np.ones((samples, testsize,np.array(self.test_y).shape[1])) # fx of test data over all samples rmse_train = np.zeros(samples) rmse_test = np.zeros(samples) w = np.random.randn(w_size) w_proposal = np.random.randn(w_size) step_w = 0.02 # defines how much variation you need in changes to w step_eta = 0.01 # --------------------- Declare FNN and initialize neuralnet = Network(self.learnrate,self.topology, self.train_x,self.train_y,self.test_x,self.test_y) print ('evaluate Initial w') #print(w,np.array(self.train_x).shape) pred_train = neuralnet.evaluate_proposal(self.train_x, w) pred_test = neuralnet.evaluate_proposal(self.test_x, w) eta = np.log(np.var(np.array(pred_train) - np.array(y_train))) tau_pro = np.exp(eta) err_nn = np.sum(np.square(np.array(pred_train) - np.array(y_train)))/(len(pred_train)) #added by ashray mean square sum print('err_nn is: ',err_nn) sigma_squared = 25 nu_1 = 0 nu_2 = 0 #print(pred_train) prior_likelihood = self.prior_likelihood(sigma_squared, nu_1, nu_2, w, tau_pro) # takes care of the gradients [likelihood, pred_train, rmsetrain] = self.likelihood_func(neuralnet, self.train_x,self.train_y, w, tau_pro) [likelihood_ignore, pred_test, rmsetest] = self.likelihood_func(neuralnet, self.test_x,self.test_y, w, tau_pro) print(likelihood,' is likelihood of train') #print(pred_train) #print(pred_train, ' is pred_train') naccept = 0 print ('begin sampling using mcmc random walk') plt.plot(x_train, y_train) plt.plot(x_train, pred_train) plt.title("Plot of Data vs Initial Fx") plt.savefig('mcmcresults/begin.png') plt.clf() plt.plot(x_train, y_train) for i in range(samples - 1): #print(i) w_proposal = w + np.random.normal(0, step_w, w_size) eta_pro = eta + np.random.normal(0, step_eta, 1) tau_pro = math.exp(eta_pro) [likelihood_proposal, pred_train, rmsetrain] = self.likelihood_func(neuralnet, self.train_x,self.train_y, w_proposal, tau_pro) [likelihood_ignore, pred_test, rmsetest] = self.likelihood_func(neuralnet, self.test_x,self.test_y, w_proposal, tau_pro) # likelihood_ignore refers to parameter that will not be used in the alg. prior_prop = self.prior_likelihood(sigma_squared, nu_1, nu_2, w_proposal, tau_pro) # takes care of the gradients diff_likelihood = likelihood_proposal - likelihood diff_priorliklihood = prior_prop - prior_likelihood #mh_prob = min(1, math.exp(diff_likelihood + diff_priorliklihood)) mh_prob = min(0, (diff_likelihood + diff_priorliklihood)) mh_prob = math.exp(mh_prob) u = random.uniform(0, 1) if u < mh_prob: # Update position #print(i, ' is the accepted sample') naccept += 1 likelihood = likelihood_proposal prior_likelihood = prior_prop w = w_proposal eta = eta_pro # if i % 100 == 0: # #print ( likelihood, prior_likelihood, rmsetrain, rmsetest, w, 'accepted') # print ('Sample:',i, 'RMSE train:', rmsetrain, 'RMSE test:',rmsetest) pos_w[i + 1,] = w_proposal pos_tau[i + 1,] = tau_pro fxtrain_samples[i + 1,] = pred_train fxtest_samples[i + 1,] = pred_test rmse_train[i + 1,] = rmsetrain rmse_test[i + 1,] = rmsetest plt.plot(x_train, pred_train) else: pos_w[i + 1,] = pos_w[i,] pos_tau[i + 1,] = pos_tau[i,] fxtrain_samples[i + 1,] = fxtrain_samples[i,] fxtest_samples[i + 1,] = fxtest_samples[i,] rmse_train[i + 1,] = rmse_train[i,] rmse_test[i + 1,] = rmse_test[i,] # print i, 'rejected and retained' if i % 100 == 0: #print ( likelihood, prior_likelihood, rmsetrain, rmsetest, w, 'accepted') print ('Sample:',i, 'RMSE train:', rmsetrain, 'RMSE test:',rmsetest) print (naccept, ' num accepted') print ((naccept*100) / (samples * 1.0), '% was accepted') accept_ratio = naccept / (samples * 1.0) * 100 plt.title("Plot of Accepted Proposals") plt.savefig('mcmcresults/proposals.png') plt.savefig('mcmcresults/proposals.svg', format='svg', dpi=600) plt.clf() return (pos_w, pos_tau, fxtrain_samples, fxtest_samples, x_train, x_test, rmse_train, rmse_test, accept_ratio) def main(): outres = open('resultspriors.txt', 'w') learnRate = 0.1 #for mackey fname = "trainsunspot.txt" x,y = loadersunspot(fname) #print_data(x,y) x,y = shuffledata(x,y) train_x= x[:int(len(x)*0.8)] test_x=x[int(len(x)*0.8):] train_y= y[:int(len(y)*0.8)] test_y=y[int(len(y)*0.8):] Input = len(train_x[0][0]) Output = len(train_y[0]) #print(traindata) Hidden = 5 topology = [Input, Hidden, Output] numSamples = 80000 # need to decide yourself mcmc = MCMC(numSamples,learnRate,train_x,train_y,test_x,test_y, topology) # declare class [pos_w, pos_tau, fx_train, fx_test, x_train, x_test, rmse_train, rmse_test, accept_ratio] = mcmc.sampler() print ('sucessfully sampled') burnin = 0.1 * numSamples # use post burn in samples pos_w = pos_w[int(burnin):, ] pos_tau = pos_tau[int(burnin):, ] ''' to plots the histograms of weight destribution ''' mplt.initialiseweights(len(pos_w),len(pos_w[0])) for i in range(len(pos_w)): mplt.addweightdata(i,pos_w[i]) mplt.saveplots() fx_mu = fx_test.mean(axis=0) fx_high = np.percentile(fx_test, 95, axis=0) fx_low = np.percentile(fx_test, 5, axis=0) fx_mu_tr = fx_train.mean(axis=0) fx_high_tr = np.percentile(fx_train, 95, axis=0) fx_low_tr = np.percentile(fx_train, 5, axis=0) rmse_tr = np.mean(rmse_train[int(burnin):]) rmsetr_std = np.std(rmse_train[int(burnin):]) rmse_tes = np.mean(rmse_test[int(burnin):]) rmsetest_std = np.std(rmse_test[int(burnin):]) print (rmse_tr, rmsetr_std, rmse_tes, rmsetest_std) np.savetxt(outres, (rmse_tr, rmsetr_std, rmse_tes, rmsetest_std, accept_ratio), fmt='%1.5f') #ytestdata = testdata[:, input] #ytraindata = traindata[:, input] ytestdata = test_y ytraindata = train_y # converting everything to np arrays x_test = np.array(x_test) fx_low = np.array(fx_low) fx_high = np.array(fx_high) fx_mu = np.array(fx_mu) ytestdata = np.array(ytestdata) x_train= np.array(x_train) ytraindata= np.array(ytraindata) fx_mu_tr = np.array(fx_mu_tr) fx_low_tr = np.array(fx_low_tr) fx_high_tr = np.array(fx_high_tr) plt.plot(x_test, ytestdata, label='actual') plt.plot(x_test, fx_mu, label='pred. (mean)') plt.plot(x_test, fx_low, label='pred.(5th percen.)') plt.plot(x_test, fx_high, label='pred.(95th percen.)') #print(np.array(x_test).shape,np.array(fx_low).shape,np.array(fx_high).shape) #print(fx_low[:,0],fx_high,x_test) plt.fill_between(x_test, fx_low[:,0], fx_high[:,0], facecolor='g', alpha=0.4) plt.legend(loc='upper right') plt.title("Plot of Test Data vs MCMC Uncertainty ") plt.savefig('mcmcresults/mcmcrestest.png') plt.savefig('mcmcresults/mcmcrestest.svg', format='svg', dpi=600) plt.clf() # ----------------------------------------- plt.plot(x_train, ytraindata, label='actual') plt.plot(x_train, fx_mu_tr, label='pred. (mean)') plt.plot(x_train, fx_low_tr, label='pred.(5th percen.)') plt.plot(x_train, fx_high_tr, label='pred.(95th percen.)') plt.fill_between(x_train, fx_low_tr[:,0], fx_high_tr[:,0], facecolor='g', alpha=0.4) plt.legend(loc='upper right') plt.title("Plot of Train Data vs MCMC Uncertainty ") plt.savefig('mcmcresults/mcmcrestrain.png') plt.savefig('mcmcresults/mcmcrestrain.svg', format='svg', dpi=600) plt.clf() mpl_fig = plt.figure() ax = mpl_fig.add_subplot(111) ax.boxplot(pos_w) ax.set_xlabel('[W1] [B1] [W2] [B2]') ax.set_ylabel('Posterior') plt.legend(loc='upper right') plt.title("Boxplot of Posterior W (weights and biases)") plt.savefig('mcmcresults/w_pos.png') plt.savefig('mcmcresults/w_pos.svg', format='svg', dpi=600) plt.clf() if __name__ == "__main__": main()
[ "ashray17aman@gmail.com" ]
ashray17aman@gmail.com
aa37c08251b42c8f761de3d567435b29526433cb
49cd7186494471d560b19630b63628e13397e4c2
/ptools.py
e65da902c6c41f947046dd70a3c43f6b48c26252
[]
no_license
Naeemkh/seismtools
65a33af6cd274bb6850c77302e67293462418cce
aa40ed59ffd9f59cf9f5a02c00c0e7a8fe75aed8
refs/heads/master
2021-05-14T13:18:38.919757
2017-11-09T17:48:36
2017-11-09T17:48:36
null
0
0
null
null
null
null
UTF-8
Python
false
false
22,332
py
#!/usr/bin/env python """ # =================================================================================== # The program contains general functions what may be used by other programs. # =================================================================================== """ from __future__ import division, print_function, absolute_import import os import sys import numpy as np from seism import s_filter, seism_psignal from stools import seism_cutting, seism_appendzeros def synchronize_all_stations(obs_data, stations, stamp, eqtimestamp, leading): """ synchronize the stating time and ending time of data arrays obs_data = recorded data (optional); stations = simulation signal(s) """ # If we have a recorded data time stamp if stamp is not None and obs_data is not None: start = stamp[0]*3600 + stamp[1]*60 + stamp[2] eq_time = eqtimestamp[0]*3600 + eqtimestamp[1]*60 + eqtimestamp[2] sim_start = eq_time - leading for i in range(0, 3): # synchronize the start time if start < sim_start: # data time < sim time < earthquake time; cutting data array obs_data[i] = seism_cutting('front', (sim_start - start), 20, obs_data[i], False) elif start > eq_time: # sim time < earthquake time < data time; adding zeros in front obs_data[i] = seism_appendzeros('front', (start - eq_time), 20, obs_data[i]) for station in stations: station[i] = seism_cutting('front', (eq_time - sim_start), 20, station[i], False) else: # sim time < data time < earthquake time; adding zeros obs_data[i] = seism_appendzeros('front', (start - sim_start), 20, obs_data[i]) # synchronize the ending time if obs_data is not None: obs_dt = obs_data[0].dt obs_samples = obs_data[0].samples obs_time = obs_dt * obs_samples else: obs_time = None # Find target timeseries duration target_time = None if obs_time is not None: target_time = obs_time for station in stations: station_dt = station[0].dt station_samples = station[0].samples station_time = station_dt * station_samples if target_time is None: target_time = station_time continue target_time = min(target_time, station_time) # Work on obs_data if obs_data is not None: for i in range(0, 3): if obs_time > target_time: obs_data[i] = seism_cutting('end', (obs_time - target_time), 20, obs_data[i], False) obs_samples = obs_data[0].samples obs_time = obs_dt * obs_samples # Work on simulated data for station in stations: for i in range(0, 3): sim_dt = station[i].dt sim_samples = station[i].samples sim_time = sim_dt * sim_samples if sim_time > target_time: station[i] = seism_cutting('end', (sim_time - target_time), 20, station[i], False) # scale the data if they have one sample in difference after synchronizing total_samples = None if obs_data is not None: total_samples = obs_samples for station in stations: sim_samples = station[0].samples if total_samples is None: total_samples = sim_samples continue total_samples = max(sim_samples, total_samples) # For obs_data if obs_data is not None: for i in range(0, 3): if obs_data[i].samples == total_samples - 1: obs_data[i] = seism_appendzeros('end', obs_data[i].dt, 20, obs_data[i]) # For simulated data for station in stations: for i in range(0, 3): if station[i].samples == total_samples - 1: station[i] = seism_appendzeros('end', station[i].dt, 20, station[i]) return obs_data, stations # end of synchronize_all_stations def filter_data(psignal, fmin, fmax): """ This function is used to filter with a bandpass filter between fmin/fmax """ if not isinstance(psignal, seism_psignal): print("[ERROR]: found error filtering psignal.") return False delta_t = psignal.dt psignal.accel = s_filter(psignal.accel, delta_t, type='bandpass', family='butter', fmin=fmin, fmax=fmax, N=4, rp=0.1, rs=100) psignal.velo = s_filter(psignal.velo, delta_t, type='bandpass', family='butter', fmin=fmin, fmax=fmax, N=4, rp=0.1, rs=100) psignal.displ = s_filter(psignal.displ, delta_t, type='bandpass', family='butter', fmin=fmin, fmax=fmax, N=4, rp=0.1, rs=100) psignal.data = np.c_[psignal.displ, psignal.velo, psignal.accel] return psignal # end of filter_data def read_filelist(filelist): """ This function reads the filelist provided by the user """ station_list = [] coor_x = [] coor_y = [] try: input_file = open(filelist, 'r') except IOError: print("[ERROR]: error loading filelist.") sys.exit(-1) for line in input_file: if not '#' in line: line = line.split() # Get station name and make substitution station_name = line[0] station_name = station_name.replace(".", "_") if len(line) == 1: # not containing coordinates station_list.append(station_name) coor_x.append(0.0) coor_y.append(0.0) elif len(line) == 3: # containing coordinates station_list.append(station_name) try: coor_x.append(float(line[1])) coor_y.append(float(line[2])) except ValueError: coor_x.append(0.0) coor_y.append(0.0) # Close the input file input_file.close() return station_list, coor_x, coor_y # end of read_filelist def get_bands(): """ The function is to allow user specify sample rates. Without user input, sample rates are setting to default values. """ freq_0 = 0.05 freq_1 = 0.1 freq_2 = 0.25 freq_3 = 0.5 freq_4 = 1 freq_5 = 2 freq_6 = 4 bands = [freq_0, freq_1, freq_2, freq_3, freq_4, freq_5, freq_6] freqs = [] flag = True while flag: flag = False freqs = raw_input('== Enter the sequence of ' 'sample rates: ').replace(',', ' ').split() if not freqs: #setting to default values return bands if len(freqs) == 1: print("[ERROR]: invalid sample rates") flag = True else: bands = [] for freq in freqs: try: bands.append(float(freq)) except ValueError: print("[ERROR]: invalid sample rates") flag = True break for i in range(0, len(bands)-1): if bands[i] >= bands[i+1]: print("[ERROR]: invalid sequence of sample rates") flag = True break return bands # end of get_bands def get_output_format(): """ This function asks the user to select between the bbp or her output formats """ output_format = '' # Get the output format the user wants while output_format != 'bbp' and output_format != 'her': output_format = raw_input('== Enter output format (bbp/her): ') output_format = output_format.lower() return output_format #end of get_output_format def check_data(station): """ Checks the data after rotation, process_dt, and synchronization to avoid encountering errors in gof_engine """ for i in range(0, len(station)): signal = station[i] if signal.accel.size == 0: print("[ERROR]: Empty array after processing signals.") return False if signal.velo.size == 0: print("[ERROR]: Empty array after processing signals.") return False if signal.displ.size == 0: print("[ERROR]: Empty array after processing signals.") return False if np.isnan(np.sum(signal.accel)): print("[ERROR]: NaN data after processing signals.") return False if np.isnan(np.sum(signal.velo)): print("[ERROR]: NaN data after processing signals.") return False if np.isnan(np.sum(signal.displ)): print("[ERROR]: NaN data after processing signals.") return False return station # end of check_data # ================================ READING ================================ def read_file(filename): """ This function reads a timeseries file(s) in either bbp format (ends with .bbp) or hercules (ends otherwise) """ if filename.lower().endswith(".bbp"): # Filename in bbp format return read_file_bbp(filename) # Otherwise use hercules format return read_file_her(filename) # end of read_file def read_file_bbp2(filename): """ This function reads a bbp file and returns the timeseries in the format time, n/s, e/w, u/d tuple """ time = np.array([]) ns_comp = np.array([]) ew_comp = np.array([]) ud_comp = np.array([]) try: input_file = open(filename, 'r') for line in input_file: line = line.strip() if line.startswith('#') or line.startswith('%'): # Skip comments continue # Trim in-line comments if line.find('#') > 0: line = line[:line.find('#')] if line.find('%') > 0: line = line[:line.find('%')] # Make them float pieces = line.split() pieces = [float(piece) for piece in pieces] time = np.append(time, pieces[0]) ns_comp = np.append(ns_comp, pieces[1]) ew_comp = np.append(ew_comp, pieces[2]) ud_comp = np.append(ud_comp, pieces[3]) except IOError: print("[ERROR]: error reading bbp file: %s" % (filename)) sys.exit(1) # All done! return time, ns_comp, ew_comp, ud_comp # end of read_file_bbp2 def read_file_bbp(filename): """ This function reads timeseries data from a set of BBP files """ # Get filenames for displacement, velocity and acceleration bbp files work_dir = os.path.dirname(filename) base_file = os.path.basename(filename) base_tokens = base_file.split('.')[0:-2] if not base_tokens: print("[ERROR]: Invalid BBP filename: %s" % (filename)) sys.exit(1) dis_tokens = list(base_tokens) vel_tokens = list(base_tokens) acc_tokens = list(base_tokens) dis_tokens.append('dis') vel_tokens.append('vel') acc_tokens.append('acc') dis_tokens.append('bbp') vel_tokens.append('bbp') acc_tokens.append('bbp') dis_file = os.path.join(work_dir, '.'.join(dis_tokens)) vel_file = os.path.join(work_dir, '.'.join(vel_tokens)) acc_file = os.path.join(work_dir, '.'.join(acc_tokens)) # Read 3 bbp files [time, dis_ns, dis_ew, dis_up] = read_file_bbp2(dis_file) [_, vel_ns, vel_ew, vel_up] = read_file_bbp2(vel_file) [_, acc_ns, acc_ew, acc_up] = read_file_bbp2(acc_file) samples = dis_ns.size delta_t = time[1] # samples, dt, data, acceleration, velocity, displacement psignal_ns = seism_psignal(samples, delta_t, np.c_[dis_ns, vel_ns, acc_ns], 'c', acc_ns, vel_ns, dis_ns) psignal_ew = seism_psignal(samples, delta_t, np.c_[dis_ew, vel_ew, acc_ew], 'c', acc_ew, vel_ew, dis_ew) psignal_up = seism_psignal(samples, delta_t, np.c_[dis_up, vel_up, acc_up], 'c', acc_up, vel_up, dis_up) station = [psignal_ns, psignal_ew, psignal_up] return station # end of read_file_bbp def read_file_her(filename): """ The function is to read 10-column .her files. Return a list of psignals for each orientation. """ time, dis_ns, dis_ew, dis_up = [np.array([], float) for _ in xrange(4)] vel_ns, vel_ew, vel_up = [np.array([], float) for _ in xrange(3)] acc_ns, acc_ew, acc_up = [np.array([], float) for _ in xrange(3)] try: (time, dis_ns, dis_ew, dis_up, vel_ns, vel_ew, vel_up, acc_ns, acc_ew, acc_up) = np.loadtxt(filename, comments='#', unpack=True) except IOError: print("[ERROR]: error loading her file.") return False samples = dis_ns.size delta_t = time[1] # samples, dt, data, acceleration, velocity, displacement psignal_ns = seism_psignal(samples, delta_t, np.c_[dis_ns, vel_ns, acc_ns], 'c', acc_ns, vel_ns, dis_ns) psignal_ew = seism_psignal(samples, delta_t, np.c_[dis_ew, vel_ew, acc_ew], 'c', acc_ew, vel_ew, dis_ew) psignal_up = seism_psignal(samples, delta_t, np.c_[dis_up, vel_up, acc_up], 'c', acc_up, vel_up, dis_up) station = [psignal_ns, psignal_ew, psignal_up] return station # end of read_file_her def read_unit_bbp(filename): """ Get the units from the file's header Returns either "m" or "cm" """ units = None try: input_file = open(filename, 'r') for line in input_file: if line.find("units=") > 0: units = line.split()[2] break input_file.close() except IOError: print("[ERROR]: No such file.") sys.exit(-1) # Make sure we got something if units is None: print("[ERROR]: Cannot find units in bbp file!") sys.exit(-1) # Figure out if we have meters or centimeters if units == "cm" or units == "cm/s" or units == "cm/s^2": return "cm" elif units == "m" or units == "m/s" or units == "m/s^2": return "m" # Invalid units in this file print("[ERROR]: Cannot parse units in bbp file!") sys.exit(-1) # end of read_unit_bbp def read_stamp(filename): """ Get the time stamp from file's header """ if filename.endswith(".bbp"): # File in bbp format return read_stamp_bbp(filename) # Otherwise use hercules format return read_stamp_her(filename) # end of read_stamp def read_stamp_bbp(filename): """ Get the time stamp from the bbp file's header """ try: input_file = open(filename, 'r') for line in input_file: if line.find("time=") > 0: stamp = line.split()[2].split(',')[-1].split(':') break input_file.close() except IOError: print("[ERROR]: No such file.") return [] # Converting time stamps to floats stamp = [float(i) for i in stamp] return stamp # end of read_stamp_bbp def read_stamp_her(filename): """ Get the time stamp from the her file's header """ try: with open(filename) as input_file: try: header = input_file.readline().split() stamp = header[4].split(',')[-1].split(':') input_file.close() except IndexError: print("[ERROR]: missing time stamp.") return [] except IOError: print("[ERROR]: No such file.") return [] # converting time stamps to floats for i in range(0, len(stamp)): stamp[i] = float(stamp[i]) return stamp # end of read_stamp_her # ================================ WRITING ================================== def print_her(filename, station): # filename = 'processed-' + filename.split('/')[-1] try: out_f = open(filename, 'w') except IOError as e: print(e) dis_ns = station[0].displ.tolist() vel_ns = station[0].velo.tolist() acc_ns = station[0].accel.tolist() dis_ew = station[1].displ.tolist() vel_ew = station[1].velo.tolist() acc_ew = station[1].accel.tolist() dis_up = station[2].displ.tolist() vel_up = station[2].velo.tolist() acc_up = station[2].accel.tolist() # get a list of time incremented by dt time = [0.000] samples = station[0].samples dt = station[0].dt tmp = samples while tmp > 1: time.append(time[len(time)-1] + dt) tmp -= 1 out_f.write('# missing header \n') descriptor = '{:>12}' + ' {:>12}'*9 + '\n' out_f.write(descriptor.format("# time", "dis_ns", "dis_ew", "dis_up", "vel_ns", "vel_ew", "vel_up", "acc_ns", "acc_ew", "acc_up")) # header descriptor = '{:>12.3f}' + ' {:>12.7f}'*9 + '\n' for c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 in zip(time, dis_ns, dis_ew, dis_up, vel_ns, vel_ew, vel_up, acc_ns, acc_ew, acc_up): out_f.write(descriptor.format(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9)) out_f.close() # end of print_her def print_bbp(input_file, output_file, station): """ This function generates processed .bbp files for each of velocity/acceleration/displacement and copies the header of the input bbp file """ output_dir = os.path.dirname(output_file) output_basename = os.path.basename(output_file) # Prepare data for output acc_ns = station[0].accel.tolist() vel_ns = station[0].velo.tolist() dis_ns = station[0].displ.tolist() acc_ew = station[1].accel.tolist() vel_ew = station[1].velo.tolist() dis_ew = station[1].displ.tolist() acc_up = station[2].accel.tolist() vel_up = station[2].velo.tolist() dis_up = station[2].displ.tolist() # Start with time = 0.0 time = [0.000] samples = station[0].samples while samples > 1: time.append(time[len(time)-1] + station[0].dt) samples -= 1 # Prepare to output out_data = [['dis', dis_ns, dis_ew, dis_up, 'displacement', 'cm'], ['vel', vel_ns, vel_ew, vel_up, 'velocity', 'cm/s'], ['acc', acc_ns, acc_ew, acc_up, 'acceleration', 'cm/s^2']] for data in out_data: if not output_basename.endswith('.bbp'): # Remove extension bbp_output_basename = os.path.splitext(output_basename)[0] bbp_output_filename = os.path.join(output_dir, "%s.%s.bbp" % (bbp_output_basename, data[0])) output_header = ["# Station: NoName", "# time= 00/00/00,00:00:00.00 UTC", "# lon= 0.00", "# lat= 0.00", "# units= %s" % (data[5]), "#", "# Data fields are TAB-separated", "# Column 1: Time (s)", "# Column 2: N/S component ground " "%s (+ is 000)" % (data[4]), "# Column 3: E/W component ground " "%s (+ is 090)" % (data[4]), "# Column 4: U/D component ground " "%s (+ is upward)" % (data[4]), "#"] else: # Read header of input file input_dirname = os.path.dirname(input_file) input_basename = os.path.basename(input_file) pieces = input_basename.split('.') pieces = pieces[0:-2] bbp_input_file = os.path.join(input_dirname, "%s.%s.bbp" % ('.'.join(pieces), data[0])) input_header = [] in_fp = open(bbp_input_file, 'r') for line in in_fp: line = line.strip() if line.startswith("#"): input_header.append(line) in_fp.close() # Compose new header output_header = [] for item in input_header: if item.find("units=") > 0: output_header.append("# units= %s" % (data[5])) else: output_header.append(item) pieces = output_basename.split('.') pieces = pieces[0:-2] bbp_output_filename = os.path.join(output_dir, "%s.%s.bbp" % ('.'.join(pieces), data[0])) # Write output file try: out_fp = open(bbp_output_filename, 'w') except IOError as e: print(e) continue # Write header for item in output_header: out_fp.write("%s\n" % (item)) # Write timeseries for val_time, val_ns, val_ew, val_ud in zip(time, data[1], data[2], data[3]): out_fp.write("%5.7f %5.9e %5.9e %5.9e\n" % (val_time, val_ns, val_ew, val_ud)) # All done, close file out_fp.close() print("*Writing file: %s " % (bbp_output_filename)) # end of print_bbp
[ "fsilva@usc.edu" ]
fsilva@usc.edu
80559b83f3e770ba73cc305ec047ba029df26fd9
a7906a7fa7b8570c1abe4861e846f12aeac82035
/Automation/find_difference.py
90c020db79b176887dffcc0fd3dce4ab851ef768
[]
no_license
Paradiddle131/Scrabble-Solver
42a4e6f1539e9e7d497beba2af94c89d63f6ca34
e96fe2512d4e5108fd6934c3d6ff72398aac5c02
refs/heads/master
2020-06-26T03:45:29.225361
2019-08-24T20:42:16
2019-08-24T20:42:16
199,517,931
1
1
null
null
null
null
UTF-8
Python
false
false
1,266
py
from skimage.measure import compare_ssim import imutils import cv2 def compare(path_img1, path_img2): imageA = cv2.imread("path_img1")[:380, :] imageB = cv2.imread("path_img2")[:380, :] grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY) grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY) (score, diff) = compare_ssim(grayA, grayB, full=True) diff = (diff * 255).astype("uint8") thresh = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1] cnts = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) cnts = imutils.grab_contours(cnts) cnts = sorted(cnts, key=cv2.contourArea, reverse=True)[:10] for c in cnts: (x, y, w, h) = cv2.boundingRect(c) cv2.rectangle(imageA, (x, y), (x + w, y + h), (0, 0, 255), 2) cv2.rectangle(imageB, (x, y), (x + w, y + h), (0, 0, 255), 2) # print(x, y, w, h, end="\n") # cv2.imshow("bounding rectangle A", imageA[y:y+h,x:x+w]) # cv2.imshow("bounding rectangle B", grayB[y:y+h,x:x+w]) # cv2.waitKey(0) cv2.imshow("Original", imageA) cv2.imshow("Modified", imageB) cv2.imshow("Diff", diff) cv2.imshow("Thresh", thresh) cv2.waitKey(0)
[ "ebhan96@hotmail.com" ]
ebhan96@hotmail.com
44568cce554fff4f7e1cdfaf4d92ab3481056d71
2dcfe2b1892afc55927fe822fe2bb179bf277376
/test/com/dvsnier/git/branch/test_branch.py
4cd953eddf0ad114c20933cab7295c545f5e7727
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Alinvor/Python-DeMo
cc0aff609a6e1afbe09121618d5cfe188239a806
e7b5e56eac86c03460f83a3a682cc9ad351f74fc
refs/heads/deploy
2022-03-15T08:34:15.261500
2021-07-08T06:14:36
2021-07-08T06:14:36
224,807,399
1
0
MIT
2022-02-14T06:49:21
2019-11-29T08:12:00
Python
UTF-8
Python
false
false
1,603
py
# -*- coding:utf-8 -*- from com.dvsnier.git.branch.branch import Branch import unittest class Test_Branch(unittest.TestCase): ''' the test branch ''' @classmethod def setUpClass(cls): print("...the set up...") print def setUp(self): return super(Test_Branch, self).setUp() def test_get_branch(self): branch = Branch() branch_name = branch.get_branch() # print(branch_name) self.assertIsNotNone(branch_name, 'test_get_branch is error.') print "the test get_branch is succeed." def test_branch_to_file_and_commit_list(self): branch = Branch() branch_commit_list = branch.branch_to_file_and_commit_list() # print(branch_commit_list) self.assertIsNotNone(branch_commit_list, 'test_branch_to_file_and_commit_list is error.') print "the test branch_to_file_and_commit_list is succeed." def test_branch_to_file_and_commit_list_with_more(self): branch = Branch() branch_commit_list_more = branch.branch_to_file_and_commit_list_with_more( ) # print(branch_commit_list_more) self.assertIsNotNone( branch_commit_list_more, 'test_branch_to_file_and_commit_list_with_more is error.') print "the test branch_to_file_and_commit_list_with_more is succeed." def tearDown(self): return super(Test_Branch, self).tearDown() @classmethod def tearDownClass(cls): print print("...the tear down...") if __name__ == '__main__': unittest.main()
[ "zhenwei-li@qq.com" ]
zhenwei-li@qq.com
5f0f95f556f85312cf7976e4fe23d559d665d9d3
c9299c10a175a8d925839adc58bbc7f86d4650f5
/tracker/migrations/0008_auto_20200923_0928.py
e574d9eee0257ff0d9fb4b17dec64974990148d2
[]
no_license
bartwroblewski/strava_gear_wear_tracker
e2e082a04cfdd226b24f59d64f1a0651224eba68
e12e3cd559d096668525ce2e0bd6047d3d508c4c
refs/heads/master
2023-09-04T13:58:42.909991
2023-08-20T18:52:06
2023-08-20T18:52:06
296,386,864
0
0
null
null
null
null
UTF-8
Python
false
false
355
py
# Generated by Django 3.0.9 on 2020-09-23 07:28 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('tracker', '0007_gear_athlete'), ] operations = [ migrations.RenameField( model_name='athlete', old_name='ref', new_name='ref_id', ), ]
[ "barti.wroblewski@gmail.com" ]
barti.wroblewski@gmail.com
49bca84529a5aaba8437382334746031792f4317
0b824e5b74927043cb4eb1cc6cbd5ce272509500
/eventkit_cloud/management/commands/clear_rabbitmq.py
6798273af8c4bd32e4bbf4b21db238189b797a09
[]
no_license
sandhillgeo/eventkit-cloud
dcfe69fc02de7eef49981568ae0354cd74188dc2
5b57506073f36e883e1b8c01d823b1bb40dc2f99
refs/heads/master
2023-08-31T16:07:51.081199
2023-03-22T18:20:19
2023-03-22T18:20:19
138,497,211
1
0
null
null
null
null
UTF-8
Python
false
false
773
py
from django.conf import settings from django.core.management import BaseCommand from eventkit_cloud.tasks.helpers import delete_rabbit_objects class Command(BaseCommand): help = "Deletes the queues (and optionally exchanges) in rabbitmq." def add_arguments(self, parser): parser.add_argument("--force", action="store_true", help="Force delete the queues.") parser.add_argument("--all", action="store_true", help="Deletes queues and exchanges.") def handle(self, *args, **options): rabbit_classes = ["queues"] if options["all"]: rabbit_classes = ["queues", "exchanges"] api_url = settings.CELERY_BROKER_API_URL delete_rabbit_objects(api_url, rabbit_classes=rabbit_classes, force=options["force"])
[ "noreply@github.com" ]
sandhillgeo.noreply@github.com
8a08164dec033ea229b3f614f80e9bd29061445f
fedcfb2a7dfdffdc87979f46c8df9605897b7546
/request.py
189aff2de29177aa7c1b948e61854a8d705b433d
[]
no_license
omsmruti/rent-predicton
de82484c9e20dae9be2c281eac411698e6134c51
36eadd4f4eba19f7a55a038effb88241d22a4b74
refs/heads/main
2023-08-01T06:16:03.284652
2021-09-26T10:47:38
2021-09-26T10:47:38
331,343,526
0
0
null
null
null
null
UTF-8
Python
false
false
160
py
import requests url = 'http://localhost:5000/predict_api' r = requests.post(url,json={'experience':2, 'test_score':9, 'interview_score':6}) print(r.json())
[ "noreply@github.com" ]
omsmruti.noreply@github.com
a0494aea564e47411668a3233912483a5cc2c136
9eb74a86c49ad1fc8808c4162c92684efa177007
/Predict_packge/ex.py
bcbe564e4ea4f3ce5d9153670187b331c196502f
[]
no_license
sih2020admin/RK305_GuardianOfSecurity
6fd4fe317e4ba79aaf771fefe4f958844c551ec6
c533e15cad7dc29de4016a935e80b7aa052ebfe8
refs/heads/master
2022-11-28T02:22:26.993803
2020-08-03T08:45:51
2020-08-03T08:45:51
null
0
0
null
null
null
null
UTF-8
Python
false
false
90
py
from predictor import predictor while True: print(predictor(input('enter url: ')))
[ "noreply@github.com" ]
sih2020admin.noreply@github.com
6587bab7164322da3cff51a756b2605e699c2dc9
87abf2d776ae18d727960e111233f3c08ac334e2
/Calculator.py
5cf777cab2a235cda9cd9723a428e3380361de88
[]
no_license
Abusiddique/learning_python
b3d3ee391098960bff63c68ed7421a8b4af63c1a
fe5ddf915c33424454dc1664fba7b747481154d0
refs/heads/master
2020-09-08T15:13:14.468538
2019-11-13T20:41:02
2019-11-13T20:41:02
221,169,394
0
0
null
null
null
null
UTF-8
Python
false
false
1,654
py
""" Script to perform few operations like Addition, subtraction, multiplication, division """ import sys from functools import reduce def get_input(): """Get inputs from the user""" list_of_numbers = input("Enter the numbers") list_of_numbers = list_of_numbers.split(',') list_of_numbers = [float(number) for number in list_of_numbers] if len(list_of_numbers) < 2: print('Please enter atleast 2 numbers to proceed with calculations') sys.exit(1) return list_of_numbers def add(list_of_numbers): sum_of_numbers = sum(list_of_numbers) print("Sum of numbers", sum_of_numbers) def sub(list_of_numbers): subtraction_of_numbers = list_of_numbers[0] - sum(list_of_numbers[1:]) print("Subraction of two number", subtraction_of_numbers) def mul(list_of_numbers): product_of_numbers = reduce((lambda x, y: x * y), list_of_numbers) print("Multiplication of two numbers", product_of_numbers) def div(list_of_numbers): division_of_numbers = reduce((lambda x, y: x /y), list_of_numbers) print("Division of two numbers", division_of_numbers) def validate_option(list_of_numbers): option = int(input("Enter the option to calculate \n1.Add \n2.Subtrate \n3.Multiplication\n4.Division\n5.Exit\n ")) if option ==1: add(list_of_numbers) elif option ==2: sub(list_of_numbers) elif option ==3: mul(list_of_numbers) elif option ==4: div(list_of_numbers) else: sys.exit(0) continue_option=input("Do you want to Continue y/n\n") if continue_option=='y': validate_option(list_of_numbers) else: sys.exit(0) list_of_numbers = get_input() validate_option(list_of_numbers)
[ "noreply@github.com" ]
Abusiddique.noreply@github.com
6debb1e5d989e8158ec1b32b631755d2bfbd2e8d
dc54551511ef3727e68c3fb2816885282c608fb3
/blog/migrations/0001_initial.py
deff4b6fb56dc7ef5c050abf6f0ee6a522791f88
[]
no_license
namsa87/my-first-blog
8dbbe937feb2dde66ac284b4fd71fa060aa05e94
ed8e3e3443a2da870e75319de2dd691c0d58874b
refs/heads/master
2020-04-11T11:05:11.748421
2018-12-14T05:38:46
2018-12-14T05:38:46
161,736,848
0
0
null
null
null
null
UTF-8
Python
false
false
986
py
# Generated by Django 2.1.4 on 2018-12-12 08:04 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Post', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=200)), ('text', models.TextField()), ('created_date', models.DateTimeField(default=django.utils.timezone.now)), ('published_date', models.DateTimeField(blank=True, null=True)), ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), ]
[ "namsa87@naver.com" ]
namsa87@naver.com
9b2d29f4fff76ec86524f13f2e06d002aa05c6f5
81e146400d2f20e4a074c6a6d6959c869db02af5
/paint.py
bb3d08f563f948bb8ce1ff38c0ccc4a591699031
[]
no_license
Iljanikolaev/-Classifier-of-handwritten-numbers
60fedc25d2b11e72045f9254074abd44ae361b8e
95bebbfd561bb50301bf742306d0be1a5489f46f
refs/heads/master
2023-01-09T02:13:31.955638
2020-11-12T19:42:20
2020-11-12T19:42:20
312,378,262
1
0
null
null
null
null
UTF-8
Python
false
false
5,297
py
import pygame import sys from nn_pred import net_predict, retrain class Paint(): """Класс для рисования""" def __init__(self, screen, ai_settings, infob): '''Инициализирует атрибуты Paint''' self.screen = screen self.ai_settings = ai_settings self.infob = infob #Создание доски для рисования self.blackboard = pygame.Surface((ai_settings.blackboard_width, ai_settings.blackboard_height)) self.blackboard.fill(ai_settings.blackboard_color) #Флаг рисования self.draw_on = False def check_event(self): '''Обрабатывает нажатия отпускания клавиш и события мыши''' for event in pygame.event.get(): if event.type == pygame.QUIT: #Закрытие программы при нажатиии крестика sys.exit() elif event.type == pygame.MOUSEBUTTONDOWN: #Рисование при нажатии клавиши мыши self.draw_on = True pygame.draw.circle(self.blackboard, self.ai_settings.crayon_color, pygame.mouse.get_pos(),self.ai_settings.crayon_width) if self.infob.wrong_predict == True: #В случае ошибки классификатора(нажатии клавиши TAB) - проверка нажатия кнопки с верным классом self.check_button(pygame.mouse.get_pos()) elif event.type == pygame.MOUSEBUTTONUP: #Рисование прекращается при отпускании кнопки мыши self.draw_on = False elif event.type == pygame.MOUSEMOTION: #Рисование при перемещении курсора с нажатой кнопкой мыши if self.draw_on: self.draw() #Сохраняем координаты текущего положения курсора self.start_pos = pygame.mouse.get_pos() elif event.type == pygame.KEYDOWN: if event.key == pygame.K_SPACE: self.clear_bb() elif event.key == pygame.K_RETURN: '''K_RETURN - клавиша Enter''' self.predict() elif event.key == pygame.K_TAB: '''Пользователь, в случае ошибки классификатора, может обучить сеть на собственном примере''' self.infob.wrong_predict =True def draw(self): '''Функция рисования''' #Сохраняем координаты последнего положения курсора и считаем разницу с начальным положением last_pos = pygame.mouse.get_pos() dx = last_pos[0] - self.start_pos[0] dy= last_pos[1] - self.start_pos[1] #Находим по какой оси разница координта положений максимальна distance = max(abs(dx), abs(dy)) #Разбиваем траекторию от нач. до кон. положения курсора мыши на части for i in range(distance): x = int(self.start_pos[0] + float(i)/distance*dx) y = int(self.start_pos[1] + float(i)/distance*dy) #Рисуем круг pygame.draw.circle(self.blackboard, self.ai_settings.crayon_color, [x, y],self.ai_settings.crayon_width) def predict(self): #Очистка информационного табла self.screen.fill(self.ai_settings.bg_color) self.infob.wrong_predict = False #сохранение рисунка pygame.image.save(self.blackboard, 'num_img.png') #получение предсказанного класса и вероятностей отнесения к классам prediction, probability = net_predict('./num_img.png', self.ai_settings.blackboard_color) #создание объектов надписей предсказания и вероятностей prediction = str(int(prediction)) probability = [round(i, 3) for i in probability[0].cpu().tolist()] self.infob.prob_obj(prediction, probability) def clear_bb(self): #Очищаем доску для рисования, забываем предсказанное значение, убираем режим неверного предсказания self.infob.pred_num = None self.infob.wrong_predict = False self.blackboard.fill(self.ai_settings.blackboard_color) def check_button(self, pos): '''Функция проверяет была ли нажата кнопка с верным классом(цифрой) и обучает сеть на новом примере''' for i in range(10): #Проверка нажатия на цифру(верный класс) if self.infob.button[i][1].collidepoint(pos[0], pos[1]): #Обводка красным выбранной цифры и обновление экрана pygame.draw.rect(self.screen, (255, 0, 100), self.infob.button[i][1], 1) pygame.display.flip() #Изображение и правильный ответ подаются в сеть для обучения retrain('./num_img.png', i) #Выключаем режим "неверного предсказания" self.infob.wrong_predict = False def blit_bb(self): #Выводит доску для рисования на экран self.screen.blit(self.blackboard, (0, 0))
[ "Iljanikolaev@users.noreply.github.com" ]
Iljanikolaev@users.noreply.github.com
457e16e30d9d18d0a338af9cd2170263202442fe
c41dae9f23a4c01aa8997e77eda3a232ff581b93
/dendropy/distributions.py
d6d185b410ad332543228cd86276b567735f3ea7
[]
no_license
dtneves/SuperFine
56ee0dc00490eac50b8435612f39332a813dc2d1
40979405a43703506b84925b26bb9d2c7c9c021b
refs/heads/master
2021-01-11T04:19:27.253474
2016-11-19T15:10:22
2016-11-19T15:10:22
71,179,608
7
1
null
null
null
null
UTF-8
Python
false
false
7,919
py
#! /usr/bin/env python ############################################################################ ## distribtions.py ## ## Part of the DendroPy library for phylogenetic computing. ## ## Copyright 2008 Jeet Sukumaran and Mark T. Holder. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License along ## with this program. If not, see <http://www.gnu.org/licenses/>. ## ############################################################################ """ Methods random-variates and probabilities based on various parametric distributions. """ import math from dendropy import GLOBAL_RNG def factorial(num): """factorial(n): return the factorial of the integer num. factorial(0) = 1 factorial(n) with n<0 is -factorial(abs(n)) """ result = 1 for i in xrange(1, abs(num)+1): result *= i return result def binomial_coefficient(population, sample): "Returns `population` choose `sample`." s = max(sample, population - sample) assert s <= population assert population > -1 if s == population: return 1 numerator = 1 denominator = 1 for i in xrange(s+1, population + 1): numerator *= i denominator *= (i - s) return numerator/denominator def exp_pdf(value, rate): """ Returns the probability density for an exponential distribution with an intensity of rate, evaluated at value. """ return float(rate) * math.exp(-1.0 * rate * value) def poisson_rv(rate, rng=None): """ Returns a random number from a Poisson distribution with rate of `rate` (mean of 1/rate). """ if rng is None: rng = GLOBAL_RNG MAX_EXPECTATION = 64.0 # larger than this and we have underflow issues if rate > MAX_EXPECTATION: r = rate/2.0 return poisson_rv(r) + poisson_rv(r) L = math.exp(-1.0 * rate) p = 1.0 k = 0.0 while p >= L: k = k + 1.0 u = rng.random() p = p * u return int(k - 1.0) def num_poisson_events(rate, period, rng=None): """ Returns the number of events that have occurred in a Poisson process of `rate` over `period`. """ if rng is None: rng = GLOBAL_RNG events = 0 while period > 0: time_to_next = rng.expovariate(1.0/rate) if time_to_next <= period: events = events + 1 period = period - time_to_next return events def sample_multinomial(probs, rng=None): """Returns the index of the probability bin in `probs`. `probs` is assumed to sum to 1.0 (all rounding error contributes to the last bin). """ if rng is None: rng = GLOBAL_RNG u = rng.random() for n, i in enumerate(probs): u -= i if u < 0.0: return n return len(probs) - 1 def lengthed_choice(seq, lengths, rng=None): """ Selects an element out of seq, with probabilities of each element given by the list `lengths` (which must be at least as long as the length of `seq` - 1). """ if rng is None: rng = GLOBAL_RNG if lengths is None: lengths = [1.0/len(seq) for count in range(len(seq))] else: lengths = list(lengths) if len(lengths) < len(seq) - 1: raise Exception("Insufficient number of lengths specified") if len(lengths) == len(seq) - 1: lengths.append(1 - sum(lengths)) prob_thresholds = [] previous_break = 0.0 for index in range(len(lengths)): prob_thresholds.append(previous_break + lengths[index]) previous_break = prob_thresholds[index] pick = rng.random() for index, prob_threshold in enumerate(prob_thresholds): if pick <= prob_threshold: return seq[index] return seq[-1] def chisqprob(chisq, df): """ Returns the probability value associated with the provided chi-square value and df. Adapted from chisq.c in Gary Perlman's |Stat. """ BIG = 20.0 def ex(x): BIG = 20.0 if x < -BIG: return 0.0 else: return math.exp(x) if chisq <=0 or df < 1: return 1.0 a = 0.5 * chisq if df%2 == 0: even = 1 else: even = 0 if df > 1: y = ex(-a) if even: s = y else: s = 2.0 * zprob(-math.sqrt(chisq)) if (df > 2): chisq = 0.5 * (df - 1.0) if even: z = 1.0 else: z = 0.5 if a > BIG: if even: e = 0.0 else: e = math.log(math.sqrt(math.pi)) c = math.log(a) while (z <= chisq): e = math.log(z) + e s = s + ex(c*z-a-e) z = z + 1.0 return s else: if even: e = 1.0 else: e = 1.0 / math.sqrt(math.pi) / math.sqrt(a) c = 0.0 while (z <= chisq): e = e * (a/float(z)) c = c + e z = z + 1.0 return (c*y+s) else: return s def zprob(z): """ Returns the probability value associated with the provided z-score. Adapted from z.c in Gary Perlman's |Stat. """ Z_MAX = 6.0 # maximum meaningful z-value if z == 0.0: x = 0.0 else: y = 0.5 * math.fabs(z) if y >= (Z_MAX*0.5): x = 1.0 elif (y < 1.0): w = y*y x = ((((((((0.000124818987 * w -0.001075204047) * w +0.005198775019) * w -0.019198292004) * w +0.059054035642) * w -0.151968751364) * w +0.319152932694) * w -0.531923007300) * w +0.797884560593) * y * 2.0 else: y = y - 2.0 x = (((((((((((((-0.000045255659 * y +0.000152529290) * y -0.000019538132) * y -0.000676904986) * y +0.001390604284) * y -0.000794620820) * y -0.002034254874) * y +0.006549791214) * y -0.010557625006) * y +0.011630447319) * y -0.009279453341) * y +0.005353579108) * y -0.002141268741) * y +0.000535310849) * y +0.999936657524 if z > 0.0: prob = ((x+1.0)*0.5) else: prob = ((1.0-x)*0.5) return prob def geometric_rv(p, rng=None): """ Geometric distribution per Devroye, Luc. _Non-Uniform Random Variate Generation_, 1986, p 500. http://cg.scs.carleton.ca/~luc/rnbookindex.html """ if rng is None: rng = GLOBAL_RNG # p should be in (0.0, 1.0]. if p <= 0.0 or p > 1.0: raise ValueError("p = %s: p must be in the interval (0.0, 1.0]" % p) elif p == 1.0: # If p is exactly 1.0, then the only possible generated value is 1. # Recognizing this case early means that we can avoid a log(0.0) later. # The exact floating point comparison should be fine. log(eps) works just # dandy. return 1 # random() returns a number in [0, 1). The log() function does not # like 0. U = 1.0 - rng.random() # Find the corresponding geometric variate by inverting the uniform variate. G = int(math.ceil(math.log(U) / math.log(1.0 - p))) return G
[ "dneves@di.uminho.pt" ]
dneves@di.uminho.pt
0013e4a03b6caa7288d822b12bf24df9573c2bc8
88a7914816e506f8e355b820db742a0817551ff5
/flask/SCIM/tests/users/UpdateUserTest.py
1323ec2c771d480ec55f15801cbc35966f7613b2
[]
no_license
OktaAlliance/SCIM-Connectors
b49c53e275affc075ded81ce70fa9da1cbe4b4c9
1582d2cd23207642370032ff901016fb3078a6f2
refs/heads/master
2023-02-06T20:19:07.249598
2023-01-25T19:04:59
2023-01-25T19:04:59
252,565,297
0
2
null
2023-01-25T19:05:00
2020-04-02T21:13:00
Python
UTF-8
Python
false
false
2,863
py
from logging import DEBUG from unittest import TestCase, TestSuite, TextTestRunner from SCIM.helpers import set_up_logger from SCIM.tests.common import TestHelper logger = set_up_logger(__name__, level=DEBUG) test_helper = TestHelper('/Users', logger) logger.info("These tests use the sample data in SCIM/examples/users.csv and expect a flushed db") class UpdateUserTests(TestCase): def test_activate_user(self) -> None: response = test_helper.put_file_contents('../data/activateUser.json') if response.status_code != 200: logger.error('Response from Connector: %s' % str(response.json())) self.assertEqual(response.status_code, 200) if not response.json()['active']: logger.error('Response from Connector: %s' % str(response.json())) self.assertTrue(response.json()['active']) logger.info('User status returned as active') def test_profile_update(self) -> None: response = test_helper.put_file_contents('../data/pushProfileUpdate.json') if response.status_code != 200: logger.error('Response from Connector: %s' % str(response.json())) self.assertEqual(response.status_code, 200) if response.json()['name']['givenName'] != 'Dana1' or response.json()['name']['familyName'] != 'Ruiz1': logger.error('Response from Connector: %s' % str(response.json())) self.assertEqual(response.json()['name']['givenName'], 'Dana1') self.assertEqual(response.json()['name']['familyName'], 'Ruiz1') logger.info('User attributes updated successfully') def test_password_update(self) -> None: response = test_helper.put_file_contents('../data/pushPasswordUpdate.json') if response.status_code != 200: logger.error('Response from Connector: %s' % str(response.json())) self.assertEqual(response.status_code, 200) logger.info('User password updated successfully') def test_deactivate_user(self) -> None: response = test_helper.put_file_contents('../data/deactivateUser.json') if response.status_code != 200: logger.error('Response from Connector: %s' % str(response.json())) self.assertEqual(response.status_code, 200) if response.json()['active']: logger.error('Response from Connector: %s' % str(response.json())) self.assertFalse(response.json()['active']) logger.info('User status returned as deactivated') def suite() -> TestSuite: suite = TestSuite() suite.addTest(UpdateUserTests('test_activate_user')) suite.addTest(UpdateUserTests('test_profile_update')) suite.addTest(UpdateUserTests('test_password_update')) suite.addTest(UpdateUserTests('test_deactivate_user')) return suite if __name__ == '__main__': runner = TextTestRunner() runner.run(suite())
[ "michaallen@deloitte.com" ]
michaallen@deloitte.com
e48e33dd8d2b1aae89f00510dddfd5da027df19b
b53f736c173776cc41617334dd4b133e1434a67a
/feedManager.py
871af0192923985a818d6f56db282ad07e79dcdb
[]
no_license
aRivieraDream/rss
90f3d96065d52350dfae18211ff00c8090934245
6940f9552dda11765d9df122c16ae49e036fbdf9
refs/heads/master
2016-09-14T01:24:29.637229
2016-04-30T19:59:59
2016-04-30T19:59:59
57,459,544
0
0
null
null
null
null
UTF-8
Python
false
false
17
py
#feedManager.py
[ "808pierce@gmail.com" ]
808pierce@gmail.com
9262d61d0f5457035294c6c1e95ee65fe5cdd72d
3ed5bc4db4387d41524b33cd4130316ec861ccfd
/test_case/login.py
af3b9ca4923ddc4a8e6737b895e64bdfe4ae7fb8
[]
no_license
wujide/testcase
7cc02f950e29e8b1f9ea6dfdea46971fc28d4f31
4ad2a843bb12236eee7950aff7963afbe480539e
refs/heads/master
2021-09-18T07:48:50.639773
2018-07-11T09:28:24
2018-07-11T09:28:24
105,023,414
0
0
null
null
null
null
UTF-8
Python
false
false
537
py
# coding=utf-8 # __author__='wujide' from flask import json from interface_test_class import InterfaceTest def login(): # 初始化login 实例 login_obj = InterfaceTest(r"../info/login_para.txt") # 获取参数 values = login_obj.data_get() # <type 'dict'> response = login_obj.data_post(values) data = response.read() # <type 'str'> file_save = r'../data/login' login_obj.data_save(file_save, data) login_obj.pass_or_fail(file_save) return data if __name__ == "__main__": print login()
[ "wujide2015@126.com" ]
wujide2015@126.com
5709d2a81a6cc6dd23607c5183a47eaf1be2e861
38fda0c667f1a58aab1aac8473614c240e8f9caa
/day_02/timing_function.py
9f02e685228024f310dabfb84f8429caabe77017
[]
no_license
KeithC113/python_course
a32218d4e0beadd153af795e9326d1e304913953
6213e08adc9e501ac62910b7c5e852a8eca43332
refs/heads/master
2022-12-24T06:24:44.060083
2020-09-29T12:56:44
2020-09-29T12:56:44
299,559,132
0
0
null
null
null
null
UTF-8
Python
false
false
268
py
import time def timing_function(callback): def wrapper(): time1 = time.time() # before function call callback() time2 = time.time() # after function call return f"here is how long it took {time2 - time1} secs" return wrapper
[ "campbell_ka@yahoo.co.uk" ]
campbell_ka@yahoo.co.uk
ffb0d0bca4435856f8d0d4ba9831a9b8078ce14c
7745d38989396297583ec1012844e3e1bc2ac31f
/HW06/kmeans.py
cf9b9b2c2fed1b23f7bd2b9ff443ccda6d37bcf0
[]
no_license
yan-roo/NCTU-ML-class
94b5db041bef1303669466b48b4df1e6b411abe7
abf0a4a88d692476e90789f477cf600d4656e9e3
refs/heads/master
2022-11-07T23:37:43.376395
2020-06-30T05:44:09
2020-06-30T05:44:09
255,879,423
0
0
null
2020-04-15T10:13:31
2020-04-15T10:13:30
null
UTF-8
Python
false
false
2,823
py
import numpy as np from util import * EPS=1e-9 def initial_mean(X,k,initType): ''' @param X: (#datapoint,#features) ndarray @param k: #clusters @param initType: 'random','pick','k_means_plusplus' @return: (k,#features) ndarray, Kij: cluster i's j-dim value ''' Cluster = np.zeros((k, X.shape[1])) if initType == 'k_means_plusplus': # reference: https://www.letiantian.me/2014-03-15-kmeans-kmeans-plus-plus/ #pick 1 cluster_mean Cluster[0]=X[np.random.randint(low=0,high=X.shape[0],size=1),:] #pick k-1 cluster_mean for c in range(1,k): Dist=np.zeros((len(X),c)) for i in range(len(X)): for j in range(c): Dist[i,j]=np.sqrt(np.sum((X[i]-Cluster[j])**2)) Dist_min=np.min(Dist,axis=1) sum=np.sum(Dist_min)*np.random.rand() for i in range(len(X)): sum-=Dist_min[i] if sum<=0: Cluster[c]=X[i] break elif initType=='pick': random_pick=np.random.randint(low=0,high=X.shape[0],size=k) Cluster=X[random_pick,:] else: # initType=='random' X_mean=np.mean(X,axis=0) X_std=np.std(X,axis=0) for c in range(X.shape[1]): Cluster[:,c]=np.random.normal(X_mean[c],X_std[c],size=k) return Cluster def kmeans(X,k,H,W,initType='random',gifPath='default.gif'): ''' k clusters @param X: (#datapoint,#features) ndarray @param k: # clusters @param H: image H @param W: image W @return: (#datapoint) ndarray, Ci: belonging class of each data point @return: ndarray list ready for gif ''' Mean=initial_mean(X,k,initType) # Classes of each Xi C=np.zeros(len(X),dtype=np.uint8) segments=[] diff=1e9 count=1 while diff>EPS : # E-step for i in range(len(X)): dist=[] for j in range(k): dist.append(np.sqrt(np.sum((X[i]-Mean[j])**2))) C[i]=np.argmin(dist) # M-step New_Mean=np.zeros(Mean.shape) for i in range(k): belong=np.argwhere(C==i).reshape(-1) for j in belong: New_Mean[i]=New_Mean[i]+X[j] if len(belong)>0: New_Mean[i]=New_Mean[i]/len(belong) diff = np.sum((New_Mean - Mean)**2) Mean=New_Mean # visualize segment = visualize(C,k,H,W) segments.append(segment) print('iteration {}'.format(count)) for i in range(k): print('k={}: {}'.format(i + 1, np.count_nonzero(C == i))) print('diff {}'.format(diff)) print('-------------------') cv2.imshow('', segment) cv2.waitKey(1) count+=1 return C,segments
[ "chiha8888@gmail.com" ]
chiha8888@gmail.com
9e518e3261015d01854fb8c1cb3f4890143be3d3
e391234621066b334ec298c524118f9bff401123
/Sesi_Workspace/ml_service/ml_service/urls.py
1ef8ada7ffdc322aa6f6e6eebb18f19ea89a2e3f
[]
no_license
tb1015/Ngoding
a9098ab9767584f0a697b2791f3dd0c86919e534
633a626fdd2a803edb27f7b9b1c12a6b0af20904
refs/heads/main
2023-08-28T14:05:37.123370
2021-10-16T05:48:08
2021-10-16T05:48:08
393,733,240
0
0
null
null
null
null
UTF-8
Python
false
false
861
py
"""ml_service URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from users import views as user_view urlpatterns = [ path('admin/', admin.site.urls), path('register/', user_view.register, name='register'), ]
[ "thoms1015@gmail.com" ]
thoms1015@gmail.com
1771b90fa501b6fb068d128d4546d5d84fb9cbe7
0cf5ade651ad671e6c7b84335b5ae7510df2b5ed
/M3Coursework/gillespieMK11.py
54ec8b4b1a9412f91a243deb022b264d2aec289e
[ "MIT" ]
permissive
GKAW/share
35898170eb22cfa62c8fb94c821bb5fabcebd0b5
2e22ce09deb1986e2e60d0bb53aafd48b1173603
refs/heads/master
2020-09-03T03:30:30.996902
2019-11-21T10:16:12
2019-11-21T10:16:12
219,375,021
0
0
null
null
null
null
UTF-8
Python
false
false
6,680
py
import os import numpy as np import matplotlib.pyplot as plt import scipy.integrate import pandas as pd import math #===INITIALISE=== pltno = 100 # how many gillespie sims do you want? endTime = 1000 # When should Gillespie stop? 25k seconds is ca 20 cycles (24000) k0 = 0.2 #s^-1 k1 = 0.01 #s^-1 m0 = 20 # initial condition t0 = 0 # intitial time mnewmegastore = [] mnewstore = [] mstore = [] mmegastore = [m0] tstore = [] tmegastore = [t0] cycle = 1200 def gil(t0,tmax,y0): # get stuff in the correct data format t0 = float(t0) tmax = float(tmax) y0 = float(y0) t = t0 m = y0 # initialise substance nthCycle = 0 # main loop while t < tmax: newt = t - (nthCycle*cycle) if newt >= cycle: m = np.random.binomial(m,0.5) nthCycle += 1 mnewstore.append(m) #print('new mnewstore:',mnewstore) r0 = k0 r1 = k1*m t0step = np.random.exponential(1/r0) if r1 == 0: t1step = math.inf else: t1step = np.random.exponential(1/r1) if t0step < t1step: m += 1 t += t0step else: m -= 1 t += t1step ''' r0 = k0 r1 = k1*m rtot = r0+r1 p0 = r0/rtot p1 = r1/rtot tstep = np.random.exponential(1/rtot) t += tstep rand0 = np.random.uniform() rand1 = np.random.uniform() if rand0 < p0: m += 1 if rand1 < p1: m -= 1 if m < 0: m = 0 ''' # STORE DATA global mstore global tstore mstore.append(m) tstore.append(t) def megagil(n,t0,tmax,y0): # initialise correct size of store nested list global mmegastore global tmegastore global mnewmegastore mmegastore = [m0] * n tmegastore = [None] * n mnewmegastore = [None] * n for i in range(n): #print("\n \n \n \n \n \n \n \n \n \n \n") #if you want to clear the console in a hacky way. megagilprog = (float(i+1)/float(n))*100 print("Progress: "+str(megagilprog)+"%") if megagilprog > 99.9999: print("Gillespie completed. Now generating stats and plots...") gil(t0,tmax,y0) global mstore mmegastore[i] = mstore mstore=[] global tstore tmegastore[i] = tstore tstore=[] global mnewstore mnewmegastore[i] = mnewstore mnewstore=[] # HOW WOULD AVERAGING WORK? MAYBE NOT THE SAME AMOUNT OF TIME POINTS. ONLY AVERAGE FIRST 100s?? # to average: unfold megagil listed list. create a list per iteration point. average out these points. save stats about those too. timevec = [] linter = [] def stats(llist): global avglist global stduplist global stddownlist global maxlist global minlist avglist=[] stduplist=[] stddownlist=[] maxlist=[] minlist=[] actlist = llist actlist = [list(i) for i in zip(*llist)] # unfold the llist (with * operator), then zip it. last timesteps if lists are different length for i in range(len(actlist)): """ statsprog = (float(i+1)/float(len(actlist)))*100 print("\n \n \n \n \n \n \n \n \n \n \n") #if you want to clear the console in a hacky way. print("Progress: "+str(statsprog)+"%") if statsprog > 99.9999: print("Stats calc completed.") """ avglist.append(np.average(actlist[i])) stduplist.append(np.average(actlist[i])+np.std(actlist[i])) stddownlist.append(np.average(actlist[i])-np.std(actlist[i])) maxlist.append(np.max(actlist[i])) minlist.append(np.min(actlist[i])) def prestats(tllist,mllist): global timevec timevec = np.linspace(0,endTime,(endTime*10)) for i in range(len(tllist)): actinter = np.interp(list(timevec),list(tllist[i]),list(mllist[i])) global linter linter.append(actinter) #===ODE for overlay=== def dydt(t,y,k0,k1): m,n = y # looks like puts A and B into vector y dmdt = k0 - m * k1 dndt = k0 - m * k1 return(dmdt,dndt) dydt_withks = lambda t,y: dydt(t,y,0.2,0.01) sol = scipy.integrate.solve_ivp(dydt_withks, t_span=(0,endTime), y0=(m0,m0), method="RK45", rtol=1e-6) #===EXECUTE=== #try: megagil(pltno,t0,endTime,m0) # returns two nested lists (mmegastore and tmegastore) in the format mmegastore[i][j] where i is per Gillepsie simulation and j is the timepoint/mRNA number #except Exception: # print('Could not compute Gillepsie.') #try: prestats(tmegastore, mmegastore) stats(linter) mavgstore = avglist mstdupstore = stduplist mstddownstore = stddownlist mmaxstore = maxlist mminstore = minlist minter = linter flat_m = [item for sublist in mmegastore for item in sublist] mtotavg = np.average(flat_m) mtotvar = np.var(flat_m) mtotfano = (mtotvar/mtotavg) print('mean mRNA:',mtotavg) print('var mRNA:',mtotvar) print('fano mRNA:',mtotfano) flat_newm = [item for sublist in mnewmegastore for item in sublist] mnewtotavg = np.average(flat_newm) mnewtotvar = np.var(flat_newm) mnewtotfano = (mnewtotvar/mnewtotavg) print('mean new mRNA:',mnewtotavg) print('var new mRNA:',mnewtotvar) print('fano new mRNA:',mnewtotfano) #===PLOT=== #for i in range(pltno): # plt.plot(tmegastore[i],mmegastore[i]) mstar = [k0/k1] * 2 #try: plt.plot([0,int(timevec[-1])],mstar,linewidth=1.5,color='r',label="Analytical steady state") # analytical steady state plt.plot(sol.t,sol.y[0],'k',linewidth=1.5,label="ODE model") #plot the ODE ''' plt.plot(tmegastore[0],mmegastore[0],label="Run 1") plt.plot(tmegastore[1],mmegastore[1],label="Run 2") plt.plot(tmegastore[2],mmegastore[2],label="Run 3") plt.plot(tmegastore[3],mmegastore[3],label="Run 4") plt.plot(tmegastore[4],mmegastore[4],label="Run 5") ''' plt.plot(timevec,mavgstore,linewidth=1.5,color='b',label="Avergage of 100 Gillespie simulations") # average of all Gillespie sims plt.fill_between(timevec,mstdupstore,mstddownstore,facecolor='blue',alpha=0.5, label='Standard deviation around mean') plt.fill_between(timevec,mmaxstore,mminstore,facecolor='blue',alpha=0.3, label='Maxima and minima') plt.xlabel('time (seconds)') plt.ylabel('mRNA (absolute number)') plt.title('Gillespie simulation of mRNA production') plt.legend(loc="lower right") plt.show() #except Exception: # print('There was an error generating graphs from data. View raw avg data below:') # print(['%.2f' % elem for elem in mavgstore]) # also do the redundant formatting here so values are below each other #print(tavgstore) # print(['%.2f' % elem for elem in tavgstore])
[ "gkw16@ic.ac.uk" ]
gkw16@ic.ac.uk
7fec2706466fe1c1870db5cfe0ec39559e11d0db
3925a36faf828a695c751a88bd99dc24f38ddb29
/web_app/settings.py
a9211f5e8891d862f185e6177a854e48fe2cd0ad
[]
no_license
dlaredorazo/ml_api
b67bf7dd72eae880a53f0afc0231958e399338cf
a7a71abfaa88df6e367aba9584774ea753c3a1ed
refs/heads/master
2022-12-29T20:13:54.908740
2020-10-20T05:17:49
2020-10-20T05:17:49
305,581,216
0
0
null
null
null
null
UTF-8
Python
false
false
169
py
import pathlib appGlobals = {} def init(): global appGlobals appGlobals['app_root'] = pathlib.Path(__file__).parent.absolute() appGlobals['ml_models'] = {}
[ "davidlaredo1@gmail.com" ]
davidlaredo1@gmail.com
6f7883d25929d75290d6e07e7e20f1853024ad0d
475b1bd5f07bf002dbe855dda98b318b75637f21
/tutorial/snippets/permissions.py
a5a4ae961f125bc8a739d9dbe470eed20c565734
[]
no_license
danieldcl/django-rest-practice
4a9e53a592dbd328e33daa04c70ee6b51eead1d9
ee636f8fcdb08b153b424e392c5799bb247239ab
refs/heads/master
2020-11-26T10:07:36.019349
2019-12-19T11:28:58
2019-12-19T11:28:58
229,038,781
0
0
null
null
null
null
UTF-8
Python
false
false
339
py
from rest_framework import permissions class IsOwnerOrReadOnly(permissions.BasePermission): """ only allow owners of an object to edit it """ def has_object_permission(self, request, view, obj): if request.method in permissions.SAFE_METHODS: return True return obj.owner == request.user
[ "dcliao@Dcs-MBP.local" ]
dcliao@Dcs-MBP.local
d5eae104ed1dbca0437560f286226681863db8e6
12ed28c03ecb2b0b8eba651454467ea2dfd8b28f
/app/venv/lib/python3.7/site-packages/azure/iot/device/common/mqtt_transport.py
964a714fd0ad1da9a396d74b6307d4f21f2be6cb
[]
no_license
nsnyder1992/rpi-iot-test
93edb068881dc8c9c3990806fd721156b2827518
e8a44ca7e09a0f3d27efc472458a49a2ae6f84de
refs/heads/main
2023-01-27T13:26:58.447897
2020-12-10T22:56:28
2020-12-10T22:56:28
319,775,348
0
0
null
null
null
null
UTF-8
Python
false
false
29,465
py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import paho.mqtt.client as mqtt import logging import ssl import sys import threading import traceback import weakref import socket from . import transport_exceptions as exceptions import socks logger = logging.getLogger(__name__) # Mapping of Paho CONNACK rc codes to Error object classes # Used for connection callbacks paho_connack_rc_to_error = { mqtt.CONNACK_REFUSED_PROTOCOL_VERSION: exceptions.ProtocolClientError, mqtt.CONNACK_REFUSED_IDENTIFIER_REJECTED: exceptions.ProtocolClientError, mqtt.CONNACK_REFUSED_SERVER_UNAVAILABLE: exceptions.ConnectionFailedError, mqtt.CONNACK_REFUSED_BAD_USERNAME_PASSWORD: exceptions.UnauthorizedError, mqtt.CONNACK_REFUSED_NOT_AUTHORIZED: exceptions.UnauthorizedError, } # Mapping of Paho rc codes to Error object classes # Used for responses to Paho APIs and non-connection callbacks paho_rc_to_error = { mqtt.MQTT_ERR_NOMEM: exceptions.ProtocolClientError, mqtt.MQTT_ERR_PROTOCOL: exceptions.ProtocolClientError, mqtt.MQTT_ERR_INVAL: exceptions.ProtocolClientError, mqtt.MQTT_ERR_NO_CONN: exceptions.ConnectionDroppedError, mqtt.MQTT_ERR_CONN_REFUSED: exceptions.ConnectionFailedError, mqtt.MQTT_ERR_NOT_FOUND: exceptions.ConnectionFailedError, mqtt.MQTT_ERR_CONN_LOST: exceptions.ConnectionDroppedError, mqtt.MQTT_ERR_TLS: exceptions.UnauthorizedError, mqtt.MQTT_ERR_PAYLOAD_SIZE: exceptions.ProtocolClientError, mqtt.MQTT_ERR_NOT_SUPPORTED: exceptions.ProtocolClientError, mqtt.MQTT_ERR_AUTH: exceptions.UnauthorizedError, mqtt.MQTT_ERR_ACL_DENIED: exceptions.UnauthorizedError, mqtt.MQTT_ERR_UNKNOWN: exceptions.ProtocolClientError, mqtt.MQTT_ERR_ERRNO: exceptions.ProtocolClientError, mqtt.MQTT_ERR_QUEUE_SIZE: exceptions.ProtocolClientError, } def _create_error_from_connack_rc_code(rc): """ Given a paho CONNACK rc code, return an Exception that can be raised """ message = mqtt.connack_string(rc) if rc in paho_connack_rc_to_error: return paho_connack_rc_to_error[rc](message) else: return exceptions.ProtocolClientError("Unknown CONNACK rc={}".format(rc)) def _create_error_from_rc_code(rc): """ Given a paho rc code, return an Exception that can be raised """ if rc == 1: # Paho returns rc=1 to mean "something went wrong. stop". We manually translate this to a ConnectionDroppedError. return exceptions.ConnectionDroppedError("Paho returned rc==1") elif rc in paho_rc_to_error: message = mqtt.error_string(rc) return paho_rc_to_error[rc](message) else: return exceptions.ProtocolClientError("Unknown CONNACK rc=={}".format(rc)) class MQTTTransport(object): """ A wrapper class that provides an implementation-agnostic MQTT message broker interface. :ivar on_mqtt_connected_handler: Event handler callback, called upon establishing a connection. :type on_mqtt_connected_handler: Function :ivar on_mqtt_disconnected_handler: Event handler callback, called upon a disconnection. :type on_mqtt_disconnected_handler: Function :ivar on_mqtt_message_received_handler: Event handler callback, called upon receiving a message. :type on_mqtt_message_received_handler: Function :ivar on_mqtt_connection_failure_handler: Event handler callback, called upon a connection failure. :type on_mqtt_connection_failure_handler: Function """ def __init__( self, client_id, hostname, username, server_verification_cert=None, x509_cert=None, websockets=False, cipher=None, proxy_options=None, keep_alive=None, ): """ Constructor to instantiate an MQTT protocol wrapper. :param str client_id: The id of the client connecting to the broker. :param str hostname: Hostname or IP address of the remote broker. :param str username: Username for login to the remote broker. :param str server_verification_cert: Certificate which can be used to validate a server-side TLS connection (optional). :param x509_cert: Certificate which can be used to authenticate connection to a server in lieu of a password (optional). :param bool websockets: Indicates whether or not to enable a websockets connection in the Transport. :param str cipher: Cipher string in OpenSSL cipher list format :param proxy_options: Options for sending traffic through proxy servers. """ self._client_id = client_id self._hostname = hostname self._username = username self._mqtt_client = None self._server_verification_cert = server_verification_cert self._x509_cert = x509_cert self._websockets = websockets self._cipher = cipher self._proxy_options = proxy_options self._keep_alive = keep_alive self.on_mqtt_connected_handler = None self.on_mqtt_disconnected_handler = None self.on_mqtt_message_received_handler = None self.on_mqtt_connection_failure_handler = None self._op_manager = OperationManager() self._mqtt_client = self._create_mqtt_client() def _create_mqtt_client(self): """ Create the MQTT client object and assign all necessary event handler callbacks. """ logger.debug("creating mqtt client") # Instaniate the client if self._websockets: logger.info("Creating client for connecting using MQTT over websockets") mqtt_client = mqtt.Client( client_id=self._client_id, clean_session=False, protocol=mqtt.MQTTv311, transport="websockets", ) mqtt_client.ws_set_options(path="/$iothub/websocket") else: logger.info("Creating client for connecting using MQTT over TCP") mqtt_client = mqtt.Client( client_id=self._client_id, clean_session=False, protocol=mqtt.MQTTv311 ) if self._proxy_options: logger.info("Setting custom proxy options on mqtt client") mqtt_client.proxy_set( proxy_type=self._proxy_options.proxy_type, proxy_addr=self._proxy_options.proxy_address, proxy_port=self._proxy_options.proxy_port, proxy_username=self._proxy_options.proxy_username, proxy_password=self._proxy_options.proxy_password, ) mqtt_client.enable_logger(logging.getLogger("paho")) # Configure TLS/SSL ssl_context = self._create_ssl_context() mqtt_client.tls_set_context(context=ssl_context) # Set event handlers. Use weak references back into this object to prevent # leaks on Python 2.7. See callable_weak_method.py and PEP 442 for explanation. # # We don't use the CallableWeakMethod object here because these handlers # are not methods. self_weakref = weakref.ref(self) def on_connect(client, userdata, flags, rc): this = self_weakref() logger.info("connected with result code: {}".format(rc)) if rc: # i.e. if there is an error if this.on_mqtt_connection_failure_handler: try: this.on_mqtt_connection_failure_handler( _create_error_from_connack_rc_code(rc) ) except Exception: logger.error("Unexpected error calling on_mqtt_connection_failure_handler") logger.error(traceback.format_exc()) else: logger.error( "connection failed, but no on_mqtt_connection_failure_handler handler callback provided" ) elif this.on_mqtt_connected_handler: try: this.on_mqtt_connected_handler() except Exception: logger.error("Unexpected error calling on_mqtt_connected_handler") logger.error(traceback.format_exc()) else: logger.error("No event handler callback set for on_mqtt_connected_handler") def on_disconnect(client, userdata, rc): this = self_weakref() logger.info("disconnected with result code: {}".format(rc)) cause = None if rc: # i.e. if there is an error logger.debug("".join(traceback.format_stack())) cause = _create_error_from_rc_code(rc) if this: this._cleanup_transport_on_error() if not this: # Paho will sometimes call this after we've been garbage collected, If so, we have to # stop the loop to make sure the Paho thread shuts down. logger.info( "on_disconnect called with transport==None. Transport must have been garbage collected. stopping loop" ) client.loop_stop() else: if this.on_mqtt_disconnected_handler: try: this.on_mqtt_disconnected_handler(cause) except Exception: logger.error("Unexpected error calling on_mqtt_disconnected_handler") logger.error(traceback.format_exc()) else: logger.error("No event handler callback set for on_mqtt_disconnected_handler") def on_subscribe(client, userdata, mid, granted_qos): this = self_weakref() logger.info("suback received for {}".format(mid)) # subscribe failures are returned from the subscribe() call. This is just # a notification that a SUBACK was received, so there is no failure case here this._op_manager.complete_operation(mid) def on_unsubscribe(client, userdata, mid): this = self_weakref() logger.info("UNSUBACK received for {}".format(mid)) # unsubscribe failures are returned from the unsubscribe() call. This is just # a notification that a SUBACK was received, so there is no failure case here this._op_manager.complete_operation(mid) def on_publish(client, userdata, mid): this = self_weakref() logger.info("payload published for {}".format(mid)) # publish failures are returned from the publish() call. This is just # a notification that a PUBACK was received, so there is no failure case here this._op_manager.complete_operation(mid) def on_message(client, userdata, mqtt_message): this = self_weakref() logger.info("message received on {}".format(mqtt_message.topic)) if this.on_mqtt_message_received_handler: try: this.on_mqtt_message_received_handler(mqtt_message.topic, mqtt_message.payload) except Exception: logger.error("Unexpected error calling on_mqtt_message_received_handler") logger.error(traceback.format_exc()) else: logger.error( "No event handler callback set for on_mqtt_message_received_handler - DROPPING MESSAGE" ) mqtt_client.on_connect = on_connect mqtt_client.on_disconnect = on_disconnect mqtt_client.on_subscribe = on_subscribe mqtt_client.on_unsubscribe = on_unsubscribe mqtt_client.on_publish = on_publish mqtt_client.on_message = on_message # Set paho automatic-reconnect delay to 2 hours. Ideally we would turn # paho auto-reconnect off entirely, but this is the best we can do. Without # this, we run the risk of our auto-reconnect code and the paho auto-reconnect # code conflicting with each other. # The choice of 2 hours is completely arbitrary mqtt_client.reconnect_delay_set(120 * 60) logger.debug("Created MQTT protocol client, assigned callbacks") return mqtt_client def _cleanup_transport_on_error(self): """ After disconnecting because of an error, Paho was designed to keep the loop running and to try reconnecting after the reconnect interval. We don't want Paho to reconnect because we want to control the timing of the reconnect, so we force the loop to stop. We are relying on intimite knowledge of Paho behavior here. If this becomes a problem, it may be necessary to write our own Paho thread and stop using thread_start()/thread_stop(). This is certainly supported by Paho, but the thread that Paho provides works well enough (so far) and making our own would be more complex than is currently justified. """ logger.info("Forcing paho disconnect to prevent it from automatically reconnecting") # Note: We are calling this inside our on_disconnect() handler, so we might be inside the # Paho thread at this point. This is perfectly valid. Comments in Paho's client.py # loop_forever() function recomment calling disconnect() from a callback to exit the # Paho thread/loop. self._mqtt_client.disconnect() # Calling disconnect() isn't enough. We also need to call loop_stop to make sure # Paho is as clean as possible. Our call to disconnect() above is enough to stop the # loop and exit the tread, but the call to loop_stop() is necessary to complete the cleanup. self._mqtt_client.loop_stop() # Finally, because of a bug in Paho, we need to null out the _thread pointer. This # is necessary because the code that sets _thread to None only gets called if you # call loop_stop from an external thread (and we're still inside the Paho thread here). if threading.current_thread() == self._mqtt_client._thread: logger.debug("in paho thread. nulling _thread") self._mqtt_client._thread = None logger.debug("Done forcing paho disconnect") def _create_ssl_context(self): """ This method creates the SSLContext object used by Paho to authenticate the connection. """ logger.debug("creating a SSL context") ssl_context = ssl.SSLContext(protocol=ssl.PROTOCOL_TLSv1_2) if self._server_verification_cert: logger.debug("configuring SSL context with custom server verification cert") ssl_context.load_verify_locations(cadata=self._server_verification_cert) else: logger.debug("configuring SSL context with default certs") ssl_context.load_default_certs() if self._cipher: try: logger.debug("configuring SSL context with cipher suites") ssl_context.set_ciphers(self._cipher) except ssl.SSLError as e: # TODO: custom error with more detail? raise e if self._x509_cert is not None: logger.debug("configuring SSL context with client-side certificate and key") ssl_context.load_cert_chain( self._x509_cert.certificate_file, self._x509_cert.key_file, self._x509_cert.pass_phrase, ) ssl_context.verify_mode = ssl.CERT_REQUIRED ssl_context.check_hostname = True return ssl_context def connect(self, password=None): """ Connect to the MQTT broker, using hostname and username set at instantiation. This method should be called as an entry point before sending any telemetry. The password is not required if the transport was instantiated with an x509 certificate. If MQTT connection has been proxied, connection will take a bit longer to allow negotiation with the proxy server. Any errors in the proxy connection process will trigger exceptions :param str password: The password for connecting with the MQTT broker (Optional). :raises: ConnectionFailedError if connection could not be established. :raises: ConnectionDroppedError if connection is dropped during execution. :raises: UnauthorizedError if there is an error authenticating. :raises: ProtocolClientError if there is some other client error. """ logger.debug("connecting to mqtt broker") self._mqtt_client.username_pw_set(username=self._username, password=password) try: if self._websockets: logger.info("Connect using port 443 (websockets)") rc = self._mqtt_client.connect( host=self._hostname, port=443, keepalive=self._keep_alive ) else: logger.info("Connect using port 8883 (TCP)") rc = self._mqtt_client.connect( host=self._hostname, port=8883, keepalive=self._keep_alive ) except socket.error as e: self._cleanup_transport_on_error() # Only this type will raise a special error # To stop it from retrying. if ( isinstance(e, ssl.SSLError) and e.strerror is not None and "CERTIFICATE_VERIFY_FAILED" in e.strerror ): raise exceptions.TlsExchangeAuthError(cause=e) elif isinstance(e, socks.ProxyError): if isinstance(e, socks.SOCKS5AuthError): # TODO This is the only I felt like specializing raise exceptions.UnauthorizedError(cause=e) else: raise exceptions.ProtocolProxyError(cause=e) else: # If the socket can't open (e.g. using iptables REJECT), we get a # socket.error. Convert this into ConnectionFailedError so we can retry raise exceptions.ConnectionFailedError(cause=e) except socks.ProxyError as pe: self._cleanup_transport_on_error() if isinstance(pe, socks.SOCKS5AuthError): raise exceptions.UnauthorizedError(cause=pe) else: raise exceptions.ProtocolProxyError(cause=pe) except Exception as e: self._cleanup_transport_on_error() raise exceptions.ProtocolClientError( message="Unexpected Paho failure during connect", cause=e ) logger.debug("_mqtt_client.connect returned rc={}".format(rc)) if rc: raise _create_error_from_rc_code(rc) self._mqtt_client.loop_start() def disconnect(self): """ Disconnect from the MQTT broker. :raises: ProtocolClientError if there is some client error. """ logger.info("disconnecting MQTT client") try: rc = self._mqtt_client.disconnect() except Exception as e: raise exceptions.ProtocolClientError( message="Unexpected Paho failure during disconnect", cause=e ) finally: self._mqtt_client.loop_stop() if threading.current_thread() == self._mqtt_client._thread: logger.debug("in paho thread. nulling _thread") self._mqtt_client._thread = None logger.debug("_mqtt_client.disconnect returned rc={}".format(rc)) if rc: # This could result in ConnectionDroppedError or ProtocolClientError # No matter what, we always raise here to give upper layers a chance to respond # to this error. err = _create_error_from_rc_code(rc) raise err def subscribe(self, topic, qos=1, callback=None): """ This method subscribes the client to one topic from the MQTT broker. :param str topic: a single string specifying the subscription topic to subscribe to :param int qos: the desired quality of service level for the subscription. Defaults to 1. :param callback: A callback to be triggered upon completion (Optional). :return: message ID for the subscribe request. :raises: ValueError if qos is not 0, 1 or 2. :raises: ValueError if topic is None or has zero string length. :raises: ConnectionDroppedError if connection is dropped during execution. :raises: ProtocolClientError if there is some other client error. """ logger.info("subscribing to {} with qos {}".format(topic, qos)) try: (rc, mid) = self._mqtt_client.subscribe(topic, qos=qos) except ValueError: raise except Exception as e: raise exceptions.ProtocolClientError( message="Unexpected Paho failure during subscribe", cause=e ) logger.debug("_mqtt_client.subscribe returned rc={}".format(rc)) if rc: # This could result in ConnectionDroppedError or ProtocolClientError raise _create_error_from_rc_code(rc) self._op_manager.establish_operation(mid, callback) def unsubscribe(self, topic, callback=None): """ Unsubscribe the client from one topic on the MQTT broker. :param str topic: a single string which is the subscription topic to unsubscribe from. :param callback: A callback to be triggered upon completion (Optional). :raises: ValueError if topic is None or has zero string length. :raises: ConnectionDroppedError if connection is dropped during execution. :raises: ProtocolClientError if there is some other client error. """ logger.info("unsubscribing from {}".format(topic)) try: (rc, mid) = self._mqtt_client.unsubscribe(topic) except ValueError: raise except Exception as e: raise exceptions.ProtocolClientError( message="Unexpected Paho failure during unsubscribe", cause=e ) logger.debug("_mqtt_client.unsubscribe returned rc={}".format(rc)) if rc: # This could result in ConnectionDroppedError or ProtocolClientError raise _create_error_from_rc_code(rc) self._op_manager.establish_operation(mid, callback) def publish(self, topic, payload, qos=1, callback=None): """ Send a message via the MQTT broker. :param str topic: topic: The topic that the message should be published on. :param payload: The actual message to send. :type payload: str, bytes, int, float or None :param int qos: the desired quality of service level for the subscription. Defaults to 1. :param callback: A callback to be triggered upon completion (Optional). :raises: ValueError if qos is not 0, 1 or 2 :raises: ValueError if topic is None or has zero string length :raises: ValueError if topic contains a wildcard ("+") :raises: ValueError if the length of the payload is greater than 268435455 bytes :raises: TypeError if payload is not a valid type :raises: ConnectionDroppedError if connection is dropped during execution. :raises: ProtocolClientError if there is some other client error. """ logger.info("publishing on {}".format(topic)) try: (rc, mid) = self._mqtt_client.publish(topic=topic, payload=payload, qos=qos) except ValueError: raise except TypeError: raise except Exception as e: raise exceptions.ProtocolClientError( message="Unexpected Paho failure during publish", cause=e ) logger.debug("_mqtt_client.publish returned rc={}".format(rc)) if rc: # This could result in ConnectionDroppedError or ProtocolClientError raise _create_error_from_rc_code(rc) self._op_manager.establish_operation(mid, callback) class OperationManager(object): """Tracks pending operations and thier associated callbacks until completion. """ def __init__(self): # Maps mid->callback for operations where a request has been sent # but the reponse has not yet been received self._pending_operation_callbacks = {} # Maps mid->mid for responses received that are NOT established in the _pending_operation_callbacks dict. # Necessary because sometimes an operation will complete with a response before the # Paho call returns. # TODO: make this map mid to something more useful (result code?) self._unknown_operation_completions = {} self._lock = threading.Lock() def establish_operation(self, mid, callback=None): """Establish a pending operation identified by MID, and store its completion callback. If the operation has already been completed, the callback will be triggered. """ trigger_callback = False with self._lock: # Check to see if a response was already received for this MID before this method was # able to be called due to threading shenanigans if mid in self._unknown_operation_completions: # Clear the recorded unknown response now that it has been resolved del self._unknown_operation_completions[mid] # Since the operation has already completed, indicate callback should trigger trigger_callback = True else: # Store the operation as pending, along with callback self._pending_operation_callbacks[mid] = callback logger.debug("Waiting for response on MID: {}".format(mid)) # Now that the lock has been released, if the callback should be triggered, # go ahead and trigger it now. if trigger_callback: logger.debug( "Response for MID: {} was received early - triggering callback".format(mid) ) if callback: try: callback() except Exception: logger.error("Unexpected error calling callback for MID: {}".format(mid)) logger.error(traceback.format_exc()) else: # Not entirely unexpected becuase of QOS=1 logger.debug("No callback for MID: {}".format(mid)) def complete_operation(self, mid): """Complete an operation identified by MID and trigger the associated completion callback. If the operation MID is unknown, the completion status will be stored until the operation is established. """ callback = None trigger_callback = False with self._lock: # If the mid is associated with an established pending operation, trigger the associated callback if mid in self._pending_operation_callbacks: # Retrieve the callback, and clear the pending operation now that it has been completed callback = self._pending_operation_callbacks[mid] del self._pending_operation_callbacks[mid] # Since the operation is complete, indicate the callback should be triggered trigger_callback = True else: # Otherwise, store the mid as an unknown response logger.debug("Response received for unknown MID: {}".format(mid)) self._unknown_operation_completions[ mid ] = mid # TODO: set something more useful here # Now that the lock has been released, if the callback should be triggered, # go ahead and trigger it now. if trigger_callback: logger.debug( "Response received for recognized MID: {} - triggering callback".format(mid) ) if callback: try: callback() except Exception: logger.error("Unexpected error calling callback for MID: {}".format(mid)) logger.error(traceback.format_exc()) else: # fully expected. QOS=1 means we might get 2 PUBACKs logger.debug("No callback set for MID: {}".format(mid))
[ "nsnyder1992@gmail.com" ]
nsnyder1992@gmail.com