max_stars_repo_path
stringlengths
4
237
max_stars_repo_name
stringlengths
6
117
max_stars_count
int64
0
95.2k
id
stringlengths
1
7
content
stringlengths
12
593k
input_ids
sequencelengths
7
549k
BPNetWork/NeuralNetwork/demo_mnist.py
Keneyr/MachineLearningMethods
1
82134
import NeuralNetwork as NN import numpy as np import matplotlib.pyplot as plt import tools def train(path_to_datas, save_model_path): # 读取MNIST数据集 train_datas, labels = tools.load_mnist(path_to_datas, 'train') print("The total numbers of datas : ", len(train_datas)) train_labels = np.zeros((labels.shape[0], 10)) train_labels[np.arange(labels.shape[0]), labels.astype('int').reshape(-1)-1] = 1.0 # 设置训练所需的超参数 batch_size = 200 #100 # 训练次数 train_epochs = 50 #10 # 学习率 lr = 0.01 #0.01 decay = False regularization = False input_features_numbers = train_datas.shape[1] layer_structure = [input_features_numbers, 512, 256, 128, 10] display = True net_name = 'nn' # 定义我们的神经网络分类器 net = NN.MLP(name=net_name, layer_structure=layer_structure, task_model='multi', batch_size=batch_size) # 开始训练 print("---------开始训练---------") net.train(train_datas=train_datas, train_targets=train_labels, train_epoch=train_epochs, lr=lr, lr_decay=decay, loss='BE', regularization=regularization, display=display) # 保存模型 net.save_model(path=save_model_path) # 绘制网络的训练损失和精度 total_net_loss = [net.total_loss] total_net_accuracy = [net.total_accuracy] tools.drawDataCurve(total_net_loss, total_net_accuracy) def test(path_to_datas, save_model_path): # 读取xlsx文件 test_datas, all_label = tools.load_mnist(path_to_datas, 'test') print("The total numbers of datas : ", len(test_datas)) test_labels = np.zeros((all_label.shape[0], 10)) test_labels[np.arange(all_label.shape[0]), all_label.astype('int').reshape(-1)-1] = 1.0 # 设置训练所需的超参数 batch_size = 200 input_features_numbers = test_datas.shape[1] layer_structure = [input_features_numbers, 512, 256, 128, 10] net_name = 'nn' # 测试代码 print("---------测试---------") # 载入训练好的模型 net = NN.MLP(name=net_name, layer_structure=layer_structure, task_model='multi', batch_size=batch_size, load_model=save_model_path) # 网络进行预测 test_steps = test_datas.shape[0] // batch_size accuracy = 0 for i in range(test_steps): input_data = test_datas[batch_size*i : batch_size*(i+1), :].reshape(batch_size, test_datas.shape[1]) targets = test_labels[batch_size*i : batch_size*(i+1), :].reshape(batch_size, test_labels.shape[1]) pred = net(input_data) # 计算准确率 accuracy += np.sum(np.argmax(pred,1) == np.argmax(targets,1)) / targets.shape[0] print("网络识别的准确率 : ", accuracy / test_steps) if __name__ == "__main__": path_to_datas = 'mnist/' save_model_path = 'model/' train(path_to_datas, save_model_path) test(path_to_datas, save_model_path)
[ 1, 1053, 2448, 3631, 13724, 408, 405, 29940, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 8492, 13, 13, 1753, 7945, 29898, 2084, 29918, 517, 29918, 14538, 29892, 4078, 29918, 4299, 29918, 2084, 1125, 13, 1678, 396, 29871, 235, 178, 190, 30683, 29924, 29940, 9047, 30354, 30763, 30893, 13, 1678, 7945, 29918, 14538, 29892, 11073, 353, 8492, 29889, 1359, 29918, 23521, 391, 29898, 2084, 29918, 517, 29918, 14538, 29892, 525, 14968, 1495, 13, 1678, 1596, 703, 1576, 3001, 3694, 310, 6155, 584, 9162, 7431, 29898, 14968, 29918, 14538, 876, 13, 1678, 7945, 29918, 21134, 353, 7442, 29889, 3298, 359, 3552, 21134, 29889, 12181, 29961, 29900, 1402, 29871, 29896, 29900, 876, 13, 1678, 7945, 29918, 21134, 29961, 9302, 29889, 279, 927, 29898, 21134, 29889, 12181, 29961, 29900, 11724, 11073, 29889, 579, 668, 877, 524, 2824, 690, 14443, 6278, 29896, 6817, 29896, 29962, 353, 29871, 29896, 29889, 29900, 13, 13, 1678, 396, 29871, 30872, 30669, 235, 177, 176, 234, 190, 134, 30744, 31383, 30210, 31480, 31125, 30354, 13, 1678, 9853, 29918, 2311, 353, 29871, 29906, 29900, 29900, 396, 29896, 29900, 29900, 13, 1678, 396, 29871, 235, 177, 176, 234, 190, 134, 30936, 30354, 13, 1678, 7945, 29918, 1022, 2878, 29879, 353, 29871, 29945, 29900, 396, 29896, 29900, 13, 1678, 396, 29871, 30415, 231, 188, 163, 234, 145, 138, 13, 1678, 301, 29878, 353, 29871, 29900, 29889, 29900, 29896, 396, 29900, 29889, 29900, 29896, 13, 1678, 20228, 353, 7700, 13, 1678, 4943, 2133, 353, 7700, 13, 1678, 1881, 29918, 22100, 29918, 20326, 353, 7945, 29918, 14538, 29889, 12181, 29961, 29896, 29962, 13, 1678, 7546, 29918, 23905, 353, 518, 2080, 29918, 22100, 29918, 20326, 29892, 29871, 29945, 29896, 29906, 29892, 29871, 29906, 29945, 29953, 29892, 29871, 29896, 29906, 29947, 29892, 29871, 29896, 29900, 29962, 13, 1678, 2479, 353, 5852, 13, 1678, 7787, 29918, 978, 353, 525, 15755, 29915, 13, 1678, 396, 29871, 30495, 31349, 30672, 31381, 30210, 30648, 31412, 31222, 234, 190, 159, 30748, 30832, 30943, 13, 1678, 7787, 353, 405, 29940, 29889, 1988, 29925, 29898, 978, 29922, 1212, 29918, 978, 29892, 7546, 29918, 23905, 29922, 13148, 29918, 23905, 29892, 3414, 29918, 4299, 2433, 9910, 742, 9853, 29918, 2311, 29922, 16175, 29918, 2311, 29897, 13, 1678, 396, 29871, 31026, 31020, 235, 177, 176, 234, 190, 134, 13, 1678, 1596, 703, 1378, 29899, 31026, 31020, 235, 177, 176, 234, 190, 134, 1378, 29899, 1159, 13, 1678, 7787, 29889, 14968, 29898, 14968, 29918, 14538, 29922, 14968, 29918, 14538, 29892, 7945, 29918, 5182, 29879, 29922, 14968, 29918, 21134, 29892, 7945, 29918, 1022, 2878, 29922, 14968, 29918, 1022, 2878, 29879, 29892, 301, 29878, 29922, 29212, 29892, 301, 29878, 29918, 7099, 388, 29922, 7099, 388, 29892, 6410, 2433, 15349, 742, 4943, 2133, 29922, 15227, 2133, 29892, 2479, 29922, 4990, 29897, 13, 1678, 396, 29871, 30982, 30946, 31382, 30883, 13, 1678, 7787, 29889, 7620, 29918, 4299, 29898, 2084, 29922, 7620, 29918, 4299, 29918, 2084, 29897, 13, 1678, 396, 29871, 234, 190, 155, 31072, 31222, 234, 190, 159, 30210, 235, 177, 176, 234, 190, 134, 233, 144, 162, 31369, 30503, 234, 181, 193, 30898, 13, 1678, 3001, 29918, 1212, 29918, 6758, 353, 518, 1212, 29889, 7827, 29918, 6758, 29962, 13, 1678, 3001, 29918, 1212, 29918, 562, 2764, 4135, 353, 518, 1212, 29889, 7827, 29918, 562, 2764, 4135, 29962, 13, 1678, 8492, 29889, 4012, 1469, 23902, 345, 29898, 7827, 29918, 1212, 29918, 6758, 29892, 3001, 29918, 1212, 29918, 562, 2764, 4135, 29897, 13, 13, 1753, 1243, 29898, 2084, 29918, 517, 29918, 14538, 29892, 4078, 29918, 4299, 29918, 2084, 1125, 13, 1678, 396, 29871, 235, 178, 190, 30683, 20267, 29916, 30333, 30631, 13, 1678, 1243, 29918, 14538, 29892, 599, 29918, 1643, 353, 8492, 29889, 1359, 29918, 23521, 391, 29898, 2084, 29918, 517, 29918, 14538, 29892, 525, 1688, 1495, 13, 1678, 1596, 703, 1576, 3001, 3694, 310, 6155, 584, 9162, 7431, 29898, 1688, 29918, 14538, 876, 13, 1678, 1243, 29918, 21134, 353, 7442, 29889, 3298, 359, 3552, 497, 29918, 1643, 29889, 12181, 29961, 29900, 1402, 29871, 29896, 29900, 876, 13, 1678, 1243, 29918, 21134, 29961, 9302, 29889, 279, 927, 29898, 497, 29918, 1643, 29889, 12181, 29961, 29900, 11724, 599, 29918, 1643, 29889, 579, 668, 877, 524, 2824, 690, 14443, 6278, 29896, 6817, 29896, 29962, 353, 29871, 29896, 29889, 29900, 13, 13, 1678, 396, 29871, 30872, 30669, 235, 177, 176, 234, 190, 134, 30744, 31383, 30210, 31480, 31125, 30354, 13, 1678, 9853, 29918, 2311, 353, 29871, 29906, 29900, 29900, 13, 1678, 1881, 29918, 22100, 29918, 20326, 353, 1243, 29918, 14538, 29889, 12181, 29961, 29896, 29962, 13, 1678, 7546, 29918, 23905, 353, 518, 2080, 29918, 22100, 29918, 20326, 29892, 29871, 29945, 29896, 29906, 29892, 29871, 29906, 29945, 29953, 29892, 29871, 29896, 29906, 29947, 29892, 29871, 29896, 29900, 29962, 13, 1678, 7787, 29918, 978, 353, 525, 15755, 29915, 13, 13, 1678, 396, 29871, 31851, 31787, 30690, 31183, 13, 1678, 1596, 703, 1378, 29899, 31851, 31787, 1378, 29899, 1159, 13, 1678, 396, 29871, 31526, 30752, 235, 177, 176, 234, 190, 134, 31076, 30210, 31382, 30883, 13, 1678, 7787, 353, 405, 29940, 29889, 1988, 29925, 29898, 978, 29922, 1212, 29918, 978, 29892, 7546, 29918, 23905, 29922, 13148, 29918, 23905, 29892, 3414, 29918, 4299, 2433, 9910, 742, 9853, 29918, 2311, 29922, 16175, 29918, 2311, 29892, 2254, 29918, 4299, 29922, 7620, 29918, 4299, 29918, 2084, 29897, 13, 13, 1678, 396, 29871, 31222, 234, 190, 159, 31174, 30448, 236, 165, 135, 31851, 13, 1678, 1243, 29918, 24530, 353, 1243, 29918, 14538, 29889, 12181, 29961, 29900, 29962, 849, 9853, 29918, 2311, 13, 1678, 13600, 353, 29871, 29900, 13, 1678, 363, 474, 297, 3464, 29898, 1688, 29918, 24530, 1125, 13, 4706, 1881, 29918, 1272, 353, 1243, 29918, 14538, 29961, 16175, 29918, 2311, 29930, 29875, 584, 9853, 29918, 2311, 16395, 29875, 29974, 29896, 511, 584, 1822, 690, 14443, 29898, 16175, 29918, 2311, 29892, 1243, 29918, 14538, 29889, 12181, 29961, 29896, 2314, 13, 4706, 22525, 353, 1243, 29918, 21134, 29961, 16175, 29918, 2311, 29930, 29875, 584, 9853, 29918, 2311, 16395, 29875, 29974, 29896, 511, 584, 1822, 690, 14443, 29898, 16175, 29918, 2311, 29892, 1243, 29918, 21134, 29889, 12181, 29961, 29896, 2314, 13, 13, 4706, 4450, 353, 7787, 29898, 2080, 29918, 1272, 29897, 13, 4706, 396, 29871, 31466, 31565, 232, 138, 137, 31835, 234, 145, 138, 13, 4706, 13600, 4619, 7442, 29889, 2083, 29898, 9302, 29889, 1191, 3317, 29898, 11965, 29892, 29896, 29897, 1275, 7442, 29889, 1191, 3317, 29898, 5182, 29879, 29892, 29896, 876, 847, 22525, 29889, 12181, 29961, 29900, 29962, 13, 1678, 1596, 703, 31222, 234, 190, 159, 235, 178, 137, 232, 139, 174, 30210, 232, 138, 137, 31835, 234, 145, 138, 584, 9162, 13600, 847, 1243, 29918, 24530, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 2224, 29918, 517, 29918, 14538, 353, 525, 23521, 391, 22208, 13, 1678, 4078, 29918, 4299, 29918, 2084, 353, 525, 4299, 22208, 13, 1678, 7945, 29898, 2084, 29918, 517, 29918, 14538, 29892, 4078, 29918, 4299, 29918, 2084, 29897, 13, 1678, 1243, 29898, 2084, 29918, 517, 29918, 14538, 29892, 4078, 29918, 4299, 29918, 2084, 29897, 13, 268, 13, 2 ]
codewof/utils/errors/VertoConversionError.py
taskmaker1/codewof
3
102947
<filename>codewof/utils/errors/VertoConversionError.py """Custom error for Verto error.""" from .Error import Error ERROR_MESSAGE = "\nConversion failed with error: \"{message}\"\n" ERROR_MESSAGE_CODE_PART = "{line_number:<6}{line}\n" class VertoConversionError(Error): """Custom error for Verto errors.""" def __init__(self, markdown_path, verto_error): """Create the error for Verto errors.""" super().__init__() self.markdown_path = markdown_path self.verto_error = verto_error def __str__(self): """Override default error string. Returns: Error message for Verto error. """ base_message = self.base_message.format(filename=self.markdown_path) custom_message = ERROR_MESSAGE.format(message=self.verto_error.message) if hasattr(self.verto_error, "line_nums") and hasattr(self.verto_error, "lines"): for i, line_num in enumerate(self.verto_error.line_nums): custom_message += ERROR_MESSAGE_CODE_PART.format( line_number=line_num, line=self.verto_error.lines[i] ) return base_message + custom_message
[ 1, 529, 9507, 29958, 401, 827, 29888, 29914, 13239, 29914, 12523, 29914, 6565, 517, 1168, 3259, 2392, 29889, 2272, 13, 15945, 29908, 7281, 1059, 363, 1798, 517, 1059, 1213, 15945, 13, 13, 3166, 869, 2392, 1053, 4829, 13, 13, 11432, 29918, 2303, 1799, 10461, 353, 6634, 29876, 1168, 3259, 5229, 411, 1059, 29901, 13218, 29912, 4906, 1012, 26732, 29876, 29908, 13, 11432, 29918, 2303, 1799, 10461, 29918, 16524, 29918, 26092, 353, 29850, 1220, 29918, 4537, 29901, 29966, 29953, 1157, 1220, 1012, 29876, 29908, 13, 13, 13, 1990, 1798, 517, 1168, 3259, 2392, 29898, 2392, 1125, 13, 1678, 9995, 7281, 1059, 363, 1798, 517, 4436, 1213, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2791, 3204, 29918, 2084, 29892, 1147, 517, 29918, 2704, 1125, 13, 4706, 9995, 4391, 278, 1059, 363, 1798, 517, 4436, 1213, 15945, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 3502, 3204, 29918, 2084, 353, 2791, 3204, 29918, 2084, 13, 4706, 1583, 29889, 369, 517, 29918, 2704, 353, 1147, 517, 29918, 2704, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 9995, 4640, 2322, 1059, 1347, 29889, 13, 13, 4706, 16969, 29901, 13, 9651, 4829, 2643, 363, 1798, 517, 1059, 29889, 13, 4706, 9995, 13, 4706, 2967, 29918, 4906, 353, 1583, 29889, 3188, 29918, 4906, 29889, 4830, 29898, 9507, 29922, 1311, 29889, 3502, 3204, 29918, 2084, 29897, 13, 4706, 2888, 29918, 4906, 353, 14431, 29918, 2303, 1799, 10461, 29889, 4830, 29898, 4906, 29922, 1311, 29889, 369, 517, 29918, 2704, 29889, 4906, 29897, 13, 4706, 565, 756, 5552, 29898, 1311, 29889, 369, 517, 29918, 2704, 29892, 376, 1220, 29918, 1949, 29879, 1159, 322, 756, 5552, 29898, 1311, 29889, 369, 517, 29918, 2704, 29892, 376, 9012, 29908, 1125, 13, 9651, 363, 474, 29892, 1196, 29918, 1949, 297, 26985, 29898, 1311, 29889, 369, 517, 29918, 2704, 29889, 1220, 29918, 1949, 29879, 1125, 13, 18884, 2888, 29918, 4906, 4619, 14431, 29918, 2303, 1799, 10461, 29918, 16524, 29918, 26092, 29889, 4830, 29898, 13, 462, 1678, 1196, 29918, 4537, 29922, 1220, 29918, 1949, 29892, 13, 462, 1678, 1196, 29922, 1311, 29889, 369, 517, 29918, 2704, 29889, 9012, 29961, 29875, 29962, 13, 18884, 1723, 13, 4706, 736, 2967, 29918, 4906, 718, 2888, 29918, 4906, 13, 2 ]
examples/04_krige_geometric.py
ehxan139/PyKrige
280
98955
# -*- coding: utf-8 -*- """ Geometric example ================= A small example script showing the usage of the 'geographic' coordinates type for ordinary kriging on a sphere. """ from pykrige.ok import OrdinaryKriging import numpy as np from matplotlib import pyplot as plt # Make this example reproducible: np.random.seed(89239413) # Generate random data following a uniform spatial distribution # of nodes and a uniform distribution of values in the interval # [2.0, 5.5]: N = 7 lon = 360.0 * np.random.random(N) lat = 180.0 / np.pi * np.arcsin(2 * np.random.random(N) - 1) z = 3.5 * np.random.rand(N) + 2.0 # Generate a regular grid with 60° longitude and 30° latitude steps: grid_lon = np.linspace(0.0, 360.0, 7) grid_lat = np.linspace(-90.0, 90.0, 7) # Create ordinary kriging object: OK = OrdinaryKriging( lon, lat, z, variogram_model="linear", verbose=False, enable_plotting=False, coordinates_type="geographic", ) # Execute on grid: z1, ss1 = OK.execute("grid", grid_lon, grid_lat) # Create ordinary kriging object ignoring curvature: OK = OrdinaryKriging( lon, lat, z, variogram_model="linear", verbose=False, enable_plotting=False ) # Execute on grid: z2, ss2 = OK.execute("grid", grid_lon, grid_lat) ############################################################################### # Print data at equator (last longitude index will show periodicity): print("Original data:") print("Longitude:", lon.astype(int)) print("Latitude: ", lat.astype(int)) print("z: ", np.array_str(z, precision=2)) print("\nKrige at 60° latitude:\n======================") print("Longitude:", grid_lon) print("Value: ", np.array_str(z1[5, :], precision=2)) print("Sigma²: ", np.array_str(ss1[5, :], precision=2)) print("\nIgnoring curvature:\n=====================") print("Value: ", np.array_str(z2[5, :], precision=2)) print("Sigma²: ", np.array_str(ss2[5, :], precision=2)) ############################################################################### # We can see that the data point at longitude 122, latitude 50 correctly # dominates the kriged results, since it is the closest node in spherical # distance metric, as longitude differences scale with cos(latitude). # When kriging using longitude / latitude linearly, the value for grid points # with longitude values further away as longitude is now incorrectly # weighted equally as latitude. fig, (ax1, ax2) = plt.subplots(1, 2) ax1.imshow(z1, extent=[0, 360, -90, 90], origin="lower") ax1.set_title("geo-coordinates") ax2.imshow(z2, extent=[0, 360, -90, 90], origin="lower") ax2.set_title("non geo-coordinates") plt.show()
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 7999, 14066, 1342, 13, 9166, 29922, 13, 13, 29909, 2319, 1342, 2471, 6445, 278, 8744, 310, 278, 525, 479, 12122, 29915, 10350, 1134, 13, 1454, 15311, 413, 8966, 292, 373, 263, 20745, 29889, 13, 15945, 29908, 13, 13, 3166, 11451, 12748, 2231, 29889, 554, 1053, 16557, 3821, 29968, 8966, 292, 13, 5215, 12655, 408, 7442, 13, 3166, 22889, 1053, 11451, 5317, 408, 14770, 13, 13, 13, 29937, 8561, 445, 1342, 9483, 15520, 29901, 13, 9302, 29889, 8172, 29889, 26776, 29898, 29947, 29929, 29906, 29941, 29929, 29946, 29896, 29941, 29897, 13, 13, 29937, 3251, 403, 4036, 848, 1494, 263, 9090, 18652, 4978, 13, 29937, 310, 7573, 322, 263, 9090, 4978, 310, 1819, 297, 278, 7292, 13, 29937, 518, 29906, 29889, 29900, 29892, 29871, 29945, 29889, 29945, 5387, 13, 29940, 353, 29871, 29955, 13, 12957, 353, 29871, 29941, 29953, 29900, 29889, 29900, 334, 7442, 29889, 8172, 29889, 8172, 29898, 29940, 29897, 13, 5066, 353, 29871, 29896, 29947, 29900, 29889, 29900, 847, 7442, 29889, 1631, 334, 7442, 29889, 279, 2395, 262, 29898, 29906, 334, 7442, 29889, 8172, 29889, 8172, 29898, 29940, 29897, 448, 29871, 29896, 29897, 13, 29920, 353, 29871, 29941, 29889, 29945, 334, 7442, 29889, 8172, 29889, 9502, 29898, 29940, 29897, 718, 29871, 29906, 29889, 29900, 13, 13, 29937, 3251, 403, 263, 4943, 6856, 411, 29871, 29953, 29900, 30073, 28745, 322, 29871, 29941, 29900, 30073, 26271, 6576, 29901, 13, 7720, 29918, 12957, 353, 7442, 29889, 1915, 3493, 29898, 29900, 29889, 29900, 29892, 29871, 29941, 29953, 29900, 29889, 29900, 29892, 29871, 29955, 29897, 13, 7720, 29918, 5066, 353, 7442, 29889, 1915, 3493, 6278, 29929, 29900, 29889, 29900, 29892, 29871, 29929, 29900, 29889, 29900, 29892, 29871, 29955, 29897, 13, 13, 29937, 6204, 15311, 413, 8966, 292, 1203, 29901, 13, 8949, 353, 16557, 3821, 29968, 8966, 292, 29898, 13, 1678, 23123, 29892, 13, 1678, 3405, 29892, 13, 1678, 503, 29892, 13, 1678, 1197, 13342, 29918, 4299, 543, 10660, 613, 13, 1678, 26952, 29922, 8824, 29892, 13, 1678, 9025, 29918, 5317, 1259, 29922, 8824, 29892, 13, 1678, 10350, 29918, 1853, 543, 479, 12122, 613, 13, 29897, 13, 13, 29937, 11080, 1082, 373, 6856, 29901, 13, 29920, 29896, 29892, 17971, 29896, 353, 9280, 29889, 7978, 703, 7720, 613, 6856, 29918, 12957, 29892, 6856, 29918, 5066, 29897, 13, 13, 29937, 6204, 15311, 413, 8966, 292, 1203, 5330, 8253, 27686, 1535, 29901, 13, 8949, 353, 16557, 3821, 29968, 8966, 292, 29898, 13, 1678, 23123, 29892, 3405, 29892, 503, 29892, 1197, 13342, 29918, 4299, 543, 10660, 613, 26952, 29922, 8824, 29892, 9025, 29918, 5317, 1259, 29922, 8824, 13, 29897, 13, 13, 29937, 11080, 1082, 373, 6856, 29901, 13, 29920, 29906, 29892, 17971, 29906, 353, 9280, 29889, 7978, 703, 7720, 613, 6856, 29918, 12957, 29892, 6856, 29918, 5066, 29897, 13, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 29937, 13, 29937, 13905, 848, 472, 1592, 1061, 313, 4230, 28745, 2380, 674, 1510, 3785, 24798, 1125, 13, 13, 2158, 703, 26036, 848, 29901, 1159, 13, 2158, 703, 8208, 4279, 29901, 613, 23123, 29889, 579, 668, 29898, 524, 876, 13, 2158, 703, 13992, 4279, 29901, 9162, 3405, 29889, 579, 668, 29898, 524, 876, 13, 2158, 703, 29920, 29901, 4706, 9162, 7442, 29889, 2378, 29918, 710, 29898, 29920, 29892, 16716, 29922, 29906, 876, 13, 2158, 14182, 29876, 29968, 29878, 2231, 472, 29871, 29953, 29900, 30073, 26271, 3583, 29876, 9166, 2751, 26359, 29897, 13, 2158, 703, 8208, 4279, 29901, 613, 6856, 29918, 12957, 29897, 13, 2158, 703, 1917, 29901, 1678, 9162, 7442, 29889, 2378, 29918, 710, 29898, 29920, 29896, 29961, 29945, 29892, 584, 1402, 16716, 29922, 29906, 876, 13, 2158, 703, 10142, 30088, 29901, 259, 9162, 7442, 29889, 2378, 29918, 710, 29898, 893, 29896, 29961, 29945, 29892, 584, 1402, 16716, 29922, 29906, 876, 13, 2158, 14182, 29876, 17273, 8253, 27686, 1535, 3583, 29876, 9166, 2751, 543, 29897, 13, 2158, 703, 1917, 29901, 1678, 9162, 7442, 29889, 2378, 29918, 710, 29898, 29920, 29906, 29961, 29945, 29892, 584, 1402, 16716, 29922, 29906, 876, 13, 2158, 703, 10142, 30088, 29901, 259, 9162, 7442, 29889, 2378, 29918, 710, 29898, 893, 29906, 29961, 29945, 29892, 584, 1402, 16716, 29922, 29906, 876, 13, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 29937, 13, 29937, 1334, 508, 1074, 393, 278, 848, 1298, 472, 28745, 29871, 29896, 29906, 29906, 29892, 26271, 29871, 29945, 29900, 5149, 13, 29937, 8022, 1078, 278, 413, 8966, 287, 2582, 29892, 1951, 372, 338, 278, 21438, 2943, 297, 26903, 936, 13, 29937, 5418, 12714, 29892, 408, 28745, 12651, 6287, 411, 6776, 29898, 5066, 4279, 467, 13, 29937, 1932, 413, 8966, 292, 773, 28745, 847, 26271, 5608, 368, 29892, 278, 995, 363, 6856, 3291, 13, 29937, 411, 28745, 1819, 4340, 3448, 408, 28745, 338, 1286, 29676, 13, 29937, 7688, 287, 18018, 408, 26271, 29889, 13, 13, 1003, 29892, 313, 1165, 29896, 29892, 4853, 29906, 29897, 353, 14770, 29889, 1491, 26762, 29898, 29896, 29892, 29871, 29906, 29897, 13, 1165, 29896, 29889, 326, 4294, 29898, 29920, 29896, 29892, 15834, 11759, 29900, 29892, 29871, 29941, 29953, 29900, 29892, 448, 29929, 29900, 29892, 29871, 29929, 29900, 1402, 3978, 543, 13609, 1159, 13, 1165, 29896, 29889, 842, 29918, 3257, 703, 24756, 29899, 1111, 24266, 1159, 13, 1165, 29906, 29889, 326, 4294, 29898, 29920, 29906, 29892, 15834, 11759, 29900, 29892, 29871, 29941, 29953, 29900, 29892, 448, 29929, 29900, 29892, 29871, 29929, 29900, 1402, 3978, 543, 13609, 1159, 13, 1165, 29906, 29889, 842, 29918, 3257, 703, 5464, 1737, 29877, 29899, 1111, 24266, 1159, 13, 572, 29873, 29889, 4294, 580, 13, 2 ]
app/core/utils/to_json.py
JordanDekker/ContainR
0
51646
<filename>app/core/utils/to_json.py import pandas as pd import numpy as np import collections import json import math from statistics import median def seq_length_to_json(df): """Convert sequence length distribution to JSON object. Args: df: DataFrame containing a subset of sequence length. Returns: String: A JSON-formatted string for visualization of sequence length distribution. """ json_data = {} for column in list(df): json_values = [] distribution = collections.Counter(df.loc[:, column].dropna().tolist()) for key, value in distribution.items(): json_values.append({"x": int(key), "y": value}) json_data[column] = json_values return json.dumps(json_data) def perc_count_to_json(df): """?""" df_count = pd.Series.to_frame(df) df_count.index.names = ["perc"] return df_count.to_json(orient="table") def get_paired_percentage_to_json(df): """Get a JSON object containing the percentage of True and False paired reads. Args: df: Pandas DataFrame. Returns: String: A JSON-formatted string. """ df = df.loc[df["paired_flag"] == False] df = df if len(df.index) > 0 else df.loc[df["paired_flag"] == True] json_paired_data = [] paired_seqs = df.groupby(["paired"]).size() if paired_seqs.count() < 2: json_paired_data.append({"name": "True", "y": 100}) json_paired_data.append({"name": "False", "y": 0}) return json.dumps(json_paired_data) else: paired_seq_number = paired_seqs.get_values() true_values = paired_seq_number[1] false_values = paired_seq_number[0] total = true_values + false_values true_values_percentage = round((true_values/total)*100, 3) false_values_percentage = round((false_values/total)*100, 3) json_paired_data.append({"name": "True", "y": true_values_percentage}) json_paired_data.append({"name": "False", "y": false_values_percentage}) return json.dumps(json_paired_data) def nucleotide_percentages_to_json(df): """Calculate box plot values from nucleotide percentages. Args: df: A pandas dataframe containing a subset of nucleotide percentages. Returns: json_data: A JSON-formatted list for visualization of nucleotide percentages. """ json_data = [] for pair in enumerate(df.iteritems()): data = list(pair[1][1].values) data = sorted(data) # Calculate quartiles q1, q3 = np.percentile(data,[25,75]) q2 = median(data) # Calculate IQR (Interquartile Range) iqr = q3 - q1 # Define bounds lower_bound = q1 -(1.5 * iqr) upper_bound = q3 +(1.5 * iqr) # Get outliers outliers = [i for i in data if i < lower_bound or i > upper_bound] non_outliers = [i for i in data if i >= lower_bound and i <= upper_bound] # Calculate total reads in every quarter. This includes outliers. # TODO Think about where to use >= or > and < or <=. quarter1 = len([i for i in data if i < q1]) quarter2 = len([i for i in data if i >= q1 and i < q2]) quarter3 = len([i for i in data if i >= q2 and i < q3]) quarter4 = len([i for i in data if i >= q3]) # Min and max within bounds, median, Q's. # The order of these matters for the visualisation in the graph. box_values = [min(non_outliers), q1, q3, max(non_outliers), q2] json_data.append({'x':pair[0],'label':pair[1][0],'y':box_values, 'outliers': outliers, 'quarter1': quarter1, 'quarter2': quarter2, 'quarter3': quarter3, 'quarter4': quarter4}) return json_data
[ 1, 529, 9507, 29958, 932, 29914, 3221, 29914, 13239, 29914, 517, 29918, 3126, 29889, 2272, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 5215, 16250, 13, 5215, 4390, 13, 5215, 5844, 13, 3166, 13964, 1053, 19194, 13, 13, 13, 1753, 19359, 29918, 2848, 29918, 517, 29918, 3126, 29898, 2176, 1125, 13, 1678, 9995, 18455, 5665, 3309, 4978, 304, 4663, 1203, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 4489, 29901, 3630, 4308, 6943, 263, 11306, 310, 5665, 3309, 29889, 13, 268, 13, 1678, 16969, 29901, 13, 4706, 1714, 29901, 319, 4663, 29899, 689, 19667, 1347, 363, 7604, 2133, 310, 5665, 3309, 4978, 29889, 13, 13, 1678, 9995, 13, 1678, 4390, 29918, 1272, 353, 6571, 13, 1678, 363, 1897, 297, 1051, 29898, 2176, 1125, 13, 4706, 4390, 29918, 5975, 353, 5159, 13, 4706, 4978, 353, 16250, 29889, 17779, 29898, 2176, 29889, 2029, 7503, 29892, 1897, 1822, 8865, 1056, 2141, 25027, 391, 3101, 13, 4706, 363, 1820, 29892, 995, 297, 4978, 29889, 7076, 7295, 13, 9651, 4390, 29918, 5975, 29889, 4397, 3319, 29908, 29916, 1115, 938, 29898, 1989, 511, 376, 29891, 1115, 995, 1800, 13, 4706, 4390, 29918, 1272, 29961, 4914, 29962, 353, 4390, 29918, 5975, 13, 1678, 736, 4390, 29889, 29881, 17204, 29898, 3126, 29918, 1272, 29897, 13, 13, 13, 1753, 639, 29883, 29918, 2798, 29918, 517, 29918, 3126, 29898, 2176, 1125, 13, 1678, 9995, 3026, 15945, 13, 1678, 4489, 29918, 2798, 353, 10518, 29889, 19204, 29889, 517, 29918, 2557, 29898, 2176, 29897, 13, 1678, 4489, 29918, 2798, 29889, 2248, 29889, 7039, 353, 6796, 546, 29883, 3108, 13, 1678, 736, 4489, 29918, 2798, 29889, 517, 29918, 3126, 29898, 12236, 543, 2371, 1159, 13, 13, 13, 1753, 679, 29918, 3274, 2859, 29918, 25376, 482, 29918, 517, 29918, 3126, 29898, 2176, 1125, 13, 1678, 9995, 2577, 263, 4663, 1203, 6943, 278, 19649, 310, 5852, 322, 7700, 3300, 2859, 13623, 29889, 13, 268, 13, 1678, 826, 3174, 29901, 13, 4706, 4489, 29901, 349, 7086, 3630, 4308, 29889, 13, 268, 13, 1678, 16969, 29901, 13, 4706, 1714, 29901, 319, 4663, 29899, 689, 19667, 1347, 29889, 13, 13, 1678, 9995, 13, 1678, 4489, 353, 4489, 29889, 2029, 29961, 2176, 3366, 3274, 2859, 29918, 15581, 3108, 1275, 7700, 29962, 13, 1678, 4489, 353, 4489, 565, 7431, 29898, 2176, 29889, 2248, 29897, 1405, 29871, 29900, 1683, 4489, 29889, 2029, 29961, 2176, 3366, 3274, 2859, 29918, 15581, 3108, 1275, 5852, 29962, 13, 1678, 4390, 29918, 3274, 2859, 29918, 1272, 353, 5159, 13, 1678, 3300, 2859, 29918, 11762, 29879, 353, 4489, 29889, 27789, 29898, 3366, 3274, 2859, 3108, 467, 2311, 580, 13, 1678, 565, 3300, 2859, 29918, 11762, 29879, 29889, 2798, 580, 529, 29871, 29906, 29901, 13, 4706, 4390, 29918, 3274, 2859, 29918, 1272, 29889, 4397, 3319, 29908, 978, 1115, 376, 5574, 613, 376, 29891, 1115, 29871, 29896, 29900, 29900, 1800, 13, 4706, 4390, 29918, 3274, 2859, 29918, 1272, 29889, 4397, 3319, 29908, 978, 1115, 376, 8824, 613, 376, 29891, 1115, 29871, 29900, 1800, 13, 4706, 736, 4390, 29889, 29881, 17204, 29898, 3126, 29918, 3274, 2859, 29918, 1272, 29897, 13, 1678, 1683, 29901, 13, 4706, 3300, 2859, 29918, 11762, 29918, 4537, 353, 3300, 2859, 29918, 11762, 29879, 29889, 657, 29918, 5975, 580, 13, 4706, 1565, 29918, 5975, 353, 3300, 2859, 29918, 11762, 29918, 4537, 29961, 29896, 29962, 13, 4706, 2089, 29918, 5975, 353, 3300, 2859, 29918, 11762, 29918, 4537, 29961, 29900, 29962, 13, 4706, 3001, 353, 1565, 29918, 5975, 718, 2089, 29918, 5975, 13, 4706, 1565, 29918, 5975, 29918, 25376, 482, 353, 4513, 3552, 3009, 29918, 5975, 29914, 7827, 11877, 29896, 29900, 29900, 29892, 29871, 29941, 29897, 13, 4706, 2089, 29918, 5975, 29918, 25376, 482, 353, 4513, 3552, 4541, 29918, 5975, 29914, 7827, 11877, 29896, 29900, 29900, 29892, 29871, 29941, 29897, 13, 4706, 4390, 29918, 3274, 2859, 29918, 1272, 29889, 4397, 3319, 29908, 978, 1115, 376, 5574, 613, 376, 29891, 1115, 1565, 29918, 5975, 29918, 25376, 482, 1800, 13, 4706, 4390, 29918, 3274, 2859, 29918, 1272, 29889, 4397, 3319, 29908, 978, 1115, 376, 8824, 613, 376, 29891, 1115, 2089, 29918, 5975, 29918, 25376, 482, 1800, 13, 4706, 736, 4390, 29889, 29881, 17204, 29898, 3126, 29918, 3274, 2859, 29918, 1272, 29897, 13, 13, 13, 1753, 22699, 327, 680, 29918, 25376, 1179, 29918, 517, 29918, 3126, 29898, 2176, 1125, 13, 1678, 9995, 27065, 403, 3800, 6492, 1819, 515, 22699, 327, 680, 10151, 1179, 29889, 13, 268, 13, 1678, 826, 3174, 29901, 13, 4706, 4489, 29901, 319, 11701, 12205, 6943, 263, 11306, 310, 22699, 327, 680, 10151, 1179, 29889, 13, 268, 13, 1678, 16969, 29901, 13, 4706, 4390, 29918, 1272, 29901, 319, 4663, 29899, 689, 19667, 1051, 363, 7604, 2133, 310, 22699, 327, 680, 10151, 1179, 29889, 13, 13, 1678, 9995, 13, 1678, 4390, 29918, 1272, 353, 5159, 13, 13, 1678, 363, 5101, 297, 26985, 29898, 2176, 29889, 1524, 7076, 580, 1125, 13, 4706, 848, 353, 1051, 29898, 18784, 29961, 29896, 3816, 29896, 1822, 5975, 29897, 13, 4706, 848, 353, 12705, 29898, 1272, 29897, 13, 13, 4706, 396, 20535, 403, 10256, 5475, 13, 4706, 3855, 29896, 29892, 3855, 29941, 353, 7442, 29889, 25376, 488, 29898, 1272, 17094, 29906, 29945, 29892, 29955, 29945, 2314, 13, 4706, 3855, 29906, 353, 19194, 29898, 1272, 29897, 13, 308, 13, 4706, 396, 20535, 403, 306, 29984, 29934, 313, 4074, 339, 442, 488, 12146, 29897, 13, 4706, 474, 29939, 29878, 353, 3855, 29941, 448, 3855, 29896, 13, 308, 13, 4706, 396, 22402, 13451, 13, 4706, 5224, 29918, 9917, 353, 3855, 29896, 19691, 29896, 29889, 29945, 334, 474, 29939, 29878, 29897, 29871, 13, 4706, 7568, 29918, 9917, 353, 3855, 29941, 718, 29898, 29896, 29889, 29945, 334, 474, 29939, 29878, 29897, 29871, 13, 308, 13, 4706, 396, 3617, 714, 27801, 13, 4706, 714, 27801, 353, 518, 29875, 363, 474, 297, 848, 565, 474, 529, 5224, 29918, 9917, 470, 474, 1405, 7568, 29918, 9917, 29962, 13, 4706, 1661, 29918, 449, 27801, 353, 518, 29875, 363, 474, 297, 848, 565, 474, 6736, 5224, 29918, 9917, 322, 474, 5277, 7568, 29918, 9917, 29962, 13, 13, 4706, 396, 20535, 403, 3001, 13623, 297, 1432, 12616, 29889, 910, 7805, 714, 27801, 29889, 13, 4706, 396, 14402, 25086, 1048, 988, 304, 671, 6736, 470, 1405, 322, 529, 470, 5277, 29889, 13, 4706, 12616, 29896, 353, 7431, 4197, 29875, 363, 474, 297, 848, 565, 474, 529, 3855, 29896, 2314, 13, 4706, 12616, 29906, 353, 7431, 4197, 29875, 363, 474, 297, 848, 565, 474, 6736, 3855, 29896, 322, 474, 529, 3855, 29906, 2314, 13, 4706, 12616, 29941, 353, 7431, 4197, 29875, 363, 474, 297, 848, 565, 474, 6736, 3855, 29906, 322, 474, 529, 3855, 29941, 2314, 13, 4706, 12616, 29946, 353, 7431, 4197, 29875, 363, 474, 297, 848, 565, 474, 6736, 3855, 29941, 2314, 13, 308, 13, 4706, 396, 3080, 322, 4236, 2629, 13451, 29892, 19194, 29892, 660, 29915, 29879, 29889, 13, 4706, 396, 450, 1797, 310, 1438, 13750, 363, 278, 7604, 4371, 297, 278, 3983, 29889, 13, 4706, 3800, 29918, 5975, 353, 518, 1195, 29898, 5464, 29918, 449, 27801, 511, 3855, 29896, 29892, 3855, 29941, 29892, 4236, 29898, 5464, 29918, 449, 27801, 511, 3855, 29906, 29962, 13, 4706, 4390, 29918, 1272, 29889, 4397, 3319, 29915, 29916, 2396, 18784, 29961, 29900, 1402, 29915, 1643, 2396, 18784, 29961, 29896, 3816, 29900, 1402, 29915, 29891, 2396, 1884, 29918, 5975, 29892, 525, 449, 27801, 2396, 714, 27801, 29892, 525, 339, 4254, 29896, 2396, 12616, 29896, 29892, 525, 339, 4254, 29906, 2396, 12616, 29906, 29892, 525, 339, 4254, 29941, 2396, 12616, 29941, 29892, 525, 339, 4254, 29946, 2396, 12616, 29946, 1800, 13, 13, 1678, 736, 4390, 29918, 1272, 13, 2 ]
src/zope/app/publisher/xmlrpc/metaconfigure.py
zopefoundation/zope.app.publisher
1
66356
<filename>src/zope/app/publisher/xmlrpc/metaconfigure.py ############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """XMLRPC configuration code""" from zope.interface import Interface from zope.configuration.exceptions import ConfigurationError from zope.security.checker import CheckerPublic, Checker from zope.security.checker import getCheckerForInstancesOf from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest from zope.component.interface import provideInterface from zope.component.zcml import handler from zope.app.publisher.xmlrpc import MethodPublisher def view(_context, for_=None, interface=None, methods=None, class_=None, permission=None, name=None): interface = interface or [] methods = methods or [] # If there were special permission settings provided, then use them if permission == 'zope.Public': permission = CheckerPublic require = {} for attr_name in methods: require[attr_name] = permission if interface: for iface in interface: for field_name in iface: require[field_name] = permission _context.action( discriminator=None, callable=provideInterface, args=('', for_) ) # Make sure that the class inherits MethodPublisher, so that the views # have a location if class_ is None: class_ = original_class = MethodPublisher else: original_class = class_ class_ = type(class_.__name__, (class_, MethodPublisher), {}) if name: # Register a single view if permission: checker = Checker(require) def proxyView(context, request, class_=class_, checker=checker): view = class_(context, request) # We need this in case the resource gets unwrapped and # needs to be rewrapped view.__Security_checker__ = checker return view class_ = proxyView class_.factory = original_class else: # No permission was defined, so we defer to the checker # of the original class def proxyView(context, request, class_=class_): view = class_(context, request) view.__Security_checker__ = getCheckerForInstancesOf( original_class) return view class_ = proxyView class_.factory = original_class # Register the new view. _context.action( discriminator=('view', for_, name, IXMLRPCRequest), callable=handler, args=('registerAdapter', class_, (for_, IXMLRPCRequest), Interface, name, _context.info) ) else: if permission: checker = Checker({'__call__': permission}) else: raise ConfigurationError( "XML/RPC view has neither a name nor a permission. " "You have to specify at least one of the two.") for name in require: # create a new callable class with a security checker; cdict = {'__Security_checker__': checker, '__call__': getattr(class_, name)} new_class = type(class_.__name__, (class_,), cdict) _context.action( discriminator=('view', for_, name, IXMLRPCRequest), callable=handler, args=('registerAdapter', new_class, (for_, IXMLRPCRequest), Interface, name, _context.info) ) # Register the used interfaces with the site manager if for_ is not None: _context.action( discriminator=None, callable=provideInterface, args=('', for_) )
[ 1, 529, 9507, 29958, 4351, 29914, 29920, 2300, 29914, 932, 29914, 23679, 261, 29914, 3134, 29878, 6739, 29914, 7299, 17591, 29889, 2272, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 13, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29900, 29896, 29892, 29871, 29906, 29900, 29900, 29906, 796, 2300, 10606, 322, 2866, 1091, 29560, 29889, 13, 29937, 2178, 26863, 2538, 9841, 29889, 13, 29937, 13, 29937, 910, 7047, 338, 4967, 304, 278, 1326, 12112, 310, 278, 796, 2300, 5236, 19245, 29892, 13, 29937, 10079, 29871, 29906, 29889, 29896, 313, 29999, 7390, 467, 29871, 319, 3509, 310, 278, 796, 7390, 881, 10259, 1384, 445, 4978, 29889, 13, 29937, 3446, 3235, 7791, 7818, 12982, 1525, 8519, 13756, 13044, 3352, 376, 3289, 8519, 29908, 5300, 13764, 29979, 5300, 15149, 8528, 15094, 1799, 6323, 306, 3580, 5265, 3352, 13, 29937, 399, 1718, 29934, 13566, 29059, 319, 1525, 28657, 13875, 8890, 29928, 29892, 2672, 6154, 15789, 4214, 29892, 350, 2692, 6058, 27848, 3352, 7495, 29892, 6093, 306, 3580, 5265, 3352, 13, 29937, 399, 1718, 29934, 13566, 29059, 8079, 323, 1806, 1307, 29892, 341, 1001, 3210, 13566, 2882, 6227, 11937, 29892, 319, 12739, 25580, 2672, 15860, 1177, 1692, 13780, 29892, 5300, 383, 1806, 8186, 1799, 13, 29937, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 29889, 13, 29937, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 13, 15945, 29908, 9165, 29934, 9026, 5285, 775, 15945, 29908, 13, 3166, 503, 2300, 29889, 13248, 1053, 25796, 13, 3166, 503, 2300, 29889, 13305, 29889, 11739, 29879, 1053, 20999, 2392, 13, 3166, 503, 2300, 29889, 8926, 29889, 3198, 261, 1053, 5399, 261, 19858, 29892, 5399, 261, 13, 3166, 503, 2300, 29889, 8926, 29889, 3198, 261, 1053, 679, 5596, 261, 2831, 3379, 2925, 2776, 13, 3166, 503, 2300, 29889, 23679, 261, 29889, 1639, 8726, 29889, 3134, 29878, 6739, 1053, 306, 9165, 29934, 9026, 3089, 13, 3166, 503, 2300, 29889, 9700, 29889, 13248, 1053, 3867, 10448, 13, 3166, 503, 2300, 29889, 9700, 29889, 29920, 29883, 828, 1053, 7834, 13, 13, 3166, 503, 2300, 29889, 932, 29889, 23679, 261, 29889, 3134, 29878, 6739, 1053, 8108, 21076, 1674, 261, 13, 13, 13, 1753, 1776, 7373, 4703, 29892, 363, 29918, 29922, 8516, 29892, 5067, 29922, 8516, 29892, 3519, 29922, 8516, 29892, 13, 308, 770, 29918, 29922, 8516, 29892, 10751, 29922, 8516, 29892, 1024, 29922, 8516, 1125, 13, 13, 1678, 5067, 353, 5067, 470, 5159, 13, 1678, 3519, 353, 3519, 470, 5159, 13, 13, 1678, 396, 960, 727, 892, 4266, 10751, 6055, 4944, 29892, 769, 671, 963, 13, 1678, 565, 10751, 1275, 525, 29920, 2300, 29889, 19858, 2396, 13, 4706, 10751, 353, 5399, 261, 19858, 13, 13, 1678, 1996, 353, 6571, 13, 1678, 363, 12421, 29918, 978, 297, 3519, 29901, 13, 4706, 1996, 29961, 5552, 29918, 978, 29962, 353, 10751, 13, 13, 1678, 565, 5067, 29901, 13, 4706, 363, 565, 815, 297, 5067, 29901, 13, 9651, 363, 1746, 29918, 978, 297, 565, 815, 29901, 13, 18884, 1996, 29961, 2671, 29918, 978, 29962, 353, 10751, 13, 9651, 903, 4703, 29889, 2467, 29898, 13, 18884, 2313, 20386, 1061, 29922, 8516, 29892, 13, 18884, 1246, 519, 29922, 16123, 680, 10448, 29892, 13, 18884, 6389, 29922, 877, 742, 363, 19925, 13, 9651, 1723, 13, 13, 1678, 396, 8561, 1854, 393, 278, 770, 7846, 1169, 8108, 21076, 1674, 261, 29892, 577, 393, 278, 8386, 13, 1678, 396, 505, 263, 4423, 13, 1678, 565, 770, 29918, 338, 6213, 29901, 13, 4706, 770, 29918, 353, 2441, 29918, 1990, 353, 8108, 21076, 1674, 261, 13, 1678, 1683, 29901, 13, 4706, 2441, 29918, 1990, 353, 770, 29918, 13, 4706, 770, 29918, 353, 1134, 29898, 1990, 5396, 1649, 978, 1649, 29892, 313, 1990, 3383, 8108, 21076, 1674, 261, 511, 426, 1800, 13, 13, 1678, 565, 1024, 29901, 13, 4706, 396, 12577, 263, 2323, 1776, 13, 13, 4706, 565, 10751, 29901, 13, 9651, 1423, 261, 353, 5399, 261, 29898, 12277, 29897, 13, 13, 9651, 822, 10166, 1043, 29898, 4703, 29892, 2009, 29892, 770, 29918, 29922, 1990, 3383, 1423, 261, 29922, 3198, 261, 1125, 13, 18884, 1776, 353, 770, 23538, 4703, 29892, 2009, 29897, 13, 18884, 396, 1334, 817, 445, 297, 1206, 278, 6503, 4947, 18500, 336, 2986, 322, 13, 18884, 396, 4225, 304, 367, 337, 29893, 336, 2986, 13, 18884, 1776, 17255, 13228, 29918, 3198, 261, 1649, 353, 1423, 261, 13, 18884, 736, 1776, 13, 13, 9651, 770, 29918, 353, 10166, 1043, 13, 9651, 770, 5396, 14399, 353, 2441, 29918, 1990, 13, 4706, 1683, 29901, 13, 9651, 396, 1939, 10751, 471, 3342, 29892, 577, 591, 316, 571, 304, 278, 1423, 261, 13, 9651, 396, 310, 278, 2441, 770, 13, 9651, 822, 10166, 1043, 29898, 4703, 29892, 2009, 29892, 770, 29918, 29922, 1990, 29918, 1125, 13, 18884, 1776, 353, 770, 23538, 4703, 29892, 2009, 29897, 13, 18884, 1776, 17255, 13228, 29918, 3198, 261, 1649, 353, 679, 5596, 261, 2831, 3379, 2925, 2776, 29898, 13, 462, 1678, 2441, 29918, 1990, 29897, 13, 18884, 736, 1776, 13, 9651, 770, 29918, 353, 10166, 1043, 13, 9651, 770, 5396, 14399, 353, 2441, 29918, 1990, 13, 13, 4706, 396, 12577, 278, 716, 1776, 29889, 13, 4706, 903, 4703, 29889, 2467, 29898, 13, 9651, 2313, 20386, 1061, 29922, 877, 1493, 742, 363, 3383, 1024, 29892, 306, 9165, 29934, 9026, 3089, 511, 13, 9651, 1246, 519, 29922, 13789, 29892, 13, 9651, 6389, 29922, 877, 9573, 6168, 742, 13, 462, 29871, 770, 3383, 313, 1454, 3383, 306, 9165, 29934, 9026, 3089, 511, 25796, 29892, 1024, 29892, 13, 462, 29871, 903, 4703, 29889, 3888, 29897, 13, 4706, 1723, 13, 1678, 1683, 29901, 13, 4706, 565, 10751, 29901, 13, 9651, 1423, 261, 353, 5399, 261, 3319, 29915, 1649, 4804, 1649, 2396, 10751, 1800, 13, 4706, 1683, 29901, 13, 9651, 12020, 20999, 2392, 29898, 13, 18884, 376, 9165, 29914, 29934, 9026, 1776, 756, 9561, 263, 1024, 3643, 263, 10751, 29889, 376, 13, 18884, 376, 3492, 505, 304, 6084, 472, 3203, 697, 310, 278, 1023, 23157, 13, 13, 4706, 363, 1024, 297, 1996, 29901, 13, 9651, 396, 1653, 263, 716, 1246, 519, 770, 411, 263, 6993, 1423, 261, 29936, 13, 9651, 274, 8977, 353, 11117, 1649, 13228, 29918, 3198, 261, 1649, 2396, 1423, 261, 29892, 13, 462, 268, 525, 1649, 4804, 1649, 2396, 679, 5552, 29898, 1990, 3383, 1024, 2915, 13, 9651, 716, 29918, 1990, 353, 1134, 29898, 1990, 5396, 1649, 978, 1649, 29892, 313, 1990, 3383, 511, 274, 8977, 29897, 13, 9651, 903, 4703, 29889, 2467, 29898, 13, 18884, 2313, 20386, 1061, 29922, 877, 1493, 742, 363, 3383, 1024, 29892, 306, 9165, 29934, 9026, 3089, 511, 13, 18884, 1246, 519, 29922, 13789, 29892, 13, 18884, 6389, 29922, 877, 9573, 6168, 742, 13, 462, 418, 716, 29918, 1990, 29892, 313, 1454, 3383, 306, 9165, 29934, 9026, 3089, 511, 25796, 29892, 1024, 29892, 13, 462, 418, 903, 4703, 29889, 3888, 29897, 13, 9651, 1723, 13, 13, 1678, 396, 12577, 278, 1304, 19510, 411, 278, 3268, 8455, 13, 1678, 565, 363, 29918, 338, 451, 6213, 29901, 13, 4706, 903, 4703, 29889, 2467, 29898, 13, 9651, 2313, 20386, 1061, 29922, 8516, 29892, 13, 9651, 1246, 519, 29922, 16123, 680, 10448, 29892, 13, 9651, 6389, 29922, 877, 742, 363, 19925, 13, 4706, 1723, 13, 2 ]
Cura/Uranium/UM/Scene/Scene.py
TIAO-JI-FU/3d-printing-with-moveo-1
0
128974
<filename>Cura/Uranium/UM/Scene/Scene.py # Copyright (c) 2018 <NAME>. # Uranium is released under the terms of the LGPLv3 or higher. import functools # For partial to update files that were changed. import os.path # To watch files for changes. import threading from typing import Callable, List, Optional, Set from PyQt5.QtCore import QFileSystemWatcher # To watch files for changes. from UM.Decorators import deprecated from UM.Logger import Logger from UM.Mesh.ReadMeshJob import ReadMeshJob # To reload a mesh when its file was changed. from UM.Message import Message # To display a message for reloading files that were changed. from UM.Scene.Camera import Camera from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.Scene.SceneNode import SceneNode from UM.Signal import Signal, signalemitter from UM.i18n import i18nCatalog from UM.Platform import Platform i18n_catalog = i18nCatalog("uranium") ## Container object for the scene graph # # The main purpose of this class is to provide the root SceneNode. @signalemitter class Scene: def __init__(self) -> None: super().__init__() from UM.Scene.SceneNode import SceneNode self._root = SceneNode(name = "Root") self._root.setCalculateBoundingBox(False) self._connectSignalsRoot() self._active_camera = None # type: Optional[Camera] self._ignore_scene_changes = False self._lock = threading.Lock() # Watching file for changes. self._file_watcher = QFileSystemWatcher() self._file_watcher.fileChanged.connect(self._onFileChanged) self._reload_message = None # type: Optional[Message] self._callbacks = set() # type: Set[Callable] # Need to keep these in memory. This is a memory leak every time you refresh, but a tiny one. def _connectSignalsRoot(self) -> None: self._root.transformationChanged.connect(self.sceneChanged) self._root.childrenChanged.connect(self.sceneChanged) self._root.meshDataChanged.connect(self.sceneChanged) def _disconnectSignalsRoot(self) -> None: self._root.transformationChanged.disconnect(self.sceneChanged) self._root.childrenChanged.disconnect(self.sceneChanged) self._root.meshDataChanged.disconnect(self.sceneChanged) def setIgnoreSceneChanges(self, ignore_scene_changes: bool) -> None: if self._ignore_scene_changes != ignore_scene_changes: self._ignore_scene_changes = ignore_scene_changes if self._ignore_scene_changes: self._disconnectSignalsRoot() else: self._connectSignalsRoot() ## Gets the global scene lock. # # Use this lock to prevent any read or write actions on the scene from other threads, # assuming those threads also properly acquire the lock. Most notably, this # prevents the rendering thread from rendering the scene while it is changing. def getSceneLock(self) -> threading.Lock: return self._lock ## Get the root node of the scene. def getRoot(self) -> "SceneNode": return self._root ## Change the root node of the scene def setRoot(self, node: "SceneNode") -> None: if self._root != node: if not self._ignore_scene_changes: self._disconnectSignalsRoot() self._root = node if not self._ignore_scene_changes: self._connectSignalsRoot() self.rootChanged.emit() rootChanged = Signal() ## Get the camera that should be used for rendering. def getActiveCamera(self) -> Optional[Camera]: return self._active_camera def getAllCameras(self) -> List[Camera]: cameras = [] for node in BreadthFirstIterator(self._root): if isinstance(node, Camera): cameras.append(node) return cameras ## Set the camera that should be used for rendering. # \param name The name of the camera to use. def setActiveCamera(self, name: str) -> None: camera = self.findCamera(name) if camera and camera != self._active_camera: if self._active_camera: self._active_camera.perspectiveChanged.disconnect(self.sceneChanged) self._active_camera = camera self._active_camera.perspectiveChanged.connect(self.sceneChanged) else: Logger.log("w", "Couldn't find camera with name [%s] to activate!" % name) ## Signal that is emitted whenever something in the scene changes. # \param object The object that triggered the change. sceneChanged = Signal() ## Find an object by id. # # \param object_id The id of the object to search for, as returned by the python id() method. # # \return The object if found, or None if not. def findObject(self, object_id: int) -> Optional["SceneNode"]: for node in BreadthFirstIterator(self._root): if id(node) == object_id: return node return None def findCamera(self, name: str) -> Optional[Camera]: for node in BreadthFirstIterator(self._root): if isinstance(node, Camera) and node.getName() == name: return node return None ## Add a file to be watched for changes. # \param file_path The path to the file that must be watched. def addWatchedFile(self, file_path: str) -> None: # The QT 5.10.0 issue, only on Windows. Cura crashes after loading a stl file from USB/sd-card/Cloud-based drive if not Platform.isWindows(): self._file_watcher.addPath(file_path) ## Remove a file so that it will no longer be watched for changes. # \param file_path The path to the file that must no longer be watched. def removeWatchedFile(self, file_path: str) -> None: # The QT 5.10.0 issue, only on Windows. Cura crashes after loading a stl file from USB/sd-card/Cloud-based drive if not Platform.isWindows(): self._file_watcher.removePath(file_path) ## Triggered whenever a file is changed that we currently have loaded. def _onFileChanged(self, file_path: str) -> None: if not os.path.isfile(file_path) or os.path.getsize(file_path) == 0: # File doesn't exist any more, or it is empty return # Multiple nodes may be loaded from the same file at different stages. Reload them all. from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator # To find which nodes to reload when files have changed. modified_nodes = [node for node in DepthFirstIterator(self.getRoot()) if node.getMeshData() and node.getMeshData().getFileName() == file_path] # type: ignore if modified_nodes: # Hide the message if it was already visible if self._reload_message is not None: self._reload_message.hide() self._reload_message = Message(i18n_catalog.i18nc("@info", "Would you like to reload {filename}?").format(filename = os.path.basename(file_path)), title = i18n_catalog.i18nc("@info:title", "File has been modified")) self._reload_message.addAction("reload", i18n_catalog.i18nc("@action:button", "Reload"), icon = "", description = i18n_catalog.i18nc("@action:description", "This will trigger the modified files to reload from disk.")) self._reload_callback = functools.partial(self._reloadNodes, modified_nodes) self._reload_message.actionTriggered.connect(self._reload_callback) self._reload_message.show() ## Reloads a list of nodes after the user pressed the "Reload" button. # \param nodes The list of nodes that needs to be reloaded. # \param message The message that triggered the action to reload them. # \param action The button that triggered the action to reload them. def _reloadNodes(self, nodes: List["SceneNode"], message: str, action: str) -> None: if action != "reload": return if self._reload_message is not None: self._reload_message.hide() for node in nodes: meshdata = node.getMeshData() if meshdata: filename = meshdata.getFileName() if not filename or not os.path.isfile(filename): # File doesn't exist any more. continue job = ReadMeshJob(filename) reload_finished_callback = functools.partial(self._reloadJobFinished, node) self._callbacks.add(reload_finished_callback) #Store it so it won't get garbage collected. This is a memory leak, but just one partial per reload so it's not much. job.finished.connect(reload_finished_callback) job.start() ## Triggered when reloading has finished. # # This then puts the resulting mesh data in the node. def _reloadJobFinished(self, replaced_node: SceneNode, job: ReadMeshJob) -> None: for node in job.getResult(): mesh_data = node.getMeshData() if mesh_data: replaced_node.setMeshData(mesh_data) else: Logger.log("w", "Could not find a mesh in reloaded node.")
[ 1, 529, 9507, 29958, 29907, 2002, 29914, 29965, 661, 1974, 29914, 5005, 29914, 23472, 29914, 23472, 29889, 2272, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29947, 529, 5813, 15513, 13, 29937, 501, 661, 1974, 338, 5492, 1090, 278, 4958, 310, 278, 365, 29954, 7390, 29894, 29941, 470, 6133, 29889, 13, 13, 5215, 2090, 312, 8789, 29871, 396, 1152, 7687, 304, 2767, 2066, 393, 892, 3939, 29889, 13, 5215, 2897, 29889, 2084, 29871, 396, 1763, 6505, 2066, 363, 3620, 29889, 13, 5215, 3244, 292, 13, 3166, 19229, 1053, 8251, 519, 29892, 2391, 29892, 28379, 29892, 3789, 13, 13, 3166, 10772, 17303, 29945, 29889, 17303, 9203, 1053, 660, 2283, 3924, 24709, 261, 29871, 396, 1763, 6505, 2066, 363, 3620, 29889, 13, 13, 3166, 501, 29924, 29889, 6185, 272, 4097, 1053, 18164, 13, 3166, 501, 29924, 29889, 16363, 1053, 28468, 13, 3166, 501, 29924, 29889, 29924, 12094, 29889, 6359, 29924, 12094, 11947, 1053, 7523, 29924, 12094, 11947, 29871, 396, 1763, 19763, 263, 27716, 746, 967, 934, 471, 3939, 29889, 13, 3166, 501, 29924, 29889, 3728, 1053, 7777, 29871, 396, 1763, 2479, 263, 2643, 363, 337, 13234, 2066, 393, 892, 3939, 29889, 13, 3166, 501, 29924, 29889, 23472, 29889, 20717, 1053, 24321, 13, 3166, 501, 29924, 29889, 23472, 29889, 20277, 29889, 29933, 949, 386, 6730, 20277, 1053, 350, 949, 386, 6730, 20277, 13, 3166, 501, 29924, 29889, 23472, 29889, 23472, 4247, 1053, 2522, 1600, 4247, 13, 3166, 501, 29924, 29889, 10140, 284, 1053, 9954, 284, 29892, 1804, 744, 2415, 357, 13, 3166, 501, 29924, 29889, 29875, 29896, 29947, 29876, 1053, 474, 29896, 29947, 29876, 29907, 3968, 13, 3166, 501, 29924, 29889, 21889, 1053, 28096, 13, 13, 29875, 29896, 29947, 29876, 29918, 28045, 353, 474, 29896, 29947, 29876, 29907, 3968, 703, 332, 273, 1974, 1159, 13, 13, 13, 2277, 29871, 21679, 1203, 363, 278, 9088, 3983, 13, 29937, 13, 29937, 259, 450, 1667, 6437, 310, 445, 770, 338, 304, 3867, 278, 3876, 2522, 1600, 4247, 29889, 13, 29992, 4530, 744, 2415, 357, 13, 1990, 2522, 1600, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29897, 1599, 6213, 29901, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 13, 4706, 515, 501, 29924, 29889, 23472, 29889, 23472, 4247, 1053, 2522, 1600, 4247, 13, 4706, 1583, 3032, 4632, 353, 2522, 1600, 4247, 29898, 978, 353, 376, 10303, 1159, 13, 4706, 1583, 3032, 4632, 29889, 842, 27065, 403, 29933, 12449, 3313, 29898, 8824, 29897, 13, 4706, 1583, 3032, 6915, 10140, 1338, 10303, 580, 13, 4706, 1583, 3032, 4925, 29918, 26065, 353, 6213, 29871, 396, 1134, 29901, 28379, 29961, 20717, 29962, 13, 4706, 1583, 3032, 17281, 29918, 24645, 29918, 25990, 353, 7700, 13, 4706, 1583, 3032, 908, 353, 3244, 292, 29889, 16542, 580, 13, 13, 4706, 396, 24274, 292, 934, 363, 3620, 29889, 13, 4706, 1583, 3032, 1445, 29918, 12344, 261, 353, 660, 2283, 3924, 24709, 261, 580, 13, 4706, 1583, 3032, 1445, 29918, 12344, 261, 29889, 1445, 7590, 29889, 6915, 29898, 1311, 3032, 265, 2283, 7590, 29897, 13, 13, 4706, 1583, 3032, 28120, 29918, 4906, 353, 6213, 29871, 396, 1134, 29901, 28379, 29961, 3728, 29962, 13, 4706, 1583, 3032, 14035, 29879, 353, 731, 580, 396, 1134, 29901, 3789, 29961, 5594, 519, 29962, 396, 20768, 304, 3013, 1438, 297, 3370, 29889, 910, 338, 263, 3370, 24993, 1432, 931, 366, 11086, 29892, 541, 263, 21577, 697, 29889, 13, 13, 1678, 822, 903, 6915, 10140, 1338, 10303, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 1583, 3032, 4632, 29889, 3286, 5404, 7590, 29889, 6915, 29898, 1311, 29889, 24645, 7590, 29897, 13, 4706, 1583, 3032, 4632, 29889, 11991, 7590, 29889, 6915, 29898, 1311, 29889, 24645, 7590, 29897, 13, 4706, 1583, 3032, 4632, 29889, 4467, 29882, 1469, 7590, 29889, 6915, 29898, 1311, 29889, 24645, 7590, 29897, 13, 13, 1678, 822, 903, 2218, 6915, 10140, 1338, 10303, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 1583, 3032, 4632, 29889, 3286, 5404, 7590, 29889, 2218, 6915, 29898, 1311, 29889, 24645, 7590, 29897, 13, 4706, 1583, 3032, 4632, 29889, 11991, 7590, 29889, 2218, 6915, 29898, 1311, 29889, 24645, 7590, 29897, 13, 4706, 1583, 3032, 4632, 29889, 4467, 29882, 1469, 7590, 29889, 2218, 6915, 29898, 1311, 29889, 24645, 7590, 29897, 13, 13, 1678, 822, 731, 23805, 23472, 21459, 29898, 1311, 29892, 11455, 29918, 24645, 29918, 25990, 29901, 6120, 29897, 1599, 6213, 29901, 13, 4706, 565, 1583, 3032, 17281, 29918, 24645, 29918, 25990, 2804, 11455, 29918, 24645, 29918, 25990, 29901, 13, 9651, 1583, 3032, 17281, 29918, 24645, 29918, 25990, 353, 11455, 29918, 24645, 29918, 25990, 13, 9651, 565, 1583, 3032, 17281, 29918, 24645, 29918, 25990, 29901, 13, 18884, 1583, 3032, 2218, 6915, 10140, 1338, 10303, 580, 13, 9651, 1683, 29901, 13, 18884, 1583, 3032, 6915, 10140, 1338, 10303, 580, 13, 13, 1678, 444, 29871, 402, 1691, 278, 5534, 9088, 7714, 29889, 13, 1678, 396, 13, 1678, 396, 259, 4803, 445, 7714, 304, 5557, 738, 1303, 470, 2436, 8820, 373, 278, 9088, 515, 916, 9717, 29892, 13, 1678, 396, 259, 10241, 1906, 9717, 884, 6284, 1274, 1548, 278, 7714, 29889, 7849, 451, 2197, 29892, 445, 13, 1678, 396, 259, 28057, 278, 15061, 3244, 515, 15061, 278, 9088, 1550, 372, 338, 6480, 29889, 13, 1678, 822, 679, 23472, 16542, 29898, 1311, 29897, 1599, 3244, 292, 29889, 16542, 29901, 13, 4706, 736, 1583, 3032, 908, 13, 13, 1678, 444, 29871, 3617, 278, 3876, 2943, 310, 278, 9088, 29889, 13, 1678, 822, 679, 10303, 29898, 1311, 29897, 1599, 376, 23472, 4247, 1115, 13, 4706, 736, 1583, 3032, 4632, 13, 13, 1678, 444, 29871, 10726, 278, 3876, 2943, 310, 278, 9088, 13, 1678, 822, 731, 10303, 29898, 1311, 29892, 2943, 29901, 376, 23472, 4247, 1159, 1599, 6213, 29901, 13, 4706, 565, 1583, 3032, 4632, 2804, 2943, 29901, 13, 9651, 565, 451, 1583, 3032, 17281, 29918, 24645, 29918, 25990, 29901, 13, 18884, 1583, 3032, 2218, 6915, 10140, 1338, 10303, 580, 13, 9651, 1583, 3032, 4632, 353, 2943, 13, 9651, 565, 451, 1583, 3032, 17281, 29918, 24645, 29918, 25990, 29901, 13, 18884, 1583, 3032, 6915, 10140, 1338, 10303, 580, 13, 9651, 1583, 29889, 4632, 7590, 29889, 21976, 580, 13, 13, 1678, 3876, 7590, 353, 9954, 284, 580, 13, 13, 1678, 444, 29871, 3617, 278, 10656, 393, 881, 367, 1304, 363, 15061, 29889, 13, 1678, 822, 679, 9966, 20717, 29898, 1311, 29897, 1599, 28379, 29961, 20717, 5387, 13, 4706, 736, 1583, 3032, 4925, 29918, 26065, 13, 13, 1678, 822, 679, 3596, 29907, 4183, 294, 29898, 1311, 29897, 1599, 2391, 29961, 20717, 5387, 13, 4706, 3949, 18464, 353, 5159, 13, 4706, 363, 2943, 297, 350, 949, 386, 6730, 20277, 29898, 1311, 3032, 4632, 1125, 13, 9651, 565, 338, 8758, 29898, 3177, 29892, 24321, 1125, 13, 18884, 3949, 18464, 29889, 4397, 29898, 3177, 29897, 13, 4706, 736, 3949, 18464, 13, 13, 1678, 444, 29871, 3789, 278, 10656, 393, 881, 367, 1304, 363, 15061, 29889, 13, 1678, 396, 259, 320, 3207, 1024, 450, 1024, 310, 278, 10656, 304, 671, 29889, 13, 1678, 822, 731, 9966, 20717, 29898, 1311, 29892, 1024, 29901, 851, 29897, 1599, 6213, 29901, 13, 4706, 10656, 353, 1583, 29889, 2886, 20717, 29898, 978, 29897, 13, 4706, 565, 10656, 322, 10656, 2804, 1583, 3032, 4925, 29918, 26065, 29901, 13, 9651, 565, 1583, 3032, 4925, 29918, 26065, 29901, 13, 18884, 1583, 3032, 4925, 29918, 26065, 29889, 6774, 12645, 7590, 29889, 2218, 6915, 29898, 1311, 29889, 24645, 7590, 29897, 13, 9651, 1583, 3032, 4925, 29918, 26065, 353, 10656, 13, 9651, 1583, 3032, 4925, 29918, 26065, 29889, 6774, 12645, 7590, 29889, 6915, 29898, 1311, 29889, 24645, 7590, 29897, 13, 4706, 1683, 29901, 13, 9651, 28468, 29889, 1188, 703, 29893, 613, 376, 23323, 29876, 29915, 29873, 1284, 10656, 411, 1024, 518, 29995, 29879, 29962, 304, 5039, 403, 3850, 1273, 1024, 29897, 13, 13, 1678, 444, 29871, 9954, 284, 393, 338, 953, 4430, 10940, 1554, 297, 278, 9088, 3620, 29889, 13, 1678, 396, 259, 320, 3207, 1203, 450, 1203, 393, 19799, 278, 1735, 29889, 13, 1678, 9088, 7590, 353, 9954, 284, 580, 13, 13, 1678, 444, 29871, 10987, 385, 1203, 491, 1178, 29889, 13, 1678, 396, 13, 1678, 396, 259, 320, 3207, 1203, 29918, 333, 450, 1178, 310, 278, 1203, 304, 2740, 363, 29892, 408, 4133, 491, 278, 3017, 1178, 580, 1158, 29889, 13, 1678, 396, 13, 1678, 396, 259, 320, 2457, 450, 1203, 565, 1476, 29892, 470, 6213, 565, 451, 29889, 13, 1678, 822, 1284, 2061, 29898, 1311, 29892, 1203, 29918, 333, 29901, 938, 29897, 1599, 28379, 3366, 23472, 4247, 3108, 29901, 13, 4706, 363, 2943, 297, 350, 949, 386, 6730, 20277, 29898, 1311, 3032, 4632, 1125, 13, 9651, 565, 1178, 29898, 3177, 29897, 1275, 1203, 29918, 333, 29901, 13, 18884, 736, 2943, 13, 4706, 736, 6213, 13, 13, 1678, 822, 1284, 20717, 29898, 1311, 29892, 1024, 29901, 851, 29897, 1599, 28379, 29961, 20717, 5387, 13, 4706, 363, 2943, 297, 350, 949, 386, 6730, 20277, 29898, 1311, 3032, 4632, 1125, 13, 9651, 565, 338, 8758, 29898, 3177, 29892, 24321, 29897, 322, 2943, 29889, 19629, 580, 1275, 1024, 29901, 13, 18884, 736, 2943, 13, 4706, 736, 6213, 13, 13, 1678, 444, 29871, 3462, 263, 934, 304, 367, 20654, 363, 3620, 29889, 13, 1678, 396, 259, 320, 3207, 934, 29918, 2084, 450, 2224, 304, 278, 934, 393, 1818, 367, 20654, 29889, 13, 1678, 822, 788, 24709, 287, 2283, 29898, 1311, 29892, 934, 29918, 2084, 29901, 851, 29897, 1599, 6213, 29901, 13, 4706, 396, 450, 660, 29911, 29871, 29945, 29889, 29896, 29900, 29889, 29900, 2228, 29892, 871, 373, 3852, 29889, 315, 2002, 21985, 1156, 8363, 263, 380, 29880, 934, 515, 12951, 29914, 4928, 29899, 7543, 29914, 20442, 29899, 6707, 7899, 13, 4706, 565, 451, 28096, 29889, 275, 7685, 7295, 13, 9651, 1583, 3032, 1445, 29918, 12344, 261, 29889, 1202, 2605, 29898, 1445, 29918, 2084, 29897, 13, 13, 1678, 444, 29871, 15154, 263, 934, 577, 393, 372, 674, 694, 5520, 367, 20654, 363, 3620, 29889, 13, 1678, 396, 259, 320, 3207, 934, 29918, 2084, 450, 2224, 304, 278, 934, 393, 1818, 694, 5520, 367, 20654, 29889, 13, 1678, 822, 3349, 24709, 287, 2283, 29898, 1311, 29892, 934, 29918, 2084, 29901, 851, 29897, 1599, 6213, 29901, 13, 4706, 396, 450, 660, 29911, 29871, 29945, 29889, 29896, 29900, 29889, 29900, 2228, 29892, 871, 373, 3852, 29889, 315, 2002, 21985, 1156, 8363, 263, 380, 29880, 934, 515, 12951, 29914, 4928, 29899, 7543, 29914, 20442, 29899, 6707, 7899, 13, 4706, 565, 451, 28096, 29889, 275, 7685, 7295, 13, 9651, 1583, 3032, 1445, 29918, 12344, 261, 29889, 5992, 2605, 29898, 1445, 29918, 2084, 29897, 13, 13, 1678, 444, 29871, 1605, 3567, 287, 10940, 263, 934, 338, 3939, 393, 591, 5279, 505, 7500, 29889, 13, 1678, 822, 903, 265, 2283, 7590, 29898, 1311, 29892, 934, 29918, 2084, 29901, 851, 29897, 1599, 6213, 29901, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 275, 1445, 29898, 1445, 29918, 2084, 29897, 470, 2897, 29889, 2084, 29889, 657, 2311, 29898, 1445, 29918, 2084, 29897, 1275, 29871, 29900, 29901, 29871, 396, 3497, 1838, 29915, 29873, 1863, 738, 901, 29892, 470, 372, 338, 4069, 13, 9651, 736, 13, 13, 4706, 396, 26905, 7573, 1122, 367, 7500, 515, 278, 1021, 934, 472, 1422, 22950, 29889, 6376, 29877, 328, 963, 599, 29889, 13, 4706, 515, 501, 29924, 29889, 23472, 29889, 20277, 29889, 8498, 386, 6730, 20277, 1053, 10034, 386, 6730, 20277, 29871, 396, 1763, 1284, 607, 7573, 304, 19763, 746, 2066, 505, 3939, 29889, 13, 4706, 9120, 29918, 18010, 353, 518, 3177, 363, 2943, 297, 10034, 386, 6730, 20277, 29898, 1311, 29889, 657, 10303, 3101, 565, 2943, 29889, 657, 29924, 12094, 1469, 580, 322, 2943, 29889, 657, 29924, 12094, 1469, 2141, 657, 17020, 580, 1275, 934, 29918, 2084, 29962, 29871, 396, 1134, 29901, 11455, 13, 13, 4706, 565, 9120, 29918, 18010, 29901, 13, 9651, 396, 379, 680, 278, 2643, 565, 372, 471, 2307, 7962, 13, 9651, 565, 1583, 3032, 28120, 29918, 4906, 338, 451, 6213, 29901, 13, 18884, 1583, 3032, 28120, 29918, 4906, 29889, 11458, 580, 13, 13, 9651, 1583, 3032, 28120, 29918, 4906, 353, 7777, 29898, 29875, 29896, 29947, 29876, 29918, 28045, 29889, 29875, 29896, 29947, 17608, 29475, 3888, 613, 376, 29956, 483, 366, 763, 304, 19763, 426, 9507, 29913, 29973, 2564, 4830, 29898, 9507, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 1445, 29918, 2084, 8243, 13, 462, 795, 3611, 353, 474, 29896, 29947, 29876, 29918, 28045, 29889, 29875, 29896, 29947, 17608, 29475, 3888, 29901, 3257, 613, 376, 2283, 756, 1063, 9120, 5783, 13, 9651, 1583, 3032, 28120, 29918, 4906, 29889, 1202, 4276, 703, 28120, 613, 474, 29896, 29947, 29876, 29918, 28045, 29889, 29875, 29896, 29947, 17608, 29475, 2467, 29901, 3092, 613, 376, 29934, 7078, 328, 4968, 9849, 353, 12633, 6139, 353, 474, 29896, 29947, 29876, 29918, 28045, 29889, 29875, 29896, 29947, 17608, 29475, 2467, 29901, 8216, 613, 376, 4013, 674, 7135, 278, 9120, 2066, 304, 19763, 515, 8086, 1213, 876, 13, 9651, 1583, 3032, 28120, 29918, 14035, 353, 2090, 312, 8789, 29889, 3846, 29898, 1311, 3032, 28120, 20284, 29892, 9120, 29918, 18010, 29897, 13, 9651, 1583, 3032, 28120, 29918, 4906, 29889, 2467, 20211, 287, 29889, 6915, 29898, 1311, 3032, 28120, 29918, 14035, 29897, 13, 9651, 1583, 3032, 28120, 29918, 4906, 29889, 4294, 580, 13, 13, 1678, 444, 29871, 6376, 29877, 7925, 263, 1051, 310, 7573, 1156, 278, 1404, 15385, 278, 376, 29934, 7078, 328, 29908, 2826, 29889, 13, 1678, 396, 259, 320, 3207, 7573, 450, 1051, 310, 7573, 393, 4225, 304, 367, 337, 15638, 29889, 13, 1678, 396, 259, 320, 3207, 2643, 450, 2643, 393, 19799, 278, 3158, 304, 19763, 963, 29889, 13, 1678, 396, 259, 320, 3207, 3158, 450, 2826, 393, 19799, 278, 3158, 304, 19763, 963, 29889, 13, 1678, 822, 903, 28120, 20284, 29898, 1311, 29892, 7573, 29901, 2391, 3366, 23472, 4247, 12436, 2643, 29901, 851, 29892, 3158, 29901, 851, 29897, 1599, 6213, 29901, 13, 4706, 565, 3158, 2804, 376, 28120, 1115, 13, 9651, 736, 13, 4706, 565, 1583, 3032, 28120, 29918, 4906, 338, 451, 6213, 29901, 13, 9651, 1583, 3032, 28120, 29918, 4906, 29889, 11458, 580, 13, 4706, 363, 2943, 297, 7573, 29901, 13, 9651, 27716, 1272, 353, 2943, 29889, 657, 29924, 12094, 1469, 580, 13, 9651, 565, 27716, 1272, 29901, 13, 18884, 10422, 353, 27716, 1272, 29889, 657, 17020, 580, 13, 18884, 565, 451, 10422, 470, 451, 2897, 29889, 2084, 29889, 275, 1445, 29898, 9507, 1125, 29871, 396, 3497, 1838, 29915, 29873, 1863, 738, 901, 29889, 13, 462, 1678, 6773, 13, 18884, 4982, 353, 7523, 29924, 12094, 11947, 29898, 9507, 29897, 13, 18884, 19763, 29918, 4951, 3276, 29918, 14035, 353, 2090, 312, 8789, 29889, 3846, 29898, 1311, 3032, 28120, 11947, 12881, 3276, 29892, 2943, 29897, 13, 18884, 1583, 3032, 14035, 29879, 29889, 1202, 29898, 28120, 29918, 4951, 3276, 29918, 14035, 29897, 396, 9044, 372, 577, 372, 2113, 29915, 29873, 679, 25861, 16531, 29889, 910, 338, 263, 3370, 24993, 29892, 541, 925, 697, 7687, 639, 19763, 577, 372, 29915, 29879, 451, 1568, 29889, 13, 18884, 4982, 29889, 4951, 3276, 29889, 6915, 29898, 28120, 29918, 4951, 3276, 29918, 14035, 29897, 13, 18884, 4982, 29889, 2962, 580, 13, 13, 1678, 444, 29871, 1605, 3567, 287, 746, 337, 13234, 756, 7743, 29889, 13, 1678, 396, 13, 1678, 396, 259, 910, 769, 15223, 278, 9819, 27716, 848, 297, 278, 2943, 29889, 13, 1678, 822, 903, 28120, 11947, 12881, 3276, 29898, 1311, 29892, 8611, 29918, 3177, 29901, 2522, 1600, 4247, 29892, 4982, 29901, 7523, 29924, 12094, 11947, 29897, 1599, 6213, 29901, 13, 4706, 363, 2943, 297, 4982, 29889, 657, 3591, 7295, 13, 9651, 27716, 29918, 1272, 353, 2943, 29889, 657, 29924, 12094, 1469, 580, 13, 9651, 565, 27716, 29918, 1272, 29901, 13, 18884, 8611, 29918, 3177, 29889, 842, 29924, 12094, 1469, 29898, 4467, 29882, 29918, 1272, 29897, 13, 9651, 1683, 29901, 13, 18884, 28468, 29889, 1188, 703, 29893, 613, 376, 23323, 451, 1284, 263, 27716, 297, 337, 15638, 2943, 23157, 2 ]
rlkit/samplers/data_collector/path_collector.py
YashBit/generalized-hindsight
0
116661
<reponame>YashBit/generalized-hindsight<filename>rlkit/samplers/data_collector/path_collector.py import numpy as np from collections import deque, OrderedDict from rlkit.core import logger from rlkit.core.eval_util import create_stats_ordered_dict from rlkit.samplers.rollout_functions import diayn_multitask_rollout_with_relabeler, rollout, multitask_rollout, multitask_rollout_with_relabeler from rlkit.samplers.data_collector.base import PathCollector from rlkit.torch.multitask.pointmass_rewards import PointMassBestRandomRelabeler import os.path as osp class MdpPathCollector(PathCollector): def __init__( self, env, policy, max_num_epoch_paths_saved=None, render=False, render_kwargs=None, ): if render_kwargs is None: render_kwargs = {} self._env = env self._policy = policy self._max_num_epoch_paths_saved = max_num_epoch_paths_saved self._epoch_paths = deque(maxlen=self._max_num_epoch_paths_saved) self._render = render self._render_kwargs = render_kwargs self._num_steps_total = 0 self._num_paths_total = 0 def collect_new_paths( self, max_path_length, num_steps, discard_incomplete_paths, ): paths = [] num_steps_collected = 0 while num_steps_collected < num_steps: max_path_length_this_loop = min( # Do not go over num_steps max_path_length, num_steps - num_steps_collected, ) path = rollout( self._env, self._policy, max_path_length=max_path_length_this_loop, render=self._render, render_kwargs=self._render_kwargs ) path_len = len(path['actions']) if ( path_len != max_path_length and not path['terminals'][-1] and discard_incomplete_paths ): break num_steps_collected += path_len paths.append(path) self._num_paths_total += len(paths) self._num_steps_total += num_steps_collected self._epoch_paths.extend(paths) return paths def get_epoch_paths(self): return self._epoch_paths def end_epoch(self, epoch): self._epoch_paths = deque(maxlen=self._max_num_epoch_paths_saved) def get_diagnostics(self): path_lens = [len(path['actions']) for path in self._epoch_paths] stats = OrderedDict([ ('num steps total', self._num_steps_total), ('num paths total', self._num_paths_total), ]) stats.update(create_stats_ordered_dict( "path length", path_lens, always_show_all_stats=True, )) return stats def get_snapshot(self): return dict( env=self._env, policy=self._policy, ) class GoalConditionedPathCollector(PathCollector): def __init__( self, env, policy, max_num_epoch_paths_saved=None, render=False, render_kwargs=None, observation_key='observation', desired_goal_key='desired_goal', ): if render_kwargs is None: render_kwargs = {} self._env = env self._policy = policy self._max_num_epoch_paths_saved = max_num_epoch_paths_saved self._render = render self._render_kwargs = render_kwargs self._epoch_paths = deque(maxlen=self._max_num_epoch_paths_saved) self._observation_key = observation_key self._desired_goal_key = desired_goal_key self._num_steps_total = 0 self._num_paths_total = 0 def collect_new_paths( self, max_path_length, num_steps, discard_incomplete_paths, ): paths = [] num_steps_collected = 0 while num_steps_collected < num_steps: print(f"MAX PATH LENGTH FOR THIS LOOP IS: {max_path_length}") max_path_length_this_loop = min( # Do not go over num_steps max_path_length, num_steps - num_steps_collected, ) path = multitask_rollout( self._env, self._policy, max_path_length=max_path_length_this_loop, render=self._render, render_kwargs=self._render_kwargs, observation_key=self._observation_key, desired_goal_key=self._desired_goal_key, return_dict_obs=True, ) path_len = len(path['actions']) if ( path_len != max_path_length and not path['terminals'][-1] and discard_incomplete_paths ): break num_steps_collected += path_len paths.append(path) self._num_paths_total += len(paths) self._num_steps_total += num_steps_collected self._epoch_paths.extend(paths) return paths def get_epoch_paths(self): return self._epoch_paths def end_epoch(self, epoch): self._epoch_paths = deque(maxlen=self._max_num_epoch_paths_saved) def get_diagnostics(self): path_lens = [len(path['actions']) for path in self._epoch_paths] stats = OrderedDict([ ('num steps total', self._num_steps_total), ('num paths total', self._num_paths_total), ]) stats.update(create_stats_ordered_dict( "path length", path_lens, always_show_all_stats=True, )) return stats def get_snapshot(self): return dict( env=self._env, policy=self._policy, observation_key=self._observation_key, desired_goal_key=self._desired_goal_key, ) class DIAYNTaskConditionedPathCollector(PathCollector): def __init__( self, env, policy, relabeler, agent, max_num_epoch_paths_saved=None, render=False, render_kwargs=None, is_eval=False, calculate_r_d=True, hide_latent=False, normalize_performance=False, save_videos=False, cfg = None ): if render_kwargs is None: render_kwargs = {} self._env = env self._policy = policy self._relabeler = relabeler self._max_num_epoch_paths_saved = max_num_epoch_paths_saved self._render = render self._render_kwargs = render_kwargs self._epoch_paths = deque(maxlen=self._max_num_epoch_paths_saved) self.is_eval = is_eval self.calculate_r_d = calculate_r_d self.hide_latent = hide_latent self.normalize_performance = normalize_performance self._num_steps_total = 0 self._num_paths_total = 0 self._epoch = 0 self.agent = agent self.cfg = cfg # for video saving self.save_video = save_videos and not self.is_eval and hasattr(relabeler, 'to_save_video') # for normalizing later self.eval_traj_infos = {} def collect_new_paths( self, max_path_length, num_steps, discard_incomplete_paths, rollType, ): paths = [] num_steps_collected = 0 if self.save_video and self._relabeler.to_save_video(self._epoch): render = True render_kwargs = dict(mode='rgb_array') else: render = self._render render_kwargs = self._render_kwargs #print(f"type of num_steps : {type(num_steps)}") # if (isinstance(num_steps, str)): # print(f"Num steps is : {num_steps}") # num_steps = int(num_steps) num_steps = 1000 #1000 PATHS, with each trajectory of 1000 steps. # print(f"Type of num_steps_collected: {type(num_steps_collected)}, num_steps: {type(num_steps)}") # print(f"NUM steps is: {num_steps}") # print(f"I am in DIAYNTaskConditionedPathCollector") while num_steps_collected < num_steps: max_path_length_this_loop = min( # Do not go over num_steps max_path_length, num_steps - num_steps_collected, ) # print(f"Max path length is: {max_path_length}") # print(f"Num steps: {num_steps}, difference is: {num_steps - num_steps_collected}") # print(f"Max path length with this loop is: {max_path_length_this_loop}") path = diayn_multitask_rollout_with_relabeler( self._env, self.agent, self._relabeler, rollType=rollType, max_path_length=max_path_length_this_loop, render=render, render_kwargs=render_kwargs, return_dict_obs=False, calculate_r_d=self.calculate_r_d, hide_latent=self.hide_latent, cfg = self.cfg ) # print(f"Path keys in collect paths is : {path.keys()}") path_len = len(path['actions']) if ( path_len != max_path_length and not path['terminals'][-1] and discard_incomplete_paths ): break # print(f"Path_len in DIAYN-HUSK: {path_len}") num_steps_collected += path_len paths.append(path) self._num_paths_total += len(paths) self._num_steps_total += num_steps_collected if self.normalize_performance: for path in paths: path['normalized_rewards'] = self._relabeler.get_normalized_path_rewards(path) self._epoch_paths.extend(paths) print(f"The len of paths: {len(paths)}") return paths def get_epoch_paths(self): return self._epoch_paths def end_epoch(self, epoch): if self.is_eval: epoch_path_info = [] for path in self._epoch_paths: latent = path['latents'][0] rewards = self._relabeler.calculate_path_reward(path, latent) epoch_path_info.append((latent, rewards.sum())) self.eval_traj_infos['epoch{}'.format(self._epoch)] = epoch_path_info logger.save_extra_data(self.eval_traj_infos, 'eval_traj_infos.pkl') self._epoch_paths = deque(maxlen=self._max_num_epoch_paths_saved) self._epoch += 1 def get_diagnostics(self): path_lens = [len(path['actions']) for path in self._epoch_paths] stats = OrderedDict([ ('num steps total', self._num_steps_total), ('num paths total', self._num_paths_total), ]) stats.update(create_stats_ordered_dict( "path length", path_lens, always_show_all_stats=True, )) return stats def get_snapshot(self): return dict( env=self._env, policy=self._policy, ) class TaskConditionedPathCollector(PathCollector): def __init__( self, env, policy, relabeler, max_num_epoch_paths_saved=None, render=False, render_kwargs=None, is_eval=False, calculate_r_d=True, hide_latent=False, normalize_performance=False, save_videos=False ): if render_kwargs is None: render_kwargs = {} self._env = env self._policy = policy self._relabeler = relabeler self._max_num_epoch_paths_saved = max_num_epoch_paths_saved self._render = render self._render_kwargs = render_kwargs self._epoch_paths = deque(maxlen=self._max_num_epoch_paths_saved) self.is_eval = is_eval self.calculate_r_d = calculate_r_d self.hide_latent = hide_latent self.normalize_performance = normalize_performance self._num_steps_total = 0 self._num_paths_total = 0 self._epoch = 0 # for video saving self.save_video = save_videos and not self.is_eval and hasattr(relabeler, 'to_save_video') # for normalizing later self.eval_traj_infos = {} def collect_new_paths( self, max_path_length, num_steps, discard_incomplete_paths, ): paths = [] num_steps_collected = 0 print(f"Num steps in rollouts are: {num_steps}") if self.save_video and self._relabeler.to_save_video(self._epoch): render = True render_kwargs = dict(mode='rgb_array') else: render = self._render render_kwargs = self._render_kwargs print(f"NUM_STEPS IN GHER PATH COLLECTOR IS: {num_steps}") while num_steps_collected < num_steps: max_path_length_this_loop = min( # Do not go over num_steps max_path_length, num_steps - num_steps_collected, ) print(f"Max path len in loop: {max_path_length_this_loop}") path = multitask_rollout_with_relabeler( self._env, self._policy, self._relabeler, max_path_length=max_path_length_this_loop, render=render, render_kwargs=render_kwargs, return_dict_obs=False, calculate_r_d=self.calculate_r_d, hide_latent=self.hide_latent ) path_len = len(path['actions']) print(f"Path_len in GHER: {path_len}") if ( path_len != max_path_length and not path['terminals'][-1] and discard_incomplete_paths ): break num_steps_collected += path_len paths.append(path) self._num_paths_total += len(paths) self._num_steps_total += num_steps_collected if self.normalize_performance: for path in paths: path['normalized_rewards'] = self._relabeler.get_normalized_path_rewards(path) self._epoch_paths.extend(paths) print(f"Len of paths in TaskConditionedPathCollector: {len(paths)}") return paths def get_epoch_paths(self): return self._epoch_paths def end_epoch(self, epoch): if self.is_eval: epoch_path_info = [] for path in self._epoch_paths: latent = path['latents'][0] rewards = self._relabeler.calculate_path_reward(path, latent) epoch_path_info.append((latent, rewards.sum())) self.eval_traj_infos['epoch{}'.format(self._epoch)] = epoch_path_info logger.save_extra_data(self.eval_traj_infos, 'eval_traj_infos.pkl') self._epoch_paths = deque(maxlen=self._max_num_epoch_paths_saved) self._epoch += 1 def get_diagnostics(self): path_lens = [len(path['actions']) for path in self._epoch_paths] stats = OrderedDict([ ('num steps total', self._num_steps_total), ('num paths total', self._num_paths_total), ]) stats.update(create_stats_ordered_dict( "path length", path_lens, always_show_all_stats=True, )) return stats def get_snapshot(self): return dict( env=self._env, policy=self._policy, )
[ 1, 529, 276, 1112, 420, 29958, 29979, 1161, 21591, 29914, 17492, 1891, 29899, 29882, 12772, 523, 29966, 9507, 29958, 2096, 7354, 29914, 13445, 572, 414, 29914, 1272, 29918, 15914, 272, 29914, 2084, 29918, 15914, 272, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 3166, 16250, 1053, 316, 802, 29892, 8170, 287, 21533, 13, 3166, 364, 29880, 7354, 29889, 3221, 1053, 17927, 13, 3166, 364, 29880, 7354, 29889, 3221, 29889, 14513, 29918, 4422, 1053, 1653, 29918, 16202, 29918, 21693, 29918, 8977, 13, 3166, 364, 29880, 7354, 29889, 13445, 572, 414, 29889, 1245, 449, 29918, 12171, 1053, 652, 388, 29876, 29918, 4713, 277, 1278, 29918, 1245, 449, 29918, 2541, 29918, 276, 1643, 261, 29892, 9679, 449, 29892, 1773, 277, 1278, 29918, 1245, 449, 29892, 1773, 277, 1278, 29918, 1245, 449, 29918, 2541, 29918, 276, 1643, 261, 13, 3166, 364, 29880, 7354, 29889, 13445, 572, 414, 29889, 1272, 29918, 15914, 272, 29889, 3188, 1053, 10802, 28916, 272, 13, 3166, 364, 29880, 7354, 29889, 7345, 305, 29889, 4713, 277, 1278, 29889, 3149, 25379, 29918, 276, 2935, 1053, 8984, 29924, 465, 25353, 17875, 9662, 1107, 261, 13, 13, 5215, 2897, 29889, 2084, 408, 288, 1028, 13, 13, 13, 1990, 341, 6099, 2605, 28916, 272, 29898, 2605, 28916, 272, 1125, 13, 1678, 822, 4770, 2344, 12035, 13, 9651, 1583, 29892, 13, 9651, 8829, 29892, 13, 9651, 8898, 29892, 13, 9651, 4236, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29922, 8516, 29892, 13, 9651, 4050, 29922, 8824, 29892, 13, 9651, 4050, 29918, 19290, 29922, 8516, 29892, 13, 268, 1125, 13, 4706, 565, 4050, 29918, 19290, 338, 6213, 29901, 13, 9651, 4050, 29918, 19290, 353, 6571, 13, 4706, 1583, 3032, 6272, 353, 8829, 13, 4706, 1583, 3032, 22197, 353, 8898, 13, 4706, 1583, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 353, 4236, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 353, 316, 802, 29898, 3317, 2435, 29922, 1311, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29897, 13, 4706, 1583, 3032, 9482, 353, 4050, 13, 4706, 1583, 3032, 9482, 29918, 19290, 353, 4050, 29918, 19290, 13, 13, 4706, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 353, 29871, 29900, 13, 4706, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 353, 29871, 29900, 13, 13, 1678, 822, 6314, 29918, 1482, 29918, 24772, 29898, 13, 9651, 1583, 29892, 13, 9651, 4236, 29918, 2084, 29918, 2848, 29892, 13, 9651, 954, 29918, 24530, 29892, 13, 9651, 2313, 538, 29918, 262, 8835, 29918, 24772, 29892, 13, 268, 1125, 13, 4706, 10898, 353, 5159, 13, 4706, 954, 29918, 24530, 29918, 15914, 287, 353, 29871, 29900, 13, 4706, 1550, 954, 29918, 24530, 29918, 15914, 287, 529, 954, 29918, 24530, 29901, 13, 9651, 4236, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 353, 1375, 29898, 29871, 396, 1938, 451, 748, 975, 954, 29918, 24530, 13, 18884, 4236, 29918, 2084, 29918, 2848, 29892, 13, 18884, 954, 29918, 24530, 448, 954, 29918, 24530, 29918, 15914, 287, 29892, 13, 9651, 1723, 13, 9651, 2224, 353, 9679, 449, 29898, 13, 18884, 1583, 3032, 6272, 29892, 13, 18884, 1583, 3032, 22197, 29892, 13, 18884, 4236, 29918, 2084, 29918, 2848, 29922, 3317, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 29892, 13, 18884, 4050, 29922, 1311, 3032, 9482, 29892, 13, 18884, 4050, 29918, 19290, 29922, 1311, 3032, 9482, 29918, 19290, 13, 9651, 1723, 13, 9651, 2224, 29918, 2435, 353, 7431, 29898, 2084, 1839, 7387, 11287, 13, 9651, 565, 313, 13, 462, 1678, 2224, 29918, 2435, 2804, 4236, 29918, 2084, 29918, 2848, 13, 462, 1678, 322, 451, 2224, 1839, 8489, 19016, 2033, 14352, 29896, 29962, 13, 462, 1678, 322, 2313, 538, 29918, 262, 8835, 29918, 24772, 13, 632, 1125, 13, 18884, 2867, 13, 9651, 954, 29918, 24530, 29918, 15914, 287, 4619, 2224, 29918, 2435, 13, 9651, 10898, 29889, 4397, 29898, 2084, 29897, 13, 4706, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 4619, 7431, 29898, 24772, 29897, 13, 4706, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 4619, 954, 29918, 24530, 29918, 15914, 287, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 29889, 21843, 29898, 24772, 29897, 13, 4706, 736, 10898, 13, 13, 1678, 822, 679, 29918, 1022, 2878, 29918, 24772, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 1022, 2878, 29918, 24772, 13, 13, 1678, 822, 1095, 29918, 1022, 2878, 29898, 1311, 29892, 21502, 305, 1125, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 353, 316, 802, 29898, 3317, 2435, 29922, 1311, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29897, 13, 13, 1678, 822, 679, 29918, 6051, 20921, 29898, 1311, 1125, 13, 4706, 2224, 29918, 29880, 575, 353, 518, 2435, 29898, 2084, 1839, 7387, 11287, 363, 2224, 297, 1583, 3032, 1022, 2878, 29918, 24772, 29962, 13, 4706, 22663, 353, 8170, 287, 21533, 4197, 13, 9651, 6702, 1949, 6576, 3001, 742, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 511, 13, 9651, 6702, 1949, 10898, 3001, 742, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 511, 13, 308, 2314, 13, 4706, 22663, 29889, 5504, 29898, 3258, 29918, 16202, 29918, 21693, 29918, 8977, 29898, 13, 9651, 376, 2084, 3309, 613, 13, 9651, 2224, 29918, 29880, 575, 29892, 13, 9651, 2337, 29918, 4294, 29918, 497, 29918, 16202, 29922, 5574, 29892, 13, 308, 876, 13, 4706, 736, 22663, 13, 13, 1678, 822, 679, 29918, 29879, 14551, 29898, 1311, 1125, 13, 4706, 736, 9657, 29898, 13, 9651, 8829, 29922, 1311, 3032, 6272, 29892, 13, 9651, 8898, 29922, 1311, 3032, 22197, 29892, 13, 4706, 1723, 13, 13, 13, 1990, 2921, 284, 25255, 287, 2605, 28916, 272, 29898, 2605, 28916, 272, 1125, 13, 1678, 822, 4770, 2344, 12035, 13, 9651, 1583, 29892, 13, 9651, 8829, 29892, 13, 9651, 8898, 29892, 13, 9651, 4236, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29922, 8516, 29892, 13, 9651, 4050, 29922, 8824, 29892, 13, 9651, 4050, 29918, 19290, 29922, 8516, 29892, 13, 9651, 15500, 29918, 1989, 2433, 26739, 362, 742, 13, 9651, 7429, 29918, 28111, 29918, 1989, 2433, 2783, 2859, 29918, 28111, 742, 13, 268, 1125, 13, 4706, 565, 4050, 29918, 19290, 338, 6213, 29901, 13, 9651, 4050, 29918, 19290, 353, 6571, 13, 4706, 1583, 3032, 6272, 353, 8829, 13, 4706, 1583, 3032, 22197, 353, 8898, 13, 4706, 1583, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 353, 4236, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 13, 4706, 1583, 3032, 9482, 353, 4050, 13, 4706, 1583, 3032, 9482, 29918, 19290, 353, 4050, 29918, 19290, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 353, 316, 802, 29898, 3317, 2435, 29922, 1311, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29897, 13, 4706, 1583, 3032, 26739, 362, 29918, 1989, 353, 15500, 29918, 1989, 13, 4706, 1583, 3032, 2783, 2859, 29918, 28111, 29918, 1989, 353, 7429, 29918, 28111, 29918, 1989, 13, 13, 4706, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 353, 29871, 29900, 13, 4706, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 353, 29871, 29900, 13, 13, 1678, 822, 6314, 29918, 1482, 29918, 24772, 29898, 13, 9651, 1583, 29892, 13, 9651, 4236, 29918, 2084, 29918, 2848, 29892, 13, 9651, 954, 29918, 24530, 29892, 13, 9651, 2313, 538, 29918, 262, 8835, 29918, 24772, 29892, 13, 268, 1125, 13, 4706, 10898, 353, 5159, 13, 4706, 954, 29918, 24530, 29918, 15914, 287, 353, 29871, 29900, 13, 4706, 1550, 954, 29918, 24530, 29918, 15914, 287, 529, 954, 29918, 24530, 29901, 13, 13, 9651, 1596, 29898, 29888, 29908, 12648, 23611, 365, 1430, 29954, 4690, 15842, 3446, 3235, 11247, 4590, 8519, 29901, 426, 3317, 29918, 2084, 29918, 2848, 27195, 13, 9651, 4236, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 353, 1375, 29898, 29871, 396, 1938, 451, 748, 975, 954, 29918, 24530, 13, 18884, 4236, 29918, 2084, 29918, 2848, 29892, 13, 18884, 954, 29918, 24530, 448, 954, 29918, 24530, 29918, 15914, 287, 29892, 13, 9651, 1723, 13, 9651, 2224, 353, 1773, 277, 1278, 29918, 1245, 449, 29898, 13, 18884, 1583, 3032, 6272, 29892, 13, 18884, 1583, 3032, 22197, 29892, 13, 18884, 4236, 29918, 2084, 29918, 2848, 29922, 3317, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 29892, 13, 18884, 4050, 29922, 1311, 3032, 9482, 29892, 13, 18884, 4050, 29918, 19290, 29922, 1311, 3032, 9482, 29918, 19290, 29892, 13, 18884, 15500, 29918, 1989, 29922, 1311, 3032, 26739, 362, 29918, 1989, 29892, 13, 18884, 7429, 29918, 28111, 29918, 1989, 29922, 1311, 3032, 2783, 2859, 29918, 28111, 29918, 1989, 29892, 13, 18884, 736, 29918, 8977, 29918, 26290, 29922, 5574, 29892, 13, 9651, 1723, 13, 9651, 2224, 29918, 2435, 353, 7431, 29898, 2084, 1839, 7387, 11287, 13, 9651, 565, 313, 13, 462, 1678, 2224, 29918, 2435, 2804, 4236, 29918, 2084, 29918, 2848, 13, 462, 1678, 322, 451, 2224, 1839, 8489, 19016, 2033, 14352, 29896, 29962, 13, 462, 1678, 322, 2313, 538, 29918, 262, 8835, 29918, 24772, 13, 632, 1125, 13, 18884, 2867, 13, 9651, 954, 29918, 24530, 29918, 15914, 287, 4619, 2224, 29918, 2435, 13, 9651, 10898, 29889, 4397, 29898, 2084, 29897, 13, 4706, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 4619, 7431, 29898, 24772, 29897, 13, 4706, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 4619, 954, 29918, 24530, 29918, 15914, 287, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 29889, 21843, 29898, 24772, 29897, 13, 4706, 736, 10898, 13, 13, 1678, 822, 679, 29918, 1022, 2878, 29918, 24772, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 1022, 2878, 29918, 24772, 13, 13, 1678, 822, 1095, 29918, 1022, 2878, 29898, 1311, 29892, 21502, 305, 1125, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 353, 316, 802, 29898, 3317, 2435, 29922, 1311, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29897, 13, 13, 1678, 822, 679, 29918, 6051, 20921, 29898, 1311, 1125, 13, 4706, 2224, 29918, 29880, 575, 353, 518, 2435, 29898, 2084, 1839, 7387, 11287, 363, 2224, 297, 1583, 3032, 1022, 2878, 29918, 24772, 29962, 13, 4706, 22663, 353, 8170, 287, 21533, 4197, 13, 9651, 6702, 1949, 6576, 3001, 742, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 511, 13, 9651, 6702, 1949, 10898, 3001, 742, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 511, 13, 308, 2314, 13, 4706, 22663, 29889, 5504, 29898, 3258, 29918, 16202, 29918, 21693, 29918, 8977, 29898, 13, 9651, 376, 2084, 3309, 613, 13, 9651, 2224, 29918, 29880, 575, 29892, 13, 9651, 2337, 29918, 4294, 29918, 497, 29918, 16202, 29922, 5574, 29892, 13, 308, 876, 13, 4706, 736, 22663, 13, 13, 1678, 822, 679, 29918, 29879, 14551, 29898, 1311, 1125, 13, 4706, 736, 9657, 29898, 13, 9651, 8829, 29922, 1311, 3032, 6272, 29892, 13, 9651, 8898, 29922, 1311, 3032, 22197, 29892, 13, 9651, 15500, 29918, 1989, 29922, 1311, 3032, 26739, 362, 29918, 1989, 29892, 13, 9651, 7429, 29918, 28111, 29918, 1989, 29922, 1311, 3032, 2783, 2859, 29918, 28111, 29918, 1989, 29892, 13, 4706, 1723, 13, 13, 13, 308, 13, 1990, 360, 10764, 29979, 29940, 5398, 25255, 287, 2605, 28916, 272, 29898, 2605, 28916, 272, 1125, 13, 1678, 822, 4770, 2344, 12035, 13, 9651, 1583, 29892, 13, 9651, 8829, 29892, 13, 9651, 8898, 29892, 13, 9651, 1104, 1107, 261, 29892, 13, 9651, 10823, 29892, 13, 9651, 4236, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29922, 8516, 29892, 13, 9651, 4050, 29922, 8824, 29892, 13, 9651, 4050, 29918, 19290, 29922, 8516, 29892, 13, 9651, 338, 29918, 14513, 29922, 8824, 29892, 13, 9651, 8147, 29918, 29878, 29918, 29881, 29922, 5574, 29892, 13, 9651, 9563, 29918, 5066, 296, 29922, 8824, 29892, 13, 9651, 4226, 675, 29918, 546, 13390, 29922, 8824, 29892, 13, 9651, 4078, 29918, 29894, 7958, 29922, 8824, 29892, 13, 9651, 274, 16434, 353, 6213, 29871, 13, 268, 1125, 13, 4706, 565, 4050, 29918, 19290, 338, 6213, 29901, 13, 9651, 4050, 29918, 19290, 353, 6571, 13, 4706, 13, 4706, 1583, 3032, 6272, 353, 8829, 13, 4706, 1583, 3032, 22197, 353, 8898, 13, 4706, 1583, 3032, 276, 1643, 261, 353, 1104, 1107, 261, 13, 4706, 1583, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 353, 4236, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 13, 4706, 1583, 3032, 9482, 353, 4050, 13, 4706, 1583, 3032, 9482, 29918, 19290, 353, 4050, 29918, 19290, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 353, 316, 802, 29898, 3317, 2435, 29922, 1311, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29897, 13, 4706, 1583, 29889, 275, 29918, 14513, 353, 338, 29918, 14513, 13, 4706, 1583, 29889, 15807, 403, 29918, 29878, 29918, 29881, 353, 8147, 29918, 29878, 29918, 29881, 13, 4706, 1583, 29889, 11458, 29918, 5066, 296, 353, 9563, 29918, 5066, 296, 13, 4706, 1583, 29889, 8945, 675, 29918, 546, 13390, 353, 4226, 675, 29918, 546, 13390, 13, 4706, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 353, 29871, 29900, 13, 4706, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 353, 29871, 29900, 13, 4706, 1583, 3032, 1022, 2878, 353, 29871, 29900, 13, 4706, 1583, 29889, 14748, 353, 10823, 13, 4706, 1583, 29889, 16859, 353, 274, 16434, 13, 4706, 396, 363, 4863, 14238, 13, 4706, 1583, 29889, 7620, 29918, 9641, 353, 4078, 29918, 29894, 7958, 322, 451, 1583, 29889, 275, 29918, 14513, 322, 756, 5552, 29898, 276, 1643, 261, 29892, 525, 517, 29918, 7620, 29918, 9641, 1495, 13, 13, 4706, 396, 363, 4226, 5281, 2678, 13, 4706, 1583, 29889, 14513, 29918, 3018, 29926, 29918, 7192, 359, 353, 6571, 13, 13, 13, 13, 1678, 822, 6314, 29918, 1482, 29918, 24772, 29898, 13, 9651, 1583, 29892, 13, 9651, 4236, 29918, 2084, 29918, 2848, 29892, 13, 9651, 954, 29918, 24530, 29892, 13, 9651, 2313, 538, 29918, 262, 8835, 29918, 24772, 29892, 13, 9651, 9679, 1542, 29892, 13, 268, 1125, 13, 4706, 10898, 353, 5159, 13, 4706, 954, 29918, 24530, 29918, 15914, 287, 353, 29871, 29900, 13, 13, 4706, 565, 1583, 29889, 7620, 29918, 9641, 322, 1583, 3032, 276, 1643, 261, 29889, 517, 29918, 7620, 29918, 9641, 29898, 1311, 3032, 1022, 2878, 1125, 13, 9651, 4050, 353, 5852, 13, 9651, 4050, 29918, 19290, 353, 9657, 29898, 8513, 2433, 23973, 29918, 2378, 1495, 13, 4706, 1683, 29901, 13, 9651, 4050, 353, 1583, 3032, 9482, 13, 9651, 4050, 29918, 19290, 353, 1583, 3032, 9482, 29918, 19290, 13, 13, 4706, 396, 2158, 29898, 29888, 29908, 1853, 310, 954, 29918, 24530, 584, 426, 1853, 29898, 1949, 29918, 24530, 2915, 1159, 13, 13, 4706, 396, 565, 313, 275, 8758, 29898, 1949, 29918, 24530, 29892, 851, 22164, 13, 4706, 396, 268, 1596, 29898, 29888, 29908, 8009, 6576, 338, 584, 426, 1949, 29918, 24530, 27195, 13, 4706, 396, 268, 954, 29918, 24530, 353, 938, 29898, 1949, 29918, 24530, 29897, 13, 13, 4706, 954, 29918, 24530, 353, 29871, 29896, 29900, 29900, 29900, 13, 13, 4706, 396, 29896, 29900, 29900, 29900, 23611, 29903, 29892, 411, 1269, 23324, 706, 310, 29871, 29896, 29900, 29900, 29900, 6576, 29889, 13, 4706, 396, 1596, 29898, 29888, 29908, 1542, 310, 954, 29918, 24530, 29918, 15914, 287, 29901, 426, 1853, 29898, 1949, 29918, 24530, 29918, 15914, 287, 19230, 954, 29918, 24530, 29901, 426, 1853, 29898, 1949, 29918, 24530, 2915, 1159, 13, 4706, 396, 1596, 29898, 29888, 29908, 13967, 6576, 338, 29901, 426, 1949, 29918, 24530, 27195, 13, 4706, 396, 1596, 29898, 29888, 29908, 29902, 626, 297, 360, 10764, 29979, 29940, 5398, 25255, 287, 2605, 28916, 272, 1159, 13, 4706, 1550, 954, 29918, 24530, 29918, 15914, 287, 529, 954, 29918, 24530, 29901, 13, 9651, 4236, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 353, 1375, 29898, 29871, 396, 1938, 451, 748, 975, 954, 29918, 24530, 13, 18884, 4236, 29918, 2084, 29918, 2848, 29892, 13, 18884, 954, 29918, 24530, 448, 954, 29918, 24530, 29918, 15914, 287, 29892, 13, 9651, 1723, 13, 9651, 396, 1596, 29898, 29888, 29908, 7976, 2224, 3309, 338, 29901, 426, 3317, 29918, 2084, 29918, 2848, 27195, 13, 9651, 396, 1596, 29898, 29888, 29908, 8009, 6576, 29901, 426, 1949, 29918, 24530, 1118, 4328, 338, 29901, 426, 1949, 29918, 24530, 448, 954, 29918, 24530, 29918, 15914, 287, 27195, 13, 9651, 396, 1596, 29898, 29888, 29908, 7976, 2224, 3309, 411, 445, 2425, 338, 29901, 426, 3317, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 27195, 13, 9651, 2224, 353, 652, 388, 29876, 29918, 4713, 277, 1278, 29918, 1245, 449, 29918, 2541, 29918, 276, 1643, 261, 29898, 13, 18884, 1583, 3032, 6272, 29892, 13, 18884, 1583, 29889, 14748, 29892, 13, 18884, 1583, 3032, 276, 1643, 261, 29892, 13, 18884, 9679, 1542, 29922, 1245, 1542, 29892, 13, 18884, 4236, 29918, 2084, 29918, 2848, 29922, 3317, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 29892, 13, 18884, 4050, 29922, 9482, 29892, 13, 18884, 4050, 29918, 19290, 29922, 9482, 29918, 19290, 29892, 13, 18884, 736, 29918, 8977, 29918, 26290, 29922, 8824, 29892, 13, 18884, 8147, 29918, 29878, 29918, 29881, 29922, 1311, 29889, 15807, 403, 29918, 29878, 29918, 29881, 29892, 13, 18884, 9563, 29918, 5066, 296, 29922, 1311, 29889, 11458, 29918, 5066, 296, 29892, 13, 18884, 274, 16434, 353, 1583, 29889, 16859, 13, 9651, 1723, 13, 9651, 396, 1596, 29898, 29888, 29908, 2605, 6611, 297, 6314, 10898, 338, 584, 426, 2084, 29889, 8149, 580, 27195, 13, 9651, 2224, 29918, 2435, 353, 7431, 29898, 2084, 1839, 7387, 11287, 13, 9651, 565, 313, 13, 462, 1678, 2224, 29918, 2435, 2804, 4236, 29918, 2084, 29918, 2848, 13, 462, 1678, 322, 451, 2224, 1839, 8489, 19016, 2033, 14352, 29896, 29962, 13, 462, 1678, 322, 2313, 538, 29918, 262, 8835, 29918, 24772, 13, 632, 1125, 13, 18884, 2867, 13, 13, 9651, 396, 1596, 29898, 29888, 29908, 2605, 29918, 2435, 297, 360, 10764, 29979, 29940, 29899, 29950, 3308, 29968, 29901, 426, 2084, 29918, 2435, 27195, 13, 9651, 954, 29918, 24530, 29918, 15914, 287, 4619, 2224, 29918, 2435, 13, 9651, 10898, 29889, 4397, 29898, 2084, 29897, 13, 4706, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 4619, 7431, 29898, 24772, 29897, 13, 4706, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 4619, 954, 29918, 24530, 29918, 15914, 287, 13, 4706, 565, 1583, 29889, 8945, 675, 29918, 546, 13390, 29901, 13, 9651, 363, 2224, 297, 10898, 29901, 13, 18884, 2224, 1839, 8945, 1891, 29918, 276, 2935, 2033, 353, 1583, 3032, 276, 1643, 261, 29889, 657, 29918, 8945, 1891, 29918, 2084, 29918, 276, 2935, 29898, 2084, 29897, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 29889, 21843, 29898, 24772, 29897, 13, 4706, 1596, 29898, 29888, 29908, 1576, 7431, 310, 10898, 29901, 426, 2435, 29898, 24772, 2915, 1159, 13, 4706, 736, 10898, 13, 13, 1678, 822, 679, 29918, 1022, 2878, 29918, 24772, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 1022, 2878, 29918, 24772, 13, 13, 1678, 822, 1095, 29918, 1022, 2878, 29898, 1311, 29892, 21502, 305, 1125, 13, 4706, 565, 1583, 29889, 275, 29918, 14513, 29901, 13, 9651, 21502, 305, 29918, 2084, 29918, 3888, 353, 5159, 13, 9651, 363, 2224, 297, 1583, 3032, 1022, 2878, 29918, 24772, 29901, 13, 18884, 3405, 296, 353, 2224, 1839, 5066, 1237, 2033, 29961, 29900, 29962, 13, 18884, 337, 2935, 353, 1583, 3032, 276, 1643, 261, 29889, 15807, 403, 29918, 2084, 29918, 276, 1328, 29898, 2084, 29892, 3405, 296, 29897, 13, 18884, 21502, 305, 29918, 2084, 29918, 3888, 29889, 4397, 3552, 5066, 296, 29892, 337, 2935, 29889, 2083, 22130, 13, 9651, 1583, 29889, 14513, 29918, 3018, 29926, 29918, 7192, 359, 1839, 1022, 2878, 8875, 4286, 4830, 29898, 1311, 3032, 1022, 2878, 4638, 353, 21502, 305, 29918, 2084, 29918, 3888, 13, 9651, 17927, 29889, 7620, 29918, 17833, 29918, 1272, 29898, 1311, 29889, 14513, 29918, 3018, 29926, 29918, 7192, 359, 29892, 525, 14513, 29918, 3018, 29926, 29918, 7192, 359, 29889, 29886, 6321, 1495, 13, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 353, 316, 802, 29898, 3317, 2435, 29922, 1311, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29897, 13, 4706, 1583, 3032, 1022, 2878, 4619, 29871, 29896, 13, 13, 1678, 822, 679, 29918, 6051, 20921, 29898, 1311, 1125, 13, 4706, 2224, 29918, 29880, 575, 353, 518, 2435, 29898, 2084, 1839, 7387, 11287, 363, 2224, 297, 1583, 3032, 1022, 2878, 29918, 24772, 29962, 13, 4706, 22663, 353, 8170, 287, 21533, 4197, 13, 9651, 6702, 1949, 6576, 3001, 742, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 511, 13, 9651, 6702, 1949, 10898, 3001, 742, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 511, 13, 308, 2314, 13, 4706, 22663, 29889, 5504, 29898, 3258, 29918, 16202, 29918, 21693, 29918, 8977, 29898, 13, 9651, 376, 2084, 3309, 613, 13, 9651, 2224, 29918, 29880, 575, 29892, 13, 9651, 2337, 29918, 4294, 29918, 497, 29918, 16202, 29922, 5574, 29892, 13, 308, 876, 13, 4706, 736, 22663, 13, 13, 1678, 822, 679, 29918, 29879, 14551, 29898, 1311, 1125, 13, 4706, 736, 9657, 29898, 13, 9651, 8829, 29922, 1311, 3032, 6272, 29892, 13, 9651, 8898, 29922, 1311, 3032, 22197, 29892, 13, 4706, 1723, 13, 13, 1990, 9330, 25255, 287, 2605, 28916, 272, 29898, 2605, 28916, 272, 1125, 13, 1678, 822, 4770, 2344, 12035, 13, 9651, 1583, 29892, 13, 9651, 8829, 29892, 13, 9651, 8898, 29892, 13, 9651, 1104, 1107, 261, 29892, 13, 9651, 4236, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29922, 8516, 29892, 13, 9651, 4050, 29922, 8824, 29892, 13, 9651, 4050, 29918, 19290, 29922, 8516, 29892, 13, 9651, 338, 29918, 14513, 29922, 8824, 29892, 13, 9651, 8147, 29918, 29878, 29918, 29881, 29922, 5574, 29892, 13, 9651, 9563, 29918, 5066, 296, 29922, 8824, 29892, 13, 9651, 4226, 675, 29918, 546, 13390, 29922, 8824, 29892, 13, 9651, 4078, 29918, 29894, 7958, 29922, 8824, 13, 268, 1125, 13, 4706, 565, 4050, 29918, 19290, 338, 6213, 29901, 13, 9651, 4050, 29918, 19290, 353, 6571, 13, 4706, 1583, 3032, 6272, 353, 8829, 13, 4706, 1583, 3032, 22197, 353, 8898, 13, 4706, 1583, 3032, 276, 1643, 261, 353, 1104, 1107, 261, 13, 4706, 1583, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 353, 4236, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 13, 4706, 1583, 3032, 9482, 353, 4050, 13, 4706, 1583, 3032, 9482, 29918, 19290, 353, 4050, 29918, 19290, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 353, 316, 802, 29898, 3317, 2435, 29922, 1311, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29897, 13, 4706, 1583, 29889, 275, 29918, 14513, 353, 338, 29918, 14513, 13, 4706, 1583, 29889, 15807, 403, 29918, 29878, 29918, 29881, 353, 8147, 29918, 29878, 29918, 29881, 13, 4706, 1583, 29889, 11458, 29918, 5066, 296, 353, 9563, 29918, 5066, 296, 13, 4706, 1583, 29889, 8945, 675, 29918, 546, 13390, 353, 4226, 675, 29918, 546, 13390, 13, 4706, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 353, 29871, 29900, 13, 4706, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 353, 29871, 29900, 13, 4706, 1583, 3032, 1022, 2878, 353, 29871, 29900, 13, 13, 4706, 396, 363, 4863, 14238, 13, 4706, 1583, 29889, 7620, 29918, 9641, 353, 4078, 29918, 29894, 7958, 322, 451, 1583, 29889, 275, 29918, 14513, 322, 756, 5552, 29898, 276, 1643, 261, 29892, 525, 517, 29918, 7620, 29918, 9641, 1495, 13, 13, 4706, 396, 363, 4226, 5281, 2678, 13, 4706, 1583, 29889, 14513, 29918, 3018, 29926, 29918, 7192, 359, 353, 6571, 13, 13, 1678, 822, 6314, 29918, 1482, 29918, 24772, 29898, 13, 9651, 1583, 29892, 13, 9651, 4236, 29918, 2084, 29918, 2848, 29892, 13, 9651, 954, 29918, 24530, 29892, 13, 9651, 2313, 538, 29918, 262, 8835, 29918, 24772, 29892, 13, 268, 1125, 13, 4706, 10898, 353, 5159, 13, 4706, 954, 29918, 24530, 29918, 15914, 287, 353, 29871, 29900, 13, 13, 4706, 1596, 29898, 29888, 29908, 8009, 6576, 297, 9679, 17718, 526, 29901, 426, 1949, 29918, 24530, 27195, 13, 13, 4706, 565, 1583, 29889, 7620, 29918, 9641, 322, 1583, 3032, 276, 1643, 261, 29889, 517, 29918, 7620, 29918, 9641, 29898, 1311, 3032, 1022, 2878, 1125, 13, 9651, 4050, 353, 5852, 13, 9651, 4050, 29918, 19290, 353, 9657, 29898, 8513, 2433, 23973, 29918, 2378, 1495, 13, 4706, 1683, 29901, 13, 9651, 4050, 353, 1583, 3032, 9482, 13, 9651, 4050, 29918, 19290, 353, 1583, 3032, 9482, 29918, 19290, 13, 13, 4706, 1596, 29898, 29888, 29908, 13967, 29918, 1254, 29923, 7024, 2672, 402, 4448, 23611, 23958, 3281, 1955, 8519, 29901, 426, 1949, 29918, 24530, 27195, 13, 4706, 1550, 954, 29918, 24530, 29918, 15914, 287, 529, 954, 29918, 24530, 29901, 13, 9651, 4236, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 353, 1375, 29898, 29871, 396, 1938, 451, 748, 975, 954, 29918, 24530, 13, 18884, 4236, 29918, 2084, 29918, 2848, 29892, 13, 18884, 954, 29918, 24530, 448, 954, 29918, 24530, 29918, 15914, 287, 29892, 13, 9651, 1723, 13, 9651, 1596, 29898, 29888, 29908, 7976, 2224, 7431, 297, 2425, 29901, 426, 3317, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 27195, 13, 9651, 2224, 353, 1773, 277, 1278, 29918, 1245, 449, 29918, 2541, 29918, 276, 1643, 261, 29898, 13, 18884, 1583, 3032, 6272, 29892, 13, 18884, 1583, 3032, 22197, 29892, 13, 18884, 1583, 3032, 276, 1643, 261, 29892, 13, 18884, 4236, 29918, 2084, 29918, 2848, 29922, 3317, 29918, 2084, 29918, 2848, 29918, 1366, 29918, 7888, 29892, 13, 18884, 4050, 29922, 9482, 29892, 13, 18884, 4050, 29918, 19290, 29922, 9482, 29918, 19290, 29892, 13, 18884, 736, 29918, 8977, 29918, 26290, 29922, 8824, 29892, 13, 18884, 8147, 29918, 29878, 29918, 29881, 29922, 1311, 29889, 15807, 403, 29918, 29878, 29918, 29881, 29892, 13, 18884, 9563, 29918, 5066, 296, 29922, 1311, 29889, 11458, 29918, 5066, 296, 13, 9651, 1723, 13, 9651, 2224, 29918, 2435, 353, 7431, 29898, 2084, 1839, 7387, 11287, 13, 13, 9651, 1596, 29898, 29888, 29908, 2605, 29918, 2435, 297, 402, 4448, 29901, 426, 2084, 29918, 2435, 27195, 13, 9651, 565, 313, 13, 462, 1678, 2224, 29918, 2435, 2804, 4236, 29918, 2084, 29918, 2848, 13, 462, 1678, 322, 451, 2224, 1839, 8489, 19016, 2033, 14352, 29896, 29962, 13, 462, 1678, 322, 2313, 538, 29918, 262, 8835, 29918, 24772, 13, 632, 1125, 13, 18884, 2867, 13, 9651, 954, 29918, 24530, 29918, 15914, 287, 4619, 2224, 29918, 2435, 13, 13, 9651, 10898, 29889, 4397, 29898, 2084, 29897, 13, 4706, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 4619, 7431, 29898, 24772, 29897, 13, 4706, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 4619, 954, 29918, 24530, 29918, 15914, 287, 13, 4706, 565, 1583, 29889, 8945, 675, 29918, 546, 13390, 29901, 13, 9651, 363, 2224, 297, 10898, 29901, 13, 18884, 2224, 1839, 8945, 1891, 29918, 276, 2935, 2033, 353, 1583, 3032, 276, 1643, 261, 29889, 657, 29918, 8945, 1891, 29918, 2084, 29918, 276, 2935, 29898, 2084, 29897, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 29889, 21843, 29898, 24772, 29897, 13, 13, 4706, 1596, 29898, 29888, 29908, 21515, 310, 10898, 297, 9330, 25255, 287, 2605, 28916, 272, 29901, 426, 2435, 29898, 24772, 2915, 1159, 13, 13, 4706, 736, 10898, 13, 13, 1678, 822, 679, 29918, 1022, 2878, 29918, 24772, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 1022, 2878, 29918, 24772, 13, 13, 1678, 822, 1095, 29918, 1022, 2878, 29898, 1311, 29892, 21502, 305, 1125, 13, 4706, 565, 1583, 29889, 275, 29918, 14513, 29901, 13, 9651, 21502, 305, 29918, 2084, 29918, 3888, 353, 5159, 13, 9651, 363, 2224, 297, 1583, 3032, 1022, 2878, 29918, 24772, 29901, 13, 18884, 3405, 296, 353, 2224, 1839, 5066, 1237, 2033, 29961, 29900, 29962, 13, 18884, 337, 2935, 353, 1583, 3032, 276, 1643, 261, 29889, 15807, 403, 29918, 2084, 29918, 276, 1328, 29898, 2084, 29892, 3405, 296, 29897, 13, 18884, 21502, 305, 29918, 2084, 29918, 3888, 29889, 4397, 3552, 5066, 296, 29892, 337, 2935, 29889, 2083, 22130, 13, 9651, 1583, 29889, 14513, 29918, 3018, 29926, 29918, 7192, 359, 1839, 1022, 2878, 8875, 4286, 4830, 29898, 1311, 3032, 1022, 2878, 4638, 353, 21502, 305, 29918, 2084, 29918, 3888, 13, 9651, 17927, 29889, 7620, 29918, 17833, 29918, 1272, 29898, 1311, 29889, 14513, 29918, 3018, 29926, 29918, 7192, 359, 29892, 525, 14513, 29918, 3018, 29926, 29918, 7192, 359, 29889, 29886, 6321, 1495, 13, 13, 4706, 1583, 3032, 1022, 2878, 29918, 24772, 353, 316, 802, 29898, 3317, 2435, 29922, 1311, 3032, 3317, 29918, 1949, 29918, 1022, 2878, 29918, 24772, 29918, 17314, 29897, 13, 4706, 1583, 3032, 1022, 2878, 4619, 29871, 29896, 13, 13, 1678, 822, 679, 29918, 6051, 20921, 29898, 1311, 1125, 13, 4706, 2224, 29918, 29880, 575, 353, 518, 2435, 29898, 2084, 1839, 7387, 11287, 363, 2224, 297, 1583, 3032, 1022, 2878, 29918, 24772, 29962, 13, 4706, 22663, 353, 8170, 287, 21533, 4197, 13, 9651, 6702, 1949, 6576, 3001, 742, 1583, 3032, 1949, 29918, 24530, 29918, 7827, 511, 13, 9651, 6702, 1949, 10898, 3001, 742, 1583, 3032, 1949, 29918, 24772, 29918, 7827, 511, 13, 308, 2314, 13, 4706, 22663, 29889, 5504, 29898, 3258, 29918, 16202, 29918, 21693, 29918, 8977, 29898, 13, 9651, 376, 2084, 3309, 613, 13, 9651, 2224, 29918, 29880, 575, 29892, 13, 9651, 2337, 29918, 4294, 29918, 497, 29918, 16202, 29922, 5574, 29892, 13, 308, 876, 13, 4706, 736, 22663, 13, 13, 1678, 822, 679, 29918, 29879, 14551, 29898, 1311, 1125, 13, 4706, 736, 9657, 29898, 13, 9651, 8829, 29922, 1311, 3032, 6272, 29892, 13, 9651, 8898, 29922, 1311, 3032, 22197, 29892, 13, 4706, 1723, 13, 2 ]
blyaml/validators.py
Brainlabs-Digital/Brainlabs-YAML-Generator
0
30236
import re from datetime import datetime from PyInquirer import Validator, ValidationError from prompt_toolkit.document import Document # This file contains functions used for validation and Validator classes that use them. # Validators are used by questions. def non_empty(document: Document) -> bool: if not document.text: raise ValidationError( message="Please enter a non-empty value.", cursor_position=len(document.text), ) return True def valid_date(document: Document) -> bool: try: datetime.strptime(document.text, "%Y-%m-%d") return True except ValueError: raise ValidationError( message="Please enter a valid yyyy-mm-dd date.", cursor_position=len(document.text), ) email_regex = r"^(\w|\d|\.|\_|\-)+$" def valid_email_prefix(document: Document) -> bool: try: assert re.match(email_regex, document.text) return True except AssertionError: raise ValidationError( message="Please enter a valid email prefix (e.g. james.f).", cursor_position=len(document.text), ) def valid_email_prefix_list(document: Document) -> bool: try: for prefix in document.text.split(","): assert re.match(email_regex, prefix.strip()) return True except AssertionError: raise ValidationError( message="Please enter a comma seperated list of valid email prefixes (e.g. james.f).", cursor_position=len(document.text), ) url_regex = ( r"^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$" ) def valid_url(document: Document) -> bool: try: assert re.match(url_regex, document.text.strip()) return True except AssertionError: raise ValidationError( message="Please enter a valid url.", cursor_position=len(document.text) ) def valid_url_list(document: Document) -> bool: try: for url in document.text.split(","): assert re.match(url_regex, url.strip()) return True except AssertionError: raise ValidationError( message="Please enter a comma seperated list of valid urls.", cursor_position=len(document.text), ) def valid_cron(document: Document) -> bool: # Cron supports lots of advanced features such as ranges, so the regex is very long. cron_regex = r"^(\*|([0-9]|0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])) (\*|([0-9]|0[0-9]|1[0-9]|2[0-3])|\*\/([0-9]|0[0-9]|1[0-9]|2[0-3])) (\*|([1-9]|0[0-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|0[0-9]|1[0-9]|2[0-9]|3[0-1])) (\*|([1-9]|0[0-9]|1[0-2])|\*\/([1-9]|0[0-9]|1[0-2])) (\*|([0-6])|\*\/([0-6]))$" try: if document.text.strip() != "null": assert re.match(cron_regex, document.text.strip()) return True except AssertionError: raise ValidationError( message="Please enter a valid cron or null.", cursor_position=len(document.text), ) def valid_directory(document: Document) -> bool: directory_regex = r"^(/)?([^/\0]+(/)?)+$" try: assert re.match(directory_regex, document.text.strip()) return True except AssertionError: raise ValidationError( message="Please enter a valid unix directory.", cursor_position=len(document.text), ) class ValidNonEmpty(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a non-empty value.""" return non_empty(document) class ValidEmailPrefix(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a valid email prefix.""" return non_empty(document) and valid_email_prefix(document) class ValidEmailPrefixList(Validator): def validate(self, document: Document) -> bool: return non_empty(document) and valid_email_prefix_list(document) class ValidClientIds(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a syntaxtically valid client id list.""" # Checkboxes don't support validation yet. # https://github.com/CITGuru/PyInquirer/issues/46 return True class ValidDate(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a valid yyyy-mm-dd date.""" return non_empty(document) and valid_date(document) class ValidOptionalUrl(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a syntaxtically valid url.""" return document.text == "" or valid_url(document) class ValidUrl(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a syntaxtically valid url.""" return non_empty(document) and valid_url(document) class ValidUrlList(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a syntaxtically valid url list.""" return non_empty(document) and valid_url_list(document) class ValidOptionalUrlList(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a syntaxtically valid url list.""" return document.text == "" or valid_url_list(document) class ValidCron(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a syntaxtically valid crontab style string.""" return non_empty(document) and valid_cron(document) class ValidDirectory(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a syntaxtically valid unix path.""" return non_empty(document) and valid_directory(document) class ValidOptionalDirectory(Validator): def validate(self, document: Document) -> bool: """Return True with no errors for a syntaxtically valid unix path.""" return document.text == "" and valid_directory(document)
[ 1, 1053, 337, 13, 3166, 12865, 1053, 12865, 13, 13, 3166, 10772, 797, 339, 381, 261, 1053, 15758, 1061, 29892, 15758, 362, 2392, 13, 3166, 9508, 29918, 10154, 7354, 29889, 3225, 1053, 10854, 13, 13, 29937, 910, 934, 3743, 3168, 1304, 363, 8845, 322, 15758, 1061, 4413, 393, 671, 963, 29889, 13, 29937, 15758, 4097, 526, 1304, 491, 5155, 29889, 13, 13, 13, 1753, 1661, 29918, 6310, 29898, 3225, 29901, 10854, 29897, 1599, 6120, 29901, 13, 1678, 565, 451, 1842, 29889, 726, 29901, 13, 4706, 12020, 15758, 362, 2392, 29898, 13, 9651, 2643, 543, 12148, 3896, 263, 1661, 29899, 6310, 995, 19602, 13, 9651, 10677, 29918, 3283, 29922, 2435, 29898, 3225, 29889, 726, 511, 13, 4706, 1723, 13, 1678, 736, 5852, 13, 13, 13, 1753, 2854, 29918, 1256, 29898, 3225, 29901, 10854, 29897, 1599, 6120, 29901, 13, 1678, 1018, 29901, 13, 4706, 12865, 29889, 710, 415, 603, 29898, 3225, 29889, 726, 29892, 11860, 29979, 19222, 29885, 19222, 29881, 1159, 13, 4706, 736, 5852, 13, 1678, 5174, 7865, 2392, 29901, 13, 4706, 12020, 15758, 362, 2392, 29898, 13, 9651, 2643, 543, 12148, 3896, 263, 2854, 343, 8071, 29891, 29899, 4317, 29899, 1289, 2635, 19602, 13, 9651, 10677, 29918, 3283, 29922, 2435, 29898, 3225, 29889, 726, 511, 13, 4706, 1723, 13, 13, 13, 5269, 29918, 13087, 353, 364, 29908, 29985, 1194, 29893, 4295, 29881, 4295, 29889, 4295, 29918, 4295, 29899, 7240, 29938, 29908, 13, 13, 13, 1753, 2854, 29918, 5269, 29918, 13506, 29898, 3225, 29901, 10854, 29897, 1599, 6120, 29901, 13, 1678, 1018, 29901, 13, 4706, 4974, 337, 29889, 4352, 29898, 5269, 29918, 13087, 29892, 1842, 29889, 726, 29897, 13, 4706, 736, 5852, 13, 1678, 5174, 16499, 291, 2392, 29901, 13, 4706, 12020, 15758, 362, 2392, 29898, 13, 9651, 2643, 543, 12148, 3896, 263, 2854, 4876, 10944, 313, 29872, 29889, 29887, 29889, 432, 1280, 29889, 29888, 467, 613, 13, 9651, 10677, 29918, 3283, 29922, 2435, 29898, 3225, 29889, 726, 511, 13, 4706, 1723, 13, 13, 13, 1753, 2854, 29918, 5269, 29918, 13506, 29918, 1761, 29898, 3225, 29901, 10854, 29897, 1599, 6120, 29901, 13, 1678, 1018, 29901, 13, 4706, 363, 10944, 297, 1842, 29889, 726, 29889, 5451, 29898, 3284, 1125, 13, 9651, 4974, 337, 29889, 4352, 29898, 5269, 29918, 13087, 29892, 10944, 29889, 17010, 3101, 13, 4706, 736, 5852, 13, 1678, 5174, 16499, 291, 2392, 29901, 13, 4706, 12020, 15758, 362, 2392, 29898, 13, 9651, 2643, 543, 12148, 3896, 263, 16694, 409, 546, 630, 1051, 310, 2854, 4876, 10944, 267, 313, 29872, 29889, 29887, 29889, 432, 1280, 29889, 29888, 467, 613, 13, 9651, 10677, 29918, 3283, 29922, 2435, 29898, 3225, 29889, 726, 511, 13, 4706, 1723, 13, 13, 13, 2271, 29918, 13087, 353, 313, 13, 1678, 364, 29908, 29985, 10780, 29901, 1124, 29898, 29879, 6877, 3583, 7998, 4551, 29973, 7110, 29893, 9229, 10062, 10780, 3583, 29889, 7110, 29893, 29905, 9229, 10062, 7240, 7110, 29893, 29905, 2612, 3032, 30022, 8419, 29973, 29937, 7110, 29962, 29992, 9903, 29938, 29987, 12764, 1194, 2144, 17710, 29974, 29892, 29936, 29922, 5586, 24035, 29908, 13, 29897, 13, 13, 13, 1753, 2854, 29918, 2271, 29898, 3225, 29901, 10854, 29897, 1599, 6120, 29901, 13, 1678, 1018, 29901, 13, 4706, 4974, 337, 29889, 4352, 29898, 2271, 29918, 13087, 29892, 1842, 29889, 726, 29889, 17010, 3101, 13, 4706, 736, 5852, 13, 1678, 5174, 16499, 291, 2392, 29901, 13, 4706, 12020, 15758, 362, 2392, 29898, 13, 9651, 2643, 543, 12148, 3896, 263, 2854, 3142, 19602, 10677, 29918, 3283, 29922, 2435, 29898, 3225, 29889, 726, 29897, 13, 4706, 1723, 13, 13, 13, 1753, 2854, 29918, 2271, 29918, 1761, 29898, 3225, 29901, 10854, 29897, 1599, 6120, 29901, 13, 1678, 1018, 29901, 13, 4706, 363, 3142, 297, 1842, 29889, 726, 29889, 5451, 29898, 3284, 1125, 13, 9651, 4974, 337, 29889, 4352, 29898, 2271, 29918, 13087, 29892, 3142, 29889, 17010, 3101, 13, 4706, 736, 5852, 13, 1678, 5174, 16499, 291, 2392, 29901, 13, 4706, 12020, 15758, 362, 2392, 29898, 13, 9651, 2643, 543, 12148, 3896, 263, 16694, 409, 546, 630, 1051, 310, 2854, 23942, 19602, 13, 9651, 10677, 29918, 3283, 29922, 2435, 29898, 3225, 29889, 726, 511, 13, 4706, 1723, 13, 13, 13, 1753, 2854, 29918, 29883, 1617, 29898, 3225, 29901, 10854, 29897, 1599, 6120, 29901, 13, 1678, 396, 315, 1617, 11286, 14568, 310, 12862, 5680, 1316, 408, 20238, 29892, 577, 278, 6528, 338, 1407, 1472, 29889, 13, 1678, 18863, 29918, 13087, 353, 364, 29908, 29985, 1194, 29930, 29989, 4197, 29900, 29899, 29929, 29962, 29989, 29900, 29961, 29900, 29899, 29929, 29962, 29989, 29896, 29961, 29900, 29899, 29929, 29962, 29989, 29906, 29961, 29900, 29899, 29929, 29962, 29989, 29941, 29961, 29900, 29899, 29929, 29962, 29989, 29946, 29961, 29900, 29899, 29929, 29962, 29989, 29945, 29961, 29900, 29899, 29929, 2314, 4295, 17710, 29914, 4197, 29900, 29899, 29929, 29962, 29989, 29900, 29961, 29900, 29899, 29929, 29962, 29989, 29896, 29961, 29900, 29899, 29929, 29962, 29989, 29906, 29961, 29900, 29899, 29929, 29962, 29989, 29941, 29961, 29900, 29899, 29929, 29962, 29989, 29946, 29961, 29900, 29899, 29929, 29962, 29989, 29945, 29961, 29900, 29899, 29929, 12622, 3441, 29930, 29989, 4197, 29900, 29899, 29929, 29962, 29989, 29900, 29961, 29900, 29899, 29929, 29962, 29989, 29896, 29961, 29900, 29899, 29929, 29962, 29989, 29906, 29961, 29900, 29899, 29941, 2314, 4295, 17710, 29914, 4197, 29900, 29899, 29929, 29962, 29989, 29900, 29961, 29900, 29899, 29929, 29962, 29989, 29896, 29961, 29900, 29899, 29929, 29962, 29989, 29906, 29961, 29900, 29899, 29941, 12622, 3441, 29930, 29989, 4197, 29896, 29899, 29929, 29962, 29989, 29900, 29961, 29900, 29899, 29929, 29962, 29989, 29896, 29961, 29900, 29899, 29929, 29962, 29989, 29906, 29961, 29900, 29899, 29929, 29962, 29989, 29941, 29961, 29900, 29899, 29896, 2314, 4295, 17710, 29914, 4197, 29896, 29899, 29929, 29962, 29989, 29900, 29961, 29900, 29899, 29929, 29962, 29989, 29896, 29961, 29900, 29899, 29929, 29962, 29989, 29906, 29961, 29900, 29899, 29929, 29962, 29989, 29941, 29961, 29900, 29899, 29896, 12622, 3441, 29930, 29989, 4197, 29896, 29899, 29929, 29962, 29989, 29900, 29961, 29900, 29899, 29929, 29962, 29989, 29896, 29961, 29900, 29899, 29906, 2314, 4295, 17710, 29914, 4197, 29896, 29899, 29929, 29962, 29989, 29900, 29961, 29900, 29899, 29929, 29962, 29989, 29896, 29961, 29900, 29899, 29906, 12622, 3441, 29930, 29989, 4197, 29900, 29899, 29953, 2314, 4295, 17710, 29914, 4197, 29900, 29899, 29953, 12622, 29938, 29908, 13, 1678, 1018, 29901, 13, 4706, 565, 1842, 29889, 726, 29889, 17010, 580, 2804, 376, 4304, 1115, 13, 9651, 4974, 337, 29889, 4352, 29898, 29883, 1617, 29918, 13087, 29892, 1842, 29889, 726, 29889, 17010, 3101, 13, 4706, 736, 5852, 13, 1678, 5174, 16499, 291, 2392, 29901, 13, 4706, 12020, 15758, 362, 2392, 29898, 13, 9651, 2643, 543, 12148, 3896, 263, 2854, 18863, 470, 1870, 19602, 13, 9651, 10677, 29918, 3283, 29922, 2435, 29898, 3225, 29889, 726, 511, 13, 4706, 1723, 13, 13, 13, 1753, 2854, 29918, 12322, 29898, 3225, 29901, 10854, 29897, 1599, 6120, 29901, 13, 1678, 3884, 29918, 13087, 353, 364, 29908, 23733, 4551, 29973, 4197, 29985, 7998, 29900, 10062, 29898, 4551, 29973, 7240, 29938, 29908, 13, 1678, 1018, 29901, 13, 4706, 4974, 337, 29889, 4352, 29898, 12322, 29918, 13087, 29892, 1842, 29889, 726, 29889, 17010, 3101, 13, 4706, 736, 5852, 13, 1678, 5174, 16499, 291, 2392, 29901, 13, 4706, 12020, 15758, 362, 2392, 29898, 13, 9651, 2643, 543, 12148, 3896, 263, 2854, 28167, 3884, 19602, 13, 9651, 10677, 29918, 3283, 29922, 2435, 29898, 3225, 29889, 726, 511, 13, 4706, 1723, 13, 13, 13, 1990, 15758, 12283, 8915, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 1661, 29899, 6310, 995, 1213, 15945, 13, 4706, 736, 1661, 29918, 6310, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 9823, 23095, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 2854, 4876, 10944, 1213, 15945, 13, 4706, 736, 1661, 29918, 6310, 29898, 3225, 29897, 322, 2854, 29918, 5269, 29918, 13506, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 9823, 23095, 1293, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 736, 1661, 29918, 6310, 29898, 3225, 29897, 322, 2854, 29918, 5269, 29918, 13506, 29918, 1761, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 4032, 21943, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 269, 3903, 29874, 486, 1711, 2854, 3132, 1178, 1051, 1213, 15945, 13, 4706, 396, 5399, 1884, 267, 1016, 29915, 29873, 2304, 8845, 3447, 29889, 13, 4706, 396, 2045, 597, 3292, 29889, 510, 29914, 29907, 1806, 29954, 20144, 29914, 19737, 797, 339, 381, 261, 29914, 12175, 29914, 29946, 29953, 13, 4706, 736, 5852, 13, 13, 13, 1990, 15758, 2539, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 2854, 343, 8071, 29891, 29899, 4317, 29899, 1289, 2635, 1213, 15945, 13, 4706, 736, 1661, 29918, 6310, 29898, 3225, 29897, 322, 2854, 29918, 1256, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 27636, 5983, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 269, 3903, 29874, 486, 1711, 2854, 3142, 1213, 15945, 13, 4706, 736, 1842, 29889, 726, 1275, 5124, 470, 2854, 29918, 2271, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 5983, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 269, 3903, 29874, 486, 1711, 2854, 3142, 1213, 15945, 13, 4706, 736, 1661, 29918, 6310, 29898, 3225, 29897, 322, 2854, 29918, 2271, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 5983, 1293, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 269, 3903, 29874, 486, 1711, 2854, 3142, 1051, 1213, 15945, 13, 4706, 736, 1661, 29918, 6310, 29898, 3225, 29897, 322, 2854, 29918, 2271, 29918, 1761, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 27636, 5983, 1293, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 269, 3903, 29874, 486, 1711, 2854, 3142, 1051, 1213, 15945, 13, 4706, 736, 1842, 29889, 726, 1275, 5124, 470, 2854, 29918, 2271, 29918, 1761, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 29907, 1617, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 269, 3903, 29874, 486, 1711, 2854, 2181, 609, 370, 3114, 1347, 1213, 15945, 13, 4706, 736, 1661, 29918, 6310, 29898, 3225, 29897, 322, 2854, 29918, 29883, 1617, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 9882, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 269, 3903, 29874, 486, 1711, 2854, 28167, 2224, 1213, 15945, 13, 4706, 736, 1661, 29918, 6310, 29898, 3225, 29897, 322, 2854, 29918, 12322, 29898, 3225, 29897, 13, 13, 13, 1990, 15758, 27636, 9882, 29898, 24204, 1125, 13, 1678, 822, 12725, 29898, 1311, 29892, 1842, 29901, 10854, 29897, 1599, 6120, 29901, 13, 4706, 9995, 11609, 5852, 411, 694, 4436, 363, 263, 269, 3903, 29874, 486, 1711, 2854, 28167, 2224, 1213, 15945, 13, 4706, 736, 1842, 29889, 726, 1275, 5124, 322, 2854, 29918, 12322, 29898, 3225, 29897, 13, 2 ]
tutorial/third_example/topwords.py
xldrx/mapreduce_examples
2
76889
#! /usr/bin/env python -u # coding=utf-8 __author__ = 'xl' import sys from operator import add from pyspark import SparkContext import re if __name__ == "__main__": if len(sys.argv) != 3: print("Usage: wordcount <input> <output>") exit(-1) sc = SparkContext(appName="PythonWordCount") common_words = ["the", "a", "an", "and", "of", "to", "in", "am", "is", "are", "at", "not"] lines = sc.textFile(sys.argv[1], 1) counts = lines.flatMap(lambda x: re.split(r"[ \t,;\.\?!-:@\[\]\(\){}_\*/]+", x)) \ .filter(lambda x: x.lower() not in common_words and len(x) > 0) \ .map(lambda x: (x, 1)) \ .reduceByKey(add) \ .map(lambda x: (x[1],x[0])) \ .sortByKey(ascending=False) \ .take(10) counts = sc.parallelize(counts) \ .map(lambda x: (x[1],x[0])) counts.saveAsTextFile(sys.argv[2]) output = counts.collect() for (word, count) in output: print("%s: %i" % (word, count)) sc.stop()
[ 1, 396, 29991, 847, 4855, 29914, 2109, 29914, 6272, 3017, 448, 29884, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 13, 1649, 8921, 1649, 353, 525, 15524, 29915, 13, 13, 5215, 10876, 13, 3166, 5455, 1053, 788, 13, 13, 3166, 282, 952, 6378, 1053, 20814, 2677, 13, 5215, 337, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 565, 7431, 29898, 9675, 29889, 19218, 29897, 2804, 29871, 29941, 29901, 13, 4706, 1596, 703, 27573, 29901, 1734, 2798, 529, 2080, 29958, 529, 4905, 29958, 1159, 13, 4706, 6876, 6278, 29896, 29897, 13, 1678, 885, 353, 20814, 2677, 29898, 932, 1170, 543, 11980, 14463, 3981, 1159, 13, 1678, 3619, 29918, 9303, 353, 6796, 1552, 613, 376, 29874, 613, 376, 273, 613, 376, 392, 613, 376, 974, 613, 376, 517, 613, 376, 262, 613, 376, 314, 613, 376, 275, 613, 376, 598, 613, 376, 271, 613, 376, 1333, 3108, 13, 1678, 3454, 353, 885, 29889, 726, 2283, 29898, 9675, 29889, 19218, 29961, 29896, 1402, 29871, 29896, 29897, 13, 1678, 18139, 353, 3454, 29889, 20620, 3388, 29898, 2892, 921, 29901, 337, 29889, 5451, 29898, 29878, 29908, 29961, 320, 29873, 29892, 10436, 7790, 29973, 29991, 29899, 26984, 29905, 7110, 10725, 1194, 2597, 12806, 3877, 10062, 613, 921, 876, 320, 13, 462, 29871, 869, 4572, 29898, 2892, 921, 29901, 921, 29889, 13609, 580, 451, 297, 3619, 29918, 9303, 322, 7431, 29898, 29916, 29897, 1405, 29871, 29900, 29897, 320, 13, 462, 29871, 869, 1958, 29898, 2892, 921, 29901, 313, 29916, 29892, 29871, 29896, 876, 320, 13, 462, 29871, 869, 17469, 2059, 2558, 29898, 1202, 29897, 320, 13, 462, 29871, 869, 1958, 29898, 2892, 921, 29901, 313, 29916, 29961, 29896, 1402, 29916, 29961, 29900, 12622, 320, 13, 462, 29871, 869, 6605, 2059, 2558, 29898, 6151, 2548, 29922, 8824, 29897, 320, 13, 462, 29871, 869, 19730, 29898, 29896, 29900, 29897, 13, 1678, 18139, 353, 885, 29889, 23482, 675, 29898, 2798, 29879, 29897, 320, 13, 462, 29871, 869, 1958, 29898, 2892, 921, 29901, 313, 29916, 29961, 29896, 1402, 29916, 29961, 29900, 12622, 13, 1678, 18139, 29889, 7620, 2887, 1626, 2283, 29898, 9675, 29889, 19218, 29961, 29906, 2314, 13, 1678, 1962, 353, 18139, 29889, 15914, 580, 13, 13, 1678, 363, 313, 1742, 29892, 2302, 29897, 297, 1962, 29901, 13, 4706, 1596, 11702, 29879, 29901, 1273, 29875, 29908, 1273, 313, 1742, 29892, 2302, 876, 13, 13, 13, 1678, 885, 29889, 9847, 580, 13, 2 ]
tests/test_column_category.py
BBVA/python-etl
20
159739
<reponame>BBVA/python-etl<filename>tests/test_column_category.py # Copyright 2017 BBVA # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from datarefinery.FieldOperations import column_category def test_empty(): operator = column_category(["bebé", "niño", "joven", "adulto", "anciano"]) (res, err) = operator(None) assert res is None assert err is None def test_empty_definition(): operator = column_category(None) (res, err) = operator("niño") assert res is None assert err is not None assert err == "no categories supplied" def test_all_empty(): operator = column_category(None) (res, err) = operator(None) assert res is None assert err is not None assert err == "no categories supplied" def test_simple(): operator = column_category(["bebé", "niño", "joven", "adulto", "anciano"]) (res, err) = operator("niño") assert res is not None assert err is None assert res == {"bebé": 0, "niño": 1, "joven": 0, "adulto": 0, "anciano": 0} def test_zero_categories(): operator = column_category([]) (res, err) = operator("niño") assert res is None assert err is not None assert err == "no categories supplied" def test_different_category(): operator = column_category(["bebé", "niño", "joven", "adulto", "anciano"]) (res, err) = operator("buzo") assert res is None assert err is not None assert err == "value buzo not found on categories"
[ 1, 529, 276, 1112, 420, 29958, 14388, 20449, 29914, 4691, 29899, 300, 29880, 29966, 9507, 29958, 21150, 29914, 1688, 29918, 4914, 29918, 7320, 29889, 2272, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29955, 29449, 20449, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 268, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 13, 3166, 848, 999, 262, 708, 29889, 3073, 7094, 800, 1053, 1897, 29918, 7320, 13, 13, 13, 1753, 1243, 29918, 6310, 7295, 13, 1678, 5455, 353, 1897, 29918, 7320, 29898, 3366, 29890, 774, 29948, 613, 376, 1240, 8266, 613, 376, 29926, 9813, 613, 376, 328, 499, 29877, 613, 376, 8463, 1562, 20068, 13, 1678, 313, 690, 29892, 4589, 29897, 353, 5455, 29898, 8516, 29897, 13, 1678, 4974, 620, 338, 6213, 13, 1678, 4974, 4589, 338, 6213, 13, 13, 13, 1753, 1243, 29918, 6310, 29918, 16553, 7295, 13, 1678, 5455, 353, 1897, 29918, 7320, 29898, 8516, 29897, 13, 1678, 313, 690, 29892, 4589, 29897, 353, 5455, 703, 1240, 8266, 1159, 13, 1678, 4974, 620, 338, 6213, 13, 1678, 4974, 4589, 338, 451, 6213, 13, 1678, 4974, 4589, 1275, 376, 1217, 13997, 19056, 29908, 13, 13, 13, 1753, 1243, 29918, 497, 29918, 6310, 7295, 13, 1678, 5455, 353, 1897, 29918, 7320, 29898, 8516, 29897, 13, 1678, 313, 690, 29892, 4589, 29897, 353, 5455, 29898, 8516, 29897, 13, 1678, 4974, 620, 338, 6213, 13, 1678, 4974, 4589, 338, 451, 6213, 13, 1678, 4974, 4589, 1275, 376, 1217, 13997, 19056, 29908, 13, 13, 13, 1753, 1243, 29918, 12857, 7295, 13, 1678, 5455, 353, 1897, 29918, 7320, 29898, 3366, 29890, 774, 29948, 613, 376, 1240, 8266, 613, 376, 29926, 9813, 613, 376, 328, 499, 29877, 613, 376, 8463, 1562, 20068, 13, 1678, 313, 690, 29892, 4589, 29897, 353, 5455, 703, 1240, 8266, 1159, 13, 1678, 4974, 620, 338, 451, 6213, 13, 1678, 4974, 4589, 338, 6213, 13, 1678, 4974, 620, 1275, 8853, 29890, 774, 29948, 1115, 29871, 29900, 29892, 376, 1240, 8266, 1115, 259, 29896, 29892, 376, 29926, 9813, 1115, 29871, 29900, 29892, 376, 328, 499, 29877, 1115, 29871, 29900, 29892, 376, 8463, 1562, 1115, 29871, 29900, 29913, 13, 13, 13, 1753, 1243, 29918, 9171, 29918, 20683, 7295, 13, 1678, 5455, 353, 1897, 29918, 7320, 4197, 2314, 13, 1678, 313, 690, 29892, 4589, 29897, 353, 5455, 703, 1240, 8266, 1159, 13, 1678, 4974, 620, 338, 6213, 13, 1678, 4974, 4589, 338, 451, 6213, 13, 1678, 4974, 4589, 1275, 376, 1217, 13997, 19056, 29908, 13, 13, 13, 1753, 1243, 29918, 29881, 15622, 29918, 7320, 7295, 13, 1678, 5455, 353, 1897, 29918, 7320, 29898, 3366, 29890, 774, 29948, 613, 376, 1240, 8266, 613, 376, 29926, 9813, 613, 376, 328, 499, 29877, 613, 376, 8463, 1562, 20068, 13, 1678, 313, 690, 29892, 4589, 29897, 353, 5455, 703, 2423, 2502, 1159, 13, 1678, 4974, 620, 338, 6213, 13, 1678, 4974, 4589, 338, 451, 6213, 13, 1678, 4974, 4589, 1275, 376, 1767, 1321, 2502, 451, 1476, 373, 13997, 29908, 13, 2 ]
segviz/render.py
shuohan/segviz
0
97118
import numpy as np from PIL import Image from scipy.ndimage.morphology import binary_erosion from improc3d import quantile_scale, calc_bbox3d from .utils import MIN_UINT8, MAX_UINT8 from .utils import assign_colors, compose_image_and_labels class ImageRenderer: """Renders slices from a 3D image using PIL. Note: The 3rd dimension is used as the slice dimension. Use `improc3d <https://github.com/shuohan/improc3d>`_ to reslice the image. >>> from improc3d import transform_to_sagittal >>> sagittal = transform_to_sagittal(image, lpim_affine) >>> renderer = ImageRenderer(sagittal) >>> print('Number of slices', len(renderer)) >>> sag_slice = renderer[100] Attributes: image (numpy.ndarray): The image to render. """ def __init__(self, image): self.image = image self._rescaled = image self.rescale_intensity() def automatic_rescale(self): """Rescales the image automatically. Works fine for T1w brain images.""" self._rescaled = quantile_scale(self.image, lower_th=MIN_UINT8, upper_th=MAX_UINT8) self._rescaled = self._rescaled.astype(np.uint8) @property def slice_size(self): """Returns the width and height of image slices.""" width = self.image.shape[1] height = self.image.shape[0] return width, height @property def intensity_range(self): """Returns the value range of the image intensities ``[vmin, vmax]``.""" vmin = np.min(self.image) vmax = np.max(self.image) return vmin, vmax def rescale_intensity(self, vmin=None, vmax=None): """Rescales image intensity into ``[vmin, vmax]``. Args: vmin (float): Any values below ``vmin`` are set to 0. vmax (float): Any values above ``vmax`` are set to 255. """ int_range = self.intensity_range vmin = int_range[0] if vmin is None else vmin vmax = int_range[1] if vmax is None else vmax self._rescaled = self.image.copy() self._rescaled[self._rescaled < vmin] = vmin self._rescaled[self._rescaled > vmax] = vmax self._rescaled = (self._rescaled - vmin) / (vmax - vmin) self._rescaled = self._rescaled * (MAX_UINT8 - MIN_UINT8) + MIN_UINT8 self._rescaled = self._rescaled.astype(np.uint8) def __len__(self): return self.image.shape[-1] def __getitem__(self, ind): ind = self._check_slice_ind(ind) image_slice = self._rescaled[:, :, ind] image_slice = Image.fromarray(image_slice, 'L') image_slice = image_slice.transpose(Image.TRANSPOSE) return image_slice def _check_slice_ind(self, ind): if ind < 0: ind = 0 print('Slice index should not be less than {}.'.format(ind)) if ind > len(self) - 1: ind = len(self) - 1 print('Slice index should not be greater than {}.'.format(ind)) return ind class ImagePairRenderer(ImageRenderer): """Renders image and its corresponding label image as an alpha-composite. Note: The attribute :attr:`label_image` will be converted into a "colored" image by assigning :attr:`colors` to its label values. As the input, it should have the same shape with :attr:`image`; after conversion, it will have a 4th dimension as the colors. Attributes: label_image (numpy.ndarray): The corresponding label image. It should have the same spatial shape with :attr:`image`. colors (numpy.ndarray): The num_colors x 4 RGBA colors array. alpha (float): The alpha value of the label image. """ def __init__(self, image, label_image, colors, alpha=1.0): assert image.shape == label_image.shape super().__init__(image) self._alpha = alpha self.colors = colors self.label_image = label_image self._assign_colors() @property def alpha(self): return self._alpha @alpha.setter def alpha(self, value): self._alpha = value self._assign_colors() def _assign_colors(self): self._colored_label_image = assign_colors(self.label_image, self.colors) def __getitem__(self, ind): ind = self._check_slice_ind(ind) image_slice = self._rescaled[:, :, ind] label_slice = self._colored_label_image[:, :, ind, :] comp = compose_image_and_labels(image_slice, label_slice, self.alpha) comp = comp.transpose(Image.TRANSPOSE) return comp def get_label_range(self): """Returns the index range of slices with non-background labels.""" bbox = calc_bbox3d(self.label_image > 0) slice_range = bbox[-1] return slice_range.start, slice_range.stop class ImageEdgeRenderer(ImagePairRenderer): """Renders an image and the outside contours (edge) of each labeled region. Attributes: edge_width (int): The width of the edge as the number of pixels. """ def __init__(self, image, label_image, colors, alpha=1, edge_width=1): self._edge_width = edge_width super().__init__(image, label_image, colors, alpha) @property def edge_width(self): return self._edge_width @edge_width.setter def edge_width(self, width): self._edge_width = width self._assign_colors() def _assign_colors(self): """Only assigns the colors to the outside contours (edges).""" label_image = self.label_image.copy() for label in np.unique(label_image): mask = label_image == label erosion = binary_erosion(mask, iterations=self.edge_width) label_image[erosion] = 0 self._colored_label_image = assign_colors(label_image, self.colors) class CheckerboardRenderer(ImageRenderer): def __init__(self, image1, image2, patch_size=20, alpha=0): self._renderer1 = ImageRenderer(image1) self._renderer2 = ImageRenderer(image2) assert self._renderer1.slice_size == self._renderer2.slice_size self.patch_size = patch_size self.alpha = alpha def automatic_rescale(self): self._renderer1.automatic_rescale() self._renderer2.automatic_rescale() @property def slice_size(self): return self._renderer1.slice_size @property def intensity_range(self): vmin1, vmax1 = self._renderer1.intensity_range vmin2, vmax2 = self._renderer2.intensity_range return vmin1, vmax1, vmin2, vmax2 def rescale_intensity(self, vmin1=None, vmax1=None, vmin2=None, vmax2=None): self._renderer1.rescale_intensity(vmin1, vmax1) self._renderer2.rescale_intensity(vmin2, vmax2) def __len__(self): return len(self._renderer1) def __getitem__(self, ind): image_slice1 = self._renderer1[ind] image_slice2 = self._renderer2[ind] image_slice = self._compose(image_slice1, image_slice2) return image_slice def _check_slice_ind(self, ind): assert False def _compose(self, image_slice1, image_slice2): array1 = np.array(image_slice1.convert('RGBA'), dtype=np.uint8) array2 = np.array(image_slice2.convert('RGBA'), dtype=np.uint8) height, width = array1.shape[:2] left = 0 top = 0 alpha_upper = self.alpha alpha = self.alpha while top < height: hstart = top hend = hstart + self.patch_size while left < width: wstart = left wend = left + self.patch_size array1[hstart:hend, wstart:wend, 3] = \ array1[hstart:hend, wstart:wend, 3] * (1 - alpha) array2[hstart:hend, wstart:wend, 3] = \ array2[hstart:hend, wstart:wend, 3] * alpha left = wend alpha = 1 - alpha top = hend left = 0 alpha = 1 - alpha_upper alpha_upper = alpha image1 = Image.fromarray(array1) image2 = Image.fromarray(array2) composition = Image.alpha_composite(image1, image2) return composition class AlphaRenderer(ImageRenderer): def __init__(self, image1, image2, alpha=0): self._renderer1 = ImageRenderer(image1) self._renderer2 = ImageRenderer(image2) assert self._renderer1.slice_size == self._renderer2.slice_size self.alpha = alpha def automatic_rescale(self): self._renderer1.automatic_rescale() self._renderer2.automatic_rescale() @property def slice_size(self): return self._renderer1.slice_size @property def intensity_range(self): vmin1, vmax1 = self._renderer1.intensity_range vmin2, vmax2 = self._renderer2.intensity_range return vmin1, vmax1, vmin2, vmax2 def rescale_intensity(self, vmin1=None, vmax1=None, vmin2=None, vmax2=None): self._renderer1.rescale_intensity(vmin1, vmax1) self._renderer2.rescale_intensity(vmin2, vmax2) def __len__(self): return len(self._renderer1) def __getitem__(self, ind): image_slice1 = self._renderer1[ind] image_slice2 = self._renderer2[ind] image_slice = self._compose(image_slice1, image_slice2) return image_slice def _check_slice_ind(self, ind): assert False def _compose(self, image_slice1, image_slice2): array1 = np.array(image_slice1.convert('RGBA'), dtype=np.uint8) array2 = np.array(image_slice2.convert('RGBA'), dtype=np.uint8) array2[..., 3] = array2[..., 3] * self.alpha image1 = Image.fromarray(array1) image2 = Image.fromarray(array2) composition = Image.alpha_composite(image1, image2) return composition
[ 1, 1053, 12655, 408, 7442, 13, 3166, 349, 6227, 1053, 7084, 13, 3166, 4560, 2272, 29889, 299, 3027, 29889, 29885, 5676, 3002, 1053, 7581, 29918, 9672, 291, 13, 3166, 4857, 29883, 29941, 29881, 1053, 4323, 488, 29918, 7052, 29892, 22235, 29918, 29890, 1884, 29941, 29881, 13, 13, 3166, 869, 13239, 1053, 341, 1177, 29918, 29965, 10192, 29947, 29892, 18134, 29918, 29965, 10192, 29947, 13, 3166, 869, 13239, 1053, 3566, 29918, 27703, 29892, 27435, 29918, 3027, 29918, 392, 29918, 21134, 13, 13, 13, 1990, 7084, 21323, 29901, 13, 1678, 9995, 29934, 21043, 269, 29399, 515, 263, 29871, 29941, 29928, 1967, 773, 349, 6227, 29889, 13, 13, 1678, 3940, 29901, 13, 4706, 450, 29871, 29941, 5499, 9927, 338, 1304, 408, 278, 22780, 9927, 29889, 4803, 421, 326, 15439, 29941, 29881, 13, 4706, 529, 991, 597, 3292, 29889, 510, 29914, 845, 29884, 1148, 273, 29914, 326, 15439, 29941, 29881, 13885, 29918, 304, 620, 5897, 278, 1967, 29889, 13, 13, 4706, 8653, 515, 4857, 29883, 29941, 29881, 1053, 4327, 29918, 517, 29918, 29879, 351, 986, 284, 13, 4706, 8653, 17233, 986, 284, 353, 4327, 29918, 517, 29918, 29879, 351, 986, 284, 29898, 3027, 29892, 301, 29886, 326, 29918, 3470, 457, 29897, 13, 4706, 8653, 4050, 261, 353, 7084, 21323, 29898, 29879, 351, 986, 284, 29897, 13, 4706, 8653, 1596, 877, 4557, 310, 269, 29399, 742, 7431, 29898, 9482, 261, 876, 13, 4706, 8653, 17233, 29918, 18337, 353, 4050, 261, 29961, 29896, 29900, 29900, 29962, 13, 13, 1678, 6212, 5026, 29901, 13, 4706, 1967, 313, 23749, 29889, 299, 2378, 1125, 450, 1967, 304, 4050, 29889, 13, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1967, 1125, 13, 4706, 1583, 29889, 3027, 353, 1967, 13, 4706, 1583, 3032, 690, 29883, 7943, 353, 1967, 13, 4706, 1583, 29889, 690, 29883, 744, 29918, 524, 575, 537, 580, 13, 13, 1678, 822, 18428, 29918, 690, 29883, 744, 29898, 1311, 1125, 13, 4706, 9995, 1666, 1052, 267, 278, 1967, 6336, 29889, 13976, 2691, 363, 323, 29896, 29893, 17294, 4558, 1213, 15945, 13, 4706, 1583, 3032, 690, 29883, 7943, 353, 4323, 488, 29918, 7052, 29898, 1311, 29889, 3027, 29892, 5224, 29918, 386, 29922, 16173, 29918, 29965, 10192, 29947, 29892, 13, 462, 462, 4706, 7568, 29918, 386, 29922, 12648, 29918, 29965, 10192, 29947, 29897, 13, 4706, 1583, 3032, 690, 29883, 7943, 353, 1583, 3032, 690, 29883, 7943, 29889, 579, 668, 29898, 9302, 29889, 13470, 29947, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 22780, 29918, 2311, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 2920, 322, 3171, 310, 1967, 269, 29399, 1213, 15945, 13, 4706, 2920, 353, 1583, 29889, 3027, 29889, 12181, 29961, 29896, 29962, 13, 4706, 3171, 353, 1583, 29889, 3027, 29889, 12181, 29961, 29900, 29962, 13, 4706, 736, 2920, 29892, 3171, 13, 13, 1678, 732, 6799, 13, 1678, 822, 26171, 29918, 3881, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 995, 3464, 310, 278, 1967, 12838, 1907, 4954, 29961, 29894, 1195, 29892, 325, 3317, 7961, 29952, 1213, 15945, 13, 4706, 325, 1195, 353, 7442, 29889, 1195, 29898, 1311, 29889, 3027, 29897, 13, 4706, 325, 3317, 353, 7442, 29889, 3317, 29898, 1311, 29889, 3027, 29897, 13, 4706, 736, 325, 1195, 29892, 325, 3317, 13, 13, 1678, 822, 620, 29883, 744, 29918, 524, 575, 537, 29898, 1311, 29892, 325, 1195, 29922, 8516, 29892, 325, 3317, 29922, 8516, 1125, 13, 4706, 9995, 1666, 1052, 267, 1967, 26171, 964, 4954, 29961, 29894, 1195, 29892, 325, 3317, 7961, 1412, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 325, 1195, 313, 7411, 1125, 3139, 1819, 2400, 4954, 29894, 1195, 16159, 526, 731, 304, 29871, 29900, 29889, 13, 9651, 325, 3317, 313, 7411, 1125, 3139, 1819, 2038, 4954, 29894, 3317, 16159, 526, 731, 304, 29871, 29906, 29945, 29945, 29889, 13, 13, 4706, 9995, 13, 4706, 938, 29918, 3881, 353, 1583, 29889, 524, 575, 537, 29918, 3881, 13, 4706, 325, 1195, 353, 938, 29918, 3881, 29961, 29900, 29962, 565, 325, 1195, 338, 6213, 1683, 325, 1195, 13, 4706, 325, 3317, 353, 938, 29918, 3881, 29961, 29896, 29962, 565, 325, 3317, 338, 6213, 1683, 325, 3317, 13, 13, 4706, 1583, 3032, 690, 29883, 7943, 353, 1583, 29889, 3027, 29889, 8552, 580, 13, 4706, 1583, 3032, 690, 29883, 7943, 29961, 1311, 3032, 690, 29883, 7943, 529, 325, 1195, 29962, 353, 325, 1195, 13, 4706, 1583, 3032, 690, 29883, 7943, 29961, 1311, 3032, 690, 29883, 7943, 1405, 325, 3317, 29962, 353, 325, 3317, 13, 4706, 1583, 3032, 690, 29883, 7943, 353, 313, 1311, 3032, 690, 29883, 7943, 448, 325, 1195, 29897, 847, 313, 29894, 3317, 448, 325, 1195, 29897, 13, 4706, 1583, 3032, 690, 29883, 7943, 353, 1583, 3032, 690, 29883, 7943, 334, 313, 12648, 29918, 29965, 10192, 29947, 448, 341, 1177, 29918, 29965, 10192, 29947, 29897, 718, 341, 1177, 29918, 29965, 10192, 29947, 13, 4706, 1583, 3032, 690, 29883, 7943, 353, 1583, 3032, 690, 29883, 7943, 29889, 579, 668, 29898, 9302, 29889, 13470, 29947, 29897, 13, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 3027, 29889, 12181, 14352, 29896, 29962, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 1399, 1125, 13, 4706, 1399, 353, 1583, 3032, 3198, 29918, 18337, 29918, 513, 29898, 513, 29897, 13, 4706, 1967, 29918, 18337, 353, 1583, 3032, 690, 29883, 7943, 7503, 29892, 584, 29892, 1399, 29962, 13, 4706, 1967, 29918, 18337, 353, 7084, 29889, 3166, 2378, 29898, 3027, 29918, 18337, 29892, 525, 29931, 1495, 13, 4706, 1967, 29918, 18337, 353, 1967, 29918, 18337, 29889, 3286, 4220, 29898, 2940, 29889, 26813, 5550, 29949, 1660, 29897, 13, 4706, 736, 1967, 29918, 18337, 13, 13, 1678, 822, 903, 3198, 29918, 18337, 29918, 513, 29898, 1311, 29892, 1399, 1125, 13, 4706, 565, 1399, 529, 29871, 29900, 29901, 13, 9651, 1399, 353, 29871, 29900, 13, 9651, 1596, 877, 29903, 5897, 2380, 881, 451, 367, 3109, 1135, 426, 1836, 4286, 4830, 29898, 513, 876, 13, 4706, 565, 1399, 1405, 7431, 29898, 1311, 29897, 448, 29871, 29896, 29901, 13, 9651, 1399, 353, 7431, 29898, 1311, 29897, 448, 29871, 29896, 13, 9651, 1596, 877, 29903, 5897, 2380, 881, 451, 367, 7621, 1135, 426, 1836, 4286, 4830, 29898, 513, 876, 13, 4706, 736, 1399, 13, 13, 13, 1990, 7084, 20547, 21323, 29898, 2940, 21323, 1125, 13, 1678, 9995, 29934, 21043, 1967, 322, 967, 6590, 3858, 1967, 408, 385, 15595, 29899, 22410, 568, 29889, 13, 13, 1678, 3940, 29901, 13, 4706, 450, 5352, 584, 5552, 18078, 1643, 29918, 3027, 29952, 674, 367, 11543, 964, 263, 376, 2780, 287, 29908, 13, 4706, 1967, 491, 23188, 584, 5552, 18078, 27703, 29952, 304, 967, 3858, 1819, 29889, 1094, 278, 1881, 29892, 13, 4706, 372, 881, 505, 278, 1021, 8267, 411, 584, 5552, 18078, 3027, 21966, 1156, 11301, 29892, 372, 13, 4706, 674, 505, 263, 29871, 29946, 386, 9927, 408, 278, 11955, 29889, 13, 13, 1678, 6212, 5026, 29901, 13, 4706, 3858, 29918, 3027, 313, 23749, 29889, 299, 2378, 1125, 450, 6590, 3858, 1967, 29889, 739, 881, 13, 9651, 505, 278, 1021, 18652, 8267, 411, 584, 5552, 18078, 3027, 1412, 13, 4706, 11955, 313, 23749, 29889, 299, 2378, 1125, 450, 954, 29918, 27703, 921, 29871, 29946, 390, 29954, 5688, 11955, 1409, 29889, 13, 4706, 15595, 313, 7411, 1125, 450, 15595, 995, 310, 278, 3858, 1967, 29889, 13, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1967, 29892, 3858, 29918, 3027, 29892, 11955, 29892, 15595, 29922, 29896, 29889, 29900, 1125, 13, 4706, 4974, 1967, 29889, 12181, 1275, 3858, 29918, 3027, 29889, 12181, 13, 4706, 2428, 2141, 1649, 2344, 12035, 3027, 29897, 13, 4706, 1583, 3032, 2312, 353, 15595, 13, 4706, 1583, 29889, 27703, 353, 11955, 13, 4706, 1583, 29889, 1643, 29918, 3027, 353, 3858, 29918, 3027, 13, 4706, 1583, 3032, 16645, 29918, 27703, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 15595, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 2312, 13, 13, 1678, 732, 2312, 29889, 842, 357, 13, 1678, 822, 15595, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 2312, 353, 995, 13, 4706, 1583, 3032, 16645, 29918, 27703, 580, 13, 13, 1678, 822, 903, 16645, 29918, 27703, 29898, 1311, 1125, 13, 4706, 1583, 3032, 2780, 287, 29918, 1643, 29918, 3027, 353, 3566, 29918, 27703, 29898, 1311, 29889, 1643, 29918, 3027, 29892, 1583, 29889, 27703, 29897, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 1399, 1125, 13, 4706, 1399, 353, 1583, 3032, 3198, 29918, 18337, 29918, 513, 29898, 513, 29897, 13, 4706, 1967, 29918, 18337, 353, 1583, 3032, 690, 29883, 7943, 7503, 29892, 584, 29892, 1399, 29962, 13, 4706, 3858, 29918, 18337, 353, 1583, 3032, 2780, 287, 29918, 1643, 29918, 3027, 7503, 29892, 584, 29892, 1399, 29892, 584, 29962, 13, 4706, 752, 353, 27435, 29918, 3027, 29918, 392, 29918, 21134, 29898, 3027, 29918, 18337, 29892, 3858, 29918, 18337, 29892, 1583, 29889, 2312, 29897, 13, 4706, 752, 353, 752, 29889, 3286, 4220, 29898, 2940, 29889, 26813, 5550, 29949, 1660, 29897, 13, 4706, 736, 752, 13, 13, 1678, 822, 679, 29918, 1643, 29918, 3881, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 2380, 3464, 310, 269, 29399, 411, 1661, 29899, 7042, 11073, 1213, 15945, 13, 4706, 289, 1884, 353, 22235, 29918, 29890, 1884, 29941, 29881, 29898, 1311, 29889, 1643, 29918, 3027, 1405, 29871, 29900, 29897, 13, 4706, 22780, 29918, 3881, 353, 289, 1884, 14352, 29896, 29962, 13, 4706, 736, 22780, 29918, 3881, 29889, 2962, 29892, 22780, 29918, 3881, 29889, 9847, 13, 13, 13, 1990, 7084, 23894, 21323, 29898, 2940, 20547, 21323, 1125, 13, 1678, 9995, 29934, 21043, 385, 1967, 322, 278, 5377, 640, 2470, 313, 12864, 29897, 310, 1269, 301, 24025, 5120, 29889, 13, 13, 1678, 6212, 5026, 29901, 13, 4706, 7636, 29918, 2103, 313, 524, 1125, 450, 2920, 310, 278, 7636, 408, 278, 1353, 310, 17036, 29889, 13, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1967, 29892, 3858, 29918, 3027, 29892, 11955, 29892, 15595, 29922, 29896, 29892, 7636, 29918, 2103, 29922, 29896, 1125, 13, 4706, 1583, 3032, 12864, 29918, 2103, 353, 7636, 29918, 2103, 13, 4706, 2428, 2141, 1649, 2344, 12035, 3027, 29892, 3858, 29918, 3027, 29892, 11955, 29892, 15595, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 7636, 29918, 2103, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 12864, 29918, 2103, 13, 13, 1678, 732, 12864, 29918, 2103, 29889, 842, 357, 13, 1678, 822, 7636, 29918, 2103, 29898, 1311, 29892, 2920, 1125, 13, 4706, 1583, 3032, 12864, 29918, 2103, 353, 2920, 13, 4706, 1583, 3032, 16645, 29918, 27703, 580, 13, 13, 1678, 822, 903, 16645, 29918, 27703, 29898, 1311, 1125, 13, 4706, 9995, 11730, 3566, 29879, 278, 11955, 304, 278, 5377, 640, 2470, 313, 287, 2710, 467, 15945, 29908, 13, 4706, 3858, 29918, 3027, 353, 1583, 29889, 1643, 29918, 3027, 29889, 8552, 580, 13, 4706, 363, 3858, 297, 7442, 29889, 13092, 29898, 1643, 29918, 3027, 1125, 13, 9651, 11105, 353, 3858, 29918, 3027, 1275, 3858, 13, 9651, 604, 359, 291, 353, 7581, 29918, 9672, 291, 29898, 13168, 29892, 24372, 29922, 1311, 29889, 12864, 29918, 2103, 29897, 13, 9651, 3858, 29918, 3027, 29961, 9672, 291, 29962, 353, 29871, 29900, 13, 4706, 1583, 3032, 2780, 287, 29918, 1643, 29918, 3027, 353, 3566, 29918, 27703, 29898, 1643, 29918, 3027, 29892, 1583, 29889, 27703, 29897, 13, 13, 13, 1990, 5399, 261, 3377, 21323, 29898, 2940, 21323, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1967, 29896, 29892, 1967, 29906, 29892, 13261, 29918, 2311, 29922, 29906, 29900, 29892, 15595, 29922, 29900, 1125, 13, 4706, 1583, 3032, 9482, 261, 29896, 353, 7084, 21323, 29898, 3027, 29896, 29897, 13, 4706, 1583, 3032, 9482, 261, 29906, 353, 7084, 21323, 29898, 3027, 29906, 29897, 13, 4706, 4974, 1583, 3032, 9482, 261, 29896, 29889, 18337, 29918, 2311, 1275, 1583, 3032, 9482, 261, 29906, 29889, 18337, 29918, 2311, 13, 4706, 1583, 29889, 5041, 29918, 2311, 353, 13261, 29918, 2311, 13, 4706, 1583, 29889, 2312, 353, 15595, 13, 13, 1678, 822, 18428, 29918, 690, 29883, 744, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9482, 261, 29896, 29889, 17405, 2454, 29918, 690, 29883, 744, 580, 13, 4706, 1583, 3032, 9482, 261, 29906, 29889, 17405, 2454, 29918, 690, 29883, 744, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 22780, 29918, 2311, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 9482, 261, 29896, 29889, 18337, 29918, 2311, 13, 13, 1678, 732, 6799, 13, 1678, 822, 26171, 29918, 3881, 29898, 1311, 1125, 13, 4706, 325, 1195, 29896, 29892, 325, 3317, 29896, 353, 1583, 3032, 9482, 261, 29896, 29889, 524, 575, 537, 29918, 3881, 13, 4706, 325, 1195, 29906, 29892, 325, 3317, 29906, 353, 1583, 3032, 9482, 261, 29906, 29889, 524, 575, 537, 29918, 3881, 13, 4706, 736, 325, 1195, 29896, 29892, 325, 3317, 29896, 29892, 325, 1195, 29906, 29892, 325, 3317, 29906, 13, 13, 1678, 822, 620, 29883, 744, 29918, 524, 575, 537, 29898, 1311, 29892, 325, 1195, 29896, 29922, 8516, 29892, 325, 3317, 29896, 29922, 8516, 29892, 325, 1195, 29906, 29922, 8516, 29892, 325, 3317, 29906, 29922, 8516, 1125, 13, 4706, 1583, 3032, 9482, 261, 29896, 29889, 690, 29883, 744, 29918, 524, 575, 537, 29898, 29894, 1195, 29896, 29892, 325, 3317, 29896, 29897, 13, 4706, 1583, 3032, 9482, 261, 29906, 29889, 690, 29883, 744, 29918, 524, 575, 537, 29898, 29894, 1195, 29906, 29892, 325, 3317, 29906, 29897, 13, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 13, 4706, 736, 7431, 29898, 1311, 3032, 9482, 261, 29896, 29897, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 1399, 1125, 13, 4706, 1967, 29918, 18337, 29896, 353, 1583, 3032, 9482, 261, 29896, 29961, 513, 29962, 13, 4706, 1967, 29918, 18337, 29906, 353, 1583, 3032, 9482, 261, 29906, 29961, 513, 29962, 13, 4706, 1967, 29918, 18337, 353, 1583, 3032, 19438, 29898, 3027, 29918, 18337, 29896, 29892, 1967, 29918, 18337, 29906, 29897, 13, 4706, 736, 1967, 29918, 18337, 13, 13, 1678, 822, 903, 3198, 29918, 18337, 29918, 513, 29898, 1311, 29892, 1399, 1125, 13, 4706, 4974, 7700, 13, 13, 1678, 822, 903, 19438, 29898, 1311, 29892, 1967, 29918, 18337, 29896, 29892, 1967, 29918, 18337, 29906, 1125, 13, 4706, 1409, 29896, 353, 7442, 29889, 2378, 29898, 3027, 29918, 18337, 29896, 29889, 13441, 877, 29934, 29954, 5688, 5477, 26688, 29922, 9302, 29889, 13470, 29947, 29897, 13, 4706, 1409, 29906, 353, 7442, 29889, 2378, 29898, 3027, 29918, 18337, 29906, 29889, 13441, 877, 29934, 29954, 5688, 5477, 26688, 29922, 9302, 29889, 13470, 29947, 29897, 13, 4706, 3171, 29892, 2920, 353, 1409, 29896, 29889, 12181, 7503, 29906, 29962, 13, 4706, 2175, 353, 29871, 29900, 13, 4706, 2246, 353, 29871, 29900, 13, 4706, 15595, 29918, 21064, 353, 1583, 29889, 2312, 13, 4706, 15595, 353, 1583, 29889, 2312, 13, 4706, 1550, 2246, 529, 3171, 29901, 13, 9651, 298, 2962, 353, 2246, 13, 9651, 298, 355, 353, 298, 2962, 718, 1583, 29889, 5041, 29918, 2311, 13, 9651, 1550, 2175, 529, 2920, 29901, 13, 18884, 281, 2962, 353, 2175, 13, 18884, 281, 355, 353, 2175, 718, 1583, 29889, 5041, 29918, 2311, 13, 18884, 1409, 29896, 29961, 29882, 2962, 29901, 29882, 355, 29892, 281, 2962, 29901, 14555, 29892, 29871, 29941, 29962, 353, 320, 13, 462, 1678, 1409, 29896, 29961, 29882, 2962, 29901, 29882, 355, 29892, 281, 2962, 29901, 14555, 29892, 29871, 29941, 29962, 334, 313, 29896, 448, 15595, 29897, 13, 18884, 1409, 29906, 29961, 29882, 2962, 29901, 29882, 355, 29892, 281, 2962, 29901, 14555, 29892, 29871, 29941, 29962, 353, 320, 13, 462, 1678, 1409, 29906, 29961, 29882, 2962, 29901, 29882, 355, 29892, 281, 2962, 29901, 14555, 29892, 29871, 29941, 29962, 334, 15595, 13, 18884, 2175, 353, 281, 355, 13, 18884, 15595, 353, 29871, 29896, 448, 15595, 13, 9651, 2246, 353, 298, 355, 13, 9651, 2175, 353, 29871, 29900, 13, 9651, 15595, 353, 29871, 29896, 448, 15595, 29918, 21064, 13, 9651, 15595, 29918, 21064, 353, 15595, 13, 13, 4706, 1967, 29896, 353, 7084, 29889, 3166, 2378, 29898, 2378, 29896, 29897, 13, 4706, 1967, 29906, 353, 7084, 29889, 3166, 2378, 29898, 2378, 29906, 29897, 13, 4706, 15259, 353, 7084, 29889, 2312, 29918, 22410, 568, 29898, 3027, 29896, 29892, 1967, 29906, 29897, 13, 4706, 736, 15259, 13, 13, 13, 1990, 838, 2026, 21323, 29898, 2940, 21323, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1967, 29896, 29892, 1967, 29906, 29892, 15595, 29922, 29900, 1125, 13, 4706, 1583, 3032, 9482, 261, 29896, 353, 7084, 21323, 29898, 3027, 29896, 29897, 13, 4706, 1583, 3032, 9482, 261, 29906, 353, 7084, 21323, 29898, 3027, 29906, 29897, 13, 4706, 4974, 1583, 3032, 9482, 261, 29896, 29889, 18337, 29918, 2311, 1275, 1583, 3032, 9482, 261, 29906, 29889, 18337, 29918, 2311, 13, 4706, 1583, 29889, 2312, 353, 15595, 13, 13, 1678, 822, 18428, 29918, 690, 29883, 744, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9482, 261, 29896, 29889, 17405, 2454, 29918, 690, 29883, 744, 580, 13, 4706, 1583, 3032, 9482, 261, 29906, 29889, 17405, 2454, 29918, 690, 29883, 744, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 22780, 29918, 2311, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 9482, 261, 29896, 29889, 18337, 29918, 2311, 13, 13, 1678, 732, 6799, 13, 1678, 822, 26171, 29918, 3881, 29898, 1311, 1125, 13, 4706, 325, 1195, 29896, 29892, 325, 3317, 29896, 353, 1583, 3032, 9482, 261, 29896, 29889, 524, 575, 537, 29918, 3881, 13, 4706, 325, 1195, 29906, 29892, 325, 3317, 29906, 353, 1583, 3032, 9482, 261, 29906, 29889, 524, 575, 537, 29918, 3881, 13, 4706, 736, 325, 1195, 29896, 29892, 325, 3317, 29896, 29892, 325, 1195, 29906, 29892, 325, 3317, 29906, 13, 13, 1678, 822, 620, 29883, 744, 29918, 524, 575, 537, 29898, 1311, 29892, 325, 1195, 29896, 29922, 8516, 29892, 325, 3317, 29896, 29922, 8516, 29892, 325, 1195, 29906, 29922, 8516, 29892, 325, 3317, 29906, 29922, 8516, 1125, 13, 4706, 1583, 3032, 9482, 261, 29896, 29889, 690, 29883, 744, 29918, 524, 575, 537, 29898, 29894, 1195, 29896, 29892, 325, 3317, 29896, 29897, 13, 4706, 1583, 3032, 9482, 261, 29906, 29889, 690, 29883, 744, 29918, 524, 575, 537, 29898, 29894, 1195, 29906, 29892, 325, 3317, 29906, 29897, 13, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 13, 4706, 736, 7431, 29898, 1311, 3032, 9482, 261, 29896, 29897, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 1399, 1125, 13, 4706, 1967, 29918, 18337, 29896, 353, 1583, 3032, 9482, 261, 29896, 29961, 513, 29962, 13, 4706, 1967, 29918, 18337, 29906, 353, 1583, 3032, 9482, 261, 29906, 29961, 513, 29962, 13, 4706, 1967, 29918, 18337, 353, 1583, 3032, 19438, 29898, 3027, 29918, 18337, 29896, 29892, 1967, 29918, 18337, 29906, 29897, 13, 4706, 736, 1967, 29918, 18337, 13, 13, 1678, 822, 903, 3198, 29918, 18337, 29918, 513, 29898, 1311, 29892, 1399, 1125, 13, 4706, 4974, 7700, 13, 13, 1678, 822, 903, 19438, 29898, 1311, 29892, 1967, 29918, 18337, 29896, 29892, 1967, 29918, 18337, 29906, 1125, 13, 4706, 1409, 29896, 353, 7442, 29889, 2378, 29898, 3027, 29918, 18337, 29896, 29889, 13441, 877, 29934, 29954, 5688, 5477, 26688, 29922, 9302, 29889, 13470, 29947, 29897, 13, 4706, 1409, 29906, 353, 7442, 29889, 2378, 29898, 3027, 29918, 18337, 29906, 29889, 13441, 877, 29934, 29954, 5688, 5477, 26688, 29922, 9302, 29889, 13470, 29947, 29897, 13, 4706, 1409, 29906, 29961, 16361, 29871, 29941, 29962, 353, 1409, 29906, 29961, 16361, 29871, 29941, 29962, 334, 1583, 29889, 2312, 13, 4706, 1967, 29896, 353, 7084, 29889, 3166, 2378, 29898, 2378, 29896, 29897, 13, 4706, 1967, 29906, 353, 7084, 29889, 3166, 2378, 29898, 2378, 29906, 29897, 13, 4706, 15259, 353, 7084, 29889, 2312, 29918, 22410, 568, 29898, 3027, 29896, 29892, 1967, 29906, 29897, 13, 4706, 736, 15259, 13, 2 ]
asyncpushbullet/websocket_server.py
rharder/pushbullet.py
12
37476
#!/usr/bin/env python3 """ Easy to use Websocket Server. Source: https://github.com/rharder/handy June 2018 - Updated for aiohttp v3.3 August 2018 - Updated for Python 3.7, made WebServer support multiple routes on one port """ import asyncio import logging import weakref from functools import partial from typing import Dict, Set, List import aiohttp # pip install aiohttp from aiohttp import web __author__ = "<NAME>" __email__ = "<EMAIL>" __license__ = "Public Domain" class WebServer: """Hosts a web/websocket server on a given port and responds to multiple routes (relative urls) at that address. Source: https://github.com/rharder/handy Author: <NAME> License: Public Domain """ def __init__(self, host: str = None, port: int = None, ssl_context=None): """ Create a new WebServer that will listen on the given port. :param port: The port on which to listen """ super().__init__() self.log = logging.getLogger(__name__ + '.' + self.__class__.__name__) # Passed parameters self.host: str = host self.port: int = port self.ssl_context = ssl_context # Internal use self.app: web.Application = None self.site: web.TCPSite = None self.runner: web.AppRunner = None self.route_handlers: Dict[str, WebHandler] = {} self._running: bool = False self._shutting_down: bool = False self._starting_up: bool = False def __str__(self): routes = ", ".join(self.route_handlers.keys()) return "{}({}:({})".format(self.__class__.__name__, self.port, routes) @property def running(self): return self._running @property def starting_up(self): return self._starting_up @property def shutting_down(self): return self._shutting_down async def start(self): """ Starts the websocket server and begins listening. This function returns with the server continuing to listen (non-blocking). :return: None """ if self.starting_up or self.running: raise Exception("Cannot start server when it is already running.") self._starting_up = True self.app = web.Application() self.app['requests'] = [] # type: List[web.BaseRequest] self.app.on_shutdown.append(self._on_shutdown) # Connect routes for route in self.route_handlers.keys(): self.app.router.add_get(route, partial(self.incoming_http_handler, route)) self.runner = web.AppRunner(self.app) await self.runner.setup() self.site = web.TCPSite(self.runner, port=self.port, host=self.host, ssl_context=self.ssl_context) await self.site.start() self._running = True self._starting_up = False async def shutdown(self): if not self.running: raise Exception("Cannot close server that is not running.") if self.shutting_down: pass else: self._shutting_down = True await self.runner.cleanup() async def _on_shutdown(self, app: web.Application): self.close_current_connections() self._running = False self._shutting_down = False def close_current_connections(self): for x in self.app["requests"]: if x is not None and x.transport is not None: x.transport.close() def add_route(self, route: str, handler): if self.running: raise RuntimeError("Cannot add a route after server is already running.") self.route_handlers[route] = handler async def incoming_http_handler(self, route: str, request: web.BaseRequest): self.app['requests'].append(request) try: resp = await self.route_handlers[route].on_incoming_http(route, request) finally: self.app['requests'].remove(request) return resp class WebHandler: async def on_incoming_http(self, route: str, request: web.BaseRequest): return web.Response(body=str(self.__class__.__name__)) class WebsocketHandler(WebHandler): def __init__(self, *kargs, **kwargs): super().__init__(*kargs, **kwargs) self.websockets: Set[web.WebSocketResponse] = weakref.WeakSet() async def broadcast_json(self, msg): """ Converts msg to json and broadcasts the json data to all connected clients. """ await self._broadcast(msg, web.WebSocketResponse.send_json) async def broadcast_text(self, msg: str): """ Broadcasts a string to all connected clients. """ await self._broadcast(msg, web.WebSocketResponse.send_str) async def broadcast_bytes(self, msg: bytes): """ Broadcasts bytes to all connected clients. """ await self._broadcast(msg, web.WebSocketResponse.send_bytes) async def _broadcast(self, msg, func: callable): for ws in set(self.websockets): # type: web.WebSocketResponse await func(ws, msg) async def close_websockets(self): """Closes all active websockets for this handler.""" ws_closers = [ws.close() for ws in set(self.websockets) if not ws.closed] ws_closers and await asyncio.gather(*ws_closers) async def on_incoming_http(self, route: str, request: web.BaseRequest): """Handles the incoming http(s) request and converts it to a WebSocketResponse. This method is not meant to be overridden when subclassed. """ ws = web.WebSocketResponse() self.websockets.add(ws) try: await ws.prepare(request) await self.on_websocket(route, ws) finally: self.websockets.discard(ws) return ws async def on_websocket(self, route: str, ws: web.WebSocketResponse): """ Override this function if you want to handle new incoming websocket clients. The default behavior is to listen indefinitely for incoming messages from clients and call on_message() with each one. If you override on_websocket and have your own loop to receive and process messages, you may also need an await asyncio.sleep(0) line to avoid an infinite loop with the websocket close message. Example: while not ws.closed: ws_msg = await ws.receive() await asyncio.sleep(0) ... """ try: while not ws.closed: ws_msg = await ws.receive() # type: aiohttp.WSMessage await self.on_message(route=route, ws=ws, ws_msg_from_client=ws_msg) # If you override on_websocket and have your own loop # to receive and process messages, you may also need # this await asyncio.sleep(0) line to avoid an infinite # loop with the websocket close message. await asyncio.sleep(0) # Need to yield control back to event loop except RuntimeError as e: # Socket closing throws RuntimeError print("RuntimeError - did socket close?", e, flush=True) pass finally: await self.on_close(route, ws) async def on_message(self, route: str, ws: web.WebSocketResponse, ws_msg_from_client: aiohttp.WSMessage): """ Override this function to handle incoming messages from websocket clients. """ pass async def on_close(self, route: str, ws: web.WebSocketResponse): """ Override this function to handle a websocket having closed. """ pass
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 15945, 29908, 13, 29923, 8995, 304, 671, 2563, 11514, 5656, 29889, 13, 13, 4435, 29901, 2045, 597, 3292, 29889, 510, 29914, 29878, 6800, 261, 29914, 3179, 29891, 13, 13, 29967, 1540, 29871, 29906, 29900, 29896, 29947, 448, 25723, 363, 263, 601, 1124, 325, 29941, 29889, 29941, 13, 26197, 29871, 29906, 29900, 29896, 29947, 448, 25723, 363, 5132, 29871, 29941, 29889, 29955, 29892, 1754, 2563, 6004, 2304, 2999, 12049, 373, 697, 2011, 13, 15945, 29908, 13, 5215, 408, 948, 3934, 13, 5215, 12183, 13, 5215, 8062, 999, 13, 3166, 2090, 312, 8789, 1053, 7687, 13, 3166, 19229, 1053, 360, 919, 29892, 3789, 29892, 2391, 13, 13, 5215, 263, 601, 1124, 29871, 396, 8450, 2601, 263, 601, 1124, 13, 3166, 263, 601, 1124, 1053, 1856, 13, 13, 1649, 8921, 1649, 353, 9872, 5813, 11903, 13, 1649, 5269, 1649, 353, 9872, 26862, 6227, 11903, 13, 1649, 506, 1947, 1649, 353, 376, 19858, 28460, 29908, 13, 13, 13, 1990, 2563, 6004, 29901, 13, 1678, 9995, 8514, 29879, 263, 1856, 29914, 2676, 11514, 1923, 373, 263, 2183, 2011, 322, 10049, 29879, 304, 2999, 12049, 13, 1678, 313, 22925, 23942, 29897, 472, 393, 3211, 29889, 13, 13, 13, 1678, 7562, 29901, 2045, 597, 3292, 29889, 510, 29914, 29878, 6800, 261, 29914, 3179, 29891, 13, 1678, 13361, 29901, 529, 5813, 29958, 13, 1678, 19245, 29901, 5236, 28460, 13, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3495, 29901, 851, 353, 6213, 29892, 2011, 29901, 938, 353, 6213, 29892, 24250, 29918, 4703, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 6204, 263, 716, 2563, 6004, 393, 674, 11621, 373, 278, 2183, 2011, 29889, 13, 13, 4706, 584, 3207, 2011, 29901, 450, 2011, 373, 607, 304, 11621, 13, 4706, 9995, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 718, 525, 6169, 718, 1583, 17255, 1990, 1649, 17255, 978, 1649, 29897, 13, 13, 4706, 396, 6978, 287, 4128, 13, 4706, 1583, 29889, 3069, 29901, 851, 353, 3495, 13, 4706, 1583, 29889, 637, 29901, 938, 353, 2011, 13, 4706, 1583, 29889, 16265, 29918, 4703, 353, 24250, 29918, 4703, 13, 13, 4706, 396, 512, 1890, 671, 13, 4706, 1583, 29889, 932, 29901, 1856, 29889, 4873, 353, 6213, 13, 4706, 1583, 29889, 2746, 29901, 1856, 29889, 29911, 6271, 17033, 353, 6213, 13, 4706, 1583, 29889, 27492, 29901, 1856, 29889, 2052, 16802, 353, 6213, 13, 4706, 1583, 29889, 13134, 29918, 3179, 9306, 29901, 360, 919, 29961, 710, 29892, 2563, 4598, 29962, 353, 6571, 13, 13, 4706, 1583, 3032, 21094, 29901, 6120, 353, 7700, 13, 4706, 1583, 3032, 845, 329, 1259, 29918, 3204, 29901, 6120, 353, 7700, 13, 4706, 1583, 3032, 2962, 292, 29918, 786, 29901, 6120, 353, 7700, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 12049, 353, 9162, 11393, 7122, 29898, 1311, 29889, 13134, 29918, 3179, 9306, 29889, 8149, 3101, 13, 4706, 736, 29850, 2119, 29912, 6177, 3319, 1800, 1642, 4830, 29898, 1311, 17255, 1990, 1649, 17255, 978, 1649, 29892, 1583, 29889, 637, 29892, 12049, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2734, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 21094, 13, 13, 1678, 732, 6799, 13, 1678, 822, 6257, 29918, 786, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 2962, 292, 29918, 786, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12522, 1259, 29918, 3204, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 845, 329, 1259, 29918, 3204, 13, 13, 1678, 7465, 822, 1369, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 624, 5708, 278, 1856, 11514, 1923, 322, 16410, 19866, 29889, 29871, 910, 740, 3639, 13, 4706, 411, 278, 1923, 3133, 292, 304, 11621, 313, 5464, 29899, 1271, 292, 467, 13, 13, 4706, 584, 2457, 29901, 6213, 13, 4706, 9995, 13, 4706, 565, 1583, 29889, 2962, 292, 29918, 786, 470, 1583, 29889, 21094, 29901, 13, 9651, 12020, 8960, 703, 29089, 1369, 1923, 746, 372, 338, 2307, 2734, 23157, 13, 13, 4706, 1583, 3032, 2962, 292, 29918, 786, 353, 5852, 13, 13, 4706, 1583, 29889, 932, 353, 1856, 29889, 4873, 580, 13, 4706, 1583, 29889, 932, 1839, 24830, 2033, 353, 5159, 29871, 396, 1134, 29901, 2391, 29961, 2676, 29889, 5160, 3089, 29962, 13, 4706, 1583, 29889, 932, 29889, 265, 29918, 845, 329, 3204, 29889, 4397, 29898, 1311, 3032, 265, 29918, 845, 329, 3204, 29897, 13, 13, 4706, 396, 14971, 12049, 13, 4706, 363, 5782, 297, 1583, 29889, 13134, 29918, 3179, 9306, 29889, 8149, 7295, 13, 9651, 1583, 29889, 932, 29889, 15140, 29889, 1202, 29918, 657, 29898, 13134, 29892, 7687, 29898, 1311, 29889, 262, 11506, 29918, 1124, 29918, 13789, 29892, 5782, 876, 13, 13, 4706, 1583, 29889, 27492, 353, 1856, 29889, 2052, 16802, 29898, 1311, 29889, 932, 29897, 13, 4706, 7272, 1583, 29889, 27492, 29889, 14669, 580, 13, 4706, 1583, 29889, 2746, 353, 1856, 29889, 29911, 6271, 17033, 29898, 1311, 29889, 27492, 29892, 2011, 29922, 1311, 29889, 637, 29892, 3495, 29922, 1311, 29889, 3069, 29892, 24250, 29918, 4703, 29922, 1311, 29889, 16265, 29918, 4703, 29897, 13, 4706, 7272, 1583, 29889, 2746, 29889, 2962, 580, 13, 13, 4706, 1583, 3032, 21094, 353, 5852, 13, 4706, 1583, 3032, 2962, 292, 29918, 786, 353, 7700, 13, 13, 1678, 7465, 822, 12522, 3204, 29898, 1311, 1125, 13, 4706, 565, 451, 1583, 29889, 21094, 29901, 13, 9651, 12020, 8960, 703, 29089, 3802, 1923, 393, 338, 451, 2734, 23157, 13, 13, 4706, 565, 1583, 29889, 845, 329, 1259, 29918, 3204, 29901, 13, 9651, 1209, 13, 4706, 1683, 29901, 13, 9651, 1583, 3032, 845, 329, 1259, 29918, 3204, 353, 5852, 13, 9651, 7272, 1583, 29889, 27492, 29889, 14941, 786, 580, 13, 13, 1678, 7465, 822, 903, 265, 29918, 845, 329, 3204, 29898, 1311, 29892, 623, 29901, 1856, 29889, 4873, 1125, 13, 4706, 1583, 29889, 5358, 29918, 3784, 29918, 11958, 1953, 580, 13, 4706, 1583, 3032, 21094, 353, 7700, 13, 4706, 1583, 3032, 845, 329, 1259, 29918, 3204, 353, 7700, 13, 13, 1678, 822, 3802, 29918, 3784, 29918, 11958, 1953, 29898, 1311, 1125, 13, 4706, 363, 921, 297, 1583, 29889, 932, 3366, 24830, 3108, 29901, 13, 9651, 565, 921, 338, 451, 6213, 322, 921, 29889, 27882, 338, 451, 6213, 29901, 13, 18884, 921, 29889, 27882, 29889, 5358, 580, 13, 13, 1678, 822, 788, 29918, 13134, 29898, 1311, 29892, 5782, 29901, 851, 29892, 7834, 1125, 13, 4706, 565, 1583, 29889, 21094, 29901, 13, 9651, 12020, 24875, 2392, 703, 29089, 788, 263, 5782, 1156, 1923, 338, 2307, 2734, 23157, 13, 4706, 1583, 29889, 13134, 29918, 3179, 9306, 29961, 13134, 29962, 353, 7834, 13, 13, 1678, 7465, 822, 23235, 29918, 1124, 29918, 13789, 29898, 1311, 29892, 5782, 29901, 851, 29892, 2009, 29901, 1856, 29889, 5160, 3089, 1125, 13, 4706, 1583, 29889, 932, 1839, 24830, 13359, 4397, 29898, 3827, 29897, 13, 4706, 1018, 29901, 13, 9651, 4613, 353, 7272, 1583, 29889, 13134, 29918, 3179, 9306, 29961, 13134, 1822, 265, 29918, 262, 11506, 29918, 1124, 29898, 13134, 29892, 2009, 29897, 13, 4706, 7146, 29901, 13, 9651, 1583, 29889, 932, 1839, 24830, 13359, 5992, 29898, 3827, 29897, 13, 4706, 736, 4613, 13, 13, 13, 1990, 2563, 4598, 29901, 13, 13, 1678, 7465, 822, 373, 29918, 262, 11506, 29918, 1124, 29898, 1311, 29892, 5782, 29901, 851, 29892, 2009, 29901, 1856, 29889, 5160, 3089, 1125, 13, 4706, 736, 1856, 29889, 5103, 29898, 2587, 29922, 710, 29898, 1311, 17255, 1990, 1649, 17255, 978, 1649, 876, 13, 13, 13, 1990, 2563, 11514, 4598, 29898, 3609, 4598, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 29895, 5085, 29892, 3579, 19290, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 10456, 29895, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1583, 29889, 2676, 578, 9737, 29901, 3789, 29961, 2676, 29889, 3609, 11373, 5103, 29962, 353, 8062, 999, 29889, 4806, 557, 2697, 580, 13, 13, 1678, 7465, 822, 12672, 29918, 3126, 29898, 1311, 29892, 10191, 1125, 13, 4706, 9995, 1281, 369, 1372, 10191, 304, 4390, 322, 12672, 29879, 278, 4390, 848, 304, 599, 6631, 13154, 29889, 9995, 13, 4706, 7272, 1583, 3032, 6729, 328, 4384, 29898, 7645, 29892, 1856, 29889, 3609, 11373, 5103, 29889, 6717, 29918, 3126, 29897, 13, 13, 1678, 7465, 822, 12672, 29918, 726, 29898, 1311, 29892, 10191, 29901, 851, 1125, 13, 4706, 9995, 25484, 29879, 263, 1347, 304, 599, 6631, 13154, 29889, 9995, 13, 4706, 7272, 1583, 3032, 6729, 328, 4384, 29898, 7645, 29892, 1856, 29889, 3609, 11373, 5103, 29889, 6717, 29918, 710, 29897, 13, 13, 1678, 7465, 822, 12672, 29918, 13193, 29898, 1311, 29892, 10191, 29901, 6262, 1125, 13, 4706, 9995, 25484, 29879, 6262, 304, 599, 6631, 13154, 29889, 9995, 13, 4706, 7272, 1583, 3032, 6729, 328, 4384, 29898, 7645, 29892, 1856, 29889, 3609, 11373, 5103, 29889, 6717, 29918, 13193, 29897, 13, 13, 1678, 7465, 822, 903, 6729, 328, 4384, 29898, 1311, 29892, 10191, 29892, 3653, 29901, 1246, 519, 1125, 13, 4706, 363, 16904, 297, 731, 29898, 1311, 29889, 2676, 578, 9737, 1125, 29871, 396, 1134, 29901, 1856, 29889, 3609, 11373, 5103, 13, 9651, 7272, 3653, 29898, 5652, 29892, 10191, 29897, 13, 13, 1678, 7465, 822, 3802, 29918, 2676, 578, 9737, 29898, 1311, 1125, 13, 4706, 9995, 29907, 5409, 267, 599, 6136, 1856, 578, 9737, 363, 445, 7834, 1213, 15945, 13, 4706, 16904, 29918, 11291, 414, 353, 518, 5652, 29889, 5358, 580, 363, 16904, 297, 731, 29898, 1311, 29889, 2676, 578, 9737, 29897, 565, 451, 16904, 29889, 15603, 29962, 13, 4706, 16904, 29918, 11291, 414, 322, 7272, 408, 948, 3934, 29889, 29887, 1624, 10456, 5652, 29918, 11291, 414, 29897, 13, 13, 1678, 7465, 822, 373, 29918, 262, 11506, 29918, 1124, 29898, 1311, 29892, 5782, 29901, 851, 29892, 2009, 29901, 1856, 29889, 5160, 3089, 1125, 13, 4706, 9995, 3481, 793, 278, 23235, 1732, 29898, 29879, 29897, 2009, 322, 29436, 372, 304, 263, 2563, 11373, 5103, 29889, 13, 13, 4706, 910, 1158, 338, 451, 6839, 304, 367, 20831, 1145, 746, 19481, 287, 29889, 13, 4706, 9995, 13, 4706, 16904, 353, 1856, 29889, 3609, 11373, 5103, 580, 13, 4706, 1583, 29889, 2676, 578, 9737, 29889, 1202, 29898, 5652, 29897, 13, 4706, 1018, 29901, 13, 9651, 7272, 16904, 29889, 19125, 29898, 3827, 29897, 13, 9651, 7272, 1583, 29889, 265, 29918, 2676, 11514, 29898, 13134, 29892, 16904, 29897, 13, 4706, 7146, 29901, 13, 9651, 1583, 29889, 2676, 578, 9737, 29889, 2218, 7543, 29898, 5652, 29897, 13, 9651, 736, 16904, 13, 13, 1678, 7465, 822, 373, 29918, 2676, 11514, 29898, 1311, 29892, 5782, 29901, 851, 29892, 16904, 29901, 1856, 29889, 3609, 11373, 5103, 1125, 13, 4706, 9995, 13, 4706, 6811, 2426, 445, 740, 565, 366, 864, 304, 4386, 716, 23235, 1856, 11514, 13154, 29889, 13, 4706, 450, 2322, 6030, 338, 304, 11621, 297, 1753, 18639, 363, 23235, 7191, 515, 13154, 13, 4706, 322, 1246, 373, 29918, 4906, 580, 411, 1269, 697, 29889, 13, 13, 4706, 960, 366, 5712, 373, 29918, 2676, 11514, 322, 505, 596, 1914, 2425, 304, 7150, 322, 1889, 7191, 29892, 13, 4706, 366, 1122, 884, 817, 385, 7272, 408, 948, 3934, 29889, 17059, 29898, 29900, 29897, 1196, 304, 4772, 385, 10362, 2425, 411, 278, 13, 4706, 1856, 11514, 3802, 2643, 29889, 13, 13, 4706, 8741, 29901, 13, 9651, 1550, 451, 16904, 29889, 15603, 29901, 13, 18884, 16904, 29918, 7645, 353, 7272, 16904, 29889, 13556, 573, 580, 13, 18884, 7272, 408, 948, 3934, 29889, 17059, 29898, 29900, 29897, 13, 18884, 2023, 13, 13, 4706, 9995, 13, 4706, 1018, 29901, 13, 9651, 1550, 451, 16904, 29889, 15603, 29901, 13, 18884, 16904, 29918, 7645, 353, 7272, 16904, 29889, 13556, 573, 580, 29871, 396, 1134, 29901, 263, 601, 1124, 29889, 7811, 3728, 13, 18884, 7272, 1583, 29889, 265, 29918, 4906, 29898, 13134, 29922, 13134, 29892, 16904, 29922, 5652, 29892, 16904, 29918, 7645, 29918, 3166, 29918, 4645, 29922, 5652, 29918, 7645, 29897, 13, 13, 18884, 396, 960, 366, 5712, 373, 29918, 2676, 11514, 322, 505, 596, 1914, 2425, 13, 18884, 396, 304, 7150, 322, 1889, 7191, 29892, 366, 1122, 884, 817, 13, 18884, 396, 445, 7272, 408, 948, 3934, 29889, 17059, 29898, 29900, 29897, 1196, 304, 4772, 385, 10362, 13, 18884, 396, 2425, 411, 278, 1856, 11514, 3802, 2643, 29889, 13, 18884, 7272, 408, 948, 3934, 29889, 17059, 29898, 29900, 29897, 29871, 396, 20768, 304, 7709, 2761, 1250, 304, 1741, 2425, 13, 13, 4706, 5174, 24875, 2392, 408, 321, 29901, 29871, 396, 29141, 14382, 8026, 24875, 2392, 13, 9651, 1596, 703, 7944, 2392, 448, 1258, 9909, 3802, 29973, 613, 321, 29892, 28371, 29922, 5574, 29897, 13, 9651, 1209, 13, 4706, 7146, 29901, 13, 9651, 7272, 1583, 29889, 265, 29918, 5358, 29898, 13134, 29892, 16904, 29897, 13, 13, 1678, 7465, 822, 373, 29918, 4906, 29898, 1311, 29892, 5782, 29901, 851, 29892, 16904, 29901, 1856, 29889, 3609, 11373, 5103, 29892, 16904, 29918, 7645, 29918, 3166, 29918, 4645, 29901, 263, 601, 1124, 29889, 7811, 3728, 1125, 13, 4706, 9995, 6811, 2426, 445, 740, 304, 4386, 23235, 7191, 515, 1856, 11514, 13154, 29889, 9995, 13, 4706, 1209, 13, 13, 1678, 7465, 822, 373, 29918, 5358, 29898, 1311, 29892, 5782, 29901, 851, 29892, 16904, 29901, 1856, 29889, 3609, 11373, 5103, 1125, 13, 4706, 9995, 6811, 2426, 445, 740, 304, 4386, 263, 1856, 11514, 2534, 5764, 29889, 9995, 13, 4706, 1209, 13, 2 ]
tests/sample_app/urls.py
dreipol/meta-tagger
3
22123
<filename>tests/sample_app/urls.py # -*- coding: utf-8 -*- from django.conf.urls import url from tests.sample_app.views import NewsArticleDetailView urlpatterns = [ url(r'^(?P<pk>\d+)/$', NewsArticleDetailView.as_view(), name='news-article-detail'), ]
[ 1, 529, 9507, 29958, 21150, 29914, 11249, 29918, 932, 29914, 26045, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 3166, 6987, 29889, 11249, 29918, 932, 29889, 7406, 1053, 10130, 9986, 2512, 16570, 1043, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 3142, 29898, 29878, 29915, 29985, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 29938, 742, 10130, 9986, 2512, 16570, 1043, 29889, 294, 29918, 1493, 3285, 1024, 2433, 15753, 29899, 7914, 29899, 16432, 5477, 13, 29962, 13, 2 ]
django_parler_graphql/fields.py
goooodmafia/django-parler-graphql
0
177346
<reponame>goooodmafia/django-parler-graphql import graphene from django_parler_graphql.enums import LanguageCodeEnum from django_parler_graphql.resolvers import resolver class TranslatedInstanceFields(graphene.Field): def __init__(self, translated_model_type, resolver=resolver): super().__init__( translated_model_type, language_code=graphene.Argument(LanguageCodeEnum, required=True), resolver=resolver, )
[ 1, 529, 276, 1112, 420, 29958, 1484, 29877, 2092, 655, 29888, 423, 29914, 14095, 29899, 862, 1358, 29899, 4262, 1519, 13, 5215, 3983, 1600, 13, 13, 3166, 9557, 29918, 862, 1358, 29918, 4262, 1519, 29889, 264, 6762, 1053, 17088, 3399, 16854, 13, 3166, 9557, 29918, 862, 1358, 29918, 4262, 1519, 29889, 9778, 874, 1053, 3770, 369, 13, 13, 13, 1990, 4103, 29880, 630, 4998, 14256, 29898, 4262, 1600, 29889, 3073, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 20512, 29918, 4299, 29918, 1853, 29892, 3770, 369, 29922, 9778, 369, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 13, 9651, 20512, 29918, 4299, 29918, 1853, 29892, 13, 9651, 4086, 29918, 401, 29922, 4262, 1600, 29889, 15730, 29898, 21233, 3399, 16854, 29892, 3734, 29922, 5574, 511, 13, 9651, 3770, 369, 29922, 9778, 369, 29892, 13, 4706, 1723, 13, 2 ]
djangoForum/forum/views.py
AlexxHr/django-forum
0
107965
from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.shortcuts import get_object_or_404, render from django.urls import reverse_lazy from django.views.generic import ListView, DetailView from django.views.generic.edit import CreateView, UpdateView, DeleteView from djangoForum.forum.forms import ForumPostForm, ForumThreadForm, ProfileEditForm, ForumCategoryForm from djangoForum.forum.models import ForumCategory, ForumThread, ForumPost, Profile User = get_user_model() def handler403(request, exception): template_name = "403.html" response = render(request, template_name) response.status_code = 403 return response def handler404(request, exception): template_name = "404.html" response = render(request, template_name) response.status_code = 404 return response class ForumHomeView(ListView): template_name = 'forum/home.html' model = ForumCategory class ForumCategoryView(ListView): template_name = 'forum/category-threads.html' paginate_by = 10 def get_queryset(self): category = ForumCategory.objects.get(slug=self.kwargs['slug']) object_list = ForumThread.objects.filter(category_id=category.id) return object_list def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['category'] = ForumCategory.objects.get(slug=self.kwargs['slug']) return context class ForumThreadCreate(LoginRequiredMixin, CreateView): form_class = ForumThreadForm login_url = reverse_lazy('account login') template_name = 'forum/thread-create.html' def form_valid(self, form): post = form.save(commit=False) post.user = self.request.user post.category = ForumCategory.objects.get(slug=self.kwargs['slug']) return super().form_valid(form) def get_success_url(self): return reverse_lazy('category threads', kwargs={'slug': self.kwargs['slug']}) class ForumThreadView(ListView): template_name = 'forum/thread-posts.html' paginate_by = 10 context_object_name = 'posts' def get_queryset(self): thread = ForumThread.objects.get(slug=self.kwargs['slug']) object_list = ForumPost.objects.filter(thread_id=thread.id) return object_list def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) thread = ForumThread.objects.get(slug=self.kwargs['slug']) category = ForumCategory.objects.get(slug=thread.category.slug) context['thread'] = thread context['category'] = category return context class ForumThreadEdit(UserPassesTestMixin, UpdateView): template_name = 'forum/thread-edit.html' form_class = ForumThreadForm def test_func(self): user = self.request.user obj = self.get_object() return obj.user == user or user.is_superuser def get_object(self, **kwargs): return get_object_or_404(ForumThread, slug=self.kwargs.get('slug')) def get_success_url(self): return reverse_lazy('thread posts', kwargs={'slug': self.kwargs['slug']}) class ForumThreadDelete(UserPassesTestMixin, DeleteView): template_name = 'forum/thread-delete.html' def test_func(self): user = self.request.user obj = self.get_object() return obj.user == user or user.is_superuser def get_object(self, **kwargs): return get_object_or_404(ForumThread, slug=self.kwargs.get('slug')) def get_success_url(self): thread = self.get_object() category = ForumCategory.objects.get(slug=thread.category.slug) return reverse_lazy('category threads', kwargs={'slug': category.slug}) class ForumPostCreate(LoginRequiredMixin, CreateView): form_class = ForumPostForm login_url = reverse_lazy('account login') template_name = 'forum/post-create.html' def form_valid(self, form): post = form.save(commit=False) post.user = self.request.user post.thread = ForumThread.objects.get(slug=self.kwargs['slug']) return super().form_valid(form) def get_success_url(self): return reverse_lazy('thread posts', kwargs={'slug': self.kwargs['slug']}) class ForumPostReply(LoginRequiredMixin, CreateView): form_class = ForumPostForm login_url = reverse_lazy('account login') template_name = 'forum/post-reply.html' def form_valid(self, form): post = form.save(commit=False) reply_post = ForumPost.objects.get(pk=self.kwargs['pk']) post.is_reply = True post.parent = reply_post post.user = self.request.user post.thread = ForumThread.objects.get(slug=reply_post.thread.slug) return super().form_valid(form) def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['reply_post'] = ForumPost.objects.get(pk=self.kwargs['pk']) return context def get_success_url(self): reply_post = ForumPost.objects.get(pk=self.kwargs['pk']) return reverse_lazy('thread posts', kwargs={'slug': reply_post.thread.slug}) class ForumPostEdit(UserPassesTestMixin, UpdateView): template_name = 'forum/post-edit.html' form_class = ForumPostForm def test_func(self): user = self.request.user obj = self.get_object() return obj.user == user or user.is_superuser def form_valid(self, form): post = form.save(commit=False) if form.initial['content'] != post.content: post.edited = True return super().form_valid(form) def get_object(self, **kwargs): return get_object_or_404(ForumPost, pk=self.kwargs.get('pk')) def get_success_url(self): post = get_object_or_404(ForumPost, pk=self.kwargs.get('pk')) return reverse_lazy('thread posts', kwargs={'slug': post.thread.slug}) class ForumPostDelete(UserPassesTestMixin, DeleteView): template_name = 'forum/post-delete.html' def test_func(self): user = self.request.user obj = self.get_object() return obj.user == user or user.is_superuser def get_object(self, **kwargs): return get_object_or_404(ForumPost, pk=self.kwargs.get('pk')) def get_success_url(self): post = get_object_or_404(ForumPost, pk=self.kwargs.get('pk')) return reverse_lazy('thread posts', kwargs={'slug': post.thread.slug}) class ProfileDetails(DetailView): model = User template_name = 'forum/profile-details.html' class ProfileEdit(UserPassesTestMixin, UpdateView): template_name = 'forum/profile-edit.html' form_class = ProfileEditForm def test_func(self): user = self.request.user obj = self.get_object() return obj.user == user or user.is_superuser def get_object(self, **kwargs): return get_object_or_404(Profile, pk=self.kwargs.get('pk')) def get_success_url(self): return reverse_lazy('profile details', kwargs={'pk': self.kwargs.get('pk')}) class ProfilePosts(ListView): template_name = 'forum/profile-posts.html' paginate_by = 10 context_object_name = 'posts' def get_queryset(self): object_list = ForumPost.objects.filter(user_id=self.kwargs['pk']) return object_list def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) context['user'] = User.objects.get(pk=self.kwargs['pk']) return context class ProfileThreads(ListView): template_name = 'forum/profile-threads.html' paginate_by = 10 context_object_name = 'threads' def get_queryset(self): object_list = ForumThread.objects.filter(user_id=self.kwargs['pk']) return object_list def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) context['user'] = User.objects.get(pk=self.kwargs['pk']) return context class SearchResults(ListView): template_name = 'forum/search-results.html' model = ForumThread def get_queryset(self): query = self.request.GET.get('q') if query: object_list = self.model.objects.filter(title__icontains=query) else: object_list = self.model.objects.none() return object_list
[ 1, 515, 9557, 29889, 21570, 29889, 5150, 1053, 679, 29918, 1792, 29918, 4299, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 28084, 1144, 1053, 19130, 19347, 29924, 861, 262, 29892, 4911, 7129, 267, 3057, 29924, 861, 262, 13, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29892, 4050, 13, 3166, 9557, 29889, 26045, 1053, 11837, 29918, 433, 1537, 13, 3166, 9557, 29889, 7406, 29889, 19206, 1053, 22184, 29892, 5953, 737, 1043, 13, 3166, 9557, 29889, 7406, 29889, 19206, 29889, 5628, 1053, 6204, 1043, 29892, 10318, 1043, 29892, 21267, 1043, 13, 13, 3166, 9557, 2831, 398, 29889, 23343, 29889, 9514, 1053, 29474, 6747, 2500, 29892, 29474, 4899, 2500, 29892, 20802, 6103, 2500, 29892, 29474, 10900, 2500, 13, 3166, 9557, 2831, 398, 29889, 23343, 29889, 9794, 1053, 29474, 10900, 29892, 29474, 4899, 29892, 29474, 6747, 29892, 20802, 13, 13, 2659, 353, 679, 29918, 1792, 29918, 4299, 580, 13, 13, 13, 1753, 7834, 29946, 29900, 29941, 29898, 3827, 29892, 3682, 1125, 13, 1678, 4472, 29918, 978, 353, 376, 29946, 29900, 29941, 29889, 1420, 29908, 13, 1678, 2933, 353, 4050, 29898, 3827, 29892, 4472, 29918, 978, 29897, 13, 1678, 2933, 29889, 4882, 29918, 401, 353, 29871, 29946, 29900, 29941, 13, 1678, 736, 2933, 13, 13, 13, 1753, 7834, 29946, 29900, 29946, 29898, 3827, 29892, 3682, 1125, 13, 1678, 4472, 29918, 978, 353, 376, 29946, 29900, 29946, 29889, 1420, 29908, 13, 1678, 2933, 353, 4050, 29898, 3827, 29892, 4472, 29918, 978, 29897, 13, 1678, 2933, 29889, 4882, 29918, 401, 353, 29871, 29946, 29900, 29946, 13, 1678, 736, 2933, 13, 13, 13, 1990, 29474, 11184, 1043, 29898, 15660, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 5184, 29889, 1420, 29915, 13, 1678, 1904, 353, 29474, 10900, 13, 13, 13, 1990, 29474, 10900, 1043, 29898, 15660, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 7320, 29899, 28993, 29889, 1420, 29915, 13, 1678, 10203, 16976, 29918, 1609, 353, 29871, 29896, 29900, 13, 13, 1678, 822, 679, 29918, 1972, 842, 29898, 1311, 1125, 13, 4706, 7663, 353, 29474, 10900, 29889, 12650, 29889, 657, 29898, 29517, 29922, 1311, 29889, 19290, 1839, 29517, 11287, 13, 4706, 1203, 29918, 1761, 353, 29474, 4899, 29889, 12650, 29889, 4572, 29898, 7320, 29918, 333, 29922, 7320, 29889, 333, 29897, 13, 4706, 736, 1203, 29918, 1761, 13, 13, 1678, 822, 679, 29918, 4703, 29918, 1272, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 3030, 353, 2428, 2141, 657, 29918, 4703, 29918, 1272, 29898, 1068, 19290, 29897, 13, 4706, 3030, 1839, 7320, 2033, 353, 29474, 10900, 29889, 12650, 29889, 657, 29898, 29517, 29922, 1311, 29889, 19290, 1839, 29517, 11287, 13, 4706, 736, 3030, 13, 13, 13, 1990, 29474, 4899, 4391, 29898, 11049, 19347, 29924, 861, 262, 29892, 6204, 1043, 1125, 13, 1678, 883, 29918, 1990, 353, 29474, 4899, 2500, 13, 1678, 6464, 29918, 2271, 353, 11837, 29918, 433, 1537, 877, 10149, 6464, 1495, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 7097, 29899, 3258, 29889, 1420, 29915, 13, 13, 1678, 822, 883, 29918, 3084, 29898, 1311, 29892, 883, 1125, 13, 4706, 1400, 353, 883, 29889, 7620, 29898, 15060, 29922, 8824, 29897, 13, 4706, 1400, 29889, 1792, 353, 1583, 29889, 3827, 29889, 1792, 13, 4706, 1400, 29889, 7320, 353, 29474, 10900, 29889, 12650, 29889, 657, 29898, 29517, 29922, 1311, 29889, 19290, 1839, 29517, 11287, 13, 4706, 736, 2428, 2141, 689, 29918, 3084, 29898, 689, 29897, 13, 13, 1678, 822, 679, 29918, 8698, 29918, 2271, 29898, 1311, 1125, 13, 4706, 736, 11837, 29918, 433, 1537, 877, 7320, 9717, 742, 9049, 5085, 3790, 29915, 29517, 2396, 1583, 29889, 19290, 1839, 29517, 2033, 1800, 13, 13, 13, 1990, 29474, 4899, 1043, 29898, 15660, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 7097, 29899, 14080, 29889, 1420, 29915, 13, 1678, 10203, 16976, 29918, 1609, 353, 29871, 29896, 29900, 13, 1678, 3030, 29918, 3318, 29918, 978, 353, 525, 14080, 29915, 13, 13, 1678, 822, 679, 29918, 1972, 842, 29898, 1311, 1125, 13, 4706, 3244, 353, 29474, 4899, 29889, 12650, 29889, 657, 29898, 29517, 29922, 1311, 29889, 19290, 1839, 29517, 11287, 13, 4706, 1203, 29918, 1761, 353, 29474, 6747, 29889, 12650, 29889, 4572, 29898, 7097, 29918, 333, 29922, 7097, 29889, 333, 29897, 13, 4706, 736, 1203, 29918, 1761, 13, 13, 1678, 822, 679, 29918, 4703, 29918, 1272, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 3030, 353, 2428, 2141, 657, 29918, 4703, 29918, 1272, 29898, 1068, 19290, 29897, 13, 4706, 3244, 353, 29474, 4899, 29889, 12650, 29889, 657, 29898, 29517, 29922, 1311, 29889, 19290, 1839, 29517, 11287, 13, 4706, 7663, 353, 29474, 10900, 29889, 12650, 29889, 657, 29898, 29517, 29922, 7097, 29889, 7320, 29889, 29517, 29897, 13, 4706, 3030, 1839, 7097, 2033, 353, 3244, 13, 4706, 3030, 1839, 7320, 2033, 353, 7663, 13, 4706, 736, 3030, 13, 13, 13, 1990, 29474, 4899, 6103, 29898, 2659, 7129, 267, 3057, 29924, 861, 262, 29892, 10318, 1043, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 7097, 29899, 5628, 29889, 1420, 29915, 13, 1678, 883, 29918, 1990, 353, 29474, 4899, 2500, 13, 13, 1678, 822, 1243, 29918, 9891, 29898, 1311, 1125, 13, 4706, 1404, 353, 1583, 29889, 3827, 29889, 1792, 13, 4706, 5446, 353, 1583, 29889, 657, 29918, 3318, 580, 13, 4706, 736, 5446, 29889, 1792, 1275, 1404, 470, 1404, 29889, 275, 29918, 9136, 1792, 13, 13, 1678, 822, 679, 29918, 3318, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 2831, 398, 4899, 29892, 2243, 688, 29922, 1311, 29889, 19290, 29889, 657, 877, 29517, 8785, 13, 13, 1678, 822, 679, 29918, 8698, 29918, 2271, 29898, 1311, 1125, 13, 4706, 736, 11837, 29918, 433, 1537, 877, 7097, 11803, 742, 9049, 5085, 3790, 29915, 29517, 2396, 1583, 29889, 19290, 1839, 29517, 2033, 1800, 13, 13, 13, 1990, 29474, 4899, 12498, 29898, 2659, 7129, 267, 3057, 29924, 861, 262, 29892, 21267, 1043, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 7097, 29899, 8143, 29889, 1420, 29915, 13, 13, 1678, 822, 1243, 29918, 9891, 29898, 1311, 1125, 13, 4706, 1404, 353, 1583, 29889, 3827, 29889, 1792, 13, 4706, 5446, 353, 1583, 29889, 657, 29918, 3318, 580, 13, 4706, 736, 5446, 29889, 1792, 1275, 1404, 470, 1404, 29889, 275, 29918, 9136, 1792, 13, 13, 1678, 822, 679, 29918, 3318, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 2831, 398, 4899, 29892, 2243, 688, 29922, 1311, 29889, 19290, 29889, 657, 877, 29517, 8785, 13, 13, 1678, 822, 679, 29918, 8698, 29918, 2271, 29898, 1311, 1125, 13, 4706, 3244, 353, 1583, 29889, 657, 29918, 3318, 580, 13, 4706, 7663, 353, 29474, 10900, 29889, 12650, 29889, 657, 29898, 29517, 29922, 7097, 29889, 7320, 29889, 29517, 29897, 13, 4706, 736, 11837, 29918, 433, 1537, 877, 7320, 9717, 742, 9049, 5085, 3790, 29915, 29517, 2396, 7663, 29889, 29517, 1800, 13, 13, 13, 1990, 29474, 6747, 4391, 29898, 11049, 19347, 29924, 861, 262, 29892, 6204, 1043, 1125, 13, 1678, 883, 29918, 1990, 353, 29474, 6747, 2500, 13, 1678, 6464, 29918, 2271, 353, 11837, 29918, 433, 1537, 877, 10149, 6464, 1495, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 2490, 29899, 3258, 29889, 1420, 29915, 13, 13, 1678, 822, 883, 29918, 3084, 29898, 1311, 29892, 883, 1125, 13, 4706, 1400, 353, 883, 29889, 7620, 29898, 15060, 29922, 8824, 29897, 13, 4706, 1400, 29889, 1792, 353, 1583, 29889, 3827, 29889, 1792, 13, 4706, 1400, 29889, 7097, 353, 29474, 4899, 29889, 12650, 29889, 657, 29898, 29517, 29922, 1311, 29889, 19290, 1839, 29517, 11287, 13, 4706, 736, 2428, 2141, 689, 29918, 3084, 29898, 689, 29897, 13, 13, 1678, 822, 679, 29918, 8698, 29918, 2271, 29898, 1311, 1125, 13, 4706, 736, 11837, 29918, 433, 1537, 877, 7097, 11803, 742, 9049, 5085, 3790, 29915, 29517, 2396, 1583, 29889, 19290, 1839, 29517, 2033, 1800, 13, 13, 13, 1990, 29474, 6747, 5612, 368, 29898, 11049, 19347, 29924, 861, 262, 29892, 6204, 1043, 1125, 13, 1678, 883, 29918, 1990, 353, 29474, 6747, 2500, 13, 1678, 6464, 29918, 2271, 353, 11837, 29918, 433, 1537, 877, 10149, 6464, 1495, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 2490, 29899, 3445, 368, 29889, 1420, 29915, 13, 13, 1678, 822, 883, 29918, 3084, 29898, 1311, 29892, 883, 1125, 13, 4706, 1400, 353, 883, 29889, 7620, 29898, 15060, 29922, 8824, 29897, 13, 4706, 8908, 29918, 2490, 353, 29474, 6747, 29889, 12650, 29889, 657, 29898, 20571, 29922, 1311, 29889, 19290, 1839, 20571, 11287, 13, 4706, 1400, 29889, 275, 29918, 3445, 368, 353, 5852, 13, 4706, 1400, 29889, 3560, 353, 8908, 29918, 2490, 13, 4706, 1400, 29889, 1792, 353, 1583, 29889, 3827, 29889, 1792, 13, 4706, 1400, 29889, 7097, 353, 29474, 4899, 29889, 12650, 29889, 657, 29898, 29517, 29922, 3445, 368, 29918, 2490, 29889, 7097, 29889, 29517, 29897, 13, 4706, 736, 2428, 2141, 689, 29918, 3084, 29898, 689, 29897, 13, 13, 1678, 822, 679, 29918, 4703, 29918, 1272, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 3030, 353, 2428, 2141, 657, 29918, 4703, 29918, 1272, 29898, 1068, 19290, 29897, 13, 4706, 3030, 1839, 3445, 368, 29918, 2490, 2033, 353, 29474, 6747, 29889, 12650, 29889, 657, 29898, 20571, 29922, 1311, 29889, 19290, 1839, 20571, 11287, 13, 4706, 736, 3030, 13, 13, 1678, 822, 679, 29918, 8698, 29918, 2271, 29898, 1311, 1125, 13, 4706, 8908, 29918, 2490, 353, 29474, 6747, 29889, 12650, 29889, 657, 29898, 20571, 29922, 1311, 29889, 19290, 1839, 20571, 11287, 13, 4706, 736, 11837, 29918, 433, 1537, 877, 7097, 11803, 742, 9049, 5085, 3790, 29915, 29517, 2396, 8908, 29918, 2490, 29889, 7097, 29889, 29517, 1800, 13, 13, 13, 1990, 29474, 6747, 6103, 29898, 2659, 7129, 267, 3057, 29924, 861, 262, 29892, 10318, 1043, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 2490, 29899, 5628, 29889, 1420, 29915, 13, 1678, 883, 29918, 1990, 353, 29474, 6747, 2500, 13, 13, 1678, 822, 1243, 29918, 9891, 29898, 1311, 1125, 13, 4706, 1404, 353, 1583, 29889, 3827, 29889, 1792, 13, 4706, 5446, 353, 1583, 29889, 657, 29918, 3318, 580, 13, 4706, 736, 5446, 29889, 1792, 1275, 1404, 470, 1404, 29889, 275, 29918, 9136, 1792, 13, 13, 1678, 822, 883, 29918, 3084, 29898, 1311, 29892, 883, 1125, 13, 4706, 1400, 353, 883, 29889, 7620, 29898, 15060, 29922, 8824, 29897, 13, 4706, 565, 883, 29889, 11228, 1839, 3051, 2033, 2804, 1400, 29889, 3051, 29901, 13, 9651, 1400, 29889, 287, 1573, 353, 5852, 13, 4706, 736, 2428, 2141, 689, 29918, 3084, 29898, 689, 29897, 13, 13, 1678, 822, 679, 29918, 3318, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 2831, 398, 6747, 29892, 282, 29895, 29922, 1311, 29889, 19290, 29889, 657, 877, 20571, 8785, 13, 13, 1678, 822, 679, 29918, 8698, 29918, 2271, 29898, 1311, 1125, 13, 4706, 1400, 353, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 2831, 398, 6747, 29892, 282, 29895, 29922, 1311, 29889, 19290, 29889, 657, 877, 20571, 8785, 13, 4706, 736, 11837, 29918, 433, 1537, 877, 7097, 11803, 742, 9049, 5085, 3790, 29915, 29517, 2396, 1400, 29889, 7097, 29889, 29517, 1800, 13, 13, 13, 1990, 29474, 6747, 12498, 29898, 2659, 7129, 267, 3057, 29924, 861, 262, 29892, 21267, 1043, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 2490, 29899, 8143, 29889, 1420, 29915, 13, 13, 1678, 822, 1243, 29918, 9891, 29898, 1311, 1125, 13, 4706, 1404, 353, 1583, 29889, 3827, 29889, 1792, 13, 4706, 5446, 353, 1583, 29889, 657, 29918, 3318, 580, 13, 4706, 736, 5446, 29889, 1792, 1275, 1404, 470, 1404, 29889, 275, 29918, 9136, 1792, 13, 13, 1678, 822, 679, 29918, 3318, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 2831, 398, 6747, 29892, 282, 29895, 29922, 1311, 29889, 19290, 29889, 657, 877, 20571, 8785, 13, 13, 1678, 822, 679, 29918, 8698, 29918, 2271, 29898, 1311, 1125, 13, 4706, 1400, 353, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 2831, 398, 6747, 29892, 282, 29895, 29922, 1311, 29889, 19290, 29889, 657, 877, 20571, 8785, 13, 4706, 736, 11837, 29918, 433, 1537, 877, 7097, 11803, 742, 9049, 5085, 3790, 29915, 29517, 2396, 1400, 29889, 7097, 29889, 29517, 1800, 13, 13, 13, 1990, 20802, 10602, 29898, 16570, 1043, 1125, 13, 1678, 1904, 353, 4911, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 10185, 29899, 14144, 29889, 1420, 29915, 13, 13, 13, 1990, 20802, 6103, 29898, 2659, 7129, 267, 3057, 29924, 861, 262, 29892, 10318, 1043, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 10185, 29899, 5628, 29889, 1420, 29915, 13, 1678, 883, 29918, 1990, 353, 20802, 6103, 2500, 13, 13, 1678, 822, 1243, 29918, 9891, 29898, 1311, 1125, 13, 4706, 1404, 353, 1583, 29889, 3827, 29889, 1792, 13, 4706, 5446, 353, 1583, 29889, 657, 29918, 3318, 580, 13, 4706, 736, 5446, 29889, 1792, 1275, 1404, 470, 1404, 29889, 275, 29918, 9136, 1792, 13, 13, 1678, 822, 679, 29918, 3318, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 13909, 29892, 282, 29895, 29922, 1311, 29889, 19290, 29889, 657, 877, 20571, 8785, 13, 13, 1678, 822, 679, 29918, 8698, 29918, 2271, 29898, 1311, 1125, 13, 4706, 736, 11837, 29918, 433, 1537, 877, 10185, 4902, 742, 9049, 5085, 3790, 29915, 20571, 2396, 1583, 29889, 19290, 29889, 657, 877, 20571, 1495, 1800, 13, 13, 13, 1990, 20802, 6747, 29879, 29898, 15660, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 10185, 29899, 14080, 29889, 1420, 29915, 13, 1678, 10203, 16976, 29918, 1609, 353, 29871, 29896, 29900, 13, 1678, 3030, 29918, 3318, 29918, 978, 353, 525, 14080, 29915, 13, 13, 1678, 822, 679, 29918, 1972, 842, 29898, 1311, 1125, 13, 4706, 1203, 29918, 1761, 353, 29474, 6747, 29889, 12650, 29889, 4572, 29898, 1792, 29918, 333, 29922, 1311, 29889, 19290, 1839, 20571, 11287, 13, 4706, 736, 1203, 29918, 1761, 13, 13, 1678, 822, 679, 29918, 4703, 29918, 1272, 29898, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 3030, 353, 2428, 2141, 657, 29918, 4703, 29918, 1272, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 3030, 1839, 1792, 2033, 353, 4911, 29889, 12650, 29889, 657, 29898, 20571, 29922, 1311, 29889, 19290, 1839, 20571, 11287, 13, 4706, 736, 3030, 13, 13, 13, 1990, 20802, 4899, 29879, 29898, 15660, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 10185, 29899, 28993, 29889, 1420, 29915, 13, 1678, 10203, 16976, 29918, 1609, 353, 29871, 29896, 29900, 13, 1678, 3030, 29918, 3318, 29918, 978, 353, 525, 28993, 29915, 13, 13, 1678, 822, 679, 29918, 1972, 842, 29898, 1311, 1125, 13, 4706, 1203, 29918, 1761, 353, 29474, 4899, 29889, 12650, 29889, 4572, 29898, 1792, 29918, 333, 29922, 1311, 29889, 19290, 1839, 20571, 11287, 13, 4706, 736, 1203, 29918, 1761, 13, 13, 1678, 822, 679, 29918, 4703, 29918, 1272, 29898, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 3030, 353, 2428, 2141, 657, 29918, 4703, 29918, 1272, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 3030, 1839, 1792, 2033, 353, 4911, 29889, 12650, 29889, 657, 29898, 20571, 29922, 1311, 29889, 19290, 1839, 20571, 11287, 13, 4706, 736, 3030, 13, 13, 13, 1990, 11856, 12191, 29898, 15660, 1125, 13, 1678, 4472, 29918, 978, 353, 525, 23343, 29914, 4478, 29899, 9902, 29889, 1420, 29915, 13, 1678, 1904, 353, 29474, 4899, 13, 13, 1678, 822, 679, 29918, 1972, 842, 29898, 1311, 1125, 13, 4706, 2346, 353, 1583, 29889, 3827, 29889, 7194, 29889, 657, 877, 29939, 1495, 13, 4706, 565, 2346, 29901, 13, 9651, 1203, 29918, 1761, 353, 1583, 29889, 4299, 29889, 12650, 29889, 4572, 29898, 3257, 1649, 293, 609, 2708, 29922, 1972, 29897, 13, 4706, 1683, 29901, 13, 9651, 1203, 29918, 1761, 353, 1583, 29889, 4299, 29889, 12650, 29889, 9290, 580, 13, 4706, 736, 1203, 29918, 1761, 13, 2 ]
lib/build.py
hexa-one/mainline-builder
0
86375
import os from .check_type import KERNEL_VER_INPUT from .definition_script import * from .get_url import * def buildmain(): os.chdir('../../catalog') if os.path.exists(KERNEL_VER_INPUT): os.remove((KERNEL_VER_INPUT) + '/install.sh') os.remove((KERNEL_VER_INPUT) + '/README.md') os.rmdir(KERNEL_VER_INPUT) os.mkdir(KERNEL_VER_INPUT) else: os.mkdir(KERNEL_VER_INPUT) os.chdir(KERNEL_VER_INPUT) out = open("install.sh", 'w') head1 = lambda *x, **y: print(*x, **y, file=out) head2 = lambda *x, **y: print(*x, **y, file=out) head3 = lambda *x, **y: print(*x, **y, file=out) head4 = lambda *x, **y: print(*x, **y, file=out) head5 = lambda *x, **y: print(*x, **y, file=out) head6 = lambda *x, **y: print(*x, **y, file=out) head7 = lambda *x, **y: print(*x, **y, file=out) head8 = lambda *x, **y: print(*x, **y, file=out) head9 = lambda *x, **y: print(*x, **y, file=out) head10 = lambda *x, **y: print(*x, **y, file=out) head11 = lambda *x, **y: print(*x, **y, file=out) head12 = lambda *x, **y: print(*x, **y, file=out) head13 = lambda *x, **y: print(*x, **y, file=out) head14 = lambda *x, **y: print(*x, **y, file=out) head15 = lambda *x, **y: print(*x, **y, file=out) head16 = lambda *x, **y: print(*x, **y, file=out) head17 = lambda *x, **y: print(*x, **y, file=out) head18 = lambda *x, **y: print(*x, **y, file=out) head19 = lambda *x, **y: print(*x, **y, file=out) head20 = lambda *x, **y: print(*x, **y, file=out) head21 = lambda *x, **y: print(*x, **y, file=out) head22 = lambda *x, **y: print(*x, **y, file=out) head23 = lambda *x, **y: print(*x, **y, file=out) head24 = lambda *x, **y: print(*x, **y, file=out) head25 = lambda *x, **y: print(*x, **y, file=out) head26 = lambda *x, **y: print(*x, **y, file=out) head27 = lambda *x, **y: print(*x, **y, file=out) head28 = lambda *x, **y: print(*x, **y, file=out) head29 = lambda *x, **y: print(*x, **y, file=out) head30 = lambda *x, **y: print(*x, **y, file=out) head31 = lambda *x, **y: print(*x, **y, file=out) head32 = lambda *x, **y: print(*x, **y, file=out) head33 = lambda *x, **y: print(*x, **y, file=out) head34 = lambda *x, **y: print(*x, **y, file=out) head35 = lambda *x, **y: print(*x, **y, file=out) head36 = lambda *x, **y: print(*x, **y, file=out) head37 = lambda *x, **y: print(*x, **y, file=out) head38 = lambda *x, **y: print(*x, **y, file=out) head39 = lambda *x, **y: print(*x, **y, file=out) head40 = lambda *x, **y: print(*x, **y, file=out) head41 = lambda *x, **y: print(*x, **y, file=out) head42 = lambda *x, **y: print(*x, **y, file=out) head43 = lambda *x, **y: print(*x, **y, file=out) head44 = lambda *x, **y: print(*x, **y, file=out) head45 = lambda *x, **y: print(*x, **y, file=out) head46 = lambda *x, **y: print(*x, **y, file=out) head47 = lambda *x, **y: print(*x, **y, file=out) head48 = lambda *x, **y: print(*x, **y, file=out) head49 = lambda *x, **y: print(*x, **y, file=out) head50 = lambda *x, **y: print(*x, **y, file=out) head51 = lambda *x, **y: print(*x, **y, file=out) head52 = lambda *x, **y: print(*x, **y, file=out) head53 = lambda *x, **y: print(*x, **y, file=out) op = open("README.md", 'w') read1 = lambda *x, **y: print(*x, **y, file=op) read2 = lambda *x, **y: print(*x, **y, file=op) read3 = lambda *x, **y: print(*x, **y, file=op) read4 = lambda *x, **y: print(*x, **y, file=op) read5 = lambda *x, **y: print(*x, **y, file=op) read6 = lambda *x, **y: print(*x, **y, file=op) read7 = lambda *x, **y: print(*x, **y, file=op) read8 = lambda *x, **y: print(*x, **y, file=op) read9 = lambda *x, **y: print(*x, **y, file=op) read10 = lambda *x, **y: print(*x, **y, file=op) read11 = lambda *x, **y: print(*x, **y, file=op) read12 = lambda *x, **y: print(*x, **y, file=op) read13 = lambda *x, **y: print(*x, **y, file=op) read14 = lambda *x, **y: print(*x, **y, file=op) read15 = lambda *x, **y: print(*x, **y, file=op) read16 = lambda *x, **y: print(*x, **y, file=op) read17 = lambda *x, **y: print(*x, **y, file=op) read18 = lambda *x, **y: print(*x, **y, file=op) read19 = lambda *x, **y: print(*x, **y, file=op) read20 = lambda *x, **y: print(*x, **y, file=op) read21 = lambda *x, **y: print(*x, **y, file=op) read22 = lambda *x, **y: print(*x, **y, file=op) read23 = lambda *x, **y: print(*x, **y, file=op) read24 = lambda *x, **y: print(*x, **y, file=op) read25 = lambda *x, **y: print(*x, **y, file=op) head1(line1) head2(empty) head3(line3) head4(line4) head5(empty) head6(line6) head7(line7) head8(line8) head9(line9) head10(line10) head11(line11) head12((wget) + (empty1) + (wget1)) head13((wget) + (empty1) + (wget2)) head14((wget) + (empty1) + (wget3)) head15((wget) + (empty1) + (wget4)) head16(line16) head17(cd) head18(line18) head19(line19) head20(line20) head21(line21) head22(line22) head23(line23) head24(line24) head25(line25) head26(line26) head27(line27) head28(line10) head29(line11) head30((wget) + (empty1) + (wget5)) head31((wget) + (empty1) + (wget6)) head32((wget) + (empty1) + (wget7)) head33(line16) head34(cd) head35(line18) head36(line25) head37(line26) head38(line38) head39(line39) head40(line40) head41(line41) head42(line42) head43(line43) head44(line19) head45(line20) head46(line46) head47(line22) head48(line48) head49(line24) head50(line25) head51(line26) head52(line52) head53(line53) read1(text1) read2(empty) read3(text3) read4(empty) read5(text5) read6(text6) read7(text7) read8(text8) read9(text9) read10(text6) read11(text11) read12(text8) read13(text13) read14(empty) read15(text5) read16(text6) read17(text17) read18(text8) read19(text9) read20(text6) read21(text11) read22(text8) read23(empty) read24(empty) read25(text25) def buildrc(): os.chdir('../../catalog') if os.path.exists(KERNEL_VER_INPUT): os.remove((KERNEL_VER_INPUT) + '/install.sh') os.remove((KERNEL_VER_INPUT) + '/README.md') os.rmdir(KERNEL_VER_INPUT) os.mkdir(KERNEL_VER_INPUT) else: os.mkdir(KERNEL_VER_INPUT) os.chdir(KERNEL_VER_INPUT) out = open("install.sh", 'w') head1 = lambda *x, **y: print(*x, **y, file=out) head2 = lambda *x, **y: print(*x, **y, file=out) head3 = lambda *x, **y: print(*x, **y, file=out) head4 = lambda *x, **y: print(*x, **y, file=out) head5 = lambda *x, **y: print(*x, **y, file=out) head6 = lambda *x, **y: print(*x, **y, file=out) head7 = lambda *x, **y: print(*x, **y, file=out) head8 = lambda *x, **y: print(*x, **y, file=out) head9 = lambda *x, **y: print(*x, **y, file=out) head10 = lambda *x, **y: print(*x, **y, file=out) head11 = lambda *x, **y: print(*x, **y, file=out) head12 = lambda *x, **y: print(*x, **y, file=out) head13 = lambda *x, **y: print(*x, **y, file=out) head14 = lambda *x, **y: print(*x, **y, file=out) head15 = lambda *x, **y: print(*x, **y, file=out) head16 = lambda *x, **y: print(*x, **y, file=out) head17 = lambda *x, **y: print(*x, **y, file=out) head18 = lambda *x, **y: print(*x, **y, file=out) head19 = lambda *x, **y: print(*x, **y, file=out) head20 = lambda *x, **y: print(*x, **y, file=out) head21 = lambda *x, **y: print(*x, **y, file=out) head22 = lambda *x, **y: print(*x, **y, file=out) head23 = lambda *x, **y: print(*x, **y, file=out) head24 = lambda *x, **y: print(*x, **y, file=out) head25 = lambda *x, **y: print(*x, **y, file=out) head26 = lambda *x, **y: print(*x, **y, file=out) head27 = lambda *x, **y: print(*x, **y, file=out) head28 = lambda *x, **y: print(*x, **y, file=out) head29 = lambda *x, **y: print(*x, **y, file=out) head30 = lambda *x, **y: print(*x, **y, file=out) head31 = lambda *x, **y: print(*x, **y, file=out) head32 = lambda *x, **y: print(*x, **y, file=out) head33 = lambda *x, **y: print(*x, **y, file=out) head34 = lambda *x, **y: print(*x, **y, file=out) head35 = lambda *x, **y: print(*x, **y, file=out) head36 = lambda *x, **y: print(*x, **y, file=out) head37 = lambda *x, **y: print(*x, **y, file=out) head38 = lambda *x, **y: print(*x, **y, file=out) head39 = lambda *x, **y: print(*x, **y, file=out) head40 = lambda *x, **y: print(*x, **y, file=out) head41 = lambda *x, **y: print(*x, **y, file=out) head42 = lambda *x, **y: print(*x, **y, file=out) head43 = lambda *x, **y: print(*x, **y, file=out) head44 = lambda *x, **y: print(*x, **y, file=out) head45 = lambda *x, **y: print(*x, **y, file=out) head46 = lambda *x, **y: print(*x, **y, file=out) head47 = lambda *x, **y: print(*x, **y, file=out) head48 = lambda *x, **y: print(*x, **y, file=out) head49 = lambda *x, **y: print(*x, **y, file=out) head50 = lambda *x, **y: print(*x, **y, file=out) head51 = lambda *x, **y: print(*x, **y, file=out) head52 = lambda *x, **y: print(*x, **y, file=out) head53 = lambda *x, **y: print(*x, **y, file=out) head54 = lambda *x, **y: print(*x, **y, file=out) op = open("README.md", 'w') read1 = lambda *x, **y: print(*x, **y, file=op) read2 = lambda *x, **y: print(*x, **y, file=op) read3 = lambda *x, **y: print(*x, **y, file=op) read4 = lambda *x, **y: print(*x, **y, file=op) read5 = lambda *x, **y: print(*x, **y, file=op) read6 = lambda *x, **y: print(*x, **y, file=op) read7 = lambda *x, **y: print(*x, **y, file=op) read8 = lambda *x, **y: print(*x, **y, file=op) read9 = lambda *x, **y: print(*x, **y, file=op) read10 = lambda *x, **y: print(*x, **y, file=op) read11 = lambda *x, **y: print(*x, **y, file=op) read12 = lambda *x, **y: print(*x, **y, file=op) read13 = lambda *x, **y: print(*x, **y, file=op) read14 = lambda *x, **y: print(*x, **y, file=op) read15 = lambda *x, **y: print(*x, **y, file=op) read16 = lambda *x, **y: print(*x, **y, file=op) read17 = lambda *x, **y: print(*x, **y, file=op) read18 = lambda *x, **y: print(*x, **y, file=op) read19 = lambda *x, **y: print(*x, **y, file=op) read20 = lambda *x, **y: print(*x, **y, file=op) read21 = lambda *x, **y: print(*x, **y, file=op) read22 = lambda *x, **y: print(*x, **y, file=op) read23 = lambda *x, **y: print(*x, **y, file=op) read24 = lambda *x, **y: print(*x, **y, file=op) read25 = lambda *x, **y: print(*x, **y, file=op) head1(line1) head2(empty) head3(line3) head4(line3_1) head5(line4) head6(empty) head7(line6) head8(line7) head9(line8) head10(line9) head11(line10) head12(line11) head13((wget) + (empty1) + (wget1)) head14((wget) + (empty1) + (wget2)) head15((wget) + (empty1) + (wget3)) head16((wget) + (empty1) + (wget4)) head17(line16) head18(cd) head19(line18) head20(line19_1) head21(line20) head22(line21) head23(line22) head24(line23) head25(line24) head26(line25) head27(line26) head28(line27) head29(line10) head30(line11) head31((wget) + (empty1) + (wget5)) head32((wget) + (empty1) + (wget6)) head33((wget) + (empty1) + (wget7)) head34(line16) head35(cd) head36(line18) head37(line25) head38(line26) head39(line38) head40(line39) head41(line40) head42(line41_1) head43(line42_1) head44(line43_1) head45(line19_1) head46(line20) head47(line46) head48(line22) head49(line48) head50(line24) head51(line25) head52(line26) head53(line52) head54(line53) read1(text1) read2(empty) read3(text3) read4(empty) read5(text5) read6(text6) read7(text7) read8(text8) read9(text9) read10(text6) read11(text11) read12(text8) read13(text13) read14(empty) read15(text5) read16(text6) read17(text17) read18(text8) read19(text9) read20(text6) read21(text11) read22(text8) read23(empty) read24(empty) read25(text25) from .definition_readme import * def buildreadme(): os.chdir('../../') os.system('rm readme.md') out = open("readme.md", 'w') headr1 = lambda *x, **y: print(*x, **y, file=out) headr2 = lambda *x, **y: print(*x, **y, file=out) headr3 = lambda *x, **y: print(*x, **y, file=out) headr4 = lambda *x, **y: print(*x, **y, file=out) headr5 = lambda *x, **y: print(*x, **y, file=out) headr6 = lambda *x, **y: print(*x, **y, file=out) headr7 = lambda *x, **y: print(*x, **y, file=out) headr8 = lambda *x, **y: print(*x, **y, file=out) headr9 = lambda *x, **y: print(*x, **y, file=out) headr10 = lambda *x, **y: print(*x, **y, file=out) headr11 = lambda *x, **y: print(*x, **y, file=out) headr12 = lambda *x, **y: print(*x, **y, file=out) headr13 = lambda *x, **y: print(*x, **y, file=out) headr14 = lambda *x, **y: print(*x, **y, file=out) headr15 = lambda *x, **y: print(*x, **y, file=out) headr16 = lambda *x, **y: print(*x, **y, file=out) headr17 = lambda *x, **y: print(*x, **y, file=out) headr18 = lambda *x, **y: print(*x, **y, file=out) headr19 = lambda *x, **y: print(*x, **y, file=out) headr20 = lambda *x, **y: print(*x, **y, file=out) headr21 = lambda *x, **y: print(*x, **y, file=out) headr22 = lambda *x, **y: print(*x, **y, file=out) headr23 = lambda *x, **y: print(*x, **y, file=out) headr24 = lambda *x, **y: print(*x, **y, file=out) headr25 = lambda *x, **y: print(*x, **y, file=out) headr26 = lambda *x, **y: print(*x, **y, file=out) headr27 = lambda *x, **y: print(*x, **y, file=out) headr28 = lambda *x, **y: print(*x, **y, file=out) headr29 = lambda *x, **y: print(*x, **y, file=out) headr30 = lambda *x, **y: print(*x, **y, file=out) headr31 = lambda *x, **y: print(*x, **y, file=out) headr32 = lambda *x, **y: print(*x, **y, file=out) headr33 = lambda *x, **y: print(*x, **y, file=out) headr34 = lambda *x, **y: print(*x, **y, file=out) headr35 = lambda *x, **y: print(*x, **y, file=out) headr36 = lambda *x, **y: print(*x, **y, file=out) headr37 = lambda *x, **y: print(*x, **y, file=out) headr38 = lambda *x, **y: print(*x, **y, file=out) headr39 = lambda *x, **y: print(*x, **y, file=out) headr40 = lambda *x, **y: print(*x, **y, file=out) headr41 = lambda *x, **y: print(*x, **y, file=out) headr42 = lambda *x, **y: print(*x, **y, file=out) headr43 = lambda *x, **y: print(*x, **y, file=out) headr44 = lambda *x, **y: print(*x, **y, file=out) headr45 = lambda *x, **y: print(*x, **y, file=out) headr46 = lambda *x, **y: print(*x, **y, file=out) headr47 = lambda *x, **y: print(*x, **y, file=out) headr48 = lambda *x, **y: print(*x, **y, file=out) headr49 = lambda *x, **y: print(*x, **y, file=out) headr50 = lambda *x, **y: print(*x, **y, file=out) headr51 = lambda *x, **y: print(*x, **y, file=out) headr52 = lambda *x, **y: print(*x, **y, file=out) headr53 = lambda *x, **y: print(*x, **y, file=out) headr54 = lambda *x, **y: print(*x, **y, file=out) headr55 = lambda *x, **y: print(*x, **y, file=out) headr56 = lambda *x, **y: print(*x, **y, file=out) headr57 = lambda *x, **y: print(*x, **y, file=out) headr58 = lambda *x, **y: print(*x, **y, file=out) headr59 = lambda *x, **y: print(*x, **y, file=out) headr60 = lambda *x, **y: print(*x, **y, file=out) headr61 = lambda *x, **y: print(*x, **y, file=out) headr62 = lambda *x, **y: print(*x, **y, file=out) headr63 = lambda *x, **y: print(*x, **y, file=out) headr64 = lambda *x, **y: print(*x, **y, file=out) headr65 = lambda *x, **y: print(*x, **y, file=out) headr66 = lambda *x, **y: print(*x, **y, file=out) headr67 = lambda *x, **y: print(*x, **y, file=out) headr68 = lambda *x, **y: print(*x, **y, file=out) headr69 = lambda *x, **y: print(*x, **y, file=out) headr70 = lambda *x, **y: print(*x, **y, file=out) headr71 = lambda *x, **y: print(*x, **y, file=out) headr72 = lambda *x, **y: print(*x, **y, file=out) headr73 = lambda *x, **y: print(*x, **y, file=out) headr74 = lambda *x, **y: print(*x, **y, file=out) headr1(l1) headr2(l2) headr3(l3) headr4(l4) headr5(l5) headr6(l6) headr7(l7) headr8(l8) headr9(l9) headr10(l10) headr11(l11) headr12(l12) headr13(l13) headr14(l14) headr15(l15) headr16(l16) headr17(l17) headr18(l18) headr19(l19) headr20(l20) headr21(l21) headr22(l22) headr23(l23) headr24(l24) headr25(l25) headr26(l26) headr27(l27) headr28(l28) headr29(l29) headr30(l30) headr31(l31) headr32(l32) headr33(l33) headr34(l34) headr35(l35) headr36(l36) headr37(l37) headr38(l38) headr39(l39) headr40(l40) headr41(l41) headr42(l42) headr43(l43) headr44(l44) headr45(l45) headr46(l46) headr47(l47) headr48(l48) headr49(l49) headr50(l50) headr51(l51) headr52(l52) headr53(l53) headr54(l54) headr55(l55) headr56(l56) headr57(l57) headr58(l58) headr59(l59) headr60(l60) headr61(l61) headr62(l62) headr63(l63) headr64(l64) headr65(l65) headr66(l66) headr67(l67) headr68(l68) headr69(l69) headr70(l70) headr71(l71) headr72(l72) headr73(l73) headr74(l74)
[ 1, 1053, 2897, 13, 3166, 869, 3198, 29918, 1853, 1053, 476, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 13, 3166, 869, 16553, 29918, 2154, 1053, 334, 13, 3166, 869, 657, 29918, 2271, 1053, 334, 13, 13, 1753, 2048, 3396, 7295, 13, 1678, 2897, 29889, 305, 3972, 877, 21546, 28045, 1495, 13, 13, 1678, 565, 2897, 29889, 2084, 29889, 9933, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 1125, 13, 4706, 2897, 29889, 5992, 3552, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 718, 8207, 6252, 29889, 845, 1495, 13, 4706, 2897, 29889, 5992, 3552, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 718, 8207, 16310, 2303, 29889, 3487, 1495, 13, 4706, 2897, 29889, 1758, 3972, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 13, 4706, 2897, 29889, 11256, 3972, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 13, 1678, 1683, 29901, 13, 4706, 2897, 29889, 11256, 3972, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 13, 13, 1678, 2897, 29889, 305, 3972, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 13, 13, 1678, 714, 353, 1722, 703, 6252, 29889, 845, 613, 525, 29893, 1495, 13, 1678, 2343, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 13, 1678, 1015, 353, 1722, 703, 16310, 2303, 29889, 3487, 613, 525, 29893, 1495, 13, 1678, 1303, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 13, 1678, 2343, 29896, 29898, 1220, 29896, 29897, 13, 1678, 2343, 29906, 29898, 6310, 29897, 13, 1678, 2343, 29941, 29898, 1220, 29941, 29897, 13, 1678, 2343, 29946, 29898, 1220, 29946, 29897, 13, 1678, 2343, 29945, 29898, 6310, 29897, 13, 1678, 2343, 29953, 29898, 1220, 29953, 29897, 13, 1678, 2343, 29955, 29898, 1220, 29955, 29897, 13, 1678, 2343, 29947, 29898, 1220, 29947, 29897, 13, 1678, 2343, 29929, 29898, 1220, 29929, 29897, 13, 1678, 2343, 29896, 29900, 29898, 1220, 29896, 29900, 29897, 13, 1678, 2343, 29896, 29896, 29898, 1220, 29896, 29896, 29897, 13, 1678, 2343, 29896, 29906, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29896, 876, 13, 1678, 2343, 29896, 29941, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29906, 876, 13, 1678, 2343, 29896, 29946, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29941, 876, 13, 1678, 2343, 29896, 29945, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29946, 876, 13, 1678, 2343, 29896, 29953, 29898, 1220, 29896, 29953, 29897, 13, 1678, 2343, 29896, 29955, 29898, 2252, 29897, 13, 1678, 2343, 29896, 29947, 29898, 1220, 29896, 29947, 29897, 13, 1678, 2343, 29896, 29929, 29898, 1220, 29896, 29929, 29897, 13, 1678, 2343, 29906, 29900, 29898, 1220, 29906, 29900, 29897, 13, 1678, 2343, 29906, 29896, 29898, 1220, 29906, 29896, 29897, 13, 1678, 2343, 29906, 29906, 29898, 1220, 29906, 29906, 29897, 13, 1678, 2343, 29906, 29941, 29898, 1220, 29906, 29941, 29897, 13, 1678, 2343, 29906, 29946, 29898, 1220, 29906, 29946, 29897, 13, 1678, 2343, 29906, 29945, 29898, 1220, 29906, 29945, 29897, 13, 1678, 2343, 29906, 29953, 29898, 1220, 29906, 29953, 29897, 13, 1678, 2343, 29906, 29955, 29898, 1220, 29906, 29955, 29897, 13, 1678, 2343, 29906, 29947, 29898, 1220, 29896, 29900, 29897, 13, 1678, 2343, 29906, 29929, 29898, 1220, 29896, 29896, 29897, 13, 1678, 2343, 29941, 29900, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29945, 876, 13, 1678, 2343, 29941, 29896, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29953, 876, 13, 1678, 2343, 29941, 29906, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29955, 876, 13, 1678, 2343, 29941, 29941, 29898, 1220, 29896, 29953, 29897, 13, 1678, 2343, 29941, 29946, 29898, 2252, 29897, 13, 1678, 2343, 29941, 29945, 29898, 1220, 29896, 29947, 29897, 13, 1678, 2343, 29941, 29953, 29898, 1220, 29906, 29945, 29897, 13, 1678, 2343, 29941, 29955, 29898, 1220, 29906, 29953, 29897, 13, 1678, 2343, 29941, 29947, 29898, 1220, 29941, 29947, 29897, 13, 1678, 2343, 29941, 29929, 29898, 1220, 29941, 29929, 29897, 13, 1678, 2343, 29946, 29900, 29898, 1220, 29946, 29900, 29897, 13, 1678, 2343, 29946, 29896, 29898, 1220, 29946, 29896, 29897, 13, 1678, 2343, 29946, 29906, 29898, 1220, 29946, 29906, 29897, 13, 1678, 2343, 29946, 29941, 29898, 1220, 29946, 29941, 29897, 13, 1678, 2343, 29946, 29946, 29898, 1220, 29896, 29929, 29897, 13, 1678, 2343, 29946, 29945, 29898, 1220, 29906, 29900, 29897, 13, 1678, 2343, 29946, 29953, 29898, 1220, 29946, 29953, 29897, 13, 1678, 2343, 29946, 29955, 29898, 1220, 29906, 29906, 29897, 13, 1678, 2343, 29946, 29947, 29898, 1220, 29946, 29947, 29897, 13, 1678, 2343, 29946, 29929, 29898, 1220, 29906, 29946, 29897, 13, 1678, 2343, 29945, 29900, 29898, 1220, 29906, 29945, 29897, 13, 1678, 2343, 29945, 29896, 29898, 1220, 29906, 29953, 29897, 13, 1678, 2343, 29945, 29906, 29898, 1220, 29945, 29906, 29897, 13, 1678, 2343, 29945, 29941, 29898, 1220, 29945, 29941, 29897, 13, 1678, 1303, 29896, 29898, 726, 29896, 29897, 13, 1678, 1303, 29906, 29898, 6310, 29897, 13, 1678, 1303, 29941, 29898, 726, 29941, 29897, 13, 1678, 1303, 29946, 29898, 6310, 29897, 13, 1678, 1303, 29945, 29898, 726, 29945, 29897, 13, 1678, 1303, 29953, 29898, 726, 29953, 29897, 13, 1678, 1303, 29955, 29898, 726, 29955, 29897, 13, 1678, 1303, 29947, 29898, 726, 29947, 29897, 13, 1678, 1303, 29929, 29898, 726, 29929, 29897, 13, 1678, 1303, 29896, 29900, 29898, 726, 29953, 29897, 13, 1678, 1303, 29896, 29896, 29898, 726, 29896, 29896, 29897, 13, 1678, 1303, 29896, 29906, 29898, 726, 29947, 29897, 13, 1678, 1303, 29896, 29941, 29898, 726, 29896, 29941, 29897, 13, 1678, 1303, 29896, 29946, 29898, 6310, 29897, 13, 1678, 1303, 29896, 29945, 29898, 726, 29945, 29897, 13, 1678, 1303, 29896, 29953, 29898, 726, 29953, 29897, 13, 1678, 1303, 29896, 29955, 29898, 726, 29896, 29955, 29897, 13, 1678, 1303, 29896, 29947, 29898, 726, 29947, 29897, 13, 1678, 1303, 29896, 29929, 29898, 726, 29929, 29897, 13, 1678, 1303, 29906, 29900, 29898, 726, 29953, 29897, 13, 1678, 1303, 29906, 29896, 29898, 726, 29896, 29896, 29897, 13, 1678, 1303, 29906, 29906, 29898, 726, 29947, 29897, 13, 1678, 1303, 29906, 29941, 29898, 6310, 29897, 13, 1678, 1303, 29906, 29946, 29898, 6310, 29897, 13, 1678, 1303, 29906, 29945, 29898, 726, 29906, 29945, 29897, 13, 13, 1753, 2048, 2214, 7295, 13, 1678, 2897, 29889, 305, 3972, 877, 21546, 28045, 1495, 13, 13, 1678, 565, 2897, 29889, 2084, 29889, 9933, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 1125, 13, 4706, 2897, 29889, 5992, 3552, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 718, 8207, 6252, 29889, 845, 1495, 13, 4706, 2897, 29889, 5992, 3552, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 718, 8207, 16310, 2303, 29889, 3487, 1495, 13, 4706, 2897, 29889, 1758, 3972, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 13, 4706, 2897, 29889, 11256, 3972, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 13, 1678, 1683, 29901, 13, 4706, 2897, 29889, 11256, 3972, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 13, 13, 1678, 2897, 29889, 305, 3972, 29898, 29968, 1001, 29940, 6670, 29918, 5348, 29918, 1177, 12336, 29897, 13, 13, 1678, 714, 353, 1722, 703, 6252, 29889, 845, 613, 525, 29893, 1495, 13, 1678, 2343, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29896, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29906, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29941, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29946, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29945, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 13, 1678, 1015, 353, 1722, 703, 16310, 2303, 29889, 3487, 613, 525, 29893, 1495, 13, 1678, 1303, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29896, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 1678, 1303, 29906, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 459, 29897, 29871, 13, 13, 1678, 2343, 29896, 29898, 1220, 29896, 29897, 13, 1678, 2343, 29906, 29898, 6310, 29897, 13, 1678, 2343, 29941, 29898, 1220, 29941, 29897, 13, 1678, 2343, 29946, 29898, 1220, 29941, 29918, 29896, 29897, 13, 1678, 2343, 29945, 29898, 1220, 29946, 29897, 13, 1678, 2343, 29953, 29898, 6310, 29897, 13, 1678, 2343, 29955, 29898, 1220, 29953, 29897, 13, 1678, 2343, 29947, 29898, 1220, 29955, 29897, 13, 1678, 2343, 29929, 29898, 1220, 29947, 29897, 13, 1678, 2343, 29896, 29900, 29898, 1220, 29929, 29897, 13, 1678, 2343, 29896, 29896, 29898, 1220, 29896, 29900, 29897, 13, 1678, 2343, 29896, 29906, 29898, 1220, 29896, 29896, 29897, 13, 1678, 2343, 29896, 29941, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29896, 876, 13, 1678, 2343, 29896, 29946, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29906, 876, 13, 1678, 2343, 29896, 29945, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29941, 876, 13, 1678, 2343, 29896, 29953, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29946, 876, 13, 1678, 2343, 29896, 29955, 29898, 1220, 29896, 29953, 29897, 13, 1678, 2343, 29896, 29947, 29898, 2252, 29897, 13, 1678, 2343, 29896, 29929, 29898, 1220, 29896, 29947, 29897, 13, 1678, 2343, 29906, 29900, 29898, 1220, 29896, 29929, 29918, 29896, 29897, 13, 1678, 2343, 29906, 29896, 29898, 1220, 29906, 29900, 29897, 13, 1678, 2343, 29906, 29906, 29898, 1220, 29906, 29896, 29897, 13, 1678, 2343, 29906, 29941, 29898, 1220, 29906, 29906, 29897, 13, 1678, 2343, 29906, 29946, 29898, 1220, 29906, 29941, 29897, 13, 1678, 2343, 29906, 29945, 29898, 1220, 29906, 29946, 29897, 13, 1678, 2343, 29906, 29953, 29898, 1220, 29906, 29945, 29897, 13, 1678, 2343, 29906, 29955, 29898, 1220, 29906, 29953, 29897, 13, 1678, 2343, 29906, 29947, 29898, 1220, 29906, 29955, 29897, 13, 1678, 2343, 29906, 29929, 29898, 1220, 29896, 29900, 29897, 13, 1678, 2343, 29941, 29900, 29898, 1220, 29896, 29896, 29897, 13, 1678, 2343, 29941, 29896, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29945, 876, 13, 1678, 2343, 29941, 29906, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29953, 876, 13, 1678, 2343, 29941, 29941, 3552, 29893, 657, 29897, 718, 313, 6310, 29896, 29897, 718, 313, 29893, 657, 29955, 876, 13, 1678, 2343, 29941, 29946, 29898, 1220, 29896, 29953, 29897, 13, 1678, 2343, 29941, 29945, 29898, 2252, 29897, 13, 1678, 2343, 29941, 29953, 29898, 1220, 29896, 29947, 29897, 13, 1678, 2343, 29941, 29955, 29898, 1220, 29906, 29945, 29897, 13, 1678, 2343, 29941, 29947, 29898, 1220, 29906, 29953, 29897, 13, 1678, 2343, 29941, 29929, 29898, 1220, 29941, 29947, 29897, 13, 1678, 2343, 29946, 29900, 29898, 1220, 29941, 29929, 29897, 13, 1678, 2343, 29946, 29896, 29898, 1220, 29946, 29900, 29897, 13, 1678, 2343, 29946, 29906, 29898, 1220, 29946, 29896, 29918, 29896, 29897, 13, 1678, 2343, 29946, 29941, 29898, 1220, 29946, 29906, 29918, 29896, 29897, 13, 1678, 2343, 29946, 29946, 29898, 1220, 29946, 29941, 29918, 29896, 29897, 13, 1678, 2343, 29946, 29945, 29898, 1220, 29896, 29929, 29918, 29896, 29897, 13, 1678, 2343, 29946, 29953, 29898, 1220, 29906, 29900, 29897, 13, 1678, 2343, 29946, 29955, 29898, 1220, 29946, 29953, 29897, 13, 1678, 2343, 29946, 29947, 29898, 1220, 29906, 29906, 29897, 13, 1678, 2343, 29946, 29929, 29898, 1220, 29946, 29947, 29897, 13, 1678, 2343, 29945, 29900, 29898, 1220, 29906, 29946, 29897, 13, 1678, 2343, 29945, 29896, 29898, 1220, 29906, 29945, 29897, 13, 1678, 2343, 29945, 29906, 29898, 1220, 29906, 29953, 29897, 13, 1678, 2343, 29945, 29941, 29898, 1220, 29945, 29906, 29897, 13, 1678, 2343, 29945, 29946, 29898, 1220, 29945, 29941, 29897, 13, 13, 1678, 1303, 29896, 29898, 726, 29896, 29897, 13, 1678, 1303, 29906, 29898, 6310, 29897, 13, 1678, 1303, 29941, 29898, 726, 29941, 29897, 13, 1678, 1303, 29946, 29898, 6310, 29897, 13, 1678, 1303, 29945, 29898, 726, 29945, 29897, 13, 1678, 1303, 29953, 29898, 726, 29953, 29897, 13, 1678, 1303, 29955, 29898, 726, 29955, 29897, 13, 1678, 1303, 29947, 29898, 726, 29947, 29897, 13, 1678, 1303, 29929, 29898, 726, 29929, 29897, 13, 1678, 1303, 29896, 29900, 29898, 726, 29953, 29897, 13, 1678, 1303, 29896, 29896, 29898, 726, 29896, 29896, 29897, 13, 1678, 1303, 29896, 29906, 29898, 726, 29947, 29897, 13, 1678, 1303, 29896, 29941, 29898, 726, 29896, 29941, 29897, 13, 1678, 1303, 29896, 29946, 29898, 6310, 29897, 13, 1678, 1303, 29896, 29945, 29898, 726, 29945, 29897, 13, 1678, 1303, 29896, 29953, 29898, 726, 29953, 29897, 13, 1678, 1303, 29896, 29955, 29898, 726, 29896, 29955, 29897, 13, 1678, 1303, 29896, 29947, 29898, 726, 29947, 29897, 13, 1678, 1303, 29896, 29929, 29898, 726, 29929, 29897, 13, 1678, 1303, 29906, 29900, 29898, 726, 29953, 29897, 13, 1678, 1303, 29906, 29896, 29898, 726, 29896, 29896, 29897, 13, 1678, 1303, 29906, 29906, 29898, 726, 29947, 29897, 13, 1678, 1303, 29906, 29941, 29898, 6310, 29897, 13, 1678, 1303, 29906, 29946, 29898, 6310, 29897, 13, 1678, 1303, 29906, 29945, 29898, 726, 29906, 29945, 29897, 13, 13, 3166, 869, 16553, 29918, 949, 1004, 1053, 334, 13, 13, 1753, 2048, 949, 1004, 7295, 13, 1678, 2897, 29889, 305, 3972, 877, 21546, 1495, 13, 1678, 2897, 29889, 5205, 877, 1758, 1303, 1004, 29889, 3487, 1495, 13, 13, 1678, 714, 353, 1722, 703, 949, 1004, 29889, 3487, 613, 525, 29893, 1495, 13, 1678, 2343, 29878, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29896, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29906, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29941, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29946, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29945, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29945, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29953, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29955, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29947, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29953, 29929, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29955, 29900, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29955, 29896, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29955, 29906, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29955, 29941, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 1678, 2343, 29878, 29955, 29946, 353, 14013, 334, 29916, 29892, 3579, 29891, 29901, 1596, 10456, 29916, 29892, 3579, 29891, 29892, 934, 29922, 449, 29897, 29871, 13, 13, 1678, 2343, 29878, 29896, 29898, 29880, 29896, 29897, 13, 1678, 2343, 29878, 29906, 29898, 29880, 29906, 29897, 13, 1678, 2343, 29878, 29941, 29898, 29880, 29941, 29897, 13, 1678, 2343, 29878, 29946, 29898, 29880, 29946, 29897, 13, 1678, 2343, 29878, 29945, 29898, 29880, 29945, 29897, 13, 1678, 2343, 29878, 29953, 29898, 29880, 29953, 29897, 13, 1678, 2343, 29878, 29955, 29898, 29880, 29955, 29897, 13, 1678, 2343, 29878, 29947, 29898, 29880, 29947, 29897, 13, 1678, 2343, 29878, 29929, 29898, 29880, 29929, 29897, 13, 1678, 2343, 29878, 29896, 29900, 29898, 29880, 29896, 29900, 29897, 13, 1678, 2343, 29878, 29896, 29896, 29898, 29880, 29896, 29896, 29897, 13, 1678, 2343, 29878, 29896, 29906, 29898, 29880, 29896, 29906, 29897, 13, 1678, 2343, 29878, 29896, 29941, 29898, 29880, 29896, 29941, 29897, 13, 1678, 2343, 29878, 29896, 29946, 29898, 29880, 29896, 29946, 29897, 13, 1678, 2343, 29878, 29896, 29945, 29898, 29880, 29896, 29945, 29897, 13, 1678, 2343, 29878, 29896, 29953, 29898, 29880, 29896, 29953, 29897, 13, 1678, 2343, 29878, 29896, 29955, 29898, 29880, 29896, 29955, 29897, 13, 1678, 2343, 29878, 29896, 29947, 29898, 29880, 29896, 29947, 29897, 13, 1678, 2343, 29878, 29896, 29929, 29898, 29880, 29896, 29929, 29897, 13, 1678, 2343, 29878, 29906, 29900, 29898, 29880, 29906, 29900, 29897, 13, 1678, 2343, 29878, 29906, 29896, 29898, 29880, 29906, 29896, 29897, 13, 1678, 2343, 29878, 29906, 29906, 29898, 29880, 29906, 29906, 29897, 13, 1678, 2343, 29878, 29906, 29941, 29898, 29880, 29906, 29941, 29897, 13, 1678, 2343, 29878, 29906, 29946, 29898, 29880, 29906, 29946, 29897, 13, 1678, 2343, 29878, 29906, 29945, 29898, 29880, 29906, 29945, 29897, 13, 1678, 2343, 29878, 29906, 29953, 29898, 29880, 29906, 29953, 29897, 13, 1678, 2343, 29878, 29906, 29955, 29898, 29880, 29906, 29955, 29897, 13, 1678, 2343, 29878, 29906, 29947, 29898, 29880, 29906, 29947, 29897, 13, 1678, 2343, 29878, 29906, 29929, 29898, 29880, 29906, 29929, 29897, 13, 1678, 2343, 29878, 29941, 29900, 29898, 29880, 29941, 29900, 29897, 13, 1678, 2343, 29878, 29941, 29896, 29898, 29880, 29941, 29896, 29897, 13, 1678, 2343, 29878, 29941, 29906, 29898, 29880, 29941, 29906, 29897, 13, 1678, 2343, 29878, 29941, 29941, 29898, 29880, 29941, 29941, 29897, 13, 1678, 2343, 29878, 29941, 29946, 29898, 29880, 29941, 29946, 29897, 13, 1678, 2343, 29878, 29941, 29945, 29898, 29880, 29941, 29945, 29897, 13, 1678, 2343, 29878, 29941, 29953, 29898, 29880, 29941, 29953, 29897, 13, 1678, 2343, 29878, 29941, 29955, 29898, 29880, 29941, 29955, 29897, 13, 1678, 2343, 29878, 29941, 29947, 29898, 29880, 29941, 29947, 29897, 13, 1678, 2343, 29878, 29941, 29929, 29898, 29880, 29941, 29929, 29897, 13, 1678, 2343, 29878, 29946, 29900, 29898, 29880, 29946, 29900, 29897, 13, 1678, 2343, 29878, 29946, 29896, 29898, 29880, 29946, 29896, 29897, 13, 1678, 2343, 29878, 29946, 29906, 29898, 29880, 29946, 29906, 29897, 13, 1678, 2343, 29878, 29946, 29941, 29898, 29880, 29946, 29941, 29897, 13, 1678, 2343, 29878, 29946, 29946, 29898, 29880, 29946, 29946, 29897, 13, 1678, 2343, 29878, 29946, 29945, 29898, 29880, 29946, 29945, 29897, 13, 1678, 2343, 29878, 29946, 29953, 29898, 29880, 29946, 29953, 29897, 13, 1678, 2343, 29878, 29946, 29955, 29898, 29880, 29946, 29955, 29897, 13, 1678, 2343, 29878, 29946, 29947, 29898, 29880, 29946, 29947, 29897, 13, 1678, 2343, 29878, 29946, 29929, 29898, 29880, 29946, 29929, 29897, 13, 1678, 2343, 29878, 29945, 29900, 29898, 29880, 29945, 29900, 29897, 13, 1678, 2343, 29878, 29945, 29896, 29898, 29880, 29945, 29896, 29897, 13, 1678, 2343, 29878, 29945, 29906, 29898, 29880, 29945, 29906, 29897, 13, 1678, 2343, 29878, 29945, 29941, 29898, 29880, 29945, 29941, 29897, 13, 1678, 2343, 29878, 29945, 29946, 29898, 29880, 29945, 29946, 29897, 13, 1678, 2343, 29878, 29945, 29945, 29898, 29880, 29945, 29945, 29897, 13, 1678, 2343, 29878, 29945, 29953, 29898, 29880, 29945, 29953, 29897, 13, 1678, 2343, 29878, 29945, 29955, 29898, 29880, 29945, 29955, 29897, 13, 1678, 2343, 29878, 29945, 29947, 29898, 29880, 29945, 29947, 29897, 13, 1678, 2343, 29878, 29945, 29929, 29898, 29880, 29945, 29929, 29897, 13, 1678, 2343, 29878, 29953, 29900, 29898, 29880, 29953, 29900, 29897, 13, 1678, 2343, 29878, 29953, 29896, 29898, 29880, 29953, 29896, 29897, 13, 1678, 2343, 29878, 29953, 29906, 29898, 29880, 29953, 29906, 29897, 13, 1678, 2343, 29878, 29953, 29941, 29898, 29880, 29953, 29941, 29897, 13, 1678, 2343, 29878, 29953, 29946, 29898, 29880, 29953, 29946, 29897, 13, 1678, 2343, 29878, 29953, 29945, 29898, 29880, 29953, 29945, 29897, 13, 1678, 2343, 29878, 29953, 29953, 29898, 29880, 29953, 29953, 29897, 13, 1678, 2343, 29878, 29953, 29955, 29898, 29880, 29953, 29955, 29897, 13, 1678, 2343, 29878, 29953, 29947, 29898, 29880, 29953, 29947, 29897, 13, 1678, 2343, 29878, 29953, 29929, 29898, 29880, 29953, 29929, 29897, 13, 1678, 2343, 29878, 29955, 29900, 29898, 29880, 29955, 29900, 29897, 13, 1678, 2343, 29878, 29955, 29896, 29898, 29880, 29955, 29896, 29897, 13, 1678, 2343, 29878, 29955, 29906, 29898, 29880, 29955, 29906, 29897, 13, 1678, 2343, 29878, 29955, 29941, 29898, 29880, 29955, 29941, 29897, 13, 1678, 2343, 29878, 29955, 29946, 29898, 29880, 29955, 29946, 29897, 2 ]
setup.py
parthe/scikit-rmt
8
164092
<reponame>parthe/scikit-rmt # encoding: utf-8 import os import sys from setuptools import find_packages, setup VERSION = '0.1.4' with open("README.md", "r") as f: LONG_DESCRIPTION = f.read() with open("requirements.txt", "r") as f: REQUIREMENTS = f.read().split('\n') setup( name='scikit-rmt', author='<NAME>', author_email='<EMAIL>', #packages = ['scikit-rmt'], version = VERSION, license='BSD', description='Random Matrix Theory Python package', long_description=LONG_DESCRIPTION, long_description_content_type="text/markdown", url = 'https://github.com/AlejandroSantorum/scikit-rmt', download_url='https://github.com/AlejandroSantorum/scikit-rmt/archive/refs/tags/v0.1.4.tar.gz', include_package_data=True, packages=find_packages(), keywords=['RMT', 'Random Matrix Theory', 'Ensemble', 'Covariance matrices'], #install_requires=["numpy", "matplotlib", "scipy"], install_requires=REQUIREMENTS, classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
[ 1, 529, 276, 1112, 420, 29958, 1595, 354, 29914, 26167, 7354, 29899, 1758, 29873, 13, 29937, 8025, 29901, 23616, 29899, 29947, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 3166, 731, 21245, 8789, 1053, 1284, 29918, 8318, 29892, 6230, 13, 13, 16358, 353, 525, 29900, 29889, 29896, 29889, 29946, 29915, 13, 13, 2541, 1722, 703, 16310, 2303, 29889, 3487, 613, 376, 29878, 1159, 408, 285, 29901, 13, 1678, 365, 20614, 29918, 2287, 7187, 24290, 2725, 353, 285, 29889, 949, 580, 13, 13, 2541, 1722, 703, 12277, 1860, 29889, 3945, 613, 376, 29878, 1159, 408, 285, 29901, 13, 1678, 5195, 29984, 3120, 1525, 13780, 29903, 353, 285, 29889, 949, 2141, 5451, 28909, 29876, 1495, 13, 13, 14669, 29898, 13, 1678, 1024, 2433, 26167, 7354, 29899, 1758, 29873, 742, 13, 1678, 4148, 2433, 29966, 5813, 29958, 742, 13, 1678, 4148, 29918, 5269, 2433, 29966, 26862, 6227, 29958, 742, 13, 1678, 396, 8318, 353, 6024, 26167, 7354, 29899, 1758, 29873, 7464, 13, 1678, 1873, 353, 478, 1001, 13381, 29892, 13, 1678, 19405, 2433, 29933, 7230, 742, 13, 1678, 6139, 2433, 17875, 22513, 24134, 5132, 3577, 742, 13, 1678, 1472, 29918, 8216, 29922, 29931, 20614, 29918, 2287, 7187, 24290, 2725, 29892, 13, 1678, 1472, 29918, 8216, 29918, 3051, 29918, 1853, 543, 726, 29914, 3502, 3204, 613, 13, 1678, 3142, 353, 525, 991, 597, 3292, 29889, 510, 29914, 29909, 23275, 14907, 29903, 424, 17220, 29914, 26167, 7354, 29899, 1758, 29873, 742, 13, 1678, 5142, 29918, 2271, 2433, 991, 597, 3292, 29889, 510, 29914, 29909, 23275, 14907, 29903, 424, 17220, 29914, 26167, 7354, 29899, 1758, 29873, 29914, 10867, 29914, 24539, 29914, 11338, 29914, 29894, 29900, 29889, 29896, 29889, 29946, 29889, 12637, 29889, 18828, 742, 13, 1678, 3160, 29918, 5113, 29918, 1272, 29922, 5574, 29892, 13, 1678, 9741, 29922, 2886, 29918, 8318, 3285, 13, 1678, 29361, 29922, 1839, 29934, 11490, 742, 525, 17875, 22513, 24134, 742, 525, 29923, 1983, 6967, 742, 525, 29907, 586, 279, 8837, 13516, 7464, 13, 1678, 396, 6252, 29918, 276, 339, 2658, 29922, 3366, 23749, 613, 376, 2922, 17357, 613, 376, 26167, 2272, 12436, 13, 1678, 2601, 29918, 276, 339, 2658, 29922, 1525, 29984, 3120, 1525, 13780, 29903, 29892, 13, 1678, 770, 14903, 11759, 13, 4706, 525, 21956, 358, 16034, 4761, 29871, 29941, 448, 838, 2026, 742, 13, 4706, 525, 2928, 2760, 319, 4749, 663, 4761, 10682, 414, 742, 13, 4706, 525, 2928, 2760, 319, 4749, 663, 4761, 9327, 29914, 1666, 2842, 742, 13, 4706, 525, 29931, 293, 1947, 4761, 438, 5425, 28268, 1490, 4761, 350, 7230, 19245, 742, 13, 4706, 525, 29940, 18771, 17088, 4761, 4223, 742, 13, 4706, 525, 7094, 1218, 2184, 4761, 6570, 25266, 742, 13, 4706, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29955, 742, 13, 4706, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29947, 742, 13, 4706, 525, 7031, 293, 4761, 23753, 928, 29914, 12412, 3241, 4761, 13486, 1199, 742, 13, 4706, 525, 7031, 293, 4761, 18540, 14650, 4761, 365, 4626, 4314, 4761, 5132, 3382, 2540, 742, 13, 1678, 21251, 13, 29897, 2 ]
dali/utils/throttled.py
JonathanRaiman/dali-cython-stub
7
1602614
<filename>dali/utils/throttled.py import time class Throttled(object): def __init__(self, min_time_since_last_run_s=5): """Used for simple throttled execution. Here's a simple example: @Throttled(1) def lol(i): print('epoch %d' % (i,), flush=True) for i in range(100000000): lol(i) Above code will report the epoch every second. Here's another way: throttled = Throttled(1) for i in range(100000000000): if throttled.should_i_run(): print('epoch %d' % (i,), flush=True) """ self.last_time = None self.min_time_since_last_run_s = min_time_since_last_run_s def should_i_run(self, min_time_since_last_run_s=None): min_time_since_last_run_s = min_time_since_last_run_s or self.min_time_since_last_run_s now = time.time() if self.last_time is None or (now - self.last_time) > min_time_since_last_run_s: self.last_time = now return True else: return False def maybe_run(self, f, min_time_since_last_run_s=None): if self.should_i_run(min_time_since_last_run_s): return f() else: return None def __call__(self, f): def wrapper(*args, **kwargs): return self.maybe_run(lambda: f(*args, **kwargs)) return wrapper
[ 1, 529, 9507, 29958, 29881, 2606, 29914, 13239, 29914, 386, 26970, 839, 29889, 2272, 13, 5215, 931, 13, 13, 13, 13, 13, 1990, 498, 26970, 839, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1375, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 29922, 29945, 1125, 13, 4706, 9995, 29965, 8485, 363, 2560, 20961, 698, 839, 8225, 29889, 13, 13, 4706, 2266, 29915, 29879, 263, 2560, 1342, 29901, 13, 13, 9651, 732, 1349, 26970, 839, 29898, 29896, 29897, 13, 9651, 822, 301, 324, 29898, 29875, 1125, 13, 18884, 1596, 877, 1022, 2878, 1273, 29881, 29915, 1273, 313, 29875, 29892, 511, 28371, 29922, 5574, 29897, 13, 13, 9651, 363, 474, 297, 3464, 29898, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 1125, 13, 18884, 301, 324, 29898, 29875, 29897, 13, 13, 4706, 319, 29205, 775, 674, 3461, 278, 21502, 305, 1432, 1473, 29889, 13, 13, 4706, 2266, 29915, 29879, 1790, 982, 29901, 13, 13, 9651, 20961, 698, 839, 353, 498, 26970, 839, 29898, 29896, 29897, 13, 13, 13, 9651, 363, 474, 297, 3464, 29898, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 1125, 13, 18884, 565, 20961, 698, 839, 29889, 9344, 29918, 29875, 29918, 3389, 7295, 13, 462, 1678, 1596, 877, 1022, 2878, 1273, 29881, 29915, 1273, 313, 29875, 29892, 511, 28371, 29922, 5574, 29897, 13, 4706, 9995, 13, 4706, 1583, 29889, 4230, 29918, 2230, 353, 6213, 13, 4706, 1583, 29889, 1195, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 353, 1375, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 13, 13, 13, 1678, 822, 881, 29918, 29875, 29918, 3389, 29898, 1311, 29892, 1375, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 29922, 8516, 1125, 13, 4706, 1375, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 353, 1375, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 470, 1583, 29889, 1195, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 13, 4706, 1286, 353, 931, 29889, 2230, 580, 13, 4706, 565, 1583, 29889, 4230, 29918, 2230, 338, 6213, 470, 313, 3707, 448, 1583, 29889, 4230, 29918, 2230, 29897, 1405, 1375, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 29901, 13, 9651, 1583, 29889, 4230, 29918, 2230, 353, 1286, 13, 9651, 736, 5852, 13, 4706, 1683, 29901, 13, 9651, 736, 7700, 13, 13, 1678, 822, 5505, 29918, 3389, 29898, 1311, 29892, 285, 29892, 1375, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 29922, 8516, 1125, 13, 4706, 565, 1583, 29889, 9344, 29918, 29875, 29918, 3389, 29898, 1195, 29918, 2230, 29918, 16076, 29918, 4230, 29918, 3389, 29918, 29879, 1125, 13, 9651, 736, 285, 580, 13, 4706, 1683, 29901, 13, 9651, 736, 6213, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 285, 1125, 13, 4706, 822, 14476, 10456, 5085, 29892, 3579, 19290, 1125, 13, 9651, 736, 1583, 29889, 26026, 29918, 3389, 29898, 2892, 29901, 285, 10456, 5085, 29892, 3579, 19290, 876, 13, 4706, 736, 14476, 13, 2 ]
theano/typed_list/basic.py
MarcCote/Theano
95
197077
from __future__ import absolute_import, print_function, division import numpy from .type import TypedListType import theano from theano.gof import Apply, Constant, Op, Variable from theano.tensor.type_other import SliceType from theano import tensor as T from theano.compile.debugmode import _lessbroken_deepcopy class _typed_list_py_operators: def __getitem__(self, index): return getitem(self, index) def __len__(self): return length(self) def append(self, toAppend): return append(self, toAppend) def extend(self, toAppend): return extend(self, toAppend) def insert(self, index, toInsert): return insert(self, index, toInsert) def remove(self, toRemove): return remove(self, toRemove) def reverse(self): return reverse(self) def count(self, elem): return count(self, elem) # name "index" is already used by an attribute def ind(self, elem): return index_(self, elem) ttype = property(lambda self: self.type.ttype) dtype = property(lambda self: self.type.ttype.dtype) ndim = property(lambda self: self.type.ttype.ndim + 1) class TypedListVariable(_typed_list_py_operators, Variable): """ Subclass to add the typed list operators to the basic `Variable` class. """ TypedListType.Variable = TypedListVariable class TypedListConstant(_typed_list_py_operators, Constant): """ Subclass to add the typed list operators to the basic `Variable` class. """ TypedListType.Constant = TypedListConstant class GetItem(Op): # See doc in instance of this Op or function after this class definition. view_map = {0: [0]} __props__ = () def make_node(self, x, index): assert isinstance(x.type, TypedListType) if not isinstance(index, Variable): if isinstance(index, slice): index = Constant(SliceType(), index) return Apply(self, [x, index], [x.type()]) else: index = T.constant(index, ndim=0, dtype='int64') return Apply(self, [x, index], [x.ttype()]) if isinstance(index.type, SliceType): return Apply(self, [x, index], [x.type()]) elif isinstance(index, T.TensorVariable) and index.ndim == 0: assert index.dtype == 'int64' return Apply(self, [x, index], [x.ttype()]) else: raise TypeError('Expected scalar or slice as index.') def perform(self, node, inputs, outputs): (x, index) = inputs (out,) = outputs if not isinstance(index, slice): index = int(index) out[0] = x[index] def __str__(self): return self.__class__.__name__ def c_code(self, node, name, inp, out, sub): x_name, index = inp[0], inp[1] output_name = out[0] fail = sub['fail'] return """ %(output_name)s = (typeof %(output_name)s) PyList_GetItem( (PyObject*) %(x_name)s, *((npy_int64 *) PyArray_DATA(%(index)s))); if(%(output_name)s == NULL){ %(fail)s } Py_INCREF(%(output_name)s); """ % locals() def c_code_cache_version(self): return (1,) getitem = GetItem() """ Get specified slice of a typed list. Parameters ---------- x Typed list. index The index of the value to return from `x`. """ class Append(Op): # See doc in instance of this Op after the class definition. __props__ = ("inplace",) def __init__(self, inplace=False): self.inplace = inplace if self.inplace: self.destroy_map = {0: [0]} # TODO: make destroy_handler support having views and # destroyed version of multiple inputs. # self.view_map = {0: [1]} else: # TODO: make destroy_handler support multiple view # self.view_map = {0: [0, 1]} self.view_map = {0: [0]} def make_node(self, x, toAppend): assert isinstance(x.type, TypedListType) assert x.ttype == toAppend.type, (x.ttype, toAppend.type) return Apply(self, [x, toAppend], [x.type()]) def perform(self, node, inputs, outputs): (x, toAppend) = inputs (out,) = outputs if not self.inplace: out[0] = list(x) else: out[0] = x # need to copy toAppend due to destroy_handler limitation toAppend = _lessbroken_deepcopy(toAppend) out[0].append(toAppend) def __str__(self): return self.__class__.__name__ # DISABLED AS WE NEED TO UPDATE IT TO COPY toAppend(). def _c_code_(self, node, name, inp, out, sub): x_name, toAppend = inp[0], inp[1] output_name = out[0] fail = sub['fail'] if not self.inplace: init = """ %(output_name)s = (PyListObject*) PyList_GetSlice((PyObject*) %(x_name)s, 0, PyList_GET_SIZE((PyObject*) %(x_name)s)) ; """ % locals() else: init = """ %(output_name)s = %(x_name)s; """ % locals() return init + """ if(%(output_name)s==NULL){ %(fail)s }; if(PyList_Append( (PyObject*) %(output_name)s,(PyObject*) %(toAppend)s)){ %(fail)s }; Py_INCREF(%(output_name)s); """ % locals() def c_code_cache_version(self): return (1,) append = Append() """ Append an element at the end of another list. Parameters ---------- x The base typed list. y The element to append to `x`. """ class Extend(Op): # See doc in instance of this Op after the class definition. __props__ = ("inplace",) def __init__(self, inplace=False): self.inplace = inplace if self.inplace: self.destroy_map = {0: [0]} # TODO: make destroy_handler support having views and # destroyed version of multiple inputs. # self.view_map = {0: [1]} else: # TODO: make destroy_handler support multiple view # self.view_map = {0: [0, 1]} self.view_map = {0: [0]} def make_node(self, x, toAppend): assert isinstance(x.type, TypedListType) assert x.type == toAppend.type return Apply(self, [x, toAppend], [x.type()]) def perform(self, node, inputs, outputs): (x, toAppend) = inputs (out,) = outputs if not self.inplace: out[0] = list(x) else: out[0] = x # need to copy toAppend due to destroy_handler limitation if toAppend: o = out[0] for i in toAppend: o.append(_lessbroken_deepcopy(i)) def __str__(self): return self.__class__.__name__ # DISABLED AS WE NEED TO UPDATE IT TO COPY toAppend(). def _c_code_(self, node, name, inp, out, sub): x_name, toAppend = inp[0], inp[1] output_name = out[0] fail = sub['fail'] if not self.inplace: init = """ %(output_name)s = (PyListObject*) PyList_GetSlice((PyObject*) %(x_name)s, 0, PyList_GET_SIZE((PyObject*) %(x_name)s)) ; """ % locals() else: init = """ %(output_name)s = %(x_name)s; """ % locals() return init + """ int i =0; int length = PyList_GET_SIZE((PyObject*) %(toAppend)s); if(%(output_name)s==NULL){ %(fail)s }; for(i; i < length; i++){ if(PyList_Append( (PyObject*) %(output_name)s,(PyObject*) PyList_GetItem((PyObject*) %(toAppend)s,i))==-1){ %(fail)s }; } Py_INCREF(%(output_name)s); """ % locals() def c_code_cache_version_(self): return (1,) extend = Extend() """ Append all elements of a list at the end of another list. Parameters ---------- x The typed list to extend. toAppend The typed list that will be added at the end of `x`. """ class Insert(Op): # See doc in instance of this Op after the class definition. __props__ = ("inplace",) def __init__(self, inplace=False): self.inplace = inplace if self.inplace: self.destroy_map = {0: [0]} # TODO: make destroy_handler support having views and # destroyed version of multiple inputs. # self.view_map = {0: [2]} else: # TODO: make destroy_handler support multiple view # self.view_map = {0: [0, 2]} self.view_map = {0: [0]} def make_node(self, x, index, toInsert): assert isinstance(x.type, TypedListType) assert x.ttype == toInsert.type if not isinstance(index, Variable): index = T.constant(index, ndim=0, dtype='int64') else: assert index.dtype == 'int64' assert isinstance(index, T.TensorVariable) and index.ndim == 0 return Apply(self, [x, index, toInsert], [x.type()]) def perform(self, node, inputs, outputs): (x, index, toInsert) = inputs (out,) = outputs if not self.inplace: out[0] = list(x) else: out[0] = x # need to copy toAppend due to destroy_handler limitation toInsert = _lessbroken_deepcopy(toInsert) out[0].insert(index, toInsert) def __str__(self): return self.__class__.__name__ # DISABLED AS WE NEED TO UPDATE IT TO COPY toAppend(). def _c_code_(self, node, name, inp, out, sub): x_name, index, toInsert = inp[0], inp[1], inp[2] output_name = out[0] fail = sub['fail'] if not self.inplace: init = """ %(output_name)s = (PyListObject*) PyList_GetSlice((PyObject*) %(x_name)s, 0, PyList_GET_SIZE((PyObject*) %(x_name)s)) ; """ % locals() else: init = """ %(output_name)s = %(x_name)s; """ % locals() return init + """ if(%(output_name)s==NULL){ %(fail)s }; if(PyList_Insert((PyObject*) %(output_name)s, *((npy_int64 *) PyArray_DATA(%(index)s)), (PyObject*) %(toInsert)s)==-1){ %(fail)s }; Py_INCREF(%(output_name)s); """ % locals() def c_code_cache_version(self): return (1,) insert = Insert() """ Insert an element at an index in a typed list. Parameters ---------- x The typed list to modify. index The index where to put the new element in `x`. toInsert The new element to insert. """ class Remove(Op): # See doc in instance of this Op after the class definition. __props__ = ("inplace",) def __init__(self, inplace=False): self.inplace = inplace if self.inplace: self.destroy_map = {0: [0]} else: self.view_map = {0: [0]} def make_node(self, x, toRemove): assert isinstance(x.type, TypedListType) assert x.ttype == toRemove.type return Apply(self, [x, toRemove], [x.type()]) def perform(self, node, inputs, outputs): (x, toRemove) = inputs (out,) = outputs if not self.inplace: out[0] = list(x) else: out[0] = x """ Inelegant workaround for ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() being thrown when trying to remove a matrix from a matrices list. """ for y in range(out[0].__len__()): if node.inputs[0].ttype.values_eq(out[0][y], toRemove): del out[0][y] break def __str__(self): return self.__class__.__name__ remove = Remove() """Remove an element from a typed list. Parameters ---------- x The typed list to be changed. toRemove An element to be removed from the typed list. We only remove the first instance. Notes ----- Python implementation of remove doesn't work when we want to remove an ndarray from a list. This implementation works in that case. """ class Reverse(Op): # See doc in instance of this Op after the class definition. __props__ = ("inplace",) def __init__(self, inplace=False): self.inplace = inplace if self.inplace: self.destroy_map = {0: [0]} else: self.view_map = {0: [0]} def make_node(self, x): assert isinstance(x.type, TypedListType) return Apply(self, [x], [x.type()]) def perform(self, node, inp, outputs): (out,) = outputs if not self.inplace: out[0] = list(inp[0]) else: out[0] = inp[0] out[0].reverse() def __str__(self): return self.__class__.__name__ def c_code(self, node, name, inp, out, sub): x_name = inp[0] output_name = out[0] fail = sub['fail'] if not self.inplace: init = """ %(output_name)s = (PyListObject*) PyList_GetSlice((PyObject*) %(x_name)s, 0, PyList_GET_SIZE((PyObject*) %(x_name)s)) ; """ % locals() else: init = """ %(output_name)s = %(x_name)s; """ % locals() return init + """ if(%(output_name)s==NULL){ %(fail)s }; if(PyList_Reverse((PyObject*) %(output_name)s)==-1){ %(fail)s }; Py_INCREF(%(output_name)s); """ % locals() def c_code_cache_version(self): return (1,) reverse = Reverse() """ Reverse the order of a typed list. Parameters ---------- x The typed list to be reversed. """ class Index(Op): # See doc in instance of this Op after the class definition. __props__ = () def make_node(self, x, elem): assert isinstance(x.type, TypedListType) assert x.ttype == elem.type return Apply(self, [x, elem], [T.scalar()]) def perform(self, node, inputs, outputs): """ Inelegant workaround for ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() being thrown when trying to remove a matrix from a matrices list """ (x, elem) = inputs (out,) = outputs for y in range(len(x)): if node.inputs[0].ttype.values_eq(x[y], elem): out[0] = numpy.asarray(y, dtype=theano.config.floatX) break def __str__(self): return self.__class__.__name__ index_ = Index() class Count(Op): # See doc in instance of this Op after the class definition. __props__ = () def make_node(self, x, elem): assert isinstance(x.type, TypedListType) assert x.ttype == elem.type return Apply(self, [x, elem], [T.scalar()]) def perform(self, node, inputs, outputs): """ Inelegant workaround for ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() being thrown when trying to remove a matrix from a matrices list """ (x, elem) = inputs (out,) = outputs out[0] = 0 for y in range(len(x)): if node.inputs[0].ttype.values_eq(x[y], elem): out[0] += 1 out[0] = numpy.asarray(out[0], dtype=theano.config.floatX) def __str__(self): return self.__class__.__name__ count = Count() """ Count the number of times an element is in the typed list. Parameters ---------- x The typed list to look into. elem The element we want to count in list. The elements are compared with equals. Notes ----- Python implementation of count doesn't work when we want to count an ndarray from a list. This implementation works in that case. """ class Length(Op): # See doc in instance of this Op after the class definition. __props__ = () def make_node(self, x): assert isinstance(x.type, TypedListType) return Apply(self, [x], [T.scalar(dtype='int64')]) def perform(self, node, x, outputs): (out,) = outputs out[0] = numpy.asarray(len(x[0]), 'int64') def __str__(self): return self.__class__.__name__ def c_code(self, node, name, inp, out, sub): x_name = inp[0] output_name = out[0] fail = sub['fail'] return """ if(!%(output_name)s) %(output_name)s=(PyArrayObject*)PyArray_EMPTY(0, NULL, NPY_INT64, 0); ((npy_int64*)PyArray_DATA(%(output_name)s))[0]=PyList_Size((PyObject*)%(x_name)s); Py_INCREF(%(output_name)s); """ % locals() def c_code_cache_version(self): return (1,) length = Length() """ Returns the size of a list. Parameters ---------- x Typed list. """ class MakeList(Op): __props__ = () def make_node(self, a): assert isinstance(a, (tuple, list)) a2 = [] for elem in a: if not isinstance(elem, theano.gof.Variable): elem = theano.tensor.as_tensor_variable(elem) a2.append(elem) if not all(a2[0].type == elem.type for elem in a2): raise TypeError( "MakeList need all input variable to be of the same type.") tl = theano.typed_list.TypedListType(a2[0].type)() return Apply(self, a2, [tl]) def perform(self, node, inputs, outputs): (out,) = outputs # We need to make sure that we don't get a view on our inputs out[0] = [_lessbroken_deepcopy(inp) for inp in inputs] make_list = MakeList() """ Build a Python list from those Theano variable. Parameters ---------- a : tuple/list of Theano variable Notes ----- All Theano variables must have the same type. """
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 29892, 1596, 29918, 2220, 29892, 8542, 13, 13, 5215, 12655, 13, 13, 3166, 869, 1853, 1053, 14213, 287, 1293, 1542, 13, 5215, 278, 1562, 13, 3166, 278, 1562, 29889, 29887, 974, 1053, 2401, 368, 29892, 28601, 29892, 6461, 29892, 28736, 13, 3166, 278, 1562, 29889, 20158, 29889, 1853, 29918, 1228, 1053, 317, 5897, 1542, 13, 3166, 278, 1562, 1053, 12489, 408, 323, 13, 3166, 278, 1562, 29889, 12198, 29889, 8382, 8513, 1053, 903, 2222, 6729, 1717, 29918, 24535, 8552, 13, 13, 13, 1990, 903, 1017, 9795, 29918, 1761, 29918, 2272, 29918, 3372, 4097, 29901, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 2380, 1125, 13, 4706, 736, 679, 667, 29898, 1311, 29892, 2380, 29897, 13, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 13, 4706, 736, 3309, 29898, 1311, 29897, 13, 13, 1678, 822, 9773, 29898, 1311, 29892, 304, 18277, 1125, 13, 4706, 736, 9773, 29898, 1311, 29892, 304, 18277, 29897, 13, 13, 1678, 822, 10985, 29898, 1311, 29892, 304, 18277, 1125, 13, 4706, 736, 10985, 29898, 1311, 29892, 304, 18277, 29897, 13, 13, 1678, 822, 4635, 29898, 1311, 29892, 2380, 29892, 304, 17491, 1125, 13, 4706, 736, 4635, 29898, 1311, 29892, 2380, 29892, 304, 17491, 29897, 13, 13, 1678, 822, 3349, 29898, 1311, 29892, 304, 15941, 1125, 13, 4706, 736, 3349, 29898, 1311, 29892, 304, 15941, 29897, 13, 13, 1678, 822, 11837, 29898, 1311, 1125, 13, 4706, 736, 11837, 29898, 1311, 29897, 13, 13, 1678, 822, 2302, 29898, 1311, 29892, 21268, 1125, 13, 4706, 736, 2302, 29898, 1311, 29892, 21268, 29897, 13, 13, 1678, 396, 1024, 376, 2248, 29908, 338, 2307, 1304, 491, 385, 5352, 13, 1678, 822, 1399, 29898, 1311, 29892, 21268, 1125, 13, 4706, 736, 2380, 23538, 1311, 29892, 21268, 29897, 13, 13, 1678, 260, 1853, 353, 2875, 29898, 2892, 1583, 29901, 1583, 29889, 1853, 29889, 698, 668, 29897, 13, 1678, 26688, 353, 2875, 29898, 2892, 1583, 29901, 1583, 29889, 1853, 29889, 698, 668, 29889, 29881, 1853, 29897, 13, 268, 299, 326, 353, 2875, 29898, 2892, 1583, 29901, 1583, 29889, 1853, 29889, 698, 668, 29889, 299, 326, 718, 29871, 29896, 29897, 13, 13, 13, 1990, 14213, 287, 1293, 16174, 7373, 1017, 9795, 29918, 1761, 29918, 2272, 29918, 3372, 4097, 29892, 28736, 1125, 13, 1678, 9995, 13, 1678, 3323, 1990, 304, 788, 278, 13033, 1051, 12768, 304, 278, 6996, 421, 16174, 29952, 770, 29889, 13, 13, 1678, 9995, 13, 13, 24933, 287, 1293, 1542, 29889, 16174, 353, 14213, 287, 1293, 16174, 13, 13, 13, 1990, 14213, 287, 1293, 12075, 424, 7373, 1017, 9795, 29918, 1761, 29918, 2272, 29918, 3372, 4097, 29892, 28601, 1125, 13, 1678, 9995, 13, 1678, 3323, 1990, 304, 788, 278, 13033, 1051, 12768, 304, 278, 6996, 421, 16174, 29952, 770, 29889, 13, 13, 1678, 9995, 13, 13, 24933, 287, 1293, 1542, 29889, 12075, 424, 353, 14213, 287, 1293, 12075, 424, 13, 13, 13, 1990, 3617, 2001, 29898, 11746, 1125, 13, 1678, 396, 2823, 1574, 297, 2777, 310, 445, 6461, 470, 740, 1156, 445, 770, 5023, 29889, 13, 1678, 1776, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 1678, 4770, 11030, 1649, 353, 3861, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 921, 29892, 2380, 1125, 13, 4706, 4974, 338, 8758, 29898, 29916, 29889, 1853, 29892, 14213, 287, 1293, 1542, 29897, 13, 4706, 565, 451, 338, 8758, 29898, 2248, 29892, 28736, 1125, 13, 9651, 565, 338, 8758, 29898, 2248, 29892, 22780, 1125, 13, 18884, 2380, 353, 28601, 29898, 29903, 5897, 1542, 3285, 2380, 29897, 13, 18884, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 2380, 1402, 518, 29916, 29889, 1853, 580, 2314, 13, 9651, 1683, 29901, 13, 18884, 2380, 353, 323, 29889, 23362, 29898, 2248, 29892, 29871, 299, 326, 29922, 29900, 29892, 26688, 2433, 524, 29953, 29946, 1495, 13, 18884, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 2380, 1402, 518, 29916, 29889, 698, 668, 580, 2314, 13, 4706, 565, 338, 8758, 29898, 2248, 29889, 1853, 29892, 317, 5897, 1542, 1125, 13, 9651, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 2380, 1402, 518, 29916, 29889, 1853, 580, 2314, 13, 4706, 25342, 338, 8758, 29898, 2248, 29892, 323, 29889, 29911, 6073, 16174, 29897, 322, 2380, 29889, 299, 326, 1275, 29871, 29900, 29901, 13, 9651, 4974, 2380, 29889, 29881, 1853, 1275, 525, 524, 29953, 29946, 29915, 13, 9651, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 2380, 1402, 518, 29916, 29889, 698, 668, 580, 2314, 13, 4706, 1683, 29901, 13, 9651, 12020, 20948, 877, 1252, 6021, 17336, 470, 22780, 408, 2380, 29889, 1495, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 10970, 29892, 14391, 1125, 13, 4706, 313, 29916, 29892, 2380, 29897, 353, 10970, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 565, 451, 338, 8758, 29898, 2248, 29892, 22780, 1125, 13, 9651, 2380, 353, 938, 29898, 2248, 29897, 13, 4706, 714, 29961, 29900, 29962, 353, 921, 29961, 2248, 29962, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 1990, 1649, 17255, 978, 1649, 13, 13, 1678, 822, 274, 29918, 401, 29898, 1311, 29892, 2943, 29892, 1024, 29892, 297, 29886, 29892, 714, 29892, 1014, 1125, 13, 4706, 921, 29918, 978, 29892, 2380, 353, 297, 29886, 29961, 29900, 1402, 297, 29886, 29961, 29896, 29962, 13, 4706, 1962, 29918, 978, 353, 714, 29961, 29900, 29962, 13, 4706, 4418, 353, 1014, 1839, 14057, 2033, 13, 4706, 736, 9995, 13, 4706, 1273, 29898, 4905, 29918, 978, 29897, 29879, 353, 313, 18059, 1273, 29898, 4905, 29918, 978, 29897, 29879, 29897, 10772, 1293, 29918, 2577, 2001, 29898, 313, 19737, 2061, 7528, 1273, 29898, 29916, 29918, 978, 29897, 29879, 29892, 334, 3552, 29876, 2272, 29918, 524, 29953, 29946, 4748, 10772, 2588, 29918, 14573, 29414, 29898, 2248, 29897, 29879, 17884, 13, 4706, 565, 29414, 29898, 4905, 29918, 978, 29897, 29879, 1275, 4265, 2597, 13, 9651, 1273, 29898, 14057, 29897, 29879, 13, 4706, 500, 13, 4706, 10772, 29918, 1177, 22245, 29943, 29414, 29898, 4905, 29918, 978, 29897, 29879, 416, 13, 4706, 9995, 1273, 1180, 1338, 580, 13, 13, 1678, 822, 274, 29918, 401, 29918, 8173, 29918, 3259, 29898, 1311, 1125, 13, 4706, 736, 313, 29896, 29892, 29897, 13, 13, 657, 667, 353, 3617, 2001, 580, 13, 15945, 29908, 13, 2577, 6790, 22780, 310, 263, 13033, 1051, 29889, 13, 13, 11507, 13, 28400, 13, 29916, 13, 1678, 14213, 287, 1051, 29889, 13, 2248, 13, 1678, 450, 2380, 310, 278, 995, 304, 736, 515, 421, 29916, 1412, 13, 13, 15945, 29908, 13, 13, 13, 1990, 22871, 29898, 11746, 1125, 13, 1678, 396, 2823, 1574, 297, 2777, 310, 445, 6461, 1156, 278, 770, 5023, 29889, 13, 1678, 4770, 11030, 1649, 353, 4852, 262, 6689, 613, 29897, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 297, 6689, 29922, 8824, 1125, 13, 4706, 1583, 29889, 262, 6689, 353, 297, 6689, 13, 4706, 565, 1583, 29889, 262, 6689, 29901, 13, 9651, 1583, 29889, 20524, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 9651, 396, 14402, 29901, 1207, 8174, 29918, 13789, 2304, 2534, 8386, 322, 13, 9651, 396, 14416, 1873, 310, 2999, 10970, 29889, 13, 9651, 396, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29896, 12258, 13, 4706, 1683, 29901, 13, 9651, 396, 14402, 29901, 1207, 8174, 29918, 13789, 2304, 2999, 1776, 13, 9651, 396, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 29892, 29871, 29896, 12258, 13, 9651, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 921, 29892, 304, 18277, 1125, 13, 4706, 4974, 338, 8758, 29898, 29916, 29889, 1853, 29892, 14213, 287, 1293, 1542, 29897, 13, 4706, 4974, 921, 29889, 698, 668, 1275, 304, 18277, 29889, 1853, 29892, 313, 29916, 29889, 698, 668, 29892, 304, 18277, 29889, 1853, 29897, 13, 4706, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 304, 18277, 1402, 518, 29916, 29889, 1853, 580, 2314, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 10970, 29892, 14391, 1125, 13, 4706, 313, 29916, 29892, 304, 18277, 29897, 353, 10970, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 565, 451, 1583, 29889, 262, 6689, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 1051, 29898, 29916, 29897, 13, 4706, 1683, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 921, 13, 4706, 396, 817, 304, 3509, 304, 18277, 2861, 304, 8174, 29918, 13789, 29485, 13, 4706, 304, 18277, 353, 903, 2222, 6729, 1717, 29918, 24535, 8552, 29898, 517, 18277, 29897, 13, 4706, 714, 29961, 29900, 1822, 4397, 29898, 517, 18277, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 1990, 1649, 17255, 978, 1649, 13, 13, 1678, 396, 28657, 6181, 29928, 3339, 399, 29923, 14693, 3352, 7495, 16924, 13315, 7495, 315, 4590, 29979, 304, 18277, 2141, 13, 1678, 822, 903, 29883, 29918, 401, 23538, 1311, 29892, 2943, 29892, 1024, 29892, 297, 29886, 29892, 714, 29892, 1014, 1125, 13, 4706, 921, 29918, 978, 29892, 304, 18277, 353, 297, 29886, 29961, 29900, 1402, 297, 29886, 29961, 29896, 29962, 13, 4706, 1962, 29918, 978, 353, 714, 29961, 29900, 29962, 13, 4706, 4418, 353, 1014, 1839, 14057, 2033, 13, 4706, 565, 451, 1583, 29889, 262, 6689, 29901, 13, 9651, 2069, 353, 9995, 13, 9651, 1273, 29898, 4905, 29918, 978, 29897, 29879, 353, 313, 19737, 1293, 2061, 7528, 10772, 1293, 29918, 2577, 29903, 5897, 3552, 19737, 2061, 7528, 1273, 29898, 29916, 29918, 978, 29897, 29879, 29892, 29871, 29900, 29892, 10772, 1293, 29918, 7194, 29918, 14226, 3552, 19737, 2061, 7528, 1273, 29898, 29916, 29918, 978, 29897, 29879, 876, 2056, 13, 9651, 9995, 1273, 1180, 1338, 580, 13, 4706, 1683, 29901, 13, 9651, 2069, 353, 9995, 13, 9651, 1273, 29898, 4905, 29918, 978, 29897, 29879, 353, 29871, 1273, 29898, 29916, 29918, 978, 29897, 29879, 29936, 13, 9651, 9995, 1273, 1180, 1338, 580, 13, 4706, 736, 2069, 718, 9995, 13, 4706, 565, 29414, 29898, 4905, 29918, 978, 29897, 29879, 1360, 10074, 2597, 13, 18884, 1273, 29898, 14057, 29897, 29879, 13, 4706, 3980, 13, 4706, 565, 29898, 19737, 1293, 29918, 18277, 29898, 313, 19737, 2061, 7528, 1273, 29898, 4905, 29918, 978, 29897, 29879, 22657, 19737, 2061, 7528, 1273, 29898, 517, 18277, 29897, 29879, 18840, 13, 9651, 1273, 29898, 14057, 29897, 29879, 13, 4706, 3980, 13, 4706, 10772, 29918, 1177, 22245, 29943, 29414, 29898, 4905, 29918, 978, 29897, 29879, 416, 13, 4706, 9995, 1273, 1180, 1338, 580, 13, 13, 1678, 822, 274, 29918, 401, 29918, 8173, 29918, 3259, 29898, 1311, 1125, 13, 4706, 736, 313, 29896, 29892, 29897, 13, 13, 4397, 353, 22871, 580, 13, 15945, 29908, 13, 18277, 385, 1543, 472, 278, 1095, 310, 1790, 1051, 29889, 13, 13, 11507, 13, 28400, 13, 29916, 13, 1678, 450, 2967, 13033, 1051, 29889, 13, 29891, 13, 1678, 450, 1543, 304, 9773, 304, 421, 29916, 1412, 13, 13, 15945, 29908, 13, 13, 13, 1990, 7338, 355, 29898, 11746, 1125, 13, 1678, 396, 2823, 1574, 297, 2777, 310, 445, 6461, 1156, 278, 770, 5023, 29889, 13, 1678, 4770, 11030, 1649, 353, 4852, 262, 6689, 613, 29897, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 297, 6689, 29922, 8824, 1125, 13, 4706, 1583, 29889, 262, 6689, 353, 297, 6689, 13, 4706, 565, 1583, 29889, 262, 6689, 29901, 13, 9651, 1583, 29889, 20524, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 9651, 396, 14402, 29901, 1207, 8174, 29918, 13789, 2304, 2534, 8386, 322, 13, 9651, 396, 14416, 1873, 310, 2999, 10970, 29889, 13, 9651, 396, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29896, 12258, 13, 4706, 1683, 29901, 13, 9651, 396, 14402, 29901, 1207, 8174, 29918, 13789, 2304, 2999, 1776, 13, 9651, 396, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 29892, 29871, 29896, 12258, 13, 9651, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 921, 29892, 304, 18277, 1125, 13, 4706, 4974, 338, 8758, 29898, 29916, 29889, 1853, 29892, 14213, 287, 1293, 1542, 29897, 13, 4706, 4974, 921, 29889, 1853, 1275, 304, 18277, 29889, 1853, 13, 4706, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 304, 18277, 1402, 518, 29916, 29889, 1853, 580, 2314, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 10970, 29892, 14391, 1125, 13, 4706, 313, 29916, 29892, 304, 18277, 29897, 353, 10970, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 565, 451, 1583, 29889, 262, 6689, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 1051, 29898, 29916, 29897, 13, 4706, 1683, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 921, 13, 4706, 396, 817, 304, 3509, 304, 18277, 2861, 304, 8174, 29918, 13789, 29485, 13, 4706, 565, 304, 18277, 29901, 13, 9651, 288, 353, 714, 29961, 29900, 29962, 13, 9651, 363, 474, 297, 304, 18277, 29901, 13, 18884, 288, 29889, 4397, 7373, 2222, 6729, 1717, 29918, 24535, 8552, 29898, 29875, 876, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 1990, 1649, 17255, 978, 1649, 13, 13, 1678, 396, 28657, 6181, 29928, 3339, 399, 29923, 14693, 3352, 7495, 16924, 13315, 7495, 315, 4590, 29979, 304, 18277, 2141, 13, 1678, 822, 903, 29883, 29918, 401, 23538, 1311, 29892, 2943, 29892, 1024, 29892, 297, 29886, 29892, 714, 29892, 1014, 1125, 13, 4706, 921, 29918, 978, 29892, 304, 18277, 353, 297, 29886, 29961, 29900, 1402, 297, 29886, 29961, 29896, 29962, 13, 4706, 1962, 29918, 978, 353, 714, 29961, 29900, 29962, 13, 4706, 4418, 353, 1014, 1839, 14057, 2033, 13, 4706, 565, 451, 1583, 29889, 262, 6689, 29901, 13, 9651, 2069, 353, 9995, 13, 9651, 1273, 29898, 4905, 29918, 978, 29897, 29879, 353, 313, 19737, 1293, 2061, 7528, 10772, 1293, 29918, 2577, 29903, 5897, 3552, 19737, 2061, 7528, 1273, 29898, 29916, 29918, 978, 29897, 29879, 29892, 29871, 29900, 29892, 10772, 1293, 29918, 7194, 29918, 14226, 3552, 19737, 2061, 7528, 1273, 29898, 29916, 29918, 978, 29897, 29879, 876, 2056, 13, 9651, 9995, 1273, 1180, 1338, 580, 13, 4706, 1683, 29901, 13, 9651, 2069, 353, 9995, 13, 9651, 1273, 29898, 4905, 29918, 978, 29897, 29879, 353, 29871, 1273, 29898, 29916, 29918, 978, 29897, 29879, 29936, 13, 9651, 9995, 1273, 1180, 1338, 580, 13, 4706, 736, 2069, 718, 9995, 13, 4706, 938, 474, 353, 29900, 29936, 13, 4706, 938, 3309, 353, 10772, 1293, 29918, 7194, 29918, 14226, 3552, 19737, 2061, 7528, 1273, 29898, 517, 18277, 29897, 29879, 416, 13, 4706, 565, 29414, 29898, 4905, 29918, 978, 29897, 29879, 1360, 10074, 2597, 13, 18884, 1273, 29898, 14057, 29897, 29879, 13, 4706, 3980, 13, 4706, 363, 29898, 29875, 29936, 474, 529, 3309, 29936, 474, 16284, 13, 9651, 565, 29898, 19737, 1293, 29918, 18277, 29898, 313, 19737, 2061, 7528, 1273, 29898, 4905, 29918, 978, 29897, 29879, 22657, 19737, 2061, 7528, 10772, 1293, 29918, 2577, 2001, 3552, 19737, 2061, 7528, 1273, 29898, 517, 18277, 29897, 29879, 29892, 29875, 876, 1360, 29899, 29896, 2597, 13, 18884, 1273, 29898, 14057, 29897, 29879, 13, 9651, 3980, 13, 4706, 500, 13, 4706, 10772, 29918, 1177, 22245, 29943, 29414, 29898, 4905, 29918, 978, 29897, 29879, 416, 13, 4706, 9995, 1273, 1180, 1338, 580, 13, 13, 1678, 822, 274, 29918, 401, 29918, 8173, 29918, 3259, 23538, 1311, 1125, 13, 4706, 736, 313, 29896, 29892, 29897, 13, 13, 21843, 353, 7338, 355, 580, 13, 15945, 29908, 13, 18277, 599, 3161, 310, 263, 1051, 472, 278, 1095, 310, 1790, 1051, 29889, 13, 13, 11507, 13, 28400, 13, 29916, 13, 1678, 450, 13033, 1051, 304, 10985, 29889, 13, 517, 18277, 13, 1678, 450, 13033, 1051, 393, 674, 367, 2715, 472, 278, 1095, 310, 421, 29916, 1412, 13, 13, 15945, 29908, 13, 13, 13, 1990, 24505, 29898, 11746, 1125, 13, 1678, 396, 2823, 1574, 297, 2777, 310, 445, 6461, 1156, 278, 770, 5023, 29889, 13, 1678, 4770, 11030, 1649, 353, 4852, 262, 6689, 613, 29897, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 297, 6689, 29922, 8824, 1125, 13, 4706, 1583, 29889, 262, 6689, 353, 297, 6689, 13, 4706, 565, 1583, 29889, 262, 6689, 29901, 13, 9651, 1583, 29889, 20524, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 9651, 396, 14402, 29901, 1207, 8174, 29918, 13789, 2304, 2534, 8386, 322, 13, 9651, 396, 14416, 1873, 310, 2999, 10970, 29889, 13, 9651, 396, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29906, 12258, 13, 4706, 1683, 29901, 13, 9651, 396, 14402, 29901, 1207, 8174, 29918, 13789, 2304, 2999, 1776, 13, 9651, 396, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 29892, 29871, 29906, 12258, 13, 9651, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 921, 29892, 2380, 29892, 304, 17491, 1125, 13, 4706, 4974, 338, 8758, 29898, 29916, 29889, 1853, 29892, 14213, 287, 1293, 1542, 29897, 13, 4706, 4974, 921, 29889, 698, 668, 1275, 304, 17491, 29889, 1853, 13, 4706, 565, 451, 338, 8758, 29898, 2248, 29892, 28736, 1125, 13, 9651, 2380, 353, 323, 29889, 23362, 29898, 2248, 29892, 29871, 299, 326, 29922, 29900, 29892, 26688, 2433, 524, 29953, 29946, 1495, 13, 4706, 1683, 29901, 13, 9651, 4974, 2380, 29889, 29881, 1853, 1275, 525, 524, 29953, 29946, 29915, 13, 9651, 4974, 338, 8758, 29898, 2248, 29892, 323, 29889, 29911, 6073, 16174, 29897, 322, 2380, 29889, 299, 326, 1275, 29871, 29900, 13, 4706, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 2380, 29892, 304, 17491, 1402, 518, 29916, 29889, 1853, 580, 2314, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 10970, 29892, 14391, 1125, 13, 4706, 313, 29916, 29892, 2380, 29892, 304, 17491, 29897, 353, 10970, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 565, 451, 1583, 29889, 262, 6689, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 1051, 29898, 29916, 29897, 13, 4706, 1683, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 921, 13, 4706, 396, 817, 304, 3509, 304, 18277, 2861, 304, 8174, 29918, 13789, 29485, 13, 4706, 304, 17491, 353, 903, 2222, 6729, 1717, 29918, 24535, 8552, 29898, 517, 17491, 29897, 13, 4706, 714, 29961, 29900, 1822, 7851, 29898, 2248, 29892, 304, 17491, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 1990, 1649, 17255, 978, 1649, 13, 13, 1678, 396, 28657, 6181, 29928, 3339, 399, 29923, 14693, 3352, 7495, 16924, 13315, 7495, 315, 4590, 29979, 304, 18277, 2141, 13, 1678, 822, 903, 29883, 29918, 401, 23538, 1311, 29892, 2943, 29892, 1024, 29892, 297, 29886, 29892, 714, 29892, 1014, 1125, 13, 4706, 921, 29918, 978, 29892, 2380, 29892, 304, 17491, 353, 297, 29886, 29961, 29900, 1402, 297, 29886, 29961, 29896, 1402, 297, 29886, 29961, 29906, 29962, 13, 4706, 1962, 29918, 978, 353, 714, 29961, 29900, 29962, 13, 4706, 4418, 353, 1014, 1839, 14057, 2033, 13, 4706, 565, 451, 1583, 29889, 262, 6689, 29901, 13, 9651, 2069, 353, 9995, 13, 9651, 1273, 29898, 4905, 29918, 978, 29897, 29879, 353, 313, 19737, 1293, 2061, 7528, 10772, 1293, 29918, 2577, 29903, 5897, 3552, 19737, 2061, 7528, 1273, 29898, 29916, 29918, 978, 29897, 29879, 29892, 29871, 29900, 29892, 10772, 1293, 29918, 7194, 29918, 14226, 3552, 19737, 2061, 7528, 1273, 29898, 29916, 29918, 978, 29897, 29879, 876, 2056, 13, 9651, 9995, 1273, 1180, 1338, 580, 13, 4706, 1683, 29901, 13, 9651, 2069, 353, 9995, 13, 9651, 1273, 29898, 4905, 29918, 978, 29897, 29879, 353, 29871, 1273, 29898, 29916, 29918, 978, 29897, 29879, 29936, 13, 9651, 9995, 1273, 1180, 1338, 580, 13, 4706, 736, 2069, 718, 9995, 13, 4706, 565, 29414, 29898, 4905, 29918, 978, 29897, 29879, 1360, 10074, 2597, 13, 18884, 1273, 29898, 14057, 29897, 29879, 13, 4706, 3980, 13, 4706, 565, 29898, 19737, 1293, 29918, 17491, 3552, 19737, 2061, 7528, 1273, 29898, 4905, 29918, 978, 29897, 29879, 29892, 334, 3552, 29876, 2272, 29918, 524, 29953, 29946, 4748, 10772, 2588, 29918, 14573, 29414, 29898, 2248, 29897, 29879, 8243, 313, 19737, 2061, 7528, 1273, 29898, 517, 17491, 29897, 29879, 29897, 1360, 29899, 29896, 2597, 13, 9651, 1273, 29898, 14057, 29897, 29879, 13, 4706, 3980, 13, 4706, 10772, 29918, 1177, 22245, 29943, 29414, 29898, 4905, 29918, 978, 29897, 29879, 416, 13, 4706, 9995, 1273, 1180, 1338, 580, 13, 13, 1678, 822, 274, 29918, 401, 29918, 8173, 29918, 3259, 29898, 1311, 1125, 13, 4706, 736, 313, 29896, 29892, 29897, 13, 13, 7851, 353, 24505, 580, 13, 15945, 29908, 13, 17491, 385, 1543, 472, 385, 2380, 297, 263, 13033, 1051, 29889, 13, 13, 11507, 13, 28400, 13, 29916, 13, 1678, 450, 13033, 1051, 304, 6623, 29889, 13, 2248, 13, 1678, 450, 2380, 988, 304, 1925, 278, 716, 1543, 297, 421, 29916, 1412, 13, 517, 17491, 13, 1678, 450, 716, 1543, 304, 4635, 29889, 13, 13, 15945, 29908, 13, 13, 13, 1990, 15154, 29898, 11746, 1125, 13, 1678, 396, 2823, 1574, 297, 2777, 310, 445, 6461, 1156, 278, 770, 5023, 29889, 13, 1678, 4770, 11030, 1649, 353, 4852, 262, 6689, 613, 29897, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 297, 6689, 29922, 8824, 1125, 13, 4706, 1583, 29889, 262, 6689, 353, 297, 6689, 13, 4706, 565, 1583, 29889, 262, 6689, 29901, 13, 9651, 1583, 29889, 20524, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 921, 29892, 304, 15941, 1125, 13, 4706, 4974, 338, 8758, 29898, 29916, 29889, 1853, 29892, 14213, 287, 1293, 1542, 29897, 13, 4706, 4974, 921, 29889, 698, 668, 1275, 304, 15941, 29889, 1853, 13, 4706, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 304, 15941, 1402, 518, 29916, 29889, 1853, 580, 2314, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 10970, 29892, 14391, 1125, 13, 4706, 313, 29916, 29892, 304, 15941, 29897, 353, 10970, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 565, 451, 1583, 29889, 262, 6689, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 1051, 29898, 29916, 29897, 13, 4706, 1683, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 921, 13, 13, 4706, 9995, 13, 4706, 306, 484, 1397, 424, 14725, 363, 7865, 2392, 29901, 450, 8760, 995, 310, 385, 13, 4706, 1409, 411, 901, 1135, 697, 1543, 338, 22363, 681, 29889, 4803, 263, 29889, 1384, 580, 470, 263, 29889, 497, 580, 13, 4706, 1641, 12005, 746, 1811, 304, 3349, 263, 4636, 515, 263, 13516, 1051, 29889, 13, 4706, 9995, 13, 4706, 363, 343, 297, 3464, 29898, 449, 29961, 29900, 1822, 1649, 2435, 1649, 580, 1125, 13, 18884, 565, 2943, 29889, 2080, 29879, 29961, 29900, 1822, 698, 668, 29889, 5975, 29918, 1837, 29898, 449, 29961, 29900, 3816, 29891, 1402, 304, 15941, 1125, 13, 462, 1678, 628, 714, 29961, 29900, 3816, 29891, 29962, 13, 462, 1678, 2867, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 1990, 1649, 17255, 978, 1649, 13, 13, 5992, 353, 15154, 580, 13, 15945, 29908, 15941, 385, 1543, 515, 263, 13033, 1051, 29889, 13, 13, 11507, 13, 28400, 13, 29916, 13, 1678, 450, 13033, 1051, 304, 367, 3939, 29889, 13, 517, 15941, 13, 1678, 530, 1543, 304, 367, 6206, 515, 278, 13033, 1051, 29889, 13, 1678, 1334, 871, 3349, 278, 937, 2777, 29889, 13, 13, 3664, 267, 13, 23648, 13, 11980, 5314, 310, 3349, 1838, 29915, 29873, 664, 746, 591, 864, 304, 3349, 385, 29871, 299, 2378, 13, 3166, 263, 1051, 29889, 910, 5314, 1736, 297, 393, 1206, 29889, 13, 13, 15945, 29908, 13, 13, 13, 1990, 830, 3901, 29898, 11746, 1125, 13, 1678, 396, 2823, 1574, 297, 2777, 310, 445, 6461, 1156, 278, 770, 5023, 29889, 13, 1678, 4770, 11030, 1649, 353, 4852, 262, 6689, 613, 29897, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 297, 6689, 29922, 8824, 1125, 13, 4706, 1583, 29889, 262, 6689, 353, 297, 6689, 13, 4706, 565, 1583, 29889, 262, 6689, 29901, 13, 9651, 1583, 29889, 20524, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 1493, 29918, 1958, 353, 426, 29900, 29901, 518, 29900, 12258, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 921, 1125, 13, 4706, 4974, 338, 8758, 29898, 29916, 29889, 1853, 29892, 14213, 287, 1293, 1542, 29897, 13, 4706, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 1402, 518, 29916, 29889, 1853, 580, 2314, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 297, 29886, 29892, 14391, 1125, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 565, 451, 1583, 29889, 262, 6689, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 1051, 29898, 262, 29886, 29961, 29900, 2314, 13, 4706, 1683, 29901, 13, 9651, 714, 29961, 29900, 29962, 353, 297, 29886, 29961, 29900, 29962, 13, 4706, 714, 29961, 29900, 1822, 24244, 580, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 1990, 1649, 17255, 978, 1649, 13, 13, 1678, 822, 274, 29918, 401, 29898, 1311, 29892, 2943, 29892, 1024, 29892, 297, 29886, 29892, 714, 29892, 1014, 1125, 13, 4706, 921, 29918, 978, 353, 297, 29886, 29961, 29900, 29962, 13, 4706, 1962, 29918, 978, 353, 714, 29961, 29900, 29962, 13, 4706, 4418, 353, 1014, 1839, 14057, 2033, 13, 4706, 565, 451, 1583, 29889, 262, 6689, 29901, 13, 9651, 2069, 353, 9995, 13, 9651, 1273, 29898, 4905, 29918, 978, 29897, 29879, 353, 313, 19737, 1293, 2061, 7528, 10772, 1293, 29918, 2577, 29903, 5897, 3552, 19737, 2061, 7528, 1273, 29898, 29916, 29918, 978, 29897, 29879, 29892, 29871, 29900, 29892, 10772, 1293, 29918, 7194, 29918, 14226, 3552, 19737, 2061, 7528, 1273, 29898, 29916, 29918, 978, 29897, 29879, 876, 2056, 13, 9651, 9995, 1273, 1180, 1338, 580, 13, 4706, 1683, 29901, 13, 9651, 2069, 353, 9995, 13, 9651, 1273, 29898, 4905, 29918, 978, 29897, 29879, 353, 29871, 1273, 29898, 29916, 29918, 978, 29897, 29879, 29936, 13, 9651, 9995, 1273, 1180, 1338, 580, 13, 4706, 736, 2069, 718, 9995, 13, 4706, 565, 29414, 29898, 4905, 29918, 978, 29897, 29879, 1360, 10074, 2597, 13, 18884, 1273, 29898, 14057, 29897, 29879, 13, 4706, 3980, 13, 4706, 565, 29898, 19737, 1293, 29918, 1123, 3901, 3552, 19737, 2061, 7528, 1273, 29898, 4905, 29918, 978, 29897, 29879, 29897, 1360, 29899, 29896, 2597, 13, 9651, 1273, 29898, 14057, 29897, 29879, 13, 4706, 3980, 13, 4706, 10772, 29918, 1177, 22245, 29943, 29414, 29898, 4905, 29918, 978, 29897, 29879, 416, 13, 4706, 9995, 1273, 1180, 1338, 580, 13, 13, 1678, 822, 274, 29918, 401, 29918, 8173, 29918, 3259, 29898, 1311, 1125, 13, 4706, 736, 313, 29896, 29892, 29897, 13, 13, 24244, 353, 830, 3901, 580, 13, 15945, 29908, 13, 1123, 3901, 278, 1797, 310, 263, 13033, 1051, 29889, 13, 13, 11507, 13, 28400, 13, 29916, 13, 1678, 450, 13033, 1051, 304, 367, 18764, 287, 29889, 13, 13, 15945, 29908, 13, 13, 13, 1990, 11374, 29898, 11746, 1125, 13, 1678, 396, 2823, 1574, 297, 2777, 310, 445, 6461, 1156, 278, 770, 5023, 29889, 13, 1678, 4770, 11030, 1649, 353, 3861, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 921, 29892, 21268, 1125, 13, 4706, 4974, 338, 8758, 29898, 29916, 29889, 1853, 29892, 14213, 287, 1293, 1542, 29897, 13, 4706, 4974, 921, 29889, 698, 668, 1275, 21268, 29889, 1853, 13, 4706, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 21268, 1402, 518, 29911, 29889, 19529, 279, 580, 2314, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 10970, 29892, 14391, 1125, 13, 4706, 9995, 13, 4706, 306, 484, 1397, 424, 14725, 363, 7865, 2392, 29901, 450, 8760, 995, 310, 385, 13, 4706, 1409, 411, 901, 1135, 697, 1543, 338, 22363, 681, 29889, 4803, 263, 29889, 1384, 580, 470, 263, 29889, 497, 580, 13, 4706, 1641, 12005, 746, 1811, 304, 3349, 263, 4636, 515, 263, 13516, 1051, 13, 4706, 9995, 13, 4706, 313, 29916, 29892, 21268, 29897, 353, 10970, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 363, 343, 297, 3464, 29898, 2435, 29898, 29916, 22164, 13, 9651, 565, 2943, 29889, 2080, 29879, 29961, 29900, 1822, 698, 668, 29889, 5975, 29918, 1837, 29898, 29916, 29961, 29891, 1402, 21268, 1125, 13, 18884, 714, 29961, 29900, 29962, 353, 12655, 29889, 294, 2378, 29898, 29891, 29892, 26688, 29922, 1552, 1562, 29889, 2917, 29889, 7411, 29990, 29897, 13, 18884, 2867, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 1990, 1649, 17255, 978, 1649, 13, 13, 2248, 29918, 353, 11374, 580, 13, 13, 13, 1990, 3917, 29898, 11746, 1125, 13, 1678, 396, 2823, 1574, 297, 2777, 310, 445, 6461, 1156, 278, 770, 5023, 29889, 13, 1678, 4770, 11030, 1649, 353, 3861, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 921, 29892, 21268, 1125, 13, 4706, 4974, 338, 8758, 29898, 29916, 29889, 1853, 29892, 14213, 287, 1293, 1542, 29897, 13, 4706, 4974, 921, 29889, 698, 668, 1275, 21268, 29889, 1853, 13, 4706, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 29892, 21268, 1402, 518, 29911, 29889, 19529, 279, 580, 2314, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 10970, 29892, 14391, 1125, 13, 4706, 9995, 13, 4706, 306, 484, 1397, 424, 14725, 363, 7865, 2392, 29901, 450, 8760, 995, 310, 385, 13, 4706, 1409, 411, 901, 1135, 697, 1543, 338, 22363, 681, 29889, 4803, 263, 29889, 1384, 580, 470, 263, 29889, 497, 580, 13, 4706, 1641, 12005, 746, 1811, 304, 3349, 263, 4636, 515, 263, 13516, 1051, 13, 4706, 9995, 13, 4706, 313, 29916, 29892, 21268, 29897, 353, 10970, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 714, 29961, 29900, 29962, 353, 29871, 29900, 13, 4706, 363, 343, 297, 3464, 29898, 2435, 29898, 29916, 22164, 13, 9651, 565, 2943, 29889, 2080, 29879, 29961, 29900, 1822, 698, 668, 29889, 5975, 29918, 1837, 29898, 29916, 29961, 29891, 1402, 21268, 1125, 13, 18884, 714, 29961, 29900, 29962, 4619, 29871, 29896, 13, 4706, 714, 29961, 29900, 29962, 353, 12655, 29889, 294, 2378, 29898, 449, 29961, 29900, 1402, 26688, 29922, 1552, 1562, 29889, 2917, 29889, 7411, 29990, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 1990, 1649, 17255, 978, 1649, 13, 13, 2798, 353, 3917, 580, 13, 15945, 29908, 13, 3981, 278, 1353, 310, 3064, 385, 1543, 338, 297, 278, 13033, 1051, 29889, 13, 13, 11507, 13, 28400, 13, 29916, 13, 1678, 450, 13033, 1051, 304, 1106, 964, 29889, 13, 20461, 13, 1678, 450, 1543, 591, 864, 304, 2302, 297, 1051, 29889, 13, 1678, 450, 3161, 526, 9401, 411, 15743, 29889, 13, 13, 3664, 267, 13, 23648, 13, 11980, 5314, 310, 2302, 1838, 29915, 29873, 664, 746, 591, 864, 304, 2302, 385, 29871, 299, 2378, 13, 3166, 263, 1051, 29889, 910, 5314, 1736, 297, 393, 1206, 29889, 13, 13, 15945, 29908, 13, 13, 13, 1990, 365, 1477, 29898, 11746, 1125, 13, 1678, 396, 2823, 1574, 297, 2777, 310, 445, 6461, 1156, 278, 770, 5023, 29889, 13, 1678, 4770, 11030, 1649, 353, 3861, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 921, 1125, 13, 4706, 4974, 338, 8758, 29898, 29916, 29889, 1853, 29892, 14213, 287, 1293, 1542, 29897, 13, 4706, 736, 2401, 368, 29898, 1311, 29892, 518, 29916, 1402, 518, 29911, 29889, 19529, 279, 29898, 29881, 1853, 2433, 524, 29953, 29946, 1495, 2314, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 921, 29892, 14391, 1125, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 714, 29961, 29900, 29962, 353, 12655, 29889, 294, 2378, 29898, 2435, 29898, 29916, 29961, 29900, 11724, 525, 524, 29953, 29946, 1495, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 1990, 1649, 17255, 978, 1649, 13, 13, 1678, 822, 274, 29918, 401, 29898, 1311, 29892, 2943, 29892, 1024, 29892, 297, 29886, 29892, 714, 29892, 1014, 1125, 13, 4706, 921, 29918, 978, 353, 297, 29886, 29961, 29900, 29962, 13, 4706, 1962, 29918, 978, 353, 714, 29961, 29900, 29962, 13, 4706, 4418, 353, 1014, 1839, 14057, 2033, 13, 4706, 736, 9995, 13, 4706, 565, 11864, 29995, 29898, 4905, 29918, 978, 29897, 29879, 29897, 13, 9651, 1273, 29898, 4905, 29918, 978, 29897, 29879, 7607, 19737, 2588, 2061, 7528, 19737, 2588, 29918, 29923, 3580, 15631, 29898, 29900, 29892, 4265, 29892, 405, 20055, 29918, 10192, 29953, 29946, 29892, 29871, 29900, 416, 13, 4706, 5135, 29876, 2272, 29918, 524, 29953, 29946, 7528, 19737, 2588, 29918, 14573, 29414, 29898, 4905, 29918, 978, 29897, 29879, 876, 29961, 29900, 13192, 19737, 1293, 29918, 3505, 3552, 19737, 2061, 7528, 29995, 29898, 29916, 29918, 978, 29897, 29879, 416, 13, 4706, 10772, 29918, 1177, 22245, 29943, 29414, 29898, 4905, 29918, 978, 29897, 29879, 416, 13, 4706, 9995, 1273, 1180, 1338, 580, 13, 13, 1678, 822, 274, 29918, 401, 29918, 8173, 29918, 3259, 29898, 1311, 1125, 13, 4706, 736, 313, 29896, 29892, 29897, 13, 13, 2848, 353, 365, 1477, 580, 13, 15945, 29908, 13, 11609, 29879, 278, 2159, 310, 263, 1051, 29889, 13, 13, 11507, 13, 28400, 13, 29916, 13, 1678, 14213, 287, 1051, 29889, 13, 13, 15945, 29908, 13, 13, 13, 1990, 8561, 1293, 29898, 11746, 1125, 13, 1678, 4770, 11030, 1649, 353, 3861, 13, 13, 1678, 822, 1207, 29918, 3177, 29898, 1311, 29892, 263, 1125, 13, 4706, 4974, 338, 8758, 29898, 29874, 29892, 313, 23583, 29892, 1051, 876, 13, 4706, 263, 29906, 353, 5159, 13, 4706, 363, 21268, 297, 263, 29901, 13, 9651, 565, 451, 338, 8758, 29898, 20461, 29892, 278, 1562, 29889, 29887, 974, 29889, 16174, 1125, 13, 18884, 21268, 353, 278, 1562, 29889, 20158, 29889, 294, 29918, 20158, 29918, 11918, 29898, 20461, 29897, 13, 9651, 263, 29906, 29889, 4397, 29898, 20461, 29897, 13, 4706, 565, 451, 599, 29898, 29874, 29906, 29961, 29900, 1822, 1853, 1275, 21268, 29889, 1853, 363, 21268, 297, 263, 29906, 1125, 13, 9651, 12020, 20948, 29898, 13, 18884, 376, 9984, 1293, 817, 599, 1881, 2286, 304, 367, 310, 278, 1021, 1134, 23157, 13, 4706, 260, 29880, 353, 278, 1562, 29889, 1017, 9795, 29918, 1761, 29889, 24933, 287, 1293, 1542, 29898, 29874, 29906, 29961, 29900, 1822, 1853, 29897, 580, 13, 13, 4706, 736, 2401, 368, 29898, 1311, 29892, 263, 29906, 29892, 518, 15206, 2314, 13, 13, 1678, 822, 2189, 29898, 1311, 29892, 2943, 29892, 10970, 29892, 14391, 1125, 13, 4706, 313, 449, 29892, 29897, 353, 14391, 13, 4706, 396, 1334, 817, 304, 1207, 1854, 393, 591, 1016, 29915, 29873, 679, 263, 1776, 373, 1749, 10970, 13, 4706, 714, 29961, 29900, 29962, 353, 23160, 2222, 6729, 1717, 29918, 24535, 8552, 29898, 262, 29886, 29897, 363, 297, 29886, 297, 10970, 29962, 13, 13, 5675, 29918, 1761, 353, 8561, 1293, 580, 13, 15945, 29908, 13, 8893, 263, 5132, 1051, 515, 1906, 450, 1562, 2286, 29889, 13, 13, 11507, 13, 28400, 13, 29874, 584, 18761, 29914, 1761, 310, 450, 1562, 2286, 13, 13, 3664, 267, 13, 23648, 13, 3596, 450, 1562, 3651, 1818, 505, 278, 1021, 1134, 29889, 13, 13, 15945, 29908, 13, 2 ]
sauronlab/core/__init__.py
dmyersturnbull/sauronlab
0
193689
""" Contains the lowest-level code in Sauronlab. This package cannot not depend on any other packages in Sauronlab. """ from __future__ import annotations import time from datetime import datetime from pathlib import Path from loguru import logger # noinspection PyProtectedMember from loguru._logger import Logger from pocketutils.misc.fancy_loguru import FancyLoguru, FancyLoguruDefaults from sauronlab import version as sauronlab_version def _notice(__message: str, *args, **kwargs) -> None: logger.log("NOTICE", __message, *args, **kwargs) def _caution(__message: str, *args, **kwargs): logger.log("CAUTION", __message, *args, **kwargs) class MyLogger(Logger): """ A wrapper that has fake methods to trick static analysis. """ def notice(self, __message: str, *args, **kwargs): raise NotImplementedError() # not real def caution(self, __message: str, *args, **kwargs): raise NotImplementedError() # not real class SauronlabResources: """ """ @classmethod def path(cls, *parts) -> Path: return Path(Path(__file__).parent.parent, "resources", *parts) @classmethod def text(cls, *parts) -> str: return SauronlabResources.path(*parts).read_text(encoding="utf8") @classmethod def binary(cls, *parts) -> bytes: return SauronlabResources.path(*parts).read_bytes() # WEIRD AS HELL, but it works # noinspection PyTypeChecker logger: MyLogger = logger logger.notice = _notice logger.caution = _caution log_setup = FancyLoguru(logger).config_levels(colors=FancyLoguruDefaults.colors_red_green_safe) sauronlab_start_time = datetime.now() sauronlab_start_clock = time.monotonic() __all__ = [ "sauronlab_version", "sauronlab_start_time", "sauronlab_start_clock", "log_setup", "SauronlabResources", "logger", ]
[ 1, 9995, 13, 21409, 278, 19604, 29899, 5563, 775, 297, 5701, 332, 265, 8205, 29889, 13, 4013, 3577, 2609, 451, 8839, 373, 738, 916, 9741, 297, 5701, 332, 265, 8205, 29889, 13, 15945, 29908, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 25495, 13, 13, 5215, 931, 13, 3166, 12865, 1053, 12865, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 3166, 1480, 20144, 1053, 17927, 13, 13, 29937, 694, 1144, 27988, 10772, 1184, 371, 2954, 13404, 13, 3166, 1480, 20144, 3032, 21707, 1053, 28468, 13, 3166, 24589, 13239, 29889, 29885, 10669, 29889, 29888, 6906, 29918, 1188, 20144, 1053, 383, 6906, 3403, 20144, 29892, 383, 6906, 3403, 20144, 24863, 13, 13, 3166, 872, 332, 265, 8205, 1053, 1873, 408, 872, 332, 265, 8205, 29918, 3259, 13, 13, 13, 1753, 903, 1333, 625, 22168, 4906, 29901, 851, 29892, 334, 5085, 29892, 3579, 19290, 29897, 1599, 6213, 29901, 13, 1678, 17927, 29889, 1188, 703, 12256, 12107, 613, 4770, 4906, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 13, 13, 1753, 903, 1113, 918, 22168, 4906, 29901, 851, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 1678, 17927, 29889, 1188, 703, 5454, 2692, 2725, 613, 4770, 4906, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 13, 13, 1990, 1619, 16363, 29898, 16363, 1125, 13, 1678, 9995, 13, 1678, 319, 14476, 393, 756, 25713, 3519, 304, 8938, 2294, 7418, 29889, 13, 1678, 9995, 13, 13, 1678, 822, 8369, 29898, 1311, 29892, 4770, 4906, 29901, 851, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 580, 29871, 396, 451, 1855, 13, 13, 1678, 822, 5777, 918, 29898, 1311, 29892, 4770, 4906, 29901, 851, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 580, 29871, 396, 451, 1855, 13, 13, 13, 1990, 5701, 332, 265, 8205, 13770, 29901, 13, 1678, 9995, 9995, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 2224, 29898, 25932, 29892, 334, 20895, 29897, 1599, 10802, 29901, 13, 4706, 736, 10802, 29898, 2605, 22168, 1445, 1649, 467, 3560, 29889, 3560, 29892, 376, 13237, 613, 334, 20895, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 1426, 29898, 25932, 29892, 334, 20895, 29897, 1599, 851, 29901, 13, 4706, 736, 5701, 332, 265, 8205, 13770, 29889, 2084, 10456, 20895, 467, 949, 29918, 726, 29898, 22331, 543, 9420, 29947, 1159, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 7581, 29898, 25932, 29892, 334, 20895, 29897, 1599, 6262, 29901, 13, 4706, 736, 5701, 332, 265, 8205, 13770, 29889, 2084, 10456, 20895, 467, 949, 29918, 13193, 580, 13, 13, 13, 29937, 399, 29923, 8193, 29928, 3339, 17714, 2208, 29892, 541, 372, 1736, 13, 29937, 694, 1144, 27988, 10772, 1542, 5596, 261, 13, 21707, 29901, 1619, 16363, 353, 17927, 13, 21707, 29889, 1333, 625, 353, 903, 1333, 625, 13, 21707, 29889, 1113, 918, 353, 903, 1113, 918, 13, 1188, 29918, 14669, 353, 383, 6906, 3403, 20144, 29898, 21707, 467, 2917, 29918, 5563, 29879, 29898, 27703, 29922, 29943, 6906, 3403, 20144, 24863, 29889, 27703, 29918, 1127, 29918, 12692, 29918, 11177, 29897, 13, 13, 4977, 332, 265, 8205, 29918, 2962, 29918, 2230, 353, 12865, 29889, 3707, 580, 13, 4977, 332, 265, 8205, 29918, 2962, 29918, 13058, 353, 931, 29889, 3712, 327, 8927, 580, 13, 13, 13, 1649, 497, 1649, 353, 518, 13, 1678, 376, 4977, 332, 265, 8205, 29918, 3259, 613, 13, 1678, 376, 4977, 332, 265, 8205, 29918, 2962, 29918, 2230, 613, 13, 1678, 376, 4977, 332, 265, 8205, 29918, 2962, 29918, 13058, 613, 13, 1678, 376, 1188, 29918, 14669, 613, 13, 1678, 376, 29903, 6698, 265, 8205, 13770, 613, 13, 1678, 376, 21707, 613, 13, 29962, 13, 2 ]
src/config/config.py
Badmuts/hsleiden-ipsenh-sensor
0
58559
<gh_stars>0 class Config(object): _instance = None def __new__(self): if not self._instance: self._instance = super(Config, self).__new__(self) return self._instance def setConfig(self, config): self.config = config def get(self, key): return self.config[key] def getAll(self): return self.config
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 1990, 12782, 29898, 3318, 1125, 13, 1678, 903, 8758, 353, 6213, 13, 13, 1678, 822, 4770, 1482, 12035, 1311, 1125, 13, 4706, 565, 451, 1583, 3032, 8758, 29901, 13, 9651, 1583, 3032, 8758, 353, 2428, 29898, 3991, 29892, 1583, 467, 1649, 1482, 12035, 1311, 29897, 13, 4706, 736, 1583, 3032, 8758, 13, 13, 1678, 822, 731, 3991, 29898, 1311, 29892, 2295, 1125, 13, 4706, 1583, 29889, 2917, 353, 2295, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 1820, 1125, 13, 4706, 736, 1583, 29889, 2917, 29961, 1989, 29962, 13, 13, 1678, 822, 679, 3596, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 2917, 2 ]
data_processing/models.py
flyingdutchman23/step-detector
0
120290
import os import glob import csv import pandas as pd import numpy as np from collections import deque from itertools import chain from utils import rotate_quat, rotate_cross_product class Sensor(object): def __init__(self, name, fieldnames, data): self.name = name self.fieldnames = fieldnames self.raw_data = data self.length = data[-1, 0] - data[0, 0] def __str__(self): return '<Sensor "{}">'.format(self.name) def __repr__(self): return str(self) def __getitem__(self, key): if isinstance(key, tuple): keys = [self.fieldnames.index(k) for k in key] else: keys = self.fieldnames.index(key) return self.raw_data[:, keys] class Recording(object): def __init__(self, path, step_stride_threshold=300): self.path = path self.sensors = [] self.subject = 'unknown' sensors_i = (p for p in glob.iglob(os.path.join(path, '*.csv')) if '-extra' not in p) for sensor_log in sensors_i: sensor_name = os.path.splitext(os.path.split(sensor_log)[-1])[0] with open(sensor_log) as f: reader = csv.reader(f) try: fieldnames = next(reader) except StopIteration: continue data = np.array([self._parse_line(fieldnames, l) for l in reader]) try: sensor = Sensor(sensor_name, fieldnames, data) except IndexError: print('Error: Empty sensor {}'.format(sensor_log)) else: setattr(self, sensor_name, sensor) self.sensors.append(sensor) if self.foot_sensors_available: self.filter_steps(step_stride_threshold) else: print('Warning: Not all foot sensors available') with open(os.path.join(path, 'meta.txt')) as f: lines = f.readlines() for l in lines: if l.startswith('now'): self.recording_start = int(l.split(' ')[-1]) * 1e-9 elif l.startswith('name'): self.subject = l.split(' ')[-1].strip() def _parse_line(self, fieldnames, l): assert len(fieldnames) == len(l), f'_parse_line({fieldnames}, {l})' for i in range(len(l)): if fieldnames[i].endswith('_ts'): value = int(l[i]) * 1e-9 elif fieldnames[i].startswith('is_') or fieldnames[i] == 'running': value = l[i] == 'true' else: value = float(l[i]) l[i] = value return l def __str__(self): return '<{} "{}" raw-sensors={}>'.format( os.path.split(self.path)[-1], self.condition, [s.name for s in self.sensors]) def __repr__(self): return str(self) def write(self, file_name): # sensors = {s.name: s.raw_data for s in self.sensors} # sensors['merged'] = self.merged # np.savez_compressed(os.path.join(self.path, file_name), # **sensors) self.merged.to_msgpack(os.path.join(self.path, file_name)) def merge(self, step_margin=1.): data_sensors = self.data_sensors arrivals = [s['arrival_ts'] for s in data_sensors] idc = [0] * len(data_sensors) qs = [deque(maxlen=1) for _ in data_sensors] result = deque() try: while True: # fill queues with newest data point new_arr = [s[idc[i]] for i, s in enumerate(arrivals)] newest = np.argmin(new_arr) qs[newest].append(data_sensors[newest].raw_data[idc[newest]]) idc[newest] += 1 # check if all queues contain data if all([len(q) > 0 for q in qs]): # create new data point containing all sensor data # assign average timestamp avg_timestamp = np.mean([q[0][0] for q in qs]) label = self.label_for_timestamp(avg_timestamp, step_margin) data = [avg_timestamp, label] # append sensor data: data fields [2:6] data += list(chain(*(q.popleft()[2:6] for q in qs))) result.append(data) except IndexError: pass cols = ['event_ts', 'label'] for s in data_sensors: cols += ['{}_{}'.format(s.name, fn) for fn in s.fieldnames[2:6]] self.merged = pd.DataFrame.from_records(list(result), columns=cols) @property def data_sensors(self): label_sensor_names = ('RightFootSensor', 'LeftFootSensor') return [s for s in self.sensors if s.name not in label_sensor_names and '-extra' not in s.name] @property def foot_sensors_available(self): return hasattr(self, 'RightFootSensor') and hasattr(self, 'LeftFootSensor') def label_for_timestamp(self, timestamp, step_margin=1.): '''TODO DOCS''' if not self.foot_sensors_available: return False for s in (self.RightFootSensor, self.LeftFootSensor): arrivals = s['arrival_ts'] ts_idx = np.searchsorted(arrivals, timestamp) step_durations = s['duration'] * 1e-3 if ts_idx < step_durations.shape[0]: step_start_ts = arrivals[ts_idx] - step_durations[ts_idx] - step_margin # print(arrivals[ts_idx + 1], step_durations[ts_idx + 1], step_start_ts, timestamp) if timestamp >= step_start_ts: # print('in') # step_start_ts <= timestamp <= step_arrival return True return False def rotate_accelerometer(self): acc = self.merged.as_matrix(['Accelerometer_val_x', 'Accelerometer_val_y', 'Accelerometer_val_z']) rot = self.merged.as_matrix(['GameRotationVector_val_w', 'GameRotationVector_val_x', 'GameRotationVector_val_y', 'GameRotationVector_val_z']) if np.isnan(rot).any(): print('WARNING: GameRotationVector data unavailable. Fallback to RotationVector.') rot = self.merged.as_matrix(['RotationVector_val_w', 'RotationVector_val_x', 'RotationVector_val_y', 'RotationVector_val_z']) if np.isnan(rot).any(): raise ValueError('No RotationVector data available. Cannot rotate accelerometer.') keys = 'Rotated_Accelerometer_val_x', 'Rotated_Accelerometer_val_y', 'Rotated_Accelerometer_val_z' rot_acc = rotate_quat(acc, rot) self.merged = self.merged.assign(**{keys[i]: rot_acc[:, i] for i in range(len(keys))}) def normalize_accelerometer(self, norm_reference): acc = self.merged.as_matrix(['Accelerometer_val_x', 'Accelerometer_val_y', 'Accelerometer_val_z']) rot = self.merged.as_matrix(['GameRotationVector_val_w', 'GameRotationVector_val_x', 'GameRotationVector_val_y', 'GameRotationVector_val_z']) if np.isnan(rot).any(): print('WARNING: GameRotationVector data unavailable. Fallback to RotationVector.') rot = self.merged.as_matrix(['RotationVector_val_w', 'RotationVector_val_x', 'RotationVector_val_y', 'RotationVector_val_z']) if np.isnan(rot).any(): raise ValueError('No RotationVector data available. Cannot rotate accelerometer.') keys = 'Normalized_Accelerometer_val_x', 'Normalized_Accelerometer_val_y', 'Normalized_Accelerometer_val_z' rot_acc = rotate_quat(acc, rot) rot_acc[:, 2] -= 9.8 rot_acc /= norm_reference self.merged = self.merged.assign(**{keys[i]: rot_acc[:, i] for i in range(len(keys))}) def filter_steps(self, th): for s in (self.RightFootSensor, self.LeftFootSensor): step_data = s['stride_x', 'stride_y'] step_norm = np.linalg.norm(step_data, axis=1) print('{}: {} steps detected as too small'.format(s.name, np.sum(step_norm < th))) s.raw_data = s.raw_data[step_norm >= th]
[ 1, 1053, 2897, 13, 5215, 13149, 13, 5215, 11799, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 3166, 16250, 1053, 316, 802, 13, 3166, 4256, 8504, 1053, 9704, 13, 3166, 3667, 29879, 1053, 16734, 29918, 339, 271, 29892, 16734, 29918, 19128, 29918, 4704, 13, 13, 13, 1990, 317, 6073, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1024, 29892, 1746, 7039, 29892, 848, 1125, 13, 4706, 1583, 29889, 978, 353, 1024, 13, 4706, 1583, 29889, 2671, 7039, 353, 1746, 7039, 13, 4706, 1583, 29889, 1610, 29918, 1272, 353, 848, 13, 4706, 1583, 29889, 2848, 353, 848, 14352, 29896, 29892, 29871, 29900, 29962, 448, 848, 29961, 29900, 29892, 29871, 29900, 29962, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 12801, 29903, 6073, 376, 8875, 1013, 4286, 4830, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 851, 29898, 1311, 29897, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 1820, 1125, 13, 4706, 565, 338, 8758, 29898, 1989, 29892, 18761, 1125, 13, 9651, 6611, 353, 518, 1311, 29889, 2671, 7039, 29889, 2248, 29898, 29895, 29897, 363, 413, 297, 1820, 29962, 13, 4706, 1683, 29901, 13, 9651, 6611, 353, 1583, 29889, 2671, 7039, 29889, 2248, 29898, 1989, 29897, 13, 4706, 736, 1583, 29889, 1610, 29918, 1272, 7503, 29892, 6611, 29962, 13, 13, 13, 1990, 3599, 3278, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2224, 29892, 4331, 29918, 303, 2426, 29918, 386, 12268, 29922, 29941, 29900, 29900, 1125, 13, 4706, 1583, 29889, 2084, 353, 2224, 13, 4706, 1583, 29889, 23149, 943, 353, 5159, 13, 4706, 1583, 29889, 16009, 353, 525, 26690, 29915, 13, 4706, 4771, 943, 29918, 29875, 353, 313, 29886, 363, 282, 297, 13149, 29889, 335, 2127, 29898, 359, 29889, 2084, 29889, 7122, 29898, 2084, 29892, 525, 10521, 7638, 8785, 565, 17411, 17833, 29915, 451, 297, 282, 29897, 13, 4706, 363, 23530, 29918, 1188, 297, 4771, 943, 29918, 29875, 29901, 13, 9651, 23530, 29918, 978, 353, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 359, 29889, 2084, 29889, 5451, 29898, 29879, 6073, 29918, 1188, 9601, 29899, 29896, 2314, 29961, 29900, 29962, 13, 9651, 411, 1722, 29898, 29879, 6073, 29918, 1188, 29897, 408, 285, 29901, 13, 18884, 9591, 353, 11799, 29889, 16950, 29898, 29888, 29897, 13, 18884, 1018, 29901, 13, 462, 1678, 1746, 7039, 353, 2446, 29898, 16950, 29897, 13, 18884, 5174, 22303, 13463, 362, 29901, 13, 462, 1678, 6773, 13, 18884, 848, 353, 7442, 29889, 2378, 4197, 1311, 3032, 5510, 29918, 1220, 29898, 2671, 7039, 29892, 301, 29897, 363, 301, 297, 9591, 2314, 13, 18884, 1018, 29901, 13, 462, 1678, 23530, 353, 317, 6073, 29898, 29879, 6073, 29918, 978, 29892, 1746, 7039, 29892, 848, 29897, 13, 18884, 5174, 11374, 2392, 29901, 13, 462, 1678, 1596, 877, 2392, 29901, 2812, 2349, 23530, 6571, 4286, 4830, 29898, 29879, 6073, 29918, 1188, 876, 13, 18884, 1683, 29901, 13, 462, 1678, 731, 5552, 29898, 1311, 29892, 23530, 29918, 978, 29892, 23530, 29897, 13, 462, 1678, 1583, 29889, 23149, 943, 29889, 4397, 29898, 29879, 6073, 29897, 13, 13, 4706, 565, 1583, 29889, 6661, 29918, 23149, 943, 29918, 16515, 29901, 13, 9651, 1583, 29889, 4572, 29918, 24530, 29898, 10568, 29918, 303, 2426, 29918, 386, 12268, 29897, 13, 4706, 1683, 29901, 13, 9651, 1596, 877, 22709, 29901, 2216, 599, 3661, 4771, 943, 3625, 1495, 13, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 2084, 29892, 525, 7299, 29889, 3945, 8785, 408, 285, 29901, 13, 9651, 3454, 353, 285, 29889, 949, 9012, 580, 13, 9651, 363, 301, 297, 3454, 29901, 13, 18884, 565, 301, 29889, 27382, 2541, 877, 3707, 29374, 13, 462, 1678, 1583, 29889, 3757, 3278, 29918, 2962, 353, 938, 29898, 29880, 29889, 5451, 877, 525, 9601, 29899, 29896, 2314, 334, 29871, 29896, 29872, 29899, 29929, 13, 18884, 25342, 301, 29889, 27382, 2541, 877, 978, 29374, 13, 462, 1678, 1583, 29889, 16009, 353, 301, 29889, 5451, 877, 525, 9601, 29899, 29896, 1822, 17010, 580, 13, 13, 1678, 822, 903, 5510, 29918, 1220, 29898, 1311, 29892, 1746, 7039, 29892, 301, 1125, 13, 4706, 4974, 7431, 29898, 2671, 7039, 29897, 1275, 7431, 29898, 29880, 511, 285, 15972, 5510, 29918, 1220, 3319, 2671, 7039, 1118, 426, 29880, 1800, 29915, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 29880, 22164, 13, 9651, 565, 1746, 7039, 29961, 29875, 1822, 1975, 2541, 877, 29918, 1372, 29374, 13, 18884, 995, 353, 938, 29898, 29880, 29961, 29875, 2314, 334, 29871, 29896, 29872, 29899, 29929, 13, 9651, 25342, 1746, 7039, 29961, 29875, 1822, 27382, 2541, 877, 275, 29918, 1495, 470, 1746, 7039, 29961, 29875, 29962, 1275, 525, 21094, 2396, 13, 18884, 995, 353, 301, 29961, 29875, 29962, 1275, 525, 3009, 29915, 13, 9651, 1683, 29901, 13, 18884, 995, 353, 5785, 29898, 29880, 29961, 29875, 2314, 13, 9651, 301, 29961, 29875, 29962, 353, 995, 13, 4706, 736, 301, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 12801, 8875, 29850, 5038, 10650, 29899, 23149, 943, 3790, 17428, 4286, 4830, 29898, 13, 9651, 2897, 29889, 2084, 29889, 5451, 29898, 1311, 29889, 2084, 9601, 29899, 29896, 1402, 13, 9651, 1583, 29889, 16122, 29892, 13, 9651, 518, 29879, 29889, 978, 363, 269, 297, 1583, 29889, 23149, 943, 2314, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 851, 29898, 1311, 29897, 13, 13, 1678, 822, 2436, 29898, 1311, 29892, 934, 29918, 978, 1125, 13, 4706, 396, 4771, 943, 353, 426, 29879, 29889, 978, 29901, 269, 29889, 1610, 29918, 1272, 363, 269, 297, 1583, 29889, 23149, 943, 29913, 13, 4706, 396, 4771, 943, 1839, 1050, 3192, 2033, 353, 1583, 29889, 1050, 3192, 13, 4706, 396, 7442, 29889, 7620, 29920, 29918, 510, 13120, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 2084, 29892, 934, 29918, 978, 511, 13, 4706, 396, 462, 268, 3579, 23149, 943, 29897, 13, 4706, 1583, 29889, 1050, 3192, 29889, 517, 29918, 7645, 4058, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 2084, 29892, 934, 29918, 978, 876, 13, 13, 1678, 822, 10366, 29898, 1311, 29892, 4331, 29918, 9264, 29922, 29896, 9575, 13, 4706, 848, 29918, 23149, 943, 353, 1583, 29889, 1272, 29918, 23149, 943, 13, 4706, 18517, 29879, 353, 518, 29879, 1839, 279, 15081, 29918, 1372, 2033, 363, 269, 297, 848, 29918, 23149, 943, 29962, 13, 4706, 1178, 29883, 353, 518, 29900, 29962, 334, 7431, 29898, 1272, 29918, 23149, 943, 29897, 13, 4706, 3855, 29879, 353, 518, 311, 802, 29898, 3317, 2435, 29922, 29896, 29897, 363, 903, 297, 848, 29918, 23149, 943, 29962, 13, 4706, 1121, 353, 316, 802, 580, 13, 4706, 1018, 29901, 13, 9651, 1550, 5852, 29901, 13, 18884, 396, 5445, 712, 1041, 411, 716, 342, 848, 1298, 13, 18884, 716, 29918, 2749, 353, 518, 29879, 29961, 333, 29883, 29961, 29875, 5262, 363, 474, 29892, 269, 297, 26985, 29898, 279, 15081, 29879, 4638, 13, 18884, 716, 342, 353, 7442, 29889, 1191, 1195, 29898, 1482, 29918, 2749, 29897, 13, 18884, 3855, 29879, 29961, 1482, 342, 1822, 4397, 29898, 1272, 29918, 23149, 943, 29961, 1482, 342, 1822, 1610, 29918, 1272, 29961, 333, 29883, 29961, 1482, 342, 24960, 13, 18884, 1178, 29883, 29961, 1482, 342, 29962, 4619, 29871, 29896, 13, 13, 18884, 396, 1423, 565, 599, 712, 1041, 1712, 848, 13, 18884, 565, 599, 4197, 2435, 29898, 29939, 29897, 1405, 29871, 29900, 363, 3855, 297, 3855, 29879, 29962, 1125, 13, 462, 1678, 396, 1653, 716, 848, 1298, 6943, 599, 23530, 848, 13, 462, 1678, 396, 3566, 6588, 14334, 13, 462, 1678, 1029, 29887, 29918, 16394, 353, 7442, 29889, 12676, 4197, 29939, 29961, 29900, 3816, 29900, 29962, 363, 3855, 297, 3855, 29879, 2314, 13, 462, 1678, 3858, 353, 1583, 29889, 1643, 29918, 1454, 29918, 16394, 29898, 485, 29887, 29918, 16394, 29892, 4331, 29918, 9264, 29897, 13, 13, 462, 1678, 848, 353, 518, 485, 29887, 29918, 16394, 29892, 3858, 29962, 13, 13, 462, 1678, 396, 9773, 23530, 848, 29901, 848, 4235, 518, 29906, 29901, 29953, 29962, 13, 462, 1678, 848, 4619, 1051, 29898, 14153, 10456, 29898, 29939, 29889, 7323, 1563, 580, 29961, 29906, 29901, 29953, 29962, 363, 3855, 297, 3855, 29879, 4961, 13, 462, 1678, 1121, 29889, 4397, 29898, 1272, 29897, 13, 13, 4706, 5174, 11374, 2392, 29901, 13, 9651, 1209, 13, 13, 4706, 28730, 353, 6024, 3696, 29918, 1372, 742, 525, 1643, 2033, 13, 4706, 363, 269, 297, 848, 29918, 23149, 943, 29901, 13, 9651, 28730, 4619, 6024, 29912, 3227, 29913, 4286, 4830, 29898, 29879, 29889, 978, 29892, 7876, 29897, 363, 7876, 297, 269, 29889, 2671, 7039, 29961, 29906, 29901, 29953, 5262, 13, 4706, 1583, 29889, 1050, 3192, 353, 10518, 29889, 17271, 29889, 3166, 29918, 3757, 4339, 29898, 1761, 29898, 2914, 511, 4341, 29922, 22724, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 848, 29918, 23149, 943, 29898, 1311, 1125, 13, 4706, 3858, 29918, 29879, 6073, 29918, 7039, 353, 6702, 7341, 13440, 29903, 6073, 742, 525, 8091, 13440, 29903, 6073, 1495, 13, 4706, 736, 518, 29879, 363, 269, 297, 1583, 29889, 23149, 943, 565, 269, 29889, 978, 451, 297, 3858, 29918, 29879, 6073, 29918, 7039, 322, 17411, 17833, 29915, 451, 297, 269, 29889, 978, 29962, 13, 13, 1678, 732, 6799, 13, 1678, 822, 3661, 29918, 23149, 943, 29918, 16515, 29898, 1311, 1125, 13, 4706, 736, 756, 5552, 29898, 1311, 29892, 525, 7341, 13440, 29903, 6073, 1495, 322, 756, 5552, 29898, 1311, 29892, 525, 8091, 13440, 29903, 6073, 1495, 13, 13, 1678, 822, 3858, 29918, 1454, 29918, 16394, 29898, 1311, 29892, 14334, 29892, 4331, 29918, 9264, 29922, 29896, 9575, 13, 4706, 14550, 4986, 3970, 11662, 9295, 12008, 13, 4706, 565, 451, 1583, 29889, 6661, 29918, 23149, 943, 29918, 16515, 29901, 13, 9651, 736, 7700, 13, 4706, 363, 269, 297, 313, 1311, 29889, 7341, 13440, 29903, 6073, 29892, 1583, 29889, 8091, 13440, 29903, 6073, 1125, 13, 9651, 18517, 29879, 353, 269, 1839, 279, 15081, 29918, 1372, 2033, 13, 9651, 18696, 29918, 13140, 353, 7442, 29889, 4478, 24582, 29898, 279, 15081, 29879, 29892, 14334, 29897, 13, 9651, 4331, 29918, 29881, 332, 800, 353, 269, 1839, 19708, 2033, 334, 29871, 29896, 29872, 29899, 29941, 13, 9651, 565, 18696, 29918, 13140, 529, 4331, 29918, 29881, 332, 800, 29889, 12181, 29961, 29900, 5387, 13, 18884, 4331, 29918, 2962, 29918, 1372, 353, 18517, 29879, 29961, 1372, 29918, 13140, 29962, 448, 4331, 29918, 29881, 332, 800, 29961, 1372, 29918, 13140, 29962, 448, 4331, 29918, 9264, 13, 18884, 396, 1596, 29898, 279, 15081, 29879, 29961, 1372, 29918, 13140, 718, 29871, 29896, 1402, 4331, 29918, 29881, 332, 800, 29961, 1372, 29918, 13140, 718, 29871, 29896, 1402, 4331, 29918, 2962, 29918, 1372, 29892, 14334, 29897, 13, 18884, 565, 14334, 6736, 4331, 29918, 2962, 29918, 1372, 29901, 13, 462, 1678, 396, 1596, 877, 262, 1495, 13, 462, 1678, 396, 4331, 29918, 2962, 29918, 1372, 5277, 14334, 5277, 4331, 29918, 279, 15081, 13, 462, 1678, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 822, 16734, 29918, 562, 2242, 261, 8328, 29898, 1311, 1125, 13, 4706, 1035, 353, 1583, 29889, 1050, 3192, 29889, 294, 29918, 5344, 18959, 7504, 7367, 8328, 29918, 791, 29918, 29916, 742, 13, 462, 462, 268, 525, 7504, 7367, 8328, 29918, 791, 29918, 29891, 742, 13, 462, 462, 268, 525, 7504, 7367, 8328, 29918, 791, 29918, 29920, 11287, 13, 4706, 5731, 353, 1583, 29889, 1050, 3192, 29889, 294, 29918, 5344, 18959, 14199, 21281, 362, 12877, 29918, 791, 29918, 29893, 742, 13, 462, 462, 268, 525, 14199, 21281, 362, 12877, 29918, 791, 29918, 29916, 742, 13, 462, 462, 268, 525, 14199, 21281, 362, 12877, 29918, 791, 29918, 29891, 742, 13, 462, 462, 268, 525, 14199, 21281, 362, 12877, 29918, 791, 29918, 29920, 11287, 13, 4706, 565, 7442, 29889, 275, 13707, 29898, 5450, 467, 1384, 7295, 13, 9651, 1596, 877, 29956, 25614, 29901, 8448, 21281, 362, 12877, 848, 443, 16515, 29889, 14053, 1627, 304, 9664, 362, 12877, 29889, 1495, 13, 9651, 5731, 353, 1583, 29889, 1050, 3192, 29889, 294, 29918, 5344, 18959, 21281, 362, 12877, 29918, 791, 29918, 29893, 742, 13, 462, 462, 308, 525, 21281, 362, 12877, 29918, 791, 29918, 29916, 742, 13, 462, 462, 308, 525, 21281, 362, 12877, 29918, 791, 29918, 29891, 742, 13, 462, 462, 308, 525, 21281, 362, 12877, 29918, 791, 29918, 29920, 11287, 13, 4706, 565, 7442, 29889, 275, 13707, 29898, 5450, 467, 1384, 7295, 13, 9651, 12020, 7865, 2392, 877, 3782, 9664, 362, 12877, 848, 3625, 29889, 15808, 16734, 15592, 8328, 29889, 1495, 13, 4706, 6611, 353, 525, 21281, 630, 29918, 7504, 7367, 8328, 29918, 791, 29918, 29916, 742, 525, 21281, 630, 29918, 7504, 7367, 8328, 29918, 791, 29918, 29891, 742, 525, 21281, 630, 29918, 7504, 7367, 8328, 29918, 791, 29918, 29920, 29915, 13, 4706, 5731, 29918, 5753, 353, 16734, 29918, 339, 271, 29898, 5753, 29892, 5731, 29897, 13, 4706, 1583, 29889, 1050, 3192, 353, 1583, 29889, 1050, 3192, 29889, 16645, 29898, 1068, 29912, 8149, 29961, 29875, 5387, 5731, 29918, 5753, 7503, 29892, 474, 29962, 363, 474, 297, 3464, 29898, 2435, 29898, 8149, 876, 1800, 13, 13, 1678, 822, 4226, 675, 29918, 562, 2242, 261, 8328, 29898, 1311, 29892, 6056, 29918, 5679, 1125, 13, 4706, 1035, 353, 1583, 29889, 1050, 3192, 29889, 294, 29918, 5344, 18959, 7504, 7367, 8328, 29918, 791, 29918, 29916, 742, 13, 462, 462, 268, 525, 7504, 7367, 8328, 29918, 791, 29918, 29891, 742, 13, 462, 462, 268, 525, 7504, 7367, 8328, 29918, 791, 29918, 29920, 11287, 13, 4706, 5731, 353, 1583, 29889, 1050, 3192, 29889, 294, 29918, 5344, 18959, 14199, 21281, 362, 12877, 29918, 791, 29918, 29893, 742, 13, 462, 462, 268, 525, 14199, 21281, 362, 12877, 29918, 791, 29918, 29916, 742, 13, 462, 462, 268, 525, 14199, 21281, 362, 12877, 29918, 791, 29918, 29891, 742, 13, 462, 462, 268, 525, 14199, 21281, 362, 12877, 29918, 791, 29918, 29920, 11287, 13, 4706, 565, 7442, 29889, 275, 13707, 29898, 5450, 467, 1384, 7295, 13, 9651, 1596, 877, 29956, 25614, 29901, 8448, 21281, 362, 12877, 848, 443, 16515, 29889, 14053, 1627, 304, 9664, 362, 12877, 29889, 1495, 13, 9651, 5731, 353, 1583, 29889, 1050, 3192, 29889, 294, 29918, 5344, 18959, 21281, 362, 12877, 29918, 791, 29918, 29893, 742, 13, 462, 462, 308, 525, 21281, 362, 12877, 29918, 791, 29918, 29916, 742, 13, 462, 462, 308, 525, 21281, 362, 12877, 29918, 791, 29918, 29891, 742, 13, 462, 462, 308, 525, 21281, 362, 12877, 29918, 791, 29918, 29920, 11287, 13, 4706, 565, 7442, 29889, 275, 13707, 29898, 5450, 467, 1384, 7295, 13, 9651, 12020, 7865, 2392, 877, 3782, 9664, 362, 12877, 848, 3625, 29889, 15808, 16734, 15592, 8328, 29889, 1495, 13, 4706, 6611, 353, 525, 19077, 1891, 29918, 7504, 7367, 8328, 29918, 791, 29918, 29916, 742, 525, 19077, 1891, 29918, 7504, 7367, 8328, 29918, 791, 29918, 29891, 742, 525, 19077, 1891, 29918, 7504, 7367, 8328, 29918, 791, 29918, 29920, 29915, 13, 4706, 5731, 29918, 5753, 353, 16734, 29918, 339, 271, 29898, 5753, 29892, 5731, 29897, 13, 4706, 5731, 29918, 5753, 7503, 29892, 29871, 29906, 29962, 22361, 29871, 29929, 29889, 29947, 13, 4706, 5731, 29918, 5753, 847, 29922, 6056, 29918, 5679, 13, 4706, 1583, 29889, 1050, 3192, 353, 1583, 29889, 1050, 3192, 29889, 16645, 29898, 1068, 29912, 8149, 29961, 29875, 5387, 5731, 29918, 5753, 7503, 29892, 474, 29962, 363, 474, 297, 3464, 29898, 2435, 29898, 8149, 876, 1800, 13, 13, 1678, 822, 4175, 29918, 24530, 29898, 1311, 29892, 266, 1125, 13, 4706, 363, 269, 297, 313, 1311, 29889, 7341, 13440, 29903, 6073, 29892, 1583, 29889, 8091, 13440, 29903, 6073, 1125, 13, 9651, 4331, 29918, 1272, 353, 269, 1839, 303, 2426, 29918, 29916, 742, 525, 303, 2426, 29918, 29891, 2033, 13, 9651, 4331, 29918, 12324, 353, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 10568, 29918, 1272, 29892, 9685, 29922, 29896, 29897, 13, 9651, 1596, 877, 29912, 6177, 6571, 6576, 17809, 408, 2086, 2319, 4286, 4830, 29898, 29879, 29889, 978, 29892, 7442, 29889, 2083, 29898, 10568, 29918, 12324, 529, 266, 4961, 13, 9651, 269, 29889, 1610, 29918, 1272, 353, 269, 29889, 1610, 29918, 1272, 29961, 10568, 29918, 12324, 6736, 266, 29962, 13, 2 ]
scripts/rpc/cmd_parser.py
5cs/spdk
2,107
35991
<filename>scripts/rpc/cmd_parser.py<gh_stars>1000+ args_global = ['server_addr', 'port', 'timeout', 'verbose', 'dry_run', 'conn_retries', 'is_server', 'rpc_plugin', 'called_rpc_name', 'func', 'client'] def strip_globals(kwargs): for arg in args_global: kwargs.pop(arg, None) def remove_null(kwargs): keys = [] for key, value in kwargs.items(): if value is None: keys.append(key) for key in keys: kwargs.pop(key, None) def apply_defaults(kwargs, **defaults): for key, value in defaults.items(): if key not in kwargs: kwargs[key] = value def group_as(kwargs, name, values): group = {} for arg in values: if arg in kwargs and kwargs[arg] is not None: group[arg] = kwargs.pop(arg, None) kwargs[name] = group
[ 1, 529, 9507, 29958, 16713, 29914, 29878, 6739, 29914, 9006, 29918, 16680, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29900, 29974, 13, 5085, 29918, 10945, 353, 6024, 2974, 29918, 10030, 742, 525, 637, 742, 525, 15619, 742, 525, 369, 15828, 742, 525, 29881, 719, 29918, 3389, 742, 525, 13082, 29918, 2267, 2722, 742, 13, 1669, 525, 275, 29918, 2974, 742, 525, 29878, 6739, 29918, 8582, 742, 525, 13998, 29918, 29878, 6739, 29918, 978, 742, 525, 9891, 742, 525, 4645, 2033, 13, 13, 13, 1753, 17820, 29918, 23705, 1338, 29898, 19290, 1125, 13, 1678, 363, 1852, 297, 6389, 29918, 10945, 29901, 13, 4706, 9049, 5085, 29889, 7323, 29898, 1191, 29892, 6213, 29897, 13, 13, 13, 1753, 3349, 29918, 4304, 29898, 19290, 1125, 13, 1678, 6611, 353, 5159, 13, 1678, 363, 1820, 29892, 995, 297, 9049, 5085, 29889, 7076, 7295, 13, 4706, 565, 995, 338, 6213, 29901, 13, 9651, 6611, 29889, 4397, 29898, 1989, 29897, 13, 13, 1678, 363, 1820, 297, 6611, 29901, 13, 4706, 9049, 5085, 29889, 7323, 29898, 1989, 29892, 6213, 29897, 13, 13, 13, 1753, 3394, 29918, 4381, 29879, 29898, 19290, 29892, 3579, 4381, 29879, 1125, 13, 1678, 363, 1820, 29892, 995, 297, 21274, 29889, 7076, 7295, 13, 4706, 565, 1820, 451, 297, 9049, 5085, 29901, 13, 9651, 9049, 5085, 29961, 1989, 29962, 353, 995, 13, 13, 13, 1753, 2318, 29918, 294, 29898, 19290, 29892, 1024, 29892, 1819, 1125, 13, 1678, 2318, 353, 6571, 13, 1678, 363, 1852, 297, 1819, 29901, 13, 4706, 565, 1852, 297, 9049, 5085, 322, 9049, 5085, 29961, 1191, 29962, 338, 451, 6213, 29901, 13, 9651, 2318, 29961, 1191, 29962, 353, 9049, 5085, 29889, 7323, 29898, 1191, 29892, 6213, 29897, 13, 1678, 9049, 5085, 29961, 978, 29962, 353, 2318, 13, 2 ]
ucloud/helpers/utils.py
yangyimincn/ucloud-sdk-python3
1
59969
import random import base64 import typing _lowercase = "abcdefghijklmnopqrstuvwxyz" _uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" _numbers = "0123456789" _specials = "_" def gen_password( n: int, lower_letters: str = _lowercase, upper_letters: str = _uppercase, number_letters: str = _numbers, special_letters: str = _specials, min_lower: int = 1, min_upper: int = 1, min_number: int = 1, min_specials: int = 1, ): """ generate password for any resource >>> len(gen_password(20)) 20 :param int n: password total length :param str lower_letters: all lowercase letters :param str upper_letters: all uppercase letters :param str number_letters: all number letters :param str special_letters: all special letters :param int min_lower: minimal number of lowercase letters :param int min_upper: minimal number of uppercase letters :param int min_number: minimal number of number letters :param int min_specials: minimal number of special letters :return: """ all_letters = "".join( [lower_letters, upper_letters, number_letters, special_letters] ) minimal_total = min_lower + min_upper + min_number + min_specials if n < minimal_total: raise ValueError( ( "the length of password must be larger than " "total minimal letters number" ) ) minimal_letters = "".join( [ gen_string(lower_letters, min_lower), gen_string(upper_letters, min_upper), gen_string(number_letters, min_number), gen_string(special_letters, min_specials), ] ) additional_letters = random.sample(all_letters, n - minimal_total) results = list(minimal_letters) + additional_letters random.shuffle(results) return "".join(results) def gen_string(letters: str, length: int): return "".join([random.choice(letters) for i in range(length)]) def first(l: typing.List[typing.Any]) -> typing.Any: if len(l) == 0: return None return l[0] def b64encode(s: str) -> str: """ base64 encode :param str s: input string :return: base64 string """ return base64.b64encode(s.encode()).decode() def b64decode(s: str) -> str: """ base64 decode :param str s: base64 string :return: output string """ return base64.b64decode(s.encode()).decode()
[ 1, 1053, 4036, 13, 5215, 2967, 29953, 29946, 13, 5215, 19229, 13, 13, 29918, 13609, 4878, 353, 376, 10736, 1753, 12443, 823, 6321, 23521, 459, 29939, 29878, 303, 4090, 29893, 20230, 29908, 13, 29918, 21064, 4878, 353, 376, 19658, 24405, 29954, 17628, 29967, 29968, 26369, 29940, 4590, 29984, 29934, 1254, 29965, 29963, 29956, 18454, 29999, 29908, 13, 29918, 20326, 353, 376, 29900, 29896, 29906, 29941, 29946, 29945, 29953, 29955, 29947, 29929, 29908, 13, 29918, 5965, 455, 1338, 353, 11119, 29908, 13, 13, 13, 1753, 2531, 29918, 5630, 29898, 13, 1678, 302, 29901, 938, 29892, 13, 1678, 5224, 29918, 1026, 2153, 29901, 851, 353, 903, 13609, 4878, 29892, 13, 1678, 7568, 29918, 1026, 2153, 29901, 851, 353, 903, 21064, 4878, 29892, 13, 1678, 1353, 29918, 1026, 2153, 29901, 851, 353, 903, 20326, 29892, 13, 1678, 4266, 29918, 1026, 2153, 29901, 851, 353, 903, 5965, 455, 1338, 29892, 13, 1678, 1375, 29918, 13609, 29901, 938, 353, 29871, 29896, 29892, 13, 1678, 1375, 29918, 21064, 29901, 938, 353, 29871, 29896, 29892, 13, 1678, 1375, 29918, 4537, 29901, 938, 353, 29871, 29896, 29892, 13, 1678, 1375, 29918, 5965, 455, 1338, 29901, 938, 353, 29871, 29896, 29892, 13, 1125, 13, 1678, 9995, 5706, 4800, 363, 738, 6503, 13, 13, 1678, 8653, 7431, 29898, 1885, 29918, 5630, 29898, 29906, 29900, 876, 13, 268, 29906, 29900, 13, 13, 1678, 584, 3207, 938, 302, 29901, 4800, 3001, 3309, 13, 1678, 584, 3207, 851, 5224, 29918, 1026, 2153, 29901, 599, 5224, 4878, 8721, 13, 1678, 584, 3207, 851, 7568, 29918, 1026, 2153, 29901, 599, 7568, 4878, 8721, 13, 1678, 584, 3207, 851, 1353, 29918, 1026, 2153, 29901, 599, 1353, 8721, 13, 1678, 584, 3207, 851, 4266, 29918, 1026, 2153, 29901, 599, 4266, 8721, 13, 1678, 584, 3207, 938, 1375, 29918, 13609, 29901, 13114, 1353, 310, 5224, 4878, 8721, 13, 1678, 584, 3207, 938, 1375, 29918, 21064, 29901, 13114, 1353, 310, 7568, 4878, 8721, 13, 1678, 584, 3207, 938, 1375, 29918, 4537, 29901, 13114, 1353, 310, 1353, 8721, 13, 1678, 584, 3207, 938, 1375, 29918, 5965, 455, 1338, 29901, 13114, 1353, 310, 4266, 8721, 13, 1678, 584, 2457, 29901, 13, 1678, 9995, 13, 1678, 599, 29918, 1026, 2153, 353, 376, 1642, 7122, 29898, 13, 4706, 518, 13609, 29918, 1026, 2153, 29892, 7568, 29918, 1026, 2153, 29892, 1353, 29918, 1026, 2153, 29892, 4266, 29918, 1026, 2153, 29962, 13, 1678, 1723, 13, 1678, 13114, 29918, 7827, 353, 1375, 29918, 13609, 718, 1375, 29918, 21064, 718, 1375, 29918, 4537, 718, 1375, 29918, 5965, 455, 1338, 13, 1678, 565, 302, 529, 13114, 29918, 7827, 29901, 13, 4706, 12020, 7865, 2392, 29898, 13, 9651, 313, 13, 18884, 376, 1552, 3309, 310, 4800, 1818, 367, 7200, 1135, 376, 13, 18884, 376, 7827, 13114, 8721, 1353, 29908, 13, 9651, 1723, 13, 4706, 1723, 13, 13, 1678, 13114, 29918, 1026, 2153, 353, 376, 1642, 7122, 29898, 13, 4706, 518, 13, 9651, 2531, 29918, 1807, 29898, 13609, 29918, 1026, 2153, 29892, 1375, 29918, 13609, 511, 13, 9651, 2531, 29918, 1807, 29898, 21064, 29918, 1026, 2153, 29892, 1375, 29918, 21064, 511, 13, 9651, 2531, 29918, 1807, 29898, 4537, 29918, 1026, 2153, 29892, 1375, 29918, 4537, 511, 13, 9651, 2531, 29918, 1807, 29898, 18732, 29918, 1026, 2153, 29892, 1375, 29918, 5965, 455, 1338, 511, 13, 4706, 4514, 13, 1678, 1723, 13, 13, 1678, 5684, 29918, 1026, 2153, 353, 4036, 29889, 11249, 29898, 497, 29918, 1026, 2153, 29892, 302, 448, 13114, 29918, 7827, 29897, 13, 1678, 2582, 353, 1051, 29898, 1195, 3039, 29918, 1026, 2153, 29897, 718, 5684, 29918, 1026, 2153, 13, 1678, 4036, 29889, 845, 21897, 29898, 9902, 29897, 13, 1678, 736, 376, 1642, 7122, 29898, 9902, 29897, 13, 13, 13, 1753, 2531, 29918, 1807, 29898, 1026, 2153, 29901, 851, 29892, 3309, 29901, 938, 1125, 13, 1678, 736, 376, 1642, 7122, 4197, 8172, 29889, 16957, 29898, 1026, 2153, 29897, 363, 474, 297, 3464, 29898, 2848, 29897, 2314, 13, 13, 13, 1753, 937, 29898, 29880, 29901, 19229, 29889, 1293, 29961, 1017, 15702, 29889, 10773, 2314, 1599, 19229, 29889, 10773, 29901, 13, 1678, 565, 7431, 29898, 29880, 29897, 1275, 29871, 29900, 29901, 13, 4706, 736, 6213, 13, 1678, 736, 301, 29961, 29900, 29962, 13, 13, 13, 1753, 289, 29953, 29946, 12508, 29898, 29879, 29901, 851, 29897, 1599, 851, 29901, 13, 1678, 9995, 2967, 29953, 29946, 19750, 13, 13, 1678, 584, 3207, 851, 269, 29901, 1881, 1347, 13, 1678, 584, 2457, 29901, 2967, 29953, 29946, 1347, 13, 1678, 9995, 13, 1678, 736, 2967, 29953, 29946, 29889, 29890, 29953, 29946, 12508, 29898, 29879, 29889, 12508, 16655, 13808, 580, 13, 13, 13, 1753, 289, 29953, 29946, 13808, 29898, 29879, 29901, 851, 29897, 1599, 851, 29901, 13, 1678, 9995, 2967, 29953, 29946, 21822, 13, 13, 1678, 584, 3207, 851, 269, 29901, 2967, 29953, 29946, 1347, 13, 1678, 584, 2457, 29901, 1962, 1347, 13, 1678, 9995, 13, 1678, 736, 2967, 29953, 29946, 29889, 29890, 29953, 29946, 13808, 29898, 29879, 29889, 12508, 16655, 13808, 580, 13, 2 ]
app.py
nathan-verghis/PlagueDoctors
0
138451
import psycopg2 conn = psycopg2.connect( database='vital-cat-208.defaultdb', user='asap_verg', password='<PASSWORD>@', sslmode='require', sslrootcert='certs/ca.crt', sslkey='certs/client.maxroach.key', sslcert='certs/client.maxroach.crt', port=26257, host='free-tier.gcp-us-central1.cockroachlabs.cloud' )
[ 1, 1053, 6529, 29891, 9708, 29887, 29906, 13, 13, 13082, 353, 6529, 29891, 9708, 29887, 29906, 29889, 6915, 29898, 13, 1678, 2566, 2433, 29894, 2410, 29899, 4117, 29899, 29906, 29900, 29947, 29889, 4381, 2585, 742, 13, 1678, 1404, 2433, 294, 481, 29918, 369, 29887, 742, 13, 1678, 4800, 2433, 29966, 25711, 17013, 29958, 29992, 742, 13, 1678, 24250, 8513, 2433, 12277, 742, 13, 1678, 24250, 4632, 6327, 2433, 6327, 29879, 29914, 1113, 29889, 29883, 2273, 742, 13, 1678, 24250, 1989, 2433, 6327, 29879, 29914, 4645, 29889, 3317, 307, 496, 29889, 1989, 742, 13, 1678, 24250, 6327, 2433, 6327, 29879, 29914, 4645, 29889, 3317, 307, 496, 29889, 29883, 2273, 742, 13, 1678, 2011, 29922, 29906, 29953, 29906, 29945, 29955, 29892, 13, 1678, 3495, 2433, 9021, 29899, 29873, 631, 29889, 29887, 6814, 29899, 375, 29899, 25171, 29896, 29889, 24956, 307, 496, 29880, 6897, 29889, 9274, 29915, 13, 29897, 13, 2 ]
pyLegoMario/LEGO_MARIO_DATA.py
Jackomatrus/pyLegoMario
0
86974
<gh_stars>0 import json from pathlib import Path # hex to ground colors # color messages are always shape (hexadecimal): 08004501ffffxx00 (where xx is the color code) HEX_TO_COLOR_TILE = { 0x0c: "Purple", 0x13: "White", 0x15: "Red", 0x17: "Blue", 0x18: "Yellow", 0x1a: "Black", 0x25: "Green", 0x38: "Nougat Brown", 0x42: "Cyan", 0x6a: "Brown"} # hex to Lego RGB codes # code messages are always shape (hexadecimal): 08004501xx00ffff (where xx is the tile code) with open(Path(__file__).parent / Path("ALL_RGB_CODES.json")) as f: HEX_TO_RGB_TILE = {x[2]:x[1] for x in json.load(f)} # hex to pants codes HEX_TO_PANTS = { # Pins 0x00: "None", #000000 0x03: "Bee", #000011 0x05: "Luigi", #000101 0x06: "Frog", #000110 0x0a: "Tanooki", #001010 0x0c: "Propeller", #001100 0x11: "Cat", #010001 0x12: "Fire", #010010 0x14: "Penguin", #010100 0x21: "Mario", #100001 0x22: "Builder" #100010 } HEX_TO_HUB_ACTIONS = { 0x30: "Hub Will Switch Off", 0x31: "Hub Will Disconnect" } HEX_TO_HUB_PROPERTIES = { 0x01: "Advertising Name", 0x02: "Button", 0x03: "Firmware Ver.", 0x04: "Hardware Ver.", 0x05: "Signal Strength", 0x06: "Battery Voltage", 0x07: "Battery Type", 0x08: "Manufacturer Name", 0x09: "Radio Firmware Version", 0x0A: "LEGO Wireless Protocol Version", 0x0B: "System Type ID", 0x0C: "H/W Network ID", 0x0D: "Primary MAC Address", 0x0E: "Secondary MAC Address", 0x0F: "Hardware Network Family" } # BLE Connection # https://github.com/bricklife/LEGO-Mario-Reveng LEGO_CHARACTERISTIC_UUID = "00001624-1212-efde-1623-785feabcd123" # Request Commmands REQUEST_RGB_COMMAND = bytearray([ 0x05, # message length 0x00, # unused 0x21, # message type (21=Port Information Request) 0x01, # port ID 0x00 # requested information type (0=Port Value) ]) REQUEST_PANTS_COMMAND = bytearray([0x05, 0x00, 0x21, 0x02, 0x00]) REQUEST_IMU_COMMAND = bytearray([0x05, 0x00, 0x21, 0x00, 0x00]) VALID_PORT_MODES = {0:(0,1), 1:(0,1), 2:(0,), 3:(0,1,2,3), 4:(0,), 6:(0,)} def pifs_command(port: int, mode: int, notifications: bool = True, delta_interval: int = 1): """Creates a PORT_INPUT_FORMAT_SETUP message according to the Lego Wireless Protocol: https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#port-input-format-setup-single Args: port (int): The designated Port. Port 0: Accelerometer Port 1: Camera Port 2: Binary (Pants) Port 3: ?? Port 4: ?? mode (int): The mode to set the port to. Available modes: Port 0: (0,1), Port 1: (0,1), Port 2: (0), Port 3: (0,1,2,3), Port 4: (0,1). Also see https://github.com/bricklife/LEGO-Mario-Reveng notifications (bool, optional): Whether to receive updates about every new value of the port. Defaults to True. If False, you'll need to manually request port values. delta_interval (int, optional): The necessary change in measured data to trigger a change in the sent value. A higher delta interval leads to less accurate data, but also less data traffic via bluetooth. I recommend 1 for every port except Port 0, which I recommend to set between 1 and 5 depending on your machine. Defaults to 1. Returns: bytearray: A bytearray to be sent to Lego Mario """ # Input Validation # Port if port not in (0,1,2,3,4): raise ValueError(f"Invalid Port, expected one of (0,1,2,3,4) but got {port}") # Mode try: mode = int(mode) except (TypeError, ValueError) as e: raise TypeError(f"Mode must be castable to int, got {type(mode)} \ instead") from e if mode not in VALID_PORT_MODES[port]: # not using .get because I verified port above raise ValueError( f"Invalid mode {mode} for port {port}, allowed modes for this \ port are: {VALID_PORT_MODES[port]}.") # Delta Interval try: int(delta_interval) except (TypeError, ValueError) as e: raise TypeError(f"Delta Interval must be castable to int, got \ {type(delta_interval)} instead") from e return bytearray([ 0x0A, # Message Length 0x00, # Unused 0x41, # Message Type port, mode, int(delta_interval), 0x00, 0x00, 0x00, int(bool(notifications)) # Notifications en/disabled ]) # Subscribtion Commands SUBSCRIBE_IMU_COMMAND = pifs_command(0, 0, delta_interval=2) SUBSCRIBE_RGB_COMMAND = pifs_command(1, 0, delta_interval=1) SUBSCRIBE_PANTS_COMMAND = pifs_command(2, 0) MUTE_COMMAND = bytearray([ 0x06, # message length 0x00, # unused, always 0 0x01, # message type (01 = Hub Properties) 0x12, # specify hub property (12 = volume) 0x01, # specify operation (1 = set new value) 0x00 # new value (0 = mute, 100 = full volume) ]) DISCONNECT_COMMAND = bytearray([ 0x04, # message length 0x00, # unused, always 0 0x02, # message type (02 = HUB Actions) 0x02, # specify action (02 = disconnect) ]) TURN_OFF_COMMAND = bytearray([ 0x04, # message length 0x00, # unused, always 0 0x02, # message type (02 = HUB Actions) 0x01, # specify action (01 = turn off) ]) BINARY_GESTURES = { # most likely wrong 0b0000000000000001: "Bump", 0b0000000000000010: "Gesture2", 0b0000000000000100: "Gesture4", 0b0000000000001000: "Gesture8", 0b0000000000010000: "Shake", 0b0000000000100000: "Gesture32", 0b0000000001000000: "Gesture64", 0b0000000010000000: "Gesture128", 0b0000000100000000: "Turning", 0b0000001000000000: "Fastmove", 0b0000010000000000: "Translation", 0b0000100000000000: "HighFallCrash", 0b0001000000000000: "DirectionChange", 0b0010000000000000: "Reverse", 0b0100000000000000: "Gesture16384", 0b1000000000000000: "Jump" }
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 4390, 13, 3166, 2224, 1982, 1053, 10802, 13, 29937, 15090, 304, 5962, 11955, 13, 29937, 2927, 7191, 526, 2337, 8267, 313, 20970, 1943, 29883, 3039, 1125, 29871, 29900, 29947, 29900, 29900, 29946, 29945, 29900, 29896, 17156, 4419, 29900, 29900, 313, 3062, 15473, 338, 278, 2927, 775, 29897, 13, 29950, 5746, 29918, 4986, 29918, 15032, 1955, 29918, 24301, 1307, 353, 426, 13, 268, 29900, 29916, 29900, 29883, 29901, 376, 29925, 332, 552, 613, 13, 268, 29900, 29916, 29896, 29941, 29901, 376, 21823, 613, 13, 268, 29900, 29916, 29896, 29945, 29901, 376, 9039, 613, 13, 268, 29900, 29916, 29896, 29955, 29901, 376, 21319, 613, 13, 268, 29900, 29916, 29896, 29947, 29901, 376, 29979, 4743, 613, 13, 268, 29900, 29916, 29896, 29874, 29901, 376, 18700, 613, 13, 268, 29900, 29916, 29906, 29945, 29901, 376, 24599, 613, 13, 268, 29900, 29916, 29941, 29947, 29901, 376, 29940, 692, 271, 9817, 613, 13, 268, 29900, 29916, 29946, 29906, 29901, 376, 29907, 10094, 613, 13, 268, 29900, 29916, 29953, 29874, 29901, 376, 29933, 4708, 9092, 13, 13, 29937, 15090, 304, 365, 2412, 390, 7210, 11561, 13, 29937, 775, 7191, 526, 2337, 8267, 313, 20970, 1943, 29883, 3039, 1125, 29871, 29900, 29947, 29900, 29900, 29946, 29945, 29900, 29896, 4419, 29900, 29900, 17156, 313, 3062, 15473, 338, 278, 25900, 775, 29897, 13, 2541, 1722, 29898, 2605, 22168, 1445, 1649, 467, 3560, 847, 10802, 703, 9818, 29918, 28212, 29918, 16524, 29903, 29889, 3126, 5783, 408, 285, 29901, 13, 1678, 379, 5746, 29918, 4986, 29918, 28212, 29918, 24301, 1307, 353, 426, 29916, 29961, 29906, 5387, 29916, 29961, 29896, 29962, 363, 921, 297, 4390, 29889, 1359, 29898, 29888, 2915, 13, 13, 29937, 15090, 304, 282, 1934, 11561, 13, 29950, 5746, 29918, 4986, 29918, 29925, 2190, 9375, 353, 426, 4706, 396, 349, 1144, 13, 268, 29900, 29916, 29900, 29900, 29901, 376, 8516, 613, 539, 396, 29900, 29900, 29900, 29900, 29900, 29900, 13, 268, 29900, 29916, 29900, 29941, 29901, 376, 3629, 29872, 613, 4706, 396, 29900, 29900, 29900, 29900, 29896, 29896, 13, 268, 29900, 29916, 29900, 29945, 29901, 376, 24126, 10091, 613, 418, 396, 29900, 29900, 29900, 29896, 29900, 29896, 13, 268, 29900, 29916, 29900, 29953, 29901, 376, 29943, 9102, 613, 539, 396, 29900, 29900, 29900, 29896, 29896, 29900, 13, 268, 29900, 29916, 29900, 29874, 29901, 376, 29911, 1562, 21025, 613, 1678, 396, 29900, 29900, 29896, 29900, 29896, 29900, 13, 268, 29900, 29916, 29900, 29883, 29901, 376, 20420, 4539, 613, 29871, 396, 29900, 29900, 29896, 29896, 29900, 29900, 13, 268, 29900, 29916, 29896, 29896, 29901, 376, 9694, 613, 4706, 396, 29900, 29896, 29900, 29900, 29900, 29896, 13, 268, 29900, 29916, 29896, 29906, 29901, 376, 18654, 613, 539, 396, 29900, 29896, 29900, 29900, 29896, 29900, 13, 268, 29900, 29916, 29896, 29946, 29901, 376, 29925, 19636, 262, 613, 1678, 396, 29900, 29896, 29900, 29896, 29900, 29900, 13, 268, 29900, 29916, 29906, 29896, 29901, 376, 29924, 2628, 613, 418, 396, 29896, 29900, 29900, 29900, 29900, 29896, 13, 268, 29900, 29916, 29906, 29906, 29901, 376, 5627, 29908, 268, 396, 29896, 29900, 29900, 29900, 29896, 29900, 13, 29913, 13, 13, 29950, 5746, 29918, 4986, 29918, 29950, 7466, 29918, 24705, 29903, 353, 426, 13, 268, 29900, 29916, 29941, 29900, 29901, 376, 16046, 2811, 28176, 5947, 613, 13, 268, 29900, 29916, 29941, 29896, 29901, 376, 16046, 2811, 3295, 6915, 29908, 13, 29913, 13, 13, 29950, 5746, 29918, 4986, 29918, 29950, 7466, 29918, 8618, 13171, 24301, 2890, 353, 426, 13, 268, 29900, 29916, 29900, 29896, 29901, 376, 3253, 1765, 5921, 4408, 613, 13, 268, 29900, 29916, 29900, 29906, 29901, 376, 3125, 613, 13, 268, 29900, 29916, 29900, 29941, 29901, 376, 29943, 3568, 2519, 1798, 19602, 13, 268, 29900, 29916, 29900, 29946, 29901, 376, 29950, 538, 2519, 1798, 19602, 13, 268, 29900, 29916, 29900, 29945, 29901, 376, 10140, 284, 3767, 1477, 613, 13, 268, 29900, 29916, 29900, 29953, 29901, 376, 29933, 2620, 29891, 3684, 29873, 482, 613, 13, 268, 29900, 29916, 29900, 29955, 29901, 376, 29933, 2620, 29891, 5167, 613, 13, 268, 29900, 29916, 29900, 29947, 29901, 376, 2517, 9765, 9945, 4408, 613, 13, 268, 29900, 29916, 29900, 29929, 29901, 376, 21818, 383, 3568, 2519, 10079, 613, 13, 268, 29900, 29916, 29900, 29909, 29901, 376, 1307, 17080, 399, 533, 2222, 1019, 5770, 10079, 613, 13, 268, 29900, 29916, 29900, 29933, 29901, 376, 3924, 5167, 3553, 613, 13, 268, 29900, 29916, 29900, 29907, 29901, 376, 29950, 29914, 29956, 8527, 3553, 613, 13, 268, 29900, 29916, 29900, 29928, 29901, 376, 26666, 26750, 16428, 613, 13, 268, 29900, 29916, 29900, 29923, 29901, 376, 11863, 653, 26750, 16428, 613, 13, 268, 29900, 29916, 29900, 29943, 29901, 376, 29950, 538, 2519, 8527, 14662, 29908, 13, 29913, 13, 13, 29937, 350, 1307, 15160, 13, 29937, 2045, 597, 3292, 29889, 510, 29914, 1182, 860, 19264, 29914, 1307, 17080, 29899, 29924, 2628, 29899, 1123, 854, 29887, 13, 1307, 17080, 29918, 11282, 17923, 1001, 9047, 2965, 29918, 29965, 11150, 353, 376, 29900, 29900, 29900, 29900, 29896, 29953, 29906, 29946, 29899, 29896, 29906, 29896, 29906, 29899, 1389, 311, 29899, 29896, 29953, 29906, 29941, 29899, 29955, 29947, 29945, 1725, 370, 2252, 29896, 29906, 29941, 29908, 13, 29937, 10729, 1876, 29885, 4167, 13, 16244, 29918, 28212, 29918, 19795, 1529, 2797, 353, 7023, 2378, 4197, 13, 462, 462, 29900, 29916, 29900, 29945, 29892, 396, 2643, 3309, 13, 462, 462, 29900, 29916, 29900, 29900, 29892, 396, 443, 3880, 13, 462, 462, 29900, 29916, 29906, 29896, 29892, 396, 2643, 1134, 313, 29906, 29896, 29922, 2290, 10343, 10729, 29897, 13, 462, 462, 29900, 29916, 29900, 29896, 29892, 396, 2011, 3553, 13, 462, 462, 29900, 29916, 29900, 29900, 29871, 396, 13877, 2472, 1134, 313, 29900, 29922, 2290, 7865, 29897, 13, 462, 462, 2314, 13, 16244, 29918, 29925, 2190, 9375, 29918, 19795, 1529, 2797, 353, 7023, 2378, 4197, 29900, 29916, 29900, 29945, 29892, 29871, 29900, 29916, 29900, 29900, 29892, 29871, 29900, 29916, 29906, 29896, 29892, 29871, 29900, 29916, 29900, 29906, 29892, 29871, 29900, 29916, 29900, 29900, 2314, 13, 16244, 29918, 7833, 29965, 29918, 19795, 1529, 2797, 353, 7023, 2378, 4197, 29900, 29916, 29900, 29945, 29892, 29871, 29900, 29916, 29900, 29900, 29892, 29871, 29900, 29916, 29906, 29896, 29892, 29871, 29900, 29916, 29900, 29900, 29892, 29871, 29900, 29916, 29900, 29900, 2314, 13, 13, 26707, 29918, 15082, 29918, 20387, 29903, 353, 426, 29900, 5919, 29900, 29892, 29896, 511, 29871, 29896, 5919, 29900, 29892, 29896, 511, 29871, 29906, 5919, 29900, 29892, 511, 29871, 29941, 5919, 29900, 29892, 29896, 29892, 29906, 29892, 29941, 511, 29871, 29946, 5919, 29900, 29892, 511, 29871, 29953, 5919, 29900, 29892, 2915, 13, 13, 1753, 282, 10270, 29918, 6519, 29898, 637, 29901, 938, 29892, 4464, 29901, 938, 29892, 25913, 29901, 6120, 353, 5852, 29892, 19471, 29918, 19207, 29901, 938, 353, 29871, 29896, 1125, 13, 1678, 9995, 9832, 1078, 263, 349, 8476, 29918, 1177, 12336, 29918, 19094, 1299, 29918, 10490, 4897, 2643, 5034, 304, 278, 365, 2412, 13, 1678, 399, 533, 2222, 1019, 5770, 29901, 2045, 597, 1397, 29877, 29889, 3292, 29889, 601, 29914, 1397, 29877, 29899, 569, 29899, 22376, 2222, 29899, 20464, 29899, 2640, 29914, 2248, 29889, 1420, 29937, 637, 29899, 2080, 29899, 4830, 29899, 14669, 29899, 14369, 13, 13, 1678, 826, 3174, 29901, 13, 1678, 2011, 313, 524, 1125, 450, 25373, 3371, 29889, 13, 18884, 3371, 29871, 29900, 29901, 4831, 7367, 8328, 13, 18884, 3371, 29871, 29896, 29901, 24321, 13, 18884, 3371, 29871, 29906, 29901, 29479, 313, 29925, 1934, 29897, 13, 18884, 3371, 29871, 29941, 29901, 13626, 13, 18884, 3371, 29871, 29946, 29901, 13626, 13, 1678, 4464, 313, 524, 1125, 450, 4464, 304, 731, 278, 2011, 304, 29889, 7740, 3106, 18893, 29901, 3371, 29871, 29900, 29901, 313, 29900, 29892, 29896, 511, 3371, 29871, 29896, 29901, 313, 29900, 29892, 29896, 511, 3371, 29871, 29906, 29901, 313, 29900, 511, 3371, 29871, 29941, 29901, 313, 29900, 29892, 29896, 29892, 29906, 29892, 29941, 511, 3371, 29871, 29946, 29901, 313, 29900, 29892, 29896, 467, 3115, 1074, 2045, 597, 3292, 29889, 510, 29914, 1182, 860, 19264, 29914, 1307, 17080, 29899, 29924, 2628, 29899, 1123, 854, 29887, 13, 1678, 25913, 313, 11227, 29892, 13136, 1125, 26460, 304, 7150, 11217, 1048, 1432, 716, 995, 310, 278, 2011, 29889, 13109, 29879, 304, 5852, 29889, 960, 7700, 29892, 366, 29915, 645, 817, 304, 7522, 2009, 2011, 1819, 29889, 13, 1678, 19471, 29918, 19207, 313, 524, 29892, 13136, 1125, 450, 5181, 1735, 297, 17005, 848, 304, 7135, 263, 1735, 297, 278, 2665, 995, 29889, 13, 462, 462, 1678, 319, 6133, 19471, 7292, 11981, 304, 3109, 16232, 848, 29892, 541, 884, 3109, 848, 12469, 3025, 1999, 20930, 29889, 13, 462, 462, 1678, 306, 6907, 29871, 29896, 363, 1432, 2011, 5174, 3371, 29871, 29900, 29892, 607, 306, 6907, 304, 731, 1546, 29871, 29896, 322, 29871, 29945, 8679, 373, 596, 4933, 29889, 13, 462, 462, 1678, 13109, 29879, 304, 29871, 29896, 29889, 13, 13, 1678, 16969, 29901, 13, 4706, 7023, 2378, 29901, 319, 7023, 2378, 304, 367, 2665, 304, 365, 2412, 16262, 13, 1678, 9995, 13, 1678, 396, 10567, 15758, 362, 13, 1678, 396, 3371, 13, 1678, 565, 2011, 451, 297, 313, 29900, 29892, 29896, 29892, 29906, 29892, 29941, 29892, 29946, 1125, 13, 4706, 12020, 7865, 2392, 29898, 29888, 29908, 13919, 3371, 29892, 3806, 697, 310, 313, 29900, 29892, 29896, 29892, 29906, 29892, 29941, 29892, 29946, 29897, 541, 2355, 426, 637, 27195, 13, 1678, 396, 21864, 13, 13, 1678, 1018, 29901, 13, 4706, 4464, 353, 938, 29898, 8513, 29897, 13, 1678, 5174, 313, 1542, 2392, 29892, 7865, 2392, 29897, 408, 321, 29901, 13, 4706, 12020, 20948, 29898, 29888, 29908, 6818, 1818, 367, 4320, 519, 304, 938, 29892, 2355, 426, 1853, 29898, 8513, 2915, 320, 13, 462, 4706, 2012, 1159, 515, 321, 13, 1678, 565, 4464, 451, 297, 12599, 1367, 29918, 15082, 29918, 20387, 29903, 29961, 637, 5387, 396, 451, 773, 869, 657, 1363, 306, 26834, 2011, 2038, 13, 4706, 12020, 7865, 2392, 29898, 13, 9651, 285, 29908, 13919, 4464, 426, 8513, 29913, 363, 2011, 426, 637, 1118, 6068, 18893, 363, 445, 320, 13, 9651, 2011, 526, 29901, 426, 26707, 29918, 15082, 29918, 20387, 29903, 29961, 637, 29962, 1836, 1159, 13, 1678, 396, 360, 2554, 4124, 791, 13, 1678, 1018, 29901, 13, 4706, 938, 29898, 4181, 29918, 19207, 29897, 13, 1678, 5174, 313, 1542, 2392, 29892, 7865, 2392, 29897, 408, 321, 29901, 13, 4706, 12020, 20948, 29898, 29888, 29908, 5268, 4124, 791, 1818, 367, 4320, 519, 304, 938, 29892, 2355, 320, 13, 462, 4706, 426, 1853, 29898, 4181, 29918, 19207, 2915, 2012, 1159, 515, 321, 13, 13, 1678, 736, 7023, 2378, 4197, 13, 462, 268, 29900, 29916, 29900, 29909, 29892, 29871, 396, 7777, 365, 1477, 13, 462, 268, 29900, 29916, 29900, 29900, 29892, 29871, 396, 853, 3880, 13, 462, 268, 29900, 29916, 29946, 29896, 29892, 29871, 396, 7777, 5167, 13, 462, 1678, 2011, 29892, 13, 462, 1678, 4464, 29892, 13, 462, 1678, 938, 29898, 4181, 29918, 19207, 511, 13, 462, 268, 29900, 29916, 29900, 29900, 29892, 13, 462, 268, 29900, 29916, 29900, 29900, 29892, 13, 462, 268, 29900, 29916, 29900, 29900, 29892, 13, 462, 1678, 938, 29898, 11227, 29898, 1333, 8232, 876, 29871, 396, 2216, 8232, 427, 29914, 18279, 13, 462, 268, 2314, 13, 13, 29937, 3323, 7588, 3116, 291, 1876, 4167, 13, 20633, 7187, 3960, 15349, 29918, 7833, 29965, 29918, 19795, 1529, 2797, 353, 29871, 282, 10270, 29918, 6519, 29898, 29900, 29892, 29871, 29900, 29892, 19471, 29918, 19207, 29922, 29906, 29897, 13, 20633, 7187, 3960, 15349, 29918, 28212, 29918, 19795, 1529, 2797, 353, 282, 10270, 29918, 6519, 29898, 29896, 29892, 29871, 29900, 29892, 19471, 29918, 19207, 29922, 29896, 29897, 13, 20633, 7187, 3960, 15349, 29918, 29925, 2190, 9375, 29918, 19795, 1529, 2797, 353, 282, 10270, 29918, 6519, 29898, 29906, 29892, 29871, 29900, 29897, 13, 13, 29924, 26027, 29918, 19795, 1529, 2797, 353, 7023, 2378, 4197, 13, 462, 308, 29900, 29916, 29900, 29953, 29892, 396, 2643, 3309, 13, 462, 308, 29900, 29916, 29900, 29900, 29892, 396, 443, 3880, 29892, 2337, 29871, 29900, 13, 462, 308, 29900, 29916, 29900, 29896, 29892, 396, 2643, 1134, 313, 29900, 29896, 353, 14533, 21582, 29897, 13, 462, 308, 29900, 29916, 29896, 29906, 29892, 396, 6084, 19766, 2875, 313, 29896, 29906, 353, 7977, 29897, 13, 462, 308, 29900, 29916, 29900, 29896, 29892, 396, 6084, 5858, 313, 29896, 353, 731, 716, 995, 29897, 13, 462, 308, 29900, 29916, 29900, 29900, 29871, 396, 716, 995, 313, 29900, 353, 286, 1082, 29892, 29871, 29896, 29900, 29900, 353, 2989, 7977, 29897, 13, 462, 308, 2314, 13, 23711, 6007, 8186, 1783, 29918, 19795, 1529, 2797, 353, 7023, 2378, 4197, 13, 462, 308, 29900, 29916, 29900, 29946, 29892, 396, 2643, 3309, 13, 462, 308, 29900, 29916, 29900, 29900, 29892, 396, 443, 3880, 29892, 2337, 29871, 29900, 13, 462, 308, 29900, 29916, 29900, 29906, 29892, 396, 2643, 1134, 313, 29900, 29906, 353, 379, 7466, 319, 1953, 29897, 13, 462, 308, 29900, 29916, 29900, 29906, 29892, 396, 6084, 3158, 313, 29900, 29906, 353, 766, 6915, 29897, 13, 462, 308, 2314, 13, 29911, 24015, 29918, 27681, 29918, 19795, 1529, 2797, 353, 7023, 2378, 4197, 13, 462, 308, 29900, 29916, 29900, 29946, 29892, 396, 2643, 3309, 13, 462, 308, 29900, 29916, 29900, 29900, 29892, 396, 443, 3880, 29892, 2337, 29871, 29900, 13, 462, 308, 29900, 29916, 29900, 29906, 29892, 396, 2643, 1134, 313, 29900, 29906, 353, 379, 7466, 319, 1953, 29897, 13, 462, 308, 29900, 29916, 29900, 29896, 29892, 396, 6084, 3158, 313, 29900, 29896, 353, 2507, 1283, 29897, 13, 462, 308, 2314, 13, 13, 29933, 1177, 19926, 29918, 1692, 1254, 11499, 29903, 353, 426, 396, 1556, 5517, 2743, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29901, 376, 29933, 3427, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29901, 376, 24110, 29906, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29901, 376, 24110, 29946, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29901, 376, 24110, 29947, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29901, 376, 2713, 1296, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29901, 376, 24110, 29941, 29906, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 24110, 29953, 29946, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 24110, 29896, 29906, 29947, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 27407, 292, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 29943, 579, 11631, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 4300, 18411, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 16382, 29943, 497, 20647, 1161, 613, 13, 462, 29900, 29890, 29900, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 21602, 7277, 613, 13, 462, 29900, 29890, 29900, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 1123, 3901, 613, 13, 462, 29900, 29890, 29900, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 24110, 29896, 29953, 29941, 29947, 29946, 613, 13, 462, 29900, 29890, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29901, 376, 29967, 3427, 29908, 13, 29913, 13, 2 ]
setup.py
tikazyq/google-analytics-api-wrapper
6
160183
<filename>setup.py<gh_stars>1-10 from distutils.core import setup setup( name='google-analytics-api-wrapper', version='0.1.4', packages=['analytics_query'], url='https://github.com/tikazyq/google-analytics-api-wrapper', download_url='https://github.com/tikazyq/google-analytics-api-wrapper/tarball/master', license='http://opensource.org/licenses/MIT', author='<NAME>', author_email='<EMAIL>', description='The Goolge Analytics wrapper is a convenient tool to extract data from GA via API. It is especially ' 'useful when the user has many GA profiles / web properties.', keywords=['google-analytics', 'ga', 'pandas', 'dataframe', 'api'] )
[ 1, 529, 9507, 29958, 14669, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 1320, 13239, 29889, 3221, 1053, 6230, 13, 13, 14669, 29898, 13, 1678, 1024, 2433, 3608, 29899, 7054, 22026, 29899, 2754, 29899, 17699, 742, 13, 1678, 1873, 2433, 29900, 29889, 29896, 29889, 29946, 742, 13, 1678, 9741, 29922, 1839, 7054, 22026, 29918, 1972, 7464, 13, 1678, 3142, 2433, 991, 597, 3292, 29889, 510, 29914, 29873, 638, 24683, 29939, 29914, 3608, 29899, 7054, 22026, 29899, 2754, 29899, 17699, 742, 13, 1678, 5142, 29918, 2271, 2433, 991, 597, 3292, 29889, 510, 29914, 29873, 638, 24683, 29939, 29914, 3608, 29899, 7054, 22026, 29899, 2754, 29899, 17699, 29914, 12637, 2135, 29914, 6207, 742, 13, 1678, 19405, 2433, 1124, 597, 22156, 1167, 29889, 990, 29914, 506, 11259, 29914, 26349, 742, 13, 1678, 4148, 2433, 29966, 5813, 29958, 742, 13, 1678, 4148, 29918, 5269, 2433, 29966, 26862, 6227, 29958, 742, 13, 1678, 6139, 2433, 1576, 402, 1507, 479, 11597, 22026, 14476, 338, 263, 19192, 5780, 304, 6597, 848, 515, 402, 29909, 3025, 3450, 29889, 739, 338, 7148, 525, 13, 18884, 525, 1509, 1319, 746, 278, 1404, 756, 1784, 402, 29909, 28723, 847, 1856, 4426, 29889, 742, 13, 1678, 29361, 29922, 1839, 3608, 29899, 7054, 22026, 742, 525, 3249, 742, 525, 15112, 742, 525, 1272, 2557, 742, 525, 2754, 2033, 13, 29897, 13, 2 ]
src/hbcomp/app.py
zgoda/hbcomp
0
36657
import os from logging.config import dictConfig from typing import Optional from flask import render_template, request, send_from_directory from flask_babel import get_locale, lazy_gettext as _ from werkzeug.utils import ImportStringError from .auth import auth_bp from .comp import comp_bp from .ext import babel, csrf, db, login_manager, pages from .home import home_bp from .models import User from .profile import profile_bp from .utils import pagination from .utils.app import Application __all__ = ['create_app'] def create_app(env: Optional[str] = None) -> Application: flask_environment = os.environ.get('FLASK_ENV', '').lower() if flask_environment == 'production': configure_logging() app = Application() configure_app(app, env) configure_extensions(app) with app.app_context(): configure_blueprints(app) configure_templates(app) configure_error_handlers(app) return app def configure_app(app: Application, env: Optional[str]): app.config.from_object('hbcomp.config') if env is not None: try: app.config.from_object(f'hbcomp.config_{env}') except ImportStringError: app.logger.info(f'no environment configuration for {env}') if app.config['DEBUG']: @app.route('/favicon.ico') def favicon(): return send_from_directory( os.path.join(app.root_path, 'static'), 'favicon.ico', mimetype='image/vnd.microsoft.icon' ) def configure_blueprints(app: Application): app.register_blueprint(home_bp) app.register_blueprint(profile_bp, url_prefix='/profile') app.register_blueprint(comp_bp, url_prefix='/comp') app.register_blueprint(auth_bp, url_prefix='/auth') def configure_extensions(app: Application): db.init_app(app) csrf.init_app(app) pages.init_app(app) pages.get('foo') if not app.testing: @babel.localeselector def get_locale(): accept_languages = app.config.get('ACCEPT_LANGUAGES', ['pl', 'en']) return request.accept_languages.best_match(accept_languages) @login_manager.user_loader def load_user(user_id): return User.query.get(user_id) babel.init_app(app) login_manager.init_app(app) login_manager.login_view = 'auth.login' login_manager.login_message = _('Please log in to access this page') login_manager.login_message_category = 'warning' def configure_templates(app: Application): app.jinja_env.globals.update({ 'url_for_other_page': pagination.url_for_other_page, 'get_locale': get_locale, }) def configure_logging(): dictConfig({ 'version': 1, 'formatters': { 'default': { 'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s' } }, 'handlers': { 'wsgi': { 'class': 'logging.StreamHandler', 'stream': 'ext://flask.logging.wsgi_errors_stream', 'formatter': 'default', } }, 'root': { 'level': 'INFO', 'handlers': ['wsgi'], }, }) def configure_error_handlers(app: Application): @app.errorhandler(403) def forbidden_page(error): return render_template('errors/403.html'), 403 @app.errorhandler(404) def page_not_found(error): return render_template('errors/404.html'), 404 @app.errorhandler(500) def server_error_page(error): return render_template('errors/500.html'), 500
[ 1, 1053, 2897, 13, 3166, 12183, 29889, 2917, 1053, 9657, 3991, 13, 3166, 19229, 1053, 28379, 13, 13, 3166, 29784, 1053, 4050, 29918, 6886, 29892, 2009, 29892, 3638, 29918, 3166, 29918, 12322, 13, 3166, 29784, 29918, 28727, 1053, 679, 29918, 23337, 29892, 17366, 29918, 657, 726, 408, 903, 13, 3166, 23085, 13289, 29889, 13239, 1053, 16032, 1231, 2392, 13, 13, 3166, 869, 5150, 1053, 4817, 29918, 25288, 13, 3166, 869, 2388, 1053, 752, 29918, 25288, 13, 3166, 869, 1062, 1053, 289, 1107, 29892, 5939, 9600, 29892, 4833, 29892, 6464, 29918, 12847, 29892, 6515, 13, 3166, 869, 5184, 1053, 3271, 29918, 25288, 13, 3166, 869, 9794, 1053, 4911, 13, 3166, 869, 10185, 1053, 8722, 29918, 25288, 13, 3166, 869, 13239, 1053, 10203, 3381, 13, 3166, 869, 13239, 29889, 932, 1053, 8427, 13, 13, 1649, 497, 1649, 353, 6024, 3258, 29918, 932, 2033, 13, 13, 13, 1753, 1653, 29918, 932, 29898, 6272, 29901, 28379, 29961, 710, 29962, 353, 6213, 29897, 1599, 8427, 29901, 13, 1678, 29784, 29918, 20944, 353, 2897, 29889, 21813, 29889, 657, 877, 10536, 3289, 29968, 29918, 25838, 742, 525, 2824, 13609, 580, 13, 1678, 565, 29784, 29918, 20944, 1275, 525, 24601, 2396, 13, 4706, 10822, 29918, 21027, 580, 13, 1678, 623, 353, 8427, 580, 13, 1678, 10822, 29918, 932, 29898, 932, 29892, 8829, 29897, 13, 1678, 10822, 29918, 24299, 29898, 932, 29897, 13, 1678, 411, 623, 29889, 932, 29918, 4703, 7295, 13, 4706, 10822, 29918, 9539, 2158, 29879, 29898, 932, 29897, 13, 4706, 10822, 29918, 20943, 29898, 932, 29897, 13, 4706, 10822, 29918, 2704, 29918, 3179, 9306, 29898, 932, 29897, 13, 1678, 736, 623, 13, 13, 13, 1753, 10822, 29918, 932, 29898, 932, 29901, 8427, 29892, 8829, 29901, 28379, 29961, 710, 29962, 1125, 13, 1678, 623, 29889, 2917, 29889, 3166, 29918, 3318, 877, 29882, 29890, 2388, 29889, 2917, 1495, 13, 1678, 565, 8829, 338, 451, 6213, 29901, 13, 4706, 1018, 29901, 13, 9651, 623, 29889, 2917, 29889, 3166, 29918, 3318, 29898, 29888, 29915, 29882, 29890, 2388, 29889, 2917, 648, 6272, 29913, 1495, 13, 4706, 5174, 16032, 1231, 2392, 29901, 13, 9651, 623, 29889, 21707, 29889, 3888, 29898, 29888, 29915, 1217, 5177, 5285, 363, 426, 6272, 29913, 1495, 13, 1678, 565, 623, 29889, 2917, 1839, 18525, 2033, 29901, 13, 4706, 732, 932, 29889, 13134, 11219, 29888, 485, 4144, 29889, 1417, 1495, 13, 4706, 822, 5025, 4144, 7295, 13, 9651, 736, 3638, 29918, 3166, 29918, 12322, 29898, 13, 18884, 2897, 29889, 2084, 29889, 7122, 29898, 932, 29889, 4632, 29918, 2084, 29892, 525, 7959, 5477, 525, 29888, 485, 4144, 29889, 1417, 742, 13, 18884, 286, 17528, 668, 2433, 3027, 29914, 29894, 299, 29889, 4994, 29889, 4144, 29915, 13, 9651, 1723, 13, 13, 13, 1753, 10822, 29918, 9539, 2158, 29879, 29898, 932, 29901, 8427, 1125, 13, 1678, 623, 29889, 9573, 29918, 9539, 2158, 29898, 5184, 29918, 25288, 29897, 13, 1678, 623, 29889, 9573, 29918, 9539, 2158, 29898, 10185, 29918, 25288, 29892, 3142, 29918, 13506, 2433, 29914, 10185, 1495, 13, 1678, 623, 29889, 9573, 29918, 9539, 2158, 29898, 2388, 29918, 25288, 29892, 3142, 29918, 13506, 2433, 29914, 2388, 1495, 13, 1678, 623, 29889, 9573, 29918, 9539, 2158, 29898, 5150, 29918, 25288, 29892, 3142, 29918, 13506, 2433, 29914, 5150, 1495, 13, 13, 13, 1753, 10822, 29918, 24299, 29898, 932, 29901, 8427, 1125, 13, 1678, 4833, 29889, 2344, 29918, 932, 29898, 932, 29897, 13, 1678, 5939, 9600, 29889, 2344, 29918, 932, 29898, 932, 29897, 13, 1678, 6515, 29889, 2344, 29918, 932, 29898, 932, 29897, 13, 1678, 6515, 29889, 657, 877, 5431, 1495, 13, 13, 1678, 565, 451, 623, 29889, 13424, 29901, 13, 4706, 732, 28727, 29889, 2997, 968, 781, 272, 13, 4706, 822, 679, 29918, 23337, 7295, 13, 9651, 3544, 29918, 29880, 8737, 353, 623, 29889, 2917, 29889, 657, 877, 2477, 4741, 7982, 29918, 29931, 19453, 29965, 10461, 29903, 742, 6024, 572, 742, 525, 264, 11287, 13, 9651, 736, 2009, 29889, 16044, 29918, 29880, 8737, 29889, 13318, 29918, 4352, 29898, 16044, 29918, 29880, 8737, 29897, 13, 13, 4706, 732, 7507, 29918, 12847, 29889, 1792, 29918, 12657, 13, 4706, 822, 2254, 29918, 1792, 29898, 1792, 29918, 333, 1125, 13, 9651, 736, 4911, 29889, 1972, 29889, 657, 29898, 1792, 29918, 333, 29897, 13, 13, 1678, 289, 1107, 29889, 2344, 29918, 932, 29898, 932, 29897, 13, 13, 1678, 6464, 29918, 12847, 29889, 2344, 29918, 932, 29898, 932, 29897, 13, 1678, 6464, 29918, 12847, 29889, 7507, 29918, 1493, 353, 525, 5150, 29889, 7507, 29915, 13, 1678, 6464, 29918, 12847, 29889, 7507, 29918, 4906, 353, 903, 877, 12148, 1480, 297, 304, 2130, 445, 1813, 1495, 13, 1678, 6464, 29918, 12847, 29889, 7507, 29918, 4906, 29918, 7320, 353, 525, 27392, 29915, 13, 13, 13, 1753, 10822, 29918, 20943, 29898, 932, 29901, 8427, 1125, 13, 1678, 623, 29889, 28789, 1764, 29918, 6272, 29889, 23705, 1338, 29889, 5504, 3319, 13, 4706, 525, 2271, 29918, 1454, 29918, 1228, 29918, 3488, 2396, 10203, 3381, 29889, 2271, 29918, 1454, 29918, 1228, 29918, 3488, 29892, 13, 4706, 525, 657, 29918, 23337, 2396, 679, 29918, 23337, 29892, 13, 1678, 5615, 13, 13, 13, 1753, 10822, 29918, 21027, 7295, 13, 1678, 9657, 3991, 3319, 13, 4706, 525, 3259, 2396, 29871, 29896, 29892, 13, 4706, 525, 4830, 2153, 2396, 426, 13, 9651, 525, 4381, 2396, 426, 13, 18884, 525, 4830, 2396, 525, 29961, 29995, 29898, 294, 312, 603, 29897, 29879, 29962, 1273, 29898, 5563, 978, 29897, 29879, 297, 1273, 29898, 5453, 29897, 29879, 29901, 1273, 29898, 4906, 29897, 29879, 29915, 13, 9651, 500, 13, 4706, 2981, 13, 4706, 525, 3179, 9306, 2396, 426, 13, 9651, 525, 5652, 3146, 2396, 426, 13, 18884, 525, 1990, 2396, 525, 21027, 29889, 3835, 4598, 742, 13, 18884, 525, 5461, 2396, 525, 1062, 597, 1579, 1278, 29889, 21027, 29889, 5652, 3146, 29918, 12523, 29918, 5461, 742, 13, 18884, 525, 689, 2620, 2396, 525, 4381, 742, 13, 9651, 500, 13, 4706, 2981, 13, 4706, 525, 4632, 2396, 426, 13, 9651, 525, 5563, 2396, 525, 11690, 742, 13, 9651, 525, 3179, 9306, 2396, 6024, 5652, 3146, 7464, 13, 4706, 2981, 13, 1678, 5615, 13, 13, 13, 1753, 10822, 29918, 2704, 29918, 3179, 9306, 29898, 932, 29901, 8427, 1125, 13, 13, 1678, 732, 932, 29889, 2704, 13789, 29898, 29946, 29900, 29941, 29897, 13, 1678, 822, 19752, 4215, 29918, 3488, 29898, 2704, 1125, 13, 4706, 736, 4050, 29918, 6886, 877, 12523, 29914, 29946, 29900, 29941, 29889, 1420, 5477, 29871, 29946, 29900, 29941, 13, 13, 1678, 732, 932, 29889, 2704, 13789, 29898, 29946, 29900, 29946, 29897, 13, 1678, 822, 1813, 29918, 1333, 29918, 11940, 29898, 2704, 1125, 13, 4706, 736, 4050, 29918, 6886, 877, 12523, 29914, 29946, 29900, 29946, 29889, 1420, 5477, 29871, 29946, 29900, 29946, 13, 13, 1678, 732, 932, 29889, 2704, 13789, 29898, 29945, 29900, 29900, 29897, 13, 1678, 822, 1923, 29918, 2704, 29918, 3488, 29898, 2704, 1125, 13, 4706, 736, 4050, 29918, 6886, 877, 12523, 29914, 29945, 29900, 29900, 29889, 1420, 5477, 29871, 29945, 29900, 29900, 13, 2 ]
src/sample_mnist.py
entaku/kusarigama
0
65698
__author__ = 'team-entaku' import sys import cv2 import numpy as np import math import matplotlib.pyplot as plt import scipy.cluster.vq import scipy.spatial.distance as distance from chainer import computational_graph as c from matplotlib.pyplot import show from scipy.cluster.hierarchy import linkage, dendrogram, fcluster import random import argparse import pickle import six import chainer from chainer import computational_graph as c from chainer import cuda import chainer.functions as F from chainer import optimizers if __name__ == "__main__": file_name = sys.argv[1] orig = cv2.imread(file_name, 1) gray = cv2.cvtColor(orig, cv2.COLOR_BGR2GRAY) gray_float = gray.astype('float32') gray28 = 1 - (cv2.resize(gray_float, (28, 28)) / 255.) gray28.resize((1, 784)) h0 = chainer.Variable(gray28) model = pickle.load(open('trained-mnist-model', 'rb')) h1 = model.l1(h0) h2 = model.l2(h1) y = model.l3(h2) print y.data print F.softmax(y).data
[ 1, 4770, 8921, 1649, 353, 525, 14318, 29899, 296, 16774, 29915, 13, 5215, 10876, 13, 5215, 13850, 29906, 13, 5215, 12655, 408, 7442, 13, 5215, 5844, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 4560, 2272, 29889, 19594, 29889, 29894, 29939, 13, 5215, 4560, 2272, 29889, 1028, 15238, 29889, 19244, 408, 5418, 13, 3166, 521, 4008, 1053, 26845, 29918, 4262, 408, 274, 13, 3166, 22889, 29889, 2272, 5317, 1053, 1510, 13, 3166, 4560, 2272, 29889, 19594, 29889, 29882, 631, 12040, 1053, 1544, 482, 29892, 270, 355, 307, 1393, 29892, 285, 19594, 13, 5215, 4036, 13, 13, 5215, 1852, 5510, 13, 13, 5215, 5839, 280, 13, 5215, 4832, 13, 13, 5215, 521, 4008, 13, 3166, 521, 4008, 1053, 26845, 29918, 4262, 408, 274, 13, 3166, 521, 4008, 1053, 274, 6191, 13, 5215, 521, 4008, 29889, 12171, 408, 383, 13, 3166, 521, 4008, 1053, 5994, 19427, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 934, 29918, 978, 353, 10876, 29889, 19218, 29961, 29896, 29962, 13, 1678, 1677, 353, 13850, 29906, 29889, 326, 949, 29898, 1445, 29918, 978, 29892, 29871, 29896, 29897, 13, 1678, 16749, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 12683, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 1678, 16749, 29918, 7411, 353, 16749, 29889, 579, 668, 877, 7411, 29941, 29906, 1495, 13, 1678, 16749, 29906, 29947, 353, 29871, 29896, 448, 313, 11023, 29906, 29889, 21476, 29898, 21012, 29918, 7411, 29892, 313, 29906, 29947, 29892, 29871, 29906, 29947, 876, 847, 29871, 29906, 29945, 29945, 1846, 13, 1678, 16749, 29906, 29947, 29889, 21476, 3552, 29896, 29892, 29871, 29955, 29947, 29946, 876, 13, 1678, 298, 29900, 353, 521, 4008, 29889, 16174, 29898, 21012, 29906, 29947, 29897, 13, 1678, 1904, 353, 5839, 280, 29889, 1359, 29898, 3150, 877, 3018, 1312, 29899, 23521, 391, 29899, 4299, 742, 525, 6050, 8785, 13, 1678, 298, 29896, 353, 1904, 29889, 29880, 29896, 29898, 29882, 29900, 29897, 13, 1678, 298, 29906, 353, 1904, 29889, 29880, 29906, 29898, 29882, 29896, 29897, 13, 1678, 343, 353, 1904, 29889, 29880, 29941, 29898, 29882, 29906, 29897, 13, 1678, 1596, 343, 29889, 1272, 13, 1678, 1596, 383, 29889, 2695, 3317, 29898, 29891, 467, 1272, 13, 2 ]
catalyst/dl/experiment/config.py
baajur/catalyst
0
129448
<gh_stars>0 from typing import Any, Callable, Dict, List, Mapping, Union from collections import OrderedDict from copy import deepcopy import torch from torch import nn from torch.utils.data import DataLoader # noqa F401 from catalyst.core import IExperiment from catalyst.data import Augmentor, AugmentorCompose from catalyst.dl import ( Callback, CheckpointCallback, CheckRunCallback, ConsoleLogger, CriterionCallback, ExceptionCallback, MetricManagerCallback, OptimizerCallback, SchedulerCallback, TensorboardLogger, TimerCallback, utils, ValidationManagerCallback, VerboseLogger, ) from catalyst.dl.registry import ( CALLBACKS, CRITERIONS, MODELS, OPTIMIZERS, SCHEDULERS, TRANSFORMS, ) from catalyst.tools.typing import Criterion, Model, Optimizer, Scheduler class ConfigExperiment(IExperiment): """ Experiment created from a configuration file. """ STAGE_KEYWORDS = [ "criterion_params", "optimizer_params", "scheduler_params", "data_params", "transform_params", "stage_params", "callbacks_params", ] def __init__(self, config: Dict): """ Args: config (dict): dictionary of parameters """ self._config: Dict = deepcopy(config) self._initial_seed: int = self._config.get("args", {}).get("seed", 42) self._verbose: bool = self._config.get("args", {}).get( "verbose", False ) self._check_run: bool = self._config.get("args", {}).get( "check", False ) self._check_time: bool = self._config.get("args", {}).get( "timeit", False ) self.__prepare_logdir() self._config["stages"]["stage_params"] = utils.merge_dicts( deepcopy( self._config["stages"].get("state_params", {}) ), # saved for backward compatibility deepcopy(self._config["stages"].get("stage_params", {})), deepcopy(self._config.get("args", {})), {"logdir": self._logdir}, ) self.stages_config: Dict = self._get_stages_config( self._config["stages"] ) @property def hparams(self) -> OrderedDict: """Returns hyper params""" return OrderedDict(self._config) def __prepare_logdir(self): EXCLUDE_TAG = "none" logdir = self._config.get("args", {}).get("logdir", None) baselogdir = self._config.get("args", {}).get("baselogdir", None) if logdir is not None and logdir.lower() != EXCLUDE_TAG: self._logdir = logdir elif baselogdir is not None and baselogdir.lower() != EXCLUDE_TAG: logdir_postfix = self._get_logdir(self._config) self._logdir = f"{baselogdir}/{logdir_postfix}" else: self._logdir = None def _get_stages_config(self, stages_config: Dict): stages_defaults = {} stages_config_out = OrderedDict() for key in self.STAGE_KEYWORDS: if key == "stage_params": # backward compatibility stages_defaults[key] = utils.merge_dicts( deepcopy(stages_config.get("state_params", {})), deepcopy(stages_config.get(key, {})), ) else: stages_defaults[key] = deepcopy(stages_config.get(key, {})) for stage in stages_config: if ( stage in self.STAGE_KEYWORDS or stage == "state_params" or stages_config.get(stage) is None ): continue stages_config_out[stage] = {} for key in self.STAGE_KEYWORDS: if key == "stage_params": # backward compatibility stages_config_out[stage][key] = utils.merge_dicts( deepcopy(stages_defaults.get("state_params", {})), deepcopy(stages_defaults.get(key, {})), deepcopy(stages_config[stage].get("state_params", {})), deepcopy(stages_config[stage].get(key, {})), ) else: stages_config_out[stage][key] = utils.merge_dicts( deepcopy(stages_defaults.get(key, {})), deepcopy(stages_config[stage].get(key, {})), ) return stages_config_out def _get_logdir(self, config: Dict) -> str: timestamp = utils.get_utcnow_time() config_hash = utils.get_short_hash(config) logdir = f"{timestamp}.{config_hash}" return logdir @property def initial_seed(self) -> int: """Experiment's initial seed value.""" return self._initial_seed @property def logdir(self): """Path to the directory where the experiment logs.""" return self._logdir @property def stages(self) -> List[str]: """Experiment's stage names.""" stages_keys = list(self.stages_config.keys()) return stages_keys @property def distributed_params(self) -> Dict: """Dict with the parameters for distributed and FP16 methond.""" return self._config.get("distributed_params", {}) def get_stage_params(self, stage: str) -> Mapping[str, Any]: """Returns the state parameters for a given stage.""" return self.stages_config[stage].get("stage_params", {}) @staticmethod def _get_model(**params): key_value_flag = params.pop("_key_value", False) if key_value_flag: model = {} for key, params_ in params.items(): model[key] = ConfigExperiment._get_model(**params_) model = nn.ModuleDict(model) else: model = MODELS.get_from_params(**params) return model def get_model(self, stage: str): """Returns the model for a given stage.""" model_params = self._config["model_params"] model = self._get_model(**model_params) return model @staticmethod def _get_criterion(**params): key_value_flag = params.pop("_key_value", False) if key_value_flag: criterion = {} for key, params_ in params.items(): criterion[key] = ConfigExperiment._get_criterion(**params_) else: criterion = CRITERIONS.get_from_params(**params) if criterion is not None and torch.cuda.is_available(): criterion = criterion.cuda() return criterion def get_criterion(self, stage: str) -> Criterion: """Returns the criterion for a given stage.""" criterion_params = self.stages_config[stage].get( "criterion_params", {} ) criterion = self._get_criterion(**criterion_params) return criterion def _get_optimizer( self, stage: str, model: Union[Model, Dict[str, Model]], **params ) -> Optimizer: # @TODO 1: refactoring; this method is too long # @TODO 2: load state dicts for schedulers & criterion layerwise_params = params.pop("layerwise_params", OrderedDict()) no_bias_weight_decay = params.pop("no_bias_weight_decay", True) # linear scaling rule from https://arxiv.org/pdf/1706.02677.pdf lr_scaling_params = params.pop("lr_linear_scaling", None) if lr_scaling_params: data_params = dict(self.stages_config[stage]["data_params"]) batch_size = data_params.get("batch_size") per_gpu_scaling = data_params.get("per_gpu_scaling", False) distributed_rank = utils.get_rank() distributed = distributed_rank > -1 if per_gpu_scaling and not distributed: num_gpus = max(1, torch.cuda.device_count()) batch_size *= num_gpus base_lr = lr_scaling_params.get("lr") base_batch_size = lr_scaling_params.get("base_batch_size", 256) lr_scaling = batch_size / base_batch_size params["lr"] = base_lr * lr_scaling # scale default lr else: lr_scaling = 1.0 # getting model parameters model_key = params.pop("_model", None) if model_key is None: assert isinstance( model, nn.Module ), "model is key-value, but optimizer has no specified model" model_params = utils.process_model_params( model, layerwise_params, no_bias_weight_decay, lr_scaling ) elif isinstance(model_key, str): model_params = utils.process_model_params( model[model_key], layerwise_params, no_bias_weight_decay, lr_scaling, ) elif isinstance(model_key, (list, tuple)): model_params = [] for model_key_ in model_key: model_params_ = utils.process_model_params( model[model_key_], layerwise_params, no_bias_weight_decay, lr_scaling, ) model_params.extend(model_params_) else: raise ValueError("unknown type of model_params") load_from_previous_stage = params.pop( "load_from_previous_stage", False ) optimizer_key = params.pop("optimizer_key", None) optimizer = OPTIMIZERS.get_from_params(**params, params=model_params) if load_from_previous_stage and self.stages.index(stage) != 0: checkpoint_path = f"{self.logdir}/checkpoints/best_full.pth" checkpoint = utils.load_checkpoint(checkpoint_path) dict2load = optimizer if optimizer_key is not None: dict2load = {optimizer_key: optimizer} utils.unpack_checkpoint(checkpoint, optimizer=dict2load) # move optimizer to device device = utils.get_device() for param in model_params: param = param["params"][0] optimizer_state = optimizer.state[param] for key, value in optimizer_state.items(): optimizer_state[key] = utils.any2device(value, device) # update optimizer params for key, value in params.items(): for pg in optimizer.param_groups: pg[key] = value return optimizer def get_optimizer( self, stage: str, model: Union[Model, Dict[str, Model]] ) -> Union[Optimizer, Dict[str, Optimizer]]: """Returns the optimizer for a given stage. Args: stage (str): stage name model (Union[Model, Dict[str, Model]]): model or a dict of models """ optimizer_params = self.stages_config[stage].get( "optimizer_params", {} ) key_value_flag = optimizer_params.pop("_key_value", False) if key_value_flag: optimizer = {} for key, params_ in optimizer_params.items(): # load specified optimizer from checkpoint optimizer_key = "optimizer_key" assert optimizer_key not in params_, "keyword reserved" params_[optimizer_key] = key optimizer[key] = self._get_optimizer(stage, model, **params_) else: optimizer = self._get_optimizer(stage, model, **optimizer_params) return optimizer @staticmethod def _get_scheduler(*, optimizer, **params): key_value_flag = params.pop("_key_value", False) if key_value_flag: scheduler = {} for key, params_ in params.items(): scheduler[key] = ConfigExperiment._get_scheduler( optimizer=optimizer, **params_ ) else: scheduler = SCHEDULERS.get_from_params( **params, optimizer=optimizer ) return scheduler def get_scheduler(self, stage: str, optimizer: Optimizer) -> Scheduler: """Returns the scheduler for a given stage.""" scheduler_params = self.stages_config[stage].get( "scheduler_params", {} ) scheduler = self._get_scheduler( optimizer=optimizer, **scheduler_params ) return scheduler @staticmethod def _get_transform(**params) -> Callable: key_value_flag = params.pop("_key_value", False) if key_value_flag: transforms_composition = { key: ConfigExperiment._get_transform(**params_) for key, params_ in params.items() } transform = AugmentorCompose( { key: Augmentor( dict_key=key, augment_fn=transform, input_key=key, output_key=key, ) for key, transform in transforms_composition.items() } ) else: if "transforms" in params: transforms_composition = [ ConfigExperiment._get_transform(**transform_params) for transform_params in params["transforms"] ] params.update(transforms=transforms_composition) transform = TRANSFORMS.get_from_params(**params) return transform def get_transforms( self, stage: str = None, dataset: str = None ) -> Callable: """Returns transform for a given stage and mode. Args: stage (str): stage name dataset (str): dataset name (e.g. "train", "valid"), will be used only if the value of `_key_value`` is ``True`` """ transform_params = deepcopy( self.stages_config[stage].get("transform_params", {}) ) key_value_flag = transform_params.pop("_key_value", False) if key_value_flag: transform_params = transform_params.get(dataset, {}) transform = self._get_transform(**transform_params) if transform is None: def transform(dict_): return dict_ elif not isinstance(transform, AugmentorCompose): transform_ = transform def transform(dict_): return transform_(**dict_) return transform def get_loaders( self, stage: str, epoch: int = None, ) -> "OrderedDict[str, DataLoader]": """Returns the loaders for a given stage.""" data_params = dict(self.stages_config[stage]["data_params"]) loaders = utils.get_loaders_from_params( get_datasets_fn=self.get_datasets, initial_seed=self.initial_seed, stage=stage, **data_params, ) return loaders @staticmethod def _get_callback(**params): wrapper_params = params.pop("_wrapper", None) callback = CALLBACKS.get_from_params(**params) if wrapper_params is not None: wrapper_params["base_callback"] = callback return ConfigExperiment._get_callback(**wrapper_params) return callback @staticmethod def _process_callbacks(callbacks: OrderedDict) -> None: """ Iterate over each of the callbacks and update approptiate parameters required for success run of config experiment. Arguments: callbacks (OrderedDict): finalized order of callbacks. """ for callback in callbacks.values(): if isinstance(callback, CheckpointCallback): if callback.load_on_stage_start is None: callback.load_on_stage_start = "best" if ( isinstance(callback.load_on_stage_start, dict) and "model" not in callback.load_on_stage_start ): callback.load_on_stage_start["model"] = "best" def get_callbacks(self, stage: str) -> "OrderedDict[Callback]": """Returns the callbacks for a given stage.""" callbacks_params = self.stages_config[stage].get( "callbacks_params", {} ) callbacks = OrderedDict() for key, callback_params in callbacks_params.items(): callback = self._get_callback(**callback_params) callbacks[key] = callback default_callbacks = [] if self._verbose: default_callbacks.append(("_verbose", VerboseLogger)) if self._check_time: default_callbacks.append(("_timer", TimerCallback)) if self._check_run: default_callbacks.append(("_check", CheckRunCallback)) if not stage.startswith("infer"): default_callbacks.append(("_metrics", MetricManagerCallback)) default_callbacks.append( ("_validation", ValidationManagerCallback) ) default_callbacks.append(("_console", ConsoleLogger)) if self.logdir is not None: default_callbacks.append(("_saver", CheckpointCallback)) default_callbacks.append(("_tensorboard", TensorboardLogger)) if self.stages_config[stage].get("criterion_params", {}): default_callbacks.append(("_criterion", CriterionCallback)) if self.stages_config[stage].get("optimizer_params", {}): default_callbacks.append(("_optimizer", OptimizerCallback)) if self.stages_config[stage].get("scheduler_params", {}): default_callbacks.append(("_scheduler", SchedulerCallback)) default_callbacks.append(("_exception", ExceptionCallback)) for callback_name, callback_fn in default_callbacks: is_already_present = False for x in callbacks.values(): if isinstance(x, callback_fn): is_already_present = True break if not is_already_present: callbacks[callback_name] = callback_fn() self._process_callbacks(callbacks) return callbacks __all__ = ["ConfigExperiment"]
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 19229, 1053, 3139, 29892, 8251, 519, 29892, 360, 919, 29892, 2391, 29892, 341, 20304, 29892, 7761, 13, 3166, 16250, 1053, 8170, 287, 21533, 13, 3166, 3509, 1053, 6483, 8552, 13, 13, 5215, 4842, 305, 13, 3166, 4842, 305, 1053, 302, 29876, 13, 3166, 4842, 305, 29889, 13239, 29889, 1272, 1053, 3630, 10036, 29871, 396, 694, 25621, 383, 29946, 29900, 29896, 13, 13, 3166, 17246, 858, 29889, 3221, 1053, 306, 1252, 15362, 13, 3166, 17246, 858, 29889, 1272, 1053, 22333, 358, 272, 29892, 22333, 358, 272, 1523, 4220, 13, 3166, 17246, 858, 29889, 11671, 1053, 313, 13, 1678, 8251, 1627, 29892, 13, 1678, 5399, 3149, 10717, 29892, 13, 1678, 5399, 6558, 10717, 29892, 13, 1678, 9405, 16363, 29892, 13, 1678, 315, 5385, 291, 10717, 29892, 13, 1678, 8960, 10717, 29892, 13, 1678, 4737, 2200, 3260, 10717, 29892, 13, 1678, 20693, 326, 3950, 10717, 29892, 13, 1678, 1102, 14952, 10717, 29892, 13, 1678, 323, 6073, 3377, 16363, 29892, 13, 1678, 29168, 10717, 29892, 13, 1678, 3667, 29879, 29892, 13, 1678, 15758, 362, 3260, 10717, 29892, 13, 1678, 1798, 15828, 16363, 29892, 13, 29897, 13, 3166, 17246, 858, 29889, 11671, 29889, 1727, 6020, 1053, 313, 13, 1678, 315, 9818, 29933, 11375, 29903, 29892, 13, 1678, 15600, 1806, 1001, 27946, 29892, 13, 1678, 16999, 2287, 8547, 29892, 13, 1678, 6418, 29911, 7833, 26664, 23598, 29892, 13, 1678, 317, 3210, 3352, 13309, 23598, 29892, 13, 1678, 10014, 2190, 20322, 1955, 4345, 29892, 13, 29897, 13, 3166, 17246, 858, 29889, 8504, 29889, 1017, 15702, 1053, 315, 5385, 291, 29892, 8125, 29892, 20693, 326, 3950, 29892, 1102, 14952, 13, 13, 13, 1990, 12782, 1252, 15362, 29898, 29902, 1252, 15362, 1125, 13, 1678, 9995, 13, 1678, 1222, 15362, 2825, 515, 263, 5285, 934, 29889, 13, 1678, 9995, 13, 13, 1678, 317, 6040, 1692, 29918, 10818, 11686, 8452, 353, 518, 13, 4706, 376, 29883, 5385, 291, 29918, 7529, 613, 13, 4706, 376, 20640, 3950, 29918, 7529, 613, 13, 4706, 376, 816, 14952, 29918, 7529, 613, 13, 4706, 376, 1272, 29918, 7529, 613, 13, 4706, 376, 9067, 29918, 7529, 613, 13, 4706, 376, 19190, 29918, 7529, 613, 13, 4706, 376, 14035, 29879, 29918, 7529, 613, 13, 1678, 4514, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2295, 29901, 360, 919, 1125, 13, 4706, 9995, 13, 4706, 826, 3174, 29901, 13, 9651, 2295, 313, 8977, 1125, 8600, 310, 4128, 13, 4706, 9995, 13, 4706, 1583, 3032, 2917, 29901, 360, 919, 353, 6483, 8552, 29898, 2917, 29897, 13, 4706, 1583, 3032, 11228, 29918, 26776, 29901, 938, 353, 1583, 3032, 2917, 29889, 657, 703, 5085, 613, 6571, 467, 657, 703, 26776, 613, 29871, 29946, 29906, 29897, 13, 4706, 1583, 3032, 369, 15828, 29901, 6120, 353, 1583, 3032, 2917, 29889, 657, 703, 5085, 613, 6571, 467, 657, 29898, 13, 9651, 376, 369, 15828, 613, 7700, 13, 4706, 1723, 13, 4706, 1583, 3032, 3198, 29918, 3389, 29901, 6120, 353, 1583, 3032, 2917, 29889, 657, 703, 5085, 613, 6571, 467, 657, 29898, 13, 9651, 376, 3198, 613, 7700, 13, 4706, 1723, 13, 4706, 1583, 3032, 3198, 29918, 2230, 29901, 6120, 353, 1583, 3032, 2917, 29889, 657, 703, 5085, 613, 6571, 467, 657, 29898, 13, 9651, 376, 2230, 277, 613, 7700, 13, 4706, 1723, 13, 4706, 1583, 17255, 19125, 29918, 1188, 3972, 580, 13, 13, 4706, 1583, 3032, 2917, 3366, 303, 1179, 3108, 3366, 19190, 29918, 7529, 3108, 353, 3667, 29879, 29889, 14634, 29918, 8977, 29879, 29898, 13, 9651, 6483, 8552, 29898, 13, 18884, 1583, 3032, 2917, 3366, 303, 1179, 16862, 657, 703, 3859, 29918, 7529, 613, 426, 1800, 13, 9651, 10353, 29871, 396, 7160, 363, 1250, 1328, 24521, 13, 9651, 6483, 8552, 29898, 1311, 3032, 2917, 3366, 303, 1179, 16862, 657, 703, 19190, 29918, 7529, 613, 426, 1800, 511, 13, 9651, 6483, 8552, 29898, 1311, 3032, 2917, 29889, 657, 703, 5085, 613, 426, 1800, 511, 13, 9651, 8853, 1188, 3972, 1115, 1583, 3032, 1188, 3972, 1118, 13, 4706, 1723, 13, 4706, 1583, 29889, 303, 1179, 29918, 2917, 29901, 360, 919, 353, 1583, 3032, 657, 29918, 303, 1179, 29918, 2917, 29898, 13, 9651, 1583, 3032, 2917, 3366, 303, 1179, 3108, 13, 4706, 1723, 13, 13, 1678, 732, 6799, 13, 1678, 822, 298, 7529, 29898, 1311, 29897, 1599, 8170, 287, 21533, 29901, 13, 4706, 9995, 11609, 29879, 11266, 8636, 15945, 29908, 13, 4706, 736, 8170, 287, 21533, 29898, 1311, 3032, 2917, 29897, 13, 13, 1678, 822, 4770, 19125, 29918, 1188, 3972, 29898, 1311, 1125, 13, 4706, 8528, 6154, 29965, 2287, 29918, 16881, 353, 376, 9290, 29908, 13, 13, 4706, 1480, 3972, 353, 1583, 3032, 2917, 29889, 657, 703, 5085, 613, 6571, 467, 657, 703, 1188, 3972, 613, 6213, 29897, 13, 4706, 2362, 295, 468, 3972, 353, 1583, 3032, 2917, 29889, 657, 703, 5085, 613, 6571, 467, 657, 703, 6500, 295, 468, 3972, 613, 6213, 29897, 13, 13, 4706, 565, 1480, 3972, 338, 451, 6213, 322, 1480, 3972, 29889, 13609, 580, 2804, 8528, 6154, 29965, 2287, 29918, 16881, 29901, 13, 9651, 1583, 3032, 1188, 3972, 353, 1480, 3972, 13, 4706, 25342, 2362, 295, 468, 3972, 338, 451, 6213, 322, 2362, 295, 468, 3972, 29889, 13609, 580, 2804, 8528, 6154, 29965, 2287, 29918, 16881, 29901, 13, 9651, 1480, 3972, 29918, 2490, 5878, 353, 1583, 3032, 657, 29918, 1188, 3972, 29898, 1311, 3032, 2917, 29897, 13, 9651, 1583, 3032, 1188, 3972, 353, 285, 29908, 29912, 6500, 295, 468, 3972, 6822, 29912, 1188, 3972, 29918, 2490, 5878, 5038, 13, 4706, 1683, 29901, 13, 9651, 1583, 3032, 1188, 3972, 353, 6213, 13, 13, 1678, 822, 903, 657, 29918, 303, 1179, 29918, 2917, 29898, 1311, 29892, 22950, 29918, 2917, 29901, 360, 919, 1125, 13, 4706, 22950, 29918, 4381, 29879, 353, 6571, 13, 4706, 22950, 29918, 2917, 29918, 449, 353, 8170, 287, 21533, 580, 13, 4706, 363, 1820, 297, 1583, 29889, 1254, 10461, 29918, 10818, 11686, 8452, 29901, 13, 9651, 565, 1820, 1275, 376, 19190, 29918, 7529, 1115, 13, 18884, 396, 1250, 1328, 24521, 13, 18884, 22950, 29918, 4381, 29879, 29961, 1989, 29962, 353, 3667, 29879, 29889, 14634, 29918, 8977, 29879, 29898, 13, 462, 1678, 6483, 8552, 29898, 303, 1179, 29918, 2917, 29889, 657, 703, 3859, 29918, 7529, 613, 426, 1800, 511, 13, 462, 1678, 6483, 8552, 29898, 303, 1179, 29918, 2917, 29889, 657, 29898, 1989, 29892, 426, 1800, 511, 13, 18884, 1723, 13, 9651, 1683, 29901, 13, 18884, 22950, 29918, 4381, 29879, 29961, 1989, 29962, 353, 6483, 8552, 29898, 303, 1179, 29918, 2917, 29889, 657, 29898, 1989, 29892, 6571, 876, 13, 4706, 363, 7408, 297, 22950, 29918, 2917, 29901, 13, 9651, 565, 313, 13, 18884, 7408, 297, 1583, 29889, 1254, 10461, 29918, 10818, 11686, 8452, 13, 18884, 470, 7408, 1275, 376, 3859, 29918, 7529, 29908, 13, 18884, 470, 22950, 29918, 2917, 29889, 657, 29898, 19190, 29897, 338, 6213, 13, 632, 1125, 13, 18884, 6773, 13, 9651, 22950, 29918, 2917, 29918, 449, 29961, 19190, 29962, 353, 6571, 13, 9651, 363, 1820, 297, 1583, 29889, 1254, 10461, 29918, 10818, 11686, 8452, 29901, 13, 18884, 565, 1820, 1275, 376, 19190, 29918, 7529, 1115, 13, 462, 1678, 396, 1250, 1328, 24521, 13, 462, 1678, 22950, 29918, 2917, 29918, 449, 29961, 19190, 3816, 1989, 29962, 353, 3667, 29879, 29889, 14634, 29918, 8977, 29879, 29898, 13, 462, 4706, 6483, 8552, 29898, 303, 1179, 29918, 4381, 29879, 29889, 657, 703, 3859, 29918, 7529, 613, 426, 1800, 511, 13, 462, 4706, 6483, 8552, 29898, 303, 1179, 29918, 4381, 29879, 29889, 657, 29898, 1989, 29892, 426, 1800, 511, 13, 462, 4706, 6483, 8552, 29898, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 703, 3859, 29918, 7529, 613, 426, 1800, 511, 13, 462, 4706, 6483, 8552, 29898, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 29898, 1989, 29892, 426, 1800, 511, 13, 462, 1678, 1723, 13, 18884, 1683, 29901, 13, 462, 1678, 22950, 29918, 2917, 29918, 449, 29961, 19190, 3816, 1989, 29962, 353, 3667, 29879, 29889, 14634, 29918, 8977, 29879, 29898, 13, 462, 4706, 6483, 8552, 29898, 303, 1179, 29918, 4381, 29879, 29889, 657, 29898, 1989, 29892, 426, 1800, 511, 13, 462, 4706, 6483, 8552, 29898, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 29898, 1989, 29892, 426, 1800, 511, 13, 462, 1678, 1723, 13, 13, 4706, 736, 22950, 29918, 2917, 29918, 449, 13, 13, 1678, 822, 903, 657, 29918, 1188, 3972, 29898, 1311, 29892, 2295, 29901, 360, 919, 29897, 1599, 851, 29901, 13, 4706, 14334, 353, 3667, 29879, 29889, 657, 29918, 329, 29883, 3707, 29918, 2230, 580, 13, 4706, 2295, 29918, 8568, 353, 3667, 29879, 29889, 657, 29918, 12759, 29918, 8568, 29898, 2917, 29897, 13, 4706, 1480, 3972, 353, 285, 29908, 29912, 16394, 1836, 29912, 2917, 29918, 8568, 5038, 13, 4706, 736, 1480, 3972, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2847, 29918, 26776, 29898, 1311, 29897, 1599, 938, 29901, 13, 4706, 9995, 1252, 15362, 29915, 29879, 2847, 16717, 995, 1213, 15945, 13, 4706, 736, 1583, 3032, 11228, 29918, 26776, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1480, 3972, 29898, 1311, 1125, 13, 4706, 9995, 2605, 304, 278, 3884, 988, 278, 7639, 10748, 1213, 15945, 13, 4706, 736, 1583, 3032, 1188, 3972, 13, 13, 1678, 732, 6799, 13, 1678, 822, 22950, 29898, 1311, 29897, 1599, 2391, 29961, 710, 5387, 13, 4706, 9995, 1252, 15362, 29915, 29879, 7408, 2983, 1213, 15945, 13, 4706, 22950, 29918, 8149, 353, 1051, 29898, 1311, 29889, 303, 1179, 29918, 2917, 29889, 8149, 3101, 13, 4706, 736, 22950, 29918, 8149, 13, 13, 1678, 732, 6799, 13, 1678, 822, 13235, 29918, 7529, 29898, 1311, 29897, 1599, 360, 919, 29901, 13, 4706, 9995, 21533, 411, 278, 4128, 363, 13235, 322, 383, 29925, 29896, 29953, 286, 621, 898, 1213, 15945, 13, 4706, 736, 1583, 3032, 2917, 29889, 657, 703, 5721, 7541, 29918, 7529, 613, 426, 1800, 13, 13, 1678, 822, 679, 29918, 19190, 29918, 7529, 29898, 1311, 29892, 7408, 29901, 851, 29897, 1599, 341, 20304, 29961, 710, 29892, 3139, 5387, 13, 4706, 9995, 11609, 29879, 278, 2106, 4128, 363, 263, 2183, 7408, 1213, 15945, 13, 4706, 736, 1583, 29889, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 703, 19190, 29918, 7529, 613, 426, 1800, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 657, 29918, 4299, 29898, 1068, 7529, 1125, 13, 4706, 1820, 29918, 1767, 29918, 15581, 353, 8636, 29889, 7323, 703, 29918, 1989, 29918, 1767, 613, 7700, 29897, 13, 13, 4706, 565, 1820, 29918, 1767, 29918, 15581, 29901, 13, 9651, 1904, 353, 6571, 13, 9651, 363, 1820, 29892, 8636, 29918, 297, 8636, 29889, 7076, 7295, 13, 18884, 1904, 29961, 1989, 29962, 353, 12782, 1252, 15362, 3032, 657, 29918, 4299, 29898, 1068, 7529, 19925, 13, 9651, 1904, 353, 302, 29876, 29889, 7355, 21533, 29898, 4299, 29897, 13, 4706, 1683, 29901, 13, 9651, 1904, 353, 16999, 2287, 8547, 29889, 657, 29918, 3166, 29918, 7529, 29898, 1068, 7529, 29897, 13, 4706, 736, 1904, 13, 13, 1678, 822, 679, 29918, 4299, 29898, 1311, 29892, 7408, 29901, 851, 1125, 13, 4706, 9995, 11609, 29879, 278, 1904, 363, 263, 2183, 7408, 1213, 15945, 13, 4706, 1904, 29918, 7529, 353, 1583, 3032, 2917, 3366, 4299, 29918, 7529, 3108, 13, 4706, 1904, 353, 1583, 3032, 657, 29918, 4299, 29898, 1068, 4299, 29918, 7529, 29897, 13, 4706, 736, 1904, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 657, 29918, 29883, 5385, 291, 29898, 1068, 7529, 1125, 13, 4706, 1820, 29918, 1767, 29918, 15581, 353, 8636, 29889, 7323, 703, 29918, 1989, 29918, 1767, 613, 7700, 29897, 13, 13, 4706, 565, 1820, 29918, 1767, 29918, 15581, 29901, 13, 9651, 28770, 291, 353, 6571, 13, 9651, 363, 1820, 29892, 8636, 29918, 297, 8636, 29889, 7076, 7295, 13, 18884, 28770, 291, 29961, 1989, 29962, 353, 12782, 1252, 15362, 3032, 657, 29918, 29883, 5385, 291, 29898, 1068, 7529, 19925, 13, 4706, 1683, 29901, 13, 9651, 28770, 291, 353, 15600, 1806, 1001, 27946, 29889, 657, 29918, 3166, 29918, 7529, 29898, 1068, 7529, 29897, 13, 9651, 565, 28770, 291, 338, 451, 6213, 322, 4842, 305, 29889, 29883, 6191, 29889, 275, 29918, 16515, 7295, 13, 18884, 28770, 291, 353, 28770, 291, 29889, 29883, 6191, 580, 13, 4706, 736, 28770, 291, 13, 13, 1678, 822, 679, 29918, 29883, 5385, 291, 29898, 1311, 29892, 7408, 29901, 851, 29897, 1599, 315, 5385, 291, 29901, 13, 4706, 9995, 11609, 29879, 278, 28770, 291, 363, 263, 2183, 7408, 1213, 15945, 13, 4706, 28770, 291, 29918, 7529, 353, 1583, 29889, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 29898, 13, 9651, 376, 29883, 5385, 291, 29918, 7529, 613, 6571, 13, 4706, 1723, 13, 4706, 28770, 291, 353, 1583, 3032, 657, 29918, 29883, 5385, 291, 29898, 1068, 29883, 5385, 291, 29918, 7529, 29897, 13, 4706, 736, 28770, 291, 13, 13, 1678, 822, 903, 657, 29918, 20640, 3950, 29898, 13, 4706, 1583, 29892, 7408, 29901, 851, 29892, 1904, 29901, 7761, 29961, 3195, 29892, 360, 919, 29961, 710, 29892, 8125, 20526, 3579, 7529, 13, 1678, 1723, 1599, 20693, 326, 3950, 29901, 13, 4706, 396, 732, 4986, 3970, 29871, 29896, 29901, 28559, 292, 29936, 445, 1158, 338, 2086, 1472, 13, 4706, 396, 732, 4986, 3970, 29871, 29906, 29901, 2254, 2106, 9657, 29879, 363, 28598, 352, 414, 669, 28770, 291, 13, 4706, 7546, 3538, 29918, 7529, 353, 8636, 29889, 7323, 703, 13148, 3538, 29918, 7529, 613, 8170, 287, 21533, 3101, 13, 4706, 694, 29918, 29890, 3173, 29918, 7915, 29918, 7099, 388, 353, 8636, 29889, 7323, 703, 1217, 29918, 29890, 3173, 29918, 7915, 29918, 7099, 388, 613, 5852, 29897, 13, 13, 4706, 396, 5608, 21640, 5751, 515, 2045, 597, 279, 26560, 29889, 990, 29914, 5140, 29914, 29896, 29955, 29900, 29953, 29889, 29900, 29906, 29953, 29955, 29955, 29889, 5140, 13, 4706, 301, 29878, 29918, 19529, 292, 29918, 7529, 353, 8636, 29889, 7323, 703, 29212, 29918, 10660, 29918, 19529, 292, 613, 6213, 29897, 13, 4706, 565, 301, 29878, 29918, 19529, 292, 29918, 7529, 29901, 13, 9651, 848, 29918, 7529, 353, 9657, 29898, 1311, 29889, 303, 1179, 29918, 2917, 29961, 19190, 29962, 3366, 1272, 29918, 7529, 20068, 13, 9651, 9853, 29918, 2311, 353, 848, 29918, 7529, 29889, 657, 703, 16175, 29918, 2311, 1159, 13, 9651, 639, 29918, 29887, 3746, 29918, 19529, 292, 353, 848, 29918, 7529, 29889, 657, 703, 546, 29918, 29887, 3746, 29918, 19529, 292, 613, 7700, 29897, 13, 9651, 13235, 29918, 10003, 353, 3667, 29879, 29889, 657, 29918, 10003, 580, 13, 9651, 13235, 353, 13235, 29918, 10003, 1405, 448, 29896, 13, 9651, 565, 639, 29918, 29887, 3746, 29918, 19529, 292, 322, 451, 13235, 29901, 13, 18884, 954, 29918, 29887, 13364, 353, 4236, 29898, 29896, 29892, 4842, 305, 29889, 29883, 6191, 29889, 10141, 29918, 2798, 3101, 13, 18884, 9853, 29918, 2311, 334, 29922, 954, 29918, 29887, 13364, 13, 13, 9651, 2967, 29918, 29212, 353, 301, 29878, 29918, 19529, 292, 29918, 7529, 29889, 657, 703, 29212, 1159, 13, 9651, 2967, 29918, 16175, 29918, 2311, 353, 301, 29878, 29918, 19529, 292, 29918, 7529, 29889, 657, 703, 3188, 29918, 16175, 29918, 2311, 613, 29871, 29906, 29945, 29953, 29897, 13, 9651, 301, 29878, 29918, 19529, 292, 353, 9853, 29918, 2311, 847, 2967, 29918, 16175, 29918, 2311, 13, 9651, 8636, 3366, 29212, 3108, 353, 2967, 29918, 29212, 334, 301, 29878, 29918, 19529, 292, 29871, 396, 6287, 2322, 301, 29878, 13, 4706, 1683, 29901, 13, 9651, 301, 29878, 29918, 19529, 292, 353, 29871, 29896, 29889, 29900, 13, 13, 4706, 396, 2805, 1904, 4128, 13, 4706, 1904, 29918, 1989, 353, 8636, 29889, 7323, 703, 29918, 4299, 613, 6213, 29897, 13, 4706, 565, 1904, 29918, 1989, 338, 6213, 29901, 13, 9651, 4974, 338, 8758, 29898, 13, 18884, 1904, 29892, 302, 29876, 29889, 7355, 13, 9651, 10353, 376, 4299, 338, 1820, 29899, 1767, 29892, 541, 5994, 3950, 756, 694, 6790, 1904, 29908, 13, 9651, 1904, 29918, 7529, 353, 3667, 29879, 29889, 5014, 29918, 4299, 29918, 7529, 29898, 13, 18884, 1904, 29892, 7546, 3538, 29918, 7529, 29892, 694, 29918, 29890, 3173, 29918, 7915, 29918, 7099, 388, 29892, 301, 29878, 29918, 19529, 292, 13, 9651, 1723, 13, 4706, 25342, 338, 8758, 29898, 4299, 29918, 1989, 29892, 851, 1125, 13, 9651, 1904, 29918, 7529, 353, 3667, 29879, 29889, 5014, 29918, 4299, 29918, 7529, 29898, 13, 18884, 1904, 29961, 4299, 29918, 1989, 1402, 13, 18884, 7546, 3538, 29918, 7529, 29892, 13, 18884, 694, 29918, 29890, 3173, 29918, 7915, 29918, 7099, 388, 29892, 13, 18884, 301, 29878, 29918, 19529, 292, 29892, 13, 9651, 1723, 13, 4706, 25342, 338, 8758, 29898, 4299, 29918, 1989, 29892, 313, 1761, 29892, 18761, 22164, 13, 9651, 1904, 29918, 7529, 353, 5159, 13, 9651, 363, 1904, 29918, 1989, 29918, 297, 1904, 29918, 1989, 29901, 13, 18884, 1904, 29918, 7529, 29918, 353, 3667, 29879, 29889, 5014, 29918, 4299, 29918, 7529, 29898, 13, 462, 1678, 1904, 29961, 4299, 29918, 1989, 29918, 1402, 13, 462, 1678, 7546, 3538, 29918, 7529, 29892, 13, 462, 1678, 694, 29918, 29890, 3173, 29918, 7915, 29918, 7099, 388, 29892, 13, 462, 1678, 301, 29878, 29918, 19529, 292, 29892, 13, 18884, 1723, 13, 18884, 1904, 29918, 7529, 29889, 21843, 29898, 4299, 29918, 7529, 19925, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 703, 26690, 1134, 310, 1904, 29918, 7529, 1159, 13, 13, 4706, 2254, 29918, 3166, 29918, 24957, 29918, 19190, 353, 8636, 29889, 7323, 29898, 13, 9651, 376, 1359, 29918, 3166, 29918, 24957, 29918, 19190, 613, 7700, 13, 4706, 1723, 13, 4706, 5994, 3950, 29918, 1989, 353, 8636, 29889, 7323, 703, 20640, 3950, 29918, 1989, 613, 6213, 29897, 13, 4706, 5994, 3950, 353, 6418, 29911, 7833, 26664, 23598, 29889, 657, 29918, 3166, 29918, 7529, 29898, 1068, 7529, 29892, 8636, 29922, 4299, 29918, 7529, 29897, 13, 13, 4706, 565, 2254, 29918, 3166, 29918, 24957, 29918, 19190, 322, 1583, 29889, 303, 1179, 29889, 2248, 29898, 19190, 29897, 2804, 29871, 29900, 29901, 13, 9651, 1423, 3149, 29918, 2084, 353, 285, 29908, 29912, 1311, 29889, 1188, 3972, 6822, 3198, 9748, 29914, 13318, 29918, 8159, 29889, 29886, 386, 29908, 13, 9651, 1423, 3149, 353, 3667, 29879, 29889, 1359, 29918, 3198, 3149, 29898, 3198, 3149, 29918, 2084, 29897, 13, 13, 9651, 9657, 29906, 1359, 353, 5994, 3950, 13, 9651, 565, 5994, 3950, 29918, 1989, 338, 451, 6213, 29901, 13, 18884, 9657, 29906, 1359, 353, 426, 20640, 3950, 29918, 1989, 29901, 5994, 3950, 29913, 13, 9651, 3667, 29879, 29889, 348, 4058, 29918, 3198, 3149, 29898, 3198, 3149, 29892, 5994, 3950, 29922, 8977, 29906, 1359, 29897, 13, 13, 9651, 396, 4337, 5994, 3950, 304, 4742, 13, 9651, 4742, 353, 3667, 29879, 29889, 657, 29918, 10141, 580, 13, 9651, 363, 1828, 297, 1904, 29918, 7529, 29901, 13, 18884, 1828, 353, 1828, 3366, 7529, 3108, 29961, 29900, 29962, 13, 18884, 5994, 3950, 29918, 3859, 353, 5994, 3950, 29889, 3859, 29961, 3207, 29962, 13, 18884, 363, 1820, 29892, 995, 297, 5994, 3950, 29918, 3859, 29889, 7076, 7295, 13, 462, 1678, 5994, 3950, 29918, 3859, 29961, 1989, 29962, 353, 3667, 29879, 29889, 1384, 29906, 10141, 29898, 1767, 29892, 4742, 29897, 13, 13, 9651, 396, 2767, 5994, 3950, 8636, 13, 9651, 363, 1820, 29892, 995, 297, 8636, 29889, 7076, 7295, 13, 18884, 363, 23822, 297, 5994, 3950, 29889, 3207, 29918, 13155, 29901, 13, 462, 1678, 23822, 29961, 1989, 29962, 353, 995, 13, 13, 4706, 736, 5994, 3950, 13, 13, 1678, 822, 679, 29918, 20640, 3950, 29898, 13, 4706, 1583, 29892, 7408, 29901, 851, 29892, 1904, 29901, 7761, 29961, 3195, 29892, 360, 919, 29961, 710, 29892, 8125, 5262, 13, 1678, 1723, 1599, 7761, 29961, 20624, 326, 3950, 29892, 360, 919, 29961, 710, 29892, 20693, 326, 3950, 5262, 29901, 13, 4706, 9995, 11609, 29879, 278, 5994, 3950, 363, 263, 2183, 7408, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 7408, 313, 710, 1125, 7408, 1024, 13, 9651, 1904, 313, 19986, 29961, 3195, 29892, 360, 919, 29961, 710, 29892, 8125, 5262, 1125, 1904, 470, 263, 9657, 310, 4733, 13, 4706, 9995, 13, 4706, 5994, 3950, 29918, 7529, 353, 1583, 29889, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 29898, 13, 9651, 376, 20640, 3950, 29918, 7529, 613, 6571, 13, 4706, 1723, 13, 4706, 1820, 29918, 1767, 29918, 15581, 353, 5994, 3950, 29918, 7529, 29889, 7323, 703, 29918, 1989, 29918, 1767, 613, 7700, 29897, 13, 13, 4706, 565, 1820, 29918, 1767, 29918, 15581, 29901, 13, 9651, 5994, 3950, 353, 6571, 13, 9651, 363, 1820, 29892, 8636, 29918, 297, 5994, 3950, 29918, 7529, 29889, 7076, 7295, 13, 18884, 396, 2254, 6790, 5994, 3950, 515, 1423, 3149, 13, 18884, 5994, 3950, 29918, 1989, 353, 376, 20640, 3950, 29918, 1989, 29908, 13, 18884, 4974, 5994, 3950, 29918, 1989, 451, 297, 8636, 3383, 376, 26766, 21676, 29908, 13, 18884, 8636, 29918, 29961, 20640, 3950, 29918, 1989, 29962, 353, 1820, 13, 13, 18884, 5994, 3950, 29961, 1989, 29962, 353, 1583, 3032, 657, 29918, 20640, 3950, 29898, 19190, 29892, 1904, 29892, 3579, 7529, 19925, 13, 4706, 1683, 29901, 13, 9651, 5994, 3950, 353, 1583, 3032, 657, 29918, 20640, 3950, 29898, 19190, 29892, 1904, 29892, 3579, 20640, 3950, 29918, 7529, 29897, 13, 13, 4706, 736, 5994, 3950, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 657, 29918, 816, 14952, 10456, 29892, 5994, 3950, 29892, 3579, 7529, 1125, 13, 4706, 1820, 29918, 1767, 29918, 15581, 353, 8636, 29889, 7323, 703, 29918, 1989, 29918, 1767, 613, 7700, 29897, 13, 13, 4706, 565, 1820, 29918, 1767, 29918, 15581, 29901, 13, 9651, 1364, 14952, 353, 6571, 13, 9651, 363, 1820, 29892, 8636, 29918, 297, 8636, 29889, 7076, 7295, 13, 18884, 1364, 14952, 29961, 1989, 29962, 353, 12782, 1252, 15362, 3032, 657, 29918, 816, 14952, 29898, 13, 462, 1678, 5994, 3950, 29922, 20640, 3950, 29892, 3579, 7529, 29918, 13, 18884, 1723, 13, 4706, 1683, 29901, 13, 9651, 1364, 14952, 353, 317, 3210, 3352, 13309, 23598, 29889, 657, 29918, 3166, 29918, 7529, 29898, 13, 18884, 3579, 7529, 29892, 5994, 3950, 29922, 20640, 3950, 13, 9651, 1723, 13, 4706, 736, 1364, 14952, 13, 13, 1678, 822, 679, 29918, 816, 14952, 29898, 1311, 29892, 7408, 29901, 851, 29892, 5994, 3950, 29901, 20693, 326, 3950, 29897, 1599, 1102, 14952, 29901, 13, 4706, 9995, 11609, 29879, 278, 1364, 14952, 363, 263, 2183, 7408, 1213, 15945, 13, 4706, 1364, 14952, 29918, 7529, 353, 1583, 29889, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 29898, 13, 9651, 376, 816, 14952, 29918, 7529, 613, 6571, 13, 4706, 1723, 13, 4706, 1364, 14952, 353, 1583, 3032, 657, 29918, 816, 14952, 29898, 13, 9651, 5994, 3950, 29922, 20640, 3950, 29892, 3579, 816, 14952, 29918, 7529, 13, 4706, 1723, 13, 4706, 736, 1364, 14952, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 657, 29918, 9067, 29898, 1068, 7529, 29897, 1599, 8251, 519, 29901, 13, 4706, 1820, 29918, 1767, 29918, 15581, 353, 8636, 29889, 7323, 703, 29918, 1989, 29918, 1767, 613, 7700, 29897, 13, 13, 4706, 565, 1820, 29918, 1767, 29918, 15581, 29901, 13, 9651, 4327, 29879, 29918, 510, 3283, 353, 426, 13, 18884, 1820, 29901, 12782, 1252, 15362, 3032, 657, 29918, 9067, 29898, 1068, 7529, 19925, 13, 18884, 363, 1820, 29892, 8636, 29918, 297, 8636, 29889, 7076, 580, 13, 9651, 500, 13, 13, 9651, 4327, 353, 22333, 358, 272, 1523, 4220, 29898, 13, 18884, 426, 13, 462, 1678, 1820, 29901, 22333, 358, 272, 29898, 13, 462, 4706, 9657, 29918, 1989, 29922, 1989, 29892, 13, 462, 4706, 18765, 29918, 9144, 29922, 9067, 29892, 13, 462, 4706, 1881, 29918, 1989, 29922, 1989, 29892, 13, 462, 4706, 1962, 29918, 1989, 29922, 1989, 29892, 13, 462, 1678, 1723, 13, 462, 1678, 363, 1820, 29892, 4327, 297, 4327, 29879, 29918, 510, 3283, 29889, 7076, 580, 13, 18884, 500, 13, 9651, 1723, 13, 4706, 1683, 29901, 13, 9651, 565, 376, 9067, 29879, 29908, 297, 8636, 29901, 13, 18884, 4327, 29879, 29918, 510, 3283, 353, 518, 13, 462, 1678, 12782, 1252, 15362, 3032, 657, 29918, 9067, 29898, 1068, 9067, 29918, 7529, 29897, 13, 462, 1678, 363, 4327, 29918, 7529, 297, 8636, 3366, 9067, 29879, 3108, 13, 18884, 4514, 13, 18884, 8636, 29889, 5504, 29898, 9067, 29879, 29922, 9067, 29879, 29918, 510, 3283, 29897, 13, 13, 9651, 4327, 353, 10014, 2190, 20322, 1955, 4345, 29889, 657, 29918, 3166, 29918, 7529, 29898, 1068, 7529, 29897, 13, 13, 4706, 736, 4327, 13, 13, 1678, 822, 679, 29918, 9067, 29879, 29898, 13, 4706, 1583, 29892, 7408, 29901, 851, 353, 6213, 29892, 8783, 29901, 851, 353, 6213, 13, 1678, 1723, 1599, 8251, 519, 29901, 13, 4706, 9995, 11609, 29879, 4327, 363, 263, 2183, 7408, 322, 4464, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 7408, 313, 710, 1125, 7408, 1024, 13, 9651, 8783, 313, 710, 1125, 8783, 1024, 313, 29872, 29889, 29887, 29889, 376, 14968, 613, 376, 3084, 4968, 13, 18884, 674, 367, 1304, 871, 565, 278, 995, 310, 19392, 1989, 29918, 1767, 16159, 338, 4954, 5574, 16159, 13, 4706, 9995, 13, 4706, 4327, 29918, 7529, 353, 6483, 8552, 29898, 13, 9651, 1583, 29889, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 703, 9067, 29918, 7529, 613, 426, 1800, 13, 4706, 1723, 13, 13, 4706, 1820, 29918, 1767, 29918, 15581, 353, 4327, 29918, 7529, 29889, 7323, 703, 29918, 1989, 29918, 1767, 613, 7700, 29897, 13, 4706, 565, 1820, 29918, 1767, 29918, 15581, 29901, 13, 9651, 4327, 29918, 7529, 353, 4327, 29918, 7529, 29889, 657, 29898, 24713, 29892, 426, 1800, 13, 13, 4706, 4327, 353, 1583, 3032, 657, 29918, 9067, 29898, 1068, 9067, 29918, 7529, 29897, 13, 4706, 565, 4327, 338, 6213, 29901, 13, 13, 9651, 822, 4327, 29898, 8977, 29918, 1125, 13, 18884, 736, 9657, 29918, 13, 13, 4706, 25342, 451, 338, 8758, 29898, 9067, 29892, 22333, 358, 272, 1523, 4220, 1125, 13, 9651, 4327, 29918, 353, 4327, 13, 13, 9651, 822, 4327, 29898, 8977, 29918, 1125, 13, 18884, 736, 4327, 23538, 1068, 8977, 19925, 13, 13, 4706, 736, 4327, 13, 13, 1678, 822, 679, 29918, 1359, 414, 29898, 13, 4706, 1583, 29892, 7408, 29901, 851, 29892, 21502, 305, 29901, 938, 353, 6213, 29892, 13, 1678, 1723, 1599, 376, 7514, 287, 21533, 29961, 710, 29892, 3630, 10036, 29962, 1115, 13, 4706, 9995, 11609, 29879, 278, 2254, 414, 363, 263, 2183, 7408, 1213, 15945, 13, 4706, 848, 29918, 7529, 353, 9657, 29898, 1311, 29889, 303, 1179, 29918, 2917, 29961, 19190, 29962, 3366, 1272, 29918, 7529, 20068, 13, 4706, 2254, 414, 353, 3667, 29879, 29889, 657, 29918, 1359, 414, 29918, 3166, 29918, 7529, 29898, 13, 9651, 679, 29918, 14538, 1691, 29918, 9144, 29922, 1311, 29889, 657, 29918, 14538, 1691, 29892, 13, 9651, 2847, 29918, 26776, 29922, 1311, 29889, 11228, 29918, 26776, 29892, 13, 9651, 7408, 29922, 19190, 29892, 13, 9651, 3579, 1272, 29918, 7529, 29892, 13, 4706, 1723, 13, 4706, 736, 2254, 414, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 657, 29918, 14035, 29898, 1068, 7529, 1125, 13, 4706, 14476, 29918, 7529, 353, 8636, 29889, 7323, 703, 29918, 17699, 613, 6213, 29897, 13, 4706, 6939, 353, 315, 9818, 29933, 11375, 29903, 29889, 657, 29918, 3166, 29918, 7529, 29898, 1068, 7529, 29897, 13, 4706, 565, 14476, 29918, 7529, 338, 451, 6213, 29901, 13, 9651, 14476, 29918, 7529, 3366, 3188, 29918, 14035, 3108, 353, 6939, 13, 9651, 736, 12782, 1252, 15362, 3032, 657, 29918, 14035, 29898, 1068, 17699, 29918, 7529, 29897, 13, 4706, 736, 6939, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 5014, 29918, 14035, 29879, 29898, 14035, 29879, 29901, 8170, 287, 21533, 29897, 1599, 6213, 29901, 13, 4706, 9995, 13, 4706, 20504, 403, 975, 1269, 310, 278, 6939, 29879, 322, 2767, 13, 4706, 2134, 415, 29347, 4128, 3734, 363, 2551, 13, 4706, 1065, 310, 2295, 7639, 29889, 13, 13, 4706, 11842, 9331, 29901, 13, 9651, 6939, 29879, 313, 7514, 287, 21533, 1125, 2186, 1891, 1797, 310, 6939, 29879, 29889, 13, 4706, 9995, 13, 4706, 363, 6939, 297, 6939, 29879, 29889, 5975, 7295, 13, 9651, 565, 338, 8758, 29898, 14035, 29892, 5399, 3149, 10717, 1125, 13, 18884, 565, 6939, 29889, 1359, 29918, 265, 29918, 19190, 29918, 2962, 338, 6213, 29901, 13, 462, 1678, 6939, 29889, 1359, 29918, 265, 29918, 19190, 29918, 2962, 353, 376, 13318, 29908, 13, 18884, 565, 313, 13, 462, 1678, 338, 8758, 29898, 14035, 29889, 1359, 29918, 265, 29918, 19190, 29918, 2962, 29892, 9657, 29897, 13, 462, 1678, 322, 376, 4299, 29908, 451, 297, 6939, 29889, 1359, 29918, 265, 29918, 19190, 29918, 2962, 13, 462, 1125, 13, 462, 1678, 6939, 29889, 1359, 29918, 265, 29918, 19190, 29918, 2962, 3366, 4299, 3108, 353, 376, 13318, 29908, 13, 13, 1678, 822, 679, 29918, 14035, 29879, 29898, 1311, 29892, 7408, 29901, 851, 29897, 1599, 376, 7514, 287, 21533, 29961, 10717, 29962, 1115, 13, 4706, 9995, 11609, 29879, 278, 6939, 29879, 363, 263, 2183, 7408, 1213, 15945, 13, 4706, 6939, 29879, 29918, 7529, 353, 1583, 29889, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 29898, 13, 9651, 376, 14035, 29879, 29918, 7529, 613, 6571, 13, 4706, 1723, 13, 13, 4706, 6939, 29879, 353, 8170, 287, 21533, 580, 13, 4706, 363, 1820, 29892, 6939, 29918, 7529, 297, 6939, 29879, 29918, 7529, 29889, 7076, 7295, 13, 9651, 6939, 353, 1583, 3032, 657, 29918, 14035, 29898, 1068, 14035, 29918, 7529, 29897, 13, 9651, 6939, 29879, 29961, 1989, 29962, 353, 6939, 13, 13, 4706, 2322, 29918, 14035, 29879, 353, 5159, 13, 4706, 565, 1583, 3032, 369, 15828, 29901, 13, 9651, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 369, 15828, 613, 1798, 15828, 16363, 876, 13, 4706, 565, 1583, 3032, 3198, 29918, 2230, 29901, 13, 9651, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 20404, 613, 29168, 10717, 876, 13, 4706, 565, 1583, 3032, 3198, 29918, 3389, 29901, 13, 9651, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 3198, 613, 5399, 6558, 10717, 876, 13, 13, 4706, 565, 451, 7408, 29889, 27382, 2541, 703, 262, 571, 29908, 1125, 13, 9651, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 2527, 10817, 613, 4737, 2200, 3260, 10717, 876, 13, 9651, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 13, 18884, 4852, 29918, 18157, 613, 15758, 362, 3260, 10717, 29897, 13, 9651, 1723, 13, 9651, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 11058, 613, 9405, 16363, 876, 13, 13, 9651, 565, 1583, 29889, 1188, 3972, 338, 451, 6213, 29901, 13, 18884, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 4977, 369, 613, 5399, 3149, 10717, 876, 13, 18884, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 20158, 3377, 613, 323, 6073, 3377, 16363, 876, 13, 13, 9651, 565, 1583, 29889, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 703, 29883, 5385, 291, 29918, 7529, 613, 6571, 1125, 13, 18884, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 29883, 5385, 291, 613, 315, 5385, 291, 10717, 876, 13, 9651, 565, 1583, 29889, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 703, 20640, 3950, 29918, 7529, 613, 6571, 1125, 13, 18884, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 20640, 3950, 613, 20693, 326, 3950, 10717, 876, 13, 9651, 565, 1583, 29889, 303, 1179, 29918, 2917, 29961, 19190, 1822, 657, 703, 816, 14952, 29918, 7529, 613, 6571, 1125, 13, 18884, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 816, 14952, 613, 1102, 14952, 10717, 876, 13, 13, 4706, 2322, 29918, 14035, 29879, 29889, 4397, 29898, 703, 29918, 11739, 613, 8960, 10717, 876, 13, 13, 4706, 363, 6939, 29918, 978, 29892, 6939, 29918, 9144, 297, 2322, 29918, 14035, 29879, 29901, 13, 9651, 338, 29918, 284, 2040, 29918, 6338, 353, 7700, 13, 9651, 363, 921, 297, 6939, 29879, 29889, 5975, 7295, 13, 18884, 565, 338, 8758, 29898, 29916, 29892, 6939, 29918, 9144, 1125, 13, 462, 1678, 338, 29918, 284, 2040, 29918, 6338, 353, 5852, 13, 462, 1678, 2867, 13, 9651, 565, 451, 338, 29918, 284, 2040, 29918, 6338, 29901, 13, 18884, 6939, 29879, 29961, 14035, 29918, 978, 29962, 353, 6939, 29918, 9144, 580, 13, 13, 4706, 1583, 3032, 5014, 29918, 14035, 29879, 29898, 14035, 29879, 29897, 13, 13, 4706, 736, 6939, 29879, 13, 13, 13, 1649, 497, 1649, 353, 6796, 3991, 1252, 15362, 3108, 13, 2 ]
restaurant/schema.py
miguel550/restaurant
0
54652
import graphene import dishes.schema class Query(dishes.schema.Query, graphene.ObjectType): pass class Mutations(graphene.ObjectType): create_category = dishes.schema.CreateCategory.Field() edit_category = dishes.schema.EditCategory.Field() delete_category = dishes.schema.DeleteCategory.Field() create_dish = dishes.schema.CreateDish.Field() edit_dish = dishes.schema.EditDish.Field() delete_dish = dishes.schema.DeleteDish.Field() schema = graphene.Schema(query=Query, mutation=Mutations)
[ 1, 1053, 3983, 1600, 30004, 13, 5215, 270, 17006, 29889, 11010, 30004, 13, 30004, 13, 30004, 13, 1990, 13641, 29898, 29881, 17006, 29889, 11010, 29889, 3010, 29892, 3983, 1600, 29889, 2061, 1542, 1125, 30004, 13, 1678, 1209, 30004, 13, 30004, 13, 30004, 13, 1990, 20749, 800, 29898, 4262, 1600, 29889, 2061, 1542, 1125, 30004, 13, 1678, 1653, 29918, 7320, 353, 270, 17006, 29889, 11010, 29889, 4391, 10900, 29889, 3073, 26471, 13, 1678, 3863, 29918, 7320, 353, 270, 17006, 29889, 11010, 29889, 6103, 10900, 29889, 3073, 26471, 13, 1678, 5217, 29918, 7320, 353, 270, 17006, 29889, 11010, 29889, 12498, 10900, 29889, 3073, 26471, 13, 1678, 1653, 29918, 29881, 728, 353, 270, 17006, 29889, 11010, 29889, 4391, 29928, 728, 29889, 3073, 26471, 13, 1678, 3863, 29918, 29881, 728, 353, 270, 17006, 29889, 11010, 29889, 6103, 29928, 728, 29889, 3073, 26471, 13, 1678, 5217, 29918, 29881, 728, 353, 270, 17006, 29889, 11010, 29889, 12498, 29928, 728, 29889, 3073, 26471, 13, 30004, 13, 30004, 13, 11010, 353, 3983, 1600, 29889, 12763, 29898, 1972, 29922, 3010, 29892, 5478, 362, 29922, 29924, 329, 800, 8443, 13, 2 ]
exercise4-8.py
raygomez/python-exercise-4
0
79391
from __future__ import print_function __author__ = 'ragomez' def prepend_this_is(f): def _(args): args = 'This is {}'.format(args) return f(args) return _ def append_exclamation(f): def _(args): args = '{}!'.format(args) return f(args) return _ @prepend_this_is @append_exclamation def sparta(name): print(name) sparta('Sparta')
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 1649, 8921, 1649, 353, 525, 1431, 608, 29920, 29915, 13, 13, 13, 1753, 8273, 355, 29918, 1366, 29918, 275, 29898, 29888, 1125, 13, 1678, 822, 903, 29898, 5085, 1125, 13, 4706, 6389, 353, 525, 4013, 338, 6571, 4286, 4830, 29898, 5085, 29897, 13, 4706, 736, 285, 29898, 5085, 29897, 13, 1678, 736, 903, 13, 13, 13, 1753, 9773, 29918, 735, 15719, 362, 29898, 29888, 1125, 13, 1678, 822, 903, 29898, 5085, 1125, 13, 4706, 6389, 353, 525, 8875, 29991, 4286, 4830, 29898, 5085, 29897, 13, 4706, 736, 285, 29898, 5085, 29897, 13, 1678, 736, 903, 13, 13, 13, 29992, 1457, 14081, 29918, 1366, 29918, 275, 13, 29992, 4397, 29918, 735, 15719, 362, 13, 1753, 805, 16979, 29898, 978, 1125, 13, 1678, 1596, 29898, 978, 29897, 13, 13, 1028, 16979, 877, 29903, 1595, 29874, 1495, 2 ]
shaping.py
kotikkonstantin/convasr
17
27247
<filename>shaping.py import functools import typing import torch # equal to 1T class _T(torch.Tensor): pass class BY(torch.Tensor): pass class T(torch.Tensor): pass class B(torch.Tensor): pass class S(torch.Tensor): pass class BCT(torch.Tensor): pass class CT(torch.Tensor): pass class BCt(torch.Tensor): pass class Bt(torch.Tensor): pass class TBC(torch.Tensor): pass class BT(torch.Tensor): pass class BLY(torch.Tensor): pass class BS(torch.Tensor): pass def is_tensor_hint(cls): return issubclass(cls, torch.Tensor) def unbind_tensor_hint(cls): dims = cls.__name__.split('.')[-1] return dims def shapecheck(hints = None, auto = None, **kwargs): if auto is not None: def decorator(fn): @functools.wraps(fn) def wrapper(*args, **kwargs): shapecheck.hints = typing.get_type_hints(fn) if auto: shapecheck(hints = {}, **kwargs) res = fn(*args, **kwargs) if auto: shapecheck(hints = {}, **kwargs, **{'return' : res}) shapecheck.hints = {} return res return wrapper return decorator else: hints = hints or shapecheck.hints dims = {} for k, v in kwargs.items(): h = hints.get(k) if h is not None: if is_tensor_hint(h): tensor_dims = unbind_tensor_hint(h) assert v.ndim == len(tensor_dims), f'Tensor [{k}] should be typed [{tensor_dims}] and should have rank {len(tensor_dims)} but has rank [v.ndim]' for i, d in enumerate(tensor_dims): s = v.shape[i] if d in dims: assert dims[d] == s, f'Tensor [{k}] should be typed [{tensor_dims}], dim [{d}] should have rank [{dims[d]}] but has rank [{s}]' dims[d] = s else: assert isinstance(v, h), f'Arg [{k}] should be typed [{h}] but is typed [{type(v)}]'
[ 1, 529, 9507, 29958, 845, 21430, 29889, 2272, 13, 5215, 2090, 312, 8789, 13, 5215, 19229, 13, 5215, 4842, 305, 13, 13, 29937, 5186, 304, 29871, 29896, 29911, 13, 1990, 903, 29911, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 6770, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 323, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 350, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 317, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 350, 1783, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 26637, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 17403, 29873, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 350, 29873, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 323, 5371, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 350, 29911, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 350, 16786, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1990, 350, 29903, 29898, 7345, 305, 29889, 29911, 6073, 1125, 13, 12, 3364, 13, 13, 1753, 338, 29918, 20158, 29918, 29882, 524, 29898, 25932, 1125, 13, 12, 2457, 338, 1491, 1990, 29898, 25932, 29892, 4842, 305, 29889, 29911, 6073, 29897, 13, 13, 1753, 443, 5355, 29918, 20158, 29918, 29882, 524, 29898, 25932, 1125, 13, 12, 6229, 29879, 353, 1067, 29879, 17255, 978, 26914, 5451, 12839, 1495, 14352, 29896, 29962, 13, 12, 2457, 3964, 29879, 13, 13, 1753, 8267, 3198, 29898, 29882, 9466, 353, 6213, 29892, 4469, 353, 6213, 29892, 3579, 19290, 1125, 13, 12, 361, 4469, 338, 451, 6213, 29901, 13, 12, 12, 1753, 10200, 1061, 29898, 9144, 1125, 13, 12, 12, 12, 29992, 7692, 312, 8789, 29889, 29893, 336, 567, 29898, 9144, 29897, 13, 12, 12, 12, 1753, 14476, 10456, 5085, 29892, 3579, 19290, 1125, 13, 12, 12, 12, 12, 12181, 3198, 29889, 29882, 9466, 353, 19229, 29889, 657, 29918, 1853, 29918, 29882, 9466, 29898, 9144, 29897, 13, 12, 12, 12, 12, 361, 4469, 29901, 13, 12, 12, 12, 12, 12, 12181, 3198, 29898, 29882, 9466, 353, 24335, 3579, 19290, 29897, 13, 12, 12, 12, 12, 690, 353, 7876, 10456, 5085, 29892, 3579, 19290, 29897, 13, 12, 12, 12, 12, 361, 4469, 29901, 13, 12, 12, 12, 12, 12, 12181, 3198, 29898, 29882, 9466, 353, 24335, 3579, 19290, 29892, 3579, 10998, 2457, 29915, 584, 620, 1800, 13, 12, 12, 12, 12, 12181, 3198, 29889, 29882, 9466, 353, 6571, 13, 12, 12, 12, 12, 2457, 620, 13, 12, 12, 12, 2457, 14476, 13, 12, 12, 2457, 10200, 1061, 13, 13, 12, 2870, 29901, 13, 12, 12, 29882, 9466, 353, 26085, 470, 8267, 3198, 29889, 29882, 9466, 13, 12, 12, 6229, 29879, 353, 6571, 13, 12, 12, 1454, 413, 29892, 325, 297, 9049, 5085, 29889, 7076, 7295, 13, 12, 12, 12, 29882, 353, 26085, 29889, 657, 29898, 29895, 29897, 13, 12, 12, 12, 361, 298, 338, 451, 6213, 29901, 13, 12, 12, 12, 12, 361, 338, 29918, 20158, 29918, 29882, 524, 29898, 29882, 1125, 13, 12, 12, 12, 12, 12, 20158, 29918, 6229, 29879, 353, 443, 5355, 29918, 20158, 29918, 29882, 524, 29898, 29882, 29897, 13, 12, 12, 12, 12, 12, 9294, 325, 29889, 299, 326, 1275, 7431, 29898, 20158, 29918, 6229, 29879, 511, 285, 29915, 29911, 6073, 15974, 29895, 6525, 881, 367, 13033, 15974, 20158, 29918, 6229, 29879, 6525, 322, 881, 505, 7115, 426, 2435, 29898, 20158, 29918, 6229, 29879, 2915, 541, 756, 7115, 518, 29894, 29889, 299, 326, 29962, 29915, 13, 12, 12, 12, 12, 12, 1454, 474, 29892, 270, 297, 26985, 29898, 20158, 29918, 6229, 29879, 1125, 13, 12, 12, 12, 12, 12, 12, 29879, 353, 325, 29889, 12181, 29961, 29875, 29962, 13, 12, 12, 12, 12, 12, 12, 361, 270, 297, 3964, 29879, 29901, 13, 12, 12, 12, 12, 12, 12, 12, 9294, 3964, 29879, 29961, 29881, 29962, 1275, 269, 29892, 285, 29915, 29911, 6073, 15974, 29895, 6525, 881, 367, 13033, 15974, 20158, 29918, 6229, 29879, 29913, 1402, 3964, 15974, 29881, 6525, 881, 505, 7115, 15974, 6229, 29879, 29961, 29881, 29962, 6525, 541, 756, 7115, 15974, 29879, 6525, 29915, 13, 12, 12, 12, 12, 12, 12, 6229, 29879, 29961, 29881, 29962, 353, 269, 13, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 9294, 338, 8758, 29898, 29894, 29892, 298, 511, 285, 29915, 8559, 15974, 29895, 6525, 881, 367, 13033, 15974, 29882, 6525, 541, 338, 13033, 15974, 1853, 29898, 29894, 2915, 29962, 29915, 13, 12, 12, 12, 12, 12, 13, 2 ]
molecule/resources/tests/repo-42/test_repo_42.py
nvaatstra/pdns_recursor-ansible
0
133443
<filename>molecule/resources/tests/repo-42/test_repo_42.py debian_os = ['debian', 'ubuntu'] rhel_os = ['redhat', 'centos'] def test_repo_file(host): f = None if host.system_info.distribution.lower() in debian_os: f = host.file('/etc/apt/sources.list.d/powerdns-rec-42.list') if host.system_info.distribution.lower() in rhel_os: f = host.file('/etc/yum.repos.d/powerdns-rec-42.repo') assert f.exists assert f.user == 'root' assert f.group == 'root' def test_pdns_repo(host): f = None if host.system_info.distribution.lower() in debian_os: f = host.file('/etc/apt/sources.list.d/powerdns-rec-42.list') if host.system_info.distribution.lower() in rhel_os: f = host.file('/etc/yum.repos.d/powerdns-rec-42.repo') assert f.exists assert f.contains('rec-42') def test_pdns_version(host): cmd = host.run('/usr/sbin/pdns_recursor --version') assert 'PowerDNS Recursor' in cmd.stderr assert '4.2' in cmd.stderr def systemd_override(host): fname = '/etc/systemd/system/pdns-recursor.service.d/override.conf' f = host.file(fname) assert not f.contains('User=') assert not f.contains('Group=')
[ 1, 529, 9507, 29958, 29885, 1772, 29883, 1297, 29914, 13237, 29914, 21150, 29914, 20095, 29899, 29946, 29906, 29914, 1688, 29918, 20095, 29918, 29946, 29906, 29889, 2272, 13, 13, 16529, 713, 29918, 359, 353, 6024, 16529, 713, 742, 525, 8767, 2033, 13, 29878, 3952, 29918, 359, 353, 6024, 1127, 2455, 742, 525, 1760, 359, 2033, 13, 13, 13, 1753, 1243, 29918, 20095, 29918, 1445, 29898, 3069, 1125, 13, 1678, 285, 353, 6213, 13, 1678, 565, 3495, 29889, 5205, 29918, 3888, 29889, 27691, 29889, 13609, 580, 297, 2553, 713, 29918, 359, 29901, 13, 4706, 285, 353, 3495, 29889, 1445, 11219, 7070, 29914, 2156, 29914, 29879, 2863, 29889, 1761, 29889, 29881, 29914, 13519, 29881, 1983, 29899, 3757, 29899, 29946, 29906, 29889, 1761, 1495, 13, 1678, 565, 3495, 29889, 5205, 29918, 3888, 29889, 27691, 29889, 13609, 580, 297, 364, 3952, 29918, 359, 29901, 13, 4706, 285, 353, 3495, 29889, 1445, 11219, 7070, 29914, 29891, 398, 29889, 276, 1066, 29889, 29881, 29914, 13519, 29881, 1983, 29899, 3757, 29899, 29946, 29906, 29889, 20095, 1495, 13, 13, 1678, 4974, 285, 29889, 9933, 13, 1678, 4974, 285, 29889, 1792, 1275, 525, 4632, 29915, 13, 1678, 4974, 285, 29889, 2972, 1275, 525, 4632, 29915, 13, 13, 13, 1753, 1243, 29918, 15926, 1983, 29918, 20095, 29898, 3069, 1125, 13, 1678, 285, 353, 6213, 13, 1678, 565, 3495, 29889, 5205, 29918, 3888, 29889, 27691, 29889, 13609, 580, 297, 2553, 713, 29918, 359, 29901, 13, 4706, 285, 353, 3495, 29889, 1445, 11219, 7070, 29914, 2156, 29914, 29879, 2863, 29889, 1761, 29889, 29881, 29914, 13519, 29881, 1983, 29899, 3757, 29899, 29946, 29906, 29889, 1761, 1495, 13, 1678, 565, 3495, 29889, 5205, 29918, 3888, 29889, 27691, 29889, 13609, 580, 297, 364, 3952, 29918, 359, 29901, 13, 4706, 285, 353, 3495, 29889, 1445, 11219, 7070, 29914, 29891, 398, 29889, 276, 1066, 29889, 29881, 29914, 13519, 29881, 1983, 29899, 3757, 29899, 29946, 29906, 29889, 20095, 1495, 13, 13, 1678, 4974, 285, 29889, 9933, 13, 1678, 4974, 285, 29889, 11516, 877, 3757, 29899, 29946, 29906, 1495, 13, 13, 13, 1753, 1243, 29918, 15926, 1983, 29918, 3259, 29898, 3069, 1125, 13, 1678, 9920, 353, 3495, 29889, 3389, 11219, 4855, 29914, 29879, 2109, 29914, 15926, 1983, 29918, 3757, 5966, 1192, 3259, 1495, 13, 13, 1678, 4974, 525, 21472, 29928, 3059, 3599, 5966, 29915, 297, 9920, 29889, 303, 20405, 13, 1678, 4974, 525, 29946, 29889, 29906, 29915, 297, 9920, 29889, 303, 20405, 13, 13, 13, 1753, 1788, 29881, 29918, 15752, 29898, 3069, 1125, 13, 1678, 285, 978, 353, 8207, 7070, 29914, 5205, 29881, 29914, 5205, 29914, 15926, 1983, 29899, 3757, 5966, 29889, 5509, 29889, 29881, 29914, 15752, 29889, 5527, 29915, 13, 1678, 285, 353, 3495, 29889, 1445, 29898, 29888, 978, 29897, 13, 13, 1678, 4974, 451, 285, 29889, 11516, 877, 2659, 29922, 1495, 13, 1678, 4974, 451, 285, 29889, 11516, 877, 4782, 29922, 1495, 13, 2 ]
facetouch/views.py
facetouch/face-I-fy
0
155951
from django.http import JsonResponse from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt import json from facetouch.models import Event, Section, Item, Image from datetime import datetime from django.views.generic import TemplateView @csrf_exempt def create_event(request): if request.method == 'POST': # import pdb;pdb.set_trace() data = json.loads(request.body) event_name = data['event_name'] if "move_left" or "move_right" or "move_up" or "move_down" in event_name: events = Event.objects.filter(event_name=data['event_name'], is_consumed=False) if len(events) > 0: return JsonResponse({'status': 200}) event = Event(event_name=data['event_name'], time_stamp=datetime.utcnow()) event.save() return JsonResponse({'status': 200}) @csrf_exempt def get_event(request): if request.method == 'GET': events = Event.objects.all() for event in events: if not event.is_consumed: event.is_consumed = True event.save() return JsonResponse({'event_name': event.event_name, 'timestamp': event.time_stamp}) return JsonResponse({'status': 'no new event'}) class HomePageView(TemplateView): template_name = "index.html" class EventsPageView(TemplateView): def get(self, request, *args, **kwargs): context = {'data': Event.objects.all()} return render(request, 'home.html', context) class SectionalDetailsView(TemplateView): def get(self, request, *args, **kwargs): sections = Section.objects.all() section_details = [] for section in sections: section_detail = {'id': section.pk, 'name': section.name} section_details.append(section_detail) context = {'data': section_details} return render(request, 'home.html', context) class ItemDetailsView(TemplateView): def get(self, request, *args, **kwargs): section_id = self.kwargs['section_id'] items = Item.objects.filter(section=section_id) item_details = [] for item in items: item_detail = {'name': item.pk, 'name': item.name, 'description': item.description, 'price': item.price, 'image': item.image.url} item_details.append(item_detail) # import pdb;pdb.set_trace() return JsonResponse({'items': item_details}) # return render(request, 'show_items.html', context)
[ 1, 515, 9557, 29889, 1124, 1053, 14355, 5103, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 13, 3166, 9557, 29889, 7406, 29889, 19557, 4097, 29889, 2395, 9600, 1053, 5939, 9600, 29918, 735, 3456, 13, 5215, 4390, 13, 3166, 4024, 300, 3222, 29889, 9794, 1053, 6864, 29892, 9779, 29892, 10976, 29892, 7084, 13, 3166, 12865, 1053, 12865, 13, 3166, 9557, 29889, 7406, 29889, 19206, 1053, 25663, 1043, 13, 13, 13, 29992, 2395, 9600, 29918, 735, 3456, 13, 1753, 1653, 29918, 3696, 29898, 3827, 1125, 13, 1678, 565, 2009, 29889, 5696, 1275, 525, 5438, 2396, 13, 4706, 396, 1053, 282, 2585, 29936, 29886, 2585, 29889, 842, 29918, 15003, 580, 13, 4706, 848, 353, 4390, 29889, 18132, 29898, 3827, 29889, 2587, 29897, 13, 4706, 1741, 29918, 978, 353, 848, 1839, 3696, 29918, 978, 2033, 13, 4706, 565, 376, 11631, 29918, 1563, 29908, 470, 376, 11631, 29918, 1266, 29908, 470, 376, 11631, 29918, 786, 29908, 470, 376, 11631, 29918, 3204, 29908, 297, 1741, 29918, 978, 29901, 13, 9651, 4959, 353, 6864, 29889, 12650, 29889, 4572, 29898, 3696, 29918, 978, 29922, 1272, 1839, 3696, 29918, 978, 7464, 338, 29918, 25978, 287, 29922, 8824, 29897, 13, 9651, 565, 7431, 29898, 13604, 29897, 1405, 29871, 29900, 29901, 13, 18884, 736, 14355, 5103, 3319, 29915, 4882, 2396, 29871, 29906, 29900, 29900, 1800, 13, 4706, 1741, 353, 6864, 29898, 3696, 29918, 978, 29922, 1272, 1839, 3696, 29918, 978, 7464, 931, 29918, 303, 1160, 29922, 12673, 29889, 329, 29883, 3707, 3101, 13, 4706, 1741, 29889, 7620, 580, 13, 1678, 736, 14355, 5103, 3319, 29915, 4882, 2396, 29871, 29906, 29900, 29900, 1800, 13, 13, 13, 29992, 2395, 9600, 29918, 735, 3456, 13, 1753, 679, 29918, 3696, 29898, 3827, 1125, 13, 1678, 565, 2009, 29889, 5696, 1275, 525, 7194, 2396, 13, 4706, 4959, 353, 6864, 29889, 12650, 29889, 497, 580, 13, 4706, 363, 1741, 297, 4959, 29901, 13, 9651, 565, 451, 1741, 29889, 275, 29918, 25978, 287, 29901, 13, 18884, 1741, 29889, 275, 29918, 25978, 287, 353, 5852, 13, 18884, 1741, 29889, 7620, 580, 13, 18884, 736, 14355, 5103, 3319, 29915, 3696, 29918, 978, 2396, 1741, 29889, 3696, 29918, 978, 29892, 525, 16394, 2396, 1741, 29889, 2230, 29918, 303, 1160, 1800, 13, 13, 1678, 736, 14355, 5103, 3319, 29915, 4882, 2396, 525, 1217, 716, 1741, 29915, 1800, 13, 13, 13, 1990, 8778, 5074, 1043, 29898, 6733, 1043, 1125, 13, 1678, 4472, 29918, 978, 353, 376, 2248, 29889, 1420, 29908, 13, 13, 13, 1990, 28488, 5074, 1043, 29898, 6733, 1043, 1125, 13, 1678, 822, 679, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 3030, 353, 11117, 1272, 2396, 6864, 29889, 12650, 29889, 497, 28296, 13, 4706, 736, 4050, 29898, 3827, 29892, 525, 5184, 29889, 1420, 742, 3030, 29897, 13, 13, 13, 1990, 9779, 284, 10602, 1043, 29898, 6733, 1043, 1125, 13, 1678, 822, 679, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 13926, 353, 9779, 29889, 12650, 29889, 497, 580, 13, 4706, 4004, 29918, 14144, 353, 5159, 13, 4706, 363, 4004, 297, 13926, 29901, 13, 9651, 4004, 29918, 16432, 353, 11117, 333, 2396, 4004, 29889, 20571, 29892, 525, 978, 2396, 4004, 29889, 978, 29913, 13, 9651, 4004, 29918, 14144, 29889, 4397, 29898, 2042, 29918, 16432, 29897, 13, 4706, 3030, 353, 11117, 1272, 2396, 4004, 29918, 14144, 29913, 13, 4706, 736, 4050, 29898, 3827, 29892, 525, 5184, 29889, 1420, 742, 3030, 29897, 13, 13, 13, 1990, 10976, 10602, 1043, 29898, 6733, 1043, 1125, 13, 1678, 822, 679, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 4004, 29918, 333, 353, 1583, 29889, 19290, 1839, 2042, 29918, 333, 2033, 13, 4706, 4452, 353, 10976, 29889, 12650, 29889, 4572, 29898, 2042, 29922, 2042, 29918, 333, 29897, 13, 4706, 2944, 29918, 14144, 353, 5159, 13, 4706, 363, 2944, 297, 4452, 29901, 13, 9651, 2944, 29918, 16432, 353, 11117, 978, 2396, 2944, 29889, 20571, 29892, 525, 978, 2396, 2944, 29889, 978, 29892, 525, 8216, 2396, 2944, 29889, 8216, 29892, 525, 9175, 2396, 2944, 29889, 9175, 29892, 13, 462, 965, 525, 3027, 2396, 2944, 29889, 3027, 29889, 2271, 29913, 13, 9651, 2944, 29918, 14144, 29889, 4397, 29898, 667, 29918, 16432, 29897, 13, 9651, 396, 1053, 282, 2585, 29936, 29886, 2585, 29889, 842, 29918, 15003, 580, 13, 4706, 736, 14355, 5103, 3319, 29915, 7076, 2396, 2944, 29918, 14144, 1800, 13, 4706, 396, 736, 4050, 29898, 3827, 29892, 525, 4294, 29918, 7076, 29889, 1420, 742, 3030, 29897, 13, 2 ]
asciimatics/renderers/kaleidoscope.py
fakegit/asciimatics
1
177620
# -*- coding: utf-8 -*- """ This module implements a kaeldioscope effect renderer. """ from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from builtins import range from math import sin, cos, pi, atan2 from asciimatics.renderers.base import DynamicRenderer class Kaleidoscope(DynamicRenderer): """ Renderer to create a 2-mirror kaleidoscope effect. This is a chained renderer (i.e. it acts upon the output of another Renderer which is passed to it on construction). The other Renderer is used as the cell that is rotated over time to create the animation. You can specify the desired rotational symmetry of the kaleidoscope (which determines the angle between the mirrors). If you chose values of less than 2, you are effectively removing one or both mirrors, thus either getting the original cell or a simple mirrored image of the cell. Since this renderer rotates the background cell, it needs operate on square pixels, which means each character in the cell is drawn as 2 next to each other on the screen. In other words the cell needs to be half the width of the desired output (when measured in text characters). """ def __init__(self, height, width, cell, symmetry): """ :param height: Height of the box to contain the kaleidoscope. :param width: Width of the box to contain the kaleidoscope. :param cell: A Renderer to use as the backing cell for the kaleidoscope. :param symmetry: The desired rotational symmetry. Must be a non-negative integer. """ super(Kaleidoscope, self).__init__(height, width) self._symmetry = symmetry self._rotation = 0 self._cell = cell def _render_now(self): # Rotate a point (x, y) through an angle theta. def _rotate(x, y, theta): return x * cos(theta) - y * sin(theta), x * sin(theta) + y * cos(theta) # Reflect a point (x, y) in a line at angle theta def _reflect(x, y, theta): return x * cos(2 * theta) + y * sin(2 * theta), x * sin(2 * theta) - y * cos(2 * theta) # Get the base cell now - so we can pick out characters as needed. text, colour_map = self._cell.rendered_text # Integer maths will result in gaps between characters if you rotate from the starting # point to desired end-point. We therefore look for the reverse mapping from the final # character and trace-back instead. for dx in range(self._canvas.width // 2): for dy in range(self._canvas.height): # Figure out which segment of the circle we're in, so we know what affine # transformations to apply. ox = (dx - self._canvas.width / 4) oy = dy - self._canvas.height / 2 segment = round(atan2(oy, ox) * self._symmetry / pi) if segment % 2 == 0: # Just a rotation required for even segments. x1, y1 = _rotate( ox, oy, 0 if self._symmetry == 0 else -segment * pi / self._symmetry) else: # Odd segments require a rotation and then a reflection. x1, y1 = _rotate(ox, oy, (1 - segment) * pi / self._symmetry) x1, y1 = _reflect(x1, y1, pi / self._symmetry / 2) # Now rotate once more to simulate the rotation of the background cell too. x1, y1 = _rotate(x1, y1, self._rotation) # Re-normalize back to the box coordinates and draw the character that we found # from the reverse mapping. x2 = int(x1 + self._cell.max_width / 2) y2 = int(y1 + self._cell.max_height / 2) if (0 <= y2 < len(text)) and (0 <= x2 < len(text[y2])): self._write(text[y2][x2] + text[y2][x2], dx * 2, dy, colour_map[y2][x2][0], colour_map[y2][x2][1], colour_map[y2][x2][2]) # Now rotate the background cell for the next frame. self._rotation += pi / 180 return self._plain_image, self._colour_map
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 4013, 3883, 10703, 263, 13560, 2495, 2363, 4338, 2779, 4050, 261, 29889, 13, 15945, 29908, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 3166, 4240, 1144, 1053, 3464, 13, 3166, 5844, 1053, 4457, 29892, 6776, 29892, 2930, 29892, 472, 273, 29906, 13, 13, 3166, 408, 455, 15840, 1199, 29889, 9482, 414, 29889, 3188, 1053, 27747, 21323, 13, 13, 13, 1990, 476, 744, 4396, 4338, 29898, 24001, 21323, 1125, 13, 1678, 9995, 13, 1678, 26000, 261, 304, 1653, 263, 29871, 29906, 29899, 11038, 729, 413, 744, 4396, 4338, 2779, 29889, 13, 13, 1678, 910, 338, 263, 521, 7114, 4050, 261, 313, 29875, 29889, 29872, 29889, 372, 14741, 2501, 278, 1962, 310, 1790, 26000, 261, 607, 338, 13, 1678, 4502, 304, 372, 373, 7632, 467, 29871, 450, 916, 26000, 261, 338, 1304, 408, 278, 3038, 393, 338, 5731, 630, 975, 13, 1678, 931, 304, 1653, 278, 9612, 29889, 13, 13, 1678, 887, 508, 6084, 278, 7429, 5731, 1288, 18446, 310, 278, 413, 744, 4396, 4338, 313, 4716, 3683, 1475, 278, 13, 1678, 10696, 1546, 278, 19571, 29879, 467, 29871, 960, 366, 12784, 1819, 310, 3109, 1135, 29871, 29906, 29892, 366, 526, 17583, 11077, 13, 1678, 697, 470, 1716, 19571, 29879, 29892, 4550, 2845, 2805, 278, 2441, 3038, 470, 263, 2560, 19571, 287, 1967, 310, 278, 13, 1678, 3038, 29889, 13, 13, 1678, 4001, 445, 4050, 261, 5731, 1078, 278, 3239, 3038, 29892, 372, 4225, 21994, 373, 6862, 17036, 29892, 607, 13, 1678, 2794, 1269, 2931, 297, 278, 3038, 338, 12061, 408, 29871, 29906, 2446, 304, 1269, 916, 373, 278, 4315, 29889, 29871, 512, 916, 13, 1678, 3838, 278, 3038, 4225, 304, 367, 4203, 278, 2920, 310, 278, 7429, 1962, 313, 8256, 17005, 297, 1426, 13, 1678, 4890, 467, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3171, 29892, 2920, 29892, 3038, 29892, 18446, 1125, 13, 4706, 9995, 13, 4706, 584, 3207, 3171, 29901, 22907, 310, 278, 3800, 304, 1712, 278, 413, 744, 4396, 4338, 29889, 13, 4706, 584, 3207, 2920, 29901, 21485, 310, 278, 3800, 304, 1712, 278, 413, 744, 4396, 4338, 29889, 13, 4706, 584, 3207, 3038, 29901, 319, 26000, 261, 304, 671, 408, 278, 27436, 3038, 363, 278, 413, 744, 4396, 4338, 29889, 13, 4706, 584, 3207, 18446, 29901, 450, 7429, 5731, 1288, 18446, 29889, 29871, 19928, 367, 263, 1661, 29899, 22198, 6043, 29889, 13, 4706, 9995, 13, 4706, 2428, 29898, 29968, 744, 4396, 4338, 29892, 1583, 467, 1649, 2344, 12035, 3545, 29892, 2920, 29897, 13, 4706, 1583, 3032, 11967, 2527, 719, 353, 18446, 13, 4706, 1583, 3032, 5450, 362, 353, 29871, 29900, 13, 4706, 1583, 3032, 3729, 353, 3038, 13, 13, 1678, 822, 903, 9482, 29918, 3707, 29898, 1311, 1125, 13, 4706, 396, 9664, 403, 263, 1298, 313, 29916, 29892, 343, 29897, 1549, 385, 10696, 278, 941, 29889, 13, 4706, 822, 903, 23361, 29898, 29916, 29892, 343, 29892, 278, 941, 1125, 13, 9651, 736, 921, 334, 6776, 29898, 3416, 29897, 448, 343, 334, 4457, 29898, 3416, 511, 921, 334, 4457, 29898, 3416, 29897, 718, 343, 334, 6776, 29898, 3416, 29897, 13, 13, 4706, 396, 9897, 781, 263, 1298, 313, 29916, 29892, 343, 29897, 297, 263, 1196, 472, 10696, 278, 941, 13, 4706, 822, 903, 13191, 29898, 29916, 29892, 343, 29892, 278, 941, 1125, 13, 9651, 736, 921, 334, 6776, 29898, 29906, 334, 278, 941, 29897, 718, 343, 334, 4457, 29898, 29906, 334, 278, 941, 511, 921, 334, 4457, 29898, 29906, 334, 278, 941, 29897, 448, 343, 334, 6776, 29898, 29906, 334, 278, 941, 29897, 13, 13, 4706, 396, 3617, 278, 2967, 3038, 1286, 448, 577, 591, 508, 5839, 714, 4890, 408, 4312, 29889, 13, 4706, 1426, 29892, 12384, 29918, 1958, 353, 1583, 3032, 3729, 29889, 9482, 287, 29918, 726, 13, 13, 4706, 396, 8102, 5844, 29879, 674, 1121, 297, 330, 2547, 1546, 4890, 565, 366, 16734, 515, 278, 6257, 13, 4706, 396, 1298, 304, 7429, 1095, 29899, 3149, 29889, 29871, 1334, 5480, 1106, 363, 278, 11837, 10417, 515, 278, 2186, 13, 4706, 396, 2931, 322, 9637, 29899, 1627, 2012, 29889, 13, 4706, 363, 15414, 297, 3464, 29898, 1311, 3032, 15257, 29889, 2103, 849, 29871, 29906, 1125, 13, 9651, 363, 13475, 297, 3464, 29898, 1311, 3032, 15257, 29889, 3545, 1125, 13, 18884, 396, 11479, 714, 607, 10768, 310, 278, 8607, 591, 29915, 276, 297, 29892, 577, 591, 1073, 825, 2756, 457, 13, 18884, 396, 29304, 304, 3394, 29889, 13, 18884, 19100, 353, 313, 8235, 448, 1583, 3032, 15257, 29889, 2103, 847, 29871, 29946, 29897, 13, 18884, 288, 29891, 353, 13475, 448, 1583, 3032, 15257, 29889, 3545, 847, 29871, 29906, 13, 18884, 10768, 353, 4513, 29898, 23402, 29906, 29898, 12602, 29892, 19100, 29897, 334, 1583, 3032, 11967, 2527, 719, 847, 2930, 29897, 13, 18884, 565, 10768, 1273, 29871, 29906, 1275, 29871, 29900, 29901, 13, 462, 1678, 396, 3387, 263, 13733, 3734, 363, 1584, 24611, 29889, 13, 462, 1678, 921, 29896, 29892, 343, 29896, 353, 903, 23361, 29898, 13, 462, 4706, 19100, 29892, 288, 29891, 29892, 29871, 29900, 565, 1583, 3032, 11967, 2527, 719, 1275, 29871, 29900, 1683, 448, 28192, 334, 2930, 847, 1583, 3032, 11967, 2527, 719, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 396, 438, 1289, 24611, 1996, 263, 13733, 322, 769, 263, 17842, 29889, 13, 462, 1678, 921, 29896, 29892, 343, 29896, 353, 903, 23361, 29898, 2251, 29892, 288, 29891, 29892, 313, 29896, 448, 10768, 29897, 334, 2930, 847, 1583, 3032, 11967, 2527, 719, 29897, 13, 462, 1678, 921, 29896, 29892, 343, 29896, 353, 903, 13191, 29898, 29916, 29896, 29892, 343, 29896, 29892, 2930, 847, 1583, 3032, 11967, 2527, 719, 847, 29871, 29906, 29897, 13, 13, 18884, 396, 2567, 16734, 2748, 901, 304, 29611, 278, 13733, 310, 278, 3239, 3038, 2086, 29889, 13, 18884, 921, 29896, 29892, 343, 29896, 353, 903, 23361, 29898, 29916, 29896, 29892, 343, 29896, 29892, 1583, 3032, 5450, 362, 29897, 13, 13, 18884, 396, 830, 29899, 8945, 675, 1250, 304, 278, 3800, 10350, 322, 4216, 278, 2931, 393, 591, 1476, 13, 18884, 396, 515, 278, 11837, 10417, 29889, 13, 18884, 921, 29906, 353, 938, 29898, 29916, 29896, 718, 1583, 3032, 3729, 29889, 3317, 29918, 2103, 847, 29871, 29906, 29897, 13, 18884, 343, 29906, 353, 938, 29898, 29891, 29896, 718, 1583, 3032, 3729, 29889, 3317, 29918, 3545, 847, 29871, 29906, 29897, 13, 18884, 565, 313, 29900, 5277, 343, 29906, 529, 7431, 29898, 726, 876, 322, 313, 29900, 5277, 921, 29906, 529, 7431, 29898, 726, 29961, 29891, 29906, 12622, 29901, 13, 462, 1678, 1583, 3032, 3539, 29898, 726, 29961, 29891, 29906, 3816, 29916, 29906, 29962, 718, 1426, 29961, 29891, 29906, 3816, 29916, 29906, 1402, 13, 462, 18884, 15414, 334, 29871, 29906, 29892, 13, 462, 18884, 13475, 29892, 13, 462, 18884, 12384, 29918, 1958, 29961, 29891, 29906, 3816, 29916, 29906, 3816, 29900, 1402, 13, 462, 18884, 12384, 29918, 1958, 29961, 29891, 29906, 3816, 29916, 29906, 3816, 29896, 1402, 13, 462, 18884, 12384, 29918, 1958, 29961, 29891, 29906, 3816, 29916, 29906, 3816, 29906, 2314, 13, 13, 4706, 396, 2567, 16734, 278, 3239, 3038, 363, 278, 2446, 3515, 29889, 13, 4706, 1583, 3032, 5450, 362, 4619, 2930, 847, 29871, 29896, 29947, 29900, 13, 13, 4706, 736, 1583, 3032, 24595, 29918, 3027, 29892, 1583, 3032, 1054, 473, 29918, 1958, 13, 2 ]
src/pynwb/ndx_icephys_meta/io/icephys.py
oruebel/ndx-icephys-meta
6
27023
<reponame>oruebel/ndx-icephys-meta """ Module with ObjectMapper classes for the icephys-meta Container classes/neurodata_types """ from pynwb import register_map from pynwb.io.file import NWBFileMap from hdmf.common.io.table import DynamicTableMap from ndx_icephys_meta.icephys import ICEphysFile, AlignedDynamicTable @register_map(ICEphysFile) class ICEphysFileMap(NWBFileMap): """ Customize object mapping for ICEphysFile to define the mapping for our custom icephys tables, i.e., InteracellularRecordings, SimultaneousRecordingsTable, SequentialRecordingsTable, RepetitionsTable, and ExperimentalConditionsTable """ def __init__(self, spec): super().__init__(spec) general_spec = self.spec.get_group('general') icephys_spec = general_spec.get_group('intracellular_ephys') self.map_spec('intracellular_recordings', icephys_spec.get_neurodata_type('IntracellularRecordingsTable')) self.map_spec('icephys_simultaneous_recordings', icephys_spec.get_neurodata_type('SimultaneousRecordingsTable')) self.map_spec('icephys_sequential_recordings', icephys_spec.get_neurodata_type('SequentialRecordingsTable')) self.map_spec('icephys_repetitions', icephys_spec.get_neurodata_type('RepetitionsTable')) self.map_spec('icephys_experimental_conditions', icephys_spec.get_neurodata_type('ExperimentalConditionsTable')) self.map_spec('ic_filtering', icephys_spec.get_dataset('filtering')) @register_map(AlignedDynamicTable) class AlignedDynamicTableMap(DynamicTableMap): """ Customize the mapping for AlignedDynamicTable """ def __init__(self, spec): super().__init__(spec) # By default the DynamicTables contained as sub-categories in the AlignedDynamicTable are mapped to # the 'dynamic_tables' class attribute. This renames the attribute to 'category_tables' self.map_spec('category_tables', spec.get_neurodata_type('DynamicTable')) @DynamicTableMap.object_attr('electrodes') def electrodes(self, container, manager): return container.category_tables.get('electrodes', None) @DynamicTableMap.object_attr('stimuli') def stimuli(self, container, manager): return container.category_tables.get('stimuli', None) @DynamicTableMap.object_attr('responses') def responses(self, container, manager): return container.category_tables.get('responses', None)
[ 1, 529, 276, 1112, 420, 29958, 272, 434, 6596, 29914, 299, 29916, 29899, 625, 14017, 29899, 7299, 13, 15945, 29908, 13, 7355, 411, 4669, 19968, 4413, 363, 278, 14890, 14017, 29899, 7299, 21679, 4413, 29914, 484, 2192, 1272, 29918, 8768, 13, 15945, 29908, 13, 3166, 282, 948, 29893, 29890, 1053, 6036, 29918, 1958, 13, 3166, 282, 948, 29893, 29890, 29889, 601, 29889, 1445, 1053, 405, 29956, 29933, 2283, 3388, 13, 3166, 298, 18933, 29888, 29889, 9435, 29889, 601, 29889, 2371, 1053, 27747, 3562, 3388, 13, 3166, 29871, 299, 29916, 29918, 625, 14017, 29918, 7299, 29889, 625, 14017, 1053, 306, 4741, 14017, 2283, 29892, 838, 12961, 24001, 3562, 13, 13, 13, 29992, 9573, 29918, 1958, 29898, 12107, 14017, 2283, 29897, 13, 1990, 306, 4741, 14017, 2283, 3388, 29898, 29940, 29956, 29933, 2283, 3388, 1125, 13, 1678, 9995, 13, 1678, 8701, 675, 1203, 10417, 363, 306, 4741, 14017, 2283, 304, 4529, 278, 10417, 13, 1678, 363, 1749, 2888, 14890, 14017, 6131, 29892, 474, 29889, 29872, 1696, 4124, 562, 514, 1070, 9182, 886, 29892, 3439, 499, 23584, 9182, 886, 3562, 29892, 13, 1678, 922, 339, 2556, 9182, 886, 3562, 29892, 10088, 300, 2187, 3562, 29892, 322, 1222, 27910, 10983, 2187, 3562, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1580, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 6550, 29897, 13, 4706, 2498, 29918, 6550, 353, 1583, 29889, 6550, 29889, 657, 29918, 2972, 877, 17492, 1495, 13, 4706, 14890, 14017, 29918, 6550, 353, 2498, 29918, 6550, 29889, 657, 29918, 2972, 877, 524, 945, 514, 1070, 29918, 29872, 14017, 1495, 13, 4706, 1583, 29889, 1958, 29918, 6550, 877, 524, 945, 514, 1070, 29918, 11651, 886, 742, 14890, 14017, 29918, 6550, 29889, 657, 29918, 484, 2192, 1272, 29918, 1853, 877, 2928, 945, 514, 1070, 9182, 886, 3562, 8785, 13, 4706, 1583, 29889, 1958, 29918, 6550, 877, 625, 14017, 29918, 3601, 499, 23584, 29918, 11651, 886, 742, 14890, 14017, 29918, 6550, 29889, 657, 29918, 484, 2192, 1272, 29918, 1853, 877, 8942, 499, 23584, 9182, 886, 3562, 8785, 13, 4706, 1583, 29889, 1958, 29918, 6550, 877, 625, 14017, 29918, 6831, 2556, 29918, 11651, 886, 742, 14890, 14017, 29918, 6550, 29889, 657, 29918, 484, 2192, 1272, 29918, 1853, 877, 16941, 2556, 9182, 886, 3562, 8785, 13, 4706, 1583, 29889, 1958, 29918, 6550, 877, 625, 14017, 29918, 3445, 300, 2187, 742, 14890, 14017, 29918, 6550, 29889, 657, 29918, 484, 2192, 1272, 29918, 1853, 877, 5612, 300, 2187, 3562, 8785, 13, 4706, 1583, 29889, 1958, 29918, 6550, 877, 625, 14017, 29918, 735, 27910, 29918, 1116, 2187, 742, 14890, 14017, 29918, 6550, 29889, 657, 29918, 484, 2192, 1272, 29918, 1853, 877, 1252, 27910, 10983, 2187, 3562, 8785, 13, 4706, 1583, 29889, 1958, 29918, 6550, 877, 293, 29918, 4572, 292, 742, 14890, 14017, 29918, 6550, 29889, 657, 29918, 24713, 877, 4572, 292, 8785, 13, 13, 13, 29992, 9573, 29918, 1958, 29898, 2499, 12961, 24001, 3562, 29897, 13, 1990, 838, 12961, 24001, 3562, 3388, 29898, 24001, 3562, 3388, 1125, 13, 1678, 9995, 13, 1678, 8701, 675, 278, 10417, 363, 838, 12961, 24001, 3562, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1580, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 6550, 29897, 13, 4706, 396, 2648, 2322, 278, 27747, 24924, 11122, 408, 1014, 29899, 20683, 297, 278, 838, 12961, 24001, 3562, 526, 20545, 304, 13, 4706, 396, 278, 525, 16626, 29918, 24051, 29915, 770, 5352, 29889, 910, 4325, 1280, 278, 5352, 304, 525, 7320, 29918, 24051, 29915, 13, 4706, 1583, 29889, 1958, 29918, 6550, 877, 7320, 29918, 24051, 742, 1580, 29889, 657, 29918, 484, 2192, 1272, 29918, 1853, 877, 24001, 3562, 8785, 13, 13, 1678, 732, 24001, 3562, 3388, 29889, 3318, 29918, 5552, 877, 15436, 307, 2783, 1495, 13, 1678, 822, 28118, 2783, 29898, 1311, 29892, 5639, 29892, 8455, 1125, 13, 4706, 736, 5639, 29889, 7320, 29918, 24051, 29889, 657, 877, 15436, 307, 2783, 742, 6213, 29897, 13, 13, 1678, 732, 24001, 3562, 3388, 29889, 3318, 29918, 5552, 877, 303, 326, 14549, 1495, 13, 1678, 822, 20436, 14549, 29898, 1311, 29892, 5639, 29892, 8455, 1125, 13, 4706, 736, 5639, 29889, 7320, 29918, 24051, 29889, 657, 877, 303, 326, 14549, 742, 6213, 29897, 13, 13, 1678, 732, 24001, 3562, 3388, 29889, 3318, 29918, 5552, 877, 26679, 267, 1495, 13, 1678, 822, 20890, 29898, 1311, 29892, 5639, 29892, 8455, 1125, 13, 4706, 736, 5639, 29889, 7320, 29918, 24051, 29889, 657, 877, 26679, 267, 742, 6213, 29897, 13, 2 ]
tests/test_serializers.py
rojoca/django-rest-framework-jwt
0
199939
<gh_stars>0 import unittest from distutils.version import StrictVersion import django from django.http import HttpRequest from django.test import TestCase from django.test.utils import override_settings import rest_framework from rest_framework.request import Request from rest_framework_jwt.compat import get_user_model from rest_framework_jwt.serializers import JSONWebTokenSerializer from rest_framework_jwt import utils User = get_user_model() drf2 = rest_framework.VERSION < StrictVersion('3.0.0') drf3 = rest_framework.VERSION >= StrictVersion('3.0.0') class JSONWebTokenSerializerTests(TestCase): def setUp(self): self.email = '<EMAIL>' self.username = 'jpueblo' self.password = 'password' self.user = User.objects.create_user( self.username, self.email, self.password) self.data = { 'username': self.username, 'password': <PASSWORD> } def get_serializer(self, **kwargs): serializer = JSONWebTokenSerializer(**kwargs) serializer.context['request'] = Request(HttpRequest()), return serializer @unittest.skipUnless(drf2, 'not supported in this version') def test_empty_drf2(self): serializer = self.get_serializer() expected = { 'username': '' } self.assertEqual(serializer.data, expected) @unittest.skipUnless(drf3, 'not supported in this version') def test_empty_drf3(self): serializer = self.get_serializer() expected = { 'username': '', 'password': '' } self.assertEqual(serializer.data, expected) def test_create(self): serializer = self.get_serializer(data=self.data) is_valid = serializer.is_valid() token = serializer.object['token'] decoded_payload = utils.jwt_decode_handler(token) self.assertTrue(is_valid) self.assertEqual(decoded_payload['username'], self.username) def test_invalid_credentials(self): self.data['password'] = '<PASSWORD>' serializer = self.get_serializer(data=self.data) is_valid = serializer.is_valid() expected_error = { 'non_field_errors': ['Unable to log in with provided credentials.'] } self.assertFalse(is_valid) self.assertEqual(serializer.errors, expected_error) @unittest.skipIf( django.VERSION[1] >= 10, reason='The ModelBackend does not permit login when is_active is False.') def test_disabled_user(self): self.user.is_active = False self.user.save() serializer = self.get_serializer(data=self.data) is_valid = serializer.is_valid() expected_error = { 'non_field_errors': ['User account is disabled.'] } self.assertFalse(is_valid) self.assertEqual(serializer.errors, expected_error) @unittest.skipUnless( django.VERSION[1] >= 10, reason='The AllowAllUsersModelBackend permits login when is_active is False.') @override_settings(AUTHENTICATION_BACKENDS=[ 'django.contrib.auth.backends.AllowAllUsersModelBackend']) def test_disabled_user_all_users_backend(self): self.user.is_active = False self.user.save() serializer = self.get_serializer(data=self.data) is_valid = serializer.is_valid() expected_error = { 'non_field_errors': ['User account is disabled.'] } self.assertFalse(is_valid) self.assertEqual(serializer.errors, expected_error) def test_required_fields(self): serializer = self.get_serializer(data={}) is_valid = serializer.is_valid() expected_error = { 'username': ['This field is required.'], 'password': ['<PASSWORD>.'] } self.assertFalse(is_valid) self.assertEqual(serializer.errors, expected_error)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 443, 27958, 13, 3166, 1320, 13239, 29889, 3259, 1053, 3767, 919, 6594, 13, 13, 5215, 9557, 13, 3166, 9557, 29889, 1124, 1053, 9056, 3089, 13, 3166, 9557, 29889, 1688, 1053, 4321, 8259, 13, 3166, 9557, 29889, 1688, 29889, 13239, 1053, 5712, 29918, 11027, 13, 13, 5215, 1791, 29918, 4468, 13, 3166, 1791, 29918, 4468, 29889, 3827, 1053, 10729, 13, 13, 13, 3166, 1791, 29918, 4468, 29918, 29926, 14554, 29889, 12667, 1053, 679, 29918, 1792, 29918, 4299, 13, 3166, 1791, 29918, 4468, 29918, 29926, 14554, 29889, 15550, 19427, 1053, 4663, 3609, 6066, 17679, 13, 3166, 1791, 29918, 4468, 29918, 29926, 14554, 1053, 3667, 29879, 13, 13, 2659, 353, 679, 29918, 1792, 29918, 4299, 580, 13, 13, 7707, 29888, 29906, 353, 1791, 29918, 4468, 29889, 16358, 529, 3767, 919, 6594, 877, 29941, 29889, 29900, 29889, 29900, 1495, 13, 7707, 29888, 29941, 353, 1791, 29918, 4468, 29889, 16358, 6736, 3767, 919, 6594, 877, 29941, 29889, 29900, 29889, 29900, 1495, 13, 13, 13, 1990, 4663, 3609, 6066, 17679, 24376, 29898, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 5269, 353, 12801, 26862, 6227, 16299, 13, 4706, 1583, 29889, 6786, 353, 525, 16865, 434, 14073, 29915, 13, 4706, 1583, 29889, 5630, 353, 525, 5630, 29915, 13, 4706, 1583, 29889, 1792, 353, 4911, 29889, 12650, 29889, 3258, 29918, 1792, 29898, 13, 9651, 1583, 29889, 6786, 29892, 1583, 29889, 5269, 29892, 1583, 29889, 5630, 29897, 13, 13, 4706, 1583, 29889, 1272, 353, 426, 13, 9651, 525, 6786, 2396, 1583, 29889, 6786, 29892, 13, 9651, 525, 5630, 2396, 529, 25711, 17013, 29958, 13, 4706, 500, 13, 13, 1678, 822, 679, 29918, 15550, 3950, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 7797, 3950, 353, 4663, 3609, 6066, 17679, 29898, 1068, 19290, 29897, 13, 4706, 7797, 3950, 29889, 4703, 1839, 3827, 2033, 353, 10729, 29898, 26021, 25739, 13, 4706, 736, 7797, 3950, 13, 13, 1678, 732, 348, 27958, 29889, 11014, 2525, 2222, 29898, 7707, 29888, 29906, 29892, 525, 1333, 6969, 297, 445, 1873, 1495, 13, 1678, 822, 1243, 29918, 6310, 29918, 7707, 29888, 29906, 29898, 1311, 1125, 13, 4706, 7797, 3950, 353, 1583, 29889, 657, 29918, 15550, 3950, 580, 13, 4706, 3806, 353, 426, 13, 9651, 525, 6786, 2396, 6629, 13, 4706, 500, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 15550, 3950, 29889, 1272, 29892, 3806, 29897, 13, 13, 1678, 732, 348, 27958, 29889, 11014, 2525, 2222, 29898, 7707, 29888, 29941, 29892, 525, 1333, 6969, 297, 445, 1873, 1495, 13, 1678, 822, 1243, 29918, 6310, 29918, 7707, 29888, 29941, 29898, 1311, 1125, 13, 4706, 7797, 3950, 353, 1583, 29889, 657, 29918, 15550, 3950, 580, 13, 4706, 3806, 353, 426, 13, 9651, 525, 6786, 2396, 15516, 13, 9651, 525, 5630, 2396, 6629, 13, 4706, 500, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 15550, 3950, 29889, 1272, 29892, 3806, 29897, 13, 13, 1678, 822, 1243, 29918, 3258, 29898, 1311, 1125, 13, 4706, 7797, 3950, 353, 1583, 29889, 657, 29918, 15550, 3950, 29898, 1272, 29922, 1311, 29889, 1272, 29897, 13, 4706, 338, 29918, 3084, 353, 7797, 3950, 29889, 275, 29918, 3084, 580, 13, 13, 4706, 5993, 353, 7797, 3950, 29889, 3318, 1839, 6979, 2033, 13, 4706, 1602, 6797, 29918, 23813, 353, 3667, 29879, 29889, 29926, 14554, 29918, 13808, 29918, 13789, 29898, 6979, 29897, 13, 13, 4706, 1583, 29889, 9294, 5574, 29898, 275, 29918, 3084, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 7099, 6797, 29918, 23813, 1839, 6786, 7464, 1583, 29889, 6786, 29897, 13, 13, 1678, 822, 1243, 29918, 20965, 29918, 11944, 9409, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1272, 1839, 5630, 2033, 353, 12801, 25711, 17013, 16299, 13, 4706, 7797, 3950, 353, 1583, 29889, 657, 29918, 15550, 3950, 29898, 1272, 29922, 1311, 29889, 1272, 29897, 13, 4706, 338, 29918, 3084, 353, 7797, 3950, 29889, 275, 29918, 3084, 580, 13, 13, 4706, 3806, 29918, 2704, 353, 426, 13, 9651, 525, 5464, 29918, 2671, 29918, 12523, 2396, 6024, 2525, 519, 304, 1480, 297, 411, 4944, 16140, 29889, 2033, 13, 4706, 500, 13, 13, 4706, 1583, 29889, 9294, 8824, 29898, 275, 29918, 3084, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 15550, 3950, 29889, 12523, 29892, 3806, 29918, 2704, 29897, 13, 13, 1678, 732, 348, 27958, 29889, 11014, 3644, 29898, 13, 4706, 9557, 29889, 16358, 29961, 29896, 29962, 6736, 29871, 29896, 29900, 29892, 13, 4706, 2769, 2433, 1576, 8125, 5841, 355, 947, 451, 14257, 6464, 746, 338, 29918, 4925, 338, 7700, 29889, 1495, 13, 1678, 822, 1243, 29918, 18279, 29918, 1792, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1792, 29889, 275, 29918, 4925, 353, 7700, 13, 4706, 1583, 29889, 1792, 29889, 7620, 580, 13, 13, 4706, 7797, 3950, 353, 1583, 29889, 657, 29918, 15550, 3950, 29898, 1272, 29922, 1311, 29889, 1272, 29897, 13, 4706, 338, 29918, 3084, 353, 7797, 3950, 29889, 275, 29918, 3084, 580, 13, 13, 4706, 3806, 29918, 2704, 353, 426, 13, 9651, 525, 5464, 29918, 2671, 29918, 12523, 2396, 6024, 2659, 3633, 338, 12708, 29889, 2033, 13, 4706, 500, 13, 13, 4706, 1583, 29889, 9294, 8824, 29898, 275, 29918, 3084, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 15550, 3950, 29889, 12523, 29892, 3806, 29918, 2704, 29897, 13, 13, 1678, 732, 348, 27958, 29889, 11014, 2525, 2222, 29898, 13, 4706, 9557, 29889, 16358, 29961, 29896, 29962, 6736, 29871, 29896, 29900, 29892, 13, 4706, 2769, 2433, 1576, 29408, 3596, 5959, 3195, 5841, 355, 3635, 1169, 6464, 746, 338, 29918, 4925, 338, 7700, 29889, 1495, 13, 1678, 732, 15752, 29918, 11027, 29898, 20656, 29950, 3919, 28541, 29918, 29933, 11375, 1430, 8452, 11759, 13, 4706, 525, 14095, 29889, 21570, 29889, 5150, 29889, 1627, 1975, 29889, 15930, 3596, 5959, 3195, 5841, 355, 11287, 13, 1678, 822, 1243, 29918, 18279, 29918, 1792, 29918, 497, 29918, 7193, 29918, 27852, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1792, 29889, 275, 29918, 4925, 353, 7700, 13, 4706, 1583, 29889, 1792, 29889, 7620, 580, 13, 13, 4706, 7797, 3950, 353, 1583, 29889, 657, 29918, 15550, 3950, 29898, 1272, 29922, 1311, 29889, 1272, 29897, 13, 4706, 338, 29918, 3084, 353, 7797, 3950, 29889, 275, 29918, 3084, 580, 13, 13, 4706, 3806, 29918, 2704, 353, 426, 13, 9651, 525, 5464, 29918, 2671, 29918, 12523, 2396, 6024, 2659, 3633, 338, 12708, 29889, 2033, 13, 4706, 500, 13, 13, 4706, 1583, 29889, 9294, 8824, 29898, 275, 29918, 3084, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 15550, 3950, 29889, 12523, 29892, 3806, 29918, 2704, 29897, 13, 13, 1678, 822, 1243, 29918, 12403, 29918, 9621, 29898, 1311, 1125, 13, 4706, 7797, 3950, 353, 1583, 29889, 657, 29918, 15550, 3950, 29898, 1272, 3790, 1800, 13, 4706, 338, 29918, 3084, 353, 7797, 3950, 29889, 275, 29918, 3084, 580, 13, 13, 4706, 3806, 29918, 2704, 353, 426, 13, 9651, 525, 6786, 2396, 6024, 4013, 1746, 338, 3734, 6169, 1402, 13, 9651, 525, 5630, 2396, 6024, 29966, 25711, 17013, 15513, 2033, 13, 4706, 500, 13, 13, 4706, 1583, 29889, 9294, 8824, 29898, 275, 29918, 3084, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 15550, 3950, 29889, 12523, 29892, 3806, 29918, 2704, 29897, 13, 2 ]
mars/tensor/reduction/nanmean.py
haijohn/mars
1
199462
<filename>mars/tensor/reduction/nanmean.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2020 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import numpy as np from ... import opcodes as OperandDef from ..datasource import tensor as astensor from ..array_utils import as_same_device, device from .core import TensorReduction, TensorReductionMixin, nannumel from .mean import TensorMean class TensorNanMean(TensorReduction, TensorReductionMixin): _op_type_ = OperandDef.NANMEAN def __init__(self, axis=None, keepdims=None, combine_size=None, stage=None, **kw): stage = self._rewrite_stage(stage) super().__init__(_axis=axis, _keepdims=keepdims, _combine_size=combine_size, stage=stage, **kw) @classmethod def execute_map(cls, ctx, op): (in_chunk,), device_id, xp = as_same_device( [ctx[c.key] for c in op.inputs], device=op.device, ret_extra=True) axis = cls.get_axis(op.axis) with device(device_id): chunk_count = nannumel(in_chunk, axis=axis, dtype=np.int64, keepdims=bool(op.keepdims)) chunk_sum = xp.nansum(in_chunk, axis=axis, dtype=op.dtype, keepdims=bool(op.keepdims)) ctx[op.outputs[0].key] = (chunk_sum, chunk_count) @classmethod def execute_agg(cls, ctx, op): axis = cls.get_axis(op.axis) a = ctx[op.inputs[0].key] if not isinstance(a, (list, tuple)): (inp,), device_id, xp = as_same_device( [a], device=op.device, ret_extra=True) with device(device_id): ctx[op.outputs[0].key] = xp.nanmean(inp, axis=axis, dtype=op.dtype, keepdims=bool(op.keepdims)) else: (_data, _count), device_id, xp = as_same_device( a, device=op.device, ret_extra=True) with device(device_id): chunk_count = xp.sum(_count, axis=axis, dtype=op.dtype, keepdims=bool(op.keepdims)) chunk_sum = xp.sum(_data, axis=axis, dtype=op.dtype, keepdims=bool(op.keepdims)) ctx[op.outputs[0].key] = xp.true_divide(chunk_sum, chunk_count, dtype=op.dtype) @classmethod def execute_combine(cls, ctx, op): TensorMean.execute_combine(ctx, op) def nanmean(a, axis=None, dtype=None, out=None, keepdims=None, combine_size=None): """ Compute the arithmetic mean along the specified axis, ignoring NaNs. Returns the average of the tensor elements. The average is taken over the flattened tensor by default, otherwise over the specified axis. `float64` intermediate and return values are used for integer inputs. For all-NaN slices, NaN is returned and a `RuntimeWarning` is raised. Parameters ---------- a : array_like Tensor containing numbers whose mean is desired. If `a` is not an tensor, a conversion is attempted. axis : int, optional Axis along which the means are computed. The default is to compute the mean of the flattened tensor. dtype : data-type, optional Type to use in computing the mean. For integer inputs, the default is `float64`; for inexact inputs, it is the same as the input dtype. out : Tensor, optional Alternate output tensor in which to place the result. The default is ``None``; if provided, it must have the same shape as the expected output, but the type will be cast if necessary. See `doc.ufuncs` for details. keepdims : bool, optional If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the original `a`. If the value is anything but the default, then `keepdims` will be passed through to the `mean` or `sum` methods of sub-classes of `Tensor`. If the sub-classes methods does not implement `keepdims` any exceptions will be raised. combine_size: int, optional The number of chunks to combine. Returns ------- m : Tensor, see dtype parameter above If `out=None`, returns a new array containing the mean values, otherwise a reference to the output array is returned. Nan is returned for slices that contain only NaNs. See Also -------- average : Weighted average mean : Arithmetic mean taken while not ignoring NaNs var, nanvar Notes ----- The arithmetic mean is the sum of the non-NaN elements along the axis divided by the number of non-NaN elements. Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for `float32`. Specifying a higher-precision accumulator using the `dtype` keyword can alleviate this issue. Examples -------- >>> import mars.tensor as mt >>> a = mt.array([[1, mt.nan], [3, 4]]) >>> mt.nanmean(a).execute() 2.6666666666666665 >>> mt.nanmean(a, axis=0).execute() array([ 2., 4.]) >>> mt.nanmean(a, axis=1).execute() array([ 1., 3.5]) """ a = astensor(a) if dtype is None: dtype = np.nanmean(np.empty((1,), dtype=a.dtype)).dtype op = TensorNanMean(axis=axis, dtype=dtype, keepdims=keepdims, combine_size=combine_size) return op(a, out=out)
[ 1, 529, 9507, 29958, 29885, 1503, 29914, 20158, 29914, 9313, 428, 29914, 13707, 12676, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 14187, 1266, 29871, 29896, 29929, 29929, 29929, 29899, 29906, 29900, 29906, 29900, 319, 1982, 5363, 6431, 21771, 292, 19806, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 418, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 2023, 1053, 1015, 18137, 408, 6607, 392, 3206, 13, 3166, 6317, 14538, 1167, 1053, 12489, 408, 8717, 6073, 13, 3166, 6317, 2378, 29918, 13239, 1053, 408, 29918, 17642, 29918, 10141, 29892, 4742, 13, 3166, 869, 3221, 1053, 323, 6073, 29934, 6085, 428, 29892, 323, 6073, 29934, 6085, 428, 29924, 861, 262, 29892, 302, 812, 398, 295, 13, 3166, 869, 12676, 1053, 323, 6073, 6816, 273, 13, 13, 13, 1990, 323, 6073, 29940, 273, 6816, 273, 29898, 29911, 6073, 29934, 6085, 428, 29892, 323, 6073, 29934, 6085, 428, 29924, 861, 262, 1125, 13, 1678, 903, 459, 29918, 1853, 29918, 353, 6607, 392, 3206, 29889, 29940, 2190, 2303, 2190, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 9685, 29922, 8516, 29892, 3013, 6229, 29879, 29922, 8516, 29892, 14405, 29918, 2311, 29922, 8516, 29892, 7408, 29922, 8516, 29892, 3579, 11022, 1125, 13, 4706, 7408, 353, 1583, 3032, 23174, 29918, 19190, 29898, 19190, 29897, 13, 4706, 2428, 2141, 1649, 2344, 1649, 7373, 8990, 29922, 8990, 29892, 903, 17462, 6229, 29879, 29922, 17462, 6229, 29879, 29892, 13, 462, 308, 903, 17743, 457, 29918, 2311, 29922, 17743, 457, 29918, 2311, 29892, 7408, 29922, 19190, 29892, 3579, 11022, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 6222, 29918, 1958, 29898, 25932, 29892, 12893, 29892, 1015, 1125, 13, 4706, 313, 262, 29918, 29812, 29892, 511, 4742, 29918, 333, 29892, 921, 29886, 353, 408, 29918, 17642, 29918, 10141, 29898, 13, 9651, 518, 13073, 29961, 29883, 29889, 1989, 29962, 363, 274, 297, 1015, 29889, 2080, 29879, 1402, 4742, 29922, 459, 29889, 10141, 29892, 3240, 29918, 17833, 29922, 5574, 29897, 13, 13, 4706, 9685, 353, 1067, 29879, 29889, 657, 29918, 8990, 29898, 459, 29889, 8990, 29897, 13, 13, 4706, 411, 4742, 29898, 10141, 29918, 333, 1125, 13, 9651, 19875, 29918, 2798, 353, 302, 812, 398, 295, 29898, 262, 29918, 29812, 29892, 9685, 29922, 8990, 29892, 26688, 29922, 9302, 29889, 524, 29953, 29946, 29892, 13, 462, 462, 259, 3013, 6229, 29879, 29922, 11227, 29898, 459, 29889, 17462, 6229, 29879, 876, 13, 9651, 19875, 29918, 2083, 353, 921, 29886, 29889, 29876, 550, 398, 29898, 262, 29918, 29812, 29892, 9685, 29922, 8990, 29892, 26688, 29922, 459, 29889, 29881, 1853, 29892, 13, 462, 462, 29871, 3013, 6229, 29879, 29922, 11227, 29898, 459, 29889, 17462, 6229, 29879, 876, 13, 9651, 12893, 29961, 459, 29889, 4905, 29879, 29961, 29900, 1822, 1989, 29962, 353, 313, 29812, 29918, 2083, 29892, 19875, 29918, 2798, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 6222, 29918, 16170, 29898, 25932, 29892, 12893, 29892, 1015, 1125, 13, 4706, 9685, 353, 1067, 29879, 29889, 657, 29918, 8990, 29898, 459, 29889, 8990, 29897, 13, 13, 4706, 263, 353, 12893, 29961, 459, 29889, 2080, 29879, 29961, 29900, 1822, 1989, 29962, 13, 4706, 565, 451, 338, 8758, 29898, 29874, 29892, 313, 1761, 29892, 18761, 22164, 13, 9651, 313, 262, 29886, 29892, 511, 4742, 29918, 333, 29892, 921, 29886, 353, 408, 29918, 17642, 29918, 10141, 29898, 13, 18884, 518, 29874, 1402, 4742, 29922, 459, 29889, 10141, 29892, 3240, 29918, 17833, 29922, 5574, 29897, 13, 13, 9651, 411, 4742, 29898, 10141, 29918, 333, 1125, 13, 18884, 12893, 29961, 459, 29889, 4905, 29879, 29961, 29900, 1822, 1989, 29962, 353, 921, 29886, 29889, 13707, 12676, 29898, 262, 29886, 29892, 9685, 29922, 8990, 29892, 26688, 29922, 459, 29889, 29881, 1853, 29892, 13, 462, 462, 462, 1678, 3013, 6229, 29879, 29922, 11227, 29898, 459, 29889, 17462, 6229, 29879, 876, 13, 4706, 1683, 29901, 13, 9651, 9423, 1272, 29892, 903, 2798, 511, 4742, 29918, 333, 29892, 921, 29886, 353, 408, 29918, 17642, 29918, 10141, 29898, 13, 18884, 263, 29892, 4742, 29922, 459, 29889, 10141, 29892, 3240, 29918, 17833, 29922, 5574, 29897, 13, 13, 9651, 411, 4742, 29898, 10141, 29918, 333, 1125, 13, 18884, 19875, 29918, 2798, 353, 921, 29886, 29889, 2083, 7373, 2798, 29892, 9685, 29922, 8990, 29892, 26688, 29922, 459, 29889, 29881, 1853, 29892, 13, 462, 462, 268, 3013, 6229, 29879, 29922, 11227, 29898, 459, 29889, 17462, 6229, 29879, 876, 13, 18884, 19875, 29918, 2083, 353, 921, 29886, 29889, 2083, 7373, 1272, 29892, 9685, 29922, 8990, 29892, 26688, 29922, 459, 29889, 29881, 1853, 29892, 13, 462, 462, 259, 3013, 6229, 29879, 29922, 11227, 29898, 459, 29889, 17462, 6229, 29879, 876, 13, 18884, 12893, 29961, 459, 29889, 4905, 29879, 29961, 29900, 1822, 1989, 29962, 353, 921, 29886, 29889, 3009, 29918, 4563, 680, 29898, 29812, 29918, 2083, 29892, 19875, 29918, 2798, 29892, 13, 462, 462, 462, 4706, 26688, 29922, 459, 29889, 29881, 1853, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 6222, 29918, 17743, 457, 29898, 25932, 29892, 12893, 29892, 1015, 1125, 13, 4706, 323, 6073, 6816, 273, 29889, 7978, 29918, 17743, 457, 29898, 13073, 29892, 1015, 29897, 13, 13, 13, 1753, 23432, 12676, 29898, 29874, 29892, 9685, 29922, 8516, 29892, 26688, 29922, 8516, 29892, 714, 29922, 8516, 29892, 3013, 6229, 29879, 29922, 8516, 29892, 14405, 29918, 2311, 29922, 8516, 1125, 13, 1678, 9995, 13, 1678, 11796, 29872, 278, 23342, 2099, 3412, 278, 6790, 9685, 29892, 5330, 8253, 18780, 29879, 29889, 13, 13, 1678, 16969, 278, 6588, 310, 278, 12489, 3161, 29889, 29871, 450, 6588, 338, 4586, 975, 13, 1678, 278, 1652, 8606, 287, 12489, 491, 2322, 29892, 6467, 975, 278, 6790, 9685, 29889, 13, 1678, 421, 7411, 29953, 29946, 29952, 19697, 322, 736, 1819, 526, 1304, 363, 6043, 10970, 29889, 13, 13, 1678, 1152, 599, 29899, 19377, 269, 29399, 29892, 18780, 338, 4133, 322, 263, 421, 7944, 22709, 29952, 338, 10425, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 263, 584, 1409, 29918, 4561, 13, 4706, 323, 6073, 6943, 3694, 5069, 2099, 338, 7429, 29889, 960, 421, 29874, 29952, 338, 451, 385, 13, 4706, 12489, 29892, 263, 11301, 338, 16388, 29889, 13, 1678, 9685, 584, 938, 29892, 13136, 13, 4706, 319, 11497, 3412, 607, 278, 2794, 526, 15712, 29889, 450, 2322, 338, 304, 10272, 13, 4706, 278, 2099, 310, 278, 1652, 8606, 287, 12489, 29889, 13, 1678, 26688, 584, 848, 29899, 1853, 29892, 13136, 13, 4706, 5167, 304, 671, 297, 20602, 278, 2099, 29889, 29871, 1152, 6043, 10970, 29892, 278, 2322, 13, 4706, 338, 421, 7411, 29953, 29946, 21966, 363, 297, 735, 627, 10970, 29892, 372, 338, 278, 1021, 408, 278, 1881, 13, 4706, 26688, 29889, 13, 1678, 714, 584, 323, 6073, 29892, 13136, 13, 4706, 12440, 403, 1962, 12489, 297, 607, 304, 2058, 278, 1121, 29889, 29871, 450, 2322, 13, 4706, 338, 4954, 8516, 16159, 29936, 565, 4944, 29892, 372, 1818, 505, 278, 1021, 8267, 408, 278, 13, 4706, 3806, 1962, 29892, 541, 278, 1134, 674, 367, 4320, 565, 5181, 29889, 29871, 2823, 13, 4706, 421, 1514, 29889, 1137, 348, 2395, 29952, 363, 4902, 29889, 13, 1678, 3013, 6229, 29879, 584, 6120, 29892, 13136, 13, 4706, 960, 445, 338, 731, 304, 5852, 29892, 278, 27815, 607, 526, 12212, 526, 2175, 13, 4706, 297, 278, 1121, 408, 13391, 411, 2159, 697, 29889, 2973, 445, 2984, 29892, 13, 4706, 278, 1121, 674, 12672, 5149, 2750, 278, 2441, 421, 29874, 1412, 13, 13, 4706, 960, 278, 995, 338, 3099, 541, 278, 2322, 29892, 769, 13, 4706, 421, 17462, 6229, 29879, 29952, 674, 367, 4502, 1549, 304, 278, 421, 12676, 29952, 470, 421, 2083, 29952, 3519, 13, 4706, 310, 1014, 29899, 13203, 310, 421, 29911, 6073, 1412, 29871, 960, 278, 1014, 29899, 13203, 3519, 13, 4706, 947, 451, 2334, 421, 17462, 6229, 29879, 29952, 738, 15283, 674, 367, 10425, 29889, 13, 1678, 14405, 29918, 2311, 29901, 938, 29892, 13136, 13, 4706, 450, 1353, 310, 521, 18801, 304, 14405, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 286, 584, 323, 6073, 29892, 1074, 26688, 3443, 2038, 13, 4706, 960, 421, 449, 29922, 8516, 1673, 3639, 263, 716, 1409, 6943, 278, 2099, 1819, 29892, 13, 4706, 6467, 263, 3407, 304, 278, 1962, 1409, 338, 4133, 29889, 25701, 338, 13, 4706, 4133, 363, 269, 29399, 393, 1712, 871, 18780, 29879, 29889, 13, 13, 1678, 2823, 3115, 13, 1678, 448, 26589, 13, 1678, 6588, 584, 1334, 523, 287, 6588, 13, 1678, 2099, 584, 826, 18542, 2099, 4586, 1550, 451, 5330, 8253, 18780, 29879, 13, 1678, 722, 29892, 23432, 1707, 13, 13, 1678, 8695, 13, 1678, 448, 807, 13, 1678, 450, 23342, 2099, 338, 278, 2533, 310, 278, 1661, 29899, 19377, 3161, 3412, 278, 9685, 13, 1678, 13931, 491, 278, 1353, 310, 1661, 29899, 19377, 3161, 29889, 13, 13, 1678, 3940, 393, 363, 16526, 29899, 3149, 1881, 29892, 278, 2099, 338, 15712, 773, 278, 1021, 13, 1678, 16716, 278, 1881, 756, 29889, 29871, 28277, 373, 278, 1881, 848, 29892, 445, 508, 4556, 13, 1678, 278, 2582, 304, 367, 297, 562, 2764, 403, 29892, 7148, 363, 421, 7411, 29941, 29906, 1412, 29871, 12048, 9215, 263, 13, 1678, 6133, 29899, 17990, 2459, 18414, 9183, 773, 278, 421, 29881, 1853, 29952, 13553, 508, 4788, 1403, 403, 13, 1678, 445, 2228, 29889, 13, 13, 1678, 1222, 9422, 13, 1678, 448, 26589, 13, 1678, 8653, 1053, 7438, 29889, 20158, 408, 286, 29873, 13, 13, 1678, 8653, 263, 353, 286, 29873, 29889, 2378, 4197, 29961, 29896, 29892, 286, 29873, 29889, 13707, 1402, 518, 29941, 29892, 29871, 29946, 24960, 13, 1678, 8653, 286, 29873, 29889, 13707, 12676, 29898, 29874, 467, 7978, 580, 13, 268, 29906, 29889, 29953, 29953, 29953, 29953, 29953, 29953, 29953, 29953, 29953, 29953, 29953, 29953, 29953, 29953, 29953, 29945, 13, 1678, 8653, 286, 29873, 29889, 13707, 12676, 29898, 29874, 29892, 9685, 29922, 29900, 467, 7978, 580, 13, 1678, 1409, 4197, 29871, 29906, 1696, 259, 29946, 29889, 2314, 13, 1678, 8653, 286, 29873, 29889, 13707, 12676, 29898, 29874, 29892, 9685, 29922, 29896, 467, 7978, 580, 13, 1678, 1409, 4197, 29871, 29896, 1696, 259, 29941, 29889, 29945, 2314, 13, 13, 1678, 9995, 13, 1678, 263, 353, 8717, 6073, 29898, 29874, 29897, 13, 1678, 565, 26688, 338, 6213, 29901, 13, 4706, 26688, 353, 7442, 29889, 13707, 12676, 29898, 9302, 29889, 6310, 3552, 29896, 29892, 511, 26688, 29922, 29874, 29889, 29881, 1853, 8106, 29881, 1853, 13, 1678, 1015, 353, 323, 6073, 29940, 273, 6816, 273, 29898, 8990, 29922, 8990, 29892, 26688, 29922, 29881, 1853, 29892, 3013, 6229, 29879, 29922, 17462, 6229, 29879, 29892, 14405, 29918, 2311, 29922, 17743, 457, 29918, 2311, 29897, 13, 1678, 736, 1015, 29898, 29874, 29892, 714, 29922, 449, 29897, 13, 2 ]
cash-donations.py
davidciani/taxtools
0
41151
#!/usr/bin/env python import argparse import logging from csv import DictReader from datetime import date, datetime from pathlib import Path logger = logging.getLogger(__name__) header = """V042 ATaxTool Donations 0.4 D{date:%Y-%m-%d} ^ """ record_layout_1 = """TD N280 C1 L1 ${amount:0.2f} X{payee} ({ein}) ^ """ record_layout_2 = """TD N280 C1 L1 ${amount:0.2f} X {payee}/{note} ({ein}) ^ """ def main(args): input_file = Path(args.input).resolve(strict=True) logger.info(f"Input file: {input_file}") if args.output is None: output_file = input_file.with_stem( input_file.stem + f"_{datetime.now():%Y%m%d_%H%M%S}" ).with_suffix(".txf") else: output_file = Path(args.output).resolve() logger.info(f"Output file: {output_file}") with input_file.open("r") as f: records = list(DictReader(f)) with output_file.open("x", newline="\r\n") as f: f.write(header.format(date=date.today())) for record in records: if float(record["amount"]) > 0: if record["notes"] != "": f.write( record_layout_2.format( payee=record["payee"], ein=record["ein"], note=record["notes"], amount=-float(record["amount"]), ) ) else: f.write( record_layout_1.format( payee=record["payee"], ein=record["ein"], amount=-float(record["amount"]), ) ) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("input", help="Input CSV file") parser.add_argument("-o", "--output", help="File to write TXF output to") main(parser.parse_args())
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 1852, 5510, 13, 5215, 12183, 13, 3166, 11799, 1053, 360, 919, 6982, 13, 3166, 12865, 1053, 2635, 29892, 12865, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 6672, 353, 9995, 29963, 29900, 29946, 29906, 13, 1299, 1165, 12229, 3872, 800, 29871, 29900, 29889, 29946, 13, 29928, 29912, 1256, 16664, 29979, 19222, 29885, 19222, 29881, 29913, 13, 29985, 13, 15945, 29908, 13, 13, 11651, 29918, 2680, 29918, 29896, 353, 9995, 24495, 13, 29940, 29906, 29947, 29900, 13, 29907, 29896, 13, 29931, 29896, 13, 5303, 14506, 29901, 29900, 29889, 29906, 29888, 29913, 13, 29990, 29912, 10472, 3905, 29913, 21313, 21084, 1800, 13, 29985, 13, 15945, 29908, 13, 13, 11651, 29918, 2680, 29918, 29906, 353, 9995, 24495, 13, 29940, 29906, 29947, 29900, 13, 29907, 29896, 13, 29931, 29896, 13, 5303, 14506, 29901, 29900, 29889, 29906, 29888, 29913, 13, 29990, 426, 10472, 3905, 6822, 29912, 6812, 29913, 21313, 21084, 1800, 13, 29985, 13, 15945, 29908, 13, 13, 13, 1753, 1667, 29898, 5085, 1125, 13, 13, 1678, 1881, 29918, 1445, 353, 10802, 29898, 5085, 29889, 2080, 467, 17863, 29898, 710, 919, 29922, 5574, 29897, 13, 1678, 17927, 29889, 3888, 29898, 29888, 29908, 4290, 934, 29901, 426, 2080, 29918, 1445, 27195, 13, 13, 1678, 565, 6389, 29889, 4905, 338, 6213, 29901, 13, 4706, 1962, 29918, 1445, 353, 1881, 29918, 1445, 29889, 2541, 29918, 303, 331, 29898, 13, 9651, 1881, 29918, 1445, 29889, 303, 331, 718, 285, 29908, 648, 12673, 29889, 3707, 7295, 29995, 29979, 29995, 29885, 29995, 29881, 29918, 29995, 29950, 29995, 29924, 29995, 29903, 5038, 13, 4706, 13742, 2541, 29918, 2146, 600, 861, 17350, 7508, 29888, 1159, 13, 1678, 1683, 29901, 13, 4706, 1962, 29918, 1445, 353, 10802, 29898, 5085, 29889, 4905, 467, 17863, 580, 13, 1678, 17927, 29889, 3888, 29898, 29888, 29908, 6466, 934, 29901, 426, 4905, 29918, 1445, 27195, 13, 13, 1678, 411, 1881, 29918, 1445, 29889, 3150, 703, 29878, 1159, 408, 285, 29901, 13, 4706, 6475, 353, 1051, 29898, 21533, 6982, 29898, 29888, 876, 13, 13, 1678, 411, 1962, 29918, 1445, 29889, 3150, 703, 29916, 613, 25899, 543, 29905, 29878, 29905, 29876, 1159, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 6672, 29889, 4830, 29898, 1256, 29922, 1256, 29889, 27765, 22130, 13, 4706, 363, 2407, 297, 6475, 29901, 13, 9651, 565, 5785, 29898, 11651, 3366, 14506, 20068, 1405, 29871, 29900, 29901, 13, 18884, 565, 2407, 3366, 16953, 3108, 2804, 376, 1115, 13, 462, 1678, 285, 29889, 3539, 29898, 13, 462, 4706, 2407, 29918, 2680, 29918, 29906, 29889, 4830, 29898, 13, 462, 9651, 5146, 3905, 29922, 11651, 3366, 10472, 3905, 12436, 13, 462, 9651, 1011, 29922, 11651, 3366, 21084, 12436, 13, 462, 9651, 4443, 29922, 11651, 3366, 16953, 12436, 13, 462, 9651, 5253, 10457, 7411, 29898, 11651, 3366, 14506, 3108, 511, 13, 462, 4706, 1723, 13, 462, 1678, 1723, 13, 18884, 1683, 29901, 13, 462, 1678, 285, 29889, 3539, 29898, 13, 462, 4706, 2407, 29918, 2680, 29918, 29896, 29889, 4830, 29898, 13, 462, 9651, 5146, 3905, 29922, 11651, 3366, 10472, 3905, 12436, 13, 462, 9651, 1011, 29922, 11651, 3366, 21084, 12436, 13, 462, 9651, 5253, 10457, 7411, 29898, 11651, 3366, 14506, 3108, 511, 13, 462, 4706, 1723, 13, 462, 1678, 1723, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 580, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 2080, 613, 1371, 543, 4290, 16874, 934, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29877, 613, 376, 489, 4905, 613, 1371, 543, 2283, 304, 2436, 323, 29990, 29943, 1962, 304, 1159, 13, 13, 1678, 1667, 29898, 16680, 29889, 5510, 29918, 5085, 3101, 13, 2 ]
src/hodge.py
Idate96/Mimetic-Fem
0
78486
<reponame>Idate96/Mimetic-Fem<filename>src/hodge.py from function_space import FunctionSpace, DualSpace import numpy as np from numpy.linalg import inv from mesh import CrazyMesh from forms import Form, AbstractForm from coboundaries import d from inner_product import inner import matplotlib.pyplot as plt def pfun(x, y): return np.sin(np.pi * x) * np.sin(np.pi * y) def hodge_from_func_space(function_space, extend): """Calculate the hodge matrix from the function space.""" dual_space = DualSpace(function_space, extend) dual_form = Form(dual_space) form = Form(function_space) wedge_prod = form.basis.wedged(dual_form.basis) inner_prod = inner(dual_form.basis, dual_form.basis) inverse_inner = inv(np.rollaxis(inner_prod, 2, 0)) hodge_matrix = np.tensordot(inverse_inner, wedge_prod, axes=((2), (0))) hodge_matrix = np.moveaxis(hodge_matrix, 0, -1) return hodge_matrix def hodge_from_form(form, extend): """Calculate the hodge matrix and resulting form.""" dual_space = DualSpace(form.function_space, extend) dual_form = Form(dual_space) wedge_prod = form.basis.wedged(dual_form.basis) inner_prod = inner(dual_form.basis, dual_form.basis) inverse_inner = inv(np.rollaxis(inner_prod, 2, 0)) hodge_matrix = np.tensordot(inverse_inner, wedge_prod, axes=((2), (0))) dual_form.cochain_local = np.einsum('kij,jk->ik', hodge_matrix, form.cochain_local) hodge_matrix = np.moveaxis(hodge_matrix, 0, -1) return dual_form, hodge_matrix def hodge(*args, return_matrix=False, extend=True): """Perform the projection onto the dual space.""" if isinstance(args[0], FunctionSpace): hodge_matrix = hodge_from_func_space(args[0], extend) return hodge_matrix if isinstance(args[0], AbstractForm): dual_form, hodge_matrix = hodge_from_form(args[0], extend) if not return_matrix: return dual_form else: return dual_form, hodge_matrix
[ 1, 529, 276, 1112, 420, 29958, 1204, 403, 29929, 29953, 29914, 29924, 326, 7492, 29899, 29943, 331, 29966, 9507, 29958, 4351, 29914, 29882, 17979, 29889, 2272, 13, 3166, 740, 29918, 3493, 1053, 6680, 14936, 29892, 360, 950, 14936, 13, 5215, 12655, 408, 7442, 13, 3166, 12655, 29889, 29880, 979, 29887, 1053, 2437, 13, 3166, 27716, 1053, 14279, 1537, 29924, 12094, 13, 3166, 7190, 1053, 3812, 29892, 25513, 2500, 13, 3166, 274, 711, 618, 4314, 1053, 270, 13, 3166, 6426, 29918, 4704, 1053, 6426, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 13, 1753, 282, 7692, 29898, 29916, 29892, 343, 1125, 13, 1678, 736, 7442, 29889, 5223, 29898, 9302, 29889, 1631, 334, 921, 29897, 334, 7442, 29889, 5223, 29898, 9302, 29889, 1631, 334, 343, 29897, 13, 13, 13, 1753, 298, 17979, 29918, 3166, 29918, 9891, 29918, 3493, 29898, 2220, 29918, 3493, 29892, 10985, 1125, 13, 1678, 9995, 27065, 403, 278, 298, 17979, 4636, 29871, 515, 278, 740, 2913, 1213, 15945, 13, 1678, 14581, 29918, 3493, 353, 360, 950, 14936, 29898, 2220, 29918, 3493, 29892, 10985, 29897, 13, 1678, 14581, 29918, 689, 353, 3812, 29898, 700, 284, 29918, 3493, 29897, 13, 1678, 883, 353, 3812, 29898, 2220, 29918, 3493, 29897, 13, 1678, 281, 12864, 29918, 10633, 353, 883, 29889, 6500, 275, 29889, 8734, 3192, 29898, 700, 284, 29918, 689, 29889, 6500, 275, 29897, 13, 1678, 6426, 29918, 10633, 353, 6426, 29898, 700, 284, 29918, 689, 29889, 6500, 275, 29892, 14581, 29918, 689, 29889, 6500, 275, 29897, 13, 1678, 16402, 29918, 3993, 353, 2437, 29898, 9302, 29889, 1467, 433, 11497, 29898, 3993, 29918, 10633, 29892, 29871, 29906, 29892, 29871, 29900, 876, 13, 1678, 298, 17979, 29918, 5344, 353, 7442, 29889, 29873, 575, 536, 327, 29898, 262, 3901, 29918, 3993, 29892, 281, 12864, 29918, 10633, 29892, 27815, 29922, 3552, 29906, 511, 313, 29900, 4961, 13, 1678, 298, 17979, 29918, 5344, 353, 7442, 29889, 11631, 8990, 29898, 29882, 17979, 29918, 5344, 29892, 29871, 29900, 29892, 448, 29896, 29897, 13, 1678, 736, 298, 17979, 29918, 5344, 13, 13, 13, 1753, 298, 17979, 29918, 3166, 29918, 689, 29898, 689, 29892, 10985, 1125, 13, 1678, 9995, 27065, 403, 278, 298, 17979, 4636, 322, 9819, 883, 1213, 15945, 13, 1678, 14581, 29918, 3493, 353, 360, 950, 14936, 29898, 689, 29889, 2220, 29918, 3493, 29892, 10985, 29897, 13, 1678, 14581, 29918, 689, 353, 3812, 29898, 700, 284, 29918, 3493, 29897, 13, 1678, 281, 12864, 29918, 10633, 353, 883, 29889, 6500, 275, 29889, 8734, 3192, 29898, 700, 284, 29918, 689, 29889, 6500, 275, 29897, 13, 1678, 6426, 29918, 10633, 353, 6426, 29898, 700, 284, 29918, 689, 29889, 6500, 275, 29892, 14581, 29918, 689, 29889, 6500, 275, 29897, 13, 1678, 16402, 29918, 3993, 353, 2437, 29898, 9302, 29889, 1467, 433, 11497, 29898, 3993, 29918, 10633, 29892, 29871, 29906, 29892, 29871, 29900, 876, 13, 1678, 298, 17979, 29918, 5344, 353, 7442, 29889, 29873, 575, 536, 327, 29898, 262, 3901, 29918, 3993, 29892, 281, 12864, 29918, 10633, 29892, 27815, 29922, 3552, 29906, 511, 313, 29900, 4961, 13, 1678, 14581, 29918, 689, 29889, 1111, 14153, 29918, 2997, 353, 7442, 29889, 29872, 1144, 398, 877, 29895, 823, 29892, 25467, 976, 638, 742, 298, 17979, 29918, 5344, 29892, 883, 29889, 1111, 14153, 29918, 2997, 29897, 13, 1678, 298, 17979, 29918, 5344, 353, 7442, 29889, 11631, 8990, 29898, 29882, 17979, 29918, 5344, 29892, 29871, 29900, 29892, 448, 29896, 29897, 13, 1678, 736, 14581, 29918, 689, 29892, 298, 17979, 29918, 5344, 13, 13, 13, 1753, 298, 17979, 10456, 5085, 29892, 736, 29918, 5344, 29922, 8824, 29892, 10985, 29922, 5574, 1125, 13, 1678, 9995, 5894, 689, 278, 18246, 11480, 278, 14581, 2913, 1213, 15945, 13, 1678, 565, 338, 8758, 29898, 5085, 29961, 29900, 1402, 6680, 14936, 1125, 13, 4706, 298, 17979, 29918, 5344, 353, 298, 17979, 29918, 3166, 29918, 9891, 29918, 3493, 29898, 5085, 29961, 29900, 1402, 10985, 29897, 13, 4706, 736, 298, 17979, 29918, 5344, 13, 1678, 565, 338, 8758, 29898, 5085, 29961, 29900, 1402, 25513, 2500, 1125, 13, 4706, 14581, 29918, 689, 29892, 298, 17979, 29918, 5344, 353, 298, 17979, 29918, 3166, 29918, 689, 29898, 5085, 29961, 29900, 1402, 10985, 29897, 13, 4706, 565, 451, 736, 29918, 5344, 29901, 13, 9651, 736, 14581, 29918, 689, 13, 4706, 1683, 29901, 13, 9651, 736, 14581, 29918, 689, 29892, 298, 17979, 29918, 5344, 13, 2 ]
morea-module-status.py
dport96/scripts
1
170503
<filename>morea-module-status.py<gh_stars>1-10 #!/usr/bin/python from time import sleep import curses import curses.panel import glob import os import subprocess import re # Helper function to print markers def marker(value): if value == 0: return "-" elif value == 1: return "X" else: return " " # Helper function to convert a string to a "boolean" def s2bool(string): if string == None: return -1 if string in ("True","true"): return 1 if string in ("False","false"): return 0 # Helper function to get a property in a morea file # Returns a string (e.g., "1", "true") # def get_property(filepath,name): value = None for l in open(filepath,'r'): m = re.match(" *"+name+" *: *(?P<value>.*)",l) if (m == None): continue if (value != None): print "File '"+filepath+"' contains two lines for property "+name+". Go fix it!" exit(1) value = m.groups()[0] return value # Helper function to set a property in a morea file # # IMPORTANT: It will do nothing if the property line is not found # def set_property(filepath, name, string_value): tmp_filepath = "./tmp_sed_file.txt" output = open(tmp_filepath,'w') for l in open(filepath,'r'): m = re.match(" *"+name+" *: *(?P<value>.*)",l) if (m == None): output.write(l) else: output.write(name+": "+string_value+"\n") output.close() os.rename(tmp_filepath,filepath) return # Helper function to find all md files with specified types # Returns [] if no file found # def find_md_files(directory, type_list): module_filepath = None files = [] # List all .md files md_file_list = glob.glob(directory+"/*.md") for f in md_file_list: value = get_property(f,"morea_type") if (value in type_list): files.append(f) return files # Helper function to find all information for a module file def find_module_info(filepath): sort_order = get_property(filepath,"morea_sort_order") if sort_order == None: print "File '"+filepath+"' contains no morea_sort_order! Go fix it!" exit(1) else: sort_order = int(get_property(filepath,"morea_sort_order")) published = get_property(filepath, "published") published = s2bool(get_property(filepath, "published")) comingsoon = s2bool(get_property(filepath, "morea_coming_soon")) highlight = s2bool(get_property(filepath, "morea_highlight")) return [sort_order, published, comingsoon, highlight] # Helper function to find all content for a module def find_module_contents(directory): md_files = find_md_files(directory, ["outcome","reading","experience","assessment"]) list_of_contents = [] for f in md_files: content = [get_property(f,"title"),get_property(f,"morea_type")] list_of_contents.append(content) return list_of_contents # Helprt function that pops up a module content panel def module_content_popup(contents): contents tmpwin = curses.newwin(len(contents)+4,70, 6,4) tmpwin.erase() tmpwin.box() tmppanel = curses.panel.new_panel(tmpwin) curses.curs_set(False) tmpwin.addstr(1, 1, sorted_modules[cur_y - min_y]+"'s content:") tmpwin.addstr(1, 56, "Enter: close",curses.A_REVERSE) x = 2 y = 3 for content in contents: tmpwin.addstr(y, x, content[1]) tmpwin.addstr(y, x+15, content[0]) y += 1 curses.panel.update_panels(); stdscr.refresh() while (stdscr.getch() != ord('\n')): pass tmppanel.hide() curses.curs_set(True) return ######################################################################################### ######################################################################################### # Check that the root directory is there root = "./master/src/morea" if (not os.path.isdir(root)): print "Can't find master/src/morea in the working directory... aborting" exit(1) # Get all module information and put it in a dictionary of # dictionaries {module file, sortorder, published, comingsoon} tuples module_info = {} module_contents = {} for path, subdirs, files in os.walk(root): for module in subdirs: if path == root: module_files = find_md_files(root+"/"+module,["module"]) if (len(module_files) == 0): continue elif (len(module_files) > 1): print "Module "+module+" contains more than on .md file with morea type 'module'! aborting...." exit(1) [sort_order, published, comingsoon, highlight] = find_module_info(module_files[0]) # add directory entry (which is itself a directory) module_info[module] = {'file':module_files[0], 'sort_order':sort_order, 'published':published, 'comingsoon':comingsoon, 'highlight':highlight} module_contents[module] = find_module_contents(root+"/"+module) if (len(module_info) == 0): print "No module found... aborting" exit(1) # Build an array of the sorted module names sorted_modules = [a for (a,b) in sorted(module_info.items(), key=lambda x: x[1]['sort_order'])] # Compute the maximum name length for displaying purposes max_name_length = reduce(lambda a,b: a if (a > b) else b, map(len,sorted_modules)) # initialize the screen stdscr = curses.initscr() # Check that the window is big enough (height,width) = stdscr.getmaxyx() if (width < 80): curses.nocbreak(); stdscr.keypad(0); curses.echo() curses.endwin() print "Terminal window needs to be wider... aborting" exit(1) if (height < 5+len(sorted_modules)): curses.nocbreak(); stdscr.keypad(0); curses.echo() curses.endwin() print "Terminal window needs to be taller... aborting" exit(1) # Set up the screen curses.noecho() curses.cbreak() stdscr.keypad(1) height = 5+len(sorted_modules); width = 50 win = curses.newwin(height, width) # Define column coordinates (hardocded values to look ok) published_column = max_name_length + 8 comingsoon_column = max_name_length + 19 highlight_column = max_name_length + 31 # dictionary of the column coordinates / meanings columns = {published_column:"published", comingsoon_column:"comingsoon", highlight_column:"highlight"} # Print fixed strings stdscr.addstr(0, 0, "MOREA Module publishing interface") stdscr.addstr(1, 0, "(Only info explicitly set to true/false in .md files is accessed)") stdscr.addstr(2, 0, "Space: toggle Enter: info q: save and quit x: quit", curses.A_REVERSE) stdscr.addstr(4, published_column-4, "PUBLISHED") stdscr.addstr(4, comingsoon_column-4, "COMINGSOON") stdscr.addstr(4, highlight_column-4, "HIGHLIGHT") stdscr.refresh() # Define cursor bounds min_y = 5 max_y = min_y + len(sorted_modules)-1 # Print modules y = min_y for module in sorted_modules: stdscr.addstr(y, 0, module) stdscr.addstr(y, published_column, marker(module_info[module]['published'])) stdscr.addstr(y, comingsoon_column, marker(module_info[module]['comingsoon'])) stdscr.addstr(y, highlight_column, marker(module_info[module]['highlight'])) y += 1 # Define the initial position of the cursor cur_x = published_column cur_y = 5 # Handle key presses while 1: stdscr.move(cur_y,cur_x) c = stdscr.getch() # Cursor move if (c == curses.KEY_DOWN) or (c == ord('j')): cur_y = min(cur_y+1,max_y) elif (c == curses.KEY_UP) or (c == ord('k')): cur_y = max(cur_y-1,min_y) elif (c == curses.KEY_LEFT) or (c == ord('h')): cur_x = sorted(columns.keys())[max(0, sorted(columns.keys()).index(cur_x)-1)] elif (c == curses.KEY_RIGHT) or (c == ord('l')): cur_x = sorted(columns.keys())[min(len(columns)-1, sorted(columns.keys()).index(cur_x)+1)] # Go to module panel elif (c == ord('\n')): module_content_popup(module_contents[sorted_modules[cur_y - min_y]]) # Toggle elif c == ord(' '): column_type = columns[cur_x] module_info[sorted_modules[cur_y - min_y]][column_type] = 1 - module_info[sorted_modules[cur_y - min_y]][column_type] stdscr.addstr(cur_y, cur_x, marker(module_info[sorted_modules[cur_y - min_y]][column_type])) # Quit elif c == ord('x'): save = False break # Save and quit elif c == ord('q'): save = True curses.flash() break # reset terminal properties curses.nocbreak(); stdscr.keypad(0); curses.echo() curses.endwin() if (save): # Implement changes (brute-force write of all relevant booleans in */*.md module files) for module in sorted_modules: if (module_info[module]['published'] != None): set_property(module_info[module]['file'], "published", str(module_info[module]['published'] == 1).lower()) if (module_info[module]['comingsoon'] != None): set_property(module_info[module]['file'], "morea_coming_soon", str(module_info[module]['comingsoon'] == 1).lower()) if (module_info[module]['highlight'] != None): set_property(module_info[module]['file'], "morea_highlight", str(module_info[module]['highlight'] == 1).lower())
[ 1, 529, 9507, 29958, 5514, 29874, 29899, 5453, 29899, 4882, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 13, 3166, 931, 1053, 8709, 13, 13, 5215, 18580, 267, 13, 5215, 18580, 267, 29889, 15119, 13, 5215, 13149, 13, 5215, 2897, 13, 5215, 1014, 5014, 13, 5215, 337, 13, 13, 29937, 6162, 546, 740, 304, 1596, 29320, 13, 1753, 17456, 29898, 1767, 1125, 13, 29871, 565, 995, 1275, 29871, 29900, 29901, 13, 1678, 736, 11663, 29908, 13, 29871, 25342, 995, 1275, 29871, 29896, 29901, 13, 1678, 736, 376, 29990, 29908, 13, 29871, 1683, 29901, 13, 1678, 736, 376, 376, 13, 13, 29937, 6162, 546, 740, 304, 3588, 263, 1347, 304, 263, 376, 20054, 29908, 13, 1753, 269, 29906, 11227, 29898, 1807, 1125, 13, 29871, 565, 1347, 1275, 6213, 29901, 13, 1678, 736, 448, 29896, 13, 29871, 565, 1347, 297, 4852, 5574, 3284, 3009, 29908, 1125, 13, 1678, 736, 29871, 29896, 13, 29871, 565, 1347, 297, 4852, 8824, 3284, 4541, 29908, 1125, 13, 1678, 736, 29871, 29900, 13, 13, 29937, 6162, 546, 740, 304, 679, 263, 2875, 297, 263, 901, 29874, 934, 13, 29937, 16969, 263, 1347, 313, 29872, 29889, 29887, 1696, 376, 29896, 613, 376, 3009, 1159, 13, 29937, 13, 1753, 679, 29918, 6799, 29898, 1445, 2084, 29892, 978, 1125, 13, 13, 29871, 995, 353, 6213, 13, 29871, 363, 301, 297, 1722, 29898, 1445, 2084, 5501, 29878, 29374, 29871, 13, 1678, 286, 353, 337, 29889, 4352, 703, 334, 17969, 978, 13578, 334, 29901, 334, 10780, 29925, 29966, 1767, 29958, 5575, 19123, 29880, 29897, 13, 1678, 565, 313, 29885, 1275, 6213, 1125, 13, 418, 6773, 13, 1678, 565, 313, 1767, 2804, 6213, 1125, 13, 418, 1596, 376, 2283, 525, 17969, 1445, 2084, 13578, 29915, 3743, 1023, 3454, 363, 2875, 15691, 978, 29974, 1642, 2921, 2329, 372, 3850, 13, 418, 6876, 29898, 29896, 29897, 13, 1678, 995, 353, 286, 29889, 13155, 580, 29961, 29900, 29962, 13, 13, 29871, 736, 995, 13, 13, 13, 29937, 6162, 546, 740, 304, 731, 263, 2875, 297, 263, 901, 29874, 934, 13, 29937, 13, 29937, 306, 3580, 8476, 13566, 29901, 739, 674, 437, 3078, 565, 278, 2875, 1196, 338, 451, 1476, 13, 29937, 13, 1753, 731, 29918, 6799, 29898, 1445, 2084, 29892, 1024, 29892, 1347, 29918, 1767, 1125, 13, 13, 29871, 13128, 29918, 1445, 2084, 353, 376, 6904, 7050, 29918, 8485, 29918, 1445, 29889, 3945, 29908, 13, 29871, 1962, 353, 1722, 29898, 7050, 29918, 1445, 2084, 5501, 29893, 1495, 13, 13, 29871, 363, 301, 297, 1722, 29898, 1445, 2084, 5501, 29878, 29374, 13, 1678, 286, 353, 337, 29889, 4352, 703, 334, 17969, 978, 13578, 334, 29901, 334, 10780, 29925, 29966, 1767, 29958, 5575, 19123, 29880, 29897, 13, 1678, 565, 313, 29885, 1275, 6213, 1125, 13, 418, 1962, 29889, 3539, 29898, 29880, 29897, 13, 1678, 1683, 29901, 13, 418, 1962, 29889, 3539, 29898, 978, 29974, 1115, 15691, 1807, 29918, 1767, 13578, 29905, 29876, 1159, 13, 29871, 1962, 29889, 5358, 580, 13, 13, 29871, 2897, 29889, 1267, 420, 29898, 7050, 29918, 1445, 2084, 29892, 1445, 2084, 29897, 13, 13, 29871, 736, 13, 13, 13, 29937, 6162, 546, 740, 304, 1284, 599, 22821, 2066, 411, 6790, 4072, 13, 29937, 16969, 5159, 565, 694, 934, 1476, 13, 29937, 13, 1753, 1284, 29918, 3487, 29918, 5325, 29898, 12322, 29892, 1134, 29918, 1761, 1125, 13, 29871, 3883, 29918, 1445, 2084, 353, 6213, 13, 29871, 2066, 353, 5159, 13, 29871, 396, 2391, 599, 869, 3487, 2066, 13, 29871, 22821, 29918, 1445, 29918, 1761, 353, 13149, 29889, 23705, 29898, 12322, 13578, 5515, 29889, 3487, 1159, 13, 29871, 363, 285, 297, 22821, 29918, 1445, 29918, 1761, 29901, 259, 13, 1678, 995, 353, 679, 29918, 6799, 29898, 29888, 1699, 5514, 29874, 29918, 1853, 1159, 13, 1678, 565, 313, 1767, 297, 1134, 29918, 1761, 1125, 13, 4706, 2066, 29889, 4397, 29898, 29888, 29897, 13, 29871, 736, 2066, 13, 13, 13, 29937, 6162, 546, 740, 304, 1284, 599, 2472, 363, 263, 3883, 934, 13, 1753, 1284, 29918, 5453, 29918, 3888, 29898, 1445, 2084, 1125, 13, 418, 2656, 29918, 2098, 353, 679, 29918, 6799, 29898, 1445, 2084, 1699, 5514, 29874, 29918, 6605, 29918, 2098, 1159, 13, 418, 565, 2656, 29918, 2098, 1275, 6213, 29901, 13, 4706, 1596, 376, 2283, 525, 17969, 1445, 2084, 13578, 29915, 3743, 694, 901, 29874, 29918, 6605, 29918, 2098, 29991, 2921, 2329, 372, 3850, 13, 4706, 6876, 29898, 29896, 29897, 13, 418, 1683, 29901, 13, 4706, 2656, 29918, 2098, 353, 938, 29898, 657, 29918, 6799, 29898, 1445, 2084, 1699, 5514, 29874, 29918, 6605, 29918, 2098, 5783, 13, 418, 6369, 353, 679, 29918, 6799, 29898, 1445, 2084, 29892, 376, 5467, 3726, 1159, 13, 418, 6369, 353, 269, 29906, 11227, 29898, 657, 29918, 6799, 29898, 1445, 2084, 29892, 376, 5467, 3726, 5783, 13, 418, 6421, 578, 265, 353, 269, 29906, 11227, 29898, 657, 29918, 6799, 29898, 1445, 2084, 29892, 376, 5514, 29874, 29918, 11506, 29918, 578, 265, 5783, 13, 418, 12141, 353, 269, 29906, 11227, 29898, 657, 29918, 6799, 29898, 1445, 2084, 29892, 376, 5514, 29874, 29918, 28970, 5783, 13, 418, 736, 518, 6605, 29918, 2098, 29892, 6369, 29892, 6421, 578, 265, 29892, 12141, 29962, 13, 13, 29937, 6162, 546, 740, 304, 1284, 599, 2793, 363, 263, 3883, 13, 1753, 1284, 29918, 5453, 29918, 10853, 29898, 12322, 1125, 13, 29871, 22821, 29918, 5325, 353, 1284, 29918, 3487, 29918, 5325, 29898, 12322, 29892, 6796, 449, 2763, 3284, 19715, 3284, 735, 546, 5597, 3284, 465, 404, 358, 20068, 13, 29871, 1051, 29918, 974, 29918, 10853, 353, 5159, 13, 29871, 363, 285, 297, 22821, 29918, 5325, 29901, 13, 1678, 2793, 353, 518, 657, 29918, 6799, 29898, 29888, 1699, 3257, 4968, 657, 29918, 6799, 29898, 29888, 1699, 5514, 29874, 29918, 1853, 13531, 13, 1678, 1051, 29918, 974, 29918, 10853, 29889, 4397, 29898, 3051, 29897, 13, 29871, 736, 1051, 29918, 974, 29918, 10853, 13, 13, 29937, 6162, 558, 29873, 740, 393, 1835, 29879, 701, 263, 3883, 2793, 9451, 13, 1753, 3883, 29918, 3051, 29918, 7323, 786, 29898, 10853, 1125, 13, 29871, 8118, 13, 29871, 13128, 5080, 353, 18580, 267, 29889, 1482, 5080, 29898, 2435, 29898, 10853, 7240, 29946, 29892, 29955, 29900, 29892, 29871, 29953, 29892, 29946, 29897, 13, 29871, 13128, 5080, 29889, 261, 559, 580, 13, 29871, 13128, 5080, 29889, 1884, 580, 13, 29871, 27702, 407, 3870, 353, 18580, 267, 29889, 15119, 29889, 1482, 29918, 15119, 29898, 7050, 5080, 29897, 13, 29871, 18580, 267, 29889, 29883, 1295, 29918, 842, 29898, 8824, 29897, 13, 259, 13, 29871, 13128, 5080, 29889, 1202, 710, 29898, 29896, 29892, 29871, 29896, 29892, 29871, 12705, 29918, 7576, 29961, 2764, 29918, 29891, 448, 1375, 29918, 29891, 10062, 29908, 29915, 29879, 2793, 29901, 1159, 13, 29871, 13128, 5080, 29889, 1202, 710, 29898, 29896, 29892, 29871, 29945, 29953, 29892, 29871, 376, 10399, 29901, 3802, 613, 29883, 1295, 267, 29889, 29909, 29918, 1525, 5348, 1660, 29897, 13, 259, 13, 29871, 921, 353, 29871, 29906, 13, 29871, 343, 353, 29871, 29941, 13, 29871, 363, 2793, 297, 8118, 29901, 13, 1678, 13128, 5080, 29889, 1202, 710, 29898, 29891, 29892, 921, 29892, 29871, 2793, 29961, 29896, 2314, 13, 1678, 13128, 5080, 29889, 1202, 710, 29898, 29891, 29892, 921, 29974, 29896, 29945, 29892, 29871, 2793, 29961, 29900, 2314, 13, 1678, 343, 4619, 29871, 29896, 13, 259, 13, 29871, 18580, 267, 29889, 15119, 29889, 5504, 29918, 8357, 1379, 890, 29871, 13, 29871, 3659, 10526, 29889, 22379, 580, 13, 29871, 1550, 313, 4172, 10526, 29889, 657, 305, 580, 2804, 4356, 28909, 29876, 8785, 29901, 13, 1678, 1209, 29871, 13, 29871, 27702, 407, 3870, 29889, 11458, 580, 13, 29871, 18580, 267, 29889, 29883, 1295, 29918, 842, 29898, 5574, 29897, 13, 29871, 736, 13, 13, 13, 259, 13, 13, 13383, 13383, 13383, 13383, 13383, 7346, 29937, 13, 13383, 13383, 13383, 13383, 13383, 7346, 29937, 13, 13, 29937, 5399, 393, 278, 3876, 3884, 338, 727, 13, 4632, 353, 376, 6904, 6207, 29914, 4351, 29914, 5514, 29874, 29908, 13, 361, 313, 1333, 2897, 29889, 2084, 29889, 275, 3972, 29898, 4632, 22164, 13, 29871, 1596, 376, 6028, 29915, 29873, 1284, 5835, 29914, 4351, 29914, 5514, 29874, 297, 278, 1985, 3884, 856, 27450, 292, 29908, 13, 29871, 6876, 29898, 29896, 29897, 13, 13, 29937, 3617, 599, 3883, 2472, 322, 1925, 372, 297, 263, 8600, 310, 29871, 13, 29937, 21503, 4314, 426, 5453, 934, 29892, 2656, 2098, 29892, 6369, 29892, 6421, 578, 265, 29913, 5291, 2701, 13, 5453, 29918, 3888, 353, 6571, 1678, 13, 5453, 29918, 10853, 353, 6571, 1678, 13, 1454, 2224, 29892, 1014, 3972, 29879, 29892, 2066, 297, 2897, 29889, 20919, 29898, 4632, 1125, 13, 29871, 363, 3883, 297, 1014, 3972, 29879, 29901, 13, 1678, 565, 2224, 1275, 3876, 29901, 13, 13, 418, 3883, 29918, 5325, 353, 1284, 29918, 3487, 29918, 5325, 29898, 4632, 13578, 12975, 29974, 5453, 29892, 3366, 5453, 20068, 13, 418, 565, 313, 2435, 29898, 5453, 29918, 5325, 29897, 1275, 29871, 29900, 1125, 13, 4706, 6773, 13, 418, 25342, 313, 2435, 29898, 5453, 29918, 5325, 29897, 1405, 29871, 29896, 1125, 13, 4706, 1596, 376, 7355, 15691, 5453, 13578, 3743, 901, 1135, 373, 869, 3487, 934, 411, 901, 29874, 1134, 525, 5453, 29915, 29991, 29871, 27450, 292, 3045, 29908, 13, 4706, 6876, 29898, 29896, 29897, 13, 29871, 13, 418, 518, 6605, 29918, 2098, 29892, 6369, 29892, 6421, 578, 265, 29892, 12141, 29962, 353, 1284, 29918, 5453, 29918, 3888, 29898, 5453, 29918, 5325, 29961, 29900, 2314, 13, 13, 418, 396, 788, 3884, 6251, 313, 4716, 338, 3528, 263, 3884, 29897, 13, 418, 3883, 29918, 3888, 29961, 5453, 29962, 353, 11117, 1445, 2396, 5453, 29918, 5325, 29961, 29900, 1402, 525, 6605, 29918, 2098, 2396, 6605, 29918, 2098, 29892, 525, 5467, 3726, 2396, 5467, 3726, 29892, 525, 11506, 578, 265, 2396, 11506, 578, 265, 29892, 525, 28970, 2396, 28970, 29913, 13, 13, 418, 3883, 29918, 10853, 29961, 5453, 29962, 353, 1284, 29918, 5453, 29918, 10853, 29898, 4632, 13578, 12975, 29974, 5453, 29897, 13, 13, 361, 313, 2435, 29898, 5453, 29918, 3888, 29897, 1275, 29871, 29900, 1125, 13, 29871, 1596, 376, 3782, 3883, 1476, 856, 27450, 292, 29908, 13, 29871, 6876, 29898, 29896, 29897, 13, 13, 13, 29937, 8878, 385, 1409, 310, 278, 12705, 3883, 2983, 13, 24582, 29918, 7576, 353, 518, 29874, 363, 313, 29874, 29892, 29890, 29897, 297, 12705, 29898, 5453, 29918, 3888, 29889, 7076, 3285, 1820, 29922, 2892, 921, 29901, 921, 29961, 29896, 22322, 6605, 29918, 2098, 2033, 4638, 13, 13, 29937, 11796, 29872, 278, 7472, 1024, 3309, 363, 16384, 11976, 13, 3317, 29918, 978, 29918, 2848, 353, 10032, 29898, 2892, 263, 29892, 29890, 29901, 263, 565, 313, 29874, 1405, 289, 29897, 1683, 289, 29892, 2910, 29898, 2435, 29892, 24582, 29918, 7576, 876, 13, 13, 29937, 11905, 278, 4315, 13, 4172, 10526, 353, 18580, 267, 29889, 262, 1169, 7283, 580, 13, 13, 29937, 5399, 393, 278, 3474, 338, 4802, 3307, 13, 29898, 3545, 29892, 2103, 29897, 353, 3659, 10526, 29889, 657, 3317, 29891, 29916, 580, 13, 361, 313, 2103, 529, 29871, 29947, 29900, 1125, 13, 12, 29883, 1295, 267, 29889, 10763, 8690, 890, 3659, 10526, 29889, 446, 1478, 328, 29898, 29900, 416, 18580, 267, 29889, 8057, 580, 13, 12, 29883, 1295, 267, 29889, 355, 5080, 580, 13, 12, 2158, 376, 14343, 979, 3474, 4225, 304, 367, 25734, 856, 27450, 292, 29908, 13, 12, 13322, 29898, 29896, 29897, 13, 361, 313, 3545, 529, 29871, 29945, 29974, 2435, 29898, 24582, 29918, 7576, 22164, 13, 12, 29883, 1295, 267, 29889, 10763, 8690, 890, 3659, 10526, 29889, 446, 1478, 328, 29898, 29900, 416, 18580, 267, 29889, 8057, 580, 13, 12, 29883, 1295, 267, 29889, 355, 5080, 580, 13, 12, 2158, 376, 14343, 979, 3474, 4225, 304, 367, 260, 12572, 856, 27450, 292, 29908, 13, 12, 13322, 29898, 29896, 29897, 13, 13, 29937, 3789, 701, 278, 4315, 13, 29883, 1295, 267, 29889, 1217, 8057, 580, 13, 29883, 1295, 267, 29889, 29883, 8690, 580, 13, 4172, 10526, 29889, 446, 1478, 328, 29898, 29896, 29897, 13, 3545, 353, 29871, 29945, 29974, 2435, 29898, 24582, 29918, 7576, 416, 2920, 353, 29871, 29945, 29900, 13, 5080, 353, 18580, 267, 29889, 1482, 5080, 29898, 3545, 29892, 2920, 29897, 13, 13, 29937, 22402, 1897, 10350, 313, 6800, 542, 7176, 1819, 304, 1106, 3431, 29897, 13, 5467, 3726, 29918, 4914, 29871, 353, 4236, 29918, 978, 29918, 2848, 718, 29871, 29947, 13, 11506, 578, 265, 29918, 4914, 353, 4236, 29918, 978, 29918, 2848, 718, 29871, 29896, 29929, 13, 28970, 29918, 4914, 29871, 353, 4236, 29918, 978, 29918, 2848, 718, 29871, 29941, 29896, 13, 13, 29937, 8600, 310, 278, 1897, 10350, 847, 2099, 886, 13, 13099, 353, 426, 5467, 3726, 29918, 4914, 6160, 5467, 3726, 613, 6421, 578, 265, 29918, 4914, 6160, 11506, 578, 265, 613, 12141, 29918, 4914, 6160, 28970, 9092, 13, 13, 29937, 13905, 4343, 6031, 13, 4172, 10526, 29889, 1202, 710, 29898, 29900, 29892, 29871, 29900, 29892, 376, 6720, 1525, 29909, 15591, 27256, 5067, 1159, 13, 4172, 10526, 29889, 1202, 710, 29898, 29896, 29892, 29871, 29900, 29892, 18227, 11730, 5235, 9479, 731, 304, 1565, 29914, 4541, 297, 869, 3487, 2066, 338, 20592, 25760, 13, 4172, 10526, 29889, 1202, 710, 29898, 29906, 29892, 29871, 29900, 29892, 376, 14936, 29901, 20429, 259, 9041, 29901, 5235, 259, 3855, 29901, 4078, 322, 23283, 268, 921, 29901, 23283, 613, 18580, 267, 29889, 29909, 29918, 1525, 5348, 1660, 29897, 13, 4172, 10526, 29889, 1202, 710, 29898, 29946, 29892, 6369, 29918, 4914, 29899, 29946, 29892, 29871, 376, 7056, 13367, 3235, 29950, 3352, 1159, 13, 4172, 10526, 29889, 1202, 710, 29898, 29946, 29892, 6421, 578, 265, 29918, 4914, 29899, 29946, 29892, 376, 19795, 4214, 6156, 1164, 1159, 13, 4172, 10526, 29889, 1202, 710, 29898, 29946, 29892, 12141, 29918, 4914, 29899, 29946, 29892, 29871, 376, 29950, 6259, 29950, 5265, 29954, 3912, 1159, 13, 4172, 10526, 29889, 22379, 580, 13, 13, 29937, 22402, 10677, 13451, 13, 1195, 29918, 29891, 353, 29871, 29945, 13, 3317, 29918, 29891, 353, 1375, 29918, 29891, 718, 7431, 29898, 24582, 29918, 7576, 6817, 29896, 13, 13, 29937, 13905, 10585, 13, 29891, 353, 1375, 29918, 29891, 13, 1454, 3883, 297, 12705, 29918, 7576, 29901, 29871, 13, 29871, 3659, 10526, 29889, 1202, 710, 29898, 29891, 29892, 29871, 29900, 29892, 3883, 29897, 13, 29871, 3659, 10526, 29889, 1202, 710, 29898, 29891, 29892, 6369, 29918, 4914, 29892, 29871, 17456, 29898, 5453, 29918, 3888, 29961, 5453, 22322, 5467, 3726, 25901, 13, 29871, 3659, 10526, 29889, 1202, 710, 29898, 29891, 29892, 6421, 578, 265, 29918, 4914, 29892, 17456, 29898, 5453, 29918, 3888, 29961, 5453, 22322, 11506, 578, 265, 25901, 13, 29871, 3659, 10526, 29889, 1202, 710, 29898, 29891, 29892, 12141, 29918, 4914, 29892, 29871, 17456, 29898, 5453, 29918, 3888, 29961, 5453, 22322, 28970, 25901, 13, 29871, 343, 4619, 29871, 29896, 13, 13, 29937, 22402, 278, 2847, 2602, 310, 278, 10677, 13, 2764, 29918, 29916, 353, 6369, 29918, 4914, 13, 2764, 29918, 29891, 353, 29871, 29945, 13, 13, 29937, 29273, 1820, 3965, 267, 13, 8000, 29871, 29896, 29901, 13, 29871, 3659, 10526, 29889, 11631, 29898, 2764, 29918, 29891, 29892, 2764, 29918, 29916, 29897, 13, 29871, 274, 353, 3659, 10526, 29889, 657, 305, 580, 13, 13, 29871, 396, 315, 5966, 4337, 13, 29871, 565, 313, 29883, 1275, 18580, 267, 29889, 10818, 29918, 3970, 16048, 29897, 470, 313, 29883, 1275, 4356, 877, 29926, 8785, 29901, 13, 1678, 3151, 29918, 29891, 353, 1375, 29898, 2764, 29918, 29891, 29974, 29896, 29892, 3317, 29918, 29891, 29897, 13, 29871, 25342, 313, 29883, 1275, 18580, 267, 29889, 10818, 29918, 4897, 29897, 470, 313, 29883, 1275, 4356, 877, 29895, 8785, 29901, 13, 1678, 3151, 29918, 29891, 353, 4236, 29898, 2764, 29918, 29891, 29899, 29896, 29892, 1195, 29918, 29891, 29897, 13, 29871, 25342, 313, 29883, 1275, 18580, 267, 29889, 10818, 29918, 28024, 29897, 470, 313, 29883, 1275, 4356, 877, 29882, 8785, 29901, 13, 1678, 3151, 29918, 29916, 353, 12705, 29898, 13099, 29889, 8149, 3101, 29961, 3317, 29898, 29900, 29892, 12705, 29898, 13099, 29889, 8149, 16655, 2248, 29898, 2764, 29918, 29916, 6817, 29896, 4638, 13, 29871, 25342, 313, 29883, 1275, 18580, 267, 29889, 10818, 29918, 22789, 3912, 29897, 470, 313, 29883, 1275, 4356, 877, 29880, 8785, 29901, 13, 1678, 3151, 29918, 29916, 353, 12705, 29898, 13099, 29889, 8149, 3101, 29961, 1195, 29898, 2435, 29898, 13099, 6817, 29896, 29892, 12705, 29898, 13099, 29889, 8149, 16655, 2248, 29898, 2764, 29918, 29916, 7240, 29896, 4638, 13, 13, 29871, 396, 2921, 304, 3883, 9451, 13, 29871, 25342, 313, 29883, 1275, 4356, 28909, 29876, 8785, 29901, 13, 1678, 3883, 29918, 3051, 29918, 7323, 786, 29898, 5453, 29918, 10853, 29961, 24582, 29918, 7576, 29961, 2764, 29918, 29891, 448, 1375, 29918, 29891, 24960, 13, 13, 29871, 396, 323, 9804, 13, 29871, 25342, 274, 1275, 4356, 877, 525, 1125, 13, 1678, 1897, 29918, 1853, 353, 4341, 29961, 2764, 29918, 29916, 29962, 13, 1678, 3883, 29918, 3888, 29961, 24582, 29918, 7576, 29961, 2764, 29918, 29891, 448, 1375, 29918, 29891, 29962, 3816, 4914, 29918, 1853, 29962, 353, 29871, 29896, 448, 3883, 29918, 3888, 29961, 24582, 29918, 7576, 29961, 2764, 29918, 29891, 448, 1375, 29918, 29891, 29962, 3816, 4914, 29918, 1853, 29962, 13, 1678, 3659, 10526, 29889, 1202, 710, 29898, 2764, 29918, 29891, 29892, 3151, 29918, 29916, 29892, 17456, 29898, 5453, 29918, 3888, 29961, 24582, 29918, 7576, 29961, 2764, 29918, 29891, 448, 1375, 29918, 29891, 29962, 3816, 4914, 29918, 1853, 12622, 13, 13, 29871, 396, 751, 277, 13, 29871, 25342, 274, 1275, 4356, 877, 29916, 29374, 13, 1678, 4078, 353, 7700, 13, 1678, 2867, 13, 13, 29871, 396, 16913, 322, 23283, 13, 29871, 25342, 274, 1275, 4356, 877, 29939, 29374, 13, 1678, 4078, 353, 5852, 13, 1678, 18580, 267, 29889, 28041, 580, 13, 1678, 2867, 29871, 13, 13, 29937, 10092, 8638, 4426, 13, 29883, 1295, 267, 29889, 10763, 8690, 890, 3659, 10526, 29889, 446, 1478, 328, 29898, 29900, 416, 18580, 267, 29889, 8057, 580, 13, 29883, 1295, 267, 29889, 355, 5080, 580, 13, 13, 361, 313, 7620, 1125, 13, 29871, 396, 1954, 2037, 3620, 313, 1182, 1082, 29899, 10118, 2436, 310, 599, 8018, 1045, 1772, 550, 297, 3776, 10521, 3487, 3883, 2066, 29897, 13, 29871, 363, 3883, 297, 12705, 29918, 7576, 29901, 13, 1678, 565, 313, 5453, 29918, 3888, 29961, 5453, 22322, 5467, 3726, 2033, 2804, 6213, 1125, 13, 418, 731, 29918, 6799, 29898, 5453, 29918, 3888, 29961, 5453, 22322, 1445, 7464, 376, 5467, 3726, 613, 308, 851, 29898, 5453, 29918, 3888, 29961, 5453, 22322, 5467, 3726, 2033, 1275, 29871, 29896, 467, 13609, 3101, 13, 1678, 565, 313, 5453, 29918, 3888, 29961, 5453, 22322, 11506, 578, 265, 2033, 2804, 6213, 1125, 13, 418, 731, 29918, 6799, 29898, 5453, 29918, 3888, 29961, 5453, 22322, 1445, 7464, 376, 5514, 29874, 29918, 11506, 29918, 578, 265, 613, 851, 29898, 5453, 29918, 3888, 29961, 5453, 22322, 11506, 578, 265, 2033, 1275, 29871, 29896, 467, 13609, 3101, 13, 1678, 565, 313, 5453, 29918, 3888, 29961, 5453, 22322, 28970, 2033, 2804, 6213, 1125, 13, 418, 731, 29918, 6799, 29898, 5453, 29918, 3888, 29961, 5453, 22322, 1445, 7464, 376, 5514, 29874, 29918, 28970, 613, 259, 851, 29898, 5453, 29918, 3888, 29961, 5453, 22322, 28970, 2033, 1275, 29871, 29896, 467, 13609, 3101, 13, 13, 13, 13, 2 ]
bitmovin/resources/models/manifests/hls/hls_manifest.py
migutw42/bitmovin-python
44
116743
from ..abstract_manifest import AbstractManifest from bitmovin.resources.enums.hls_version import HlsVersion class HlsManifest(AbstractManifest): def __init__(self, manifest_name, outputs, name=None, description=None, id_=None, custom_data=None, hls_media_playlist_version=None, hls_master_playlist_version=None): super().__init__(id_=id_, custom_data=custom_data, manifest_name=manifest_name, outputs=outputs, name=name, description=description) self._hlsMediaPlaylistVersion = None self.hlsMediaPlaylistVersion = hls_media_playlist_version self._hlsMasterPlaylistVersion = None self.hlsMasterPlaylistVersion = hls_master_playlist_version @property def hlsMediaPlaylistVersion(self): return self._hlsMediaPlaylistVersion @hlsMediaPlaylistVersion.setter def hlsMediaPlaylistVersion(self, new_hls_media_playlist_version): if new_hls_media_playlist_version is None: self._hlsMediaPlaylistVersion = None elif isinstance(new_hls_media_playlist_version, HlsVersion): self._hlsMediaPlaylistVersion = new_hls_media_playlist_version.value elif isinstance(new_hls_media_playlist_version, int): self._hlsMediaPlaylistVersion = new_hls_media_playlist_version else: raise InvalidTypeError('hlsMediaPlaylistVersion has to be of type HlsVersion') @property def hlsMasterPlaylistVersion(self): return self._hlsMasterPlaylistVersion @hlsMasterPlaylistVersion.setter def hlsMasterPlaylistVersion(self, new_hls_master_playlist_version): if new_hls_master_playlist_version is None: self._hlsMasterPlaylistVersion = None elif isinstance(new_hls_master_playlist_version, HlsVersion): self._hlsMasterPlaylistVersion = new_hls_master_playlist_version.value elif isinstance(new_hls_master_playlist_version, int): self._hlsMasterPlaylistVersion = new_hls_master_playlist_version else: raise InvalidTypeError('hlsMasterPlaylistVersion has to be of type HlsVersion') @classmethod def parse_from_json_object(cls, json_object): manifest = AbstractManifest.parse_from_json_object(json_object=json_object) id_ = manifest.id manifest_name = manifest.manifestName name = manifest.name description = manifest.description custom_data = manifest.customData outputs = manifest.outputs hls_media_playlist_version = json_object.get('hlsMediaPlaylistVersion') hls_master_playlist_version = json_object.get('hlsMasterPlaylistVersion') hls_manifest = HlsManifest(id_=id_, manifest_name=manifest_name, custom_data=custom_data, outputs=outputs, name=name, description=description, hls_media_playlist_version=hls_media_playlist_version, hls_master_playlist_version=hls_master_playlist_version) return hls_manifest def serialize(self): serialized = super().serialize() serialized['hlsMediaPlaylistVersion'] = self.hlsMediaPlaylistVersion serialized['hlsMasterPlaylistVersion'] = self.hlsMasterPlaylistVersion return serialized
[ 1, 515, 6317, 16595, 29918, 29135, 1053, 25513, 2517, 7004, 13, 3166, 2586, 13529, 262, 29889, 13237, 29889, 264, 6762, 29889, 29882, 3137, 29918, 3259, 1053, 379, 3137, 6594, 13, 13, 13, 1990, 379, 3137, 2517, 7004, 29898, 9118, 2517, 7004, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 10419, 29918, 978, 29892, 14391, 29892, 1024, 29922, 8516, 29892, 6139, 29922, 8516, 29892, 1178, 29918, 29922, 8516, 29892, 2888, 29918, 1272, 29922, 8516, 29892, 13, 462, 298, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 29922, 8516, 29892, 298, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 29922, 8516, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 333, 29918, 29922, 333, 3383, 2888, 29918, 1272, 29922, 6341, 29918, 1272, 29892, 10419, 29918, 978, 29922, 29135, 29918, 978, 29892, 14391, 29922, 4905, 29879, 29892, 13, 462, 308, 1024, 29922, 978, 29892, 6139, 29922, 8216, 29897, 13, 13, 4706, 1583, 3032, 29882, 3137, 10572, 13454, 1761, 6594, 353, 6213, 13, 4706, 1583, 29889, 29882, 3137, 10572, 13454, 1761, 6594, 353, 298, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 13, 4706, 1583, 3032, 29882, 3137, 19203, 13454, 1761, 6594, 353, 6213, 13, 4706, 1583, 29889, 29882, 3137, 19203, 13454, 1761, 6594, 353, 298, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 13, 13, 1678, 732, 6799, 13, 1678, 822, 298, 3137, 10572, 13454, 1761, 6594, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29882, 3137, 10572, 13454, 1761, 6594, 13, 13, 1678, 732, 29882, 3137, 10572, 13454, 1761, 6594, 29889, 842, 357, 13, 1678, 822, 298, 3137, 10572, 13454, 1761, 6594, 29898, 1311, 29892, 716, 29918, 29882, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 1125, 13, 4706, 565, 716, 29918, 29882, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 338, 6213, 29901, 13, 9651, 1583, 3032, 29882, 3137, 10572, 13454, 1761, 6594, 353, 6213, 13, 4706, 25342, 338, 8758, 29898, 1482, 29918, 29882, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 29892, 379, 3137, 6594, 1125, 13, 9651, 1583, 3032, 29882, 3137, 10572, 13454, 1761, 6594, 353, 716, 29918, 29882, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 29889, 1767, 13, 4706, 25342, 338, 8758, 29898, 1482, 29918, 29882, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 29892, 938, 1125, 13, 9651, 1583, 3032, 29882, 3137, 10572, 13454, 1761, 6594, 353, 716, 29918, 29882, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 13, 4706, 1683, 29901, 13, 9651, 12020, 21403, 1542, 2392, 877, 29882, 3137, 10572, 13454, 1761, 6594, 756, 304, 367, 310, 1134, 379, 3137, 6594, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 298, 3137, 19203, 13454, 1761, 6594, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29882, 3137, 19203, 13454, 1761, 6594, 13, 13, 1678, 732, 29882, 3137, 19203, 13454, 1761, 6594, 29889, 842, 357, 13, 1678, 822, 298, 3137, 19203, 13454, 1761, 6594, 29898, 1311, 29892, 716, 29918, 29882, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 1125, 13, 4706, 565, 716, 29918, 29882, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 338, 6213, 29901, 13, 9651, 1583, 3032, 29882, 3137, 19203, 13454, 1761, 6594, 353, 6213, 13, 4706, 25342, 338, 8758, 29898, 1482, 29918, 29882, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 29892, 379, 3137, 6594, 1125, 13, 9651, 1583, 3032, 29882, 3137, 19203, 13454, 1761, 6594, 353, 716, 29918, 29882, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 29889, 1767, 13, 4706, 25342, 338, 8758, 29898, 1482, 29918, 29882, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 29892, 938, 1125, 13, 9651, 1583, 3032, 29882, 3137, 19203, 13454, 1761, 6594, 353, 716, 29918, 29882, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 13, 4706, 1683, 29901, 13, 9651, 12020, 21403, 1542, 2392, 877, 29882, 3137, 19203, 13454, 1761, 6594, 756, 304, 367, 310, 1134, 379, 3137, 6594, 1495, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 6088, 29918, 3166, 29918, 3126, 29918, 3318, 29898, 25932, 29892, 4390, 29918, 3318, 1125, 13, 4706, 10419, 353, 25513, 2517, 7004, 29889, 5510, 29918, 3166, 29918, 3126, 29918, 3318, 29898, 3126, 29918, 3318, 29922, 3126, 29918, 3318, 29897, 13, 4706, 1178, 29918, 353, 10419, 29889, 333, 13, 4706, 10419, 29918, 978, 353, 10419, 29889, 29135, 1170, 13, 4706, 1024, 353, 10419, 29889, 978, 13, 4706, 6139, 353, 10419, 29889, 8216, 13, 4706, 2888, 29918, 1272, 353, 10419, 29889, 6341, 1469, 13, 4706, 14391, 353, 10419, 29889, 4905, 29879, 13, 4706, 298, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 353, 4390, 29918, 3318, 29889, 657, 877, 29882, 3137, 10572, 13454, 1761, 6594, 1495, 13, 4706, 298, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 353, 4390, 29918, 3318, 29889, 657, 877, 29882, 3137, 19203, 13454, 1761, 6594, 1495, 13, 13, 4706, 298, 3137, 29918, 29135, 353, 379, 3137, 2517, 7004, 29898, 333, 29918, 29922, 333, 3383, 10419, 29918, 978, 29922, 29135, 29918, 978, 29892, 2888, 29918, 1272, 29922, 6341, 29918, 1272, 29892, 13, 462, 462, 259, 14391, 29922, 4905, 29879, 29892, 1024, 29922, 978, 29892, 6139, 29922, 8216, 29892, 13, 462, 462, 259, 298, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 29922, 29882, 3137, 29918, 9799, 29918, 1456, 1761, 29918, 3259, 29892, 13, 462, 462, 259, 298, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 29922, 29882, 3137, 29918, 6207, 29918, 1456, 1761, 29918, 3259, 29897, 13, 13, 4706, 736, 298, 3137, 29918, 29135, 13, 13, 1678, 822, 28755, 29898, 1311, 1125, 13, 4706, 7797, 1891, 353, 2428, 2141, 643, 6646, 580, 13, 4706, 7797, 1891, 1839, 29882, 3137, 10572, 13454, 1761, 6594, 2033, 353, 1583, 29889, 29882, 3137, 10572, 13454, 1761, 6594, 13, 4706, 7797, 1891, 1839, 29882, 3137, 19203, 13454, 1761, 6594, 2033, 353, 1583, 29889, 29882, 3137, 19203, 13454, 1761, 6594, 13, 13, 4706, 736, 7797, 1891, 13, 2 ]
tools/setup_helpers/rocm.py
DavidKo3/mctorch
1
135463
<gh_stars>1-10 from .env import check_env_flag # Check if ROCM is enabled USE_ROCM = check_env_flag('USE_ROCM') ROCM_HOME = "/opt/rocm" ROCM_VERSION = ""
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 869, 6272, 1053, 1423, 29918, 6272, 29918, 15581, 13, 29937, 5399, 565, 16641, 24494, 338, 9615, 13, 17171, 29918, 1672, 24494, 353, 1423, 29918, 6272, 29918, 15581, 877, 17171, 29918, 1672, 24494, 1495, 13, 1672, 24494, 29918, 17353, 353, 5591, 3670, 29914, 307, 4912, 29908, 13, 1672, 24494, 29918, 16358, 353, 5124, 13, 2 ]
jionlp/algorithm/summary/__init__.py
ji3g4m6zo6/JioNLP
1,063
137437
<reponame>ji3g4m6zo6/JioNLP # -*- coding=utf-8 -*- # library: jionlp # author: dongrixinyu # license: Apache License 2.0 # Email: <EMAIL> # github: https://github.com/dongrixinyu/JioNLP # description: Preprocessing tool for Chinese NLP from .extract_summary import ChineseSummaryExtractor extract_summary = ChineseSummaryExtractor()
[ 1, 529, 276, 1112, 420, 29958, 2397, 29941, 29887, 29946, 29885, 29953, 2502, 29953, 29914, 29967, 601, 29940, 13208, 13, 29937, 448, 29930, 29899, 14137, 29922, 9420, 29899, 29947, 448, 29930, 29899, 13, 29937, 3489, 29901, 432, 291, 22833, 13, 29937, 4148, 29901, 270, 549, 2126, 4901, 29884, 13, 29937, 19405, 29901, 13380, 19245, 29871, 29906, 29889, 29900, 13, 29937, 22608, 29901, 529, 26862, 6227, 29958, 13, 29937, 18546, 29901, 2045, 597, 3292, 29889, 510, 29914, 29881, 549, 2126, 4901, 29884, 29914, 29967, 601, 29940, 13208, 13, 29937, 6139, 29901, 4721, 19170, 5780, 363, 10013, 405, 13208, 13, 13, 13, 3166, 869, 21111, 29918, 7727, 1053, 10013, 26289, 5647, 28891, 13, 13, 13, 21111, 29918, 7727, 353, 10013, 26289, 5647, 28891, 580, 13, 13, 2 ]
_py2tmp/ir1/free_variables.py
google/tmppy
27
1605920
<reponame>google/tmppy # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS-IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import itertools from contextlib import contextmanager from typing import List, Set, Dict, Union, Generator, Tuple, Iterable from _py2tmp.ir1 import ir from _py2tmp.ir1._visitor import Visitor class _GetFreeVariablesVisitor(Visitor): def __init__(self) -> None: self.local_var_names: Set[str] = set() self.free_vars_by_name: Dict[str, Union[ir.VarReference, ir.VarReferencePattern]] = dict() def visit_assignment(self, stmt: ir.Assignment): self.visit_expr(stmt.rhs) self.local_var_names.add(stmt.lhs.name) if stmt.lhs2: self.local_var_names.add(stmt.lhs2.name) def visit_unpacking_assignment(self, stmt: ir.UnpackingAssignment): self.visit_expr(stmt.rhs) for var in stmt.lhs_list: self.local_var_names.add(var.name) def visit_match_expr(self, expr: ir.MatchExpr): for matched_var in expr.matched_vars: self.visit_expr(matched_var) for match_case in expr.match_cases: with self.open_scope(): for var in itertools.chain(match_case.matched_var_names, match_case.matched_variadic_var_names): self.local_var_names.add(var) self.visit_match_case(match_case) def visit_var_reference(self, expr: ir.VarReference): if not expr.is_global_function and expr.name not in self.local_var_names: self.free_vars_by_name[expr.name] = expr def visit_var_reference_pattern(self, expr: ir.VarReferencePattern): if not expr.is_global_function and expr.name not in self.local_var_names: self.free_vars_by_name[expr.name] = expr def visit_list_comprehension_expr(self, expr: ir.ListComprehensionExpr): self.visit_expr(expr.list_var) with self.open_scope(): self.local_var_names.add(expr.loop_var.name) self.visit_expr(expr.result_elem_expr) @contextmanager def open_scope(self) -> Generator[None, None, None]: old_names = self.local_var_names.copy() yield self.local_var_names = old_names def get_unique_free_variables_in_stmts(stmts: Iterable[ir.Stmt]) -> Tuple[ir.VarReference, ...]: visitor = _GetFreeVariablesVisitor() visitor.visit_stmts(stmts) return tuple(sorted(visitor.free_vars_by_name.values(), key=lambda var: var.name)) def get_unique_free_variables_in_expr(expr: ir.Expr) -> Tuple[ir.VarReference, ...]: visitor = _GetFreeVariablesVisitor() visitor.visit_expr(expr) return tuple(sorted(visitor.free_vars_by_name.values(), key=lambda var: var.name))
[ 1, 529, 276, 1112, 420, 29958, 3608, 29914, 18276, 23717, 13, 29937, 29871, 14187, 1266, 29871, 29906, 29900, 29896, 29955, 5087, 9266, 29889, 2178, 26863, 2538, 9841, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 418, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 29899, 3235, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 5215, 4256, 8504, 13, 3166, 3030, 1982, 1053, 3030, 12847, 13, 3166, 19229, 1053, 2391, 29892, 3789, 29892, 360, 919, 29892, 7761, 29892, 3251, 1061, 29892, 12603, 552, 29892, 20504, 519, 13, 13, 3166, 903, 2272, 29906, 7050, 29889, 381, 29896, 1053, 3805, 13, 3166, 903, 2272, 29906, 7050, 29889, 381, 29896, 3032, 1730, 2105, 1053, 5741, 2105, 13, 13, 13, 1990, 903, 2577, 20475, 10444, 1849, 6116, 2105, 29898, 6116, 2105, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 29901, 3789, 29961, 710, 29962, 353, 731, 580, 13, 4706, 1583, 29889, 9021, 29918, 16908, 29918, 1609, 29918, 978, 29901, 360, 919, 29961, 710, 29892, 7761, 29961, 381, 29889, 9037, 7422, 29892, 3805, 29889, 9037, 7422, 17144, 5262, 353, 9657, 580, 13, 13, 1678, 822, 6493, 29918, 465, 10194, 29898, 1311, 29892, 380, 4378, 29901, 3805, 29889, 7900, 10194, 1125, 13, 4706, 1583, 29889, 1730, 277, 29918, 13338, 29898, 17868, 29889, 29878, 9499, 29897, 13, 4706, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 29889, 1202, 29898, 17868, 29889, 29880, 9499, 29889, 978, 29897, 13, 4706, 565, 380, 4378, 29889, 29880, 9499, 29906, 29901, 13, 9651, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 29889, 1202, 29898, 17868, 29889, 29880, 9499, 29906, 29889, 978, 29897, 13, 13, 1678, 822, 6493, 29918, 348, 4058, 292, 29918, 465, 10194, 29898, 1311, 29892, 380, 4378, 29901, 3805, 29889, 2525, 4058, 292, 7900, 10194, 1125, 13, 4706, 1583, 29889, 1730, 277, 29918, 13338, 29898, 17868, 29889, 29878, 9499, 29897, 13, 4706, 363, 722, 297, 380, 4378, 29889, 29880, 9499, 29918, 1761, 29901, 13, 9651, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 29889, 1202, 29898, 1707, 29889, 978, 29897, 13, 13, 1678, 822, 6493, 29918, 4352, 29918, 13338, 29898, 1311, 29892, 22010, 29901, 3805, 29889, 9652, 21176, 1125, 13, 4706, 363, 19228, 29918, 1707, 297, 22010, 29889, 4352, 287, 29918, 16908, 29901, 13, 9651, 1583, 29889, 1730, 277, 29918, 13338, 29898, 4352, 287, 29918, 1707, 29897, 13, 4706, 363, 1993, 29918, 4878, 297, 22010, 29889, 4352, 29918, 11436, 29901, 13, 9651, 411, 1583, 29889, 3150, 29918, 6078, 7295, 13, 18884, 363, 722, 297, 4256, 8504, 29889, 14153, 29898, 4352, 29918, 4878, 29889, 4352, 287, 29918, 1707, 29918, 7039, 29892, 1993, 29918, 4878, 29889, 4352, 287, 29918, 5927, 26538, 29918, 1707, 29918, 7039, 1125, 13, 462, 1678, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 29889, 1202, 29898, 1707, 29897, 13, 18884, 1583, 29889, 1730, 277, 29918, 4352, 29918, 4878, 29898, 4352, 29918, 4878, 29897, 13, 13, 1678, 822, 6493, 29918, 1707, 29918, 5679, 29898, 1311, 29892, 22010, 29901, 3805, 29889, 9037, 7422, 1125, 13, 4706, 565, 451, 22010, 29889, 275, 29918, 10945, 29918, 2220, 322, 22010, 29889, 978, 451, 297, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 29901, 13, 9651, 1583, 29889, 9021, 29918, 16908, 29918, 1609, 29918, 978, 29961, 13338, 29889, 978, 29962, 353, 22010, 13, 13, 1678, 822, 6493, 29918, 1707, 29918, 5679, 29918, 11037, 29898, 1311, 29892, 22010, 29901, 3805, 29889, 9037, 7422, 17144, 1125, 13, 4706, 565, 451, 22010, 29889, 275, 29918, 10945, 29918, 2220, 322, 22010, 29889, 978, 451, 297, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 29901, 13, 9651, 1583, 29889, 9021, 29918, 16908, 29918, 1609, 29918, 978, 29961, 13338, 29889, 978, 29962, 353, 22010, 13, 13, 1678, 822, 6493, 29918, 1761, 29918, 510, 1457, 29882, 2673, 29918, 13338, 29898, 1311, 29892, 22010, 29901, 3805, 29889, 1293, 1523, 1457, 29882, 2673, 21176, 1125, 13, 4706, 1583, 29889, 1730, 277, 29918, 13338, 29898, 13338, 29889, 1761, 29918, 1707, 29897, 13, 4706, 411, 1583, 29889, 3150, 29918, 6078, 7295, 13, 9651, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 29889, 1202, 29898, 13338, 29889, 7888, 29918, 1707, 29889, 978, 29897, 13, 9651, 1583, 29889, 1730, 277, 29918, 13338, 29898, 13338, 29889, 2914, 29918, 20461, 29918, 13338, 29897, 13, 13, 1678, 732, 4703, 12847, 13, 1678, 822, 1722, 29918, 6078, 29898, 1311, 29897, 1599, 3251, 1061, 29961, 8516, 29892, 6213, 29892, 6213, 5387, 13, 4706, 2030, 29918, 7039, 353, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 29889, 8552, 580, 13, 4706, 7709, 13, 4706, 1583, 29889, 2997, 29918, 1707, 29918, 7039, 353, 2030, 29918, 7039, 13, 13, 1753, 679, 29918, 13092, 29918, 9021, 29918, 20897, 29918, 262, 29918, 303, 29885, 1372, 29898, 303, 29885, 1372, 29901, 20504, 519, 29961, 381, 29889, 855, 4378, 2314, 1599, 12603, 552, 29961, 381, 29889, 9037, 7422, 29892, 2023, 5387, 13, 1678, 27682, 353, 903, 2577, 20475, 10444, 1849, 6116, 2105, 580, 13, 1678, 27682, 29889, 1730, 277, 29918, 303, 29885, 1372, 29898, 303, 29885, 1372, 29897, 13, 1678, 736, 18761, 29898, 24582, 29898, 1730, 2105, 29889, 9021, 29918, 16908, 29918, 1609, 29918, 978, 29889, 5975, 3285, 1820, 29922, 2892, 722, 29901, 722, 29889, 978, 876, 13, 13, 1753, 679, 29918, 13092, 29918, 9021, 29918, 20897, 29918, 262, 29918, 13338, 29898, 13338, 29901, 3805, 29889, 21176, 29897, 1599, 12603, 552, 29961, 381, 29889, 9037, 7422, 29892, 2023, 5387, 13, 1678, 27682, 353, 903, 2577, 20475, 10444, 1849, 6116, 2105, 580, 13, 1678, 27682, 29889, 1730, 277, 29918, 13338, 29898, 13338, 29897, 13, 1678, 736, 18761, 29898, 24582, 29898, 1730, 2105, 29889, 9021, 29918, 16908, 29918, 1609, 29918, 978, 29889, 5975, 3285, 1820, 29922, 2892, 722, 29901, 722, 29889, 978, 876, 13, 2 ]
cvxpy/reductions/flip_objective.py
hashstat/cvxpy
3,285
148764
""" Copyright 2017 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from cvxpy.expressions import cvxtypes from cvxpy.problems.objective import Maximize, Minimize from cvxpy.reductions.reduction import Reduction class FlipObjective(Reduction): """Flip a minimization objective to a maximization and vice versa. """ def accepts(self, problem) -> bool: return True def apply(self, problem): """:math:`\\max(f(x)) = -\\min(-f(x))` Parameters ---------- problem : Problem The problem whose objective is to be flipped. Returns ------- Problem A problem with a flipped objective. list The inverse data. """ is_maximize = type(problem.objective) == Maximize objective = Minimize if is_maximize else Maximize problem = cvxtypes.problem()(objective(-problem.objective.expr), problem.constraints) return problem, [] def invert(self, solution, inverse_data): """Map the solution of the flipped problem to that of the original. Parameters ---------- solution : Solution A solution object. inverse_data : list The inverse data returned by an invocation to apply. Returns ------- Solution A solution to the original problem. """ if solution.opt_val is not None: solution.opt_val = -solution.opt_val return solution
[ 1, 9995, 13, 11882, 1266, 29871, 29906, 29900, 29896, 29955, 529, 5813, 29958, 13, 13, 29931, 293, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 6293, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 3492, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 13, 1678, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 13, 2525, 2222, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 5721, 7541, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29956, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 13393, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 13400, 800, 1090, 278, 19245, 29889, 13, 15945, 29908, 13, 13, 3166, 13850, 29916, 2272, 29889, 17073, 1080, 1053, 13850, 486, 7384, 13, 3166, 13850, 29916, 2272, 29889, 17199, 29879, 29889, 3318, 573, 1053, 22128, 675, 29892, 3080, 326, 675, 13, 3166, 13850, 29916, 2272, 29889, 9313, 1953, 29889, 9313, 428, 1053, 4367, 29884, 428, 13, 13, 13, 1990, 383, 3466, 2061, 573, 29898, 29934, 6085, 428, 1125, 13, 1678, 9995, 29943, 3466, 263, 6260, 2133, 12091, 304, 263, 5256, 2133, 322, 11289, 1224, 29874, 29889, 13, 268, 9995, 13, 13, 1678, 822, 21486, 29898, 1311, 29892, 1108, 29897, 1599, 6120, 29901, 13, 4706, 736, 5852, 13, 13, 1678, 822, 3394, 29898, 1311, 29892, 1108, 1125, 13, 4706, 5124, 1115, 755, 18078, 1966, 3317, 29898, 29888, 29898, 29916, 876, 353, 448, 1966, 1195, 6278, 29888, 29898, 29916, 25337, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1108, 584, 11583, 13, 9651, 450, 1108, 5069, 12091, 338, 304, 367, 285, 492, 2986, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 11583, 13, 9651, 319, 1108, 411, 263, 285, 492, 2986, 12091, 29889, 13, 4706, 1051, 13, 9651, 450, 16402, 848, 29889, 13, 4706, 9995, 13, 4706, 338, 29918, 27525, 675, 353, 1134, 29898, 17199, 29889, 3318, 573, 29897, 1275, 22128, 675, 13, 4706, 12091, 353, 3080, 326, 675, 565, 338, 29918, 27525, 675, 1683, 22128, 675, 13, 4706, 1108, 353, 13850, 486, 7384, 29889, 17199, 580, 29898, 3318, 573, 6278, 17199, 29889, 3318, 573, 29889, 13338, 511, 13, 462, 462, 268, 1108, 29889, 13646, 29879, 29897, 13, 4706, 736, 1108, 29892, 5159, 13, 13, 1678, 822, 21292, 29898, 1311, 29892, 1650, 29892, 16402, 29918, 1272, 1125, 13, 4706, 9995, 3388, 278, 1650, 310, 278, 285, 492, 2986, 1108, 304, 393, 310, 278, 2441, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1650, 584, 24380, 13, 9651, 319, 1650, 1203, 29889, 13, 4706, 16402, 29918, 1272, 584, 1051, 13, 9651, 450, 16402, 848, 4133, 491, 385, 2437, 10610, 304, 3394, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 24380, 13, 9651, 319, 1650, 304, 278, 2441, 1108, 29889, 13, 4706, 9995, 13, 4706, 565, 1650, 29889, 3670, 29918, 791, 338, 451, 6213, 29901, 13, 9651, 1650, 29889, 3670, 29918, 791, 353, 448, 2929, 918, 29889, 3670, 29918, 791, 13, 4706, 736, 1650, 13, 2 ]
test_seg_patch.py
Aryan98/lcprediction
0
139888
<filename>test_seg_patch.py import string import sys import lasagne as nn import numpy as np import theano import buffering import pathfinder import utils from configuration import config, set_configuration from utils_plots import plot_slice_3d_3 import utils_lung import logger theano.config.warn_float64 = 'raise' if len(sys.argv) < 2: sys.exit("Usage: train.py <configuration_name>") config_name = sys.argv[1] set_configuration('configs_seg_patch', config_name) # metadata metadata_dir = utils.get_dir_path('models', pathfinder.METADATA_PATH) metadata_path = utils.find_model_metadata(metadata_dir, config_name) metadata = utils.load_pkl(metadata_path) expid = metadata['experiment_id'] # logs logs_dir = utils.get_dir_path('logs', pathfinder.METADATA_PATH) sys.stdout = logger.Logger(logs_dir + '/%s-test.log' % expid) sys.stderr = sys.stdout # predictions path predictions_dir = utils.get_dir_path('model-predictions', pathfinder.METADATA_PATH) outputs_path = predictions_dir + '/' + expid utils.auto_make_dir(outputs_path) print 'Build model' model = config().build_model() all_layers = nn.layers.get_all_layers(model.l_out) all_params = nn.layers.get_all_params(model.l_out) num_params = nn.layers.count_params(model.l_out) print ' number of parameters: %d' % num_params print string.ljust(' layer output shapes:', 36), print string.ljust('#params:', 10), print 'output shape:' for layer in all_layers: name = string.ljust(layer.__class__.__name__, 32) num_param = sum([np.prod(p.get_value().shape) for p in layer.get_params()]) num_param = string.ljust(num_param.__str__(), 10) print ' %s %s %s' % (name, num_param, layer.output_shape) nn.layers.set_all_param_values(model.l_out, metadata['param_values']) valid_loss = config().build_objective(model, deterministic=True) x_shared = nn.utils.shared_empty(dim=len(model.l_in.shape)) givens_valid = {} givens_valid[model.l_in.input_var] = x_shared # theano functions iter_get_predictions = theano.function([], nn.layers.get_output(model.l_out, deterministic=True), givens=givens_valid) valid_data_iterator = config().valid_data_iterator print print 'Data' print 'n validation: %d' % valid_data_iterator.nsamples valid_losses_dice = [] tp = 0 for n, (x_chunk, y_chunk, id_chunk) in enumerate(buffering.buffered_gen_threaded(valid_data_iterator.generate())): # load chunk to GPU x_shared.set_value(x_chunk) predictions = iter_get_predictions() targets = y_chunk inputs = x_chunk if predictions.shape != targets.shape: pad_width = (np.asarray(targets.shape) - np.asarray(predictions.shape)) / 2 pad_width = [(p, p) for p in pad_width] predictions = np.pad(predictions, pad_width=pad_width, mode='constant') dice = utils_lung.dice_index(predictions, targets) print n, id_chunk, dice valid_losses_dice.append(dice) if np.sum(predictions * targets) / np.sum(targets) > 0.1: tp += 1 else: print 'not detected!!!!' for k in xrange(predictions.shape[0]): plot_slice_3d_3(input=inputs[k, 0], mask=targets[k, 0], prediction=predictions[k, 0], axis=0, pid='-'.join([str(n), str(k), str(id_chunk[k])]), img_dir=outputs_path) print 'Dice index validation loss', np.mean(valid_losses_dice) print 'TP', tp
[ 1, 529, 9507, 29958, 1688, 29918, 10199, 29918, 5041, 29889, 2272, 13, 5215, 1347, 13, 5215, 10876, 13, 5215, 1869, 5889, 408, 302, 29876, 13, 5215, 12655, 408, 7442, 13, 5215, 278, 1562, 13, 5215, 6835, 292, 13, 5215, 2224, 2886, 261, 13, 5215, 3667, 29879, 13, 3166, 5285, 1053, 2295, 29892, 731, 29918, 13305, 13, 3166, 3667, 29879, 29918, 26762, 1053, 6492, 29918, 18337, 29918, 29941, 29881, 29918, 29941, 13, 5215, 3667, 29879, 29918, 8285, 13, 5215, 17927, 13, 13, 1552, 1562, 29889, 2917, 29889, 25442, 29918, 7411, 29953, 29946, 353, 525, 22692, 29915, 13, 13, 361, 7431, 29898, 9675, 29889, 19218, 29897, 529, 29871, 29906, 29901, 13, 1678, 10876, 29889, 13322, 703, 27573, 29901, 7945, 29889, 2272, 529, 13305, 29918, 978, 29958, 1159, 13, 13, 2917, 29918, 978, 353, 10876, 29889, 19218, 29961, 29896, 29962, 13, 842, 29918, 13305, 877, 2917, 29879, 29918, 10199, 29918, 5041, 742, 2295, 29918, 978, 29897, 13, 13, 29937, 15562, 13, 19635, 29918, 3972, 353, 3667, 29879, 29889, 657, 29918, 3972, 29918, 2084, 877, 9794, 742, 2224, 2886, 261, 29889, 2303, 29911, 3035, 8254, 29918, 10145, 29897, 13, 19635, 29918, 2084, 353, 3667, 29879, 29889, 2886, 29918, 4299, 29918, 19635, 29898, 19635, 29918, 3972, 29892, 2295, 29918, 978, 29897, 13, 13, 19635, 353, 3667, 29879, 29889, 1359, 29918, 29886, 6321, 29898, 19635, 29918, 2084, 29897, 13, 4548, 333, 353, 15562, 1839, 735, 15362, 29918, 333, 2033, 13, 13, 29937, 10748, 13, 20756, 29918, 3972, 353, 3667, 29879, 29889, 657, 29918, 3972, 29918, 2084, 877, 20756, 742, 2224, 2886, 261, 29889, 2303, 29911, 3035, 8254, 29918, 10145, 29897, 13, 9675, 29889, 25393, 353, 17927, 29889, 16363, 29898, 20756, 29918, 3972, 718, 8207, 29995, 29879, 29899, 1688, 29889, 1188, 29915, 1273, 1518, 333, 29897, 13, 9675, 29889, 303, 20405, 353, 10876, 29889, 25393, 13, 13, 29937, 27303, 2224, 13, 27711, 1080, 29918, 3972, 353, 3667, 29879, 29889, 657, 29918, 3972, 29918, 2084, 877, 4299, 29899, 27711, 1080, 742, 2224, 2886, 261, 29889, 2303, 29911, 3035, 8254, 29918, 10145, 29897, 13, 4905, 29879, 29918, 2084, 353, 27303, 29918, 3972, 718, 8207, 29915, 718, 1518, 333, 13, 13239, 29889, 6921, 29918, 5675, 29918, 3972, 29898, 4905, 29879, 29918, 2084, 29897, 13, 13, 2158, 525, 8893, 1904, 29915, 13, 4299, 353, 2295, 2141, 4282, 29918, 4299, 580, 13, 497, 29918, 29277, 353, 302, 29876, 29889, 29277, 29889, 657, 29918, 497, 29918, 29277, 29898, 4299, 29889, 29880, 29918, 449, 29897, 13, 497, 29918, 7529, 353, 302, 29876, 29889, 29277, 29889, 657, 29918, 497, 29918, 7529, 29898, 4299, 29889, 29880, 29918, 449, 29897, 13, 1949, 29918, 7529, 353, 302, 29876, 29889, 29277, 29889, 2798, 29918, 7529, 29898, 4299, 29889, 29880, 29918, 449, 29897, 13, 2158, 525, 29871, 1353, 310, 4128, 29901, 1273, 29881, 29915, 1273, 954, 29918, 7529, 13, 2158, 1347, 29889, 29880, 5143, 877, 29871, 7546, 1962, 25834, 29901, 742, 29871, 29941, 29953, 511, 13, 2158, 1347, 29889, 29880, 5143, 14237, 7529, 29901, 742, 29871, 29896, 29900, 511, 13, 2158, 525, 4905, 8267, 11283, 13, 1454, 7546, 297, 599, 29918, 29277, 29901, 13, 1678, 1024, 353, 1347, 29889, 29880, 5143, 29898, 13148, 17255, 1990, 1649, 17255, 978, 1649, 29892, 29871, 29941, 29906, 29897, 13, 1678, 954, 29918, 3207, 353, 2533, 4197, 9302, 29889, 10633, 29898, 29886, 29889, 657, 29918, 1767, 2141, 12181, 29897, 363, 282, 297, 7546, 29889, 657, 29918, 7529, 580, 2314, 13, 1678, 954, 29918, 3207, 353, 1347, 29889, 29880, 5143, 29898, 1949, 29918, 3207, 17255, 710, 1649, 3285, 29871, 29896, 29900, 29897, 13, 1678, 1596, 525, 1678, 1273, 29879, 1273, 29879, 1273, 29879, 29915, 1273, 313, 978, 29892, 954, 29918, 3207, 29892, 7546, 29889, 4905, 29918, 12181, 29897, 13, 13, 15755, 29889, 29277, 29889, 842, 29918, 497, 29918, 3207, 29918, 5975, 29898, 4299, 29889, 29880, 29918, 449, 29892, 15562, 1839, 3207, 29918, 5975, 11287, 13, 13, 3084, 29918, 6758, 353, 2295, 2141, 4282, 29918, 3318, 573, 29898, 4299, 29892, 11806, 4695, 29922, 5574, 29897, 13, 13, 29916, 29918, 12366, 353, 302, 29876, 29889, 13239, 29889, 12366, 29918, 6310, 29898, 6229, 29922, 2435, 29898, 4299, 29889, 29880, 29918, 262, 29889, 12181, 876, 13, 13, 25624, 575, 29918, 3084, 353, 6571, 13, 25624, 575, 29918, 3084, 29961, 4299, 29889, 29880, 29918, 262, 29889, 2080, 29918, 1707, 29962, 353, 921, 29918, 12366, 13, 13, 29937, 278, 1562, 3168, 13, 1524, 29918, 657, 29918, 27711, 1080, 353, 278, 1562, 29889, 2220, 4197, 1402, 302, 29876, 29889, 29277, 29889, 657, 29918, 4905, 29898, 4299, 29889, 29880, 29918, 449, 29892, 11806, 4695, 29922, 5574, 511, 1517, 575, 29922, 25624, 575, 29918, 3084, 29897, 13, 3084, 29918, 1272, 29918, 17609, 353, 2295, 2141, 3084, 29918, 1272, 29918, 17609, 13, 13, 2158, 13, 2158, 525, 1469, 29915, 13, 2158, 525, 29876, 8845, 29901, 1273, 29881, 29915, 1273, 2854, 29918, 1272, 29918, 17609, 29889, 1983, 9422, 13, 13, 3084, 29918, 6758, 267, 29918, 29881, 625, 353, 5159, 13, 9392, 353, 29871, 29900, 13, 1454, 302, 29892, 313, 29916, 29918, 29812, 29892, 343, 29918, 29812, 29892, 1178, 29918, 29812, 29897, 297, 26985, 29898, 9040, 292, 29889, 9040, 287, 29918, 1885, 29918, 7097, 287, 29898, 3084, 29918, 1272, 29918, 17609, 29889, 17158, 22130, 29901, 13, 1678, 396, 2254, 19875, 304, 22796, 13, 1678, 921, 29918, 12366, 29889, 842, 29918, 1767, 29898, 29916, 29918, 29812, 29897, 13, 1678, 27303, 353, 4256, 29918, 657, 29918, 27711, 1080, 580, 13, 1678, 22525, 353, 343, 29918, 29812, 13, 1678, 10970, 353, 921, 29918, 29812, 13, 13, 1678, 565, 27303, 29889, 12181, 2804, 22525, 29889, 12181, 29901, 13, 4706, 17132, 29918, 2103, 353, 313, 9302, 29889, 294, 2378, 29898, 5182, 29879, 29889, 12181, 29897, 448, 7442, 29889, 294, 2378, 29898, 27711, 1080, 29889, 12181, 876, 847, 29871, 29906, 13, 4706, 17132, 29918, 2103, 353, 17288, 29886, 29892, 282, 29897, 363, 282, 297, 17132, 29918, 2103, 29962, 13, 4706, 27303, 353, 7442, 29889, 8305, 29898, 27711, 1080, 29892, 17132, 29918, 2103, 29922, 8305, 29918, 2103, 29892, 4464, 2433, 23362, 1495, 13, 13, 1678, 17629, 353, 3667, 29879, 29918, 8285, 29889, 29881, 625, 29918, 2248, 29898, 27711, 1080, 29892, 22525, 29897, 13, 1678, 1596, 302, 29892, 1178, 29918, 29812, 29892, 17629, 13, 1678, 2854, 29918, 6758, 267, 29918, 29881, 625, 29889, 4397, 29898, 29881, 625, 29897, 13, 1678, 565, 7442, 29889, 2083, 29898, 27711, 1080, 334, 22525, 29897, 847, 7442, 29889, 2083, 29898, 5182, 29879, 29897, 1405, 29871, 29900, 29889, 29896, 29901, 13, 4706, 260, 29886, 4619, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 1596, 525, 1333, 17809, 6824, 6824, 29915, 13, 13, 1678, 363, 413, 297, 921, 3881, 29898, 27711, 1080, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 6492, 29918, 18337, 29918, 29941, 29881, 29918, 29941, 29898, 2080, 29922, 2080, 29879, 29961, 29895, 29892, 29871, 29900, 1402, 11105, 29922, 5182, 29879, 29961, 29895, 29892, 29871, 29900, 1402, 18988, 29922, 27711, 1080, 29961, 29895, 29892, 29871, 29900, 1402, 13, 462, 4706, 9685, 29922, 29900, 29892, 23107, 2433, 29899, 4286, 7122, 4197, 710, 29898, 29876, 511, 851, 29898, 29895, 511, 851, 29898, 333, 29918, 29812, 29961, 29895, 2314, 11724, 13, 462, 4706, 10153, 29918, 3972, 29922, 4905, 29879, 29918, 2084, 29897, 13, 13, 2158, 525, 29928, 625, 2380, 8845, 6410, 742, 7442, 29889, 12676, 29898, 3084, 29918, 6758, 267, 29918, 29881, 625, 29897, 13, 2158, 525, 3557, 742, 260, 29886, 13, 2 ]
production_system/models.py
rameshgopalakrishnan/v_excel_inventory
0
87006
from django.db import models from people.models import Customer, InternalUser from service_and_process.models import MasterService, MasterProduct, MasterProcess class Order(models.Model): amount = models.DecimalField(max_digits=7, decimal_places=2) customer_id = models.ForeignKey(Customer) expected_timestamp = models.DateTimeField() completed_timestamp = models.DateTimeField() def __str__(self): return "{}".format(self.id) # calculate tax in the invoice # def __str__(self): # return "{}. {}".format(self.id, self.amount) class MasterTag(models.Model): CHOICE = ((1, 'In Use'), (2, 'Free')) status = models.IntegerField(choices=CHOICE) def __str__(self): return "{}. {}".format(self.id, self.status) class Item(models.Model): """Can either be service or product""" service = models.ForeignKey(MasterService, blank=True, null=True) product = models.ForeignKey(MasterProduct, blank=True, null=True) order = models.ForeignKey(Order) tag_id = models.ForeignKey(MasterTag) def __str__(self): return "{}. {}".format(self.id, self.service.label) class MasterRawMaterial(models.Model): CHOICES = ((1, 'piece'), (2, 'kg')) label = models.TextField() unit = models.IntegerField(choices=CHOICES) def __str__(self): return "{}. {}".format( self.id, self.label) class Inventory(models.Model): """Raw materials in purchase""" raw_material = models.ForeignKey(MasterRawMaterial) quantity = models.IntegerField() entry_timestamp = models.DateTimeField(auto_now_add=True) update_timestamp = models.DateTimeField() def __str__(self): return "{}. {}".format(self.id, self.raw_material.label) class Purchase(models.Model): """Get materials from vendor""" raw_material = models.ForeignKey(MasterRawMaterial) vendor = models.TextField() entry_timestamp = models.DateTimeField(auto_now_add=True) price = models.DecimalField(max_digits=9, decimal_places=2) quantity = models.IntegerField() def __str__(self): return "{}. {}. {}".format(self.id, self.raw_material.label, self.vendor) class MappingProductMaterial(models.Model): product = models.ForeignKey(MasterProduct) raw_material = models.ForeignKey(MasterRawMaterial) quantity = models.IntegerField() def __str__(self): return "{}. {}".format(self.id, self.product.label) class Task(models.Model): """User is ironing""" user = models.ForeignKey(InternalUser) process = models.ForeignKey(MasterProcess) item = models.ForeignKey(Item) entry_timestamp = models.DateTimeField(auto_now_add=True) assigned_timestamp = models.DateTimeField() completed_timestamp = models.DateTimeField() is_success = models.BooleanField(default=True) def __str__(self): return "{}. {} - {}".format(self.id, self.user.user.username, self.process.label) class Production(models.Model): PRODUCTION_CHOICE = ((1, 'Training'), (2, 'Actual')) item = models.ForeignKey(Item) product = models.ForeignKey(MasterProduct) entry_timestamp = models.DateTimeField(auto_now_add=True) expected_quantity = models.IntegerField() output_quantity = models.IntegerField(null=True) production_type = models.IntegerField(choices=PRODUCTION_CHOICE) # batch def __str__(self): return "{}. {}".format(self.id, self.production_type) class ProductInventory(models.Model): """Holds the current state of the product (cookies, chocolates) Inventory""" product = models.ForeignKey(MasterProduct) quantity = models.IntegerField() entry_timestamp = models.DateTimeField(auto_now_add=True) update_timestamp = models.DateTimeField() def __str__(self): return "{}. {}".format(self.id, self.product.label) class MappingTrainerTraineeTask(models.Model): task_id = models.ForeignKey('production_system.Task') trainer = models.ForeignKey(InternalUser, related_name='trainer') trainee = models.ForeignKey(InternalUser, related_name='trainee')
[ 1, 515, 9557, 29889, 2585, 1053, 4733, 13, 13, 3166, 2305, 29889, 9794, 1053, 21886, 29892, 512, 1890, 2659, 13, 3166, 2669, 29918, 392, 29918, 5014, 29889, 9794, 1053, 9082, 3170, 29892, 9082, 7566, 29892, 9082, 7032, 13, 13, 13, 1990, 8170, 29898, 9794, 29889, 3195, 1125, 13, 13, 1678, 5253, 353, 4733, 29889, 23307, 3073, 29898, 3317, 29918, 7501, 1169, 29922, 29955, 29892, 13677, 29918, 29886, 6048, 29922, 29906, 29897, 13, 1678, 11962, 29918, 333, 353, 4733, 29889, 27755, 2558, 29898, 15122, 29897, 13, 1678, 3806, 29918, 16394, 353, 4733, 29889, 11384, 3073, 580, 13, 1678, 8676, 29918, 16394, 353, 4733, 29889, 11384, 3073, 580, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 376, 8875, 1642, 4830, 29898, 1311, 29889, 333, 29897, 13, 1678, 396, 8147, 8818, 297, 278, 297, 14917, 13, 13, 1678, 396, 822, 4770, 710, 12035, 1311, 1125, 13, 1678, 396, 268, 736, 29850, 1836, 6571, 1642, 4830, 29898, 1311, 29889, 333, 29892, 1583, 29889, 14506, 29897, 13, 13, 1990, 9082, 8176, 29898, 9794, 29889, 3195, 1125, 13, 1678, 5868, 29949, 12107, 353, 5135, 29896, 29892, 525, 797, 4803, 5477, 13, 795, 313, 29906, 29892, 525, 20475, 8785, 13, 1678, 4660, 353, 4733, 29889, 7798, 3073, 29898, 1859, 1575, 29922, 3210, 29949, 12107, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 29850, 1836, 6571, 1642, 4830, 29898, 1311, 29889, 333, 29892, 1583, 29889, 4882, 29897, 13, 13, 1990, 10976, 29898, 9794, 29889, 3195, 1125, 13, 1678, 9995, 6028, 2845, 367, 2669, 470, 3234, 15945, 29908, 13, 13, 1678, 2669, 353, 4733, 29889, 27755, 2558, 29898, 19203, 3170, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 3234, 353, 4733, 29889, 27755, 2558, 29898, 19203, 7566, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 1797, 353, 4733, 29889, 27755, 2558, 29898, 7514, 29897, 13, 1678, 4055, 29918, 333, 353, 4733, 29889, 27755, 2558, 29898, 19203, 8176, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 29850, 1836, 6571, 1642, 4830, 29898, 1311, 29889, 333, 29892, 1583, 29889, 5509, 29889, 1643, 29897, 13, 13, 1990, 9082, 22131, 24095, 29898, 9794, 29889, 3195, 1125, 13, 13, 1678, 5868, 29949, 2965, 2890, 353, 5135, 29896, 29892, 525, 12343, 346, 5477, 13, 1669, 313, 29906, 29892, 525, 9415, 8785, 13, 13, 1678, 3858, 353, 4733, 29889, 15778, 580, 13, 1678, 5190, 353, 4733, 29889, 7798, 3073, 29898, 1859, 1575, 29922, 3210, 29949, 2965, 2890, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 29850, 1836, 6571, 1642, 4830, 29898, 1583, 29889, 333, 29892, 1583, 29889, 1643, 29897, 13, 13, 1990, 512, 23886, 29898, 9794, 29889, 3195, 1125, 13, 1678, 9995, 22131, 17279, 297, 20590, 15945, 29908, 13, 13, 1678, 10650, 29918, 15388, 353, 4733, 29889, 27755, 2558, 29898, 19203, 22131, 24095, 29897, 13, 1678, 14728, 353, 4733, 29889, 7798, 3073, 580, 13, 1678, 6251, 29918, 16394, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 2767, 29918, 16394, 353, 4733, 29889, 11384, 3073, 580, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 29850, 1836, 6571, 1642, 4830, 29898, 1311, 29889, 333, 29892, 1583, 29889, 1610, 29918, 15388, 29889, 1643, 29897, 13, 13, 1990, 349, 27574, 29898, 9794, 29889, 3195, 1125, 13, 1678, 9995, 2577, 17279, 515, 27042, 15945, 29908, 13, 13, 1678, 10650, 29918, 15388, 353, 4733, 29889, 27755, 2558, 29898, 19203, 22131, 24095, 29897, 13, 1678, 27042, 353, 4733, 29889, 15778, 580, 13, 1678, 6251, 29918, 16394, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 8666, 353, 4733, 29889, 23307, 3073, 29898, 3317, 29918, 7501, 1169, 29922, 29929, 29892, 13677, 29918, 29886, 6048, 29922, 29906, 29897, 13, 1678, 14728, 353, 4733, 29889, 7798, 3073, 580, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 29850, 1836, 426, 1836, 6571, 1642, 4830, 29898, 1311, 29889, 333, 29892, 1583, 29889, 1610, 29918, 15388, 29889, 1643, 29892, 1583, 29889, 19167, 29897, 13, 13, 1990, 341, 20304, 7566, 24095, 29898, 9794, 29889, 3195, 1125, 13, 13, 1678, 3234, 353, 4733, 29889, 27755, 2558, 29898, 19203, 7566, 29897, 13, 1678, 10650, 29918, 15388, 353, 4733, 29889, 27755, 2558, 29898, 19203, 22131, 24095, 29897, 13, 1678, 14728, 353, 4733, 29889, 7798, 3073, 580, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 29850, 1836, 6571, 1642, 4830, 29898, 1311, 29889, 333, 29892, 1583, 29889, 4704, 29889, 1643, 29897, 13, 13, 1990, 9330, 29898, 9794, 29889, 3195, 1125, 13, 1678, 9995, 2659, 338, 13977, 292, 15945, 29908, 13, 13, 1678, 1404, 353, 4733, 29889, 27755, 2558, 29898, 16491, 2659, 29897, 13, 1678, 1889, 353, 4733, 29889, 27755, 2558, 29898, 19203, 7032, 29897, 13, 1678, 2944, 353, 4733, 29889, 27755, 2558, 29898, 2001, 29897, 13, 1678, 6251, 29918, 16394, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 9859, 29918, 16394, 353, 4733, 29889, 11384, 3073, 580, 13, 1678, 8676, 29918, 16394, 353, 4733, 29889, 11384, 3073, 580, 13, 1678, 338, 29918, 8698, 353, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 5574, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 29850, 1836, 6571, 448, 6571, 1642, 4830, 29898, 1311, 29889, 333, 29892, 1583, 29889, 1792, 29889, 1792, 29889, 6786, 29892, 1583, 29889, 5014, 29889, 1643, 29897, 13, 13, 13, 1990, 19561, 29898, 9794, 29889, 3195, 1125, 13, 1678, 13756, 14849, 9838, 29918, 3210, 29949, 12107, 353, 5135, 29896, 29892, 525, 5323, 2827, 5477, 13, 462, 308, 313, 29906, 29892, 525, 2865, 950, 8785, 13, 13, 1678, 2944, 353, 4733, 29889, 27755, 2558, 29898, 2001, 29897, 13, 1678, 3234, 353, 4733, 29889, 27755, 2558, 29898, 19203, 7566, 29897, 13, 1678, 6251, 29918, 16394, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 3806, 29918, 22640, 353, 4733, 29889, 7798, 3073, 580, 13, 1678, 1962, 29918, 22640, 353, 4733, 29889, 7798, 3073, 29898, 4304, 29922, 5574, 29897, 13, 1678, 5802, 29918, 1853, 353, 4733, 29889, 7798, 3073, 29898, 1859, 1575, 29922, 8618, 14849, 9838, 29918, 3210, 29949, 12107, 29897, 13, 1678, 396, 9853, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 29850, 1836, 6571, 1642, 4830, 29898, 1311, 29889, 333, 29892, 1583, 29889, 24601, 29918, 1853, 29897, 13, 13, 1990, 10969, 797, 23886, 29898, 9794, 29889, 3195, 1125, 13, 1678, 9995, 29950, 3361, 278, 1857, 2106, 310, 278, 3234, 313, 15108, 583, 29892, 521, 542, 324, 1078, 29897, 512, 23886, 15945, 29908, 13, 1678, 3234, 353, 4733, 29889, 27755, 2558, 29898, 19203, 7566, 29897, 13, 1678, 14728, 353, 4733, 29889, 7798, 3073, 580, 13, 1678, 6251, 29918, 16394, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 2767, 29918, 16394, 353, 4733, 29889, 11384, 3073, 580, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 29850, 1836, 6571, 1642, 4830, 29898, 1311, 29889, 333, 29892, 1583, 29889, 4704, 29889, 1643, 29897, 13, 13, 1990, 341, 20304, 5323, 4983, 5323, 457, 29872, 5398, 29898, 9794, 29889, 3195, 1125, 13, 13, 1678, 3414, 29918, 333, 353, 4733, 29889, 27755, 2558, 877, 24601, 29918, 5205, 29889, 5398, 1495, 13, 1678, 1020, 4983, 353, 4733, 29889, 27755, 2558, 29898, 16491, 2659, 29892, 4475, 29918, 978, 2433, 3018, 4983, 1495, 13, 1678, 1020, 457, 29872, 353, 4733, 29889, 27755, 2558, 29898, 16491, 2659, 29892, 4475, 29918, 978, 2433, 3018, 457, 29872, 1495, 13, 2 ]
website/message/views.py
m3alamin/message-system
1
99037
from django.shortcuts import render, redirect from .models import Message, Reply, Reader from .forms import MessageForm, ReplyForm from pprint import pprint from django.contrib.auth.models import User from datetime import datetime # Create your views here. def index(request): if request.user.is_authenticated: messages = Message.objects.filter(recipient=request.user.id) ccMessages = Reader.objects.filter(cc=request.user.id) logged_in = True else: messages = [] ccMessages = [] logged_in = False return render(request, 'index.html', { 'title': 'Message System inbox', 'messages': messages, 'ccMessages': ccMessages, 'logged_in': logged_in }) def send(request): if request.user.is_authenticated: logged_in = True else: logged_in = False if request.method == 'POST': form = MessageForm(request.POST) if form.is_valid(): # message = form.save(commit=False) # message.sender = request.user # message.save() message = Message() message.subject = form.cleaned_data['subject'] message.message = form.cleaned_data['message'] message.sender = request.user recipient = form.cleaned_data['recipient'] message.recipient = recipient message.created_at = datetime.now() message.save() ccUsers = form.cleaned_data['cc'] for cc in ccUsers: if recipient == cc: continue reader = Reader() reader.cc = cc reader.message = message reader.save() return redirect('/read/{}'.format(message.pk)) else: form = MessageForm() return render(request, 'send.html', { 'title': 'Send Message', 'form': form, 'logged_in': logged_in }) def read(request, id): if request.user.is_authenticated: logged_in = True else: logged_in = False title = "Read message" message = Message.objects.get(pk=id) if message and message.subject: title = message.subject replies = Reply.objects.filter(message=message) can_replay = False if message.recipient == request.user or message.sender == request.user: can_replay = True if request.method == 'POST': form = ReplyForm(request.POST) if form.is_valid(): reply = form.save(commit=False) reply.message = message reply.author = request.user reply.save() else: form = ReplyForm() return render(request, 'read.html', { 'title': title, 'message': message, 'form': form, 'replies': replies, 'can_replay': can_replay, 'logged_in': logged_in })
[ 1, 515, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 29892, 6684, 13, 3166, 869, 9794, 1053, 7777, 29892, 10088, 368, 29892, 830, 1664, 13, 3166, 869, 9514, 1053, 7777, 2500, 29892, 10088, 368, 2500, 13, 3166, 282, 2158, 1053, 282, 2158, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 3166, 12865, 1053, 12865, 13, 13, 13, 29937, 6204, 596, 8386, 1244, 29889, 13, 1753, 2380, 29898, 3827, 1125, 13, 13, 1678, 565, 2009, 29889, 1792, 29889, 275, 29918, 27218, 630, 29901, 13, 4706, 7191, 353, 7777, 29889, 12650, 29889, 4572, 29898, 4361, 29886, 993, 29922, 3827, 29889, 1792, 29889, 333, 29897, 13, 4706, 21759, 25510, 353, 830, 1664, 29889, 12650, 29889, 4572, 29898, 617, 29922, 3827, 29889, 1792, 29889, 333, 29897, 13, 4706, 13817, 29918, 262, 353, 5852, 13, 1678, 1683, 29901, 13, 4706, 7191, 353, 5159, 13, 4706, 21759, 25510, 353, 5159, 13, 4706, 13817, 29918, 262, 353, 7700, 13, 13, 1678, 736, 4050, 29898, 3827, 29892, 525, 2248, 29889, 1420, 742, 426, 13, 4706, 525, 3257, 2396, 525, 3728, 2184, 297, 1884, 742, 13, 4706, 525, 19158, 2396, 7191, 29892, 13, 4706, 525, 617, 25510, 2396, 21759, 25510, 29892, 13, 4706, 525, 1188, 3192, 29918, 262, 2396, 13817, 29918, 262, 13, 1678, 5615, 13, 13, 13, 1753, 3638, 29898, 3827, 1125, 13, 1678, 565, 2009, 29889, 1792, 29889, 275, 29918, 27218, 630, 29901, 13, 4706, 13817, 29918, 262, 353, 5852, 13, 1678, 1683, 29901, 13, 4706, 13817, 29918, 262, 353, 7700, 13, 13, 1678, 565, 2009, 29889, 5696, 1275, 525, 5438, 2396, 13, 4706, 883, 353, 7777, 2500, 29898, 3827, 29889, 5438, 29897, 13, 4706, 565, 883, 29889, 275, 29918, 3084, 7295, 13, 9651, 396, 2643, 353, 883, 29889, 7620, 29898, 15060, 29922, 8824, 29897, 13, 9651, 396, 2643, 29889, 15452, 353, 2009, 29889, 1792, 13, 9651, 396, 2643, 29889, 7620, 580, 13, 9651, 2643, 353, 7777, 580, 13, 9651, 2643, 29889, 16009, 353, 883, 29889, 14941, 287, 29918, 1272, 1839, 16009, 2033, 13, 9651, 2643, 29889, 4906, 353, 883, 29889, 14941, 287, 29918, 1272, 1839, 4906, 2033, 13, 9651, 2643, 29889, 15452, 353, 2009, 29889, 1792, 13, 9651, 23957, 993, 353, 883, 29889, 14941, 287, 29918, 1272, 1839, 4361, 29886, 993, 2033, 13, 9651, 2643, 29889, 4361, 29886, 993, 353, 23957, 993, 13, 9651, 2643, 29889, 11600, 29918, 271, 353, 12865, 29889, 3707, 580, 13, 9651, 2643, 29889, 7620, 580, 13, 13, 9651, 21759, 5959, 353, 883, 29889, 14941, 287, 29918, 1272, 1839, 617, 2033, 13, 9651, 363, 21759, 297, 21759, 5959, 29901, 13, 18884, 565, 23957, 993, 1275, 21759, 29901, 13, 462, 1678, 6773, 13, 18884, 9591, 353, 830, 1664, 580, 13, 18884, 9591, 29889, 617, 353, 21759, 13, 18884, 9591, 29889, 4906, 353, 2643, 13, 18884, 9591, 29889, 7620, 580, 13, 13, 9651, 736, 6684, 11219, 949, 29914, 8875, 4286, 4830, 29898, 4906, 29889, 20571, 876, 13, 1678, 1683, 29901, 13, 4706, 883, 353, 7777, 2500, 580, 13, 1678, 736, 4050, 29898, 3827, 29892, 525, 6717, 29889, 1420, 742, 426, 13, 4706, 525, 3257, 2396, 525, 12600, 7777, 742, 13, 4706, 525, 689, 2396, 883, 29892, 13, 4706, 525, 1188, 3192, 29918, 262, 2396, 13817, 29918, 262, 13, 1678, 5615, 13, 13, 13, 1753, 1303, 29898, 3827, 29892, 1178, 1125, 13, 1678, 565, 2009, 29889, 1792, 29889, 275, 29918, 27218, 630, 29901, 13, 4706, 13817, 29918, 262, 353, 5852, 13, 1678, 1683, 29901, 13, 4706, 13817, 29918, 262, 353, 7700, 13, 13, 1678, 3611, 353, 376, 6359, 2643, 29908, 13, 13, 1678, 2643, 353, 7777, 29889, 12650, 29889, 657, 29898, 20571, 29922, 333, 29897, 13, 1678, 565, 2643, 322, 2643, 29889, 16009, 29901, 13, 4706, 3611, 353, 2643, 29889, 16009, 13, 13, 1678, 1634, 3687, 353, 10088, 368, 29889, 12650, 29889, 4572, 29898, 4906, 29922, 4906, 29897, 13, 1678, 508, 29918, 276, 1456, 353, 7700, 13, 13, 1678, 565, 2643, 29889, 4361, 29886, 993, 1275, 2009, 29889, 1792, 470, 2643, 29889, 15452, 1275, 2009, 29889, 1792, 29901, 13, 4706, 508, 29918, 276, 1456, 353, 5852, 13, 13, 1678, 565, 2009, 29889, 5696, 1275, 525, 5438, 2396, 13, 4706, 883, 353, 10088, 368, 2500, 29898, 3827, 29889, 5438, 29897, 13, 4706, 565, 883, 29889, 275, 29918, 3084, 7295, 13, 9651, 8908, 353, 883, 29889, 7620, 29898, 15060, 29922, 8824, 29897, 13, 9651, 8908, 29889, 4906, 353, 2643, 13, 9651, 8908, 29889, 8921, 353, 2009, 29889, 1792, 13, 9651, 8908, 29889, 7620, 580, 13, 1678, 1683, 29901, 13, 4706, 883, 353, 10088, 368, 2500, 580, 13, 13, 13, 1678, 736, 4050, 29898, 3827, 29892, 525, 949, 29889, 1420, 742, 426, 13, 4706, 525, 3257, 2396, 3611, 29892, 13, 4706, 525, 4906, 2396, 2643, 29892, 13, 4706, 525, 689, 2396, 883, 29892, 13, 4706, 525, 3445, 3687, 2396, 1634, 3687, 29892, 13, 4706, 525, 3068, 29918, 276, 1456, 2396, 508, 29918, 276, 1456, 29892, 13, 4706, 525, 1188, 3192, 29918, 262, 2396, 13817, 29918, 262, 13, 1678, 5615, 13, 2 ]
tests/optims/distributed_adamw_test.py
AswinRetnakumar/Machina
302
522
import os import unittest import torch import torch.distributed as dist from torch.multiprocessing import Process import torch.nn as nn from machina.optims import DistributedAdamW def init_processes(rank, world_size, function, backend='tcp'): os.environ['MASTER_ADDR'] = '127.0.0.1' os.environ['MASTER_PORT'] = '29500' dist.init_process_group(backend, rank=rank, world_size=world_size) function(rank, world_size) class TestDistributedAdamW(unittest.TestCase): def test_step(self): def _run(rank, world_size): model = nn.Linear(10, 1) optimizer = DistributedAdamW( model.parameters()) optimizer.zero_grad() loss = model(torch.ones(10).float()) loss.backward() optimizer.step() processes = [] world_size = 4 for rank in range(world_size): p = Process(target=init_processes, args=(rank, world_size, _run)) p.start() processes.append(p) for p in processes: p.join()
[ 1, 1053, 2897, 13, 5215, 443, 27958, 13, 13, 5215, 4842, 305, 13, 5215, 4842, 305, 29889, 5721, 7541, 408, 1320, 13, 3166, 4842, 305, 29889, 18056, 307, 985, 292, 1053, 10554, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 13, 3166, 7672, 1099, 29889, 3670, 9893, 1053, 6652, 7541, 3253, 314, 29956, 13, 13, 13, 1753, 2069, 29918, 5014, 267, 29898, 10003, 29892, 3186, 29918, 2311, 29892, 13, 462, 259, 740, 29892, 14998, 2433, 23981, 29374, 13, 1678, 2897, 29889, 21813, 1839, 1529, 1254, 1001, 29918, 3035, 8353, 2033, 353, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29915, 13, 1678, 2897, 29889, 21813, 1839, 1529, 1254, 1001, 29918, 15082, 2033, 353, 525, 29906, 29929, 29945, 29900, 29900, 29915, 13, 1678, 1320, 29889, 2344, 29918, 5014, 29918, 2972, 29898, 27852, 29892, 7115, 29922, 10003, 29892, 13, 462, 9651, 3186, 29918, 2311, 29922, 11526, 29918, 2311, 29897, 13, 1678, 740, 29898, 10003, 29892, 3186, 29918, 2311, 29897, 13, 13, 13, 1990, 4321, 13398, 7541, 3253, 314, 29956, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 13, 1678, 822, 1243, 29918, 10568, 29898, 1311, 1125, 13, 13, 4706, 822, 903, 3389, 29898, 10003, 29892, 3186, 29918, 2311, 1125, 13, 9651, 1904, 353, 302, 29876, 29889, 12697, 29898, 29896, 29900, 29892, 29871, 29896, 29897, 13, 9651, 5994, 3950, 353, 6652, 7541, 3253, 314, 29956, 29898, 13, 18884, 1904, 29889, 16744, 3101, 13, 13, 9651, 5994, 3950, 29889, 9171, 29918, 5105, 580, 13, 9651, 6410, 353, 1904, 29898, 7345, 305, 29889, 2873, 29898, 29896, 29900, 467, 7411, 3101, 13, 9651, 6410, 29889, 1627, 1328, 580, 13, 9651, 5994, 3950, 29889, 10568, 580, 13, 13, 4706, 10174, 353, 5159, 13, 4706, 3186, 29918, 2311, 353, 29871, 29946, 13, 4706, 363, 7115, 297, 3464, 29898, 11526, 29918, 2311, 1125, 13, 9651, 282, 353, 10554, 29898, 5182, 29922, 2344, 29918, 5014, 267, 29892, 13, 462, 4706, 6389, 7607, 10003, 29892, 13, 462, 795, 3186, 29918, 2311, 29892, 13, 462, 795, 903, 3389, 876, 13, 9651, 282, 29889, 2962, 580, 13, 9651, 10174, 29889, 4397, 29898, 29886, 29897, 13, 4706, 363, 282, 297, 10174, 29901, 13, 9651, 282, 29889, 7122, 580, 13, 2 ]
snakeoil/migrations/0001_initial.py
wbcsmarteezgithub/django-snakeoil
1
34092
# Generated by Django 2.2 on 2020-03-30 15:03 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='SeoUrl', fields=[ ('head_title', models.CharField(blank=True, max_length=55, verbose_name='head title')), ('meta_description', models.TextField(blank=True, max_length=160, verbose_name='meta description')), ('url', models.CharField(max_length=255, primary_key=True, serialize=False, unique=True, verbose_name='URL')), ], options={ 'verbose_name': 'SEO URL', 'verbose_name_plural': 'SEO URLs', }, ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29906, 373, 29871, 29906, 29900, 29906, 29900, 29899, 29900, 29941, 29899, 29941, 29900, 29871, 29896, 29945, 29901, 29900, 29941, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 2847, 353, 5852, 13, 13, 1678, 9962, 353, 518, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 2008, 29877, 5983, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 2813, 29918, 3257, 742, 4733, 29889, 27890, 29898, 19465, 29922, 5574, 29892, 4236, 29918, 2848, 29922, 29945, 29945, 29892, 26952, 29918, 978, 2433, 2813, 3611, 1495, 511, 13, 18884, 6702, 7299, 29918, 8216, 742, 4733, 29889, 15778, 29898, 19465, 29922, 5574, 29892, 4236, 29918, 2848, 29922, 29896, 29953, 29900, 29892, 26952, 29918, 978, 2433, 7299, 6139, 1495, 511, 13, 18884, 6702, 2271, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 29892, 5412, 29922, 5574, 29892, 26952, 29918, 978, 2433, 4219, 1495, 511, 13, 9651, 21251, 13, 9651, 3987, 3790, 13, 18884, 525, 369, 15828, 29918, 978, 2396, 525, 1660, 29949, 3988, 742, 13, 18884, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 1660, 29949, 24295, 742, 13, 9651, 2981, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
orthoexon/tests/test_util.py
jessicalettes/orthoexon
0
3559
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_orthoexon ---------------------------------- Tests for `orthoexon` module. """ import os import pytest @pytest.fixture def exon_id_with_quotes(): return "'ENSE00001229068.1'" @pytest.fixture def exon_id(): return "ENSE00001229068.1" def test_separate_with_quotes(exon_id_with_quotes): from orthoexon.util import separate test = separate(exon_id_with_quotes) true = "ENSE00001229068" assert test == true def test_separate(exon_id): from orthoexon.util import separate test = separate(exon_id) true = "ENSE00001229068" assert test == true @pytest.fixture def location(): return "chr20:10256140-10256211:+:0" def test_splitstart(location): from orthoexon.util import splitstart test = splitstart(location) true = '10256140' assert test == true def test_splitend(location): from orthoexon.util import splitend test = splitend(location) true = '10256211' assert test == true @pytest.fixture def human_gtf_filename(table_folder): return os.path.join(table_folder, 'humanrbfox2andfmr1andsnap25.gtf') @pytest.fixture def human_gtf_database(table_folder): return os.path.join(table_folder, 'humanrbfox2andfmr1andsnap25.gtf.db') @pytest.fixture def human_fasta(table_folder): return os.path.join(table_folder, 'GRCm38.p3.genome.fa') def test_translate(exon_id, human_fasta, human_gtf_database): from orthoexon.util import translate from orthoexon.util import separate for index, species1gene in enumerate(human_gtf_database.features_of_type('gene')): species1gffutilsgeneid = str(species1gene['gene_id']) species1geneid = separate(species1gffutilsgeneid) for exon in human_gtf_database.children(species1geneid, featuretype='CDS', order_by='start'): if exon_id == exon: test = translate(exon, human_fasta) break break true = 'MAEDADMRNELEEMQRRADQLADE' assert test == true # def test_getsequence(exon, human_gtf_database): # from orthoexon.util import getsequence # # test = getsequence(exon, human_gtf_database) # true = 'ATGGCCGAAGACGCAGACATGCGCAATGAGCTGGAGGAGATGCAGCGAAGGGCTGACCAGTT' \ # 'GGCTGATGAG' # # assert test == true # def test_make_sequence_array(finalsequencedf): # from orthoexon.util import make_sequence_array # # test = make_sequence_array(finalsequencedf) # true = ...... # # assert test == true
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 15945, 29908, 13, 1688, 29918, 2072, 29877, 735, 265, 13, 2683, 2683, 489, 13, 13, 24376, 363, 421, 2072, 29877, 735, 265, 29952, 3883, 29889, 13, 15945, 29908, 13, 5215, 2897, 13, 5215, 11451, 1688, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 429, 265, 29918, 333, 29918, 2541, 29918, 339, 4769, 7295, 13, 1678, 736, 13577, 1430, 1660, 29900, 29900, 29900, 29900, 29896, 29906, 29906, 29929, 29900, 29953, 29947, 29889, 29896, 11838, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 429, 265, 29918, 333, 7295, 13, 1678, 736, 376, 1430, 1660, 29900, 29900, 29900, 29900, 29896, 29906, 29906, 29929, 29900, 29953, 29947, 29889, 29896, 29908, 13, 13, 1753, 1243, 29918, 25048, 403, 29918, 2541, 29918, 339, 4769, 29898, 735, 265, 29918, 333, 29918, 2541, 29918, 339, 4769, 1125, 13, 1678, 515, 14219, 29877, 735, 265, 29889, 4422, 1053, 5004, 13, 13, 1678, 1243, 353, 5004, 29898, 735, 265, 29918, 333, 29918, 2541, 29918, 339, 4769, 29897, 13, 1678, 1565, 353, 376, 1430, 1660, 29900, 29900, 29900, 29900, 29896, 29906, 29906, 29929, 29900, 29953, 29947, 29908, 13, 13, 1678, 4974, 1243, 1275, 1565, 13, 13, 13, 13, 1753, 1243, 29918, 25048, 403, 29898, 735, 265, 29918, 333, 1125, 13, 1678, 515, 14219, 29877, 735, 265, 29889, 4422, 1053, 5004, 13, 13, 1678, 1243, 353, 5004, 29898, 735, 265, 29918, 333, 29897, 13, 1678, 1565, 353, 376, 1430, 1660, 29900, 29900, 29900, 29900, 29896, 29906, 29906, 29929, 29900, 29953, 29947, 29908, 13, 13, 1678, 4974, 1243, 1275, 1565, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 4423, 7295, 13, 1678, 736, 376, 22495, 29906, 29900, 29901, 29896, 29900, 29906, 29945, 29953, 29896, 29946, 29900, 29899, 29896, 29900, 29906, 29945, 29953, 29906, 29896, 29896, 29901, 29974, 29901, 29900, 29908, 13, 13, 1753, 1243, 29918, 5451, 2962, 29898, 5479, 1125, 13, 1678, 515, 14219, 29877, 735, 265, 29889, 4422, 1053, 6219, 2962, 13, 13, 1678, 1243, 353, 6219, 2962, 29898, 5479, 29897, 13, 1678, 1565, 353, 525, 29896, 29900, 29906, 29945, 29953, 29896, 29946, 29900, 29915, 13, 13, 1678, 4974, 1243, 1275, 1565, 13, 13, 13, 1753, 1243, 29918, 5451, 355, 29898, 5479, 1125, 13, 1678, 515, 14219, 29877, 735, 265, 29889, 4422, 1053, 6219, 355, 13, 13, 1678, 1243, 353, 6219, 355, 29898, 5479, 29897, 13, 1678, 1565, 353, 525, 29896, 29900, 29906, 29945, 29953, 29906, 29896, 29896, 29915, 13, 13, 1678, 4974, 1243, 1275, 1565, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 5199, 29918, 4141, 29888, 29918, 9507, 29898, 2371, 29918, 12083, 1125, 13, 1678, 736, 2897, 29889, 2084, 29889, 7122, 29898, 2371, 29918, 12083, 29892, 525, 26029, 6050, 8944, 29906, 392, 24826, 29878, 29896, 4167, 8971, 29906, 29945, 29889, 4141, 29888, 1495, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 5199, 29918, 4141, 29888, 29918, 9803, 29898, 2371, 29918, 12083, 1125, 13, 1678, 736, 2897, 29889, 2084, 29889, 7122, 29898, 2371, 29918, 12083, 29892, 525, 26029, 6050, 8944, 29906, 392, 24826, 29878, 29896, 4167, 8971, 29906, 29945, 29889, 4141, 29888, 29889, 2585, 1495, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 5199, 29918, 29888, 5427, 29898, 2371, 29918, 12083, 1125, 13, 1678, 736, 2897, 29889, 2084, 29889, 7122, 29898, 2371, 29918, 12083, 29892, 525, 29954, 10363, 29885, 29941, 29947, 29889, 29886, 29941, 29889, 1885, 608, 29889, 5444, 1495, 13, 13, 1753, 1243, 29918, 21652, 29898, 735, 265, 29918, 333, 29892, 5199, 29918, 29888, 5427, 29892, 5199, 29918, 4141, 29888, 29918, 9803, 1125, 13, 1678, 515, 14219, 29877, 735, 265, 29889, 4422, 1053, 14240, 13, 1678, 515, 14219, 29877, 735, 265, 29889, 4422, 1053, 5004, 13, 1678, 363, 2380, 29892, 6606, 29896, 29887, 1600, 297, 26985, 29898, 26029, 29918, 4141, 29888, 29918, 9803, 29889, 22100, 29918, 974, 29918, 1853, 877, 29887, 1600, 8785, 29901, 13, 4706, 6606, 29896, 29887, 600, 13239, 29887, 1600, 333, 353, 851, 29898, 24091, 29896, 29887, 1600, 1839, 29887, 1600, 29918, 333, 11287, 13, 4706, 6606, 29896, 29887, 1600, 333, 353, 5004, 29898, 24091, 29896, 29887, 600, 13239, 29887, 1600, 333, 29897, 13, 13, 4706, 363, 429, 265, 297, 5199, 29918, 4141, 29888, 29918, 9803, 29889, 11991, 29898, 24091, 29896, 29887, 1600, 333, 29892, 13, 462, 462, 18884, 4682, 1853, 2433, 6530, 29903, 742, 13, 462, 462, 18884, 1797, 29918, 1609, 2433, 2962, 29374, 13, 9651, 565, 429, 265, 29918, 333, 1275, 429, 265, 29901, 13, 18884, 1243, 353, 14240, 29898, 735, 265, 29892, 5199, 29918, 29888, 5427, 29897, 13, 9651, 2867, 13, 4706, 2867, 13, 1678, 1565, 353, 525, 1529, 3352, 3035, 21055, 8186, 1307, 12665, 29984, 29934, 29934, 3035, 2239, 29909, 2287, 29915, 13, 1678, 4974, 1243, 1275, 1565, 13, 13, 13, 13, 29937, 822, 1243, 29918, 657, 16506, 29898, 735, 265, 29892, 5199, 29918, 4141, 29888, 29918, 9803, 1125, 13, 29937, 268, 515, 14219, 29877, 735, 265, 29889, 4422, 1053, 679, 16506, 13, 29937, 13, 29937, 268, 1243, 353, 679, 16506, 29898, 735, 265, 29892, 5199, 29918, 4141, 29888, 29918, 9803, 29897, 13, 29937, 268, 1565, 353, 525, 1299, 26788, 4174, 29954, 6344, 29954, 2477, 29954, 5454, 29954, 2477, 1299, 8766, 29954, 5454, 1299, 29954, 10051, 1783, 26788, 10051, 29954, 10051, 1299, 29954, 5454, 8766, 29954, 6344, 26788, 29954, 1783, 29954, 2477, 5454, 29954, 19988, 29915, 320, 13, 29937, 9651, 525, 26788, 1783, 29954, 1299, 29954, 10051, 29915, 13, 29937, 13, 29937, 268, 4974, 1243, 1275, 1565, 13, 13, 29937, 822, 1243, 29918, 5675, 29918, 16506, 29918, 2378, 29898, 8394, 6831, 9223, 29888, 1125, 13, 29937, 268, 515, 14219, 29877, 735, 265, 29889, 4422, 1053, 1207, 29918, 16506, 29918, 2378, 13, 29937, 13, 29937, 268, 1243, 353, 1207, 29918, 16506, 29918, 2378, 29898, 8394, 6831, 9223, 29888, 29897, 13, 29937, 268, 1565, 353, 13035, 636, 13, 29937, 13, 29937, 268, 4974, 1243, 1275, 1565, 2 ]
Python/powx-n.py
xtt129/LeetCode
2
87459
<gh_stars>1-10 # Time: O(logn) # Space: O(logn) # # Implement pow(x, n). # class Solution: # @param x, a float # @param n, a integer # @return a float def pow(self, x, n): if n < 0: return 1 / self.powRecu(x, -n) return self.powRecu(x, n) def powRecu(self, x, n): if n == 0: return 1.0 if n % 2 == 0: return self.powRecu(x * x, n / 2) else: return x * self.powRecu(x * x, n / 2) if __name__ == "__main__": print Solution().pow(3, 5) print Solution().pow(3, -5)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 5974, 29901, 29871, 438, 29898, 1188, 29876, 29897, 13, 29937, 14121, 29901, 438, 29898, 1188, 29876, 29897, 13, 29937, 29871, 13, 29937, 1954, 2037, 4764, 29898, 29916, 29892, 302, 467, 13, 29937, 13, 13, 1990, 24380, 29901, 13, 1678, 396, 732, 3207, 921, 29892, 263, 5785, 13, 1678, 396, 732, 3207, 302, 29892, 263, 6043, 13, 1678, 396, 732, 2457, 263, 5785, 13, 1678, 822, 4764, 29898, 1311, 29892, 921, 29892, 302, 1125, 13, 4706, 565, 302, 529, 29871, 29900, 29901, 13, 9651, 736, 29871, 29896, 847, 1583, 29889, 12248, 4789, 29884, 29898, 29916, 29892, 448, 29876, 29897, 13, 308, 13, 4706, 736, 1583, 29889, 12248, 4789, 29884, 29898, 29916, 29892, 302, 29897, 13, 268, 13, 1678, 822, 4764, 4789, 29884, 29898, 1311, 29892, 921, 29892, 302, 1125, 13, 4706, 565, 302, 1275, 29871, 29900, 29901, 13, 9651, 736, 29871, 29896, 29889, 29900, 13, 308, 13, 4706, 565, 302, 1273, 29871, 29906, 1275, 29871, 29900, 29901, 13, 9651, 736, 1583, 29889, 12248, 4789, 29884, 29898, 29916, 334, 921, 29892, 302, 847, 29871, 29906, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 921, 334, 1583, 29889, 12248, 4789, 29884, 29898, 29916, 334, 921, 29892, 302, 847, 29871, 29906, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1596, 24380, 2141, 12248, 29898, 29941, 29892, 29871, 29945, 29897, 13, 1678, 1596, 24380, 2141, 12248, 29898, 29941, 29892, 448, 29945, 29897, 2 ]
scheduler/migrations/0025_auto_20181227_0749.py
janton42/reservationator
1
81318
# Generated by Django 2.1.3 on 2018-12-27 15:49 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('scheduler', '0024_auto_20181227_0744'), ] operations = [ migrations.AlterField( model_name='choice', name='date', field=models.DateField(null=True, verbose_name='Date'), ), migrations.AlterField( model_name='choice', name='time', field=models.TimeField(null=True, verbose_name='Time'), ), migrations.AlterField( model_name='event', name='place', field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='scheduler.Place'), ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29896, 29889, 29941, 373, 29871, 29906, 29900, 29896, 29947, 29899, 29896, 29906, 29899, 29906, 29955, 29871, 29896, 29945, 29901, 29946, 29929, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 5215, 9557, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702, 816, 14952, 742, 525, 29900, 29900, 29906, 29946, 29918, 6921, 29918, 29906, 29900, 29896, 29947, 29896, 29906, 29906, 29955, 29918, 29900, 29955, 29946, 29946, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 2499, 357, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 16957, 742, 13, 9651, 1024, 2433, 1256, 742, 13, 9651, 1746, 29922, 9794, 29889, 2539, 3073, 29898, 4304, 29922, 5574, 29892, 26952, 29918, 978, 2433, 2539, 5477, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2499, 357, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 16957, 742, 13, 9651, 1024, 2433, 2230, 742, 13, 9651, 1746, 29922, 9794, 29889, 2481, 3073, 29898, 4304, 29922, 5574, 29892, 26952, 29918, 978, 2433, 2481, 5477, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2499, 357, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 3696, 742, 13, 9651, 1024, 2433, 6689, 742, 13, 9651, 1746, 29922, 9794, 29889, 27755, 2558, 29898, 4304, 29922, 5574, 29892, 373, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 304, 2433, 816, 14952, 29889, 22150, 5477, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
installSynApps/IO/config_writer.py
oksanagit/installSynApps
0
77866
"""Class that is responsible for writing Install Configurations Converts datamodel objects back into text files """ import datetime import os import errno import shutil from installSynApps.DataModel import * from installSynApps.IO import logger as LOG class ConfigWriter: """Class that is responsible for writing Install Configurations Attributes ---------- install_config : InstallConfiguration install config to write Methods ------- write_injector_files(filepath : str) Helper Function for writing injector files from install config write_build_flags(filepath : str) Helper Function for writing build flags from install config write_install_config(filepath : str) function that writes an install config "saving" it """ def __init__(self, install_config): """ constructor for ConfigWriter """ self.install_config = install_config def write_injector_files(self, filepath): """Helper Function for writing injector files from install config Parameters ---------- filepath : str Path into which we wish to save configuration """ # for each injector file write it with its target location for injector_file in self.install_config.injector_files: LOG.debug('Saving injector file {} with target {}'.format(injector_file, injector_file.target)) new_fp = open(filepath + "/injectionFiles/" + injector_file.name, 'w') new_fp.write('# Saved by installSynApps on {}\n'.format(datetime.datetime.now())) new_fp.write('__TARGET_LOC__={}\n\n'.format(injector_file.target)) new_fp.write(injector_file.contents) new_fp.close() def write_build_flags(self, filepath): """Helper Function for writing build flags from install config Parameters ---------- filepath : str Path into which we wish to save configuration """ new_build_flag = open(filepath + "/macroFiles/BUILD_FLAG_CONFIG", 'w') new_build_flag.write('# Saved by installSynApps on {}\n\n'.format(datetime.datetime.now())) for macro_pair in self.install_config.build_flags: LOG.debug('Writing build flag {}={}'.format(macro_pair[0], macro_pair[1])) new_build_flag.write('{}={}\n'.format(macro_pair[0], macro_pair[1])) new_build_flag.close() def write_custom_build_scripts(self, filepath): """Helper Function for writing custom build scripts of modules Parameters ---------- filepath : str Path into which we wish to save configuration """ build_script_out = os.path.join(filepath, 'customBuildScripts') for module in self.install_config.get_module_list(): old_script = module.custom_build_script_path if old_script is not None: if os.path.exists(old_script): LOG.debug('Copying module custom build script: {}'.format(old_script)) try: shutil.copyfile(old_script, os.path.join(build_script_out, os.path.basename(old_script))) except: LOG.debug('Encountered error copying: {}'.format(old_script)) else: LOG.debug('Could not find build script at: {}'.format(old_script)) def write_install_config(self, filepath='addtlConfDirs/config{}'.format(datetime.date.today())): """Function that saves loaded install configuration Main saving function for writing install config. Can create a save directory, then saves main install configuration, build flags, and injector files. Parameters ---------- filepath : str defaults to addtlConfDirs/config$DATE. The filepath into which to save the install configuration Returns ------- bool True if successful, False otherwise str None if successfull, otherwise error message """ # Check if path exists, create it if it doesn't if not os.path.exists(filepath): try: os.mkdir(filepath) except OSError as err: if err.errno == errno.EACCES: return False, 'Permission Error!' elif err.errno == errno.EEXIST: return False, 'Path already exists!' elif err.errno == errno.ENOSPC: return False, 'No space on device!' elif err.errno == errno.EROFS: return False, 'Read Only File System!' else: return False, 'Unknown Error' try: os.mkdir(os.path.join(filepath, 'injectionFiles')) os.mkdir(os.path.join(filepath, 'macroFiles')) os.mkdir(os.path.join(filepath, 'customBuildScripts')) except: LOG.write('Failed to make configuration directories!') return False, 'Unknown Error' LOG.debug('Writing injector files.') self.write_injector_files(filepath) LOG.debug('Writing build flags.') self.write_build_flags(filepath) LOG.debug('Writing custom build scripts.') self.write_custom_build_scripts(filepath) LOG.debug('Writing INSTALL_CONFIG file.') new_install_config = open(os.path.join(filepath, "INSTALL_CONFIG"), "w+") new_install_config.write('#\n# INSTALL_CONFIG file saved by installSynApps on {}\n#\n\n'.format(datetime.datetime.now())) new_install_config.write("INSTALL={}\n\n\n".format(self.install_config.install_location)) new_install_config.write('#MODULE_NAME MODULE_VERSION MODULE_PATH MODULE_REPO CLONE_MODULE BUILD_MODULE PACKAGE_MODULE\n') new_install_config.write('#--------------------------------------------------------------------------------------------------------------------------------------------------\n') current_url = "" for module in self.install_config.get_module_list(): if module.url != current_url: new_install_config.write("\n{}={}\n\n".format(module.url_type, module.url)) current_url = module.url new_install_config.write("{:<16} {:<20} {:<40} {:<24} {:<16} {:<16} {}\n".format(module.name, module.version, module.rel_path, module.rel_repo, module.clone, module.build, module.package)) new_install_config.close() return True, None
[ 1, 9995, 2385, 393, 338, 14040, 363, 5007, 16052, 12782, 332, 800, 13, 13, 1168, 369, 1372, 1418, 314, 27224, 3618, 1250, 964, 1426, 2066, 13, 15945, 29908, 13, 13, 13, 5215, 12865, 13, 5215, 2897, 13, 5215, 4589, 1217, 13, 5215, 528, 4422, 13, 3166, 2601, 29216, 2052, 29879, 29889, 1469, 3195, 1053, 334, 13, 3166, 2601, 29216, 2052, 29879, 29889, 5971, 1053, 17927, 408, 25401, 13, 13, 1990, 12782, 10507, 29901, 13, 1678, 9995, 2385, 393, 338, 14040, 363, 5007, 16052, 12782, 332, 800, 13, 13, 1678, 6212, 5026, 13, 1678, 448, 1378, 29899, 13, 1678, 2601, 29918, 2917, 584, 16052, 8614, 13, 4706, 2601, 2295, 304, 2436, 13, 13, 1678, 8108, 29879, 13, 1678, 448, 22158, 13, 1678, 2436, 29918, 21920, 272, 29918, 5325, 29898, 1445, 2084, 584, 851, 29897, 13, 539, 6162, 546, 6680, 363, 5007, 11658, 272, 2066, 515, 2601, 2295, 13, 1678, 2436, 29918, 4282, 29918, 15764, 29898, 1445, 2084, 584, 851, 29897, 13, 539, 6162, 546, 6680, 363, 5007, 2048, 13449, 515, 2601, 2295, 13, 1678, 2436, 29918, 6252, 29918, 2917, 29898, 1445, 2084, 584, 851, 29897, 13, 4706, 740, 393, 15873, 385, 2601, 2295, 376, 29879, 5555, 29908, 372, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2601, 29918, 2917, 1125, 13, 4706, 9995, 5823, 363, 12782, 10507, 9995, 13, 13, 4706, 1583, 29889, 6252, 29918, 2917, 353, 2601, 29918, 2917, 13, 13, 13, 1678, 822, 2436, 29918, 21920, 272, 29918, 5325, 29898, 1311, 29892, 934, 2084, 1125, 13, 4706, 9995, 10739, 6680, 363, 5007, 11658, 272, 2066, 515, 2601, 2295, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 934, 2084, 584, 851, 13, 9651, 10802, 964, 607, 591, 6398, 304, 4078, 5285, 13, 4706, 9995, 13, 13, 4706, 396, 363, 1269, 11658, 272, 934, 2436, 372, 411, 967, 3646, 4423, 13, 4706, 363, 11658, 272, 29918, 1445, 297, 1583, 29889, 6252, 29918, 2917, 29889, 21920, 272, 29918, 5325, 29901, 13, 9651, 25401, 29889, 8382, 877, 29903, 5555, 11658, 272, 934, 6571, 411, 3646, 6571, 4286, 4830, 29898, 21920, 272, 29918, 1445, 29892, 11658, 272, 29918, 1445, 29889, 5182, 876, 13, 9651, 716, 29918, 18091, 353, 1722, 29898, 1445, 2084, 718, 5591, 262, 6929, 10547, 12975, 718, 11658, 272, 29918, 1445, 29889, 978, 29892, 525, 29893, 1495, 13, 9651, 716, 29918, 18091, 29889, 3539, 14237, 9583, 287, 491, 2601, 29216, 2052, 29879, 373, 426, 1012, 29876, 4286, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 22130, 13, 9651, 716, 29918, 18091, 29889, 3539, 877, 1649, 29911, 1718, 7194, 29918, 16652, 1649, 3790, 1012, 29876, 29905, 29876, 4286, 4830, 29898, 21920, 272, 29918, 1445, 29889, 5182, 876, 13, 9651, 716, 29918, 18091, 29889, 3539, 29898, 21920, 272, 29918, 1445, 29889, 10853, 29897, 13, 9651, 716, 29918, 18091, 29889, 5358, 580, 13, 13, 13, 1678, 822, 2436, 29918, 4282, 29918, 15764, 29898, 1311, 29892, 934, 2084, 1125, 13, 4706, 9995, 10739, 6680, 363, 5007, 2048, 13449, 515, 2601, 2295, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 934, 2084, 584, 851, 13, 9651, 10802, 964, 607, 591, 6398, 304, 4078, 5285, 13, 4706, 9995, 13, 13, 4706, 716, 29918, 4282, 29918, 15581, 353, 1722, 29898, 1445, 2084, 718, 5591, 25254, 10547, 29914, 29933, 25282, 29918, 26516, 29918, 25903, 613, 525, 29893, 1495, 13, 4706, 716, 29918, 4282, 29918, 15581, 29889, 3539, 14237, 9583, 287, 491, 2601, 29216, 2052, 29879, 373, 426, 1012, 29876, 29905, 29876, 4286, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 22130, 13, 4706, 363, 11758, 29918, 18784, 297, 1583, 29889, 6252, 29918, 2917, 29889, 4282, 29918, 15764, 29901, 13, 9651, 25401, 29889, 8382, 877, 29956, 768, 292, 2048, 7353, 6571, 3790, 29913, 4286, 4830, 29898, 25254, 29918, 18784, 29961, 29900, 1402, 11758, 29918, 18784, 29961, 29896, 12622, 13, 9651, 716, 29918, 4282, 29918, 15581, 29889, 3539, 877, 8875, 3790, 1012, 29876, 4286, 4830, 29898, 25254, 29918, 18784, 29961, 29900, 1402, 11758, 29918, 18784, 29961, 29896, 12622, 13, 4706, 716, 29918, 4282, 29918, 15581, 29889, 5358, 580, 13, 13, 13, 1678, 822, 2436, 29918, 6341, 29918, 4282, 29918, 16713, 29898, 1311, 29892, 934, 2084, 1125, 13, 4706, 9995, 10739, 6680, 363, 5007, 2888, 2048, 12078, 310, 10585, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 934, 2084, 584, 851, 13, 9651, 10802, 964, 607, 591, 6398, 304, 4078, 5285, 13, 4706, 9995, 13, 13, 4706, 2048, 29918, 2154, 29918, 449, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1445, 2084, 29892, 525, 6341, 8893, 4081, 29879, 1495, 13, 4706, 363, 3883, 297, 1583, 29889, 6252, 29918, 2917, 29889, 657, 29918, 5453, 29918, 1761, 7295, 13, 9651, 2030, 29918, 2154, 353, 3883, 29889, 6341, 29918, 4282, 29918, 2154, 29918, 2084, 13, 9651, 565, 2030, 29918, 2154, 338, 451, 6213, 29901, 13, 18884, 565, 2897, 29889, 2084, 29889, 9933, 29898, 1025, 29918, 2154, 1125, 13, 462, 1678, 25401, 29889, 8382, 877, 11882, 292, 3883, 2888, 2048, 2471, 29901, 6571, 4286, 4830, 29898, 1025, 29918, 2154, 876, 13, 462, 1678, 1018, 29901, 13, 462, 4706, 528, 4422, 29889, 8552, 1445, 29898, 1025, 29918, 2154, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 4282, 29918, 2154, 29918, 449, 29892, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 1025, 29918, 2154, 4961, 13, 462, 1678, 5174, 29901, 13, 462, 4706, 25401, 29889, 8382, 877, 8566, 5336, 287, 1059, 17596, 29901, 6571, 4286, 4830, 29898, 1025, 29918, 2154, 876, 13, 18884, 1683, 29901, 13, 462, 1678, 25401, 29889, 8382, 877, 23323, 451, 1284, 2048, 2471, 472, 29901, 6571, 4286, 4830, 29898, 1025, 29918, 2154, 876, 13, 13, 13, 1678, 822, 2436, 29918, 6252, 29918, 2917, 29898, 1311, 29892, 934, 2084, 2433, 1202, 15206, 16376, 9170, 29879, 29914, 2917, 8875, 4286, 4830, 29898, 12673, 29889, 1256, 29889, 27765, 22130, 29901, 13, 4706, 9995, 6678, 393, 27401, 7500, 2601, 5285, 13, 13, 4706, 4241, 14238, 740, 363, 5007, 2601, 2295, 29889, 1815, 1653, 263, 4078, 3884, 29892, 769, 27401, 29871, 13, 4706, 1667, 2601, 5285, 29892, 2048, 13449, 29892, 322, 11658, 272, 2066, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 934, 2084, 584, 851, 13, 9651, 21274, 304, 788, 15206, 16376, 9170, 29879, 29914, 2917, 29938, 6248, 29889, 450, 934, 2084, 964, 607, 304, 4078, 278, 2601, 5285, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 6120, 13, 9651, 5852, 565, 9150, 29892, 7700, 6467, 13, 4706, 851, 13, 9651, 6213, 565, 2551, 8159, 29892, 6467, 1059, 2643, 13, 4706, 9995, 13, 13, 4706, 396, 5399, 565, 2224, 4864, 29892, 1653, 372, 565, 372, 1838, 29915, 29873, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 1445, 2084, 1125, 13, 9651, 1018, 29901, 13, 18884, 2897, 29889, 11256, 3972, 29898, 1445, 2084, 29897, 13, 9651, 5174, 438, 29173, 408, 4589, 29901, 13, 18884, 565, 4589, 29889, 3127, 1217, 1275, 4589, 1217, 29889, 29923, 2477, 27266, 29901, 13, 462, 1678, 736, 7700, 29892, 525, 27293, 4829, 20714, 13, 18884, 25342, 4589, 29889, 3127, 1217, 1275, 4589, 1217, 29889, 29923, 5746, 9047, 29901, 13, 462, 1678, 736, 7700, 29892, 525, 2605, 2307, 4864, 20714, 13, 18884, 25342, 4589, 29889, 3127, 1217, 1275, 4589, 1217, 29889, 1430, 3267, 9026, 29901, 13, 462, 1678, 736, 7700, 29892, 525, 3782, 2913, 373, 4742, 20714, 13, 18884, 25342, 4589, 29889, 3127, 1217, 1275, 4589, 1217, 29889, 1001, 9800, 29903, 29901, 13, 462, 1678, 736, 7700, 29892, 525, 6359, 9333, 3497, 2184, 20714, 13, 18884, 1683, 29901, 13, 462, 1678, 736, 7700, 29892, 525, 14148, 4829, 29915, 13, 4706, 1018, 29901, 13, 9651, 2897, 29889, 11256, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1445, 2084, 29892, 525, 262, 6929, 10547, 8785, 13, 9651, 2897, 29889, 11256, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1445, 2084, 29892, 525, 25254, 10547, 8785, 13, 9651, 2897, 29889, 11256, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1445, 2084, 29892, 525, 6341, 8893, 4081, 29879, 8785, 13, 4706, 5174, 29901, 13, 9651, 25401, 29889, 3539, 877, 17776, 304, 1207, 5285, 17525, 29991, 1495, 13, 9651, 736, 7700, 29892, 525, 14148, 4829, 29915, 13, 13, 4706, 25401, 29889, 8382, 877, 29956, 768, 292, 11658, 272, 2066, 29889, 1495, 13, 4706, 1583, 29889, 3539, 29918, 21920, 272, 29918, 5325, 29898, 1445, 2084, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 29956, 768, 292, 2048, 13449, 29889, 1495, 13, 4706, 1583, 29889, 3539, 29918, 4282, 29918, 15764, 29898, 1445, 2084, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 29956, 768, 292, 2888, 2048, 12078, 29889, 1495, 13, 4706, 1583, 29889, 3539, 29918, 6341, 29918, 4282, 29918, 16713, 29898, 1445, 2084, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 29956, 768, 292, 2672, 1254, 9818, 29918, 25903, 934, 29889, 1495, 13, 4706, 716, 29918, 6252, 29918, 2917, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1445, 2084, 29892, 376, 25580, 9818, 29918, 25903, 4968, 376, 29893, 29974, 1159, 13, 4706, 716, 29918, 6252, 29918, 2917, 29889, 3539, 14237, 29905, 29876, 29937, 2672, 1254, 9818, 29918, 25903, 934, 7160, 491, 2601, 29216, 2052, 29879, 373, 426, 1012, 29876, 29937, 29905, 29876, 29905, 29876, 4286, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 22130, 29871, 13, 4706, 716, 29918, 6252, 29918, 2917, 29889, 3539, 703, 25580, 9818, 3790, 1012, 29876, 29905, 29876, 29905, 29876, 1642, 4830, 29898, 1311, 29889, 6252, 29918, 2917, 29889, 6252, 29918, 5479, 876, 13, 13, 4706, 716, 29918, 6252, 29918, 2917, 29889, 3539, 14237, 6720, 14849, 1307, 29918, 5813, 1678, 341, 13668, 29965, 1307, 29918, 16358, 3986, 341, 13668, 29965, 1307, 29918, 10145, 462, 632, 341, 13668, 29965, 1307, 29918, 1525, 13152, 308, 17332, 12413, 29918, 6720, 14849, 1307, 1678, 350, 25282, 29918, 6720, 14849, 1307, 1678, 349, 11375, 10461, 29918, 6720, 14849, 1307, 29905, 29876, 1495, 13, 4706, 716, 29918, 6252, 29918, 2917, 29889, 3539, 14237, 2683, 2683, 2683, 2683, 2683, 2683, 2683, 2683, 2683, 489, 29905, 29876, 1495, 13, 13, 4706, 1857, 29918, 2271, 353, 5124, 13, 4706, 363, 3883, 297, 1583, 29889, 6252, 29918, 2917, 29889, 657, 29918, 5453, 29918, 1761, 7295, 13, 9651, 565, 3883, 29889, 2271, 2804, 1857, 29918, 2271, 29901, 13, 18884, 716, 29918, 6252, 29918, 2917, 29889, 3539, 14182, 29876, 8875, 3790, 1012, 29876, 29905, 29876, 1642, 4830, 29898, 5453, 29889, 2271, 29918, 1853, 29892, 3883, 29889, 2271, 876, 13, 18884, 1857, 29918, 2271, 353, 3883, 29889, 2271, 13, 9651, 716, 29918, 6252, 29918, 2917, 29889, 3539, 703, 25641, 29966, 29896, 29953, 29913, 12365, 29966, 29906, 29900, 29913, 12365, 29966, 29946, 29900, 29913, 12365, 29966, 29906, 29946, 29913, 12365, 29966, 29896, 29953, 29913, 12365, 29966, 29896, 29953, 29913, 426, 1012, 29876, 1642, 4830, 29898, 5453, 29889, 978, 29892, 3883, 29889, 3259, 29892, 3883, 29889, 2674, 29918, 2084, 29892, 3883, 29889, 2674, 29918, 20095, 29892, 3883, 29889, 16513, 29892, 3883, 29889, 4282, 29892, 3883, 29889, 5113, 876, 13, 13, 4706, 716, 29918, 6252, 29918, 2917, 29889, 5358, 580, 13, 4706, 736, 5852, 29892, 6213, 2 ]
utils/italic_utils.py
Brickster/pretty-markdown
0
165789
<reponame>Brickster/pretty-markdown import re VALID_CHARACTERS = ['*', "_"] def convert_italics(text, character='_'): """Converts any italics implementation to use the specified character. If no character is given, an underscore (_) is used. """ assert character in VALID_CHARACTERS, 'character must be one of {}'.format(VALID_CHARACTERS) p = re.compile(r'(?<![*_])((?:\*{2}|_{2})?)([*_])([*_]*)((?<!(?<![*_])[*_][*_])[^\s*_](?:[\S \t]+?\S)?)\3\2\1') text = p.sub(r'\1{0}\3\4\3{0}\1'.format(character), text) return text
[ 1, 529, 276, 1112, 420, 29958, 29933, 9131, 2475, 29914, 1457, 4349, 29899, 3502, 3204, 13, 5215, 337, 13, 13, 26707, 29918, 11282, 17923, 23598, 353, 6024, 29930, 742, 11119, 3108, 13, 13, 13, 1753, 3588, 29918, 2410, 1199, 29898, 726, 29892, 2931, 2433, 29918, 29374, 13, 1678, 9995, 1168, 369, 1372, 738, 4698, 1199, 5314, 304, 671, 278, 6790, 2931, 29889, 13, 13, 1678, 960, 694, 2931, 338, 2183, 29892, 385, 23400, 3221, 9423, 29897, 338, 1304, 29889, 13, 1678, 9995, 13, 13, 1678, 4974, 2931, 297, 12599, 1367, 29918, 11282, 17923, 23598, 29892, 525, 18609, 1818, 367, 697, 310, 6571, 4286, 4830, 29898, 26707, 29918, 11282, 17923, 23598, 29897, 13, 13, 1678, 282, 353, 337, 29889, 12198, 29898, 29878, 29915, 10780, 29966, 21298, 29930, 29918, 2314, 3552, 29973, 3583, 19740, 29906, 11079, 648, 29906, 1800, 7897, 4197, 29930, 29918, 2314, 4197, 29930, 29918, 29962, 7528, 3552, 29973, 29966, 29991, 10780, 29966, 21298, 29930, 29918, 2314, 29961, 29930, 29918, 3816, 29930, 29918, 2314, 29961, 3823, 29879, 29930, 29918, 850, 25825, 7110, 29903, 320, 29873, 10062, 29973, 29905, 29903, 6877, 2144, 29941, 29905, 29906, 29905, 29896, 1495, 13, 1678, 1426, 353, 282, 29889, 1491, 29898, 29878, 12764, 29896, 29912, 29900, 1012, 29941, 29905, 29946, 29905, 29941, 29912, 29900, 1012, 29896, 4286, 4830, 29898, 18609, 511, 1426, 29897, 13, 13, 1678, 736, 1426, 13, 2 ]
64-minimum-path-sum.py
Iciclelz/leetcode
0
140692
import math import queue class Solution: def vertices(self): return [(x, y) for y in range(len(self.grid[0])) for x in range(len(self.grid))] def adjacent(self, u): l = list() if u[0] + 1 < len(self.grid): l.append((u[0] + 1, u[1])) if u[1] + 1 < len(self.grid[0]): l.append((u[0], u[1] + 1)) return l def length(self, u, v): return self.grid[v[0]][v[1]] def dijkstra(self, s, u): distance = dict() pq = queue.PriorityQueue() distance[s] = 0 pq.put((distance[s], s)) for v in self.vertices(): if v != s: distance[v] = math.inf while not pq.empty(): _, u = pq.get() for v in self.adjacent(u): if distance[v] > distance[u] + self.length(u, v): distance[v] = distance[u] + self.length(u, v) pq.put((distance[v], v)) return distance def minPathSum(self, grid: List[List[int]]) -> int: self.grid = grid start = (0,0) end = (len(grid)-1, len(grid[0])-1) distance = self.dijkstra(start, end) # distance at end + initial cost return distance[end] + grid[0][0]
[ 1, 1053, 5844, 13, 5215, 9521, 13, 13, 1990, 24380, 29901, 13, 1678, 822, 13791, 29898, 1311, 1125, 13, 4706, 736, 17288, 29916, 29892, 343, 29897, 363, 343, 297, 3464, 29898, 2435, 29898, 1311, 29889, 7720, 29961, 29900, 12622, 363, 921, 297, 3464, 29898, 2435, 29898, 1311, 29889, 7720, 28166, 13, 13, 1678, 822, 20114, 29898, 1311, 29892, 318, 1125, 13, 4706, 301, 353, 1051, 580, 13, 13, 4706, 565, 318, 29961, 29900, 29962, 718, 29871, 29896, 529, 7431, 29898, 1311, 29889, 7720, 1125, 13, 9651, 301, 29889, 4397, 3552, 29884, 29961, 29900, 29962, 718, 29871, 29896, 29892, 318, 29961, 29896, 12622, 13, 13, 4706, 565, 318, 29961, 29896, 29962, 718, 29871, 29896, 529, 7431, 29898, 1311, 29889, 7720, 29961, 29900, 29962, 1125, 13, 9651, 301, 29889, 4397, 3552, 29884, 29961, 29900, 1402, 318, 29961, 29896, 29962, 718, 29871, 29896, 876, 13, 308, 13, 4706, 736, 301, 13, 13, 1678, 822, 3309, 29898, 1311, 29892, 318, 29892, 325, 1125, 13, 4706, 736, 1583, 29889, 7720, 29961, 29894, 29961, 29900, 29962, 3816, 29894, 29961, 29896, 5262, 13, 13, 1678, 822, 652, 25467, 4151, 29898, 1311, 29892, 269, 29892, 318, 1125, 13, 4706, 5418, 353, 9657, 580, 13, 4706, 282, 29939, 353, 9521, 29889, 29925, 21766, 10620, 580, 13, 13, 4706, 5418, 29961, 29879, 29962, 353, 29871, 29900, 13, 4706, 282, 29939, 29889, 649, 3552, 19244, 29961, 29879, 1402, 269, 876, 13, 13, 4706, 363, 325, 297, 1583, 29889, 1765, 1575, 7295, 13, 9651, 565, 325, 2804, 269, 29901, 13, 18884, 5418, 29961, 29894, 29962, 353, 5844, 29889, 7192, 13, 13, 4706, 1550, 451, 282, 29939, 29889, 6310, 7295, 13, 9651, 17117, 318, 353, 282, 29939, 29889, 657, 580, 13, 9651, 363, 325, 297, 1583, 29889, 26859, 16648, 29898, 29884, 1125, 13, 18884, 565, 5418, 29961, 29894, 29962, 1405, 5418, 29961, 29884, 29962, 718, 1583, 29889, 2848, 29898, 29884, 29892, 325, 1125, 13, 462, 1678, 5418, 29961, 29894, 29962, 353, 5418, 29961, 29884, 29962, 718, 1583, 29889, 2848, 29898, 29884, 29892, 325, 29897, 13, 462, 1678, 282, 29939, 29889, 649, 3552, 19244, 29961, 29894, 1402, 325, 876, 13, 632, 13, 4706, 736, 5418, 13, 268, 13, 1678, 822, 1375, 2605, 11139, 29898, 1311, 29892, 6856, 29901, 2391, 29961, 1293, 29961, 524, 24960, 1599, 938, 29901, 13, 4706, 1583, 29889, 7720, 353, 6856, 13, 308, 13, 4706, 1369, 353, 313, 29900, 29892, 29900, 29897, 13, 4706, 1095, 353, 313, 2435, 29898, 7720, 6817, 29896, 29892, 7431, 29898, 7720, 29961, 29900, 2314, 29899, 29896, 29897, 13, 308, 13, 4706, 5418, 353, 1583, 29889, 29881, 13535, 4151, 29898, 2962, 29892, 1095, 29897, 13, 308, 13, 4706, 396, 5418, 472, 1095, 718, 2847, 3438, 13, 4706, 736, 5418, 29961, 355, 29962, 718, 6856, 29961, 29900, 3816, 29900, 29962, 2 ]
users/roles.py
Zimodra/yamdb_final
0
30235
from django.db import models class Roles(models.TextChoices): USER = 'user', 'User' MODERATOR = 'moderator', 'Moderator' ADMIN = 'admin', 'Admin'
[ 1, 515, 9557, 29889, 2585, 1053, 4733, 13, 13, 13, 1990, 390, 6544, 29898, 9794, 29889, 1626, 15954, 1575, 1125, 13, 1678, 3148, 1001, 353, 525, 1792, 742, 525, 2659, 29915, 13, 1678, 16999, 8032, 1299, 1955, 353, 525, 1545, 261, 1061, 742, 525, 2111, 261, 1061, 29915, 13, 1678, 11033, 16173, 353, 525, 6406, 742, 525, 12754, 29915, 13, 2 ]
POP1/worksheets/recursion/ex02/test_ex02.py
silvafj/BBK-MSCCS-2017-18
1
120799
import pytest from power import power def test_one(): assert power(2,-3) == 0.125 def test_two(): assert power(2,1) == 2 def test_three(): assert power(2,2) == 4 def test_four(): assert power(2,3) == 8 def test_five(): assert power(2,4) == 16 def test_six(): assert power(2,9) == 512 def test_seven(): assert power(2,10) == 1024 def test_eight(): assert power(2,15) == 32768 def test_nine(): assert power(2,0) == 1 def test_ten(): assert power(3,1) == 3 def test_eleven(): assert power(3,2) == 9 def test_twelve(): assert power(3,3) == 27 def test_thirteen(): assert power(3,10) == 59049 def test_fourteen(): assert power(3,0) == 1 def test_fifteen(): assert power(1.1414,2) == pytest.approx(1.30279, 0.00001) def test_sixteen(): assert power(1.5,10) == pytest.approx(57.665, 0.001) def test_seventeen(): assert power(1,-1) == 1 def test_eighteen(): assert power(2,-1) == 0.5 def test_nineteen(): assert power(2,-2) == 0.25 def test_twenty(): assert power(2,-3) == 0.125 def test_twentyone(): assert power(2,-4) == 0.0625 def test_twentytwo(): assert power(2,-8) == 0.00390625 def test_twentythree(): assert power(2,-9) == pytest.approx(0.00195312, 0.00001) def test_twentyfour(): assert power(2,-10) == pytest.approx(0.000976562, 0.00001) def test_twentyfive(): assert power(2,-15) == pytest.approx(3.05176e-05) def test_twentysix(): assert power(3,-1) == pytest.approx(0.333333, 0.00001) def test_twentyseven(): assert power(3,-2) == pytest.approx(0.111111, 0.00001) def test_twentyeight(): assert power(3,-3) == pytest.approx(0.037037, 0.00001) def test_twentynine(): assert power(3,-4) == pytest.approx(0.0123457, 0.00001) def test_thirty(): assert power(3,-5) == pytest.approx(0.00411523, 0.000001) def test_thirtyone(): assert power(3,-10) == pytest.approx(1.69351e-05) def test_thirtytwo(): assert power(3,-6) == pytest.approx(0.00137174, 0.00001) def test_thirtythree(): assert power(1.1414,-2) == pytest.approx(0.767581, 0.000001) def test_thirtyfour(): assert power(1.5,-10) == pytest.approx(0.0173415, 0.00001)
[ 1, 1053, 11451, 1688, 13, 13, 3166, 3081, 1053, 3081, 13, 13, 1753, 1243, 29918, 650, 7295, 13, 12, 9294, 3081, 29898, 29906, 6653, 29941, 29897, 1275, 29871, 29900, 29889, 29896, 29906, 29945, 13, 13, 1753, 1243, 29918, 10184, 7295, 13, 12, 9294, 3081, 29898, 29906, 29892, 29896, 29897, 1275, 29871, 29906, 13, 13, 1753, 1243, 29918, 17536, 7295, 13, 12, 9294, 3081, 29898, 29906, 29892, 29906, 29897, 1275, 29871, 29946, 13, 13, 1753, 1243, 29918, 17823, 7295, 13, 12, 9294, 3081, 29898, 29906, 29892, 29941, 29897, 1275, 29871, 29947, 13, 13, 1753, 1243, 29918, 20818, 7295, 13, 12, 9294, 3081, 29898, 29906, 29892, 29946, 29897, 1275, 29871, 29896, 29953, 13, 13, 1753, 1243, 29918, 28319, 7295, 13, 12, 9294, 3081, 29898, 29906, 29892, 29929, 29897, 1275, 29871, 29945, 29896, 29906, 13, 13, 1753, 1243, 29918, 344, 854, 7295, 13, 12, 9294, 3081, 29898, 29906, 29892, 29896, 29900, 29897, 1275, 29871, 29896, 29900, 29906, 29946, 13, 13, 1753, 1243, 29918, 29872, 523, 7295, 13, 12, 9294, 3081, 29898, 29906, 29892, 29896, 29945, 29897, 1275, 29871, 29941, 29906, 29955, 29953, 29947, 13, 13, 1753, 1243, 29918, 29876, 457, 7295, 13, 12, 9294, 3081, 29898, 29906, 29892, 29900, 29897, 1275, 29871, 29896, 13, 13, 1753, 1243, 29918, 841, 7295, 13, 12, 9294, 3081, 29898, 29941, 29892, 29896, 29897, 1275, 29871, 29941, 13, 13, 1753, 1243, 29918, 6146, 854, 7295, 13, 12, 9294, 3081, 29898, 29941, 29892, 29906, 29897, 1275, 29871, 29929, 13, 13, 1753, 1243, 29918, 7516, 13841, 7295, 13, 12, 9294, 3081, 29898, 29941, 29892, 29941, 29897, 1275, 29871, 29906, 29955, 13, 13, 1753, 1243, 29918, 386, 381, 9404, 7295, 13, 12, 9294, 3081, 29898, 29941, 29892, 29896, 29900, 29897, 1275, 29871, 29945, 29929, 29900, 29946, 29929, 13, 13, 1753, 1243, 29918, 17823, 9404, 7295, 13, 12, 9294, 3081, 29898, 29941, 29892, 29900, 29897, 1275, 29871, 29896, 13, 13, 1753, 1243, 29918, 28491, 9404, 7295, 13, 12, 9294, 3081, 29898, 29896, 29889, 29896, 29946, 29896, 29946, 29892, 29906, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29896, 29889, 29941, 29900, 29906, 29955, 29929, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 28319, 9404, 7295, 13, 12, 9294, 3081, 29898, 29896, 29889, 29945, 29892, 29896, 29900, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29945, 29955, 29889, 29953, 29953, 29945, 29892, 29871, 29900, 29889, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 344, 794, 27294, 7295, 13, 12, 9294, 3081, 29898, 29896, 6653, 29896, 29897, 1275, 29871, 29896, 13, 13, 1753, 1243, 29918, 29872, 1141, 9404, 7295, 13, 12, 9294, 3081, 29898, 29906, 6653, 29896, 29897, 1275, 29871, 29900, 29889, 29945, 13, 13, 1753, 1243, 29918, 29876, 262, 2650, 264, 7295, 13, 12, 9294, 3081, 29898, 29906, 6653, 29906, 29897, 1275, 29871, 29900, 29889, 29906, 29945, 13, 13, 1753, 1243, 29918, 7516, 6478, 7295, 13, 12, 9294, 3081, 29898, 29906, 6653, 29941, 29897, 1275, 29871, 29900, 29889, 29896, 29906, 29945, 13, 13, 1753, 1243, 29918, 7516, 6478, 650, 7295, 13, 12, 9294, 3081, 29898, 29906, 6653, 29946, 29897, 1275, 29871, 29900, 29889, 29900, 29953, 29906, 29945, 13, 13, 1753, 1243, 29918, 7516, 296, 3637, 827, 7295, 13, 12, 9294, 3081, 29898, 29906, 6653, 29947, 29897, 1275, 29871, 29900, 29889, 29900, 29900, 29941, 29929, 29900, 29953, 29906, 29945, 13, 13, 1753, 1243, 29918, 7516, 296, 1541, 929, 7295, 13, 12, 9294, 3081, 29898, 29906, 6653, 29929, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29900, 29900, 29896, 29929, 29945, 29941, 29896, 29906, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 7516, 6478, 17823, 7295, 13, 12, 9294, 3081, 29898, 29906, 6653, 29896, 29900, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29900, 29900, 29900, 29929, 29955, 29953, 29945, 29953, 29906, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 7516, 6478, 20818, 7295, 13, 12, 9294, 3081, 29898, 29906, 6653, 29896, 29945, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29941, 29889, 29900, 29945, 29896, 29955, 29953, 29872, 29899, 29900, 29945, 29897, 13, 13, 1753, 1243, 29918, 7516, 296, 952, 861, 7295, 13, 12, 9294, 3081, 29898, 29941, 6653, 29896, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29941, 29941, 29941, 29941, 29941, 29941, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 7516, 6478, 344, 854, 7295, 13, 12, 9294, 3081, 29898, 29941, 6653, 29906, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29896, 29896, 29896, 29896, 29896, 29896, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 7516, 296, 4099, 523, 7295, 13, 12, 9294, 3081, 29898, 29941, 6653, 29941, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29900, 29941, 29955, 29900, 29941, 29955, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 7516, 296, 948, 457, 7295, 13, 12, 9294, 3081, 29898, 29941, 6653, 29946, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29900, 29896, 29906, 29941, 29946, 29945, 29955, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 386, 13163, 7295, 13, 12, 9294, 3081, 29898, 29941, 6653, 29945, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29900, 29900, 29946, 29896, 29896, 29945, 29906, 29941, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 386, 13163, 650, 7295, 13, 12, 9294, 3081, 29898, 29941, 6653, 29896, 29900, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29896, 29889, 29953, 29929, 29941, 29945, 29896, 29872, 29899, 29900, 29945, 29897, 13, 13, 1753, 1243, 29918, 386, 13163, 10184, 7295, 13, 12, 9294, 3081, 29898, 29941, 6653, 29953, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29900, 29900, 29896, 29941, 29955, 29896, 29955, 29946, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 386, 13163, 17536, 7295, 13, 12, 9294, 3081, 29898, 29896, 29889, 29896, 29946, 29896, 29946, 6653, 29906, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29955, 29953, 29955, 29945, 29947, 29896, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29900, 29896, 29897, 13, 13, 1753, 1243, 29918, 386, 13163, 17823, 7295, 13, 12, 9294, 3081, 29898, 29896, 29889, 29945, 6653, 29896, 29900, 29897, 1275, 11451, 1688, 29889, 14850, 29898, 29900, 29889, 29900, 29896, 29955, 29941, 29946, 29896, 29945, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29896, 29897, 13, 2 ]
infoblox_netmri/api/broker/v3_6_0/sdn_network_broker.py
IngmarVG-IB/infoblox-netmri
0
91165
<reponame>IngmarVG-IB/infoblox-netmri from ..broker import Broker class SdnNetworkBroker(Broker): controller = "sdn_networks" def index(self, **kwargs): """Lists the available sdn networks. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is most efficient. **Inputs** | ``api version min:`` 3.4 | ``api version max:`` None | ``required:`` False | ``default:`` None :param sdn_network_id: The internal NetMRI identifier for this network :type sdn_network_id: Array of Integer | ``api version min:`` 3.4 | ``api version max:`` None | ``required:`` False | ``default:`` None :param sdn_network_key: The unique identifier of each network at the SDN controller side :type sdn_network_key: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param methods: A list of sdn network methods. The listed methods will be called on each sdn network returned and included in the output. Available methods are: fabric_handle. :type methods: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` 0 :param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information. :type start: Integer | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` 1000 :param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000. :type limit: Integer | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` sdn_network_id :param sort: The data field(s) to use for sorting the output. Default is sdn_network_id. Valid values are sdn_network_id, sdn_network_key, sdn_network_name, fabric_id, virtual_network_id, StartTime, EndTime. :type sort: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` asc :param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'. :type dir: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param select: The list of attributes to return for each SdnNetwork. Valid values are sdn_network_id, sdn_network_key, sdn_network_name, fabric_id, virtual_network_id, StartTime, EndTime. If empty or omitted, all attributes will be returned. :type select: Array | ``api version min:`` 2.8 | ``api version max:`` None | ``required:`` False | ``default:`` None :param goto_field: The field name for NIOS GOTO that is used for locating a row position of records. :type goto_field: String | ``api version min:`` 2.8 | ``api version max:`` None | ``required:`` False | ``default:`` None :param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records. :type goto_value: String **Outputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :return sdn_networks: An array of the SdnNetwork objects that match the specified input criteria. :rtype sdn_networks: Array of SdnNetwork """ return self.api_list_request(self._get_method_fullname("index"), kwargs) def search(self, **kwargs): """Lists the available sdn networks matching the input criteria. This method provides a more flexible search interface than the index method, but searching using this method is more demanding on the system and will not perform to the same level as the index method. The input fields listed below will be used as in the index method, to filter the result, along with the optional query string and XML filter described below. **Inputs** | ``api version min:`` 3.4 | ``api version max:`` None | ``required:`` False | ``default:`` None :param EndTime: The ending date/time of this network :type EndTime: Array of DateTime | ``api version min:`` 3.4 | ``api version max:`` None | ``required:`` False | ``default:`` None :param StartTime: The starting date/time of this network :type StartTime: Array of DateTime | ``api version min:`` 3.4 | ``api version max:`` None | ``required:`` False | ``default:`` None :param fabric_id: Identifier of SdnSetting from which this network was collected :type fabric_id: Array of Integer | ``api version min:`` 3.4 | ``api version max:`` None | ``required:`` False | ``default:`` None :param sdn_network_id: The internal NetMRI identifier for this network :type sdn_network_id: Array of Integer | ``api version min:`` 3.4 | ``api version max:`` None | ``required:`` False | ``default:`` None :param sdn_network_key: The unique identifier of each network at the SDN controller side :type sdn_network_key: Array of String | ``api version min:`` 3.4 | ``api version max:`` None | ``required:`` False | ``default:`` None :param sdn_network_name: Name of SDN network :type sdn_network_name: Array of String | ``api version min:`` 3.4 | ``api version max:`` None | ``required:`` False | ``default:`` None :param virtual_network_id: ID of Virtual Network which is assigned to this network :type virtual_network_id: Array of Integer | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param methods: A list of sdn network methods. The listed methods will be called on each sdn network returned and included in the output. Available methods are: fabric_handle. :type methods: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` 0 :param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information. :type start: Integer | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` 1000 :param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000. :type limit: Integer | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` sdn_network_id :param sort: The data field(s) to use for sorting the output. Default is sdn_network_id. Valid values are sdn_network_id, sdn_network_key, sdn_network_name, fabric_id, virtual_network_id, StartTime, EndTime. :type sort: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` asc :param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'. :type dir: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param select: The list of attributes to return for each SdnNetwork. Valid values are sdn_network_id, sdn_network_key, sdn_network_name, fabric_id, virtual_network_id, StartTime, EndTime. If empty or omitted, all attributes will be returned. :type select: Array | ``api version min:`` 2.8 | ``api version max:`` None | ``required:`` False | ``default:`` None :param goto_field: The field name for NIOS GOTO that is used for locating a row position of records. :type goto_field: String | ``api version min:`` 2.8 | ``api version max:`` None | ``required:`` False | ``default:`` None :param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records. :type goto_value: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param query: This value will be matched against sdn networks, looking to see if one or more of the listed attributes contain the passed value. You may also surround the value with '/' and '/' to perform a regular expression search rather than a containment operation. Any record that matches will be returned. The attributes searched are: EndTime, StartTime, fabric_id, sdn_network_id, sdn_network_key, sdn_network_name, virtual_network_id. :type query: String | ``api version min:`` 2.3 | ``api version max:`` None | ``required:`` False | ``default:`` None :param xml_filter: A SetFilter XML structure to further refine the search. The SetFilter will be applied AFTER any search query or field values, but before any limit options. The limit and pagination will be enforced after the filter. Remind that this kind of filter may be costly and inefficient if not associated with a database filtering. :type xml_filter: String **Outputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :return sdn_networks: An array of the SdnNetwork objects that match the specified input criteria. :rtype sdn_networks: Array of SdnNetwork """ return self.api_list_request(self._get_method_fullname("search"), kwargs) def find(self, **kwargs): """Lists the available sdn networks matching the input specification. This provides the most flexible search specification of all the query mechanisms, enabling searching using comparison operations other than equality. However, it is more complex to use and will not perform as efficiently as the index or search methods. In the input descriptions below, 'field names' refers to the following fields: EndTime, StartTime, fabric_id, sdn_network_id, sdn_network_key, sdn_network_name, virtual_network_id. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param op_EndTime: The operator to apply to the field EndTime. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. EndTime: The ending date/time of this network For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values. :type op_EndTime: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_f_EndTime: If op_EndTime is specified, the field named in this input will be compared to the value in EndTime using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_EndTime must be specified if op_EndTime is specified. :type val_f_EndTime: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_c_EndTime: If op_EndTime is specified, this value will be compared to the value in EndTime using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_EndTime must be specified if op_EndTime is specified. :type val_c_EndTime: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param op_StartTime: The operator to apply to the field StartTime. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. StartTime: The starting date/time of this network For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values. :type op_StartTime: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_f_StartTime: If op_StartTime is specified, the field named in this input will be compared to the value in StartTime using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_StartTime must be specified if op_StartTime is specified. :type val_f_StartTime: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_c_StartTime: If op_StartTime is specified, this value will be compared to the value in StartTime using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_StartTime must be specified if op_StartTime is specified. :type val_c_StartTime: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param op_fabric_handle: The operator to apply to the field fabric_handle. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. fabric_handle: Name of SDN controller from which this network was collected. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values. :type op_fabric_handle: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_f_fabric_handle: If op_fabric_handle is specified, the field named in this input will be compared to the value in fabric_handle using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_fabric_handle must be specified if op_fabric_handle is specified. :type val_f_fabric_handle: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_c_fabric_handle: If op_fabric_handle is specified, this value will be compared to the value in fabric_handle using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_fabric_handle must be specified if op_fabric_handle is specified. :type val_c_fabric_handle: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param op_fabric_id: The operator to apply to the field fabric_id. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. fabric_id: Identifier of SdnSetting from which this network was collected For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values. :type op_fabric_id: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_f_fabric_id: If op_fabric_id is specified, the field named in this input will be compared to the value in fabric_id using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_fabric_id must be specified if op_fabric_id is specified. :type val_f_fabric_id: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_c_fabric_id: If op_fabric_id is specified, this value will be compared to the value in fabric_id using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_fabric_id must be specified if op_fabric_id is specified. :type val_c_fabric_id: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param op_sdn_network_id: The operator to apply to the field sdn_network_id. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. sdn_network_id: The internal NetMRI identifier for this network For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values. :type op_sdn_network_id: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_f_sdn_network_id: If op_sdn_network_id is specified, the field named in this input will be compared to the value in sdn_network_id using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_sdn_network_id must be specified if op_sdn_network_id is specified. :type val_f_sdn_network_id: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_c_sdn_network_id: If op_sdn_network_id is specified, this value will be compared to the value in sdn_network_id using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_sdn_network_id must be specified if op_sdn_network_id is specified. :type val_c_sdn_network_id: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param op_sdn_network_key: The operator to apply to the field sdn_network_key. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. sdn_network_key: The unique identifier of each network at the SDN controller side For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values. :type op_sdn_network_key: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_f_sdn_network_key: If op_sdn_network_key is specified, the field named in this input will be compared to the value in sdn_network_key using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_sdn_network_key must be specified if op_sdn_network_key is specified. :type val_f_sdn_network_key: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_c_sdn_network_key: If op_sdn_network_key is specified, this value will be compared to the value in sdn_network_key using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_sdn_network_key must be specified if op_sdn_network_key is specified. :type val_c_sdn_network_key: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param op_sdn_network_name: The operator to apply to the field sdn_network_name. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. sdn_network_name: Name of SDN network For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values. :type op_sdn_network_name: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_f_sdn_network_name: If op_sdn_network_name is specified, the field named in this input will be compared to the value in sdn_network_name using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_sdn_network_name must be specified if op_sdn_network_name is specified. :type val_f_sdn_network_name: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_c_sdn_network_name: If op_sdn_network_name is specified, this value will be compared to the value in sdn_network_name using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_sdn_network_name must be specified if op_sdn_network_name is specified. :type val_c_sdn_network_name: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param op_virtual_network_id: The operator to apply to the field virtual_network_id. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. virtual_network_id: ID of Virtual Network which is assigned to this network For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values. :type op_virtual_network_id: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_f_virtual_network_id: If op_virtual_network_id is specified, the field named in this input will be compared to the value in virtual_network_id using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_virtual_network_id must be specified if op_virtual_network_id is specified. :type val_f_virtual_network_id: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param val_c_virtual_network_id: If op_virtual_network_id is specified, this value will be compared to the value in virtual_network_id using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_virtual_network_id must be specified if op_virtual_network_id is specified. :type val_c_virtual_network_id: String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param methods: A list of sdn network methods. The listed methods will be called on each sdn network returned and included in the output. Available methods are: fabric_handle. :type methods: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` 0 :param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information. :type start: Integer | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` 1000 :param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000. :type limit: Integer | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` sdn_network_id :param sort: The data field(s) to use for sorting the output. Default is sdn_network_id. Valid values are sdn_network_id, sdn_network_key, sdn_network_name, fabric_id, virtual_network_id, StartTime, EndTime. :type sort: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` asc :param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'. :type dir: Array of String | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param select: The list of attributes to return for each SdnNetwork. Valid values are sdn_network_id, sdn_network_key, sdn_network_name, fabric_id, virtual_network_id, StartTime, EndTime. If empty or omitted, all attributes will be returned. :type select: Array | ``api version min:`` 2.8 | ``api version max:`` None | ``required:`` False | ``default:`` None :param goto_field: The field name for NIOS GOTO that is used for locating a row position of records. :type goto_field: String | ``api version min:`` 2.8 | ``api version max:`` None | ``required:`` False | ``default:`` None :param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records. :type goto_value: String | ``api version min:`` 2.3 | ``api version max:`` None | ``required:`` False | ``default:`` None :param xml_filter: A SetFilter XML structure to further refine the search. The SetFilter will be applied AFTER any search query or field values, but before any limit options. The limit and pagination will be enforced after the filter. Remind that this kind of filter may be costly and inefficient if not associated with a database filtering. :type xml_filter: String **Outputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :return sdn_networks: An array of the SdnNetwork objects that match the specified input criteria. :rtype sdn_networks: Array of SdnNetwork """ return self.api_list_request(self._get_method_fullname("find"), kwargs) def show(self, **kwargs): """Shows the details for the specified sdn network. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` True | ``default:`` None :param sdn_network_id: The internal NetMRI identifier for this network :type sdn_network_id: Integer | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :param methods: A list of sdn network methods. The listed methods will be called on each sdn network returned and included in the output. Available methods are: fabric_handle. :type methods: Array of String **Outputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` False | ``default:`` None :return sdn_network: The sdn network identified by the specified sdn_network_id. :rtype sdn_network: SdnNetwork """ return self.api_request(self._get_method_fullname("show"), kwargs)
[ 1, 529, 276, 1112, 420, 29958, 797, 29887, 3034, 29963, 29954, 29899, 8979, 29914, 7192, 711, 417, 29916, 29899, 1212, 29885, 374, 13, 3166, 6317, 6729, 3946, 1053, 4358, 3946, 13, 13, 1990, 317, 5200, 13724, 29857, 3946, 29898, 29857, 3946, 1125, 13, 1678, 4701, 353, 376, 4928, 29876, 29918, 11618, 29879, 29908, 13, 268, 13, 268, 13, 1678, 822, 2380, 29898, 1311, 29892, 3579, 19290, 1125, 13, 268, 13, 4706, 9995, 1293, 29879, 278, 3625, 269, 5200, 14379, 29889, 3139, 310, 278, 10970, 9904, 1122, 367, 367, 1304, 304, 12474, 278, 1051, 29936, 916, 10970, 674, 367, 17262, 29889, 4587, 278, 5164, 5837, 304, 2346, 8857, 29892, 773, 445, 1158, 338, 1556, 8543, 29889, 13, 13, 9651, 3579, 4290, 29879, 1068, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29941, 29889, 29946, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 269, 5200, 29918, 11618, 29918, 333, 29901, 450, 7463, 12670, 29924, 3960, 15882, 363, 445, 3564, 13, 632, 584, 1853, 269, 5200, 29918, 11618, 29918, 333, 29901, 4398, 310, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29941, 29889, 29946, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 269, 5200, 29918, 11618, 29918, 1989, 29901, 450, 5412, 15882, 310, 1269, 3564, 472, 278, 8073, 29940, 4701, 2625, 13, 632, 584, 1853, 269, 5200, 29918, 11618, 29918, 1989, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 3519, 29901, 319, 1051, 310, 269, 5200, 3564, 3519, 29889, 450, 9904, 3519, 674, 367, 2000, 373, 1269, 269, 5200, 3564, 4133, 322, 5134, 297, 278, 1962, 29889, 7740, 3106, 3519, 526, 29901, 18187, 29918, 8411, 29889, 13, 632, 584, 1853, 3519, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 29871, 29900, 13, 13, 632, 584, 3207, 1369, 29901, 450, 2407, 1353, 304, 736, 297, 278, 4629, 1813, 310, 848, 29889, 739, 674, 2337, 2615, 29892, 5998, 372, 1122, 451, 367, 278, 937, 2407, 29889, 2823, 278, 584, 13400, 363, 901, 2472, 29889, 13, 632, 584, 1853, 1369, 29901, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 29871, 29896, 29900, 29900, 29900, 13, 13, 632, 584, 3207, 4046, 29901, 450, 2159, 310, 278, 1813, 310, 848, 29892, 393, 338, 29892, 278, 7472, 1353, 310, 6475, 4133, 29889, 450, 4046, 2159, 674, 367, 1304, 304, 2867, 278, 848, 701, 964, 6515, 322, 278, 937, 1813, 411, 278, 1369, 2407, 674, 367, 4133, 29889, 1105, 565, 366, 505, 29871, 29896, 29900, 29900, 6475, 322, 671, 263, 584, 13400, 310, 29871, 29896, 29900, 322, 263, 584, 2962, 310, 29871, 29896, 29900, 29892, 366, 674, 679, 6475, 29871, 29896, 29900, 29899, 29896, 29929, 29889, 450, 7472, 4046, 338, 29871, 29896, 29900, 29900, 29900, 29900, 29889, 13, 632, 584, 1853, 4046, 29901, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 269, 5200, 29918, 11618, 29918, 333, 13, 13, 632, 584, 3207, 2656, 29901, 450, 848, 1746, 29898, 29879, 29897, 304, 671, 363, 16548, 278, 1962, 29889, 13109, 338, 269, 5200, 29918, 11618, 29918, 333, 29889, 15758, 1819, 526, 269, 5200, 29918, 11618, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 1989, 29892, 269, 5200, 29918, 11618, 29918, 978, 29892, 18187, 29918, 333, 29892, 6901, 29918, 11618, 29918, 333, 29892, 7370, 2481, 29892, 2796, 2481, 29889, 13, 632, 584, 1853, 2656, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 12066, 13, 13, 632, 584, 3207, 4516, 29901, 450, 5305, 29898, 29879, 29897, 297, 607, 304, 2656, 278, 848, 29889, 13109, 338, 525, 6151, 4286, 15758, 1819, 526, 525, 6151, 29915, 322, 525, 14273, 4286, 13, 632, 584, 1853, 4516, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1831, 29901, 450, 1051, 310, 8393, 304, 736, 363, 1269, 317, 5200, 13724, 29889, 15758, 1819, 526, 269, 5200, 29918, 11618, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 1989, 29892, 269, 5200, 29918, 11618, 29918, 978, 29892, 18187, 29918, 333, 29892, 6901, 29918, 11618, 29918, 333, 29892, 7370, 2481, 29892, 2796, 2481, 29889, 960, 4069, 470, 25811, 29892, 599, 8393, 674, 367, 4133, 29889, 13, 632, 584, 1853, 1831, 29901, 4398, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29906, 29889, 29947, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 2355, 29877, 29918, 2671, 29901, 450, 1746, 1024, 363, 405, 25925, 402, 2891, 29949, 393, 338, 1304, 363, 1180, 1218, 263, 1948, 2602, 310, 6475, 29889, 13, 632, 584, 1853, 2355, 29877, 29918, 2671, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29906, 29889, 29947, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 2355, 29877, 29918, 1767, 29901, 450, 995, 310, 2355, 29877, 29918, 2671, 363, 405, 25925, 402, 2891, 29949, 393, 338, 1304, 363, 1180, 1218, 263, 1948, 2602, 310, 6475, 29889, 13, 632, 584, 1853, 2355, 29877, 29918, 1767, 29901, 1714, 13, 13, 9651, 3579, 6466, 29879, 1068, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 2457, 269, 5200, 29918, 11618, 29879, 29901, 530, 1409, 310, 278, 317, 5200, 13724, 3618, 393, 1993, 278, 6790, 1881, 16614, 29889, 13, 632, 584, 29878, 1853, 269, 5200, 29918, 11618, 29879, 29901, 4398, 310, 317, 5200, 13724, 13, 13, 9651, 9995, 13, 308, 13, 4706, 736, 1583, 29889, 2754, 29918, 1761, 29918, 3827, 29898, 1311, 3032, 657, 29918, 5696, 29918, 8159, 978, 703, 2248, 4968, 9049, 5085, 29897, 13, 308, 13, 268, 13, 268, 13, 1678, 822, 2740, 29898, 1311, 29892, 3579, 19290, 1125, 13, 268, 13, 4706, 9995, 1293, 29879, 278, 3625, 269, 5200, 14379, 9686, 278, 1881, 16614, 29889, 910, 1158, 8128, 263, 901, 25706, 2740, 5067, 1135, 278, 2380, 1158, 29892, 541, 11975, 773, 445, 1158, 338, 901, 9667, 292, 373, 278, 1788, 322, 674, 451, 2189, 304, 278, 1021, 3233, 408, 278, 2380, 1158, 29889, 450, 1881, 4235, 9904, 2400, 674, 367, 1304, 408, 297, 278, 2380, 1158, 29892, 304, 4175, 278, 1121, 29892, 3412, 411, 278, 13136, 2346, 1347, 322, 6560, 4175, 5439, 2400, 29889, 13, 13, 9651, 3579, 4290, 29879, 1068, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29941, 29889, 29946, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 2796, 2481, 29901, 450, 17140, 2635, 29914, 2230, 310, 445, 3564, 13, 632, 584, 1853, 2796, 2481, 29901, 4398, 310, 12315, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29941, 29889, 29946, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 7370, 2481, 29901, 450, 6257, 2635, 29914, 2230, 310, 445, 3564, 13, 632, 584, 1853, 7370, 2481, 29901, 4398, 310, 12315, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29941, 29889, 29946, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 18187, 29918, 333, 29901, 20286, 310, 317, 5200, 29020, 515, 607, 445, 3564, 471, 16531, 13, 632, 584, 1853, 18187, 29918, 333, 29901, 4398, 310, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29941, 29889, 29946, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 269, 5200, 29918, 11618, 29918, 333, 29901, 450, 7463, 12670, 29924, 3960, 15882, 363, 445, 3564, 13, 632, 584, 1853, 269, 5200, 29918, 11618, 29918, 333, 29901, 4398, 310, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29941, 29889, 29946, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 269, 5200, 29918, 11618, 29918, 1989, 29901, 450, 5412, 15882, 310, 1269, 3564, 472, 278, 8073, 29940, 4701, 2625, 13, 632, 584, 1853, 269, 5200, 29918, 11618, 29918, 1989, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29941, 29889, 29946, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 269, 5200, 29918, 11618, 29918, 978, 29901, 4408, 310, 8073, 29940, 3564, 13, 632, 584, 1853, 269, 5200, 29918, 11618, 29918, 978, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29941, 29889, 29946, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 6901, 29918, 11618, 29918, 333, 29901, 3553, 310, 19181, 8527, 607, 338, 9859, 304, 445, 3564, 13, 632, 584, 1853, 6901, 29918, 11618, 29918, 333, 29901, 4398, 310, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 3519, 29901, 319, 1051, 310, 269, 5200, 3564, 3519, 29889, 450, 9904, 3519, 674, 367, 2000, 373, 1269, 269, 5200, 3564, 4133, 322, 5134, 297, 278, 1962, 29889, 7740, 3106, 3519, 526, 29901, 18187, 29918, 8411, 29889, 13, 632, 584, 1853, 3519, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 29871, 29900, 13, 13, 632, 584, 3207, 1369, 29901, 450, 2407, 1353, 304, 736, 297, 278, 4629, 1813, 310, 848, 29889, 739, 674, 2337, 2615, 29892, 5998, 372, 1122, 451, 367, 278, 937, 2407, 29889, 2823, 278, 584, 13400, 363, 901, 2472, 29889, 13, 632, 584, 1853, 1369, 29901, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 29871, 29896, 29900, 29900, 29900, 13, 13, 632, 584, 3207, 4046, 29901, 450, 2159, 310, 278, 1813, 310, 848, 29892, 393, 338, 29892, 278, 7472, 1353, 310, 6475, 4133, 29889, 450, 4046, 2159, 674, 367, 1304, 304, 2867, 278, 848, 701, 964, 6515, 322, 278, 937, 1813, 411, 278, 1369, 2407, 674, 367, 4133, 29889, 1105, 565, 366, 505, 29871, 29896, 29900, 29900, 6475, 322, 671, 263, 584, 13400, 310, 29871, 29896, 29900, 322, 263, 584, 2962, 310, 29871, 29896, 29900, 29892, 366, 674, 679, 6475, 29871, 29896, 29900, 29899, 29896, 29929, 29889, 450, 7472, 4046, 338, 29871, 29896, 29900, 29900, 29900, 29900, 29889, 13, 632, 584, 1853, 4046, 29901, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 269, 5200, 29918, 11618, 29918, 333, 13, 13, 632, 584, 3207, 2656, 29901, 450, 848, 1746, 29898, 29879, 29897, 304, 671, 363, 16548, 278, 1962, 29889, 13109, 338, 269, 5200, 29918, 11618, 29918, 333, 29889, 15758, 1819, 526, 269, 5200, 29918, 11618, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 1989, 29892, 269, 5200, 29918, 11618, 29918, 978, 29892, 18187, 29918, 333, 29892, 6901, 29918, 11618, 29918, 333, 29892, 7370, 2481, 29892, 2796, 2481, 29889, 13, 632, 584, 1853, 2656, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 12066, 13, 13, 632, 584, 3207, 4516, 29901, 450, 5305, 29898, 29879, 29897, 297, 607, 304, 2656, 278, 848, 29889, 13109, 338, 525, 6151, 4286, 15758, 1819, 526, 525, 6151, 29915, 322, 525, 14273, 4286, 13, 632, 584, 1853, 4516, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1831, 29901, 450, 1051, 310, 8393, 304, 736, 363, 1269, 317, 5200, 13724, 29889, 15758, 1819, 526, 269, 5200, 29918, 11618, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 1989, 29892, 269, 5200, 29918, 11618, 29918, 978, 29892, 18187, 29918, 333, 29892, 6901, 29918, 11618, 29918, 333, 29892, 7370, 2481, 29892, 2796, 2481, 29889, 960, 4069, 470, 25811, 29892, 599, 8393, 674, 367, 4133, 29889, 13, 632, 584, 1853, 1831, 29901, 4398, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29906, 29889, 29947, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 2355, 29877, 29918, 2671, 29901, 450, 1746, 1024, 363, 405, 25925, 402, 2891, 29949, 393, 338, 1304, 363, 1180, 1218, 263, 1948, 2602, 310, 6475, 29889, 13, 632, 584, 1853, 2355, 29877, 29918, 2671, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29906, 29889, 29947, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 2355, 29877, 29918, 1767, 29901, 450, 995, 310, 2355, 29877, 29918, 2671, 363, 405, 25925, 402, 2891, 29949, 393, 338, 1304, 363, 1180, 1218, 263, 1948, 2602, 310, 6475, 29889, 13, 632, 584, 1853, 2355, 29877, 29918, 1767, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 2346, 29901, 910, 995, 674, 367, 19228, 2750, 269, 5200, 14379, 29892, 3063, 304, 1074, 565, 697, 470, 901, 310, 278, 9904, 8393, 1712, 278, 4502, 995, 29889, 887, 1122, 884, 8388, 618, 278, 995, 411, 8207, 29915, 322, 8207, 29915, 304, 2189, 263, 4943, 4603, 2740, 3265, 1135, 263, 1712, 358, 5858, 29889, 3139, 2407, 393, 7087, 674, 367, 4133, 29889, 450, 8393, 17371, 526, 29901, 2796, 2481, 29892, 7370, 2481, 29892, 18187, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 1989, 29892, 269, 5200, 29918, 11618, 29918, 978, 29892, 6901, 29918, 11618, 29918, 333, 29889, 13, 632, 584, 1853, 2346, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29906, 29889, 29941, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 4903, 29918, 4572, 29901, 319, 3789, 5072, 6560, 3829, 304, 4340, 2143, 457, 278, 2740, 29889, 450, 3789, 5072, 674, 367, 7436, 23844, 4945, 738, 2740, 2346, 470, 1746, 1819, 29892, 541, 1434, 738, 4046, 3987, 29889, 450, 4046, 322, 10203, 3381, 674, 367, 24555, 1133, 1156, 278, 4175, 29889, 5240, 513, 393, 445, 2924, 310, 4175, 1122, 367, 3438, 368, 322, 297, 8462, 565, 451, 6942, 411, 263, 2566, 21166, 29889, 13, 632, 584, 1853, 4903, 29918, 4572, 29901, 1714, 13, 13, 9651, 3579, 6466, 29879, 1068, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 2457, 269, 5200, 29918, 11618, 29879, 29901, 530, 1409, 310, 278, 317, 5200, 13724, 3618, 393, 1993, 278, 6790, 1881, 16614, 29889, 13, 632, 584, 29878, 1853, 269, 5200, 29918, 11618, 29879, 29901, 4398, 310, 317, 5200, 13724, 13, 13, 9651, 9995, 13, 308, 13, 4706, 736, 1583, 29889, 2754, 29918, 1761, 29918, 3827, 29898, 1311, 3032, 657, 29918, 5696, 29918, 8159, 978, 703, 4478, 4968, 9049, 5085, 29897, 13, 308, 13, 268, 13, 268, 13, 1678, 822, 1284, 29898, 1311, 29892, 3579, 19290, 1125, 13, 268, 13, 4706, 9995, 1293, 29879, 278, 3625, 269, 5200, 14379, 9686, 278, 1881, 21992, 29889, 910, 8128, 278, 1556, 25706, 2740, 21992, 310, 599, 278, 2346, 7208, 12903, 29892, 427, 17961, 11975, 773, 10230, 6931, 916, 1135, 17193, 29889, 2398, 29892, 372, 338, 901, 4280, 304, 671, 322, 674, 451, 2189, 408, 29497, 408, 278, 2380, 470, 2740, 3519, 29889, 512, 278, 1881, 2342, 1980, 2400, 29892, 525, 2671, 2983, 29915, 14637, 304, 278, 1494, 4235, 29901, 2796, 2481, 29892, 7370, 2481, 29892, 18187, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 1989, 29892, 269, 5200, 29918, 11618, 29918, 978, 29892, 6901, 29918, 11618, 29918, 333, 29889, 13, 13, 9651, 3579, 4290, 29879, 1068, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1015, 29918, 5044, 2481, 29901, 450, 5455, 304, 3394, 304, 278, 1746, 2796, 2481, 29889, 15758, 1819, 526, 29901, 353, 29892, 529, 10202, 364, 4561, 29892, 451, 364, 4561, 29892, 1405, 29892, 6736, 29892, 529, 29892, 5277, 29892, 763, 29892, 451, 763, 29892, 338, 1870, 29892, 338, 451, 1870, 29892, 1546, 29889, 2796, 2481, 29901, 450, 17140, 2635, 29914, 2230, 310, 445, 3564, 1152, 278, 1546, 5455, 278, 995, 674, 367, 14914, 408, 385, 4398, 565, 16694, 628, 326, 1573, 1347, 338, 4502, 29892, 322, 372, 1818, 1712, 385, 1584, 1353, 310, 1819, 29889, 13, 632, 584, 1853, 1015, 29918, 5044, 2481, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29888, 29918, 5044, 2481, 29901, 960, 1015, 29918, 5044, 2481, 338, 6790, 29892, 278, 1746, 4257, 297, 445, 1881, 674, 367, 9401, 304, 278, 995, 297, 2796, 2481, 773, 278, 6790, 5455, 29889, 2193, 338, 29892, 278, 995, 297, 445, 1881, 674, 367, 14914, 408, 1790, 1746, 1024, 29892, 3265, 1135, 263, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29883, 29918, 5044, 2481, 1818, 367, 6790, 565, 1015, 29918, 5044, 2481, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29888, 29918, 5044, 2481, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29883, 29918, 5044, 2481, 29901, 960, 1015, 29918, 5044, 2481, 338, 6790, 29892, 445, 995, 674, 367, 9401, 304, 278, 995, 297, 2796, 2481, 773, 278, 6790, 5455, 29889, 450, 995, 297, 445, 1881, 674, 367, 14914, 408, 385, 6261, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29888, 29918, 5044, 2481, 1818, 367, 6790, 565, 1015, 29918, 5044, 2481, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29883, 29918, 5044, 2481, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1015, 29918, 4763, 2481, 29901, 450, 5455, 304, 3394, 304, 278, 1746, 7370, 2481, 29889, 15758, 1819, 526, 29901, 353, 29892, 529, 10202, 364, 4561, 29892, 451, 364, 4561, 29892, 1405, 29892, 6736, 29892, 529, 29892, 5277, 29892, 763, 29892, 451, 763, 29892, 338, 1870, 29892, 338, 451, 1870, 29892, 1546, 29889, 7370, 2481, 29901, 450, 6257, 2635, 29914, 2230, 310, 445, 3564, 1152, 278, 1546, 5455, 278, 995, 674, 367, 14914, 408, 385, 4398, 565, 16694, 628, 326, 1573, 1347, 338, 4502, 29892, 322, 372, 1818, 1712, 385, 1584, 1353, 310, 1819, 29889, 13, 632, 584, 1853, 1015, 29918, 4763, 2481, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29888, 29918, 4763, 2481, 29901, 960, 1015, 29918, 4763, 2481, 338, 6790, 29892, 278, 1746, 4257, 297, 445, 1881, 674, 367, 9401, 304, 278, 995, 297, 7370, 2481, 773, 278, 6790, 5455, 29889, 2193, 338, 29892, 278, 995, 297, 445, 1881, 674, 367, 14914, 408, 1790, 1746, 1024, 29892, 3265, 1135, 263, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29883, 29918, 4763, 2481, 1818, 367, 6790, 565, 1015, 29918, 4763, 2481, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29888, 29918, 4763, 2481, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29883, 29918, 4763, 2481, 29901, 960, 1015, 29918, 4763, 2481, 338, 6790, 29892, 445, 995, 674, 367, 9401, 304, 278, 995, 297, 7370, 2481, 773, 278, 6790, 5455, 29889, 450, 995, 297, 445, 1881, 674, 367, 14914, 408, 385, 6261, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29888, 29918, 4763, 2481, 1818, 367, 6790, 565, 1015, 29918, 4763, 2481, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29883, 29918, 4763, 2481, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1015, 29918, 16582, 2200, 29918, 8411, 29901, 450, 5455, 304, 3394, 304, 278, 1746, 18187, 29918, 8411, 29889, 15758, 1819, 526, 29901, 353, 29892, 529, 10202, 364, 4561, 29892, 451, 364, 4561, 29892, 1405, 29892, 6736, 29892, 529, 29892, 5277, 29892, 763, 29892, 451, 763, 29892, 338, 1870, 29892, 338, 451, 1870, 29892, 1546, 29889, 18187, 29918, 8411, 29901, 4408, 310, 8073, 29940, 4701, 515, 607, 445, 3564, 471, 16531, 29889, 1152, 278, 1546, 5455, 278, 995, 674, 367, 14914, 408, 385, 4398, 565, 16694, 628, 326, 1573, 1347, 338, 4502, 29892, 322, 372, 1818, 1712, 385, 1584, 1353, 310, 1819, 29889, 13, 632, 584, 1853, 1015, 29918, 16582, 2200, 29918, 8411, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29888, 29918, 16582, 2200, 29918, 8411, 29901, 960, 1015, 29918, 16582, 2200, 29918, 8411, 338, 6790, 29892, 278, 1746, 4257, 297, 445, 1881, 674, 367, 9401, 304, 278, 995, 297, 18187, 29918, 8411, 773, 278, 6790, 5455, 29889, 2193, 338, 29892, 278, 995, 297, 445, 1881, 674, 367, 14914, 408, 1790, 1746, 1024, 29892, 3265, 1135, 263, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29883, 29918, 16582, 2200, 29918, 8411, 1818, 367, 6790, 565, 1015, 29918, 16582, 2200, 29918, 8411, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29888, 29918, 16582, 2200, 29918, 8411, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29883, 29918, 16582, 2200, 29918, 8411, 29901, 960, 1015, 29918, 16582, 2200, 29918, 8411, 338, 6790, 29892, 445, 995, 674, 367, 9401, 304, 278, 995, 297, 18187, 29918, 8411, 773, 278, 6790, 5455, 29889, 450, 995, 297, 445, 1881, 674, 367, 14914, 408, 385, 6261, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29888, 29918, 16582, 2200, 29918, 8411, 1818, 367, 6790, 565, 1015, 29918, 16582, 2200, 29918, 8411, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29883, 29918, 16582, 2200, 29918, 8411, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1015, 29918, 16582, 2200, 29918, 333, 29901, 450, 5455, 304, 3394, 304, 278, 1746, 18187, 29918, 333, 29889, 15758, 1819, 526, 29901, 353, 29892, 529, 10202, 364, 4561, 29892, 451, 364, 4561, 29892, 1405, 29892, 6736, 29892, 529, 29892, 5277, 29892, 763, 29892, 451, 763, 29892, 338, 1870, 29892, 338, 451, 1870, 29892, 1546, 29889, 18187, 29918, 333, 29901, 20286, 310, 317, 5200, 29020, 515, 607, 445, 3564, 471, 16531, 1152, 278, 1546, 5455, 278, 995, 674, 367, 14914, 408, 385, 4398, 565, 16694, 628, 326, 1573, 1347, 338, 4502, 29892, 322, 372, 1818, 1712, 385, 1584, 1353, 310, 1819, 29889, 13, 632, 584, 1853, 1015, 29918, 16582, 2200, 29918, 333, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29888, 29918, 16582, 2200, 29918, 333, 29901, 960, 1015, 29918, 16582, 2200, 29918, 333, 338, 6790, 29892, 278, 1746, 4257, 297, 445, 1881, 674, 367, 9401, 304, 278, 995, 297, 18187, 29918, 333, 773, 278, 6790, 5455, 29889, 2193, 338, 29892, 278, 995, 297, 445, 1881, 674, 367, 14914, 408, 1790, 1746, 1024, 29892, 3265, 1135, 263, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29883, 29918, 16582, 2200, 29918, 333, 1818, 367, 6790, 565, 1015, 29918, 16582, 2200, 29918, 333, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29888, 29918, 16582, 2200, 29918, 333, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29883, 29918, 16582, 2200, 29918, 333, 29901, 960, 1015, 29918, 16582, 2200, 29918, 333, 338, 6790, 29892, 445, 995, 674, 367, 9401, 304, 278, 995, 297, 18187, 29918, 333, 773, 278, 6790, 5455, 29889, 450, 995, 297, 445, 1881, 674, 367, 14914, 408, 385, 6261, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29888, 29918, 16582, 2200, 29918, 333, 1818, 367, 6790, 565, 1015, 29918, 16582, 2200, 29918, 333, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29883, 29918, 16582, 2200, 29918, 333, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 333, 29901, 450, 5455, 304, 3394, 304, 278, 1746, 269, 5200, 29918, 11618, 29918, 333, 29889, 15758, 1819, 526, 29901, 353, 29892, 529, 10202, 364, 4561, 29892, 451, 364, 4561, 29892, 1405, 29892, 6736, 29892, 529, 29892, 5277, 29892, 763, 29892, 451, 763, 29892, 338, 1870, 29892, 338, 451, 1870, 29892, 1546, 29889, 269, 5200, 29918, 11618, 29918, 333, 29901, 450, 7463, 12670, 29924, 3960, 15882, 363, 445, 3564, 1152, 278, 1546, 5455, 278, 995, 674, 367, 14914, 408, 385, 4398, 565, 16694, 628, 326, 1573, 1347, 338, 4502, 29892, 322, 372, 1818, 1712, 385, 1584, 1353, 310, 1819, 29889, 13, 632, 584, 1853, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 333, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29888, 29918, 4928, 29876, 29918, 11618, 29918, 333, 29901, 960, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 333, 338, 6790, 29892, 278, 1746, 4257, 297, 445, 1881, 674, 367, 9401, 304, 278, 995, 297, 269, 5200, 29918, 11618, 29918, 333, 773, 278, 6790, 5455, 29889, 2193, 338, 29892, 278, 995, 297, 445, 1881, 674, 367, 14914, 408, 1790, 1746, 1024, 29892, 3265, 1135, 263, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29883, 29918, 4928, 29876, 29918, 11618, 29918, 333, 1818, 367, 6790, 565, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 333, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29888, 29918, 4928, 29876, 29918, 11618, 29918, 333, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29883, 29918, 4928, 29876, 29918, 11618, 29918, 333, 29901, 960, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 333, 338, 6790, 29892, 445, 995, 674, 367, 9401, 304, 278, 995, 297, 269, 5200, 29918, 11618, 29918, 333, 773, 278, 6790, 5455, 29889, 450, 995, 297, 445, 1881, 674, 367, 14914, 408, 385, 6261, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29888, 29918, 4928, 29876, 29918, 11618, 29918, 333, 1818, 367, 6790, 565, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 333, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29883, 29918, 4928, 29876, 29918, 11618, 29918, 333, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 29901, 450, 5455, 304, 3394, 304, 278, 1746, 269, 5200, 29918, 11618, 29918, 1989, 29889, 15758, 1819, 526, 29901, 353, 29892, 529, 10202, 364, 4561, 29892, 451, 364, 4561, 29892, 1405, 29892, 6736, 29892, 529, 29892, 5277, 29892, 763, 29892, 451, 763, 29892, 338, 1870, 29892, 338, 451, 1870, 29892, 1546, 29889, 269, 5200, 29918, 11618, 29918, 1989, 29901, 450, 5412, 15882, 310, 1269, 3564, 472, 278, 8073, 29940, 4701, 2625, 1152, 278, 1546, 5455, 278, 995, 674, 367, 14914, 408, 385, 4398, 565, 16694, 628, 326, 1573, 1347, 338, 4502, 29892, 322, 372, 1818, 1712, 385, 1584, 1353, 310, 1819, 29889, 13, 632, 584, 1853, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29888, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 29901, 960, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 338, 6790, 29892, 278, 1746, 4257, 297, 445, 1881, 674, 367, 9401, 304, 278, 995, 297, 269, 5200, 29918, 11618, 29918, 1989, 773, 278, 6790, 5455, 29889, 2193, 338, 29892, 278, 995, 297, 445, 1881, 674, 367, 14914, 408, 1790, 1746, 1024, 29892, 3265, 1135, 263, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29883, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 1818, 367, 6790, 565, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29888, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29883, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 29901, 960, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 338, 6790, 29892, 445, 995, 674, 367, 9401, 304, 278, 995, 297, 269, 5200, 29918, 11618, 29918, 1989, 773, 278, 6790, 5455, 29889, 450, 995, 297, 445, 1881, 674, 367, 14914, 408, 385, 6261, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29888, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 1818, 367, 6790, 565, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29883, 29918, 4928, 29876, 29918, 11618, 29918, 1989, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 978, 29901, 450, 5455, 304, 3394, 304, 278, 1746, 269, 5200, 29918, 11618, 29918, 978, 29889, 15758, 1819, 526, 29901, 353, 29892, 529, 10202, 364, 4561, 29892, 451, 364, 4561, 29892, 1405, 29892, 6736, 29892, 529, 29892, 5277, 29892, 763, 29892, 451, 763, 29892, 338, 1870, 29892, 338, 451, 1870, 29892, 1546, 29889, 269, 5200, 29918, 11618, 29918, 978, 29901, 4408, 310, 8073, 29940, 3564, 1152, 278, 1546, 5455, 278, 995, 674, 367, 14914, 408, 385, 4398, 565, 16694, 628, 326, 1573, 1347, 338, 4502, 29892, 322, 372, 1818, 1712, 385, 1584, 1353, 310, 1819, 29889, 13, 632, 584, 1853, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 978, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29888, 29918, 4928, 29876, 29918, 11618, 29918, 978, 29901, 960, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 978, 338, 6790, 29892, 278, 1746, 4257, 297, 445, 1881, 674, 367, 9401, 304, 278, 995, 297, 269, 5200, 29918, 11618, 29918, 978, 773, 278, 6790, 5455, 29889, 2193, 338, 29892, 278, 995, 297, 445, 1881, 674, 367, 14914, 408, 1790, 1746, 1024, 29892, 3265, 1135, 263, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29883, 29918, 4928, 29876, 29918, 11618, 29918, 978, 1818, 367, 6790, 565, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 978, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29888, 29918, 4928, 29876, 29918, 11618, 29918, 978, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29883, 29918, 4928, 29876, 29918, 11618, 29918, 978, 29901, 960, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 978, 338, 6790, 29892, 445, 995, 674, 367, 9401, 304, 278, 995, 297, 269, 5200, 29918, 11618, 29918, 978, 773, 278, 6790, 5455, 29889, 450, 995, 297, 445, 1881, 674, 367, 14914, 408, 385, 6261, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29888, 29918, 4928, 29876, 29918, 11618, 29918, 978, 1818, 367, 6790, 565, 1015, 29918, 4928, 29876, 29918, 11618, 29918, 978, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29883, 29918, 4928, 29876, 29918, 11618, 29918, 978, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1015, 29918, 18714, 29918, 11618, 29918, 333, 29901, 450, 5455, 304, 3394, 304, 278, 1746, 6901, 29918, 11618, 29918, 333, 29889, 15758, 1819, 526, 29901, 353, 29892, 529, 10202, 364, 4561, 29892, 451, 364, 4561, 29892, 1405, 29892, 6736, 29892, 529, 29892, 5277, 29892, 763, 29892, 451, 763, 29892, 338, 1870, 29892, 338, 451, 1870, 29892, 1546, 29889, 6901, 29918, 11618, 29918, 333, 29901, 3553, 310, 19181, 8527, 607, 338, 9859, 304, 445, 3564, 1152, 278, 1546, 5455, 278, 995, 674, 367, 14914, 408, 385, 4398, 565, 16694, 628, 326, 1573, 1347, 338, 4502, 29892, 322, 372, 1818, 1712, 385, 1584, 1353, 310, 1819, 29889, 13, 632, 584, 1853, 1015, 29918, 18714, 29918, 11618, 29918, 333, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29888, 29918, 18714, 29918, 11618, 29918, 333, 29901, 960, 1015, 29918, 18714, 29918, 11618, 29918, 333, 338, 6790, 29892, 278, 1746, 4257, 297, 445, 1881, 674, 367, 9401, 304, 278, 995, 297, 6901, 29918, 11618, 29918, 333, 773, 278, 6790, 5455, 29889, 2193, 338, 29892, 278, 995, 297, 445, 1881, 674, 367, 14914, 408, 1790, 1746, 1024, 29892, 3265, 1135, 263, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29883, 29918, 18714, 29918, 11618, 29918, 333, 1818, 367, 6790, 565, 1015, 29918, 18714, 29918, 11618, 29918, 333, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29888, 29918, 18714, 29918, 11618, 29918, 333, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 659, 29918, 29883, 29918, 18714, 29918, 11618, 29918, 333, 29901, 960, 1015, 29918, 18714, 29918, 11618, 29918, 333, 338, 6790, 29892, 445, 995, 674, 367, 9401, 304, 278, 995, 297, 6901, 29918, 11618, 29918, 333, 773, 278, 6790, 5455, 29889, 450, 995, 297, 445, 1881, 674, 367, 14914, 408, 385, 6261, 4868, 995, 29889, 20370, 445, 1746, 470, 659, 29918, 29888, 29918, 18714, 29918, 11618, 29918, 333, 1818, 367, 6790, 565, 1015, 29918, 18714, 29918, 11618, 29918, 333, 338, 6790, 29889, 13, 632, 584, 1853, 659, 29918, 29883, 29918, 18714, 29918, 11618, 29918, 333, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 3519, 29901, 319, 1051, 310, 269, 5200, 3564, 3519, 29889, 450, 9904, 3519, 674, 367, 2000, 373, 1269, 269, 5200, 3564, 4133, 322, 5134, 297, 278, 1962, 29889, 7740, 3106, 3519, 526, 29901, 18187, 29918, 8411, 29889, 13, 632, 584, 1853, 3519, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 29871, 29900, 13, 13, 632, 584, 3207, 1369, 29901, 450, 2407, 1353, 304, 736, 297, 278, 4629, 1813, 310, 848, 29889, 739, 674, 2337, 2615, 29892, 5998, 372, 1122, 451, 367, 278, 937, 2407, 29889, 2823, 278, 584, 13400, 363, 901, 2472, 29889, 13, 632, 584, 1853, 1369, 29901, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 29871, 29896, 29900, 29900, 29900, 13, 13, 632, 584, 3207, 4046, 29901, 450, 2159, 310, 278, 1813, 310, 848, 29892, 393, 338, 29892, 278, 7472, 1353, 310, 6475, 4133, 29889, 450, 4046, 2159, 674, 367, 1304, 304, 2867, 278, 848, 701, 964, 6515, 322, 278, 937, 1813, 411, 278, 1369, 2407, 674, 367, 4133, 29889, 1105, 565, 366, 505, 29871, 29896, 29900, 29900, 6475, 322, 671, 263, 584, 13400, 310, 29871, 29896, 29900, 322, 263, 584, 2962, 310, 29871, 29896, 29900, 29892, 366, 674, 679, 6475, 29871, 29896, 29900, 29899, 29896, 29929, 29889, 450, 7472, 4046, 338, 29871, 29896, 29900, 29900, 29900, 29900, 29889, 13, 632, 584, 1853, 4046, 29901, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 269, 5200, 29918, 11618, 29918, 333, 13, 13, 632, 584, 3207, 2656, 29901, 450, 848, 1746, 29898, 29879, 29897, 304, 671, 363, 16548, 278, 1962, 29889, 13109, 338, 269, 5200, 29918, 11618, 29918, 333, 29889, 15758, 1819, 526, 269, 5200, 29918, 11618, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 1989, 29892, 269, 5200, 29918, 11618, 29918, 978, 29892, 18187, 29918, 333, 29892, 6901, 29918, 11618, 29918, 333, 29892, 7370, 2481, 29892, 2796, 2481, 29889, 13, 632, 584, 1853, 2656, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 12066, 13, 13, 632, 584, 3207, 4516, 29901, 450, 5305, 29898, 29879, 29897, 297, 607, 304, 2656, 278, 848, 29889, 13109, 338, 525, 6151, 4286, 15758, 1819, 526, 525, 6151, 29915, 322, 525, 14273, 4286, 13, 632, 584, 1853, 4516, 29901, 4398, 310, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 1831, 29901, 450, 1051, 310, 8393, 304, 736, 363, 1269, 317, 5200, 13724, 29889, 15758, 1819, 526, 269, 5200, 29918, 11618, 29918, 333, 29892, 269, 5200, 29918, 11618, 29918, 1989, 29892, 269, 5200, 29918, 11618, 29918, 978, 29892, 18187, 29918, 333, 29892, 6901, 29918, 11618, 29918, 333, 29892, 7370, 2481, 29892, 2796, 2481, 29889, 960, 4069, 470, 25811, 29892, 599, 8393, 674, 367, 4133, 29889, 13, 632, 584, 1853, 1831, 29901, 4398, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29906, 29889, 29947, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 2355, 29877, 29918, 2671, 29901, 450, 1746, 1024, 363, 405, 25925, 402, 2891, 29949, 393, 338, 1304, 363, 1180, 1218, 263, 1948, 2602, 310, 6475, 29889, 13, 632, 584, 1853, 2355, 29877, 29918, 2671, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29906, 29889, 29947, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 2355, 29877, 29918, 1767, 29901, 450, 995, 310, 2355, 29877, 29918, 2671, 363, 405, 25925, 402, 2891, 29949, 393, 338, 1304, 363, 1180, 1218, 263, 1948, 2602, 310, 6475, 29889, 13, 632, 584, 1853, 2355, 29877, 29918, 1767, 29901, 1714, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 29871, 29906, 29889, 29941, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 4903, 29918, 4572, 29901, 319, 3789, 5072, 6560, 3829, 304, 4340, 2143, 457, 278, 2740, 29889, 450, 3789, 5072, 674, 367, 7436, 23844, 4945, 738, 2740, 2346, 470, 1746, 1819, 29892, 541, 1434, 738, 4046, 3987, 29889, 450, 4046, 322, 10203, 3381, 674, 367, 24555, 1133, 1156, 278, 4175, 29889, 5240, 513, 393, 445, 2924, 310, 4175, 1122, 367, 3438, 368, 322, 297, 8462, 565, 451, 6942, 411, 263, 2566, 21166, 29889, 13, 632, 584, 1853, 4903, 29918, 4572, 29901, 1714, 13, 13, 9651, 3579, 6466, 29879, 1068, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 2457, 269, 5200, 29918, 11618, 29879, 29901, 530, 1409, 310, 278, 317, 5200, 13724, 3618, 393, 1993, 278, 6790, 1881, 16614, 29889, 13, 632, 584, 29878, 1853, 269, 5200, 29918, 11618, 29879, 29901, 4398, 310, 317, 5200, 13724, 13, 13, 9651, 9995, 13, 308, 13, 4706, 736, 1583, 29889, 2754, 29918, 1761, 29918, 3827, 29898, 1311, 3032, 657, 29918, 5696, 29918, 8159, 978, 703, 2886, 4968, 9049, 5085, 29897, 13, 308, 13, 268, 13, 268, 13, 1678, 822, 1510, 29898, 1311, 29892, 3579, 19290, 1125, 13, 268, 13, 4706, 9995, 2713, 1242, 278, 4902, 363, 278, 6790, 269, 5200, 3564, 29889, 13, 13, 9651, 3579, 4290, 29879, 1068, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 5852, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 269, 5200, 29918, 11618, 29918, 333, 29901, 450, 7463, 12670, 29924, 3960, 15882, 363, 445, 3564, 13, 632, 584, 1853, 269, 5200, 29918, 11618, 29918, 333, 29901, 8102, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 3207, 3519, 29901, 319, 1051, 310, 269, 5200, 3564, 3519, 29889, 450, 9904, 3519, 674, 367, 2000, 373, 1269, 269, 5200, 3564, 4133, 322, 5134, 297, 278, 1962, 29889, 7740, 3106, 3519, 526, 29901, 18187, 29918, 8411, 29889, 13, 632, 584, 1853, 3519, 29901, 4398, 310, 1714, 13, 13, 9651, 3579, 6466, 29879, 1068, 13, 13, 9651, 891, 29871, 4954, 2754, 1873, 1375, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 2754, 1873, 4236, 29901, 16159, 6213, 13, 9651, 891, 29871, 4954, 12403, 29901, 16159, 7700, 13, 9651, 891, 29871, 4954, 4381, 29901, 16159, 6213, 13, 13, 632, 584, 2457, 269, 5200, 29918, 11618, 29901, 450, 269, 5200, 3564, 15659, 491, 278, 6790, 269, 5200, 29918, 11618, 29918, 333, 29889, 13, 632, 584, 29878, 1853, 269, 5200, 29918, 11618, 29901, 317, 5200, 13724, 13, 13, 9651, 9995, 13, 308, 13, 4706, 736, 1583, 29889, 2754, 29918, 3827, 29898, 1311, 3032, 657, 29918, 5696, 29918, 8159, 978, 703, 4294, 4968, 9049, 5085, 29897, 13, 308, 13, 268, 2 ]
baseline/eval_sent.py
parallelcrawl/DataCollection
8
31240
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- import sys from strip_language_from_uri import LanguageStripper import urlparse correct, wrong = [], [] def strip_uri(uri, language_stripper): parsed_uri = urlparse.urlparse(uri) matched_language = language_stripper.match(parsed_uri.path) if not matched_language: matched_language = language_stripper.match(parsed_uri.query) assert matched_language stripped_path = language_stripper.strip(parsed_uri.path) stripped_query = language_stripper.strip(parsed_uri.query) stripped_uri = urlparse.ParseResult(parsed_uri.scheme, parsed_uri.netloc, stripped_path, parsed_uri.params, stripped_query, parsed_uri.fragment).geturl() return matched_language, stripped_uri if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() parser.add_argument( 'infile', type=argparse.FileType('r'), default=sys.stdin) parser.add_argument( '--outfile', type=argparse.FileType('w')) parser.add_argument('-filter', action="store_true") args = parser.parse_args() stripper = LanguageStripper() source_uris, target_uris = set(), set() for line in args.infile: source_uri, target_uri, source, target, score = line.split("\t") source_lang, stripped_source_uri = strip_uri(source_uri, stripper) target_lang, stripped_target_uri = strip_uri(target_uri, stripper) source_uris.add(source_uri) target_uris.add(target_uri) if stripped_source_uri != stripped_target_uri: wrong.append((stripped_source_uri, stripped_target_uri)) else: if args.outfile: args.outfile.write(line) correct.append((stripped_source_uri, stripped_target_uri)) print "found %s source and %s target uris" % (len(source_uris), len(target_uris)) total = len(wrong) + len(correct) total_unique = len(set(wrong).union(set(correct))) if wrong: print "Wrong: ", len(wrong), len(set(wrong)) if correct: print "Correct", len(correct), len(set(correct)) if total > 0: print "Acc1", float(len(wrong)) / total print "Acc2", float(len(set(wrong))) / total_unique
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 10876, 13, 3166, 17820, 29918, 11675, 29918, 3166, 29918, 5338, 1053, 17088, 855, 374, 2496, 13, 5215, 3142, 5510, 13, 13, 15728, 29892, 2743, 353, 19997, 5159, 13, 13, 13, 1753, 17820, 29918, 5338, 29898, 5338, 29892, 4086, 29918, 303, 374, 2496, 1125, 13, 1678, 21213, 29918, 5338, 353, 3142, 5510, 29889, 2271, 5510, 29898, 5338, 29897, 13, 13, 1678, 19228, 29918, 11675, 353, 4086, 29918, 303, 374, 2496, 29889, 4352, 29898, 862, 8485, 29918, 5338, 29889, 2084, 29897, 13, 1678, 565, 451, 19228, 29918, 11675, 29901, 13, 4706, 19228, 29918, 11675, 353, 4086, 29918, 303, 374, 2496, 29889, 4352, 29898, 862, 8485, 29918, 5338, 29889, 1972, 29897, 13, 4706, 4974, 19228, 29918, 11675, 13, 13, 1678, 10076, 2986, 29918, 2084, 353, 4086, 29918, 303, 374, 2496, 29889, 17010, 29898, 862, 8485, 29918, 5338, 29889, 2084, 29897, 13, 1678, 10076, 2986, 29918, 1972, 353, 4086, 29918, 303, 374, 2496, 29889, 17010, 29898, 862, 8485, 29918, 5338, 29889, 1972, 29897, 13, 1678, 10076, 2986, 29918, 5338, 353, 3142, 5510, 29889, 12914, 3591, 29898, 862, 8485, 29918, 5338, 29889, 816, 2004, 29892, 13, 462, 462, 4706, 21213, 29918, 5338, 29889, 1212, 2029, 29892, 13, 462, 462, 4706, 10076, 2986, 29918, 2084, 29892, 13, 462, 462, 4706, 21213, 29918, 5338, 29889, 7529, 29892, 13, 462, 462, 4706, 10076, 2986, 29918, 1972, 29892, 13, 462, 462, 4706, 21213, 29918, 5338, 29889, 20777, 467, 657, 2271, 580, 13, 1678, 736, 19228, 29918, 11675, 29892, 10076, 2986, 29918, 5338, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1053, 1852, 5510, 13, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 580, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 525, 262, 1445, 742, 1134, 29922, 1191, 5510, 29889, 2283, 1542, 877, 29878, 5477, 2322, 29922, 9675, 29889, 4172, 262, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 525, 489, 449, 1445, 742, 1134, 29922, 1191, 5510, 29889, 2283, 1542, 877, 29893, 8785, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 4572, 742, 3158, 543, 8899, 29918, 3009, 1159, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 10076, 2496, 353, 17088, 855, 374, 2496, 580, 13, 13, 1678, 2752, 29918, 332, 275, 29892, 3646, 29918, 332, 275, 353, 731, 3285, 731, 580, 13, 13, 1678, 363, 1196, 297, 6389, 29889, 262, 1445, 29901, 13, 4706, 2752, 29918, 5338, 29892, 3646, 29918, 5338, 29892, 2752, 29892, 3646, 29892, 8158, 353, 1196, 29889, 5451, 14182, 29873, 1159, 13, 4706, 2752, 29918, 3893, 29892, 10076, 2986, 29918, 4993, 29918, 5338, 353, 17820, 29918, 5338, 29898, 4993, 29918, 5338, 29892, 10076, 2496, 29897, 13, 4706, 3646, 29918, 3893, 29892, 10076, 2986, 29918, 5182, 29918, 5338, 353, 17820, 29918, 5338, 29898, 5182, 29918, 5338, 29892, 10076, 2496, 29897, 13, 4706, 2752, 29918, 332, 275, 29889, 1202, 29898, 4993, 29918, 5338, 29897, 13, 4706, 3646, 29918, 332, 275, 29889, 1202, 29898, 5182, 29918, 5338, 29897, 13, 4706, 565, 10076, 2986, 29918, 4993, 29918, 5338, 2804, 10076, 2986, 29918, 5182, 29918, 5338, 29901, 13, 9651, 2743, 29889, 4397, 3552, 303, 374, 2986, 29918, 4993, 29918, 5338, 29892, 10076, 2986, 29918, 5182, 29918, 5338, 876, 13, 4706, 1683, 29901, 13, 9651, 565, 6389, 29889, 449, 1445, 29901, 13, 18884, 6389, 29889, 449, 1445, 29889, 3539, 29898, 1220, 29897, 13, 9651, 1959, 29889, 4397, 3552, 303, 374, 2986, 29918, 4993, 29918, 5338, 29892, 10076, 2986, 29918, 5182, 29918, 5338, 876, 13, 13, 1678, 1596, 376, 11940, 1273, 29879, 2752, 322, 1273, 29879, 3646, 318, 3780, 29908, 1273, 313, 2435, 29898, 4993, 29918, 332, 275, 511, 7431, 29898, 5182, 29918, 332, 275, 876, 13, 13, 1678, 3001, 353, 7431, 29898, 15866, 549, 29897, 718, 7431, 29898, 15728, 29897, 13, 1678, 3001, 29918, 13092, 353, 7431, 29898, 842, 29898, 15866, 549, 467, 13094, 29898, 842, 29898, 15728, 4961, 13, 1678, 565, 2743, 29901, 13, 4706, 1596, 376, 29956, 29373, 29901, 9162, 29871, 7431, 29898, 15866, 549, 511, 7431, 29898, 842, 29898, 15866, 549, 876, 13, 1678, 565, 1959, 29901, 13, 4706, 1596, 376, 12521, 1621, 613, 7431, 29898, 15728, 511, 7431, 29898, 842, 29898, 15728, 876, 13, 1678, 565, 3001, 1405, 29871, 29900, 29901, 13, 4706, 1596, 376, 7504, 29896, 613, 5785, 29898, 2435, 29898, 15866, 549, 876, 847, 3001, 13, 4706, 1596, 376, 7504, 29906, 613, 5785, 29898, 2435, 29898, 842, 29898, 15866, 549, 4961, 847, 3001, 29918, 13092, 13, 2 ]
tensorflow_probability/python/bijectors/glow.py
PavanKishore21/probability
2
135473
<reponame>PavanKishore21/probability # Copyright 2020 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ """Glow bijector.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import numpy as np import tensorflow.compat.v2 as tf from tensorflow_probability.python.bijectors import bijector from tensorflow_probability.python.bijectors import blockwise from tensorflow_probability.python.bijectors import chain from tensorflow_probability.python.bijectors import composition from tensorflow_probability.python.bijectors import exp from tensorflow_probability.python.bijectors import identity from tensorflow_probability.python.bijectors import invert from tensorflow_probability.python.bijectors import real_nvp from tensorflow_probability.python.bijectors import reshape from tensorflow_probability.python.bijectors import scale from tensorflow_probability.python.bijectors import scale_matvec_lu from tensorflow_probability.python.bijectors import shift from tensorflow_probability.python.bijectors import transpose from tensorflow_probability.python.internal import dtype_util from tensorflow_probability.python.internal import prefer_static from tensorflow_probability.python.internal import tensorshape_util from tensorflow_probability.python.util.deferred_tensor import TransformedVariable from tensorflow_probability.python.util.seed_stream import SeedStream tfk = tf.keras tfkl = tfk.layers __all__ = [ 'Glow', 'GlowDefaultNetwork', 'GlowDefaultExitNetwork', ] class Glow(composition.Composition): r"""Implements the Glow Bijector from Kingma & Dhariwal (2018)[1]. Overview: `Glow` is a chain of bijectors which transforms a rank-1 tensor (vector) into a rank-3 tensor (e.g. an RGB image). `Glow` does this by chaining together an alternating series of "Blocks," "Squeezes," and "Exits" which are each themselves special chains of other bijectors. The intended use of `Glow` is as part of a `tfp.distributions.TransformedDistribution`, in which the base distribution over the vector space is used to generate samples in the image space. In the paper, an Independent Normal distribution is used as the base distribution. A "Block" (implemented as the `GlowBlock` Bijector) performs much of the transformations which allow glow to produce sophisticated and complex mappings between the image space and the latent space and therefore achieve rich image generation performance. A Block is composed of `num_steps_per_block` steps, which are each implemented as a `Chain` containing an `ActivationNormalization` (ActNorm) bijector, followed by an (invertible) `OneByOneConv` bijector, and finally a coupling bijector. The coupling bijector is an instance of a `RealNVP` bijector, and uses the `coupling_bijector_fn` function to instantiate the coupling bijector function which is given to the `RealNVP`. This function returns a bijector which defines the coupling (e.g. `Shift(Scale)` for affine coupling or `Shift` for additive coupling). A "Squeeze" converts spatial features into channel features. It is implemented using the `Expand` bijector. The difference in names is due to the fact that the `forward` function from glow is meant to ultimately correspond to sampling from a `tfp.util.TransformedDistribution` object, which would use `Expand` (Squeeze is just Invert(Expand)). The `Expand` bijector takes a tensor with shape `[H, W, C]` and returns a tensor with shape `[2H, 2W, C / 4]`, such that each 2x2x1 spatial tile in the output is composed from a single 1x1x4 tile in the input tensor, as depicted in the figure below. Forward pass (Expand) ______ __________ \ \ \ \ \ \\ \ ----> \ 1 \ 2 \ \\\__1__\ \____\____\ \\\__2__\ \ \ \ \\__3__\ <---- \ 3 \ 4 \ \__4__\ \____\____\ Inverse pass (Squeeze) This is implemented using a chain of `Reshape` -> `Transpose` -> `Reshape` bijectors. Note that on an inverse pass through the bijector, each Squeeze will cause the width/height of the image to decrease by a factor of 2. Therefore, the input image must be evenly divisible by 2 at least `num_glow_blocks` times, since it will pass through a Squeeze step that many times. An "Exit" is simply a junction at which some of the tensor "exits" from the glow bijector and therefore avoids any further alteration. Each exit is implemented as a `Blockwise` bijector, where some channels are given to the rest of the glow model, and the rest are given to a bypass implemented using the `Identity` bijector. The fraction of channels to be removed at each exit is determined by the `grab_after_block` arg, indicates the fraction of _remaining_ channels which join the identity bypass. The fraction is converted to an integer number of channels by multiplying by the remaining number of channels and rounding. Additionally, at each exit, glow couples the tensor exiting the highway to the tensor continuing onward. This makes small scale features in the image dependent on larger scale features, since the larger scale features dictate the mean and scale of the distribution over the smaller scale features. This coupling is done similarly to the Coupling bijector in each step of the flow (i.e. using a RealNVP bijector). However for the exit bijector, the coupling is instantiated using `exit_bijector_fn` rather than coupling bijector fn, allowing for different behaviors between standard coupling and exit coupling. Also note that because the exit utilizes a coupling bijector, there are two special cases (all channels exiting and no channels exiting). The full Glow bijector consists of `num_glow_blocks` Blocks each of which contains `num_steps_per_block` steps. Each step implements a coupling using `bijector_coupling_fn`. Between blocks, glow converts between spatial pixels and channels using the Expand Bijector, and splits channels out of the bijector using the Exit Bijector. The channels which have exited continue onward through Identity bijectors and those which have not exited are given to the next block. After passing through all Blocks, the tensor is reshaped to a rank-1 tensor with the same number of elements. This is where the distribution will be defined. A schematic diagram of Glow is shown below. The `forward` function of the bijector starts from the bottom and goes upward, while the `inverse` function starts from the top and proceeds downward. ```None ============================================================================== Glow Schematic Diagram Input Image ######################## shape = [H, W, C] \ /<- Expand Bijector turns spatial \ / dimensions into channels. _ | XXXXXXXXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXX A single step of the flow consists Glow Block - | XXXXXXXXXXXXXXXXXXXX <- of ActNorm -> 1x1Conv -> Coupling. | XXXXXXXXXXXXXXXXXXXX there are num_steps_per_block | XXXXXXXXXXXXXXXXXXXX steps of the flow in each block. |_ XXXXXXXXXXXXXXXXXXXX \ / <-- Expand bijectors follow each glow \ / block XXXXXXXX\\\\\\\\ <-- Exit Bijector removes channels _ _ from additional alteration. | XXXXXXXX ! | ! | XXXXXXXX ! | ! | XXXXXXXX ! | ! After exiting, channels are passed Glow Block - | XXXXXXXX ! | ! <--- downward using the Blockwise and | XXXXXXXX ! | ! Identify bijectors. | XXXXXXXX ! | ! |_ XXXXXXXX ! | ! \ / <---- Expand Bijector \ / XXX\\\ | ! <---- Exit Bijector _ | XXX ! | | ! | XXX ! | | ! | XXX ! | | ! Glow Block - | XXX ! | | ! | XXX ! | | ! | XXX ! | | ! |_ XXX ! | | ! XX\ ! | | ! <----- (Optional) Exit Bijector | | | v v v Output Distribution ########## shape = [H * W * C] _________________________ | Legend | | XX = Step of flow | | X\ = Exit bijector | | \/ = Expand bijector | | !|! = Identity bijector | | | | up = Forward pass | | dn = Inverse pass | |_________________________| ============================================================================== ``` The default configuration for glow is meant to replicate the architecture in [1] for generating images from CIFAR-10. Example usage: ```python from functools import reduce from operator import mul import tensorflow as tf import tensorflow_datasets as tfds import tensorflow_probability as tfp tfb = tfp.bijectors tfd = tfp.distributions data, info = tfds.load('cifar10', with_info=True) train_data, test_data = data['train'], data['test'] preprocess = lambda x: tf.cast(x['image'], tf.float32) train_data = train_data.batch(4).map(preprocess) test_data = test_data.batch(4).map(preprocess) x = next(iter(train_data)) glow = tfb.Glow(output_shape=info.features['image'].shape, coupling_bijector_fn=tfb.GlowDefaultNetwork, exit_bijector_fn=tfb.GlowDefaultExitNetwork) z_shape = glow.inverse_event_shape(info.features['image'].shape) pz = tfd.Sample(tfd.Normal(0., 1.), z_shape) # Calling glow on distribution p(z) creates our glow distribution over images. px = glow(pz) # Take samples from the distribution to get images from your dataset images = px.sample(4) # Map images to positions in the distribution z = glow.inverse(x) # Get the z's corresponding to each spatial scale. To do this, we have to # find out how many zs are passed through blockwise at each stage that were # not passed at the previous stage. This is encoded in the second element of # each list of blockwise splits. However because the bijector iteratively # converts spatial pixels to channels, we also need to multiply the size of # that second element by the number of spatial-to-channel conversions that the # tensor receives after exiting (including after any alteration). ztake = [bs[1] * 4**(i+2) for i, bs in enumerate(glow.blockwise_splits)] total_z_taken = sum(ztake) split_sizes = [z_shape.as_list()[0]-total_z_taken] + ztake zsplits = tf.split(z, num_or_size_splits=split_sizes, axis=-1) ``` #### References: [1]: <NAME>, <NAME>, Glow: Generative Flow with Invertible 1x1 Convolutions. In _Neural Information Processing Systems_, 2018. https://arxiv.org/abs/1807.03039 [2]: <NAME>, <NAME>, and <NAME>. Density Estimation using Real NVP. In _International Conference on Learning Representations_, 2017. https://arxiv.org/abs/1605.08803 """ def __init__(self, output_shape=(32, 32, 3), num_glow_blocks=3, num_steps_per_block=32, coupling_bijector_fn=None, exit_bijector_fn=None, grab_after_block=None, use_actnorm=True, seed=None, validate_args=False, name='glow'): """Creates the Glow bijector. Args: output_shape: A list of integers, specifying the event shape of the output, of the bijectors forward pass (the image). Specified as [H, W, C]. Default Value: (32, 32, 3) num_glow_blocks: An integer, specifying how many downsampling levels to include in the model. This must divide equally into both H and W, otherwise the bijector would not be invertible. Default Value: 3 num_steps_per_block: An integer specifying how many Affine Coupling and 1x1 convolution layers to include at each level of the spatial hierarchy. Default Value: 32 (i.e. the value used in the original glow paper). coupling_bijector_fn: A function which takes the argument `input_shape` and returns a callable neural network (e.g. a keras.Sequential). The network should either return a tensor with the same event shape as `input_shape` (this will employ additive coupling), a tensor with the same height and width as `input_shape` but twice the number of channels (this will employ affine coupling), or a bijector which takes in a tensor with event shape `input_shape`, and returns a tensor with shape `input_shape`. exit_bijector_fn: Similar to coupling_bijector_fn, exit_bijector_fn is a function which takes the argument `input_shape` and `output_chan` and returns a callable neural network. The neural network it returns should take a tensor of shape `input_shape` as the input, and return one of three options: A tensor with `output_chan` channels, a tensor with `2 * output_chan` channels, or a bijector. Additional details can be found in the documentation for ExitBijector. grab_after_block: A tuple of floats, specifying what fraction of the remaining channels to remove following each glow block. Glow will take the integer floor of this number multiplied by the remaining number of channels. The default is half at each spatial hierarchy. Default value: None (this will take out half of the channels after each block. use_actnorm: A bool deciding whether or not to use actnorm. Data-dependent initialization is used to initialize this layer. Default value: `False` seed: A seed to control randomness in the 1x1 convolution initialization. Default value: `None` (i.e., non-reproducible sampling). validate_args: Python `bool` indicating whether arguments should be checked for correctness. Default value: `False` name: Python `str`, name given to ops managed by this object. Default value: `'glow'`. """ parameters = dict(locals()) # Make sure that the input shape is fully defined. if not tensorshape_util.is_fully_defined(output_shape): raise ValueError('Shape must be fully defined.') if tensorshape_util.rank(output_shape) != 3: raise ValueError('Shape ndims must be 3 for images. Your shape is' '{}'.format(tensorshape_util.rank(output_shape))) num_glow_blocks_ = tf.get_static_value(num_glow_blocks) if (num_glow_blocks_ is None or int(num_glow_blocks_) != num_glow_blocks_ or num_glow_blocks_ < 1): raise ValueError('Argument `num_glow_blocks` must be a statically known' 'positive `int` (saw: {}).'.format(num_glow_blocks)) num_glow_blocks = int(num_glow_blocks_) output_shape = tensorshape_util.as_list(output_shape) h, w, c = output_shape n = num_glow_blocks nsteps = num_steps_per_block # Default Glow: Half of the channels are split off after each block, # and after the final block, no channels are split off. if grab_after_block is None: grab_after_block = tuple([0.5] * (n - 1) + [0.]) # Thing we know must be true: h and w are evenly divisible by 2, n times. # Otherwise, the squeeze bijector will not work. if w % 2**n != 0: raise ValueError('Width must be divisible by 2 at least n times.' 'Saw: {} % {} != 0'.format(w, 2**n)) if h % 2**n != 0: raise ValueError('Height should be divisible by 2 at least n times.') if h // 2**n < 1: raise ValueError('num_glow_blocks ({0}) is too large. The image height ' '({1}) must be divisible by 2 no more than {2} ' 'times.'.format(num_glow_blocks, h, int(np.log(h) / np.log(2.)))) if w // 2**n < 1: raise ValueError('num_glow_blocks ({0}) is too large. The image width ' '({1}) must be divisible by 2 no more than {2} ' 'times.'.format(num_glow_blocks, w, int(np.log(h) / np.log(2.)))) # Other things we want to be true: # - The number of times we take must be equal to the number of glow blocks. if len(grab_after_block) != num_glow_blocks: raise ValueError('Length of grab_after_block ({0}) must match the number' 'of blocks ({1}).'.format(len(grab_after_block), num_glow_blocks)) self._blockwise_splits = self._get_blockwise_splits(output_shape, grab_after_block[::-1]) # Now check on the values of blockwise splits if any([bs[0] < 1 for bs in self._blockwise_splits]): first_offender = [bs[0] for bs in self._blockwise_splits].index(True) raise ValueError('At at least one exit, you are taking out all of your ' 'channels, and therefore have no inputs to later blocks.' ' Try setting grab_after_block to a lower value at index' '{}.'.format(first_offender)) if any(np.isclose(gab, 0) for gab in grab_after_block): # Special case: if specifically exiting no channels, then the exit is # just an identity bijector. pass elif any([bs[1] < 1 for bs in self._blockwise_splits]): first_offender = [bs[1] for bs in self._blockwise_splits].index(True) raise ValueError('At least one of your layers has < 1 output channels. ' 'This means you set grab_at_block too small. ' 'Try setting grab_after_block to a larger value at index' '{}.'.format(first_offender)) # Lets start to build our bijector. We assume that the distribution is 1 # dimensional. First, lets reshape it to an image. glow_chain = [ reshape.Reshape( event_shape_out=[h // 2**n, w // 2**n, c * 4**n], event_shape_in=[h * w * c]) ] seedstream = SeedStream(seed=seed, salt='random_beta') for i in range(n): # This is the shape of the current tensor current_shape = (h // 2**n * 2**i, w // 2**n * 2**i, c * 4**(i + 1)) # This is the shape of the input to both the glow block and exit bijector. this_nchan = sum(self._blockwise_splits[i][0:2]) this_input_shape = (h // 2**n * 2**i, w // 2**n * 2**i, this_nchan) glow_chain.append(invert.Invert(ExitBijector(current_shape, self._blockwise_splits[i], exit_bijector_fn))) glow_block = GlowBlock(input_shape=this_input_shape, num_steps=nsteps, coupling_bijector_fn=coupling_bijector_fn, use_actnorm=use_actnorm, seedstream=seedstream) if self._blockwise_splits[i][2] == 0: # All channels are passed to the RealNVP glow_chain.append(glow_block) else: # Some channels are passed around the block. # This is done with the Blockwise bijector. glow_chain.append( blockwise.Blockwise( [glow_block, identity.Identity()], [sum(self._blockwise_splits[i][0:2]), self._blockwise_splits[i][2]])) # Finally, lets expand the channels into spatial features. glow_chain.append( Expand(input_shape=[ h // 2**n * 2**i, w // 2**n * 2**i, c * 4**n // 4**i, ])) glow_chain = glow_chain[::-1] # To finish off, we build a bijector that chains the components together # sequentially. super(Glow, self).__init__( bijectors=chain.Chain(glow_chain, validate_args=validate_args), validate_args=validate_args, parameters=parameters, name=name) @classmethod def _parameter_properties(cls, dtype): return dict() def _get_blockwise_splits(self, input_shape, grab_after_block): """build list of splits to give to the blockwise_bijectors. The list will have 3 different splits. The first element is `nleave` which shows how many channels will remain in the network after each exit. The second element is `ngrab`, which shows how many channels will be removed at the exit. The third is `npass`, which shows how many channels have already exited at a previous junction, and are therefore passed to an identity bijector instead of the glow block. Args: input_shape: shape of the input data grab_after_block: list of floats specifying what fraction of the channels should exit the network after each glow block. Returns: blockwise_splits: the number of channels left, taken, and passed over for each glow block. """ blockwise_splits = [] ngrab, nleave, npass = 0, 0, 0 # Build backwards for i, frac in enumerate(reversed(grab_after_block)): nchan = 4**(i + 1) * input_shape[-1] ngrab = int((nchan - npass) * frac) nleave = nchan - ngrab - npass blockwise_splits.append([nleave, ngrab, npass]) # update npass for the next level npass += ngrab npass *= 4 return blockwise_splits[::-1] @property def blockwise_splits(self): return self._blockwise_splits class ExitBijector(composition.Composition): """The spatial coupling bijector used in Glow. This bijector consists of a blockwise bijector of a realNVP bijector. It is where Glow adds a fork between points that are split off and passed to the base distribution, and points that are passed onward through more Glow blocks. For this bijector, we include spatial coupling between the part being forked off, and the part being passed onward. This induces a hierarchical spatial dependence on samples, and results in images which look better. """ def __init__(self, input_shape, blockwise_splits, coupling_bijector_fn=None): """Creates the exit bijector. Args: input_shape: A list specifying the input shape to the exit bijector. Used in constructing the network. blockwise_splits: A list of integers specifying the number of channels exiting the model, as well as those being left in the model, and those bypassing the exit bijector altogether. coupling_bijector_fn: A function which takes the argument `input_shape` and returns a callable neural network (e.g. a keras Sequential). The network should either return a tensor with the same event shape as `input_shape` (this will employ additive coupling), a tensor with the same height and width as `input_shape` but twice the number of channels (this will employ affine coupling), or a bijector which takes in a tensor with event shape `input_shape`, and returns a tensor with shape `input_shape`. """ parameters = dict(locals()) nleave, ngrab, npass = blockwise_splits new_input_shape = input_shape[:-1]+(nleave,) target_output_shape = input_shape[:-1]+(ngrab,) # if nleave or ngrab == 0, then just use an identity for everything. if nleave == 0 or ngrab == 0: exit_layer = None exit_bijector_fn = None self.exit_layer = exit_layer shift_distribution = identity.Identity() else: exit_layer = coupling_bijector_fn(new_input_shape, output_chan=ngrab) exit_bijector_fn = self.make_bijector_fn( exit_layer, target_shape=target_output_shape, scale_fn=tf.exp) self.exit_layer = exit_layer # For variable tracking. shift_distribution = real_nvp.RealNVP( num_masked=nleave, bijector_fn=exit_bijector_fn) super(ExitBijector, self).__init__( blockwise.Blockwise( [shift_distribution, identity.Identity()], [nleave + ngrab, npass]), parameters=parameters, name='exit_bijector') @staticmethod def make_bijector_fn(layer, target_shape, scale_fn=tf.nn.sigmoid): def bijector_fn(inputs, ignored_input): """Decorated function to get the RealNVP bijector.""" # Build this so we can handle a user passing a NN that returns a tensor # OR an NN that returns a bijector possible_output = layer(inputs) # We need to produce a bijector, but we do not know if the layer has done # so. We are setting this up to handle 2 possibilities: # 1) The layer outputs a bijector --> all is good # 2) The layer outputs a tensor --> we need to turn it into a bijector. if isinstance(possible_output, bijector.Bijector): output = possible_output elif isinstance(possible_output, tf.Tensor): input_shape = inputs.get_shape().as_list() output_shape = possible_output.get_shape().as_list() assert input_shape[:-1] == output_shape[:-1] c = input_shape[-1] # For layers which output a tensor, we have two possibilities: # 1) There are twice as many output channels as the target --> the # coupling is affine, meaning there is a scale followed by a shift. # 2) The number of output channels equals the target --> the # coupling is additive, meaning there is just a shift if target_shape[-1] == output_shape[-1] // 2: this_scale = scale.Scale(scale_fn(possible_output[..., :c] + 2.)) this_shift = shift.Shift(possible_output[..., c:]) output = this_shift(this_scale) elif target_shape[-1] == output_shape[-1]: output = shift.Shift(possible_output[..., :c]) else: raise ValueError('Shape inconsistent with input. Expected shape' '{0} or {1} but tensor was shape {2}'.format( input_shape, tf.concat( [input_shape[:-1], [2 * input_shape[-1]]], 0), output_shape)) else: raise ValueError('Expected a bijector or a tensor, but instead got' '{}'.format(possible_output.__class__)) return output return bijector_fn class GlowBlock(composition.Composition): """Single block for a glow model. This bijector contains `num_steps` steps of the flow, each consisting of an actnorm-OneByOneConv-RealNVP chain of bijectors. Use of actnorm is optional and the RealNVP behavior is controlled by the coupling_bijector_fn, which implements a function (e.g. deep neural network) to dictate the behavior of the flow. A default (GlowDefaultNetwork) function is provided. """ def __init__(self, input_shape, num_steps, coupling_bijector_fn, use_actnorm, seedstream): parameters = dict(locals()) rnvp_block = [identity.Identity()] this_nchan = input_shape[-1] for j in range(num_steps): # pylint: disable=unused-variable this_layer_input_shape = input_shape[:-1] + (input_shape[-1] // 2,) this_layer = coupling_bijector_fn(this_layer_input_shape) bijector_fn = self.make_bijector_fn(this_layer) # For each step in the block, we do (optional) actnorm, followed # by an invertible 1x1 convolution, then affine coupling. this_rnvp = invert.Invert( real_nvp.RealNVP(this_nchan // 2, bijector_fn=bijector_fn)) # Append the layer to the realNVP bijector for variable tracking. this_rnvp.coupling_bijector_layer = this_layer rnvp_block.append(this_rnvp) rnvp_block.append( invert.Invert(OneByOneConv( this_nchan, seed=seedstream(), dtype=dtype_util.common_dtype(this_rnvp.variables, dtype_hint=tf.float32)))) if use_actnorm: rnvp_block.append(ActivationNormalization( this_nchan, dtype=dtype_util.common_dtype(this_rnvp.variables, dtype_hint=tf.float32))) # Note that we reverse the list since Chain applies bijectors in reverse # order. super(GlowBlock, self).__init__( chain.Chain(rnvp_block[::-1]), parameters=parameters, name='glow_block') @staticmethod def make_bijector_fn(layer, scale_fn=tf.nn.sigmoid): def bijector_fn(inputs, ignored_input): """Decorated function to get the RealNVP bijector.""" # Build this so we can handle a user passing a NN that returns a tensor # OR an NN that returns a bijector possible_output = layer(inputs) # We need to produce a bijector, but we do not know if the layer has done # so. We are setting this up to handle 2 possibilities: # 1) The layer outputs a bijector --> all is good # 2) The layer outputs a tensor --> we need to turn it into a bijector. if isinstance(possible_output, bijector.Bijector): output = possible_output elif isinstance(possible_output, tf.Tensor): input_shape = inputs.get_shape().as_list() output_shape = possible_output.get_shape().as_list() assert input_shape[:-1] == output_shape[:-1] c = input_shape[-1] # For layers which output a tensor, we have two possibilities: # 1) There are twice as many output channels as inputs --> the coupling # is affine, meaning there is a scale followed by a shift. # 2) There are an equal number of input and output channels --> the # coupling is additive, meaning there is just a shift if input_shape[-1] == output_shape[-1] // 2: this_scale = scale.Scale(scale_fn(possible_output[..., :c] + 2.)) this_shift = shift.Shift(possible_output[..., c:]) output = this_shift(this_scale) elif input_shape[-1] == output_shape[-1]: output = shift.Shift(possible_output[..., :c]) else: raise ValueError('Shape inconsistent with input. Expected shape' '{0} or {1} but tensor was shape {2}'.format( input_shape, tf.concat( [input_shape[:-1], [2 * input_shape[-1]]], 0), output_shape)) else: raise ValueError('Expected a bijector or a tensor, but instead got' '{}'.format(possible_output.__class__)) return output return bijector_fn class OneByOneConv(bijector.Bijector): """The 1x1 Conv bijector used in Glow. This class has a convenience function which initializes the parameters of the bijector. """ def __init__(self, event_size, seed=None, dtype=tf.float32, **kwargs): parameters = dict(locals()) with tf.name_scope('OneByOneConv') as name: lower_upper, permutation = self.trainable_lu_factorization( event_size, seed=seed, dtype=dtype) self._bijector = scale_matvec_lu.ScaleMatvecLU( lower_upper, permutation, **kwargs) super(OneByOneConv, self).__init__( dtype=self._bijector.lower_upper.dtype, is_constant_jacobian=True, forward_min_event_ndims=1, parameters=parameters, name=name) def forward(self, x): return self._bijector.forward(x) def inverse(self, y): return self._bijector.inverse(y) def inverse_log_det_jacobian(self, y, event_ndims=None): return self._bijector.inverse_log_det_jacobian(y, event_ndims) def forward_log_det_jacobian(self, x, event_ndims=None): return self._bijector.forward_log_det_jacobian(x, event_ndims) @staticmethod def trainable_lu_factorization(event_size, seed=None, dtype=tf.float32, name=None): with tf.name_scope(name or 'trainable_lu_factorization'): event_size = tf.convert_to_tensor( event_size, dtype_hint=tf.int32, name='event_size') random_matrix = tf.random.uniform( shape=[event_size, event_size], dtype=dtype, seed=seed) random_orthonormal = tf.linalg.qr(random_matrix)[0] lower_upper, permutation = tf.linalg.lu(random_orthonormal) lower_upper = tf.Variable( initial_value=lower_upper, trainable=True, name='lower_upper') # Initialize a non-trainable variable for the permutation indices so # that its value isn't re-sampled from run-to-run. permutation = tf.Variable( initial_value=permutation, trainable=False, name='permutation') return lower_upper, permutation class ActivationNormalization(bijector.Bijector): """Bijector to implement Activation Normalization (ActNorm).""" def __init__(self, nchan, dtype=tf.float32, validate_args=False, name=None): parameters = dict(locals()) self._initialized = tf.Variable(False, trainable=False) self._m = tf.Variable(tf.zeros(nchan, dtype)) self._s = TransformedVariable(tf.ones(nchan, dtype), exp.Exp()) self._bijector = invert.Invert( chain.Chain([ scale.Scale(self._s), shift.Shift(self._m), ])) super(ActivationNormalization, self).__init__( validate_args=validate_args, forward_min_event_ndims=1, parameters=parameters, name=name or 'ActivationNormalization') def _inverse(self, y, **kwargs): with tf.control_dependencies([self._maybe_init(y, inverse=True)]): return self._bijector.inverse(y, **kwargs) def _forward(self, x, **kwargs): with tf.control_dependencies([self._maybe_init(x, inverse=False)]): return self._bijector.forward(x, **kwargs) def _inverse_log_det_jacobian(self, y, **kwargs): with tf.control_dependencies([self._maybe_init(y, inverse=True)]): return self._bijector.inverse_log_det_jacobian(y, 1, **kwargs) def _forward_log_det_jacobian(self, x, **kwargs): with tf.control_dependencies([self._maybe_init(x, inverse=False)]): return self._bijector.forward_log_det_jacobian(x, 1, **kwargs) def _maybe_init(self, inputs, inverse): """Initialize if not already initialized.""" def _init(): """Build the data-dependent initialization.""" axis = prefer_static.range(prefer_static.rank(inputs) - 1) m = tf.math.reduce_mean(inputs, axis=axis) s = ( tf.math.reduce_std(inputs, axis=axis) + 10. * np.finfo(dtype_util.as_numpy_dtype(inputs.dtype)).eps) if inverse: s = 1 / s m = -m else: m = m / s with tf.control_dependencies([self._m.assign(m), self._s.assign(s)]): return self._initialized.assign(True) return tf.cond(self._initialized, tf.no_op, _init) class Expand(composition.Composition): """A bijector to transform channels into spatial pixels.""" def __init__(self, input_shape, block_size=2, validate_args=False, name=None): parameters = dict(locals()) self._block_size = block_size _, h, w, c = prefer_static.split(input_shape, [-1, 1, 1, 1]) h, w, c = h[0], w[0], c[0] n = self._block_size b = [ reshape.Reshape( event_shape_out=[h * n, w * n, c // n**2], event_shape_in=[h, n, w, n, c // n**2]), transpose.Transpose(perm=[0, 3, 1, 4, 2]), reshape.Reshape( event_shape_in=[h, w, c], event_shape_out=[h, w, c // n**2, n, n]), ] super(Expand, self).__init__( bijectors=chain.Chain(b, validate_args=validate_args), name=name or 'Expand', parameters=parameters) class GlowDefaultNetwork(tfk.Sequential): """Default network for the glow bijector. This builds a 3 layer convolutional network, with relu activation functions and he_normal initializer. The first and third layers have default kernel shape of 3, and the second layer is a 1x1 convolution. This is the setup in the public version of Glow. The output of the convolutional network defines the components of an Affine transformation (i.e. y = m * x + b), where m, x, and b are all tensors of the same shape, and * indicates elementwise multiplication. """ def __init__(self, input_shape, num_hidden=400, kernel_shape=3): """Default network for glow bijector.""" # Default is scale and shift, so 2c outputs. this_nchan = input_shape[-1] * 2 conv = functools.partial( tfkl.Conv2D, padding='same', kernel_initializer=tf.initializers.he_normal(), activation='relu') conv_last = functools.partial( tfkl.Conv2D, padding='same', kernel_initializer=tf.initializers.zeros(), bias_initializer=tf.initializers.zeros()) super(GlowDefaultNetwork, self).__init__([ tfkl.Input(shape=input_shape), conv(num_hidden, kernel_shape), conv(num_hidden, 1), conv_last(this_nchan, kernel_shape) ]) class GlowDefaultExitNetwork(tfk.Sequential): """Default network for the glow exit bijector. This is just a single convolutional layer. """ def __init__(self, input_shape, output_chan, kernel_shape=3): """Default network for glow bijector.""" # Default is scale and shift, so 2c outputs. this_nchan = output_chan * 2 conv = functools.partial( tfkl.Conv2D, padding='same', kernel_initializer=tf.initializers.zeros(), bias_initializer=tf.initializers.zeros()) super(GlowDefaultExitNetwork, self).__init__([ tfkl.Input(input_shape), conv(this_nchan, kernel_shape)])
[ 1, 529, 276, 1112, 420, 29958, 29925, 29080, 29968, 728, 487, 29906, 29896, 29914, 22795, 3097, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 450, 323, 6073, 17907, 1019, 29890, 3097, 13189, 943, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 268, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 29937, 1275, 9166, 9166, 9166, 9166, 4936, 1360, 13, 15945, 29908, 29954, 677, 4768, 622, 272, 1213, 15945, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 5215, 2090, 312, 8789, 13, 5215, 12655, 408, 7442, 13, 13, 5215, 26110, 29889, 12667, 29889, 29894, 29906, 408, 15886, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 4768, 622, 272, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 2908, 3538, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 9704, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 15259, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 1518, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 10110, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 21292, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 1855, 29918, 29876, 29894, 29886, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 620, 14443, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 6287, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 6287, 29918, 2922, 2003, 29918, 6092, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 9500, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 5365, 622, 943, 1053, 1301, 4220, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 7564, 1053, 26688, 29918, 4422, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 7564, 1053, 5821, 29918, 7959, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 7564, 1053, 12489, 12181, 29918, 4422, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 4422, 29889, 311, 14373, 29918, 20158, 1053, 4103, 15628, 16174, 13, 3166, 26110, 29918, 22795, 3097, 29889, 4691, 29889, 4422, 29889, 26776, 29918, 5461, 1053, 922, 287, 3835, 13, 13, 13264, 29895, 353, 15886, 29889, 3946, 294, 13, 13264, 6321, 353, 15886, 29895, 29889, 29277, 13, 13, 1649, 497, 1649, 353, 518, 13, 1678, 525, 29954, 677, 742, 13, 1678, 525, 29954, 677, 4592, 13724, 742, 13, 1678, 525, 29954, 677, 4592, 24365, 13724, 742, 13, 29962, 13, 13, 13, 1990, 402, 677, 29898, 510, 3283, 29889, 1523, 3283, 1125, 13, 29871, 364, 15945, 29908, 1888, 9711, 278, 402, 677, 3457, 622, 272, 515, 4088, 655, 669, 360, 29882, 1306, 14625, 313, 29906, 29900, 29896, 29947, 9601, 29896, 1822, 13, 13, 29871, 6811, 1493, 29901, 421, 29954, 677, 29952, 338, 263, 9704, 310, 4768, 622, 943, 607, 4327, 29879, 263, 7115, 29899, 29896, 12489, 13, 29871, 313, 8111, 29897, 964, 263, 7115, 29899, 29941, 12489, 313, 29872, 29889, 29887, 29889, 385, 390, 7210, 1967, 467, 421, 29954, 677, 29952, 947, 445, 491, 13, 29871, 9704, 292, 4208, 385, 5136, 1218, 3652, 310, 376, 7445, 29879, 1699, 376, 29903, 802, 6096, 267, 1699, 322, 376, 1252, 1169, 29908, 13, 29871, 607, 526, 1269, 6053, 4266, 521, 2708, 310, 916, 4768, 622, 943, 29889, 450, 9146, 671, 13, 29871, 310, 421, 29954, 677, 29952, 338, 408, 760, 310, 263, 421, 13264, 29886, 29889, 27691, 29879, 29889, 13372, 287, 13398, 3224, 1673, 297, 13, 29871, 607, 278, 2967, 4978, 975, 278, 4608, 2913, 338, 1304, 304, 5706, 11916, 13, 29871, 297, 278, 1967, 2913, 29889, 512, 278, 5650, 29892, 385, 25266, 21981, 4978, 338, 1304, 13, 29871, 408, 278, 2967, 4978, 29889, 13, 13, 29871, 319, 376, 7445, 29908, 313, 326, 2037, 287, 408, 278, 421, 29954, 677, 7445, 29952, 3457, 622, 272, 29897, 23233, 1568, 310, 278, 13, 29871, 29304, 607, 2758, 330, 677, 304, 7738, 269, 3021, 4695, 630, 322, 4280, 611, 27775, 13, 29871, 1546, 278, 1967, 2913, 322, 278, 3405, 296, 2913, 322, 5480, 6176, 8261, 1967, 13, 29871, 12623, 4180, 29889, 319, 15658, 338, 13725, 310, 421, 1949, 29918, 24530, 29918, 546, 29918, 1271, 29952, 6576, 29892, 13, 29871, 607, 526, 1269, 8762, 408, 263, 421, 14688, 29952, 6943, 385, 13, 29871, 421, 21786, 362, 19077, 2133, 29952, 313, 2865, 29940, 555, 29897, 4768, 622, 272, 29892, 5643, 491, 385, 313, 262, 1765, 1821, 29897, 13, 29871, 421, 6716, 2059, 6716, 1168, 29894, 29952, 4768, 622, 272, 29892, 322, 7146, 263, 23638, 4768, 622, 272, 29889, 450, 23638, 13, 29871, 4768, 622, 272, 338, 385, 2777, 310, 263, 421, 21713, 29940, 18510, 29952, 4768, 622, 272, 29892, 322, 3913, 278, 13, 29871, 421, 16589, 10335, 29918, 5365, 622, 272, 29918, 9144, 29952, 740, 304, 25112, 278, 23638, 4768, 622, 272, 740, 13, 29871, 607, 338, 2183, 304, 278, 421, 21713, 29940, 18510, 1412, 910, 740, 3639, 263, 4768, 622, 272, 607, 13, 29871, 17645, 278, 23638, 313, 29872, 29889, 29887, 29889, 421, 29657, 29898, 17185, 3569, 363, 2756, 457, 23638, 470, 421, 29657, 29952, 363, 13, 29871, 788, 3321, 23638, 467, 13, 13, 29871, 319, 376, 29903, 802, 29872, 911, 29908, 29436, 18652, 5680, 964, 8242, 5680, 29889, 739, 338, 13, 29871, 8762, 773, 278, 421, 29777, 29952, 4768, 622, 272, 29889, 450, 4328, 297, 2983, 338, 13, 29871, 2861, 304, 278, 2114, 393, 278, 421, 11333, 29952, 740, 515, 330, 677, 338, 6839, 304, 18973, 13, 29871, 3928, 304, 23460, 515, 263, 421, 13264, 29886, 29889, 4422, 29889, 13372, 287, 13398, 3224, 29952, 1203, 29892, 13, 29871, 607, 723, 671, 421, 29777, 29952, 313, 29903, 802, 29872, 911, 338, 925, 512, 1765, 29898, 29777, 8106, 450, 421, 29777, 29952, 13, 29871, 4768, 622, 272, 4893, 263, 12489, 411, 8267, 10338, 29950, 29892, 399, 29892, 315, 7961, 322, 3639, 263, 12489, 411, 8267, 13, 29871, 10338, 29906, 29950, 29892, 29871, 29906, 29956, 29892, 315, 847, 29871, 29946, 29962, 1673, 1316, 393, 1269, 29871, 29906, 29916, 29906, 29916, 29896, 18652, 25900, 297, 278, 1962, 338, 13725, 13, 29871, 515, 263, 2323, 29871, 29896, 29916, 29896, 29916, 29946, 25900, 297, 278, 1881, 12489, 29892, 408, 1401, 18186, 297, 278, 4377, 2400, 29889, 13, 13, 462, 965, 1152, 1328, 1209, 313, 29777, 29897, 13, 462, 3986, 903, 7652, 29918, 4706, 903, 14365, 29918, 13, 462, 3986, 320, 268, 320, 539, 320, 1678, 320, 1678, 320, 13, 462, 3986, 2474, 268, 320, 11474, 976, 320, 259, 29896, 320, 259, 29906, 320, 13, 462, 3986, 320, 1966, 1649, 29896, 1649, 29905, 539, 320, 7652, 29905, 7652, 29905, 13, 462, 3986, 320, 1966, 1649, 29906, 1649, 29905, 4706, 320, 1678, 320, 1678, 320, 13, 462, 965, 2474, 1649, 29941, 1649, 29905, 29871, 529, 807, 29871, 320, 259, 29941, 320, 259, 29946, 320, 13, 462, 9651, 320, 1649, 29946, 1649, 29905, 3986, 320, 7652, 29905, 7652, 29905, 13, 462, 1669, 512, 3901, 1209, 313, 29903, 802, 29872, 911, 29897, 13, 13, 29871, 910, 338, 8762, 773, 263, 9704, 310, 421, 1666, 14443, 29952, 1599, 421, 4300, 4220, 29952, 1599, 421, 1666, 14443, 29952, 13, 29871, 4768, 622, 943, 29889, 3940, 393, 373, 385, 16402, 1209, 1549, 278, 4768, 622, 272, 29892, 1269, 317, 802, 29872, 911, 13, 29871, 674, 4556, 278, 2920, 29914, 3545, 310, 278, 1967, 304, 23806, 491, 263, 7329, 310, 29871, 29906, 29889, 13, 29871, 7857, 29892, 278, 1881, 1967, 1818, 367, 1584, 368, 8572, 1821, 491, 29871, 29906, 472, 3203, 13, 29871, 421, 1949, 29918, 29887, 677, 29918, 1271, 29879, 29952, 3064, 29892, 1951, 372, 674, 1209, 1549, 263, 317, 802, 29872, 911, 4331, 393, 1784, 13, 29871, 3064, 29889, 13, 13, 29871, 530, 376, 24365, 29908, 338, 3763, 263, 432, 651, 472, 607, 777, 310, 278, 12489, 376, 735, 1169, 29908, 515, 278, 13, 29871, 330, 677, 4768, 622, 272, 322, 5480, 4772, 29879, 738, 4340, 10551, 362, 29889, 7806, 6876, 338, 13, 29871, 8762, 408, 263, 421, 7445, 3538, 29952, 4768, 622, 272, 29892, 988, 777, 18196, 526, 2183, 304, 278, 13, 29871, 1791, 310, 278, 330, 677, 1904, 29892, 322, 278, 1791, 526, 2183, 304, 263, 491, 3364, 8762, 773, 13, 29871, 278, 421, 18415, 29952, 4768, 622, 272, 29889, 450, 15958, 310, 18196, 304, 367, 6206, 472, 1269, 6876, 13, 29871, 338, 10087, 491, 278, 421, 3874, 29890, 29918, 7045, 29918, 1271, 29952, 1852, 29892, 14088, 278, 15958, 310, 13, 29871, 903, 1745, 17225, 29918, 18196, 607, 5988, 278, 10110, 491, 3364, 29889, 450, 15958, 338, 13, 29871, 11543, 304, 385, 6043, 1353, 310, 18196, 491, 6674, 5890, 491, 278, 9886, 13, 29871, 1353, 310, 18196, 322, 4513, 292, 29889, 13, 13, 29871, 19814, 29892, 472, 1269, 6876, 29892, 330, 677, 3581, 2701, 278, 12489, 6876, 292, 278, 29469, 304, 13, 29871, 278, 12489, 3133, 292, 373, 1328, 29889, 910, 3732, 2319, 6287, 5680, 297, 278, 1967, 13, 29871, 14278, 373, 7200, 6287, 5680, 29892, 1951, 278, 7200, 6287, 5680, 9657, 403, 13, 29871, 278, 2099, 322, 6287, 310, 278, 4978, 975, 278, 7968, 6287, 5680, 29889, 13, 29871, 910, 23638, 338, 2309, 22829, 304, 278, 19565, 10335, 4768, 622, 272, 297, 1269, 4331, 310, 278, 13, 29871, 4972, 313, 29875, 29889, 29872, 29889, 773, 263, 8195, 29940, 18510, 4768, 622, 272, 467, 2398, 363, 278, 6876, 4768, 622, 272, 29892, 278, 13, 29871, 23638, 338, 13213, 630, 773, 421, 13322, 29918, 5365, 622, 272, 29918, 9144, 29952, 3265, 1135, 23638, 13, 29871, 4768, 622, 272, 7876, 29892, 14372, 363, 1422, 4010, 18930, 1546, 3918, 23638, 322, 13, 29871, 6876, 23638, 29889, 3115, 4443, 393, 1363, 278, 6876, 3667, 7093, 263, 23638, 4768, 622, 272, 29892, 13, 29871, 727, 526, 1023, 4266, 4251, 313, 497, 18196, 6876, 292, 322, 694, 18196, 6876, 292, 467, 13, 13, 29871, 450, 2989, 402, 677, 4768, 622, 272, 11624, 310, 421, 1949, 29918, 29887, 677, 29918, 1271, 29879, 29952, 15658, 29879, 1269, 310, 607, 13, 29871, 3743, 421, 1949, 29918, 24530, 29918, 546, 29918, 1271, 29952, 6576, 29889, 7806, 4331, 10703, 263, 23638, 773, 13, 29871, 421, 5365, 622, 272, 29918, 16589, 10335, 29918, 9144, 1412, 21674, 10930, 29892, 330, 677, 29436, 1546, 18652, 17036, 13, 29871, 322, 18196, 773, 278, 12027, 392, 3457, 622, 272, 29892, 322, 8536, 1169, 18196, 714, 310, 278, 13, 29871, 4768, 622, 272, 773, 278, 25954, 3457, 622, 272, 29889, 450, 18196, 607, 505, 429, 1573, 6773, 13, 29871, 373, 1328, 1549, 27486, 4768, 622, 943, 322, 1906, 607, 505, 451, 429, 1573, 526, 2183, 13, 29871, 304, 278, 2446, 2908, 29889, 2860, 6819, 1549, 599, 15658, 29879, 29892, 278, 12489, 338, 620, 29882, 10501, 13, 29871, 304, 263, 7115, 29899, 29896, 12489, 411, 278, 1021, 1353, 310, 3161, 29889, 910, 338, 988, 278, 13, 29871, 4978, 674, 367, 3342, 29889, 13, 13, 29871, 319, 1364, 19217, 13722, 310, 402, 677, 338, 4318, 2400, 29889, 450, 421, 11333, 29952, 740, 310, 278, 13, 29871, 4768, 622, 272, 8665, 515, 278, 5970, 322, 5771, 701, 1328, 29892, 1550, 278, 421, 262, 3901, 29952, 740, 13, 29871, 8665, 515, 278, 2246, 322, 8469, 29879, 1623, 1328, 29889, 13, 13, 29871, 7521, 8516, 13, 29871, 1275, 9166, 9166, 9166, 9166, 4936, 2751, 13, 462, 965, 402, 677, 1102, 19217, 4671, 14442, 13, 13, 29871, 10567, 7084, 268, 835, 13383, 4136, 29937, 259, 8267, 353, 518, 29950, 29892, 399, 29892, 315, 29962, 13, 13, 462, 29871, 320, 462, 418, 847, 16406, 12027, 392, 3457, 622, 272, 12169, 18652, 13, 462, 259, 320, 462, 1678, 847, 1678, 13391, 964, 18196, 29889, 13, 462, 29871, 903, 13, 462, 891, 29871, 6193, 19165, 19165, 19165, 19165, 6247, 13, 462, 891, 29871, 6193, 19165, 19165, 19165, 19165, 6247, 13, 462, 891, 29871, 6193, 19165, 19165, 19165, 19165, 6247, 268, 319, 2323, 4331, 310, 278, 4972, 11624, 13, 259, 402, 677, 15658, 29871, 448, 891, 29871, 6193, 19165, 19165, 19165, 19165, 6247, 29871, 3705, 310, 3185, 29940, 555, 1599, 29871, 29896, 29916, 29896, 1168, 29894, 1599, 19565, 10335, 29889, 13, 462, 891, 29871, 6193, 19165, 19165, 19165, 19165, 6247, 268, 727, 526, 954, 29918, 24530, 29918, 546, 29918, 1271, 13, 462, 891, 29871, 6193, 19165, 19165, 19165, 19165, 6247, 268, 6576, 310, 278, 4972, 297, 1269, 2908, 29889, 13, 462, 891, 29918, 6193, 19165, 19165, 19165, 19165, 6247, 13, 13, 462, 1678, 320, 462, 29871, 847, 529, 489, 12027, 392, 4768, 622, 943, 1101, 1269, 330, 677, 13, 462, 268, 320, 18884, 847, 418, 2908, 13, 13, 462, 418, 6193, 19165, 6247, 1966, 1966, 1966, 1966, 259, 529, 489, 25954, 3457, 622, 272, 25388, 18196, 13, 462, 29871, 903, 462, 1678, 903, 268, 515, 5684, 10551, 362, 29889, 13, 462, 891, 1678, 6193, 19165, 6247, 1738, 29871, 891, 29871, 1738, 13, 462, 891, 1678, 6193, 19165, 6247, 1738, 29871, 891, 29871, 1738, 13, 462, 891, 1678, 6193, 19165, 6247, 1738, 29871, 891, 29871, 1738, 539, 2860, 6876, 292, 29892, 18196, 526, 4502, 13, 259, 402, 677, 15658, 29871, 448, 891, 1678, 6193, 19165, 6247, 1738, 29871, 891, 29871, 1738, 29871, 529, 5634, 1623, 1328, 773, 278, 15658, 3538, 322, 13, 462, 891, 1678, 6193, 19165, 6247, 1738, 29871, 891, 29871, 1738, 539, 13355, 1598, 4768, 622, 943, 29889, 13, 462, 891, 1678, 6193, 19165, 6247, 1738, 29871, 891, 29871, 1738, 13, 462, 891, 29918, 259, 6193, 19165, 6247, 1738, 29871, 891, 29871, 1738, 13, 13, 462, 418, 320, 795, 847, 529, 807, 12027, 392, 3457, 622, 272, 13, 462, 539, 320, 9651, 847, 13, 13, 462, 4706, 22615, 1966, 29905, 1678, 891, 1738, 29871, 529, 807, 25954, 3457, 622, 272, 13, 462, 29871, 903, 13, 462, 891, 418, 22615, 1738, 891, 259, 891, 1738, 13, 462, 891, 418, 22615, 1738, 891, 259, 891, 1738, 13, 462, 891, 418, 22615, 1738, 891, 259, 891, 1738, 13, 259, 402, 677, 15658, 29871, 448, 891, 418, 22615, 1738, 891, 259, 891, 1738, 13, 462, 891, 418, 22615, 1738, 891, 259, 891, 1738, 13, 462, 891, 418, 22615, 1738, 891, 259, 891, 1738, 13, 462, 891, 29918, 268, 22615, 1738, 891, 259, 891, 1738, 13, 13, 462, 4706, 6193, 29905, 1738, 891, 259, 891, 1738, 529, 23648, 313, 27636, 29897, 25954, 3457, 622, 272, 13, 13, 462, 308, 891, 1678, 891, 259, 891, 13, 462, 308, 325, 1678, 325, 259, 325, 13, 29871, 10604, 17740, 1678, 835, 4136, 2277, 29937, 3986, 8267, 353, 518, 29950, 334, 399, 334, 315, 29962, 13, 462, 462, 462, 268, 903, 27097, 14365, 13, 462, 462, 462, 1678, 891, 308, 5682, 355, 3986, 891, 13, 462, 462, 462, 1678, 891, 6193, 29871, 353, 16696, 310, 4972, 418, 891, 13, 462, 462, 462, 1678, 891, 1060, 29905, 29871, 353, 25954, 4768, 622, 272, 268, 891, 13, 462, 462, 462, 1678, 891, 320, 29914, 29871, 353, 12027, 392, 4768, 622, 272, 259, 891, 13, 462, 462, 462, 1678, 891, 1738, 29989, 29991, 353, 27486, 4768, 622, 272, 891, 13, 462, 462, 462, 1678, 891, 462, 308, 891, 13, 462, 462, 462, 1678, 891, 701, 29871, 353, 1152, 1328, 1209, 418, 891, 13, 462, 462, 462, 1678, 891, 270, 29876, 29871, 353, 512, 3901, 1209, 418, 891, 13, 462, 462, 462, 1678, 891, 27097, 14365, 29918, 29989, 13, 13, 29871, 1275, 9166, 9166, 9166, 9166, 4936, 2751, 13, 29871, 7521, 13, 29871, 450, 2322, 5285, 363, 330, 677, 338, 6839, 304, 1634, 5926, 278, 11258, 297, 13, 29871, 518, 29896, 29962, 363, 14655, 4558, 515, 315, 6545, 1718, 29899, 29896, 29900, 29889, 13, 13, 29871, 8741, 8744, 29901, 13, 29871, 7521, 4691, 13, 13, 29871, 515, 2090, 312, 8789, 1053, 10032, 13, 29871, 515, 5455, 1053, 15065, 13, 29871, 1053, 26110, 408, 15886, 13, 29871, 1053, 26110, 29918, 14538, 1691, 408, 15886, 6289, 13, 29871, 1053, 26110, 29918, 22795, 3097, 408, 15886, 29886, 13, 29871, 260, 14943, 353, 15886, 29886, 29889, 5365, 622, 943, 13, 29871, 260, 11512, 353, 15886, 29886, 29889, 27691, 29879, 13, 13, 29871, 848, 29892, 5235, 353, 15886, 6289, 29889, 1359, 877, 29883, 361, 279, 29896, 29900, 742, 411, 29918, 3888, 29922, 5574, 29897, 13, 29871, 7945, 29918, 1272, 29892, 1243, 29918, 1272, 353, 848, 1839, 14968, 7464, 848, 1839, 1688, 2033, 13, 13, 29871, 758, 5014, 353, 14013, 921, 29901, 15886, 29889, 4384, 29898, 29916, 1839, 3027, 7464, 15886, 29889, 7411, 29941, 29906, 29897, 13, 29871, 7945, 29918, 1272, 353, 7945, 29918, 1272, 29889, 16175, 29898, 29946, 467, 1958, 29898, 1457, 5014, 29897, 13, 29871, 1243, 29918, 1272, 353, 1243, 29918, 1272, 29889, 16175, 29898, 29946, 467, 1958, 29898, 1457, 5014, 29897, 13, 13, 29871, 921, 353, 2446, 29898, 1524, 29898, 14968, 29918, 1272, 876, 13, 13, 29871, 330, 677, 353, 260, 14943, 29889, 29954, 677, 29898, 4905, 29918, 12181, 29922, 3888, 29889, 22100, 1839, 3027, 13359, 12181, 29892, 13, 462, 29871, 23638, 29918, 5365, 622, 272, 29918, 9144, 29922, 13264, 29890, 29889, 29954, 677, 4592, 13724, 29892, 13, 462, 29871, 6876, 29918, 5365, 622, 272, 29918, 9144, 29922, 13264, 29890, 29889, 29954, 677, 4592, 24365, 13724, 29897, 13, 13, 29871, 503, 29918, 12181, 353, 330, 677, 29889, 262, 3901, 29918, 3696, 29918, 12181, 29898, 3888, 29889, 22100, 1839, 3027, 13359, 12181, 29897, 13, 13, 29871, 282, 29920, 353, 260, 11512, 29889, 17708, 29898, 29873, 11512, 29889, 19077, 29898, 29900, 1696, 29871, 29896, 9774, 503, 29918, 12181, 29897, 13, 13, 29871, 396, 8251, 292, 330, 677, 373, 4978, 282, 29898, 29920, 29897, 10017, 1749, 330, 677, 4978, 975, 4558, 29889, 13, 29871, 282, 29916, 353, 330, 677, 29898, 29886, 29920, 29897, 13, 13, 29871, 396, 11190, 11916, 515, 278, 4978, 304, 679, 4558, 515, 596, 8783, 13, 29871, 4558, 353, 282, 29916, 29889, 11249, 29898, 29946, 29897, 13, 13, 29871, 396, 7315, 4558, 304, 11909, 297, 278, 4978, 13, 29871, 503, 353, 330, 677, 29889, 262, 3901, 29898, 29916, 29897, 13, 13, 29871, 396, 3617, 278, 503, 29915, 29879, 6590, 304, 1269, 18652, 6287, 29889, 1763, 437, 445, 29892, 591, 505, 304, 13, 29871, 396, 1284, 714, 920, 1784, 503, 29879, 526, 4502, 1549, 2908, 3538, 472, 1269, 7408, 393, 892, 13, 29871, 396, 451, 4502, 472, 278, 3517, 7408, 29889, 910, 338, 18511, 297, 278, 1473, 1543, 310, 13, 29871, 396, 1269, 1051, 310, 2908, 3538, 8536, 1169, 29889, 2398, 1363, 278, 4768, 622, 272, 4256, 6703, 13, 29871, 396, 29436, 18652, 17036, 304, 18196, 29892, 591, 884, 817, 304, 22932, 278, 2159, 310, 13, 29871, 396, 393, 1473, 1543, 491, 278, 1353, 310, 18652, 29899, 517, 29899, 12719, 9678, 1080, 393, 278, 13, 29871, 396, 12489, 20586, 1156, 6876, 292, 313, 18271, 1156, 738, 10551, 362, 467, 13, 29871, 503, 19730, 353, 518, 5824, 29961, 29896, 29962, 334, 29871, 29946, 1068, 29898, 29875, 29974, 29906, 29897, 363, 474, 29892, 24512, 297, 26985, 29898, 29887, 677, 29889, 1271, 3538, 29918, 23579, 1169, 4638, 13, 29871, 3001, 29918, 29920, 29918, 29873, 9424, 353, 2533, 29898, 29920, 19730, 29897, 13, 29871, 6219, 29918, 29879, 7093, 353, 518, 29920, 29918, 12181, 29889, 294, 29918, 1761, 580, 29961, 29900, 29962, 29899, 7827, 29918, 29920, 29918, 29873, 9424, 29962, 718, 503, 19730, 13, 29871, 503, 23579, 1169, 353, 15886, 29889, 5451, 29898, 29920, 29892, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 29922, 5451, 29918, 29879, 7093, 29892, 9685, 10457, 29896, 29897, 13, 29871, 7521, 13, 13, 29871, 3191, 28318, 29901, 13, 13, 29871, 518, 29896, 5387, 529, 5813, 10202, 529, 5813, 10202, 402, 677, 29901, 3251, 1230, 22787, 13, 539, 411, 512, 1765, 1821, 29871, 29896, 29916, 29896, 1281, 4068, 29879, 29889, 512, 903, 8139, 3631, 10343, 13, 539, 10554, 292, 23985, 3383, 29871, 29906, 29900, 29896, 29947, 29889, 2045, 597, 279, 26560, 29889, 990, 29914, 6897, 29914, 29896, 29947, 29900, 29955, 29889, 29900, 29941, 29900, 29941, 29929, 13, 13, 29871, 518, 29906, 5387, 529, 5813, 10202, 529, 5813, 10202, 322, 529, 5813, 15513, 360, 575, 537, 2661, 7715, 13, 539, 773, 8195, 405, 18510, 29889, 512, 903, 17579, 1288, 16377, 373, 29257, 13, 539, 16314, 800, 3383, 29871, 29906, 29900, 29896, 29955, 29889, 2045, 597, 279, 26560, 29889, 990, 29914, 6897, 29914, 29896, 29953, 29900, 29945, 29889, 29900, 29947, 29947, 29900, 29941, 13, 29871, 9995, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 13, 1669, 1962, 29918, 12181, 7607, 29941, 29906, 29892, 29871, 29941, 29906, 29892, 29871, 29941, 511, 13, 1669, 954, 29918, 29887, 677, 29918, 1271, 29879, 29922, 29941, 29892, 13, 1669, 954, 29918, 24530, 29918, 546, 29918, 1271, 29922, 29941, 29906, 29892, 13, 1669, 23638, 29918, 5365, 622, 272, 29918, 9144, 29922, 8516, 29892, 13, 1669, 6876, 29918, 5365, 622, 272, 29918, 9144, 29922, 8516, 29892, 13, 1669, 17229, 29918, 7045, 29918, 1271, 29922, 8516, 29892, 13, 1669, 671, 29918, 627, 12324, 29922, 5574, 29892, 13, 1669, 16717, 29922, 8516, 29892, 13, 1669, 12725, 29918, 5085, 29922, 8824, 29892, 13, 1669, 1024, 2433, 29887, 677, 29374, 13, 1678, 9995, 9832, 1078, 278, 402, 677, 4768, 622, 272, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 418, 1962, 29918, 12181, 29901, 319, 1051, 310, 11920, 29892, 22146, 278, 1741, 8267, 310, 278, 13, 4706, 1962, 29892, 310, 278, 4768, 622, 943, 6375, 1209, 313, 1552, 1967, 467, 29871, 12048, 2164, 408, 13, 4706, 518, 29950, 29892, 399, 29892, 315, 1822, 13, 4706, 13109, 7865, 29901, 313, 29941, 29906, 29892, 29871, 29941, 29906, 29892, 29871, 29941, 29897, 13, 418, 954, 29918, 29887, 677, 29918, 1271, 29879, 29901, 530, 6043, 29892, 22146, 920, 1784, 1623, 13445, 10335, 11174, 304, 13, 4706, 3160, 297, 278, 1904, 29889, 910, 1818, 16429, 18018, 964, 1716, 379, 322, 399, 29892, 13, 4706, 6467, 278, 4768, 622, 272, 723, 451, 367, 21292, 1821, 29889, 13, 4706, 13109, 7865, 29901, 29871, 29941, 13, 418, 954, 29918, 24530, 29918, 546, 29918, 1271, 29901, 530, 6043, 22146, 920, 1784, 13737, 457, 19565, 10335, 322, 13, 308, 29896, 29916, 29896, 26851, 15359, 304, 3160, 472, 1269, 3233, 310, 278, 18652, 13, 4706, 21277, 29889, 13, 4706, 13109, 7865, 29901, 29871, 29941, 29906, 313, 29875, 29889, 29872, 29889, 278, 995, 1304, 297, 278, 2441, 330, 677, 5650, 467, 13, 418, 23638, 29918, 5365, 622, 272, 29918, 9144, 29901, 319, 740, 607, 4893, 278, 2980, 421, 2080, 29918, 12181, 29952, 13, 4706, 322, 3639, 263, 1246, 519, 19677, 3564, 313, 29872, 29889, 29887, 29889, 263, 13023, 294, 29889, 16941, 2556, 467, 450, 13, 4706, 3564, 881, 2845, 736, 263, 12489, 411, 278, 1021, 1741, 8267, 408, 13, 4706, 421, 2080, 29918, 12181, 29952, 313, 1366, 674, 5703, 788, 3321, 23638, 511, 263, 12489, 411, 278, 13, 4706, 1021, 3171, 322, 2920, 408, 421, 2080, 29918, 12181, 29952, 541, 8951, 278, 1353, 310, 18196, 13, 4706, 313, 1366, 674, 5703, 2756, 457, 23638, 511, 470, 263, 4768, 622, 272, 607, 4893, 297, 263, 13, 4706, 12489, 411, 1741, 8267, 421, 2080, 29918, 12181, 1673, 322, 3639, 263, 12489, 411, 8267, 13, 4706, 421, 2080, 29918, 12181, 1412, 13, 418, 6876, 29918, 5365, 622, 272, 29918, 9144, 29901, 13999, 304, 23638, 29918, 5365, 622, 272, 29918, 9144, 29892, 6876, 29918, 5365, 622, 272, 29918, 9144, 338, 13, 4706, 263, 740, 607, 4893, 278, 2980, 421, 2080, 29918, 12181, 29952, 322, 421, 4905, 29918, 5083, 29952, 13, 4706, 322, 3639, 263, 1246, 519, 19677, 3564, 29889, 450, 19677, 3564, 372, 3639, 13, 4706, 881, 2125, 263, 12489, 310, 8267, 421, 2080, 29918, 12181, 29952, 408, 278, 1881, 29892, 322, 736, 13, 4706, 697, 310, 2211, 3987, 29901, 319, 12489, 411, 421, 4905, 29918, 5083, 29952, 18196, 29892, 263, 12489, 13, 4706, 411, 421, 29906, 334, 1962, 29918, 5083, 29952, 18196, 29892, 470, 263, 4768, 622, 272, 29889, 3462, 3245, 4902, 508, 13, 4706, 367, 1476, 297, 278, 5106, 363, 25954, 20517, 622, 272, 29889, 13, 418, 17229, 29918, 7045, 29918, 1271, 29901, 319, 18761, 310, 5685, 1446, 29892, 22146, 825, 15958, 310, 278, 13, 4706, 9886, 18196, 304, 3349, 1494, 1269, 330, 677, 2908, 29889, 402, 677, 674, 2125, 13, 4706, 278, 6043, 11904, 310, 445, 1353, 6674, 2957, 491, 278, 9886, 1353, 310, 13, 4706, 18196, 29889, 450, 2322, 338, 4203, 472, 1269, 18652, 21277, 29889, 13, 4706, 13109, 995, 29901, 6213, 313, 1366, 674, 2125, 714, 4203, 310, 278, 18196, 1156, 1269, 13, 3986, 2908, 29889, 13, 418, 671, 29918, 627, 12324, 29901, 319, 6120, 1602, 4821, 3692, 470, 451, 304, 671, 1044, 12324, 29889, 3630, 29899, 18980, 13, 4706, 17865, 338, 1304, 304, 11905, 445, 7546, 29889, 13, 4706, 13109, 995, 29901, 421, 8824, 29952, 13, 418, 16717, 29901, 319, 16717, 304, 2761, 4036, 2264, 297, 278, 29871, 29896, 29916, 29896, 26851, 17865, 29889, 13, 4706, 13109, 995, 29901, 421, 8516, 29952, 313, 29875, 29889, 29872, 1696, 1661, 29899, 276, 5498, 15520, 23460, 467, 13, 418, 12725, 29918, 5085, 29901, 5132, 421, 11227, 29952, 23941, 3692, 6273, 881, 367, 13, 4706, 7120, 363, 1959, 2264, 29889, 13, 4706, 13109, 995, 29901, 421, 8824, 29952, 13, 418, 1024, 29901, 5132, 421, 710, 1673, 1024, 2183, 304, 288, 567, 8745, 491, 445, 1203, 29889, 13, 4706, 13109, 995, 29901, 16218, 29887, 677, 29915, 1412, 13, 1678, 9995, 13, 1678, 4128, 353, 9657, 29898, 2997, 29879, 3101, 13, 1678, 396, 8561, 1854, 393, 278, 1881, 8267, 338, 8072, 3342, 29889, 13, 1678, 565, 451, 12489, 12181, 29918, 4422, 29889, 275, 29918, 3730, 29918, 12119, 29898, 4905, 29918, 12181, 1125, 13, 418, 12020, 7865, 2392, 877, 24111, 1818, 367, 8072, 3342, 29889, 1495, 13, 1678, 565, 12489, 12181, 29918, 4422, 29889, 10003, 29898, 4905, 29918, 12181, 29897, 2804, 29871, 29941, 29901, 13, 418, 12020, 7865, 2392, 877, 24111, 29871, 299, 9893, 1818, 367, 29871, 29941, 363, 4558, 29889, 29871, 3575, 8267, 338, 29915, 13, 462, 539, 525, 8875, 4286, 4830, 29898, 20158, 12181, 29918, 4422, 29889, 10003, 29898, 4905, 29918, 12181, 4961, 13, 13, 1678, 954, 29918, 29887, 677, 29918, 1271, 29879, 29918, 353, 15886, 29889, 657, 29918, 7959, 29918, 1767, 29898, 1949, 29918, 29887, 677, 29918, 1271, 29879, 29897, 13, 1678, 565, 313, 1949, 29918, 29887, 677, 29918, 1271, 29879, 29918, 338, 6213, 470, 13, 4706, 938, 29898, 1949, 29918, 29887, 677, 29918, 1271, 29879, 19925, 2804, 954, 29918, 29887, 677, 29918, 1271, 29879, 29918, 470, 13, 4706, 954, 29918, 29887, 677, 29918, 1271, 29879, 29918, 529, 29871, 29896, 1125, 13, 418, 12020, 7865, 2392, 877, 15730, 421, 1949, 29918, 29887, 677, 29918, 1271, 29879, 29952, 1818, 367, 263, 1002, 1711, 2998, 29915, 13, 462, 539, 525, 1066, 3321, 421, 524, 29952, 313, 29879, 1450, 29901, 6571, 467, 4286, 4830, 29898, 1949, 29918, 29887, 677, 29918, 1271, 29879, 876, 13, 1678, 954, 29918, 29887, 677, 29918, 1271, 29879, 353, 938, 29898, 1949, 29918, 29887, 677, 29918, 1271, 29879, 19925, 13, 13, 1678, 1962, 29918, 12181, 353, 12489, 12181, 29918, 4422, 29889, 294, 29918, 1761, 29898, 4905, 29918, 12181, 29897, 13, 1678, 298, 29892, 281, 29892, 274, 353, 1962, 29918, 12181, 13, 1678, 302, 353, 954, 29918, 29887, 677, 29918, 1271, 29879, 13, 1678, 302, 24530, 353, 954, 29918, 24530, 29918, 546, 29918, 1271, 13, 13, 1678, 396, 13109, 402, 677, 29901, 28144, 310, 278, 18196, 526, 6219, 1283, 1156, 1269, 2908, 29892, 13, 1678, 396, 322, 1156, 278, 2186, 2908, 29892, 694, 18196, 526, 6219, 1283, 29889, 13, 1678, 565, 17229, 29918, 7045, 29918, 1271, 338, 6213, 29901, 13, 418, 17229, 29918, 7045, 29918, 1271, 353, 18761, 4197, 29900, 29889, 29945, 29962, 334, 313, 29876, 448, 29871, 29896, 29897, 718, 518, 29900, 29889, 2314, 13, 13, 1678, 396, 498, 292, 591, 1073, 1818, 367, 1565, 29901, 298, 322, 281, 526, 1584, 368, 8572, 1821, 491, 29871, 29906, 29892, 302, 3064, 29889, 13, 1678, 396, 13466, 29892, 278, 269, 802, 29872, 911, 4768, 622, 272, 674, 451, 664, 29889, 13, 1678, 565, 281, 1273, 29871, 29906, 1068, 29876, 2804, 29871, 29900, 29901, 13, 418, 12020, 7865, 2392, 877, 6110, 1818, 367, 8572, 1821, 491, 29871, 29906, 472, 3203, 302, 3064, 6169, 13, 462, 539, 525, 29903, 1450, 29901, 6571, 1273, 6571, 2804, 29871, 29900, 4286, 4830, 29898, 29893, 29892, 29871, 29906, 1068, 29876, 876, 13, 1678, 565, 298, 1273, 29871, 29906, 1068, 29876, 2804, 29871, 29900, 29901, 13, 418, 12020, 7865, 2392, 877, 7011, 881, 367, 8572, 1821, 491, 29871, 29906, 472, 3203, 302, 3064, 29889, 1495, 13, 1678, 565, 298, 849, 29871, 29906, 1068, 29876, 529, 29871, 29896, 29901, 13, 418, 12020, 7865, 2392, 877, 1949, 29918, 29887, 677, 29918, 1271, 29879, 21313, 29900, 1800, 338, 2086, 2919, 29889, 450, 1967, 3171, 525, 13, 462, 539, 525, 3319, 29896, 1800, 1818, 367, 8572, 1821, 491, 29871, 29906, 694, 901, 1135, 426, 29906, 29913, 525, 13, 462, 539, 525, 3706, 29889, 4286, 4830, 29898, 1949, 29918, 29887, 677, 29918, 1271, 29879, 29892, 298, 29892, 13, 462, 462, 539, 938, 29898, 9302, 29889, 1188, 29898, 29882, 29897, 847, 7442, 29889, 1188, 29898, 29906, 29889, 13697, 13, 1678, 565, 281, 849, 29871, 29906, 1068, 29876, 529, 29871, 29896, 29901, 13, 418, 12020, 7865, 2392, 877, 1949, 29918, 29887, 677, 29918, 1271, 29879, 21313, 29900, 1800, 338, 2086, 2919, 29889, 450, 1967, 2920, 525, 13, 462, 539, 525, 3319, 29896, 1800, 1818, 367, 8572, 1821, 491, 29871, 29906, 694, 901, 1135, 426, 29906, 29913, 525, 13, 462, 539, 525, 3706, 29889, 4286, 4830, 29898, 1949, 29918, 29887, 677, 29918, 1271, 29879, 29892, 281, 29892, 13, 462, 462, 539, 938, 29898, 9302, 29889, 1188, 29898, 29882, 29897, 847, 7442, 29889, 1188, 29898, 29906, 29889, 13697, 13, 13, 1678, 396, 5901, 2712, 591, 864, 304, 367, 1565, 29901, 13, 1678, 396, 448, 450, 1353, 310, 3064, 591, 2125, 1818, 367, 5186, 304, 278, 1353, 310, 330, 677, 10930, 29889, 13, 1678, 565, 7431, 29898, 3874, 29890, 29918, 7045, 29918, 1271, 29897, 2804, 954, 29918, 29887, 677, 29918, 1271, 29879, 29901, 13, 418, 12020, 7865, 2392, 877, 6513, 310, 17229, 29918, 7045, 29918, 1271, 21313, 29900, 1800, 1818, 1993, 278, 1353, 29915, 13, 462, 539, 525, 974, 10930, 21313, 29896, 7690, 4286, 4830, 29898, 2435, 29898, 3874, 29890, 29918, 7045, 29918, 1271, 511, 13, 462, 462, 462, 954, 29918, 29887, 677, 29918, 1271, 29879, 876, 13, 13, 1678, 1583, 3032, 1271, 3538, 29918, 23579, 1169, 353, 1583, 3032, 657, 29918, 1271, 3538, 29918, 23579, 1169, 29898, 4905, 29918, 12181, 29892, 13, 462, 462, 462, 4706, 17229, 29918, 7045, 29918, 1271, 29961, 1057, 29899, 29896, 2314, 13, 13, 1678, 396, 2567, 1423, 373, 278, 1819, 310, 2908, 3538, 8536, 1169, 13, 1678, 565, 738, 4197, 5824, 29961, 29900, 29962, 529, 29871, 29896, 363, 24512, 297, 1583, 3032, 1271, 3538, 29918, 23579, 1169, 29962, 1125, 13, 418, 937, 29918, 2696, 1581, 353, 518, 5824, 29961, 29900, 29962, 363, 24512, 297, 1583, 3032, 1271, 3538, 29918, 23579, 1169, 1822, 2248, 29898, 5574, 29897, 13, 418, 12020, 7865, 2392, 877, 4178, 472, 3203, 697, 6876, 29892, 366, 526, 5622, 714, 599, 310, 596, 525, 13, 462, 539, 525, 305, 12629, 29892, 322, 5480, 505, 694, 10970, 304, 2678, 10930, 6169, 13, 462, 539, 525, 3967, 4444, 17229, 29918, 7045, 29918, 1271, 304, 263, 5224, 995, 472, 2380, 29915, 13, 462, 539, 22372, 1836, 4286, 4830, 29898, 4102, 29918, 2696, 1581, 876, 13, 13, 1678, 565, 738, 29898, 9302, 29889, 275, 5358, 29898, 29887, 370, 29892, 29871, 29900, 29897, 363, 11880, 297, 17229, 29918, 7045, 29918, 1271, 1125, 13, 418, 396, 12630, 1206, 29901, 565, 10816, 6876, 292, 694, 18196, 29892, 769, 278, 6876, 338, 13, 418, 396, 925, 385, 10110, 4768, 622, 272, 29889, 13, 418, 1209, 13, 1678, 25342, 738, 4197, 5824, 29961, 29896, 29962, 529, 29871, 29896, 363, 24512, 297, 1583, 3032, 1271, 3538, 29918, 23579, 1169, 29962, 1125, 13, 418, 937, 29918, 2696, 1581, 353, 518, 5824, 29961, 29896, 29962, 363, 24512, 297, 1583, 3032, 1271, 3538, 29918, 23579, 1169, 1822, 2248, 29898, 5574, 29897, 13, 418, 12020, 7865, 2392, 877, 4178, 3203, 697, 310, 596, 15359, 756, 529, 29871, 29896, 1962, 18196, 29889, 525, 13, 462, 539, 525, 4013, 2794, 366, 731, 17229, 29918, 271, 29918, 1271, 2086, 2319, 29889, 525, 13, 462, 539, 525, 15870, 4444, 17229, 29918, 7045, 29918, 1271, 304, 263, 7200, 995, 472, 2380, 29915, 13, 462, 539, 22372, 1836, 4286, 4830, 29898, 4102, 29918, 2696, 1581, 876, 13, 13, 1678, 396, 365, 1691, 1369, 304, 2048, 1749, 4768, 622, 272, 29889, 1334, 5251, 393, 278, 4978, 338, 29871, 29896, 13, 1678, 396, 22112, 29889, 3824, 29892, 16869, 620, 14443, 372, 304, 385, 1967, 29889, 13, 1678, 330, 677, 29918, 14153, 353, 518, 13, 4706, 620, 14443, 29889, 1666, 14443, 29898, 13, 9651, 1741, 29918, 12181, 29918, 449, 11759, 29882, 849, 29871, 29906, 1068, 29876, 29892, 281, 849, 29871, 29906, 1068, 29876, 29892, 274, 334, 29871, 29946, 1068, 29876, 1402, 13, 9651, 1741, 29918, 12181, 29918, 262, 11759, 29882, 334, 281, 334, 274, 2314, 13, 1678, 4514, 13, 13, 1678, 16717, 5461, 353, 922, 287, 3835, 29898, 26776, 29922, 26776, 29892, 15795, 2433, 8172, 29918, 3571, 1495, 13, 13, 1678, 363, 474, 297, 3464, 29898, 29876, 1125, 13, 13, 418, 396, 910, 338, 278, 8267, 310, 278, 1857, 12489, 13, 418, 1857, 29918, 12181, 353, 313, 29882, 849, 29871, 29906, 1068, 29876, 334, 29871, 29906, 1068, 29875, 29892, 281, 849, 29871, 29906, 1068, 29876, 334, 29871, 29906, 1068, 29875, 29892, 274, 334, 29871, 29946, 1068, 29898, 29875, 718, 29871, 29896, 876, 13, 13, 418, 396, 910, 338, 278, 8267, 310, 278, 1881, 304, 1716, 278, 330, 677, 2908, 322, 6876, 4768, 622, 272, 29889, 13, 418, 445, 29918, 29876, 5083, 353, 2533, 29898, 1311, 3032, 1271, 3538, 29918, 23579, 1169, 29961, 29875, 3816, 29900, 29901, 29906, 2314, 13, 418, 445, 29918, 2080, 29918, 12181, 353, 313, 29882, 849, 29871, 29906, 1068, 29876, 334, 29871, 29906, 1068, 29875, 29892, 281, 849, 29871, 29906, 1068, 29876, 334, 29871, 29906, 1068, 29875, 29892, 445, 29918, 29876, 5083, 29897, 13, 13, 418, 330, 677, 29918, 14153, 29889, 4397, 29898, 262, 1765, 29889, 797, 1765, 29898, 24365, 20517, 622, 272, 29898, 3784, 29918, 12181, 29892, 13, 462, 462, 462, 259, 1583, 3032, 1271, 3538, 29918, 23579, 1169, 29961, 29875, 1402, 13, 462, 462, 462, 259, 6876, 29918, 5365, 622, 272, 29918, 9144, 4961, 13, 13, 418, 330, 677, 29918, 1271, 353, 402, 677, 7445, 29898, 2080, 29918, 12181, 29922, 1366, 29918, 2080, 29918, 12181, 29892, 13, 462, 632, 954, 29918, 24530, 29922, 29876, 24530, 29892, 13, 462, 632, 23638, 29918, 5365, 622, 272, 29918, 9144, 29922, 16589, 10335, 29918, 5365, 622, 272, 29918, 9144, 29892, 13, 462, 632, 671, 29918, 627, 12324, 29922, 1509, 29918, 627, 12324, 29892, 13, 462, 632, 16717, 5461, 29922, 26776, 5461, 29897, 13, 13, 418, 565, 1583, 3032, 1271, 3538, 29918, 23579, 1169, 29961, 29875, 3816, 29906, 29962, 1275, 29871, 29900, 29901, 13, 4706, 396, 2178, 18196, 526, 4502, 304, 278, 8195, 29940, 18510, 13, 4706, 330, 677, 29918, 14153, 29889, 4397, 29898, 29887, 677, 29918, 1271, 29897, 13, 418, 1683, 29901, 13, 4706, 396, 3834, 18196, 526, 4502, 2820, 278, 2908, 29889, 13, 4706, 396, 910, 338, 2309, 411, 278, 15658, 3538, 4768, 622, 272, 29889, 13, 4706, 330, 677, 29918, 14153, 29889, 4397, 29898, 13, 9651, 2908, 3538, 29889, 7445, 3538, 29898, 13, 18884, 518, 29887, 677, 29918, 1271, 29892, 10110, 29889, 18415, 580, 1402, 13, 18884, 518, 2083, 29898, 1311, 3032, 1271, 3538, 29918, 23579, 1169, 29961, 29875, 3816, 29900, 29901, 29906, 11724, 13, 462, 1583, 3032, 1271, 3538, 29918, 23579, 1169, 29961, 29875, 3816, 29906, 5262, 876, 13, 13, 418, 396, 9788, 29892, 16869, 7985, 278, 18196, 964, 18652, 5680, 29889, 13, 418, 330, 677, 29918, 14153, 29889, 4397, 29898, 13, 3986, 12027, 392, 29898, 2080, 29918, 12181, 11759, 13, 795, 298, 849, 29871, 29906, 1068, 29876, 334, 29871, 29906, 1068, 29875, 29892, 13, 795, 281, 849, 29871, 29906, 1068, 29876, 334, 29871, 29906, 1068, 29875, 29892, 13, 795, 274, 334, 29871, 29946, 1068, 29876, 849, 29871, 29946, 1068, 29875, 29892, 13, 3986, 4514, 876, 13, 13, 1678, 330, 677, 29918, 14153, 353, 330, 677, 29918, 14153, 29961, 1057, 29899, 29896, 29962, 13, 1678, 396, 1763, 8341, 1283, 29892, 591, 2048, 263, 4768, 622, 272, 393, 521, 2708, 278, 7117, 4208, 13, 1678, 396, 8617, 9247, 29889, 13, 1678, 2428, 29898, 29954, 677, 29892, 1583, 467, 1649, 2344, 12035, 13, 4706, 4768, 622, 943, 29922, 14153, 29889, 14688, 29898, 29887, 677, 29918, 14153, 29892, 12725, 29918, 5085, 29922, 15480, 29918, 5085, 511, 13, 4706, 12725, 29918, 5085, 29922, 15480, 29918, 5085, 29892, 13, 4706, 4128, 29922, 16744, 29892, 13, 4706, 1024, 29922, 978, 29897, 13, 13, 29871, 732, 1990, 5696, 13, 29871, 822, 903, 15501, 29918, 11330, 29898, 25932, 29892, 26688, 1125, 13, 1678, 736, 9657, 580, 13, 13, 29871, 822, 903, 657, 29918, 1271, 3538, 29918, 23579, 1169, 29898, 1311, 29892, 1881, 29918, 12181, 29892, 17229, 29918, 7045, 29918, 1271, 1125, 13, 1678, 9995, 4282, 1051, 310, 8536, 1169, 304, 2367, 304, 278, 2908, 3538, 29918, 5365, 622, 943, 29889, 13, 13, 1678, 450, 1051, 674, 505, 29871, 29941, 1422, 8536, 1169, 29889, 450, 937, 1543, 338, 421, 29876, 280, 1351, 29952, 13, 1678, 607, 3697, 920, 1784, 18196, 674, 3933, 297, 278, 3564, 1156, 1269, 6876, 29889, 13, 1678, 450, 1473, 1543, 338, 421, 865, 4201, 1673, 607, 3697, 920, 1784, 18196, 674, 367, 6206, 13, 1678, 472, 278, 6876, 29889, 450, 4654, 338, 421, 29876, 3364, 1673, 607, 3697, 920, 1784, 18196, 505, 13, 1678, 2307, 429, 1573, 472, 263, 3517, 432, 651, 29892, 322, 526, 5480, 4502, 304, 385, 13, 1678, 10110, 4768, 622, 272, 2012, 310, 278, 330, 677, 2908, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 418, 1881, 29918, 12181, 29901, 8267, 310, 278, 1881, 848, 13, 418, 17229, 29918, 7045, 29918, 1271, 29901, 1051, 310, 5685, 1446, 22146, 825, 15958, 310, 278, 18196, 13, 4706, 881, 6876, 278, 3564, 1156, 1269, 330, 677, 2908, 29889, 13, 1678, 16969, 29901, 13, 418, 2908, 3538, 29918, 23579, 1169, 29901, 278, 1353, 310, 18196, 2175, 29892, 4586, 29892, 322, 4502, 975, 363, 13, 4706, 1269, 330, 677, 2908, 29889, 13, 1678, 9995, 13, 1678, 2908, 3538, 29918, 23579, 1169, 353, 5159, 13, 13, 1678, 302, 3874, 29890, 29892, 302, 280, 1351, 29892, 302, 3364, 353, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 13, 13, 1678, 396, 8878, 28953, 13, 1678, 363, 474, 29892, 285, 945, 297, 26985, 29898, 276, 874, 287, 29898, 3874, 29890, 29918, 7045, 29918, 1271, 22164, 13, 418, 302, 5083, 353, 29871, 29946, 1068, 29898, 29875, 718, 29871, 29896, 29897, 334, 1881, 29918, 12181, 14352, 29896, 29962, 13, 418, 302, 3874, 29890, 353, 938, 3552, 29876, 5083, 448, 302, 3364, 29897, 334, 285, 945, 29897, 13, 418, 302, 280, 1351, 353, 302, 5083, 448, 302, 3874, 29890, 448, 302, 3364, 13, 13, 418, 2908, 3538, 29918, 23579, 1169, 29889, 4397, 4197, 29876, 280, 1351, 29892, 302, 3874, 29890, 29892, 302, 3364, 2314, 13, 13, 418, 396, 2767, 302, 3364, 363, 278, 2446, 3233, 13, 418, 302, 3364, 4619, 302, 3874, 29890, 13, 418, 302, 3364, 334, 29922, 29871, 29946, 13, 13, 1678, 736, 2908, 3538, 29918, 23579, 1169, 29961, 1057, 29899, 29896, 29962, 13, 13, 29871, 732, 6799, 13, 29871, 822, 2908, 3538, 29918, 23579, 1169, 29898, 1311, 1125, 13, 1678, 736, 1583, 3032, 1271, 3538, 29918, 23579, 1169, 13, 13, 13, 1990, 25954, 20517, 622, 272, 29898, 510, 3283, 29889, 1523, 3283, 1125, 13, 29871, 9995, 1576, 18652, 23638, 4768, 622, 272, 1304, 297, 402, 677, 29889, 13, 13, 29871, 910, 4768, 622, 272, 11624, 310, 263, 2908, 3538, 4768, 622, 272, 310, 263, 1855, 29940, 18510, 4768, 622, 272, 29889, 739, 338, 13, 29871, 988, 402, 677, 12778, 263, 27350, 1546, 3291, 393, 526, 6219, 1283, 322, 4502, 304, 278, 13, 29871, 2967, 4978, 29892, 322, 3291, 393, 526, 4502, 373, 1328, 1549, 901, 402, 677, 10930, 29889, 13, 13, 29871, 1152, 445, 4768, 622, 272, 29892, 591, 3160, 18652, 23638, 1546, 278, 760, 1641, 363, 17713, 13, 29871, 1283, 29892, 322, 278, 760, 1641, 4502, 373, 1328, 29889, 910, 9013, 778, 263, 6128, 1279, 936, 18652, 13, 29871, 26307, 373, 11916, 29892, 322, 2582, 297, 4558, 607, 1106, 2253, 29889, 13, 29871, 9995, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 13, 1669, 1881, 29918, 12181, 29892, 13, 1669, 2908, 3538, 29918, 23579, 1169, 29892, 13, 1669, 23638, 29918, 5365, 622, 272, 29918, 9144, 29922, 8516, 1125, 13, 1678, 9995, 9832, 1078, 278, 6876, 4768, 622, 272, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 418, 1881, 29918, 12181, 29901, 319, 1051, 22146, 278, 1881, 8267, 304, 278, 6876, 4768, 622, 272, 29889, 13, 4706, 501, 8485, 297, 3386, 292, 278, 3564, 29889, 13, 418, 2908, 3538, 29918, 23579, 1169, 29901, 319, 1051, 310, 11920, 22146, 278, 1353, 310, 18196, 13, 4706, 6876, 292, 278, 1904, 29892, 408, 1532, 408, 1906, 1641, 2175, 297, 278, 1904, 29892, 322, 1906, 13, 4706, 491, 3364, 292, 278, 6876, 4768, 622, 272, 19148, 29889, 13, 418, 23638, 29918, 5365, 622, 272, 29918, 9144, 29901, 319, 740, 607, 4893, 278, 2980, 421, 2080, 29918, 12181, 29952, 13, 4706, 322, 3639, 263, 1246, 519, 19677, 3564, 313, 29872, 29889, 29887, 29889, 263, 13023, 294, 922, 339, 2556, 467, 450, 13, 4706, 3564, 881, 2845, 736, 263, 12489, 411, 278, 1021, 1741, 8267, 408, 13, 4706, 421, 2080, 29918, 12181, 29952, 313, 1366, 674, 5703, 788, 3321, 23638, 511, 263, 12489, 411, 278, 13, 4706, 1021, 3171, 322, 2920, 408, 421, 2080, 29918, 12181, 29952, 541, 8951, 278, 1353, 310, 18196, 13, 4706, 313, 1366, 674, 5703, 2756, 457, 23638, 511, 470, 263, 4768, 622, 272, 607, 4893, 297, 263, 13, 4706, 12489, 411, 1741, 8267, 421, 2080, 29918, 12181, 1673, 322, 3639, 263, 12489, 411, 8267, 13, 4706, 421, 2080, 29918, 12181, 1412, 13, 1678, 9995, 13, 1678, 4128, 353, 9657, 29898, 2997, 29879, 3101, 13, 1678, 302, 280, 1351, 29892, 302, 3874, 29890, 29892, 302, 3364, 353, 2908, 3538, 29918, 23579, 1169, 13, 13, 1678, 716, 29918, 2080, 29918, 12181, 353, 1881, 29918, 12181, 7503, 29899, 29896, 10062, 29898, 29876, 280, 1351, 29892, 29897, 13, 1678, 3646, 29918, 4905, 29918, 12181, 353, 1881, 29918, 12181, 7503, 29899, 29896, 10062, 29898, 865, 4201, 29892, 29897, 13, 13, 1678, 396, 565, 302, 280, 1351, 470, 302, 3874, 29890, 1275, 29871, 29900, 29892, 769, 925, 671, 385, 10110, 363, 4129, 29889, 13, 1678, 565, 302, 280, 1351, 1275, 29871, 29900, 470, 302, 3874, 29890, 1275, 29871, 29900, 29901, 13, 418, 6876, 29918, 13148, 353, 6213, 13, 418, 6876, 29918, 5365, 622, 272, 29918, 9144, 353, 6213, 13, 13, 418, 1583, 29889, 13322, 29918, 13148, 353, 6876, 29918, 13148, 13, 418, 9500, 29918, 27691, 353, 10110, 29889, 18415, 580, 13, 13, 1678, 1683, 29901, 13, 418, 6876, 29918, 13148, 353, 23638, 29918, 5365, 622, 272, 29918, 9144, 29898, 1482, 29918, 2080, 29918, 12181, 29892, 13, 462, 462, 4706, 1962, 29918, 5083, 29922, 865, 4201, 29897, 13, 418, 6876, 29918, 5365, 622, 272, 29918, 9144, 353, 1583, 29889, 5675, 29918, 5365, 622, 272, 29918, 9144, 29898, 13, 3986, 6876, 29918, 13148, 29892, 13, 3986, 3646, 29918, 12181, 29922, 5182, 29918, 4905, 29918, 12181, 29892, 13, 3986, 6287, 29918, 9144, 29922, 13264, 29889, 4548, 29897, 13, 418, 1583, 29889, 13322, 29918, 13148, 353, 6876, 29918, 13148, 29871, 396, 1152, 2286, 23110, 29889, 13, 418, 9500, 29918, 27691, 353, 1855, 29918, 29876, 29894, 29886, 29889, 21713, 29940, 18510, 29898, 13, 3986, 954, 29918, 13168, 287, 29922, 29876, 280, 1351, 29892, 13, 3986, 4768, 622, 272, 29918, 9144, 29922, 13322, 29918, 5365, 622, 272, 29918, 9144, 29897, 13, 13, 1678, 2428, 29898, 24365, 20517, 622, 272, 29892, 1583, 467, 1649, 2344, 12035, 13, 4706, 2908, 3538, 29889, 7445, 3538, 29898, 13, 9651, 518, 10889, 29918, 27691, 29892, 10110, 29889, 18415, 580, 1402, 518, 29876, 280, 1351, 718, 302, 3874, 29890, 29892, 302, 3364, 11724, 13, 4706, 4128, 29922, 16744, 29892, 13, 4706, 1024, 2433, 13322, 29918, 5365, 622, 272, 1495, 13, 13, 29871, 732, 7959, 5696, 13, 29871, 822, 1207, 29918, 5365, 622, 272, 29918, 9144, 29898, 13148, 29892, 3646, 29918, 12181, 29892, 6287, 29918, 9144, 29922, 13264, 29889, 15755, 29889, 18816, 29885, 3398, 1125, 13, 13, 1678, 822, 4768, 622, 272, 29918, 9144, 29898, 2080, 29879, 29892, 17262, 29918, 2080, 1125, 13, 418, 9995, 6185, 272, 630, 740, 304, 679, 278, 8195, 29940, 18510, 4768, 622, 272, 1213, 15945, 13, 418, 396, 8878, 445, 577, 591, 508, 4386, 263, 1404, 6819, 263, 405, 29940, 393, 3639, 263, 12489, 13, 418, 396, 6323, 385, 405, 29940, 393, 3639, 263, 4768, 622, 272, 13, 418, 1950, 29918, 4905, 353, 7546, 29898, 2080, 29879, 29897, 13, 13, 418, 396, 1334, 817, 304, 7738, 263, 4768, 622, 272, 29892, 541, 591, 437, 451, 1073, 565, 278, 7546, 756, 2309, 13, 418, 396, 577, 29889, 1334, 526, 4444, 445, 701, 304, 4386, 29871, 29906, 24496, 29901, 13, 418, 396, 29871, 29896, 29897, 450, 7546, 14391, 263, 4768, 622, 272, 6660, 599, 338, 1781, 13, 418, 396, 29871, 29906, 29897, 450, 7546, 14391, 263, 12489, 6660, 591, 817, 304, 2507, 372, 964, 263, 4768, 622, 272, 29889, 13, 418, 565, 338, 8758, 29898, 27338, 29918, 4905, 29892, 4768, 622, 272, 29889, 20517, 622, 272, 1125, 13, 4706, 1962, 353, 1950, 29918, 4905, 13, 418, 25342, 338, 8758, 29898, 27338, 29918, 4905, 29892, 15886, 29889, 29911, 6073, 1125, 13, 4706, 1881, 29918, 12181, 353, 10970, 29889, 657, 29918, 12181, 2141, 294, 29918, 1761, 580, 13, 4706, 1962, 29918, 12181, 353, 1950, 29918, 4905, 29889, 657, 29918, 12181, 2141, 294, 29918, 1761, 580, 13, 4706, 4974, 1881, 29918, 12181, 7503, 29899, 29896, 29962, 1275, 1962, 29918, 12181, 7503, 29899, 29896, 29962, 13, 4706, 274, 353, 1881, 29918, 12181, 14352, 29896, 29962, 13, 13, 4706, 396, 1152, 15359, 607, 1962, 263, 12489, 29892, 591, 505, 1023, 24496, 29901, 13, 4706, 396, 29871, 29896, 29897, 1670, 526, 8951, 408, 1784, 1962, 18196, 408, 278, 3646, 6660, 278, 13, 4706, 396, 1678, 23638, 338, 2756, 457, 29892, 6593, 727, 338, 263, 6287, 5643, 491, 263, 9500, 29889, 13, 4706, 396, 29871, 29906, 29897, 450, 1353, 310, 1962, 18196, 15743, 278, 3646, 6660, 278, 13, 4706, 396, 1678, 23638, 338, 788, 3321, 29892, 6593, 727, 338, 925, 263, 9500, 13, 4706, 565, 3646, 29918, 12181, 14352, 29896, 29962, 1275, 1962, 29918, 12181, 14352, 29896, 29962, 849, 29871, 29906, 29901, 13, 3986, 445, 29918, 7052, 353, 6287, 29889, 17185, 29898, 7052, 29918, 9144, 29898, 27338, 29918, 4905, 29961, 16361, 584, 29883, 29962, 718, 29871, 29906, 29889, 876, 13, 3986, 445, 29918, 10889, 353, 9500, 29889, 29657, 29898, 27338, 29918, 4905, 29961, 16361, 274, 29901, 2314, 13, 3986, 1962, 353, 445, 29918, 10889, 29898, 1366, 29918, 7052, 29897, 13, 4706, 25342, 3646, 29918, 12181, 14352, 29896, 29962, 1275, 1962, 29918, 12181, 14352, 29896, 5387, 13, 13, 3986, 1962, 353, 9500, 29889, 29657, 29898, 27338, 29918, 4905, 29961, 16361, 584, 29883, 2314, 13, 4706, 1683, 29901, 13, 3986, 12020, 7865, 2392, 877, 24111, 22435, 9696, 411, 1881, 29889, 1222, 6021, 8267, 29915, 13, 462, 965, 22372, 29900, 29913, 470, 426, 29896, 29913, 541, 12489, 471, 8267, 426, 29906, 29913, 4286, 4830, 29898, 13, 462, 1669, 1881, 29918, 12181, 29892, 15886, 29889, 17685, 29898, 13, 462, 462, 259, 518, 2080, 29918, 12181, 7503, 29899, 29896, 1402, 13, 462, 462, 1678, 518, 29906, 334, 1881, 29918, 12181, 14352, 29896, 5262, 1402, 29871, 29900, 511, 13, 462, 1669, 1962, 29918, 12181, 876, 13, 418, 1683, 29901, 13, 4706, 12020, 7865, 2392, 877, 1252, 6021, 263, 4768, 622, 272, 470, 263, 12489, 29892, 541, 2012, 2355, 29915, 13, 462, 308, 525, 8875, 4286, 4830, 29898, 27338, 29918, 4905, 17255, 1990, 1649, 876, 13, 418, 736, 1962, 13, 13, 1678, 736, 4768, 622, 272, 29918, 9144, 13, 13, 13, 1990, 402, 677, 7445, 29898, 510, 3283, 29889, 1523, 3283, 1125, 13, 29871, 9995, 15771, 2908, 363, 263, 330, 677, 1904, 29889, 13, 13, 29871, 910, 4768, 622, 272, 3743, 421, 1949, 29918, 24530, 29952, 6576, 310, 278, 4972, 29892, 1269, 19849, 310, 385, 13, 29871, 1044, 12324, 29899, 6716, 2059, 6716, 1168, 29894, 29899, 21713, 29940, 18510, 9704, 310, 4768, 622, 943, 29889, 4803, 310, 1044, 12324, 338, 13136, 13, 29871, 322, 278, 8195, 29940, 18510, 6030, 338, 20704, 491, 278, 23638, 29918, 5365, 622, 272, 29918, 9144, 29892, 607, 13, 29871, 10703, 263, 740, 313, 29872, 29889, 29887, 29889, 6483, 19677, 3564, 29897, 304, 9657, 403, 278, 6030, 310, 13, 29871, 278, 4972, 29889, 319, 2322, 313, 29954, 677, 4592, 13724, 29897, 740, 338, 4944, 29889, 13, 29871, 9995, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 12181, 29892, 954, 29918, 24530, 29892, 23638, 29918, 5365, 622, 272, 29918, 9144, 29892, 13, 1669, 671, 29918, 627, 12324, 29892, 16717, 5461, 1125, 13, 1678, 4128, 353, 9657, 29898, 2997, 29879, 3101, 13, 1678, 364, 29876, 29894, 29886, 29918, 1271, 353, 518, 22350, 29889, 18415, 580, 29962, 13, 1678, 445, 29918, 29876, 5083, 353, 1881, 29918, 12181, 14352, 29896, 29962, 13, 13, 1678, 363, 432, 297, 3464, 29898, 1949, 29918, 24530, 1125, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 348, 3880, 29899, 11918, 13, 13, 418, 445, 29918, 13148, 29918, 2080, 29918, 12181, 353, 1881, 29918, 12181, 7503, 29899, 29896, 29962, 718, 313, 2080, 29918, 12181, 14352, 29896, 29962, 849, 29871, 29906, 29892, 29897, 13, 418, 445, 29918, 13148, 353, 23638, 29918, 5365, 622, 272, 29918, 9144, 29898, 1366, 29918, 13148, 29918, 2080, 29918, 12181, 29897, 13, 418, 4768, 622, 272, 29918, 9144, 353, 1583, 29889, 5675, 29918, 5365, 622, 272, 29918, 9144, 29898, 1366, 29918, 13148, 29897, 13, 13, 418, 396, 1152, 1269, 4331, 297, 278, 2908, 29892, 591, 437, 313, 25253, 29897, 1044, 12324, 29892, 5643, 13, 418, 396, 491, 385, 21292, 1821, 29871, 29896, 29916, 29896, 26851, 29892, 769, 2756, 457, 23638, 29889, 13, 418, 445, 29918, 27539, 29894, 29886, 353, 21292, 29889, 797, 1765, 29898, 13, 3986, 1855, 29918, 29876, 29894, 29886, 29889, 21713, 29940, 18510, 29898, 1366, 29918, 29876, 5083, 849, 29871, 29906, 29892, 4768, 622, 272, 29918, 9144, 29922, 5365, 622, 272, 29918, 9144, 876, 13, 13, 418, 396, 22871, 278, 7546, 304, 278, 1855, 29940, 18510, 4768, 622, 272, 363, 2286, 23110, 29889, 13, 418, 445, 29918, 27539, 29894, 29886, 29889, 16589, 10335, 29918, 5365, 622, 272, 29918, 13148, 353, 445, 29918, 13148, 13, 418, 364, 29876, 29894, 29886, 29918, 1271, 29889, 4397, 29898, 1366, 29918, 27539, 29894, 29886, 29897, 13, 13, 418, 364, 29876, 29894, 29886, 29918, 1271, 29889, 4397, 29898, 13, 3986, 21292, 29889, 797, 1765, 29898, 6716, 2059, 6716, 1168, 29894, 29898, 13, 795, 445, 29918, 29876, 5083, 29892, 16717, 29922, 26776, 5461, 3285, 13, 795, 26688, 29922, 29881, 1853, 29918, 4422, 29889, 9435, 29918, 29881, 1853, 29898, 1366, 29918, 27539, 29894, 29886, 29889, 20897, 29892, 13, 462, 462, 9651, 26688, 29918, 29882, 524, 29922, 13264, 29889, 7411, 29941, 29906, 13697, 13, 13, 418, 565, 671, 29918, 627, 12324, 29901, 13, 4706, 364, 29876, 29894, 29886, 29918, 1271, 29889, 4397, 29898, 21786, 362, 19077, 2133, 29898, 13, 9651, 445, 29918, 29876, 5083, 29892, 13, 9651, 26688, 29922, 29881, 1853, 29918, 4422, 29889, 9435, 29918, 29881, 1853, 29898, 1366, 29918, 27539, 29894, 29886, 29889, 20897, 29892, 13, 462, 462, 3986, 26688, 29918, 29882, 524, 29922, 13264, 29889, 7411, 29941, 29906, 4961, 13, 13, 1678, 396, 3940, 393, 591, 11837, 278, 1051, 1951, 678, 475, 16058, 4768, 622, 943, 297, 11837, 13, 1678, 396, 1797, 29889, 13, 1678, 2428, 29898, 29954, 677, 7445, 29892, 1583, 467, 1649, 2344, 12035, 13, 4706, 9704, 29889, 14688, 29898, 27539, 29894, 29886, 29918, 1271, 29961, 1057, 29899, 29896, 11724, 4128, 29922, 16744, 29892, 1024, 2433, 29887, 677, 29918, 1271, 1495, 13, 13, 29871, 732, 7959, 5696, 13, 29871, 822, 1207, 29918, 5365, 622, 272, 29918, 9144, 29898, 13148, 29892, 6287, 29918, 9144, 29922, 13264, 29889, 15755, 29889, 18816, 29885, 3398, 1125, 13, 13, 1678, 822, 4768, 622, 272, 29918, 9144, 29898, 2080, 29879, 29892, 17262, 29918, 2080, 1125, 13, 418, 9995, 6185, 272, 630, 740, 304, 679, 278, 8195, 29940, 18510, 4768, 622, 272, 1213, 15945, 13, 418, 396, 8878, 445, 577, 591, 508, 4386, 263, 1404, 6819, 263, 405, 29940, 393, 3639, 263, 12489, 13, 418, 396, 6323, 385, 405, 29940, 393, 3639, 263, 4768, 622, 272, 13, 418, 1950, 29918, 4905, 353, 7546, 29898, 2080, 29879, 29897, 13, 13, 418, 396, 1334, 817, 304, 7738, 263, 4768, 622, 272, 29892, 541, 591, 437, 451, 1073, 565, 278, 7546, 756, 2309, 13, 418, 396, 577, 29889, 1334, 526, 4444, 445, 701, 304, 4386, 29871, 29906, 24496, 29901, 13, 418, 396, 29871, 29896, 29897, 450, 7546, 14391, 263, 4768, 622, 272, 6660, 599, 338, 1781, 13, 418, 396, 29871, 29906, 29897, 450, 7546, 14391, 263, 12489, 6660, 591, 817, 304, 2507, 372, 964, 263, 4768, 622, 272, 29889, 13, 418, 565, 338, 8758, 29898, 27338, 29918, 4905, 29892, 4768, 622, 272, 29889, 20517, 622, 272, 1125, 13, 4706, 1962, 353, 1950, 29918, 4905, 13, 418, 25342, 338, 8758, 29898, 27338, 29918, 4905, 29892, 15886, 29889, 29911, 6073, 1125, 13, 4706, 1881, 29918, 12181, 353, 10970, 29889, 657, 29918, 12181, 2141, 294, 29918, 1761, 580, 13, 4706, 1962, 29918, 12181, 353, 1950, 29918, 4905, 29889, 657, 29918, 12181, 2141, 294, 29918, 1761, 580, 13, 4706, 4974, 1881, 29918, 12181, 7503, 29899, 29896, 29962, 1275, 1962, 29918, 12181, 7503, 29899, 29896, 29962, 13, 4706, 274, 353, 1881, 29918, 12181, 14352, 29896, 29962, 13, 13, 4706, 396, 1152, 15359, 607, 1962, 263, 12489, 29892, 591, 505, 1023, 24496, 29901, 13, 4706, 396, 29871, 29896, 29897, 1670, 526, 8951, 408, 1784, 1962, 18196, 408, 10970, 6660, 278, 23638, 13, 4706, 396, 1678, 338, 2756, 457, 29892, 6593, 727, 338, 263, 6287, 5643, 491, 263, 9500, 29889, 13, 4706, 396, 29871, 29906, 29897, 1670, 526, 385, 5186, 1353, 310, 1881, 322, 1962, 18196, 6660, 278, 13, 4706, 396, 1678, 23638, 338, 788, 3321, 29892, 6593, 727, 338, 925, 263, 9500, 13, 4706, 565, 1881, 29918, 12181, 14352, 29896, 29962, 1275, 1962, 29918, 12181, 14352, 29896, 29962, 849, 29871, 29906, 29901, 13, 3986, 445, 29918, 7052, 353, 6287, 29889, 17185, 29898, 7052, 29918, 9144, 29898, 27338, 29918, 4905, 29961, 16361, 584, 29883, 29962, 718, 29871, 29906, 29889, 876, 13, 3986, 445, 29918, 10889, 353, 9500, 29889, 29657, 29898, 27338, 29918, 4905, 29961, 16361, 274, 29901, 2314, 13, 3986, 1962, 353, 445, 29918, 10889, 29898, 1366, 29918, 7052, 29897, 13, 4706, 25342, 1881, 29918, 12181, 14352, 29896, 29962, 1275, 1962, 29918, 12181, 14352, 29896, 5387, 13, 13, 3986, 1962, 353, 9500, 29889, 29657, 29898, 27338, 29918, 4905, 29961, 16361, 584, 29883, 2314, 13, 4706, 1683, 29901, 13, 3986, 12020, 7865, 2392, 877, 24111, 22435, 9696, 411, 1881, 29889, 1222, 6021, 8267, 29915, 13, 462, 965, 22372, 29900, 29913, 470, 426, 29896, 29913, 541, 12489, 471, 8267, 426, 29906, 29913, 4286, 4830, 29898, 13, 462, 1669, 1881, 29918, 12181, 29892, 15886, 29889, 17685, 29898, 13, 462, 462, 259, 518, 2080, 29918, 12181, 7503, 29899, 29896, 1402, 13, 462, 462, 1678, 518, 29906, 334, 1881, 29918, 12181, 14352, 29896, 5262, 1402, 29871, 29900, 511, 13, 462, 1669, 1962, 29918, 12181, 876, 13, 418, 1683, 29901, 13, 4706, 12020, 7865, 2392, 877, 1252, 6021, 263, 4768, 622, 272, 470, 263, 12489, 29892, 541, 2012, 2355, 29915, 13, 462, 308, 525, 8875, 4286, 4830, 29898, 27338, 29918, 4905, 17255, 1990, 1649, 876, 13, 418, 736, 1962, 13, 13, 1678, 736, 4768, 622, 272, 29918, 9144, 13, 13, 13, 1990, 3118, 2059, 6716, 1168, 29894, 29898, 5365, 622, 272, 29889, 20517, 622, 272, 1125, 13, 29871, 9995, 1576, 29871, 29896, 29916, 29896, 1281, 29894, 4768, 622, 272, 1304, 297, 402, 677, 29889, 13, 13, 29871, 910, 770, 756, 263, 29703, 740, 607, 2847, 7093, 278, 4128, 13, 29871, 310, 278, 4768, 622, 272, 29889, 13, 29871, 9995, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 1741, 29918, 2311, 29892, 16717, 29922, 8516, 29892, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29892, 3579, 19290, 1125, 13, 1678, 4128, 353, 9657, 29898, 2997, 29879, 3101, 13, 1678, 411, 15886, 29889, 978, 29918, 6078, 877, 6716, 2059, 6716, 1168, 29894, 1495, 408, 1024, 29901, 13, 418, 5224, 29918, 21064, 29892, 20005, 362, 353, 1583, 29889, 14968, 519, 29918, 6092, 29918, 19790, 2133, 29898, 13, 3986, 1741, 29918, 2311, 29892, 16717, 29922, 26776, 29892, 26688, 29922, 29881, 1853, 29897, 13, 418, 1583, 3032, 5365, 622, 272, 353, 6287, 29918, 2922, 2003, 29918, 6092, 29889, 17185, 9782, 2003, 29931, 29965, 29898, 13, 3986, 5224, 29918, 21064, 29892, 20005, 362, 29892, 3579, 19290, 29897, 13, 418, 2428, 29898, 6716, 2059, 6716, 1168, 29894, 29892, 1583, 467, 1649, 2344, 12035, 13, 3986, 26688, 29922, 1311, 3032, 5365, 622, 272, 29889, 13609, 29918, 21064, 29889, 29881, 1853, 29892, 13, 3986, 338, 29918, 23362, 29918, 29926, 562, 711, 713, 29922, 5574, 29892, 13, 3986, 6375, 29918, 1195, 29918, 3696, 29918, 299, 9893, 29922, 29896, 29892, 13, 3986, 4128, 29922, 16744, 29892, 13, 3986, 1024, 29922, 978, 29897, 13, 13, 29871, 822, 6375, 29898, 1311, 29892, 921, 1125, 13, 1678, 736, 1583, 3032, 5365, 622, 272, 29889, 11333, 29898, 29916, 29897, 13, 13, 29871, 822, 16402, 29898, 1311, 29892, 343, 1125, 13, 1678, 736, 1583, 3032, 5365, 622, 272, 29889, 262, 3901, 29898, 29891, 29897, 13, 13, 29871, 822, 16402, 29918, 1188, 29918, 4801, 29918, 29926, 562, 711, 713, 29898, 1311, 29892, 343, 29892, 1741, 29918, 299, 9893, 29922, 8516, 1125, 13, 1678, 736, 1583, 3032, 5365, 622, 272, 29889, 262, 3901, 29918, 1188, 29918, 4801, 29918, 29926, 562, 711, 713, 29898, 29891, 29892, 1741, 29918, 299, 9893, 29897, 13, 13, 29871, 822, 6375, 29918, 1188, 29918, 4801, 29918, 29926, 562, 711, 713, 29898, 1311, 29892, 921, 29892, 1741, 29918, 299, 9893, 29922, 8516, 1125, 13, 1678, 736, 1583, 3032, 5365, 622, 272, 29889, 11333, 29918, 1188, 29918, 4801, 29918, 29926, 562, 711, 713, 29898, 29916, 29892, 1741, 29918, 299, 9893, 29897, 13, 13, 29871, 732, 7959, 5696, 13, 29871, 822, 7945, 519, 29918, 6092, 29918, 19790, 2133, 29898, 3696, 29918, 2311, 29892, 13, 462, 462, 16717, 29922, 8516, 29892, 13, 462, 462, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29892, 13, 462, 462, 1024, 29922, 8516, 1125, 13, 1678, 411, 15886, 29889, 978, 29918, 6078, 29898, 978, 470, 525, 14968, 519, 29918, 6092, 29918, 19790, 2133, 29374, 13, 418, 1741, 29918, 2311, 353, 15886, 29889, 13441, 29918, 517, 29918, 20158, 29898, 13, 3986, 1741, 29918, 2311, 29892, 26688, 29918, 29882, 524, 29922, 13264, 29889, 524, 29941, 29906, 29892, 1024, 2433, 3696, 29918, 2311, 1495, 13, 418, 4036, 29918, 5344, 353, 15886, 29889, 8172, 29889, 29590, 29898, 13, 3986, 8267, 11759, 3696, 29918, 2311, 29892, 1741, 29918, 2311, 1402, 13, 3986, 26688, 29922, 29881, 1853, 29892, 13, 3986, 16717, 29922, 26776, 29897, 13, 418, 4036, 29918, 2072, 265, 2759, 353, 15886, 29889, 29880, 979, 29887, 29889, 29939, 29878, 29898, 8172, 29918, 5344, 9601, 29900, 29962, 13, 418, 5224, 29918, 21064, 29892, 20005, 362, 353, 15886, 29889, 29880, 979, 29887, 29889, 6092, 29898, 8172, 29918, 2072, 265, 2759, 29897, 13, 418, 5224, 29918, 21064, 353, 15886, 29889, 16174, 29898, 13, 3986, 2847, 29918, 1767, 29922, 13609, 29918, 21064, 29892, 7945, 519, 29922, 5574, 29892, 1024, 2433, 13609, 29918, 21064, 1495, 13, 418, 396, 25455, 263, 1661, 29899, 14968, 519, 2286, 363, 278, 20005, 362, 16285, 577, 13, 418, 396, 393, 967, 995, 3508, 29915, 29873, 337, 29899, 11249, 29881, 515, 1065, 29899, 517, 29899, 3389, 29889, 13, 418, 20005, 362, 353, 15886, 29889, 16174, 29898, 13, 3986, 2847, 29918, 1767, 29922, 546, 6149, 362, 29892, 7945, 519, 29922, 8824, 29892, 1024, 2433, 546, 6149, 362, 1495, 13, 418, 736, 5224, 29918, 21064, 29892, 20005, 362, 13, 13, 13, 1990, 21775, 362, 19077, 2133, 29898, 5365, 622, 272, 29889, 20517, 622, 272, 1125, 13, 29871, 9995, 20517, 622, 272, 304, 2334, 21775, 362, 21981, 2133, 313, 2865, 29940, 555, 467, 15945, 29908, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 302, 5083, 29892, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29892, 12725, 29918, 5085, 29922, 8824, 29892, 1024, 29922, 8516, 1125, 13, 1678, 4128, 353, 9657, 29898, 2997, 29879, 3101, 13, 13, 1678, 1583, 3032, 11228, 1891, 353, 15886, 29889, 16174, 29898, 8824, 29892, 7945, 519, 29922, 8824, 29897, 13, 1678, 1583, 3032, 29885, 353, 15886, 29889, 16174, 29898, 13264, 29889, 3298, 359, 29898, 29876, 5083, 29892, 26688, 876, 13, 1678, 1583, 3032, 29879, 353, 4103, 15628, 16174, 29898, 13264, 29889, 2873, 29898, 29876, 5083, 29892, 26688, 511, 1518, 29889, 9544, 3101, 13, 1678, 1583, 3032, 5365, 622, 272, 353, 21292, 29889, 797, 1765, 29898, 13, 4706, 9704, 29889, 14688, 4197, 13, 9651, 6287, 29889, 17185, 29898, 1311, 3032, 29879, 511, 13, 9651, 9500, 29889, 29657, 29898, 1311, 3032, 29885, 511, 13, 4706, 4514, 876, 13, 1678, 2428, 29898, 21786, 362, 19077, 2133, 29892, 1583, 467, 1649, 2344, 12035, 13, 4706, 12725, 29918, 5085, 29922, 15480, 29918, 5085, 29892, 13, 4706, 6375, 29918, 1195, 29918, 3696, 29918, 299, 9893, 29922, 29896, 29892, 13, 4706, 4128, 29922, 16744, 29892, 13, 4706, 1024, 29922, 978, 470, 525, 21786, 362, 19077, 2133, 1495, 13, 13, 29871, 822, 903, 262, 3901, 29898, 1311, 29892, 343, 29892, 3579, 19290, 1125, 13, 1678, 411, 15886, 29889, 6451, 29918, 22594, 4197, 1311, 3032, 26026, 29918, 2344, 29898, 29891, 29892, 16402, 29922, 5574, 4638, 1125, 13, 418, 736, 1583, 3032, 5365, 622, 272, 29889, 262, 3901, 29898, 29891, 29892, 3579, 19290, 29897, 13, 13, 29871, 822, 903, 11333, 29898, 1311, 29892, 921, 29892, 3579, 19290, 1125, 13, 1678, 411, 15886, 29889, 6451, 29918, 22594, 4197, 1311, 3032, 26026, 29918, 2344, 29898, 29916, 29892, 16402, 29922, 8824, 4638, 1125, 13, 418, 736, 1583, 3032, 5365, 622, 272, 29889, 11333, 29898, 29916, 29892, 3579, 19290, 29897, 13, 13, 29871, 822, 903, 262, 3901, 29918, 1188, 29918, 4801, 29918, 29926, 562, 711, 713, 29898, 1311, 29892, 343, 29892, 3579, 19290, 1125, 13, 1678, 411, 15886, 29889, 6451, 29918, 22594, 4197, 1311, 3032, 26026, 29918, 2344, 29898, 29891, 29892, 16402, 29922, 5574, 4638, 1125, 13, 418, 736, 1583, 3032, 5365, 622, 272, 29889, 262, 3901, 29918, 1188, 29918, 4801, 29918, 29926, 562, 711, 713, 29898, 29891, 29892, 29871, 29896, 29892, 3579, 19290, 29897, 13, 13, 29871, 822, 903, 11333, 29918, 1188, 29918, 4801, 29918, 29926, 562, 711, 713, 29898, 1311, 29892, 921, 29892, 3579, 19290, 1125, 13, 1678, 411, 15886, 29889, 6451, 29918, 22594, 4197, 1311, 3032, 26026, 29918, 2344, 29898, 29916, 29892, 16402, 29922, 8824, 4638, 1125, 13, 418, 736, 1583, 3032, 5365, 622, 272, 29889, 11333, 29918, 1188, 29918, 4801, 29918, 29926, 562, 711, 713, 29898, 29916, 29892, 29871, 29896, 29892, 3579, 19290, 29897, 13, 13, 29871, 822, 903, 26026, 29918, 2344, 29898, 1311, 29892, 10970, 29892, 16402, 1125, 13, 1678, 9995, 6644, 6646, 565, 451, 2307, 16601, 1213, 15945, 13, 13, 1678, 822, 903, 2344, 7295, 13, 418, 9995, 8893, 278, 848, 29899, 18980, 17865, 1213, 15945, 13, 418, 9685, 353, 5821, 29918, 7959, 29889, 3881, 29898, 1457, 571, 29918, 7959, 29889, 10003, 29898, 2080, 29879, 29897, 448, 29871, 29896, 29897, 13, 418, 286, 353, 15886, 29889, 755, 29889, 17469, 29918, 12676, 29898, 2080, 29879, 29892, 9685, 29922, 8990, 29897, 13, 418, 269, 353, 313, 13, 3986, 15886, 29889, 755, 29889, 17469, 29918, 4172, 29898, 2080, 29879, 29892, 9685, 29922, 8990, 29897, 718, 13, 965, 29896, 29900, 29889, 334, 7442, 29889, 29888, 3888, 29898, 29881, 1853, 29918, 4422, 29889, 294, 29918, 23749, 29918, 29881, 1853, 29898, 2080, 29879, 29889, 29881, 1853, 8106, 8961, 29897, 13, 418, 565, 16402, 29901, 13, 4706, 269, 353, 29871, 29896, 847, 269, 13, 4706, 286, 353, 448, 29885, 13, 418, 1683, 29901, 13, 4706, 286, 353, 286, 847, 269, 13, 418, 411, 15886, 29889, 6451, 29918, 22594, 4197, 1311, 3032, 29885, 29889, 16645, 29898, 29885, 511, 1583, 3032, 29879, 29889, 16645, 29898, 29879, 4638, 1125, 13, 4706, 736, 1583, 3032, 11228, 1891, 29889, 16645, 29898, 5574, 29897, 13, 13, 1678, 736, 15886, 29889, 1116, 29898, 1311, 3032, 11228, 1891, 29892, 15886, 29889, 1217, 29918, 459, 29892, 903, 2344, 29897, 13, 13, 13, 1990, 12027, 392, 29898, 510, 3283, 29889, 1523, 3283, 1125, 13, 29871, 9995, 29909, 4768, 622, 272, 304, 4327, 18196, 964, 18652, 17036, 1213, 15945, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 12181, 29892, 2908, 29918, 2311, 29922, 29906, 29892, 12725, 29918, 5085, 29922, 8824, 29892, 1024, 29922, 8516, 1125, 13, 1678, 4128, 353, 9657, 29898, 2997, 29879, 3101, 13, 1678, 1583, 3032, 1271, 29918, 2311, 353, 2908, 29918, 2311, 13, 1678, 17117, 298, 29892, 281, 29892, 274, 353, 5821, 29918, 7959, 29889, 5451, 29898, 2080, 29918, 12181, 29892, 21069, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 2314, 13, 1678, 298, 29892, 281, 29892, 274, 353, 298, 29961, 29900, 1402, 281, 29961, 29900, 1402, 274, 29961, 29900, 29962, 13, 1678, 302, 353, 1583, 3032, 1271, 29918, 2311, 13, 1678, 289, 353, 518, 13, 4706, 620, 14443, 29889, 1666, 14443, 29898, 13, 9651, 1741, 29918, 12181, 29918, 449, 11759, 29882, 334, 302, 29892, 281, 334, 302, 29892, 274, 849, 302, 1068, 29906, 1402, 13, 9651, 1741, 29918, 12181, 29918, 262, 11759, 29882, 29892, 302, 29892, 281, 29892, 302, 29892, 274, 849, 302, 1068, 29906, 11724, 13, 4706, 1301, 4220, 29889, 4300, 4220, 29898, 17858, 11759, 29900, 29892, 29871, 29941, 29892, 29871, 29896, 29892, 29871, 29946, 29892, 29871, 29906, 11724, 13, 4706, 620, 14443, 29889, 1666, 14443, 29898, 13, 9651, 1741, 29918, 12181, 29918, 262, 11759, 29882, 29892, 281, 29892, 274, 1402, 13, 9651, 1741, 29918, 12181, 29918, 449, 11759, 29882, 29892, 281, 29892, 274, 849, 302, 1068, 29906, 29892, 302, 29892, 302, 11724, 13, 1678, 4514, 13, 1678, 2428, 29898, 29777, 29892, 1583, 467, 1649, 2344, 12035, 13, 4706, 4768, 622, 943, 29922, 14153, 29889, 14688, 29898, 29890, 29892, 12725, 29918, 5085, 29922, 15480, 29918, 5085, 511, 13, 4706, 1024, 29922, 978, 470, 525, 29777, 742, 13, 4706, 4128, 29922, 16744, 29897, 13, 13, 13, 1990, 402, 677, 4592, 13724, 29898, 13264, 29895, 29889, 16941, 2556, 1125, 13, 29871, 9995, 4592, 3564, 363, 278, 330, 677, 4768, 622, 272, 29889, 13, 13, 29871, 910, 23315, 263, 29871, 29941, 7546, 26851, 284, 3564, 29892, 411, 1104, 29884, 26229, 3168, 13, 29871, 322, 540, 29918, 8945, 2847, 3950, 29889, 450, 937, 322, 4654, 15359, 505, 2322, 8466, 13, 29871, 8267, 310, 29871, 29941, 29892, 322, 278, 1473, 7546, 338, 263, 29871, 29896, 29916, 29896, 26851, 29889, 910, 338, 278, 6230, 13, 29871, 297, 278, 970, 1873, 310, 402, 677, 29889, 13, 13, 29871, 450, 1962, 310, 278, 26851, 284, 3564, 17645, 278, 7117, 310, 385, 13737, 457, 13, 29871, 13852, 313, 29875, 29889, 29872, 29889, 343, 353, 286, 334, 921, 718, 289, 511, 988, 286, 29892, 921, 29892, 322, 289, 526, 599, 25187, 943, 310, 13, 29871, 278, 1021, 8267, 29892, 322, 334, 14088, 1543, 3538, 21666, 29889, 13, 29871, 9995, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 12181, 29892, 954, 29918, 10892, 29922, 29946, 29900, 29900, 29892, 8466, 29918, 12181, 29922, 29941, 1125, 13, 1678, 9995, 4592, 3564, 363, 330, 677, 4768, 622, 272, 1213, 15945, 13, 1678, 396, 13109, 338, 6287, 322, 9500, 29892, 577, 29871, 29906, 29883, 14391, 29889, 13, 1678, 445, 29918, 29876, 5083, 353, 1881, 29918, 12181, 14352, 29896, 29962, 334, 29871, 29906, 13, 1678, 7602, 353, 2090, 312, 8789, 29889, 3846, 29898, 13, 4706, 15886, 6321, 29889, 1168, 29894, 29906, 29928, 29892, 13, 4706, 7164, 2433, 17642, 742, 13, 4706, 8466, 29918, 11228, 3950, 29922, 13264, 29889, 11228, 19427, 29889, 354, 29918, 8945, 3285, 13, 4706, 26229, 2433, 2674, 29884, 1495, 13, 1678, 7602, 29918, 4230, 353, 2090, 312, 8789, 29889, 3846, 29898, 13, 4706, 15886, 6321, 29889, 1168, 29894, 29906, 29928, 29892, 13, 4706, 7164, 2433, 17642, 742, 13, 4706, 8466, 29918, 11228, 3950, 29922, 13264, 29889, 11228, 19427, 29889, 3298, 359, 3285, 13, 4706, 24003, 29918, 11228, 3950, 29922, 13264, 29889, 11228, 19427, 29889, 3298, 359, 3101, 13, 1678, 2428, 29898, 29954, 677, 4592, 13724, 29892, 1583, 467, 1649, 2344, 1649, 4197, 13, 4706, 15886, 6321, 29889, 4290, 29898, 12181, 29922, 2080, 29918, 12181, 511, 13, 4706, 7602, 29898, 1949, 29918, 10892, 29892, 8466, 29918, 12181, 511, 13, 4706, 7602, 29898, 1949, 29918, 10892, 29892, 29871, 29896, 511, 13, 4706, 7602, 29918, 4230, 29898, 1366, 29918, 29876, 5083, 29892, 8466, 29918, 12181, 29897, 13, 268, 2314, 13, 13, 13, 1990, 402, 677, 4592, 24365, 13724, 29898, 13264, 29895, 29889, 16941, 2556, 1125, 13, 29871, 9995, 4592, 3564, 363, 278, 330, 677, 6876, 4768, 622, 272, 29889, 13, 13, 29871, 910, 338, 925, 263, 2323, 26851, 284, 7546, 29889, 13, 29871, 9995, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 12181, 29892, 1962, 29918, 5083, 29892, 8466, 29918, 12181, 29922, 29941, 1125, 13, 1678, 9995, 4592, 3564, 363, 330, 677, 4768, 622, 272, 1213, 15945, 13, 1678, 396, 13109, 338, 6287, 322, 9500, 29892, 577, 29871, 29906, 29883, 14391, 29889, 13, 1678, 445, 29918, 29876, 5083, 353, 1962, 29918, 5083, 334, 29871, 29906, 13, 1678, 7602, 353, 2090, 312, 8789, 29889, 3846, 29898, 13, 4706, 15886, 6321, 29889, 1168, 29894, 29906, 29928, 29892, 13, 4706, 7164, 2433, 17642, 742, 13, 4706, 8466, 29918, 11228, 3950, 29922, 13264, 29889, 11228, 19427, 29889, 3298, 359, 3285, 13, 4706, 24003, 29918, 11228, 3950, 29922, 13264, 29889, 11228, 19427, 29889, 3298, 359, 3101, 13, 13, 1678, 2428, 29898, 29954, 677, 4592, 24365, 13724, 29892, 1583, 467, 1649, 2344, 1649, 4197, 13, 4706, 15886, 6321, 29889, 4290, 29898, 2080, 29918, 12181, 511, 13, 4706, 7602, 29898, 1366, 29918, 29876, 5083, 29892, 8466, 29918, 12181, 29897, 2314, 13, 2 ]
idfy_sdk/services/signature/models/redirect_settings.py
idfy-io/idfy-sdk-python
0
107258
<gh_stars>0 # coding: utf-8 """ Idfy.Signature Sign contracts, declarations, forms and other documents using digital signatures. ## Last update Last build date for this endpoint: 18.03.2019 """ import pprint import re from typing import List, Dict from datetime import datetime as datetime class RedirectSettings(object): """NOTE: This class is generated by Eivind. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ swagger_types = { 'redirect_mode': str, 'domain': str, 'error': str, 'cancel': str, 'success': str } attribute_map = { 'redirect_mode': 'redirectMode', 'domain': 'domain', 'error': 'error', 'cancel': 'cancel', 'success': 'success' } def __init__(self, redirect_mode=None, domain=None, error=None, cancel=None, success=None): self._redirect_mode = None self._domain = None self._error = None self._cancel = None self._success = None self.discriminator = None if redirect_mode is not None: self.redirect_mode = redirect_mode if domain is not None: self.domain = domain if error is not None: self.error = error if cancel is not None: self.cancel = cancel if success is not None: self.success = success @property def redirect_mode(self): """Gets the redirect_mode of this RedirectSettings. Defines the redirect mode to use for the signer. :return: The redirect_mode of this RedirectSettings. :rtype: str """ return self._redirect_mode @redirect_mode.setter def redirect_mode(self, redirect_mode): """Sets the redirect_mode of this RedirectSettings. Defines the redirect mode to use for the signer. :param redirect_mode: The redirect_mode of this RedirectSettings. :type: str """ self._redirect_mode = redirect_mode @property def domain(self): """Gets the domain of this RedirectSettings. The domain your website is hosted on. <span style=\"color: red;\">Required if you specify one of the iframe redirect modes for the signer.</span> :return: The domain of this RedirectSettings. :rtype: str """ return self._domain @domain.setter def domain(self, domain): """Sets the domain of this RedirectSettings. The domain your website is hosted on. <span style=\"color: red;\">Required if you specify one of the iframe redirect modes for the signer.</span> :param domain: The domain of this RedirectSettings. :type: str """ self._domain = domain @property def error(self): """Gets the error of this RedirectSettings. The URL that the signer is redirected to if something goes wrong. <span style=\"color: red;\">Required if you use redirect for the signer.</span> :return: The error of this RedirectSettings. :rtype: str """ return self._error @error.setter def error(self, error): """Sets the error of this RedirectSettings. The URL that the signer is redirected to if something goes wrong. <span style=\"color: red;\">Required if you use redirect for the signer.</span> :param error: The error of this RedirectSettings. :type: str """ self._error = error @property def cancel(self): """Gets the cancel of this RedirectSettings. The URL that the signer is redirected to if the signing is cancelled. <span style=\"color: red;\">Required if you use redirect for the signer.</span> :return: The cancel of this RedirectSettings. :rtype: str """ return self._cancel @cancel.setter def cancel(self, cancel): """Sets the cancel of this RedirectSettings. The URL that the signer is redirected to if the signing is cancelled. <span style=\"color: red;\">Required if you use redirect for the signer.</span> :param cancel: The cancel of this RedirectSettings. :type: str """ self._cancel = cancel @property def success(self): """Gets the success of this RedirectSettings. The URL that the signer is redirected to after a successful signing. <span style=\"color: red;\">Required if you use redirect for the signer.</span> :return: The success of this RedirectSettings. :rtype: str """ return self._success @success.setter def success(self, success): """Sets the success of this RedirectSettings. The URL that the signer is redirected to after a successful signing. <span style=\"color: red;\">Required if you use redirect for the signer.</span> :param success: The success of this RedirectSettings. :type: str """ self._success = success def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in self.swagger_types.items(): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value return result def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, RedirectSettings): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 15945, 29908, 13, 1678, 306, 2176, 29891, 29889, 10140, 1535, 13, 13, 1678, 9954, 8078, 29879, 29892, 28721, 29892, 7190, 322, 916, 10701, 773, 13436, 1804, 3698, 29889, 259, 444, 9208, 2767, 259, 9208, 2048, 2635, 363, 445, 16248, 29901, 29871, 29896, 29947, 29889, 29900, 29941, 29889, 29906, 29900, 29896, 29929, 13, 13, 15945, 29908, 13, 13, 13, 5215, 282, 2158, 13, 5215, 337, 13, 3166, 19229, 1053, 2391, 29892, 360, 919, 13, 3166, 12865, 1053, 12865, 408, 12865, 13, 13, 13, 1990, 4367, 1088, 9585, 29898, 3318, 1125, 13, 1678, 9995, 12256, 29923, 29901, 910, 770, 338, 5759, 491, 382, 440, 513, 29889, 13, 13, 1678, 1938, 451, 3863, 278, 770, 7522, 29889, 13, 1678, 9995, 13, 13, 1678, 9995, 13, 1678, 6212, 5026, 29901, 13, 418, 2381, 9921, 29918, 8768, 313, 8977, 1125, 450, 1820, 338, 5352, 1024, 13, 462, 9651, 322, 278, 995, 338, 5352, 1134, 29889, 13, 418, 5352, 29918, 1958, 313, 8977, 1125, 450, 1820, 338, 5352, 1024, 13, 462, 9651, 322, 278, 995, 338, 4390, 1820, 297, 5023, 29889, 13, 1678, 9995, 13, 1678, 2381, 9921, 29918, 8768, 353, 426, 13, 4706, 525, 17886, 29918, 8513, 2396, 851, 29892, 13, 4706, 525, 7247, 2396, 851, 29892, 13, 4706, 525, 2704, 2396, 851, 29892, 13, 4706, 525, 20713, 2396, 851, 29892, 13, 4706, 525, 8698, 2396, 851, 13, 1678, 500, 13, 13, 1678, 5352, 29918, 1958, 353, 426, 13, 4706, 525, 17886, 29918, 8513, 2396, 525, 17886, 6818, 742, 13, 4706, 525, 7247, 2396, 525, 7247, 742, 13, 4706, 525, 2704, 2396, 525, 2704, 742, 13, 4706, 525, 20713, 2396, 525, 20713, 742, 13, 4706, 525, 8698, 2396, 525, 8698, 29915, 13, 1678, 500, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 6684, 29918, 8513, 29922, 8516, 29892, 5354, 29922, 8516, 29892, 1059, 29922, 8516, 29892, 12611, 29922, 8516, 29892, 2551, 29922, 8516, 1125, 13, 13, 4706, 1583, 3032, 17886, 29918, 8513, 353, 6213, 13, 4706, 1583, 3032, 7247, 353, 6213, 13, 4706, 1583, 3032, 2704, 353, 6213, 13, 4706, 1583, 3032, 20713, 353, 6213, 13, 4706, 1583, 3032, 8698, 353, 6213, 13, 4706, 1583, 29889, 2218, 29883, 20386, 1061, 353, 6213, 13, 13, 4706, 565, 6684, 29918, 8513, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 17886, 29918, 8513, 353, 6684, 29918, 8513, 13, 4706, 565, 5354, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 7247, 353, 5354, 13, 4706, 565, 1059, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 2704, 353, 1059, 13, 4706, 565, 12611, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 20713, 353, 12611, 13, 4706, 565, 2551, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 8698, 353, 2551, 13, 13, 1678, 732, 6799, 13, 1678, 822, 6684, 29918, 8513, 29898, 1311, 1125, 13, 4706, 9995, 29954, 1691, 278, 6684, 29918, 8513, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 5282, 1475, 278, 6684, 4464, 304, 671, 363, 278, 1804, 261, 29889, 13, 13, 4706, 584, 2457, 29901, 450, 6684, 29918, 8513, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 17886, 29918, 8513, 13, 13, 1678, 732, 17886, 29918, 8513, 29889, 842, 357, 13, 1678, 822, 6684, 29918, 8513, 29898, 1311, 29892, 6684, 29918, 8513, 1125, 13, 4706, 9995, 29903, 1691, 278, 6684, 29918, 8513, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 5282, 1475, 278, 6684, 4464, 304, 671, 363, 278, 1804, 261, 29889, 13, 13, 4706, 584, 3207, 6684, 29918, 8513, 29901, 450, 6684, 29918, 8513, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 13, 4706, 1583, 3032, 17886, 29918, 8513, 353, 6684, 29918, 8513, 13, 13, 1678, 732, 6799, 13, 1678, 822, 5354, 29898, 1311, 1125, 13, 4706, 9995, 29954, 1691, 278, 5354, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 450, 5354, 596, 4700, 338, 17791, 373, 29889, 29871, 529, 9653, 3114, 14672, 2780, 29901, 2654, 10436, 1013, 19347, 565, 366, 6084, 697, 310, 278, 22014, 6684, 18893, 363, 278, 1804, 261, 21106, 9653, 29958, 13, 13, 4706, 584, 2457, 29901, 450, 5354, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 7247, 13, 13, 1678, 732, 7247, 29889, 842, 357, 13, 1678, 822, 5354, 29898, 1311, 29892, 5354, 1125, 13, 4706, 9995, 29903, 1691, 278, 5354, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 450, 5354, 596, 4700, 338, 17791, 373, 29889, 29871, 529, 9653, 3114, 14672, 2780, 29901, 2654, 10436, 1013, 19347, 565, 366, 6084, 697, 310, 278, 22014, 6684, 18893, 363, 278, 1804, 261, 21106, 9653, 29958, 13, 13, 4706, 584, 3207, 5354, 29901, 450, 5354, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 13, 4706, 1583, 3032, 7247, 353, 5354, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1059, 29898, 1311, 1125, 13, 4706, 9995, 29954, 1691, 278, 1059, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 450, 3988, 393, 278, 1804, 261, 338, 6684, 287, 304, 565, 1554, 5771, 2743, 29889, 529, 9653, 3114, 14672, 2780, 29901, 2654, 10436, 1013, 19347, 565, 366, 671, 6684, 363, 278, 1804, 261, 21106, 9653, 29958, 13, 13, 4706, 584, 2457, 29901, 450, 1059, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 2704, 13, 13, 1678, 732, 2704, 29889, 842, 357, 13, 1678, 822, 1059, 29898, 1311, 29892, 1059, 1125, 13, 4706, 9995, 29903, 1691, 278, 1059, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 450, 3988, 393, 278, 1804, 261, 338, 6684, 287, 304, 565, 1554, 5771, 2743, 29889, 529, 9653, 3114, 14672, 2780, 29901, 2654, 10436, 1013, 19347, 565, 366, 671, 6684, 363, 278, 1804, 261, 21106, 9653, 29958, 13, 13, 4706, 584, 3207, 1059, 29901, 450, 1059, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 13, 4706, 1583, 3032, 2704, 353, 1059, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12611, 29898, 1311, 1125, 13, 4706, 9995, 29954, 1691, 278, 12611, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 450, 3988, 393, 278, 1804, 261, 338, 6684, 287, 304, 565, 278, 26188, 338, 12611, 839, 29889, 529, 9653, 3114, 14672, 2780, 29901, 2654, 10436, 1013, 19347, 565, 366, 671, 6684, 363, 278, 1804, 261, 21106, 9653, 29958, 13, 13, 4706, 584, 2457, 29901, 450, 12611, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 20713, 13, 13, 1678, 732, 20713, 29889, 842, 357, 13, 1678, 822, 12611, 29898, 1311, 29892, 12611, 1125, 13, 4706, 9995, 29903, 1691, 278, 12611, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 450, 3988, 393, 278, 1804, 261, 338, 6684, 287, 304, 565, 278, 26188, 338, 12611, 839, 29889, 529, 9653, 3114, 14672, 2780, 29901, 2654, 10436, 1013, 19347, 565, 366, 671, 6684, 363, 278, 1804, 261, 21106, 9653, 29958, 13, 13, 4706, 584, 3207, 12611, 29901, 450, 12611, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 13, 4706, 1583, 3032, 20713, 353, 12611, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2551, 29898, 1311, 1125, 13, 4706, 9995, 29954, 1691, 278, 2551, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 450, 3988, 393, 278, 1804, 261, 338, 6684, 287, 304, 1156, 263, 9150, 26188, 29889, 529, 9653, 3114, 14672, 2780, 29901, 2654, 10436, 1013, 19347, 565, 366, 671, 6684, 363, 278, 1804, 261, 21106, 9653, 29958, 13, 13, 4706, 584, 2457, 29901, 450, 2551, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 8698, 13, 13, 1678, 732, 8698, 29889, 842, 357, 13, 1678, 822, 2551, 29898, 1311, 29892, 2551, 1125, 13, 4706, 9995, 29903, 1691, 278, 2551, 310, 445, 4367, 1088, 9585, 29889, 13, 13, 4706, 450, 3988, 393, 278, 1804, 261, 338, 6684, 287, 304, 1156, 263, 9150, 26188, 29889, 529, 9653, 3114, 14672, 2780, 29901, 2654, 10436, 1013, 19347, 565, 366, 671, 6684, 363, 278, 1804, 261, 21106, 9653, 29958, 13, 13, 4706, 584, 3207, 2551, 29901, 450, 2551, 310, 445, 4367, 1088, 9585, 29889, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 13, 4706, 1583, 3032, 8698, 353, 2551, 13, 13, 1678, 822, 304, 29918, 8977, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 1904, 4426, 408, 263, 9657, 15945, 29908, 13, 4706, 1121, 353, 6571, 13, 13, 4706, 363, 12421, 29892, 903, 297, 1583, 29889, 2774, 9921, 29918, 8768, 29889, 7076, 7295, 13, 9651, 995, 353, 679, 5552, 29898, 1311, 29892, 12421, 29897, 13, 9651, 565, 338, 8758, 29898, 1767, 29892, 1051, 1125, 13, 18884, 1121, 29961, 5552, 29962, 353, 1051, 29898, 1958, 29898, 13, 462, 1678, 14013, 921, 29901, 921, 29889, 517, 29918, 8977, 580, 565, 756, 5552, 29898, 29916, 29892, 376, 517, 29918, 8977, 1159, 1683, 921, 29892, 13, 462, 1678, 995, 13, 462, 876, 13, 9651, 25342, 756, 5552, 29898, 1767, 29892, 376, 517, 29918, 8977, 29908, 1125, 13, 18884, 1121, 29961, 5552, 29962, 353, 995, 29889, 517, 29918, 8977, 580, 13, 9651, 25342, 338, 8758, 29898, 1767, 29892, 9657, 1125, 13, 18884, 1121, 29961, 5552, 29962, 353, 9657, 29898, 1958, 29898, 13, 462, 1678, 14013, 2944, 29901, 313, 667, 29961, 29900, 1402, 2944, 29961, 29896, 1822, 517, 29918, 8977, 3101, 13, 462, 1678, 565, 756, 5552, 29898, 667, 29961, 29896, 1402, 376, 517, 29918, 8977, 1159, 1683, 2944, 29892, 13, 462, 1678, 995, 29889, 7076, 580, 13, 462, 876, 13, 9651, 1683, 29901, 13, 18884, 1121, 29961, 5552, 29962, 353, 995, 13, 13, 4706, 736, 1121, 13, 13, 1678, 822, 304, 29918, 710, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 1347, 8954, 310, 278, 1904, 15945, 29908, 13, 4706, 736, 282, 2158, 29889, 29886, 4830, 29898, 1311, 29889, 517, 29918, 8977, 3101, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 9995, 2831, 421, 2158, 29952, 322, 421, 407, 29878, 524, 29952, 15945, 29908, 13, 4706, 736, 1583, 29889, 517, 29918, 710, 580, 13, 13, 1678, 822, 4770, 1837, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 11609, 29879, 1565, 565, 1716, 3618, 526, 5186, 15945, 29908, 13, 4706, 565, 451, 338, 8758, 29898, 1228, 29892, 4367, 1088, 9585, 1125, 13, 9651, 736, 7700, 13, 13, 4706, 736, 1583, 17255, 8977, 1649, 1275, 916, 17255, 8977, 1649, 13, 13, 1678, 822, 4770, 484, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 11609, 29879, 1565, 565, 1716, 3618, 526, 451, 5186, 15945, 29908, 13, 4706, 736, 451, 1583, 1275, 916, 13, 2 ]
tests/test_statebus.py
invisible-college/tightrope
1
29656
// Test calls to statebus server var bus = require('statebus/server')(); bus.ws_client("/*", "ws://aws.local-box.org:45678"); x = bus.fetch("/paul/code"); console.log(JSON.stringify(x)); if (!x.written) { console.log("No member .written found, setting it now"); x.written = "here it is"; } save(x);
[ 1, 849, 4321, 5717, 304, 2106, 8262, 1923, 13, 1707, 3593, 353, 1996, 877, 3859, 8262, 29914, 2974, 1495, 890, 13, 8262, 29889, 5652, 29918, 4645, 703, 5515, 613, 376, 5652, 597, 10467, 29889, 2997, 29899, 1884, 29889, 990, 29901, 29946, 29945, 29953, 29955, 29947, 1496, 13, 29916, 353, 3593, 29889, 9155, 11974, 3274, 352, 29914, 401, 1496, 13, 11058, 29889, 1188, 29898, 7249, 29889, 22070, 29898, 29916, 2483, 13, 361, 5384, 29916, 29889, 17625, 29897, 426, 13, 29871, 2991, 29889, 1188, 703, 3782, 4509, 869, 17625, 1476, 29892, 4444, 372, 1286, 1496, 13, 29871, 921, 29889, 17625, 353, 376, 4150, 372, 338, 1769, 13, 29913, 13, 7620, 29898, 29916, 416, 13, 13, 2 ]
Project/app/views.py
geminateCoder/Character-Archive-Website
0
80943
from flask import render_template, flash, redirect, session, url_for, request, g from flask.ext.login import login_user, logout_user, current_user, login_required from app import app, db, lm, oid from .forms import LoginForm, EditForm, RegisterForm, CreateC from .models import User, UserSettings, Character from datetime import datetime def remove_html_tags(text): """Remove html tags from a string""" import re clean = re.compile('<.*?>') return re.sub(clean, '', text) @lm.user_loader def load_user(id): return User.query.get(int(id)) @app.before_request def before_request(): g.user = current_user if g.user.is_authenticated: g.user.last_login_at = datetime.utcnow() db.session.add(g.user) db.session.commit() @app.route("/") def index(): return render_template("index.html") @app.route("/login", methods=['GET','POST']) @oid.loginhandler def login(): error=None if g.user is not None and g.user.is_authenticated: return redirect(url_for('index')) form = LoginForm(request.form) if request.method == 'POST': if form.validate_on_submit(): user = User.query.filter_by(username=request.form['username'].lower()).first() if user is not None and user.password == request.form['password']: session['remember_me'] = form.remember_me.data user.login_count = user.login_count +1 user.current_login_at = datetime.now() user.current_login_ip = request.remote_addr db.session.commit() login_user(user) return redirect(url_for('index')) else: error = 'Invalid username or password.' return render_template('login.html', form=form, error=error) @app.route('/register', methods=['GET', 'POST']) # pragma: no cover def register(): pageType='register' form = RegisterForm(request.form) if form.validate_on_submit(): user = User( username=remove_html_tags(form.username.data).lower(), email=remove_html_tags(form.email.data).lower(), password=form.password.data ) db.session.add(user) user.follow.append(user) user.settings.append(UserSettings(displayname=form.username.data)) user.login_count = 1 user.current_login_at = datetime.now() user.current_login_ip = request.remote_addr db.session.commit() login_user(user) return redirect(url_for('index')) return render_template('register.html', form=form, page=pageType) @app.route('/logout') def logout(): user = current_user user.last_login_at = datetime.now() user.last_login_ip = request.remote_addr db.session.commit() logout_user() return redirect(url_for('index')) @app.route("/create", methods=['GET','POST']) @login_required def create(): return render_template("Create.html") @app.route("/create/original", methods=['GET','POST']) @login_required def original(): pageType='original' form = CreateC() character ='None' if form.validate_on_submit(): character = Character( username=current_user.username, firstname=remove_html_tags(form.firstname.data), lastname=remove_html_tags(form.lastname.data), img=form.img.data, created=datetime.now() ) db.session.add(character) db.session.commit() return redirect(url_for('create')) return render_template("CreateForms.html", page=pageType, form=form, character=character) @app.route("/create/fandom", methods=['GET','POST']) @login_required def fandom(): pageType='fandom' return render_template("CreateForms.html", page=pageType) @app.route("/create/original_fandom", methods=['GET','POST']) @login_required def originalFandom(): pageType='ofandom' return render_template("CreateForms.html", page=pageType) @app.route("/create/d&d", methods=['GET','POST']) @login_required def DnD(): pageType='ofandom' return render_template("CreateForms.html", page=pageType)
[ 1, 515, 29784, 1053, 4050, 29918, 6886, 29892, 11013, 29892, 6684, 29892, 4867, 29892, 3142, 29918, 1454, 29892, 2009, 29892, 330, 13, 3166, 29784, 29889, 1062, 29889, 7507, 1053, 6464, 29918, 1792, 29892, 1480, 449, 29918, 1792, 29892, 1857, 29918, 1792, 29892, 6464, 29918, 12403, 13, 3166, 623, 1053, 623, 29892, 4833, 29892, 301, 29885, 29892, 288, 333, 13, 3166, 869, 9514, 1053, 19130, 2500, 29892, 7641, 2500, 29892, 12577, 2500, 29892, 6204, 29907, 13, 3166, 869, 9794, 1053, 4911, 29892, 4911, 9585, 29892, 26804, 13, 3166, 12865, 1053, 12865, 13, 13, 1753, 3349, 29918, 1420, 29918, 11338, 29898, 726, 1125, 13, 1678, 9995, 15941, 3472, 8282, 515, 263, 1347, 15945, 29908, 13, 1678, 1053, 337, 13, 1678, 5941, 353, 337, 29889, 12198, 877, 29966, 5575, 17382, 1495, 13, 1678, 736, 337, 29889, 1491, 29898, 14941, 29892, 15516, 1426, 29897, 13, 13, 29992, 21457, 29889, 1792, 29918, 12657, 13, 1753, 2254, 29918, 1792, 29898, 333, 1125, 13, 1678, 736, 4911, 29889, 1972, 29889, 657, 29898, 524, 29898, 333, 876, 13, 13, 29992, 932, 29889, 11083, 29918, 3827, 13, 1753, 1434, 29918, 3827, 7295, 13, 1678, 330, 29889, 1792, 353, 1857, 29918, 1792, 13, 1678, 565, 330, 29889, 1792, 29889, 275, 29918, 27218, 630, 29901, 13, 4706, 330, 29889, 1792, 29889, 4230, 29918, 7507, 29918, 271, 353, 12865, 29889, 329, 29883, 3707, 580, 13, 4706, 4833, 29889, 7924, 29889, 1202, 29898, 29887, 29889, 1792, 29897, 13, 4706, 4833, 29889, 7924, 29889, 15060, 580, 13, 13, 29992, 932, 29889, 13134, 11974, 1159, 13, 1753, 2380, 7295, 13, 1678, 736, 4050, 29918, 6886, 703, 2248, 29889, 1420, 1159, 13, 13, 13, 13, 29992, 932, 29889, 13134, 11974, 7507, 613, 3519, 29922, 1839, 7194, 3788, 5438, 11287, 13, 29992, 3398, 29889, 7507, 13789, 13, 1753, 6464, 7295, 13, 1678, 1059, 29922, 8516, 13, 1678, 565, 330, 29889, 1792, 338, 451, 6213, 322, 330, 29889, 1792, 29889, 275, 29918, 27218, 630, 29901, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 2248, 8785, 13, 1678, 883, 353, 19130, 2500, 29898, 3827, 29889, 689, 29897, 13, 1678, 565, 2009, 29889, 5696, 1275, 525, 5438, 2396, 13, 4706, 565, 883, 29889, 15480, 29918, 265, 29918, 7892, 7295, 13, 9651, 1404, 353, 4911, 29889, 1972, 29889, 4572, 29918, 1609, 29898, 6786, 29922, 3827, 29889, 689, 1839, 6786, 13359, 13609, 16655, 4102, 580, 13, 9651, 565, 1404, 338, 451, 6213, 322, 1404, 29889, 5630, 1275, 2009, 29889, 689, 1839, 5630, 2033, 29901, 13, 18884, 4867, 1839, 1745, 1096, 29918, 1004, 2033, 353, 883, 29889, 1745, 1096, 29918, 1004, 29889, 1272, 13, 18884, 1404, 29889, 7507, 29918, 2798, 353, 1404, 29889, 7507, 29918, 2798, 718, 29896, 13, 18884, 1404, 29889, 3784, 29918, 7507, 29918, 271, 353, 12865, 29889, 3707, 580, 13, 18884, 1404, 29889, 3784, 29918, 7507, 29918, 666, 353, 2009, 29889, 16674, 29918, 10030, 13, 18884, 4833, 29889, 7924, 29889, 15060, 580, 13, 18884, 6464, 29918, 1792, 29898, 1792, 29897, 13, 18884, 736, 6684, 29898, 2271, 29918, 1454, 877, 2248, 8785, 13, 9651, 1683, 29901, 13, 18884, 1059, 353, 525, 13919, 8952, 470, 4800, 6169, 13, 1678, 736, 4050, 29918, 6886, 877, 7507, 29889, 1420, 742, 883, 29922, 689, 29892, 1059, 29922, 2704, 29897, 13, 13, 29992, 932, 29889, 13134, 11219, 9573, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 11287, 259, 396, 282, 23929, 29901, 694, 4612, 13, 1753, 6036, 7295, 13, 1678, 1813, 1542, 2433, 9573, 29915, 13, 1678, 883, 353, 12577, 2500, 29898, 3827, 29889, 689, 29897, 13, 1678, 565, 883, 29889, 15480, 29918, 265, 29918, 7892, 7295, 13, 4706, 1404, 353, 4911, 29898, 13, 9651, 8952, 29922, 5992, 29918, 1420, 29918, 11338, 29898, 689, 29889, 6786, 29889, 1272, 467, 13609, 3285, 13, 9651, 4876, 29922, 5992, 29918, 1420, 29918, 11338, 29898, 689, 29889, 5269, 29889, 1272, 467, 13609, 3285, 13, 9651, 4800, 29922, 689, 29889, 5630, 29889, 1272, 13, 13, 4706, 1723, 13, 4706, 4833, 29889, 7924, 29889, 1202, 29898, 1792, 29897, 13, 4706, 1404, 29889, 23031, 29889, 4397, 29898, 1792, 29897, 13, 4706, 1404, 29889, 11027, 29889, 4397, 29898, 2659, 9585, 29898, 4990, 978, 29922, 689, 29889, 6786, 29889, 1272, 876, 13, 4706, 1404, 29889, 7507, 29918, 2798, 353, 29871, 29896, 13, 4706, 1404, 29889, 3784, 29918, 7507, 29918, 271, 353, 12865, 29889, 3707, 580, 13, 4706, 1404, 29889, 3784, 29918, 7507, 29918, 666, 353, 2009, 29889, 16674, 29918, 10030, 13, 4706, 4833, 29889, 7924, 29889, 15060, 580, 13, 4706, 6464, 29918, 1792, 29898, 1792, 29897, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 2248, 8785, 13, 1678, 736, 4050, 29918, 6886, 877, 9573, 29889, 1420, 742, 883, 29922, 689, 29892, 1813, 29922, 3488, 1542, 29897, 13, 13, 29992, 932, 29889, 13134, 11219, 1188, 449, 1495, 13, 1753, 1480, 449, 7295, 13, 1678, 1404, 353, 1857, 29918, 1792, 13, 1678, 1404, 29889, 4230, 29918, 7507, 29918, 271, 353, 12865, 29889, 3707, 580, 13, 1678, 1404, 29889, 4230, 29918, 7507, 29918, 666, 353, 2009, 29889, 16674, 29918, 10030, 13, 1678, 4833, 29889, 7924, 29889, 15060, 580, 13, 1678, 1480, 449, 29918, 1792, 580, 13, 1678, 736, 6684, 29898, 2271, 29918, 1454, 877, 2248, 8785, 13, 13, 13, 29992, 932, 29889, 13134, 11974, 3258, 613, 3519, 29922, 1839, 7194, 3788, 5438, 11287, 13, 29992, 7507, 29918, 12403, 13, 1753, 1653, 7295, 13, 1678, 736, 4050, 29918, 6886, 703, 4391, 29889, 1420, 1159, 13, 13, 13, 13, 13, 29992, 932, 29889, 13134, 11974, 3258, 29914, 13492, 613, 3519, 29922, 1839, 7194, 3788, 5438, 11287, 13, 29992, 7507, 29918, 12403, 13, 1753, 2441, 7295, 13, 1678, 1813, 1542, 2433, 13492, 29915, 13, 1678, 883, 353, 6204, 29907, 580, 13, 1678, 2931, 353, 29915, 8516, 29915, 13, 1678, 565, 883, 29889, 15480, 29918, 265, 29918, 7892, 7295, 13, 4706, 2931, 353, 26804, 29898, 13, 9651, 8952, 29922, 3784, 29918, 1792, 29889, 6786, 29892, 13, 9651, 937, 978, 29922, 5992, 29918, 1420, 29918, 11338, 29898, 689, 29889, 4102, 978, 29889, 1272, 511, 13, 9651, 1833, 978, 29922, 5992, 29918, 1420, 29918, 11338, 29898, 689, 29889, 4230, 978, 29889, 1272, 511, 13, 9651, 10153, 29922, 689, 29889, 2492, 29889, 1272, 29892, 13, 9651, 2825, 29922, 12673, 29889, 3707, 580, 13, 4706, 1723, 13, 4706, 4833, 29889, 7924, 29889, 1202, 29898, 18609, 29897, 13, 4706, 4833, 29889, 7924, 29889, 15060, 580, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 3258, 8785, 13, 1678, 736, 4050, 29918, 6886, 703, 4391, 12605, 29889, 1420, 613, 1813, 29922, 3488, 1542, 29892, 883, 29922, 689, 29892, 2931, 29922, 18609, 29897, 13, 13, 29992, 932, 29889, 13134, 11974, 3258, 29914, 29888, 2685, 613, 3519, 29922, 1839, 7194, 3788, 5438, 11287, 13, 29992, 7507, 29918, 12403, 13, 1753, 285, 2685, 7295, 13, 1678, 1813, 1542, 2433, 29888, 2685, 29915, 13, 1678, 736, 4050, 29918, 6886, 703, 4391, 12605, 29889, 1420, 613, 1813, 29922, 3488, 1542, 29897, 13, 13, 29992, 932, 29889, 13134, 11974, 3258, 29914, 13492, 29918, 29888, 2685, 613, 3519, 29922, 1839, 7194, 3788, 5438, 11287, 13, 29992, 7507, 29918, 12403, 13, 1753, 2441, 29943, 2685, 7295, 13, 1678, 1813, 1542, 2433, 974, 2685, 29915, 13, 1678, 736, 4050, 29918, 6886, 703, 4391, 12605, 29889, 1420, 613, 1813, 29922, 3488, 1542, 29897, 13, 13, 29992, 932, 29889, 13134, 11974, 3258, 29914, 29881, 29987, 29881, 613, 3519, 29922, 1839, 7194, 3788, 5438, 11287, 13, 29992, 7507, 29918, 12403, 13, 1753, 360, 29876, 29928, 7295, 13, 1678, 1813, 1542, 2433, 974, 2685, 29915, 13, 1678, 736, 4050, 29918, 6886, 703, 4391, 12605, 29889, 1420, 613, 1813, 29922, 3488, 1542, 29897, 2 ]
pywaterkotte/test_ecotouch.py
chboland/pywaterkotte
3
64013
from pywaterkotte.ecotouch import (Ecotouch, EcotouchTag, InvalidResponseException, StatusException) import responses import pytest from datetime import datetime HOSTNAME = 'hostname' @pytest.fixture def wp_instance(): return Ecotouch(HOSTNAME) # Helper functions def prepare_response(action, body): responses.add( responses.GET, 'http://%s/cgi/%s' % (HOSTNAME, action), body=body) @responses.activate def test_login_invalid_response(wp_instance): prepare_response('login', 'invalid') with pytest.raises(InvalidResponseException) as e_info: wp_instance.login() @responses.activate def test_login_relogin(wp_instance): prepare_response('login', '#E_RE-LOGIN_ATTEMPT') with pytest.raises(StatusException) as e_info: wp_instance.login() @responses.activate def test_login_success(wp_instance): prepare_response('login', '1\n#S_OK\nIDALToken=<PASSWORD>') wp_instance.login() @responses.activate def test_read_tag(wp_instance): prepare_response('readTags', '#A1\tS_OK\n192\t86\n') assert wp_instance.read_value(EcotouchTag.TEMPERATURE_OUTSIDE) == 8.6 @responses.activate def test_read_bitfield(wp_instance): prepare_response('readTags', '#I51\tS_OK\n192\t170\n') assert wp_instance.read_value(EcotouchTag.STATE_COMPRESSOR) == True assert wp_instance.read_value(EcotouchTag.STATE_SOURCEPUMP) == False assert wp_instance.read_value(EcotouchTag.STATE_EXTERNAL_HEATER) == True assert wp_instance.read_value(EcotouchTag.STATE_HEATINGPUMP) == True @responses.activate def test_write(wp_instance): prepare_response('writeTags', '#I263\tS_OK\n192\t5\n') wp_instance.write_value(EcotouchTag.ADAPT_HEATING, 6) assert len(responses.calls) == 1 @responses.activate def test_write_date(wp_instance): prepare_response('writeTags', '#I263\tS_OK\n192\t5\n') wp_instance.write_value(EcotouchTag.HOLIDAY_START_TIME, datetime(2019, 3,2,11,00)) assert len(responses.calls) == 5 @responses.activate def test_read_date(wp_instance): RESPONSE = "".join([ '#I1250\tS_OK\n192\t18\n', '#I1251\tS_OK\n192\t2\n', '#I1252\tS_OK\n192\t1\n', '#I1253\tS_OK\n192\t3\n', '#I1254\tS_OK\n192\t19\n']) prepare_response('readTags', RESPONSE) result = wp_instance.read_value(EcotouchTag.HOLIDAY_START_TIME) assert isinstance(result, datetime) assert datetime(2019,3,1,18,2) == result @responses.activate def test_read_multiple_tags(wp_instance): RESPONSE = "".join([ '#A1\tS_OK\n192\t84\n', '#A2\tS_OK\n192\t87\n', '#A3\tS_OK\n192\t92\n', '#A4\tS_OK\n192\t95\n', '#A5\tS_OK\n192\t57\n']) prepare_response('readTags', RESPONSE) result = wp_instance.read_values([ EcotouchTag.TEMPERATURE_OUTSIDE, EcotouchTag.TEMPERATURE_OUTSIDE_1H, EcotouchTag.TEMPERATURE_OUTSIDE_24H, EcotouchTag.TEMPERATURE_SOURCE_IN, EcotouchTag.TEMPERATURE_SOURCE_OUT]) assert result is not None assert isinstance(result, dict) assert result[EcotouchTag.TEMPERATURE_OUTSIDE] == 8.4 assert result[EcotouchTag.TEMPERATURE_OUTSIDE_1H] == 8.7 assert result[EcotouchTag.TEMPERATURE_OUTSIDE_24H] == 9.2 assert result[EcotouchTag.TEMPERATURE_SOURCE_IN] == 9.5 assert result[EcotouchTag.TEMPERATURE_SOURCE_OUT] == 5.7
[ 1, 515, 282, 5693, 1008, 29895, 14360, 29889, 687, 327, 3222, 1053, 313, 29923, 26235, 3222, 29892, 382, 26235, 3222, 8176, 29892, 21403, 5103, 2451, 29892, 16034, 2451, 29897, 13, 5215, 20890, 13, 5215, 11451, 1688, 13, 3166, 12865, 1053, 12865, 13, 13, 20832, 5813, 353, 525, 28988, 29915, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 19247, 29918, 8758, 7295, 13, 1678, 736, 382, 26235, 3222, 29898, 20832, 5813, 29897, 13, 13, 13, 29937, 6162, 546, 3168, 13, 1753, 19012, 29918, 5327, 29898, 2467, 29892, 3573, 1125, 13, 1678, 20890, 29889, 1202, 29898, 13, 9651, 20890, 29889, 7194, 29892, 29871, 13, 9651, 525, 1124, 597, 29995, 29879, 29914, 20006, 22584, 29879, 29915, 1273, 313, 20832, 5813, 29892, 3158, 511, 29871, 13, 9651, 3573, 29922, 2587, 29897, 13, 13, 13, 29992, 26679, 267, 29889, 11236, 403, 13, 1753, 1243, 29918, 7507, 29918, 20965, 29918, 5327, 29898, 11912, 29918, 8758, 1125, 13, 1678, 19012, 29918, 5327, 877, 7507, 742, 525, 20965, 1495, 13, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 13919, 5103, 2451, 29897, 408, 321, 29918, 3888, 29901, 13, 4706, 19247, 29918, 8758, 29889, 7507, 580, 13, 13, 29992, 26679, 267, 29889, 11236, 403, 13, 1753, 1243, 29918, 7507, 29918, 276, 7507, 29898, 11912, 29918, 8758, 1125, 13, 1678, 19012, 29918, 5327, 877, 7507, 742, 16321, 29923, 29918, 1525, 29899, 14480, 1177, 29918, 1299, 4330, 3580, 29911, 1495, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 5709, 2451, 29897, 408, 321, 29918, 3888, 29901, 13, 4706, 19247, 29918, 8758, 29889, 7507, 580, 13, 13, 29992, 26679, 267, 29889, 11236, 403, 13, 1753, 1243, 29918, 7507, 29918, 8698, 29898, 11912, 29918, 8758, 1125, 13, 1678, 19012, 29918, 5327, 877, 7507, 742, 525, 29896, 29905, 29876, 29937, 29903, 29918, 8949, 29905, 29876, 1367, 1964, 6066, 29922, 29966, 25711, 17013, 29958, 1495, 13, 1678, 19247, 29918, 8758, 29889, 7507, 580, 13, 268, 13, 29992, 26679, 267, 29889, 11236, 403, 13, 1753, 1243, 29918, 949, 29918, 4039, 29898, 11912, 29918, 8758, 1125, 13, 1678, 19012, 29918, 5327, 877, 949, 28089, 742, 16321, 29909, 29896, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29947, 29953, 29905, 29876, 1495, 13, 1678, 4974, 19247, 29918, 8758, 29889, 949, 29918, 1767, 29898, 29923, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 12015, 29903, 22027, 29897, 1275, 29871, 29947, 29889, 29953, 13, 13, 29992, 26679, 267, 29889, 11236, 403, 13, 1753, 1243, 29918, 949, 29918, 2966, 2671, 29898, 11912, 29918, 8758, 1125, 13, 1678, 19012, 29918, 5327, 877, 949, 28089, 742, 16321, 29902, 29945, 29896, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29896, 29955, 29900, 29905, 29876, 1495, 13, 1678, 4974, 19247, 29918, 8758, 29889, 949, 29918, 1767, 29898, 29923, 26235, 3222, 8176, 29889, 19713, 29918, 21514, 26785, 1955, 29897, 1275, 5852, 13, 1678, 4974, 19247, 29918, 8758, 29889, 949, 29918, 1767, 29898, 29923, 26235, 3222, 8176, 29889, 19713, 29918, 27839, 4741, 7056, 3580, 29897, 1275, 7700, 13, 1678, 4974, 19247, 29918, 8758, 29889, 949, 29918, 1767, 29898, 29923, 26235, 3222, 8176, 29889, 19713, 29918, 5746, 4945, 29940, 1964, 29918, 9606, 1299, 1001, 29897, 1275, 5852, 13, 1678, 4974, 19247, 29918, 8758, 29889, 949, 29918, 1767, 29898, 29923, 26235, 3222, 8176, 29889, 19713, 29918, 9606, 1299, 4214, 7056, 3580, 29897, 1275, 5852, 13, 13, 29992, 26679, 267, 29889, 11236, 403, 13, 1753, 1243, 29918, 3539, 29898, 11912, 29918, 8758, 1125, 13, 1678, 19012, 29918, 5327, 877, 3539, 28089, 742, 16321, 29902, 29906, 29953, 29941, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29945, 29905, 29876, 1495, 13, 1678, 19247, 29918, 8758, 29889, 3539, 29918, 1767, 29898, 29923, 26235, 3222, 8176, 29889, 3035, 3301, 29911, 29918, 9606, 1299, 4214, 29892, 29871, 29953, 29897, 13, 1678, 4974, 7431, 29898, 26679, 267, 29889, 29883, 4293, 29897, 1275, 29871, 29896, 13, 13, 29992, 26679, 267, 29889, 11236, 403, 13, 1753, 1243, 29918, 3539, 29918, 1256, 29898, 11912, 29918, 8758, 1125, 13, 1678, 19012, 29918, 5327, 877, 3539, 28089, 742, 16321, 29902, 29906, 29953, 29941, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29945, 29905, 29876, 1495, 13, 1678, 19247, 29918, 8758, 29889, 3539, 29918, 1767, 29898, 29923, 26235, 3222, 8176, 29889, 29950, 5607, 1367, 29909, 29979, 29918, 25826, 29918, 15307, 29892, 12865, 29898, 29906, 29900, 29896, 29929, 29892, 29871, 29941, 29892, 29906, 29892, 29896, 29896, 29892, 29900, 29900, 876, 13, 1678, 4974, 7431, 29898, 26679, 267, 29889, 29883, 4293, 29897, 1275, 29871, 29945, 13, 13, 29992, 26679, 267, 29889, 11236, 403, 13, 1753, 1243, 29918, 949, 29918, 1256, 29898, 11912, 29918, 8758, 1125, 13, 1678, 390, 2890, 29925, 1164, 1660, 353, 376, 1642, 7122, 4197, 13, 1678, 16321, 29902, 29896, 29906, 29945, 29900, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29896, 29947, 29905, 29876, 742, 13, 1678, 16321, 29902, 29896, 29906, 29945, 29896, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29906, 29905, 29876, 742, 13, 1678, 16321, 29902, 29896, 29906, 29945, 29906, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29896, 29905, 29876, 742, 13, 1678, 16321, 29902, 29896, 29906, 29945, 29941, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29941, 29905, 29876, 742, 13, 1678, 16321, 29902, 29896, 29906, 29945, 29946, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29896, 29929, 29905, 29876, 11287, 13, 1678, 19012, 29918, 5327, 877, 949, 28089, 742, 390, 2890, 29925, 1164, 1660, 29897, 13, 1678, 1121, 353, 19247, 29918, 8758, 29889, 949, 29918, 1767, 29898, 29923, 26235, 3222, 8176, 29889, 29950, 5607, 1367, 29909, 29979, 29918, 25826, 29918, 15307, 29897, 13, 1678, 4974, 338, 8758, 29898, 2914, 29892, 12865, 29897, 13, 1678, 4974, 12865, 29898, 29906, 29900, 29896, 29929, 29892, 29941, 29892, 29896, 29892, 29896, 29947, 29892, 29906, 29897, 1275, 1121, 13, 13, 13, 29992, 26679, 267, 29889, 11236, 403, 13, 1753, 1243, 29918, 949, 29918, 20787, 29918, 11338, 29898, 11912, 29918, 8758, 1125, 13, 1678, 390, 2890, 29925, 1164, 1660, 353, 376, 1642, 7122, 4197, 13, 1678, 16321, 29909, 29896, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29947, 29946, 29905, 29876, 742, 13, 1678, 16321, 29909, 29906, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29947, 29955, 29905, 29876, 742, 13, 1678, 16321, 29909, 29941, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29929, 29906, 29905, 29876, 742, 13, 1678, 16321, 29909, 29946, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29929, 29945, 29905, 29876, 742, 13, 1678, 16321, 29909, 29945, 29905, 29873, 29903, 29918, 8949, 29905, 29876, 29896, 29929, 29906, 29905, 29873, 29945, 29955, 29905, 29876, 11287, 13, 1678, 19012, 29918, 5327, 877, 949, 28089, 742, 390, 2890, 29925, 1164, 1660, 29897, 13, 1678, 1121, 353, 19247, 29918, 8758, 29889, 949, 29918, 5975, 4197, 13, 4706, 382, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 12015, 29903, 22027, 29892, 13, 4706, 382, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 12015, 29903, 22027, 29918, 29896, 29950, 29892, 13, 4706, 382, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 12015, 29903, 22027, 29918, 29906, 29946, 29950, 29892, 13, 4706, 382, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 27839, 4741, 29918, 1177, 29892, 13, 4706, 382, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 27839, 4741, 29918, 12015, 2314, 13, 13, 1678, 4974, 1121, 338, 451, 6213, 13, 1678, 4974, 338, 8758, 29898, 2914, 29892, 9657, 29897, 13, 1678, 4974, 1121, 29961, 29923, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 12015, 29903, 22027, 29962, 1275, 29871, 29947, 29889, 29946, 13, 1678, 4974, 1121, 29961, 29923, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 12015, 29903, 22027, 29918, 29896, 29950, 29962, 1275, 29871, 29947, 29889, 29955, 13, 1678, 4974, 1121, 29961, 29923, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 12015, 29903, 22027, 29918, 29906, 29946, 29950, 29962, 1275, 29871, 29929, 29889, 29906, 13, 1678, 4974, 1121, 29961, 29923, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 27839, 4741, 29918, 1177, 29962, 1275, 29871, 29929, 29889, 29945, 13, 1678, 4974, 1121, 29961, 29923, 26235, 3222, 8176, 29889, 4330, 3580, 1001, 1299, 11499, 29918, 27839, 4741, 29918, 12015, 29962, 1275, 29871, 29945, 29889, 29955, 13, 13, 2 ]
pycdb/__init__.py
moriyoshi/wozozo-cdb
1
135807
from ._pycdb import CDB, CDBMake
[ 1, 515, 869, 29918, 2272, 2252, 29890, 1053, 315, 4051, 29892, 315, 4051, 9984, 13, 13, 2 ]
test/fisheries_test_io.py
phargogh/invest-natcap.invest-3
0
40061
<reponame>phargogh/invest-natcap.invest-3 import unittest import os import pprint from numpy import testing import numpy as np import invest_natcap.fisheries.fisheries_io as fisheries_io from invest_natcap.fisheries.fisheries_io import MissingParameter data_directory = './invest-data/test/data/fisheries' pp = pprint.PrettyPrinter(indent=4) All_Parameters = ['Classes', 'Duration', 'Exploitationfraction', 'Fecundity', 'Larvaldispersal', 'Maturity', 'Regions', 'Survnaturalfrac', 'Weight', 'Vulnfishing'] Necessary_Params = ['Classes', 'Exploitationfraction', 'Maturity', 'Regions', 'Survnaturalfrac', 'Vulnfishing'] class TestPopulationParamsIO(unittest.TestCase): def test_parse_popu_params_blue_crab(self): uri = os.path.join(data_directory, 'CSVs/New_Params.csv') sexsp = 1 pop_dict = fisheries_io._parse_population_csv(uri, sexsp) # Check that keys are correct Matching_Keys = [i for i in pop_dict.keys() if i in Necessary_Params] self.assertEqual(len(Matching_Keys), len(Necessary_Params)) # Check that sexsp handled correctly self.assertEqual(len(pop_dict['Survnaturalfrac'][0]), sexsp) # Check that Class attribute lengths match self.assertEqual( len(pop_dict['Vulnfishing']), len(pop_dict['Maturity'])) # Print Dictionary if debugging #pp.pprint(pop_dict) def test_parse_popu_params_sn(self): uri = os.path.join(data_directory, 'CSVs/TestCSV_SN_Syntax.csv') sexsp = 1 pop_dict = fisheries_io._parse_population_csv(uri, sexsp) # Check that keys are correct Matching_Keys = [i for i in pop_dict.keys() if i in All_Parameters] self.assertEqual(len(Matching_Keys), len(All_Parameters)) # Check that sexsp handled correctly self.assertEqual(len(pop_dict['Survnaturalfrac'][0]), sexsp) # Check that Class attribute lengths match self.assertEqual( len(pop_dict['Vulnfishing']), len(pop_dict['Maturity'])) # Print Dictionary if debugging #pp.pprint(pop_dict) def test_parse_popu_params_ss(self): uri = os.path.join(data_directory, 'CSVs/TestCSV_SS_Syntax.csv') sexsp = 2 pop_dict = fisheries_io._parse_population_csv(uri, sexsp) # Check that keys are correct Matching_Params = [i for i in pop_dict.keys() if i in All_Parameters] self.assertEqual(len(Matching_Params), len(All_Parameters)) # Check that sexsp handled correctly self.assertEqual(len(pop_dict['Survnaturalfrac'][0]), sexsp) # Check that Class attribute lengths match self.assertEqual( len(pop_dict['Vulnfishing']), len(pop_dict['Maturity'])) # Print Dictionary if debugging #pp.pprint(pop_dict) def test_read_popu_params(self): # Check that throws error when necessary information does not exist # Test with not all necessary params population_csv_uri = os.path.join(data_directory, 'CSVs/Fail/TestCSV_SN_Syntax_fail1.csv') args = {'population_csv_uri': population_csv_uri, 'sexsp': 1} with self.assertRaises(MissingParameter): fisheries_io.read_population_csv(args, population_csv_uri) # Test Stage-based without Duration vector population_csv_uri = os.path.join(data_directory, 'CSVs/Fail/TestCSV_SN_Syntax_fail2.csv') args['population_csv_uri'] = population_csv_uri args['recruitment_type'] = 'Beverton-Holt' args['population_type'] = 'Stage-Based' with self.assertRaises(MissingParameter): fisheries_io.read_population_csv(args, population_csv_uri) # Test B-H / Weight without Weight vector population_csv_uri = os.path.join(data_directory, 'CSVs/Fail/TestCSV_SN_Syntax_fail3.csv') args['population_csv_uri'] = population_csv_uri args['spawn_units'] = 'Weight' with self.assertRaises(MissingParameter): fisheries_io.read_population_csv(args, population_csv_uri) # Test Fecundity without Fecundity vector population_csv_uri = os.path.join(data_directory, 'CSVs/Fail/TestCSV_SN_Syntax_fail3.csv') args['population_csv_uri'] = population_csv_uri args['recruitment_type'] = 'Fecundity' args['harvest_units'] = 'Weight' with self.assertRaises(MissingParameter): fisheries_io.read_population_csv(args, population_csv_uri) ''' # Check that throws error when incorrect information exists population_csv_uri = os.path.join(data_directory, 'CSVs/Fail/TestCSV_SN_Semantics_fail1.csv') args = {'population_csv_uri': population_csv_uri, 'sexsp': 1} self.assertRaises( MissingParameter, fisheries_io.read_population_csv(args)) population_csv_uri = os.path.join(data_directory, 'CSVs/Fail/TestCSV_SN_Semantics_fail2.csv') args = {'population_csv_uri': population_csv_uri, 'sexsp': 1} self.assertRaises( MissingParameter, fisheries_io.read_population_csv(args)) population_csv_uri = os.path.join(data_directory, 'CSVs/Fail/TestCSV_SN_Semantics_fail3.csv') args = {'population_csv_uri': population_csv_uri, 'sexsp': 1} self.assertRaises( MissingParameter, fisheries_io.read_population_csv(args)) ''' class TestMigrationIO(unittest.TestCase): def test_parse_migration(self): uri = os.path.join(data_directory, 'migration/') args = { 'migr_cont': True, 'migration_dir': uri } class_list = ['larva', 'adult'] mig_dict = fisheries_io._parse_migration_tables(args, class_list) #pp.pprint(mig_dict) self.assertIsInstance(mig_dict['adult'], np.matrix) self.assertEqual( mig_dict['adult'].shape[0], mig_dict['adult'].shape[1]) def test_read_migration(self): uri = os.path.join(data_directory, 'migration/') args = { "migration_dir": uri, "migr_cont": True, } class_list = ['larva', 'other', 'other2', 'adult'] region_list = ['Region 1', 'Region 2', '...', 'Region N'] mig_dict = fisheries_io.read_migration_tables( args, class_list, region_list) test_matrix_dict = fisheries_io._parse_migration_tables( args, ['larva']) # pp.pprint(test_matrix_dict) # pp.pprint(mig_dict) testing.assert_array_equal( mig_dict['Migration'][0], test_matrix_dict['larva']) class TestSingleParamsIO(unittest.TestCase): def test_verify_single_params(self): args = { 'workspace_dir': '', 'aoi_uri': None, 'population_type': None, 'sexsp': 1, 'do_batch': False, 'total_init_recruits': -1.0, 'total_timesteps': -1, 'recruitment_type': 'Ricker', 'spawn_units': 'Individuals', 'alpha': None, 'beta': None, 'total_recur_recruits': None, 'migr_cont': True, 'harvest_units': None, 'frac_post_process': None, 'unit_price': None, 'val_cont': True, } # Check that path exists and user has read/write permissions along path with self.assertRaises(OSError): fisheries_io._verify_single_params(args) # Check timesteps positive number with self.assertRaises(ValueError): fisheries_io._verify_single_params(args, create_outputs=False) args['total_timesteps'] = 100 # Check total_init_recruits for non-negative float with self.assertRaises(ValueError): fisheries_io._verify_single_params(args, create_outputs=False) args['total_init_recruits'] = 1.2 # Check recruitment type's corresponding parameters exist with self.assertRaises(ValueError): fisheries_io._verify_single_params(args, create_outputs=False) args['alpha'] = -1.0 args['beta'] = -1.0 args['total_recur_recruits'] = -1.0 # If BH or Ricker: Check alpha positive float with self.assertRaises(ValueError): fisheries_io._verify_single_params(args, create_outputs=False) args['alpha'] = 1.0 # Check positive beta positive float with self.assertRaises(ValueError): fisheries_io._verify_single_params(args, create_outputs=False) args['beta'] = 1.0 # Check total_recur_recruits is non-negative float args['recruitment_type'] = 'Fixed' with self.assertRaises(ValueError): fisheries_io._verify_single_params(args, create_outputs=False) args['total_recur_recruits'] = 100.0 # If Harvest: Check frac_post_process float between [0,1] with self.assertRaises(ValueError): fisheries_io._verify_single_params(args, create_outputs=False) args['frac_post_process'] = 0.2 # If Harvest: Check unit_price non-negative float with self.assertRaises(ValueError): fisheries_io._verify_single_params(args, create_outputs=False) args['unit_price'] = 20.2 # Check file extension? (maybe try / except would be better) # Check shapefile subregions match regions in population parameters file args['aoi_uri'] = None class TestFetchArgs(unittest.TestCase): def test_fetch_args(self): csv_uri = os.path.join(data_directory, 'CSVs/TestCSV_SN_Syntax.csv') mig_uri = os.path.join(data_directory, 'migration/') args = { 'population_csv_uri': csv_uri, 'migr_cont': True, 'migration_dir': mig_uri, 'workspace_dir': '', 'aoi_uri': None, 'population_type': "Stage-Based", 'sexsp': 'No', 'do_batch': False, 'total_init_recruits': 1.2, 'total_timesteps': 100, 'recruitment_type': 'Ricker', 'spawn_units': 'Individuals', 'alpha': 1.0, 'beta': 1.2, 'total_recur_recruits': 100.0, 'migr_cont': True, 'harvest_units': "Weight", 'frac_post_process': 0.2, 'unit_price': 20.2, 'val_cont': True, } vars_dict = fisheries_io.fetch_args(args, create_outputs=False) # pp.pprint(vars_dict) # with self.assertRaises(): # fisheries_io.fetch_args(args) def test_fetch_args2(self): csv_dir = os.path.join(data_directory, 'CSVs/Multiple_CSV_Test') mig_uri = os.path.join(data_directory, 'migration/') workspace_dir = '' args = { 'population_csv_dir': csv_dir, 'migr_cont': True, 'migration_dir': mig_uri, 'workspace_dir': workspace_dir, 'aoi_uri': None, 'population_type': "Stage-Based", 'sexsp': 'No', 'do_batch': True, 'total_init_recruits': 1.2, 'total_timesteps': 100, 'recruitment_type': 'Ricker', 'spawn_units': 'Individuals', 'alpha': 1.0, 'beta': 1.2, 'total_recur_recruits': 100.0, 'migr_cont': True, 'harvest_units': "Weight", 'frac_post_process': 0.2, 'unit_price': 20.2, 'val_cont': True, } # model_list = fisheries_io.fetch_args(args) # pp.pprint(model_list) # with self.assertRaises(): # fisheries_io.fetch_args(args) # os.removedirs(os.path.join(args['workspace_dir'], 'output')) class TestCreateCSV(unittest.TestCase): def setUp(self): self.vars_dict = { 'workspace_dir': 'path/to/workspace_dir', 'output_dir': os.getcwd(), # 'aoi_uri': 'path/to/aoi_uri', 'total_timesteps': 15, 'population_type': 'Age-Based', 'sexsp': 2, 'do_batch': False, 'spawn_units': 'Weight', 'total_init_recruits': 100.0, 'recruitment_type': 'Fixed', 'alpha': 3.0, 'beta': 4.0, 'total_recur_recruits': 1.0, 'migr_cont': True, 'val_cont': True, 'harvest_units': 'Individuals', 'frac_post_process': 0.5, 'unit_price': 5.0, # Pop Params # 'population_csv_uri': 'path/to/csv_uri', 'Survnaturalfrac': np.ones([2, 2, 2]) * 0.5, # Regions, Sexes, Classes 'Classes': np.array(['larva', 'adult']), 'Vulnfishing': np.array([[0.5, 0.5], [0.5, 0.5]]), 'Maturity': np.array([[0.0, 1.0], [0.0, 1.0]]), 'Duration': np.array([[2, 3], [2, 3]]), 'Weight': np.array([[0.1, 1.0], [0.1, 1.0]]), 'Fecundity': np.array([[0.1, 1.0], [0.1, 2.0]]), 'Regions': np.array(['r1', 'r2']), 'Exploitationfraction': np.array([0.25, 0.5]), 'Larvaldispersal': np.array([0.5, 0.5]), # Mig Params # 'migration_dir': 'path/to/mig_dir', 'Migration': [np.eye(2), np.eye(2)], # Derived Params 'equilibrate_cycle': 10, 'Survtotalfrac': np.array([[[0.5, 0.5], [0.5, 0.5]], [[0.5, 0.5], [0.5, 0.5]]]), # Index Order: class, sex, region 'G_survtotalfrac': np.ones([2, 2, 2]), # (same) 'P_survtotalfrac': np.ones([2, 2, 2]), # (same) 'N_tasx': np.ones([15, 2, 2, 2]), # Index Order: time, class, sex, region 'H_tx': np.ones([15, 2]), 'V_tx': np.ones([15, 2]) * 5.0, } pass def test_create_csv(self): # fisheries_io._create_csv(self.vars_dict) pass class TestCreateHTML(unittest.TestCase): def setUp(self): self.vars_dict = { 'workspace_dir': 'path/to/workspace_dir', 'output_dir': os.getcwd(), # 'aoi_uri': 'path/to/aoi_uri', 'total_timesteps': 15, 'population_type': 'Age-Based', 'sexsp': 2, 'do_batch': False, 'spawn_units': 'Weight', 'total_init_recruits': 100.0, 'recruitment_type': 'Fixed', 'alpha': 3.0, 'beta': 4.0, 'total_recur_recruits': 1.0, 'migr_cont': True, 'val_cont': True, 'harvest_units': 'Individuals', 'frac_post_process': 0.5, 'unit_price': 5.0, # Pop Params # 'population_csv_uri': 'path/to/csv_uri', 'Survnaturalfrac': np.ones([2, 2, 2]) * 0.5, # Regions, Sexes, Classes 'Classes': np.array(['larva', 'adult']), 'Vulnfishing': np.array([[0.5, 0.5], [0.5, 0.5]]), 'Maturity': np.array([[0.0, 1.0], [0.0, 1.0]]), 'Duration': np.array([[2, 3], [2, 3]]), 'Weight': np.array([[0.1, 1.0], [0.1, 1.0]]), 'Fecundity': np.array([[0.1, 1.0], [0.1, 2.0]]), 'Regions': np.array(['r1', 'r2']), 'Exploitationfraction': np.array([0.25, 0.5]), 'Larvaldispersal': np.array([0.5, 0.5]), # Mig Params # 'migration_dir': 'path/to/mig_dir', 'Migration': [np.eye(2), np.eye(2)], # Derived Params 'equilibrate_cycle': 10, 'Survtotalfrac': np.array([[[0.5, 0.5], [0.5, 0.5]], [[0.5, 0.5], [0.5, 0.5]]]), # Index Order: class, sex, region 'G_survtotalfrac': np.ones([2, 2, 2]), # (same) 'P_survtotalfrac': np.ones([2, 2, 2]), # (same) 'N_tasx': np.ones([15, 2, 2, 2]), # Index Order: time, class, sex, region 'H_tx': np.ones([15, 2]), 'V_tx': np.ones([15, 2]) * 5.0, } pass def test_create_html(self): # fisheries_io._create_html(self.vars_dict) pass class TestCreateAOI(unittest.TestCase): def setUp(self): self.vars_dict = { 'workspace_dir': 'path/to/workspace_dir', 'output_dir': os.getcwd(), 'aoi_uri': os.path.join(data_directory, 'Galveston_Subregion.shp'), 'Classes': np.array(['larva']), 'Regions': np.array(['1']), 'N_tasx': np.ones([15, 2, 2, 2]), 'H_tx': np.ones([15, 1]), 'V_tx': np.ones([15, 1]) * 5.0, } pass def test_create_aoi(self): # fisheries_io._create_aoi(self.vars_dict) pass if __name__ == '__main__': unittest.main()
[ 1, 529, 276, 1112, 420, 29958, 561, 1191, 468, 29882, 29914, 262, 10147, 29899, 8924, 5030, 29889, 262, 10147, 29899, 29941, 13, 5215, 443, 27958, 13, 5215, 2897, 13, 5215, 282, 2158, 13, 13, 3166, 12655, 1053, 6724, 13, 5215, 12655, 408, 7442, 13, 13, 5215, 13258, 29918, 8924, 5030, 29889, 15161, 6358, 29889, 15161, 6358, 29918, 601, 408, 9427, 6358, 29918, 601, 13, 13, 3166, 13258, 29918, 8924, 5030, 29889, 15161, 6358, 29889, 15161, 6358, 29918, 601, 1053, 4750, 292, 9329, 13, 13, 1272, 29918, 12322, 353, 19283, 262, 10147, 29899, 1272, 29914, 1688, 29914, 1272, 29914, 15161, 6358, 29915, 13, 407, 353, 282, 2158, 29889, 6572, 4349, 4040, 1639, 29898, 12860, 29922, 29946, 29897, 13, 13, 13, 3596, 29918, 11507, 353, 6024, 27403, 742, 525, 18984, 742, 525, 9544, 417, 7018, 29888, 13857, 742, 525, 29943, 687, 870, 537, 742, 13, 462, 29871, 525, 24105, 791, 2218, 6774, 284, 742, 525, 29924, 1337, 537, 742, 525, 4597, 1080, 742, 525, 18498, 18564, 18771, 1154, 742, 13, 462, 29871, 525, 22676, 742, 525, 29963, 352, 29876, 29888, 14424, 2033, 13, 29940, 687, 404, 653, 29918, 9629, 353, 6024, 27403, 742, 525, 9544, 417, 7018, 29888, 13857, 742, 525, 29924, 1337, 537, 742, 525, 4597, 1080, 742, 13, 462, 1678, 525, 18498, 18564, 18771, 1154, 742, 525, 29963, 352, 29876, 29888, 14424, 2033, 13, 13, 13, 1990, 4321, 12310, 2785, 9629, 5971, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 5510, 29918, 7323, 29884, 29918, 7529, 29918, 9539, 29918, 29883, 4201, 29898, 1311, 1125, 13, 4706, 21333, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 4373, 29918, 9629, 29889, 7638, 1495, 13, 4706, 7916, 1028, 353, 29871, 29896, 13, 4706, 1835, 29918, 8977, 353, 9427, 6358, 29918, 601, 3032, 5510, 29918, 7323, 2785, 29918, 7638, 29898, 5338, 29892, 7916, 1028, 29897, 13, 4706, 396, 5399, 393, 6611, 526, 1959, 13, 4706, 14514, 292, 29918, 15506, 353, 518, 29875, 363, 474, 297, 1835, 29918, 8977, 29889, 8149, 580, 565, 474, 297, 405, 687, 404, 653, 29918, 9629, 29962, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 9652, 292, 29918, 15506, 511, 7431, 29898, 29940, 687, 404, 653, 29918, 9629, 876, 13, 4706, 396, 5399, 393, 7916, 1028, 16459, 5149, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 7323, 29918, 8977, 1839, 18498, 18564, 18771, 1154, 2033, 29961, 29900, 11724, 7916, 1028, 29897, 13, 4706, 396, 5399, 393, 4134, 5352, 27497, 1993, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13, 9651, 7431, 29898, 7323, 29918, 8977, 1839, 29963, 352, 29876, 29888, 14424, 2033, 511, 7431, 29898, 7323, 29918, 8977, 1839, 29924, 1337, 537, 25901, 13, 4706, 396, 13905, 13343, 565, 13490, 13, 4706, 396, 407, 29889, 407, 29878, 524, 29898, 7323, 29918, 8977, 29897, 13, 13, 1678, 822, 1243, 29918, 5510, 29918, 7323, 29884, 29918, 7529, 29918, 16586, 29898, 1311, 1125, 13, 4706, 21333, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 3057, 29907, 7597, 29918, 19296, 29918, 16676, 29889, 7638, 1495, 13, 4706, 7916, 1028, 353, 29871, 29896, 13, 4706, 1835, 29918, 8977, 353, 9427, 6358, 29918, 601, 3032, 5510, 29918, 7323, 2785, 29918, 7638, 29898, 5338, 29892, 7916, 1028, 29897, 13, 4706, 396, 5399, 393, 6611, 526, 1959, 13, 4706, 14514, 292, 29918, 15506, 353, 518, 29875, 363, 474, 297, 1835, 29918, 8977, 29889, 8149, 580, 565, 474, 297, 2178, 29918, 11507, 29962, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 9652, 292, 29918, 15506, 511, 7431, 29898, 3596, 29918, 11507, 876, 13, 4706, 396, 5399, 393, 7916, 1028, 16459, 5149, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 7323, 29918, 8977, 1839, 18498, 18564, 18771, 1154, 2033, 29961, 29900, 11724, 7916, 1028, 29897, 13, 4706, 396, 5399, 393, 4134, 5352, 27497, 1993, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13, 9651, 7431, 29898, 7323, 29918, 8977, 1839, 29963, 352, 29876, 29888, 14424, 2033, 511, 7431, 29898, 7323, 29918, 8977, 1839, 29924, 1337, 537, 25901, 13, 4706, 396, 13905, 13343, 565, 13490, 13, 4706, 396, 407, 29889, 407, 29878, 524, 29898, 7323, 29918, 8977, 29897, 13, 13, 1678, 822, 1243, 29918, 5510, 29918, 7323, 29884, 29918, 7529, 29918, 893, 29898, 1311, 1125, 13, 4706, 21333, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 3057, 29907, 7597, 29918, 1799, 29918, 16676, 29889, 7638, 1495, 13, 4706, 7916, 1028, 353, 29871, 29906, 13, 4706, 1835, 29918, 8977, 353, 9427, 6358, 29918, 601, 3032, 5510, 29918, 7323, 2785, 29918, 7638, 29898, 5338, 29892, 7916, 1028, 29897, 13, 4706, 396, 5399, 393, 6611, 526, 1959, 13, 4706, 14514, 292, 29918, 9629, 353, 518, 29875, 363, 474, 297, 1835, 29918, 8977, 29889, 8149, 580, 565, 474, 297, 2178, 29918, 11507, 29962, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 9652, 292, 29918, 9629, 511, 7431, 29898, 3596, 29918, 11507, 876, 13, 4706, 396, 5399, 393, 7916, 1028, 16459, 5149, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 7323, 29918, 8977, 1839, 18498, 18564, 18771, 1154, 2033, 29961, 29900, 11724, 7916, 1028, 29897, 13, 4706, 396, 5399, 393, 4134, 5352, 27497, 1993, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13, 9651, 7431, 29898, 7323, 29918, 8977, 1839, 29963, 352, 29876, 29888, 14424, 2033, 511, 7431, 29898, 7323, 29918, 8977, 1839, 29924, 1337, 537, 25901, 13, 4706, 396, 13905, 13343, 565, 13490, 13, 4706, 396, 407, 29889, 407, 29878, 524, 29898, 7323, 29918, 8977, 29897, 13, 13, 1678, 822, 1243, 29918, 949, 29918, 7323, 29884, 29918, 7529, 29898, 1311, 1125, 13, 4706, 396, 5399, 393, 8026, 1059, 746, 5181, 2472, 947, 451, 1863, 13, 13, 4706, 396, 4321, 411, 451, 599, 5181, 8636, 13, 4706, 4665, 29918, 7638, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 16243, 29914, 3057, 29907, 7597, 29918, 19296, 29918, 16676, 29918, 14057, 29896, 29889, 7638, 1495, 13, 4706, 6389, 353, 11117, 7323, 2785, 29918, 7638, 29918, 5338, 2396, 4665, 29918, 7638, 29918, 5338, 29892, 525, 14167, 1028, 2396, 29871, 29896, 29913, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 18552, 292, 9329, 1125, 13, 9651, 9427, 6358, 29918, 601, 29889, 949, 29918, 7323, 2785, 29918, 7638, 29898, 5085, 29892, 4665, 29918, 7638, 29918, 5338, 29897, 13, 13, 4706, 396, 4321, 24906, 29899, 6707, 1728, 360, 2633, 4608, 13, 4706, 4665, 29918, 7638, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 16243, 29914, 3057, 29907, 7597, 29918, 19296, 29918, 16676, 29918, 14057, 29906, 29889, 7638, 1495, 13, 4706, 6389, 1839, 7323, 2785, 29918, 7638, 29918, 5338, 2033, 353, 4665, 29918, 7638, 29918, 5338, 13, 4706, 6389, 1839, 3757, 9216, 358, 29918, 1853, 2033, 353, 525, 29933, 1310, 880, 29899, 29950, 14339, 29915, 13, 4706, 6389, 1839, 7323, 2785, 29918, 1853, 2033, 353, 525, 27276, 29899, 29933, 1463, 29915, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 18552, 292, 9329, 1125, 13, 9651, 9427, 6358, 29918, 601, 29889, 949, 29918, 7323, 2785, 29918, 7638, 29898, 5085, 29892, 4665, 29918, 7638, 29918, 5338, 29897, 13, 13, 4706, 396, 4321, 350, 29899, 29950, 847, 1334, 523, 1728, 1334, 523, 4608, 13, 4706, 4665, 29918, 7638, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 16243, 29914, 3057, 29907, 7597, 29918, 19296, 29918, 16676, 29918, 14057, 29941, 29889, 7638, 1495, 13, 4706, 6389, 1839, 7323, 2785, 29918, 7638, 29918, 5338, 2033, 353, 4665, 29918, 7638, 29918, 5338, 13, 4706, 6389, 1839, 1028, 18101, 29918, 348, 1169, 2033, 353, 525, 22676, 29915, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 18552, 292, 9329, 1125, 13, 9651, 9427, 6358, 29918, 601, 29889, 949, 29918, 7323, 2785, 29918, 7638, 29898, 5085, 29892, 4665, 29918, 7638, 29918, 5338, 29897, 13, 13, 4706, 396, 4321, 383, 687, 870, 537, 1728, 383, 687, 870, 537, 4608, 13, 4706, 4665, 29918, 7638, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 16243, 29914, 3057, 29907, 7597, 29918, 19296, 29918, 16676, 29918, 14057, 29941, 29889, 7638, 1495, 13, 4706, 6389, 1839, 7323, 2785, 29918, 7638, 29918, 5338, 2033, 353, 4665, 29918, 7638, 29918, 5338, 13, 4706, 6389, 1839, 3757, 9216, 358, 29918, 1853, 2033, 353, 525, 29943, 687, 870, 537, 29915, 13, 4706, 6389, 1839, 8222, 10147, 29918, 348, 1169, 2033, 353, 525, 22676, 29915, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 18552, 292, 9329, 1125, 13, 9651, 9427, 6358, 29918, 601, 29889, 949, 29918, 7323, 2785, 29918, 7638, 29898, 5085, 29892, 4665, 29918, 7638, 29918, 5338, 29897, 13, 13, 4706, 14550, 13, 4706, 396, 5399, 393, 8026, 1059, 746, 10240, 2472, 4864, 13, 4706, 4665, 29918, 7638, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 16243, 29914, 3057, 29907, 7597, 29918, 19296, 29918, 28516, 22614, 29918, 14057, 29896, 29889, 7638, 1495, 13, 4706, 6389, 353, 11117, 7323, 2785, 29918, 7638, 29918, 5338, 2396, 4665, 29918, 7638, 29918, 5338, 29892, 525, 14167, 1028, 2396, 29871, 29896, 29913, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13, 9651, 4750, 292, 9329, 29892, 9427, 6358, 29918, 601, 29889, 949, 29918, 7323, 2785, 29918, 7638, 29898, 5085, 876, 13, 13, 4706, 4665, 29918, 7638, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 16243, 29914, 3057, 29907, 7597, 29918, 19296, 29918, 28516, 22614, 29918, 14057, 29906, 29889, 7638, 1495, 13, 4706, 6389, 353, 11117, 7323, 2785, 29918, 7638, 29918, 5338, 2396, 4665, 29918, 7638, 29918, 5338, 29892, 525, 14167, 1028, 2396, 29871, 29896, 29913, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13, 9651, 4750, 292, 9329, 29892, 9427, 6358, 29918, 601, 29889, 949, 29918, 7323, 2785, 29918, 7638, 29898, 5085, 876, 13, 13, 4706, 4665, 29918, 7638, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 16243, 29914, 3057, 29907, 7597, 29918, 19296, 29918, 28516, 22614, 29918, 14057, 29941, 29889, 7638, 1495, 13, 4706, 6389, 353, 11117, 7323, 2785, 29918, 7638, 29918, 5338, 2396, 4665, 29918, 7638, 29918, 5338, 29892, 525, 14167, 1028, 2396, 29871, 29896, 29913, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13, 9651, 4750, 292, 9329, 29892, 9427, 6358, 29918, 601, 29889, 949, 29918, 7323, 2785, 29918, 7638, 29898, 5085, 876, 13, 4706, 14550, 13, 13, 13, 1990, 4321, 29924, 16783, 5971, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 5510, 29918, 29885, 16783, 29898, 1311, 1125, 13, 4706, 21333, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29885, 16783, 29914, 1495, 13, 4706, 6389, 353, 426, 13, 9651, 525, 26983, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 29885, 16783, 29918, 3972, 2396, 21333, 13, 4706, 500, 13, 4706, 770, 29918, 1761, 353, 6024, 4675, 1564, 742, 525, 328, 499, 2033, 13, 4706, 29542, 29918, 8977, 353, 9427, 6358, 29918, 601, 3032, 5510, 29918, 29885, 16783, 29918, 24051, 29898, 5085, 29892, 770, 29918, 1761, 29897, 13, 4706, 396, 407, 29889, 407, 29878, 524, 29898, 29885, 335, 29918, 8977, 29897, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 29885, 335, 29918, 8977, 1839, 328, 499, 7464, 7442, 29889, 5344, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13, 9651, 29542, 29918, 8977, 1839, 328, 499, 13359, 12181, 29961, 29900, 1402, 29542, 29918, 8977, 1839, 328, 499, 13359, 12181, 29961, 29896, 2314, 13, 13, 1678, 822, 1243, 29918, 949, 29918, 29885, 16783, 29898, 1311, 1125, 13, 4706, 21333, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29885, 16783, 29914, 1495, 13, 4706, 6389, 353, 426, 13, 9651, 376, 29885, 16783, 29918, 3972, 1115, 21333, 29892, 13, 9651, 376, 26983, 29918, 1285, 1115, 5852, 29892, 13, 9651, 500, 13, 4706, 770, 29918, 1761, 353, 6024, 4675, 1564, 742, 525, 1228, 742, 525, 1228, 29906, 742, 525, 328, 499, 2033, 13, 4706, 5120, 29918, 1761, 353, 6024, 18457, 29871, 29896, 742, 525, 18457, 29871, 29906, 742, 525, 856, 742, 525, 18457, 405, 2033, 13, 4706, 29542, 29918, 8977, 353, 9427, 6358, 29918, 601, 29889, 949, 29918, 29885, 16783, 29918, 24051, 29898, 13, 9651, 6389, 29892, 770, 29918, 1761, 29892, 5120, 29918, 1761, 29897, 13, 4706, 1243, 29918, 5344, 29918, 8977, 353, 9427, 6358, 29918, 601, 3032, 5510, 29918, 29885, 16783, 29918, 24051, 29898, 13, 9651, 6389, 29892, 6024, 4675, 1564, 11287, 13, 4706, 396, 6499, 29889, 407, 29878, 524, 29898, 1688, 29918, 5344, 29918, 8977, 29897, 13, 4706, 396, 6499, 29889, 407, 29878, 524, 29898, 29885, 335, 29918, 8977, 29897, 13, 4706, 6724, 29889, 9294, 29918, 2378, 29918, 11745, 29898, 13, 9651, 29542, 29918, 8977, 1839, 29924, 16783, 2033, 29961, 29900, 1402, 1243, 29918, 5344, 29918, 8977, 1839, 4675, 1564, 11287, 13, 13, 13, 1990, 4321, 15771, 9629, 5971, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 27902, 29918, 14369, 29918, 7529, 29898, 1311, 1125, 13, 4706, 6389, 353, 426, 13, 9651, 525, 1287, 3493, 29918, 3972, 2396, 15516, 13, 9651, 525, 6241, 29875, 29918, 5338, 2396, 6213, 29892, 13, 9651, 525, 7323, 2785, 29918, 1853, 2396, 6213, 29892, 13, 9651, 525, 14167, 1028, 2396, 29871, 29896, 29892, 13, 9651, 525, 1867, 29918, 16175, 2396, 7700, 29892, 13, 9651, 525, 7827, 29918, 2344, 29918, 3757, 21211, 2396, 448, 29896, 29889, 29900, 29892, 13, 9651, 525, 7827, 29918, 9346, 4196, 567, 2396, 448, 29896, 29892, 13, 9651, 525, 3757, 9216, 358, 29918, 1853, 2396, 525, 29934, 6541, 742, 13, 9651, 525, 1028, 18101, 29918, 348, 1169, 2396, 525, 2568, 23352, 29879, 742, 13, 9651, 525, 2312, 2396, 6213, 29892, 13, 9651, 525, 3571, 2396, 6213, 29892, 13, 9651, 525, 7827, 29918, 276, 2764, 29918, 3757, 21211, 2396, 6213, 29892, 13, 9651, 525, 26983, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 8222, 10147, 29918, 348, 1169, 2396, 6213, 29892, 13, 9651, 525, 1154, 29918, 2490, 29918, 5014, 2396, 6213, 29892, 13, 9651, 525, 5441, 29918, 9175, 2396, 6213, 29892, 13, 9651, 525, 791, 29918, 1285, 2396, 5852, 29892, 13, 9651, 500, 13, 13, 4706, 396, 5399, 393, 2224, 4864, 322, 1404, 756, 1303, 29914, 3539, 11239, 3412, 2224, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 29949, 29173, 1125, 13, 9651, 9427, 6358, 29918, 601, 3032, 27902, 29918, 14369, 29918, 7529, 29898, 5085, 29897, 13, 13, 4706, 396, 5399, 5335, 4196, 567, 6374, 1353, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 9427, 6358, 29918, 601, 3032, 27902, 29918, 14369, 29918, 7529, 29898, 5085, 29892, 1653, 29918, 4905, 29879, 29922, 8824, 29897, 13, 4706, 6389, 1839, 7827, 29918, 9346, 4196, 567, 2033, 353, 29871, 29896, 29900, 29900, 13, 13, 4706, 396, 5399, 3001, 29918, 2344, 29918, 3757, 21211, 363, 1661, 29899, 22198, 5785, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 9427, 6358, 29918, 601, 3032, 27902, 29918, 14369, 29918, 7529, 29898, 5085, 29892, 1653, 29918, 4905, 29879, 29922, 8824, 29897, 13, 4706, 6389, 1839, 7827, 29918, 2344, 29918, 3757, 21211, 2033, 353, 29871, 29896, 29889, 29906, 13, 13, 4706, 396, 5399, 1162, 9216, 358, 1134, 29915, 29879, 6590, 4128, 1863, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 9427, 6358, 29918, 601, 3032, 27902, 29918, 14369, 29918, 7529, 29898, 5085, 29892, 1653, 29918, 4905, 29879, 29922, 8824, 29897, 13, 4706, 6389, 1839, 2312, 2033, 353, 448, 29896, 29889, 29900, 13, 4706, 6389, 1839, 3571, 2033, 353, 448, 29896, 29889, 29900, 13, 4706, 6389, 1839, 7827, 29918, 276, 2764, 29918, 3757, 21211, 2033, 353, 448, 29896, 29889, 29900, 13, 13, 4706, 396, 960, 350, 29950, 470, 390, 6541, 29901, 5399, 15595, 6374, 5785, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 9427, 6358, 29918, 601, 3032, 27902, 29918, 14369, 29918, 7529, 29898, 5085, 29892, 1653, 29918, 4905, 29879, 29922, 8824, 29897, 13, 4706, 6389, 1839, 2312, 2033, 353, 29871, 29896, 29889, 29900, 13, 13, 4706, 396, 5399, 6374, 21762, 6374, 5785, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 9427, 6358, 29918, 601, 3032, 27902, 29918, 14369, 29918, 7529, 29898, 5085, 29892, 1653, 29918, 4905, 29879, 29922, 8824, 29897, 13, 4706, 6389, 1839, 3571, 2033, 353, 29871, 29896, 29889, 29900, 13, 13, 4706, 396, 5399, 3001, 29918, 276, 2764, 29918, 3757, 21211, 338, 1661, 29899, 22198, 5785, 13, 4706, 6389, 1839, 3757, 9216, 358, 29918, 1853, 2033, 353, 525, 26262, 29915, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 9427, 6358, 29918, 601, 3032, 27902, 29918, 14369, 29918, 7529, 29898, 5085, 29892, 1653, 29918, 4905, 29879, 29922, 8824, 29897, 13, 4706, 6389, 1839, 7827, 29918, 276, 2764, 29918, 3757, 21211, 2033, 353, 29871, 29896, 29900, 29900, 29889, 29900, 13, 13, 4706, 396, 960, 3536, 10147, 29901, 5399, 285, 945, 29918, 2490, 29918, 5014, 5785, 1546, 518, 29900, 29892, 29896, 29962, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 9427, 6358, 29918, 601, 3032, 27902, 29918, 14369, 29918, 7529, 29898, 5085, 29892, 1653, 29918, 4905, 29879, 29922, 8824, 29897, 13, 4706, 6389, 1839, 1154, 29918, 2490, 29918, 5014, 2033, 353, 29871, 29900, 29889, 29906, 13, 13, 4706, 396, 960, 3536, 10147, 29901, 5399, 5190, 29918, 9175, 1661, 29899, 22198, 5785, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 9427, 6358, 29918, 601, 3032, 27902, 29918, 14369, 29918, 7529, 29898, 5085, 29892, 1653, 29918, 4905, 29879, 29922, 8824, 29897, 13, 4706, 6389, 1839, 5441, 29918, 9175, 2033, 353, 29871, 29906, 29900, 29889, 29906, 13, 13, 4706, 396, 5399, 934, 6081, 29973, 313, 26026, 1018, 847, 5174, 723, 367, 2253, 29897, 13, 4706, 396, 5399, 8267, 1445, 1014, 1727, 1080, 1993, 12786, 297, 4665, 4128, 934, 13, 4706, 6389, 1839, 6241, 29875, 29918, 5338, 2033, 353, 6213, 13, 13, 13, 1990, 4321, 20927, 7883, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 9155, 29918, 5085, 29898, 1311, 1125, 13, 4706, 11799, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 3057, 29907, 7597, 29918, 19296, 29918, 16676, 29889, 7638, 1495, 13, 4706, 29542, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29885, 16783, 29914, 1495, 13, 4706, 6389, 353, 426, 13, 9651, 525, 7323, 2785, 29918, 7638, 29918, 5338, 2396, 11799, 29918, 5338, 29892, 13, 9651, 525, 26983, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 29885, 16783, 29918, 3972, 2396, 29542, 29918, 5338, 29892, 13, 9651, 525, 1287, 3493, 29918, 3972, 2396, 15516, 13, 9651, 525, 6241, 29875, 29918, 5338, 2396, 6213, 29892, 13, 9651, 525, 7323, 2785, 29918, 1853, 2396, 376, 27276, 29899, 29933, 1463, 613, 13, 9651, 525, 14167, 1028, 2396, 525, 3782, 742, 13, 9651, 525, 1867, 29918, 16175, 2396, 7700, 29892, 13, 9651, 525, 7827, 29918, 2344, 29918, 3757, 21211, 2396, 29871, 29896, 29889, 29906, 29892, 13, 9651, 525, 7827, 29918, 9346, 4196, 567, 2396, 29871, 29896, 29900, 29900, 29892, 13, 9651, 525, 3757, 9216, 358, 29918, 1853, 2396, 525, 29934, 6541, 742, 13, 9651, 525, 1028, 18101, 29918, 348, 1169, 2396, 525, 2568, 23352, 29879, 742, 13, 9651, 525, 2312, 2396, 29871, 29896, 29889, 29900, 29892, 13, 9651, 525, 3571, 2396, 29871, 29896, 29889, 29906, 29892, 13, 9651, 525, 7827, 29918, 276, 2764, 29918, 3757, 21211, 2396, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 13, 9651, 525, 26983, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 8222, 10147, 29918, 348, 1169, 2396, 376, 22676, 613, 13, 9651, 525, 1154, 29918, 2490, 29918, 5014, 2396, 29871, 29900, 29889, 29906, 29892, 13, 9651, 525, 5441, 29918, 9175, 2396, 29871, 29906, 29900, 29889, 29906, 29892, 13, 9651, 525, 791, 29918, 1285, 2396, 5852, 29892, 13, 4706, 500, 13, 4706, 24987, 29918, 8977, 353, 9427, 6358, 29918, 601, 29889, 9155, 29918, 5085, 29898, 5085, 29892, 1653, 29918, 4905, 29879, 29922, 8824, 29897, 13, 4706, 396, 6499, 29889, 407, 29878, 524, 29898, 16908, 29918, 8977, 29897, 13, 4706, 396, 411, 1583, 29889, 9294, 29934, 1759, 267, 7295, 13, 4706, 396, 1678, 9427, 6358, 29918, 601, 29889, 9155, 29918, 5085, 29898, 5085, 29897, 13, 13, 1678, 822, 1243, 29918, 9155, 29918, 5085, 29906, 29898, 1311, 1125, 13, 4706, 11799, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29907, 7597, 29879, 29914, 15329, 552, 29918, 29907, 7597, 29918, 3057, 1495, 13, 4706, 29542, 29918, 5338, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29885, 16783, 29914, 1495, 13, 4706, 664, 3493, 29918, 3972, 353, 6629, 13, 4706, 6389, 353, 426, 13, 9651, 525, 7323, 2785, 29918, 7638, 29918, 3972, 2396, 11799, 29918, 3972, 29892, 13, 9651, 525, 26983, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 29885, 16783, 29918, 3972, 2396, 29542, 29918, 5338, 29892, 13, 9651, 525, 1287, 3493, 29918, 3972, 2396, 664, 3493, 29918, 3972, 29892, 13, 9651, 525, 6241, 29875, 29918, 5338, 2396, 6213, 29892, 13, 9651, 525, 7323, 2785, 29918, 1853, 2396, 376, 27276, 29899, 29933, 1463, 613, 13, 9651, 525, 14167, 1028, 2396, 525, 3782, 742, 13, 9651, 525, 1867, 29918, 16175, 2396, 5852, 29892, 13, 9651, 525, 7827, 29918, 2344, 29918, 3757, 21211, 2396, 29871, 29896, 29889, 29906, 29892, 13, 9651, 525, 7827, 29918, 9346, 4196, 567, 2396, 29871, 29896, 29900, 29900, 29892, 13, 9651, 525, 3757, 9216, 358, 29918, 1853, 2396, 525, 29934, 6541, 742, 13, 9651, 525, 1028, 18101, 29918, 348, 1169, 2396, 525, 2568, 23352, 29879, 742, 13, 9651, 525, 2312, 2396, 29871, 29896, 29889, 29900, 29892, 13, 9651, 525, 3571, 2396, 29871, 29896, 29889, 29906, 29892, 13, 9651, 525, 7827, 29918, 276, 2764, 29918, 3757, 21211, 2396, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 13, 9651, 525, 26983, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 8222, 10147, 29918, 348, 1169, 2396, 376, 22676, 613, 13, 9651, 525, 1154, 29918, 2490, 29918, 5014, 2396, 29871, 29900, 29889, 29906, 29892, 13, 9651, 525, 5441, 29918, 9175, 2396, 29871, 29906, 29900, 29889, 29906, 29892, 13, 9651, 525, 791, 29918, 1285, 2396, 5852, 29892, 13, 4706, 500, 13, 4706, 396, 1904, 29918, 1761, 353, 9427, 6358, 29918, 601, 29889, 9155, 29918, 5085, 29898, 5085, 29897, 13, 4706, 396, 6499, 29889, 407, 29878, 524, 29898, 4299, 29918, 1761, 29897, 13, 4706, 396, 411, 1583, 29889, 9294, 29934, 1759, 267, 7295, 13, 4706, 396, 1678, 9427, 6358, 29918, 601, 29889, 9155, 29918, 5085, 29898, 5085, 29897, 13, 4706, 396, 2897, 29889, 1745, 8238, 12935, 29898, 359, 29889, 2084, 29889, 7122, 29898, 5085, 1839, 1287, 3493, 29918, 3972, 7464, 525, 4905, 8785, 13, 13, 13, 1990, 4321, 4391, 29907, 7597, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 16908, 29918, 8977, 353, 426, 13, 9651, 525, 1287, 3493, 29918, 3972, 2396, 525, 2084, 29914, 517, 29914, 1287, 3493, 29918, 3972, 742, 13, 9651, 525, 4905, 29918, 3972, 2396, 2897, 29889, 657, 29883, 9970, 3285, 13, 9651, 396, 525, 6241, 29875, 29918, 5338, 2396, 525, 2084, 29914, 517, 29914, 6241, 29875, 29918, 5338, 742, 13, 9651, 525, 7827, 29918, 9346, 4196, 567, 2396, 29871, 29896, 29945, 29892, 13, 9651, 525, 7323, 2785, 29918, 1853, 2396, 525, 22406, 29899, 29933, 1463, 742, 13, 9651, 525, 14167, 1028, 2396, 29871, 29906, 29892, 13, 9651, 525, 1867, 29918, 16175, 2396, 7700, 29892, 13, 9651, 525, 1028, 18101, 29918, 348, 1169, 2396, 525, 22676, 742, 13, 9651, 525, 7827, 29918, 2344, 29918, 3757, 21211, 2396, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 13, 9651, 525, 3757, 9216, 358, 29918, 1853, 2396, 525, 26262, 742, 13, 9651, 525, 2312, 2396, 29871, 29941, 29889, 29900, 29892, 13, 9651, 525, 3571, 2396, 29871, 29946, 29889, 29900, 29892, 13, 9651, 525, 7827, 29918, 276, 2764, 29918, 3757, 21211, 2396, 29871, 29896, 29889, 29900, 29892, 13, 9651, 525, 26983, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 791, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 8222, 10147, 29918, 348, 1169, 2396, 525, 2568, 23352, 29879, 742, 13, 9651, 525, 1154, 29918, 2490, 29918, 5014, 2396, 29871, 29900, 29889, 29945, 29892, 13, 9651, 525, 5441, 29918, 9175, 2396, 29871, 29945, 29889, 29900, 29892, 13, 13, 9651, 396, 6977, 1459, 2232, 13, 9651, 396, 525, 7323, 2785, 29918, 7638, 29918, 5338, 2396, 525, 2084, 29914, 517, 29914, 7638, 29918, 5338, 742, 13, 9651, 525, 18498, 18564, 18771, 1154, 2396, 7442, 29889, 2873, 4197, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 2314, 334, 29871, 29900, 29889, 29945, 29892, 29871, 396, 2169, 1080, 29892, 21703, 267, 29892, 4134, 267, 13, 9651, 525, 27403, 2396, 7442, 29889, 2378, 18959, 4675, 1564, 742, 525, 328, 499, 2033, 511, 13, 9651, 525, 29963, 352, 29876, 29888, 14424, 2396, 7442, 29889, 2378, 4197, 29961, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 1402, 518, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 5262, 511, 13, 9651, 525, 29924, 1337, 537, 2396, 7442, 29889, 2378, 4197, 29961, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 1402, 518, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 5262, 511, 13, 9651, 525, 18984, 2396, 7442, 29889, 2378, 4197, 29961, 29906, 29892, 29871, 29941, 1402, 518, 29906, 29892, 29871, 29941, 5262, 511, 13, 9651, 525, 22676, 2396, 7442, 29889, 2378, 4197, 29961, 29900, 29889, 29896, 29892, 29871, 29896, 29889, 29900, 1402, 518, 29900, 29889, 29896, 29892, 29871, 29896, 29889, 29900, 5262, 511, 13, 9651, 525, 29943, 687, 870, 537, 2396, 7442, 29889, 2378, 4197, 29961, 29900, 29889, 29896, 29892, 29871, 29896, 29889, 29900, 1402, 518, 29900, 29889, 29896, 29892, 29871, 29906, 29889, 29900, 5262, 511, 13, 9651, 525, 4597, 1080, 2396, 7442, 29889, 2378, 18959, 29878, 29896, 742, 525, 29878, 29906, 2033, 511, 13, 9651, 525, 9544, 417, 7018, 29888, 13857, 2396, 7442, 29889, 2378, 4197, 29900, 29889, 29906, 29945, 29892, 29871, 29900, 29889, 29945, 11724, 13, 9651, 525, 24105, 791, 2218, 6774, 284, 2396, 7442, 29889, 2378, 4197, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 11724, 13, 13, 9651, 396, 14854, 1459, 2232, 13, 9651, 396, 525, 29885, 16783, 29918, 3972, 2396, 525, 2084, 29914, 517, 29914, 29885, 335, 29918, 3972, 742, 13, 9651, 525, 29924, 16783, 2396, 518, 9302, 29889, 1032, 29872, 29898, 29906, 511, 7442, 29889, 1032, 29872, 29898, 29906, 29897, 1402, 13, 13, 9651, 396, 2452, 2347, 1459, 2232, 13, 9651, 525, 1686, 309, 4626, 403, 29918, 23090, 2396, 29871, 29896, 29900, 29892, 13, 9651, 525, 18498, 29894, 7827, 1154, 2396, 7442, 29889, 2378, 4197, 8999, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 1402, 518, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 20526, 5519, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 1402, 518, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 5262, 11724, 29871, 396, 11374, 8170, 29901, 770, 29892, 7916, 29892, 5120, 13, 9651, 525, 29954, 29918, 7610, 29894, 7827, 1154, 2396, 7442, 29889, 2873, 4197, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 11724, 29871, 396, 313, 17642, 29897, 13, 9651, 525, 29925, 29918, 7610, 29894, 7827, 1154, 2396, 7442, 29889, 2873, 4197, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 11724, 29871, 396, 313, 17642, 29897, 13, 9651, 525, 29940, 29918, 29873, 294, 29916, 2396, 7442, 29889, 2873, 4197, 29896, 29945, 29892, 29871, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 11724, 29871, 396, 11374, 8170, 29901, 931, 29892, 770, 29892, 7916, 29892, 5120, 13, 9651, 525, 29950, 29918, 7508, 2396, 7442, 29889, 2873, 4197, 29896, 29945, 29892, 29871, 29906, 11724, 13, 9651, 525, 29963, 29918, 7508, 2396, 7442, 29889, 2873, 4197, 29896, 29945, 29892, 29871, 29906, 2314, 334, 29871, 29945, 29889, 29900, 29892, 13, 4706, 500, 13, 4706, 1209, 13, 13, 1678, 822, 1243, 29918, 3258, 29918, 7638, 29898, 1311, 1125, 13, 4706, 396, 9427, 6358, 29918, 601, 3032, 3258, 29918, 7638, 29898, 1311, 29889, 16908, 29918, 8977, 29897, 13, 4706, 1209, 13, 13, 13, 1990, 4321, 4391, 7020, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 16908, 29918, 8977, 353, 426, 13, 9651, 525, 1287, 3493, 29918, 3972, 2396, 525, 2084, 29914, 517, 29914, 1287, 3493, 29918, 3972, 742, 13, 9651, 525, 4905, 29918, 3972, 2396, 2897, 29889, 657, 29883, 9970, 3285, 13, 9651, 396, 525, 6241, 29875, 29918, 5338, 2396, 525, 2084, 29914, 517, 29914, 6241, 29875, 29918, 5338, 742, 13, 9651, 525, 7827, 29918, 9346, 4196, 567, 2396, 29871, 29896, 29945, 29892, 13, 9651, 525, 7323, 2785, 29918, 1853, 2396, 525, 22406, 29899, 29933, 1463, 742, 13, 9651, 525, 14167, 1028, 2396, 29871, 29906, 29892, 13, 9651, 525, 1867, 29918, 16175, 2396, 7700, 29892, 13, 9651, 525, 1028, 18101, 29918, 348, 1169, 2396, 525, 22676, 742, 13, 9651, 525, 7827, 29918, 2344, 29918, 3757, 21211, 2396, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 13, 9651, 525, 3757, 9216, 358, 29918, 1853, 2396, 525, 26262, 742, 13, 9651, 525, 2312, 2396, 29871, 29941, 29889, 29900, 29892, 13, 9651, 525, 3571, 2396, 29871, 29946, 29889, 29900, 29892, 13, 9651, 525, 7827, 29918, 276, 2764, 29918, 3757, 21211, 2396, 29871, 29896, 29889, 29900, 29892, 13, 9651, 525, 26983, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 791, 29918, 1285, 2396, 5852, 29892, 13, 9651, 525, 8222, 10147, 29918, 348, 1169, 2396, 525, 2568, 23352, 29879, 742, 13, 9651, 525, 1154, 29918, 2490, 29918, 5014, 2396, 29871, 29900, 29889, 29945, 29892, 13, 9651, 525, 5441, 29918, 9175, 2396, 29871, 29945, 29889, 29900, 29892, 13, 13, 9651, 396, 6977, 1459, 2232, 13, 9651, 396, 525, 7323, 2785, 29918, 7638, 29918, 5338, 2396, 525, 2084, 29914, 517, 29914, 7638, 29918, 5338, 742, 13, 9651, 525, 18498, 18564, 18771, 1154, 2396, 7442, 29889, 2873, 4197, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 2314, 334, 29871, 29900, 29889, 29945, 29892, 29871, 396, 2169, 1080, 29892, 21703, 267, 29892, 4134, 267, 13, 9651, 525, 27403, 2396, 7442, 29889, 2378, 18959, 4675, 1564, 742, 525, 328, 499, 2033, 511, 13, 9651, 525, 29963, 352, 29876, 29888, 14424, 2396, 7442, 29889, 2378, 4197, 29961, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 1402, 518, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 5262, 511, 13, 9651, 525, 29924, 1337, 537, 2396, 7442, 29889, 2378, 4197, 29961, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 1402, 518, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 5262, 511, 13, 9651, 525, 18984, 2396, 7442, 29889, 2378, 4197, 29961, 29906, 29892, 29871, 29941, 1402, 518, 29906, 29892, 29871, 29941, 5262, 511, 13, 9651, 525, 22676, 2396, 7442, 29889, 2378, 4197, 29961, 29900, 29889, 29896, 29892, 29871, 29896, 29889, 29900, 1402, 518, 29900, 29889, 29896, 29892, 29871, 29896, 29889, 29900, 5262, 511, 13, 9651, 525, 29943, 687, 870, 537, 2396, 7442, 29889, 2378, 4197, 29961, 29900, 29889, 29896, 29892, 29871, 29896, 29889, 29900, 1402, 518, 29900, 29889, 29896, 29892, 29871, 29906, 29889, 29900, 5262, 511, 13, 9651, 525, 4597, 1080, 2396, 7442, 29889, 2378, 18959, 29878, 29896, 742, 525, 29878, 29906, 2033, 511, 13, 9651, 525, 9544, 417, 7018, 29888, 13857, 2396, 7442, 29889, 2378, 4197, 29900, 29889, 29906, 29945, 29892, 29871, 29900, 29889, 29945, 11724, 13, 9651, 525, 24105, 791, 2218, 6774, 284, 2396, 7442, 29889, 2378, 4197, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 11724, 13, 13, 9651, 396, 14854, 1459, 2232, 13, 9651, 396, 525, 29885, 16783, 29918, 3972, 2396, 525, 2084, 29914, 517, 29914, 29885, 335, 29918, 3972, 742, 13, 9651, 525, 29924, 16783, 2396, 518, 9302, 29889, 1032, 29872, 29898, 29906, 511, 7442, 29889, 1032, 29872, 29898, 29906, 29897, 1402, 13, 13, 9651, 396, 2452, 2347, 1459, 2232, 13, 9651, 525, 1686, 309, 4626, 403, 29918, 23090, 2396, 29871, 29896, 29900, 29892, 13, 9651, 525, 18498, 29894, 7827, 1154, 2396, 7442, 29889, 2378, 4197, 8999, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 1402, 518, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 20526, 5519, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 1402, 518, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 5262, 11724, 29871, 396, 11374, 8170, 29901, 770, 29892, 7916, 29892, 5120, 13, 9651, 525, 29954, 29918, 7610, 29894, 7827, 1154, 2396, 7442, 29889, 2873, 4197, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 11724, 29871, 396, 313, 17642, 29897, 13, 9651, 525, 29925, 29918, 7610, 29894, 7827, 1154, 2396, 7442, 29889, 2873, 4197, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 11724, 29871, 396, 313, 17642, 29897, 13, 9651, 525, 29940, 29918, 29873, 294, 29916, 2396, 7442, 29889, 2873, 4197, 29896, 29945, 29892, 29871, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 11724, 29871, 396, 11374, 8170, 29901, 931, 29892, 770, 29892, 7916, 29892, 5120, 13, 9651, 525, 29950, 29918, 7508, 2396, 7442, 29889, 2873, 4197, 29896, 29945, 29892, 29871, 29906, 11724, 13, 9651, 525, 29963, 29918, 7508, 2396, 7442, 29889, 2873, 4197, 29896, 29945, 29892, 29871, 29906, 2314, 334, 29871, 29945, 29889, 29900, 29892, 13, 4706, 500, 13, 4706, 1209, 13, 13, 1678, 822, 1243, 29918, 3258, 29918, 1420, 29898, 1311, 1125, 13, 4706, 396, 9427, 6358, 29918, 601, 3032, 3258, 29918, 1420, 29898, 1311, 29889, 16908, 29918, 8977, 29897, 13, 4706, 1209, 13, 13, 13, 1990, 4321, 4391, 29909, 29949, 29902, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 16908, 29918, 8977, 353, 426, 13, 9651, 525, 1287, 3493, 29918, 3972, 2396, 525, 2084, 29914, 517, 29914, 1287, 3493, 29918, 3972, 742, 13, 9651, 525, 4905, 29918, 3972, 2396, 2897, 29889, 657, 29883, 9970, 3285, 13, 9651, 525, 6241, 29875, 29918, 5338, 2396, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 12322, 29892, 525, 29954, 284, 10147, 265, 29918, 4035, 12803, 29889, 845, 29886, 5477, 13, 9651, 525, 27403, 2396, 7442, 29889, 2378, 18959, 4675, 1564, 2033, 511, 13, 9651, 525, 4597, 1080, 2396, 7442, 29889, 2378, 18959, 29896, 2033, 511, 13, 9651, 525, 29940, 29918, 29873, 294, 29916, 2396, 7442, 29889, 2873, 4197, 29896, 29945, 29892, 29871, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 11724, 13, 9651, 525, 29950, 29918, 7508, 2396, 7442, 29889, 2873, 4197, 29896, 29945, 29892, 29871, 29896, 11724, 13, 9651, 525, 29963, 29918, 7508, 2396, 7442, 29889, 2873, 4197, 29896, 29945, 29892, 29871, 29896, 2314, 334, 29871, 29945, 29889, 29900, 29892, 13, 4706, 500, 13, 4706, 1209, 13, 13, 1678, 822, 1243, 29918, 3258, 29918, 6241, 29875, 29898, 1311, 1125, 13, 4706, 396, 9427, 6358, 29918, 601, 3032, 3258, 29918, 6241, 29875, 29898, 1311, 29889, 16908, 29918, 8977, 29897, 13, 4706, 1209, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
registration/migrations/0019_child_unique_child.py
screw-pack/hazel
0
148626
# Generated by Django 3.2.4 on 2021-07-21 13:41 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('registration', '0018_child_category'), ] operations = [ migrations.AddConstraint( model_name='child', constraint=models.UniqueConstraint(fields=('family', 'firstname', 'lastname'), name='unique_child'), ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29941, 29889, 29906, 29889, 29946, 373, 29871, 29906, 29900, 29906, 29896, 29899, 29900, 29955, 29899, 29906, 29896, 29871, 29896, 29941, 29901, 29946, 29896, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702, 1727, 8306, 742, 525, 29900, 29900, 29896, 29947, 29918, 5145, 29918, 7320, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 2528, 21529, 29898, 13, 9651, 1904, 29918, 978, 2433, 5145, 742, 13, 9651, 7276, 29922, 9794, 29889, 8110, 802, 21529, 29898, 9621, 29922, 877, 11922, 742, 525, 4102, 978, 742, 525, 4230, 978, 5477, 1024, 2433, 13092, 29918, 5145, 5477, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
utils/convert.py
loyelee/doubanAutoProject
1
162805
# -*- coding: utf-8 -*- """ Created on 2019/8/27 @author: LoyeLee """ # 容错最大的有色判断 MAX_RGB_VALUE = 20 # 噪点大小 MAX_NOISY_COUNT = 25 # RGBA白色定义 WHITE_COLOR = (255, 255, 255, 255) # RGBA黑色定义 BLACK_COLOR = (0, 0, 0, 255) def print_char_pic(width, height, s_data): """ 画出字符图, 空格为白色, 点为黑色 """ _pic_str = '' for y in range(0, height): for x in range(0, width): _point = s_data[y * width + x] if _point == WHITE_COLOR: _pic_str += ' ' else: _pic_str += '*' _pic_str += '\n' print(_pic_str) def gen_white_black_points(image): """ 根据点阵颜色强制转换黑白点 """ data = image.getdata() new_data = [] for item in data: if item[0] > MAX_RGB_VALUE and item[1] > MAX_RGB_VALUE and item[2] > MAX_RGB_VALUE: new_data.append(WHITE_COLOR) else: new_data.append(BLACK_COLOR) return new_data def reduce_noisy(width, height, points): """ 横向扫描, 获取最大边界大小. 除去小于最大噪点大小的面积. """ # 标记位置, 初始化都是0, 未遍历过 flag_list = [] for i in range(width * height): flag_list.append(0) # 遍历 for index, value in enumerate(points): _y = index // width _x = index - _y * width # print _x, _y if flag_list[index] == 0 and value == BLACK_COLOR: flag_list[index] = 1 _tmp_list = [index] recursion_scan_black_point(_x, _y, width, height, _tmp_list, flag_list, points) if len(_tmp_list) <= MAX_NOISY_COUNT: for x in _tmp_list: points[x] = WHITE_COLOR else: flag_list[index] = 1 def recursion_scan_black_point(x, y, width, height, tmp_list, flag_list, points): # 左上 if 0 <= (x - 1) < width and 0 <= (y - 1) < height: _x = x - 1 _y = y - 1 _inner_recursion(_x, _y, width, height, tmp_list, flag_list, points) # 上 if 0 <= (y - 1) < height: _x = x _y = y - 1 _inner_recursion(_x, _y, width, height, tmp_list, flag_list, points) # 右上 if 0 <= (x + 1) < width and 0 <= (y - 1) < height: _x = x + 1 _y = y - 1 _inner_recursion(_x, _y, width, height, tmp_list, flag_list, points) # 左 if 0 <= (x - 1) < width: _x = x - 1 _y = y _inner_recursion(_x, _y, width, height, tmp_list, flag_list, points) # 右 if 0 <= (x + 1) < width: _x = x + 1 _y = y _inner_recursion(_x, _y, width, height, tmp_list, flag_list, points) # 左下 if 0 <= (x - 1) < width and 0 <= (y + 1) < height: _x = x - 1 _y = y + 1 _inner_recursion(_x, _y, width, height, tmp_list, flag_list, points) # 下 if 0 <= (y + 1) < height: _x = x _y = y + 1 _inner_recursion(_x, _y, width, height, tmp_list, flag_list, points) # 右下 if 0 <= (x + 1) < width and 0 <= (y + 1) < height: _x = x + 1 _y = y + 1 _inner_recursion(_x, _y, width, height, tmp_list, flag_list, points) def _inner_recursion(new_x, new_y, width, height, tmp_list, flag_list, points): _index = new_x + width * new_y if flag_list[_index] == 0 and points[_index] == BLACK_COLOR: tmp_list.append(_index) flag_list[_index] = 1 recursion_scan_black_point(new_x, new_y, width, height, tmp_list, flag_list, points) else: flag_list[_index] = 1
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 20399, 373, 29871, 29906, 29900, 29896, 29929, 29914, 29947, 29914, 29906, 29955, 29871, 13, 13, 29992, 8921, 29901, 4309, 4099, 3226, 29872, 13, 15945, 29908, 13, 13, 29937, 29871, 31294, 31745, 30878, 30257, 30210, 30417, 31085, 31791, 31683, 13, 12648, 29918, 28212, 29918, 19143, 353, 29871, 29906, 29900, 13, 29937, 29871, 232, 156, 173, 30940, 30257, 30446, 13, 12648, 29918, 6632, 3235, 29979, 29918, 18736, 353, 29871, 29906, 29945, 13, 13, 29937, 390, 29954, 5688, 30868, 31085, 30495, 31349, 13, 25039, 9094, 29918, 15032, 1955, 353, 313, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29897, 13, 29937, 390, 29954, 5688, 236, 190, 148, 31085, 30495, 31349, 13, 13367, 11375, 29918, 15032, 1955, 353, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 29897, 13, 13, 1753, 1596, 29918, 3090, 29918, 16447, 29898, 2103, 29892, 3171, 29892, 269, 29918, 1272, 1125, 13, 1678, 9995, 13, 268, 31046, 30544, 30578, 31277, 30861, 29892, 29871, 30816, 31168, 30573, 30868, 31085, 29892, 29871, 30940, 30573, 236, 190, 148, 31085, 13, 1678, 9995, 13, 1678, 903, 16447, 29918, 710, 353, 6629, 13, 1678, 363, 343, 297, 3464, 29898, 29900, 29892, 3171, 1125, 13, 4706, 363, 921, 297, 3464, 29898, 29900, 29892, 2920, 1125, 13, 9651, 903, 3149, 353, 269, 29918, 1272, 29961, 29891, 334, 2920, 718, 921, 29962, 13, 9651, 565, 903, 3149, 1275, 12317, 9094, 29918, 15032, 1955, 29901, 13, 18884, 903, 16447, 29918, 710, 4619, 525, 525, 13, 9651, 1683, 29901, 13, 18884, 903, 16447, 29918, 710, 4619, 525, 29930, 29915, 13, 4706, 903, 16447, 29918, 710, 4619, 11297, 29876, 29915, 13, 13, 1678, 1596, 7373, 16447, 29918, 710, 29897, 13, 13, 13, 1753, 2531, 29918, 10921, 29918, 8517, 29918, 9748, 29898, 3027, 1125, 13, 1678, 9995, 13, 268, 31393, 30763, 30940, 236, 155, 184, 236, 165, 159, 31085, 232, 191, 189, 31072, 31415, 31640, 236, 190, 148, 30868, 30940, 13, 1678, 9995, 13, 1678, 848, 353, 1967, 29889, 657, 1272, 580, 13, 1678, 716, 29918, 1272, 353, 5159, 13, 1678, 363, 2944, 297, 848, 29901, 13, 4706, 565, 2944, 29961, 29900, 29962, 1405, 18134, 29918, 28212, 29918, 19143, 322, 2944, 29961, 29896, 29962, 1405, 18134, 29918, 28212, 29918, 19143, 322, 2944, 29961, 29906, 29962, 1405, 18134, 29918, 28212, 29918, 19143, 29901, 13, 9651, 716, 29918, 1272, 29889, 4397, 29898, 25039, 9094, 29918, 15032, 1955, 29897, 13, 4706, 1683, 29901, 13, 9651, 716, 29918, 1272, 29889, 4397, 29898, 13367, 11375, 29918, 15032, 1955, 29897, 13, 1678, 736, 716, 29918, 1272, 13, 13, 13, 1753, 10032, 29918, 1217, 13344, 29898, 2103, 29892, 3171, 29892, 3291, 1125, 13, 1678, 9995, 13, 268, 233, 171, 173, 31331, 233, 140, 174, 233, 146, 146, 29892, 29871, 31024, 30683, 30878, 30257, 31993, 30967, 30257, 30446, 29889, 29871, 31152, 31475, 30446, 30909, 30878, 30257, 232, 156, 173, 30940, 30257, 30446, 30210, 30806, 234, 170, 178, 29889, 13, 1678, 9995, 13, 1678, 396, 29871, 31062, 31410, 30956, 30669, 29892, 29871, 31120, 31020, 30705, 30769, 30392, 29900, 29892, 29871, 31295, 236, 132, 144, 232, 145, 137, 31138, 13, 1678, 7353, 29918, 1761, 353, 5159, 13, 1678, 363, 474, 297, 3464, 29898, 2103, 334, 3171, 1125, 13, 4706, 7353, 29918, 1761, 29889, 4397, 29898, 29900, 29897, 13, 13, 1678, 396, 29871, 236, 132, 144, 232, 145, 137, 13, 1678, 363, 2380, 29892, 995, 297, 26985, 29898, 9748, 1125, 13, 4706, 903, 29891, 353, 2380, 849, 2920, 13, 4706, 903, 29916, 353, 2380, 448, 903, 29891, 334, 2920, 13, 4706, 396, 1596, 903, 29916, 29892, 903, 29891, 13, 4706, 565, 7353, 29918, 1761, 29961, 2248, 29962, 1275, 29871, 29900, 322, 995, 1275, 350, 29931, 11375, 29918, 15032, 1955, 29901, 13, 9651, 7353, 29918, 1761, 29961, 2248, 29962, 353, 29871, 29896, 13, 9651, 903, 7050, 29918, 1761, 353, 518, 2248, 29962, 13, 9651, 20437, 29918, 16192, 29918, 8517, 29918, 3149, 7373, 29916, 29892, 903, 29891, 29892, 2920, 29892, 3171, 29892, 903, 7050, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 9651, 565, 7431, 7373, 7050, 29918, 1761, 29897, 5277, 18134, 29918, 6632, 3235, 29979, 29918, 18736, 29901, 13, 18884, 363, 921, 297, 903, 7050, 29918, 1761, 29901, 13, 462, 1678, 3291, 29961, 29916, 29962, 353, 12317, 9094, 29918, 15032, 1955, 13, 13, 4706, 1683, 29901, 13, 9651, 7353, 29918, 1761, 29961, 2248, 29962, 353, 29871, 29896, 13, 13, 13, 1753, 20437, 29918, 16192, 29918, 8517, 29918, 3149, 29898, 29916, 29892, 343, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 1125, 13, 1678, 396, 29871, 31651, 30429, 13, 1678, 565, 29871, 29900, 5277, 313, 29916, 448, 29871, 29896, 29897, 529, 2920, 322, 29871, 29900, 5277, 313, 29891, 448, 29871, 29896, 29897, 529, 3171, 29901, 13, 4706, 903, 29916, 353, 921, 448, 29871, 29896, 13, 4706, 903, 29891, 353, 343, 448, 29871, 29896, 13, 4706, 903, 3993, 29918, 3757, 1295, 291, 7373, 29916, 29892, 903, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 13, 1678, 396, 29871, 30429, 13, 1678, 565, 29871, 29900, 5277, 313, 29891, 448, 29871, 29896, 29897, 529, 3171, 29901, 13, 4706, 903, 29916, 353, 921, 13, 4706, 903, 29891, 353, 343, 448, 29871, 29896, 13, 4706, 903, 3993, 29918, 3757, 1295, 291, 7373, 29916, 29892, 903, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 13, 1678, 396, 29871, 31803, 30429, 13, 1678, 565, 29871, 29900, 5277, 313, 29916, 718, 29871, 29896, 29897, 529, 2920, 322, 29871, 29900, 5277, 313, 29891, 448, 29871, 29896, 29897, 529, 3171, 29901, 13, 4706, 903, 29916, 353, 921, 718, 29871, 29896, 13, 4706, 903, 29891, 353, 343, 448, 29871, 29896, 13, 4706, 903, 3993, 29918, 3757, 1295, 291, 7373, 29916, 29892, 903, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 13, 1678, 396, 29871, 31651, 13, 1678, 565, 29871, 29900, 5277, 313, 29916, 448, 29871, 29896, 29897, 529, 2920, 29901, 13, 4706, 903, 29916, 353, 921, 448, 29871, 29896, 13, 4706, 903, 29891, 353, 343, 13, 4706, 903, 3993, 29918, 3757, 1295, 291, 7373, 29916, 29892, 903, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 13, 1678, 396, 29871, 31803, 13, 1678, 565, 29871, 29900, 5277, 313, 29916, 718, 29871, 29896, 29897, 529, 2920, 29901, 13, 4706, 903, 29916, 353, 921, 718, 29871, 29896, 13, 4706, 903, 29891, 353, 343, 13, 4706, 903, 3993, 29918, 3757, 1295, 291, 7373, 29916, 29892, 903, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 13, 1678, 396, 29871, 31651, 30557, 13, 1678, 565, 29871, 29900, 5277, 313, 29916, 448, 29871, 29896, 29897, 529, 2920, 322, 29871, 29900, 5277, 313, 29891, 718, 29871, 29896, 29897, 529, 3171, 29901, 13, 4706, 903, 29916, 353, 921, 448, 29871, 29896, 13, 4706, 903, 29891, 353, 343, 718, 29871, 29896, 13, 4706, 903, 3993, 29918, 3757, 1295, 291, 7373, 29916, 29892, 903, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 13, 1678, 396, 29871, 30557, 13, 1678, 565, 29871, 29900, 5277, 313, 29891, 718, 29871, 29896, 29897, 529, 3171, 29901, 13, 4706, 903, 29916, 353, 921, 13, 4706, 903, 29891, 353, 343, 718, 29871, 29896, 13, 4706, 903, 3993, 29918, 3757, 1295, 291, 7373, 29916, 29892, 903, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 13, 1678, 396, 29871, 31803, 30557, 13, 1678, 565, 29871, 29900, 5277, 313, 29916, 718, 29871, 29896, 29897, 529, 2920, 322, 29871, 29900, 5277, 313, 29891, 718, 29871, 29896, 29897, 529, 3171, 29901, 13, 4706, 903, 29916, 353, 921, 718, 29871, 29896, 13, 4706, 903, 29891, 353, 343, 718, 29871, 29896, 13, 4706, 903, 3993, 29918, 3757, 1295, 291, 7373, 29916, 29892, 903, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 13, 13, 1753, 903, 3993, 29918, 3757, 1295, 291, 29898, 1482, 29918, 29916, 29892, 716, 29918, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 1125, 13, 1678, 903, 2248, 353, 716, 29918, 29916, 718, 2920, 334, 716, 29918, 29891, 13, 1678, 565, 7353, 29918, 1761, 28513, 2248, 29962, 1275, 29871, 29900, 322, 3291, 28513, 2248, 29962, 1275, 350, 29931, 11375, 29918, 15032, 1955, 29901, 13, 4706, 13128, 29918, 1761, 29889, 4397, 7373, 2248, 29897, 13, 4706, 7353, 29918, 1761, 28513, 2248, 29962, 353, 29871, 29896, 13, 4706, 20437, 29918, 16192, 29918, 8517, 29918, 3149, 29898, 1482, 29918, 29916, 29892, 716, 29918, 29891, 29892, 2920, 29892, 3171, 29892, 13128, 29918, 1761, 29892, 7353, 29918, 1761, 29892, 3291, 29897, 13, 1678, 1683, 29901, 13, 4706, 7353, 29918, 1761, 28513, 2248, 29962, 353, 29871, 29896, 2 ]
api/models.py
shrionit/invoicegen_backend
0
173356
from hashlib import blake2s from django.utils import timezone def today(): return timezone.localtime(timezone.now()) def generalCode(length): code = blake2s(digest_size=length // 2) code.update(bytes(f"{today()}", "utf-8")) return f"MT{code.hexdigest()}".upper()
[ 1, 515, 6608, 1982, 1053, 12995, 446, 29906, 29879, 13, 3166, 9557, 29889, 13239, 1053, 29431, 13, 13, 13, 1753, 9826, 7295, 13, 1678, 736, 29431, 29889, 2997, 2230, 29898, 2230, 8028, 29889, 3707, 3101, 13, 13, 13, 1753, 2498, 3399, 29898, 2848, 1125, 13, 1678, 775, 353, 12995, 446, 29906, 29879, 29898, 7501, 342, 29918, 2311, 29922, 2848, 849, 29871, 29906, 29897, 13, 1678, 775, 29889, 5504, 29898, 13193, 29898, 29888, 29908, 29912, 27765, 580, 17671, 376, 9420, 29899, 29947, 5783, 13, 1678, 736, 285, 29908, 11490, 29912, 401, 29889, 20970, 7501, 342, 28296, 1642, 21064, 580, 13, 2 ]
baaz/ChunkTreeInformationExtractor.py
sobhe/openie
23
94494
# coding: utf8 from __future__ import print_function from itertools import product from nltk.tree import Tree class ChunkTreeInformationExtractor(): def __init__(self): self.arg = lambda chunk: ' '.join([word for word, tag in chunk.leaves()]) def extract(self, chunked_tree): """ extracts information from chunk tree Args: chunked_tree (nltk.Tree): chunk tree of a sentence Returns: list(str,str,str): list of informations in for of (argument1, argument2, relation) """ informations = [] arg1s = [] arg2s = [] chunks_list = list(chunked_tree) for chunk in chunked_tree: if type(chunk) is not Tree and chunk[1] == "PUNC": chunks_list.remove(chunk) for c in range(len(chunks_list)): if c >= len(chunks_list): break chunk = chunks_list[c] if type(chunk) is not Tree: try: if chunk[0] == 'که': last_args = [] if len(arg1s) > 0 and self.arg(chunks_list[c-1]) in arg1s[-1]: last_args = arg1s elif len(arg2s) > 0 and self.arg(chunks_list[c-1]) in arg2s[-1]: last_args = arg2s else: continue last_label = '' while type(chunk) is not Tree or last_label is not 'VP': chunk = chunks_list[c] if type(chunk) is Tree: last_args[-1] += ' ' + self.arg(chunk) last_label = chunk.label() else: last_args[-1] += ' ' + chunk[0] chunks_list.pop(c) except: pass continue if chunk.label() == 'NP': try: if type(chunks_list[c - 1]) == Tree and chunks_list[c - 1].label() == 'PP': arg2s.append(self.arg(chunks_list[c - 1]) + ' ' + self.arg(chunk)) elif type(chunks_list[c + 1]) == Tree and chunks_list[c + 1].label() == 'POSTP': arg2s.append(self.arg(chunk) + ' ' + self.arg(chunks_list[c + 1])) else: if len(arg1s) == 0: arg1s.append(self.arg(chunk)) except: continue elif chunk.label() == 'VP': if len(arg1s) > 0 and len(arg2s) > 0: rel = self.arg(chunk) if len(chunk) <= 1 and type(chunks_list[c - 1]) is Tree: if chunks_list[c - 1].label() is 'ADJP': rel = self.arg(chunks_list[c - 1]) + ' ' + rel elif chunks_list[c - 1].label() == 'NP' and self.arg(chunks_list[c - 1]) not in (arg1s[-1] + arg2s[-1]): rel = self.arg(chunks_list[c - 1]) + ' ' + rel for arg1, arg2 in product(arg1s, arg2s): informations.append((arg1, arg2, rel)) arg1s = [] arg2s = [] return informations
[ 1, 396, 14137, 29901, 23616, 29947, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 3166, 4256, 8504, 1053, 3234, 13, 3166, 302, 1896, 29895, 29889, 8336, 1053, 15472, 13, 13, 13, 1990, 678, 2960, 9643, 20350, 5647, 28891, 7295, 13, 13, 12, 1753, 4770, 2344, 12035, 1311, 1125, 13, 12, 12, 1311, 29889, 1191, 353, 14013, 19875, 29901, 525, 15300, 7122, 4197, 1742, 363, 1734, 29892, 4055, 297, 19875, 29889, 280, 5989, 580, 2314, 13, 13, 12, 1753, 6597, 29898, 1311, 29892, 19875, 287, 29918, 8336, 1125, 13, 12, 12, 15945, 29908, 6597, 29879, 2472, 515, 19875, 5447, 13, 12, 12, 12, 7883, 29901, 13, 12, 12, 12, 12, 29812, 287, 29918, 8336, 313, 29876, 1896, 29895, 29889, 9643, 1125, 19875, 5447, 310, 263, 10541, 13, 12, 12, 12, 11609, 29879, 29901, 13, 12, 12, 12, 12, 1761, 29898, 710, 29892, 710, 29892, 710, 1125, 1051, 310, 19313, 297, 363, 310, 313, 23516, 29896, 29892, 2980, 29906, 29892, 8220, 29897, 13, 12, 12, 15945, 29908, 13, 12, 12, 262, 689, 800, 353, 5159, 13, 12, 12, 1191, 29896, 29879, 353, 5159, 13, 12, 12, 1191, 29906, 29879, 353, 5159, 13, 12, 12, 305, 18801, 29918, 1761, 353, 1051, 29898, 29812, 287, 29918, 8336, 29897, 13, 12, 12, 1454, 19875, 297, 19875, 287, 29918, 8336, 29901, 13, 12, 12, 12, 361, 1134, 29898, 29812, 29897, 338, 451, 15472, 322, 19875, 29961, 29896, 29962, 1275, 376, 29925, 3904, 29907, 1115, 13, 12, 12, 12, 12, 305, 18801, 29918, 1761, 29889, 5992, 29898, 29812, 29897, 13, 13, 12, 12, 1454, 274, 297, 3464, 29898, 2435, 29898, 305, 18801, 29918, 1761, 22164, 13, 12, 12, 12, 361, 274, 6736, 7431, 29898, 305, 18801, 29918, 1761, 1125, 13, 12, 12, 12, 12, 8690, 13, 12, 12, 12, 29812, 353, 521, 18801, 29918, 1761, 29961, 29883, 29962, 13, 12, 12, 12, 361, 1134, 29898, 29812, 29897, 338, 451, 15472, 29901, 13, 12, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 12, 361, 19875, 29961, 29900, 29962, 1275, 525, 30343, 30204, 2396, 13, 12, 12, 12, 12, 12, 12, 4230, 29918, 5085, 353, 5159, 13, 12, 12, 12, 12, 12, 12, 361, 7431, 29898, 1191, 29896, 29879, 29897, 1405, 29871, 29900, 322, 1583, 29889, 1191, 29898, 305, 18801, 29918, 1761, 29961, 29883, 29899, 29896, 2314, 297, 1852, 29896, 29879, 14352, 29896, 5387, 13, 12, 12, 12, 12, 12, 12, 12, 4230, 29918, 5085, 353, 1852, 29896, 29879, 13, 12, 12, 12, 12, 12, 12, 23681, 7431, 29898, 1191, 29906, 29879, 29897, 1405, 29871, 29900, 322, 1583, 29889, 1191, 29898, 305, 18801, 29918, 1761, 29961, 29883, 29899, 29896, 2314, 297, 1852, 29906, 29879, 14352, 29896, 5387, 13, 12, 12, 12, 12, 12, 12, 12, 4230, 29918, 5085, 353, 1852, 29906, 29879, 13, 12, 12, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 12, 12, 19878, 13, 12, 12, 12, 12, 12, 12, 4230, 29918, 1643, 353, 6629, 13, 12, 12, 12, 12, 12, 12, 8000, 1134, 29898, 29812, 29897, 338, 451, 15472, 470, 1833, 29918, 1643, 338, 451, 525, 18510, 2396, 13, 12, 12, 12, 12, 12, 12, 12, 29812, 353, 521, 18801, 29918, 1761, 29961, 29883, 29962, 13, 12, 12, 12, 12, 12, 12, 12, 361, 1134, 29898, 29812, 29897, 338, 15472, 29901, 13, 12, 12, 12, 12, 12, 12, 12, 12, 4230, 29918, 5085, 14352, 29896, 29962, 4619, 525, 525, 718, 1583, 29889, 1191, 29898, 29812, 29897, 13, 12, 12, 12, 12, 12, 12, 12, 12, 4230, 29918, 1643, 353, 19875, 29889, 1643, 580, 13, 12, 12, 12, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 12, 12, 12, 4230, 29918, 5085, 14352, 29896, 29962, 4619, 525, 525, 718, 19875, 29961, 29900, 29962, 13, 12, 12, 12, 12, 12, 12, 12, 305, 18801, 29918, 1761, 29889, 7323, 29898, 29883, 29897, 13, 12, 12, 12, 12, 19499, 29901, 13, 12, 12, 12, 12, 12, 3364, 13, 12, 12, 12, 12, 19878, 13, 12, 12, 12, 361, 19875, 29889, 1643, 580, 1275, 525, 25500, 2396, 13, 12, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 12, 361, 1134, 29898, 305, 18801, 29918, 1761, 29961, 29883, 448, 29871, 29896, 2314, 1275, 15472, 322, 521, 18801, 29918, 1761, 29961, 29883, 448, 29871, 29896, 1822, 1643, 580, 1275, 525, 18009, 2396, 13, 12, 12, 12, 12, 12, 12, 1191, 29906, 29879, 29889, 4397, 29898, 1311, 29889, 1191, 29898, 305, 18801, 29918, 1761, 29961, 29883, 448, 29871, 29896, 2314, 718, 525, 525, 718, 1583, 29889, 1191, 29898, 29812, 876, 13, 12, 12, 12, 12, 12, 23681, 1134, 29898, 305, 18801, 29918, 1761, 29961, 29883, 718, 29871, 29896, 2314, 1275, 15472, 322, 521, 18801, 29918, 1761, 29961, 29883, 718, 29871, 29896, 1822, 1643, 580, 1275, 525, 5438, 29925, 2396, 13, 12, 12, 12, 12, 12, 12, 1191, 29906, 29879, 29889, 4397, 29898, 1311, 29889, 1191, 29898, 29812, 29897, 718, 525, 525, 718, 1583, 29889, 1191, 29898, 305, 18801, 29918, 1761, 29961, 29883, 718, 29871, 29896, 12622, 13, 12, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 12, 361, 7431, 29898, 1191, 29896, 29879, 29897, 1275, 29871, 29900, 29901, 13, 12, 12, 12, 12, 12, 12, 12, 1191, 29896, 29879, 29889, 4397, 29898, 1311, 29889, 1191, 29898, 29812, 876, 13, 12, 12, 12, 12, 19499, 29901, 13, 12, 12, 12, 12, 12, 19878, 13, 12, 12, 12, 23681, 19875, 29889, 1643, 580, 1275, 525, 18510, 2396, 13, 12, 12, 12, 12, 361, 7431, 29898, 1191, 29896, 29879, 29897, 1405, 29871, 29900, 322, 7431, 29898, 1191, 29906, 29879, 29897, 1405, 29871, 29900, 29901, 13, 12, 12, 12, 12, 12, 2674, 353, 1583, 29889, 1191, 29898, 29812, 29897, 13, 12, 12, 12, 12, 12, 361, 7431, 29898, 29812, 29897, 5277, 29871, 29896, 322, 1134, 29898, 305, 18801, 29918, 1761, 29961, 29883, 448, 29871, 29896, 2314, 338, 15472, 29901, 13, 12, 12, 12, 12, 12, 12, 361, 521, 18801, 29918, 1761, 29961, 29883, 448, 29871, 29896, 1822, 1643, 580, 338, 525, 3035, 29967, 29925, 2396, 13, 12, 12, 12, 12, 12, 12, 12, 2674, 353, 1583, 29889, 1191, 29898, 305, 18801, 29918, 1761, 29961, 29883, 448, 29871, 29896, 2314, 718, 525, 525, 718, 1104, 13, 12, 12, 12, 12, 12, 12, 23681, 521, 18801, 29918, 1761, 29961, 29883, 448, 29871, 29896, 1822, 1643, 580, 1275, 525, 25500, 29915, 322, 1583, 29889, 1191, 29898, 305, 18801, 29918, 1761, 29961, 29883, 448, 29871, 29896, 2314, 451, 297, 313, 1191, 29896, 29879, 14352, 29896, 29962, 718, 1852, 29906, 29879, 14352, 29896, 29962, 1125, 13, 12, 12, 12, 12, 12, 12, 12, 2674, 353, 1583, 29889, 1191, 29898, 305, 18801, 29918, 1761, 29961, 29883, 448, 29871, 29896, 2314, 718, 525, 525, 718, 1104, 13, 12, 12, 12, 12, 12, 1454, 1852, 29896, 29892, 1852, 29906, 297, 3234, 29898, 1191, 29896, 29879, 29892, 1852, 29906, 29879, 1125, 13, 12, 12, 12, 12, 12, 12, 262, 689, 800, 29889, 4397, 3552, 1191, 29896, 29892, 1852, 29906, 29892, 1104, 876, 13, 12, 12, 12, 12, 1191, 29896, 29879, 353, 5159, 13, 12, 12, 12, 12, 1191, 29906, 29879, 353, 5159, 13, 13, 12, 12, 2457, 19313, 13, 2 ]
train.py
eculiat/ImageClassifier
0
74050
import matplotlib.pyplot as plt import numpy as np import time import torch from torch import nn from torch import tensor from torch import optim import torch.nn.functional as F from torch.autograd import Variable from torchvision import datasets, transforms import torchvision.models as models import argparse import nnutils2 args = argparse.ArgumentParser(description='Train.py') # Command Line ardguments args.add_argument('--data_dir', dest="data_dir", action="store", default="./flowers/") args.add_argument('--gpu', dest="gpu", action="store", default="gpu") args.add_argument('--save_dir', dest="save_dir", action="store", default="./checkpoint.pth") args.add_argument('--learning_rate', dest="learning_rate", action="store", default=0.001) args.add_argument('--dropout', dest = "dropout", action = "store", default = 0.5) args.add_argument('--epochs', dest="epochs", action="store", type=int, default=4) args.add_argument('--arch', dest="arch", action="store", default="vgg16", type = str) args.add_argument('--hidden_units', type=int, dest="hidden_units", action="store", default=120) pa = args.parse_args() where = pa.data_dir path = pa.save_dir lr = pa.learning_rate structure = pa.arch dropout = pa.dropout hidden_layer1 = pa.hidden_units power = pa.gpu epochs = pa.epochs print("***************Training Start complete***************") print("Arguments:") print(" data dir: ", pa.data_dir) print(" save path: ", pa.save_dir) print(" learning rate: ", pa.learning_rate) print(" structure: ", pa.arch) print(" dropout: ", pa.dropout) print(" hidden layer: ", pa.hidden_units) print(" power: ", pa.gpu) print(" epoch: ", pa.epochs) print("") # Load Neural network print("Loading Data-----------------------------------") trainloader, v_loader, testloader, train_data = nnutils2.load_data(where) print("Data Loaded-----------------------------------") print("") # Setup Neural network print("Setting Neural Network-------------------------") model, optimizer, criterion = nnutils2.nn_setup(structure,dropout,hidden_layer1,lr,power) print("Neural Network Set-----------------------------") print("") # Train Neural network print("Training Neural Network------------------------") nnutils2.train_network(model, optimizer, criterion, epochs, 20, trainloader, power) print("Neural Network Trained------------------------") print("") # Save print("Saving Neural Network------------------------") nnutils2.save_checkpoint(model,train_data, path,structure,hidden_layer1,dropout,lr) print("Neural Network Saved-------------------------") print("") # load_data print("Load Neural Network-------------------------") nnutils2.load_checkpoint(path) print() print() print("***************Training complete***************")
[ 1, 1053, 22889, 29889, 2272, 5317, 408, 14770, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 5215, 931, 30004, 13, 5215, 4842, 305, 30004, 13, 3166, 4842, 305, 1053, 302, 29876, 30004, 13, 3166, 4842, 305, 1053, 12489, 30004, 13, 3166, 4842, 305, 1053, 5994, 30004, 13, 5215, 4842, 305, 29889, 15755, 29889, 2220, 284, 408, 383, 30004, 13, 3166, 4842, 305, 29889, 1300, 468, 3665, 1053, 28736, 30004, 13, 3166, 4842, 305, 4924, 1053, 20035, 29892, 4327, 29879, 30004, 13, 5215, 4842, 305, 4924, 29889, 9794, 408, 4733, 30004, 13, 5215, 1852, 5510, 30004, 13, 30004, 13, 5215, 302, 29876, 13239, 29906, 30004, 13, 30004, 13, 5085, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 5323, 262, 29889, 2272, 1495, 30004, 13, 29937, 10516, 7407, 564, 20726, 9331, 30004, 13, 30004, 13, 5085, 29889, 1202, 29918, 23516, 877, 489, 1272, 29918, 3972, 742, 2731, 543, 1272, 29918, 3972, 613, 3158, 543, 8899, 613, 2322, 543, 6904, 1731, 414, 29914, 1159, 30004, 13, 5085, 29889, 1202, 29918, 23516, 877, 489, 29887, 3746, 742, 2731, 543, 29887, 3746, 613, 3158, 543, 8899, 613, 2322, 543, 29887, 3746, 1159, 30004, 13, 5085, 29889, 1202, 29918, 23516, 877, 489, 7620, 29918, 3972, 742, 2731, 543, 7620, 29918, 3972, 613, 3158, 543, 8899, 613, 2322, 543, 6904, 3198, 3149, 29889, 29886, 386, 1159, 30004, 13, 5085, 29889, 1202, 29918, 23516, 877, 489, 21891, 29918, 10492, 742, 2731, 543, 21891, 29918, 10492, 613, 3158, 543, 8899, 613, 2322, 29922, 29900, 29889, 29900, 29900, 29896, 8443, 13, 5085, 29889, 1202, 29918, 23516, 877, 489, 8865, 449, 742, 2731, 353, 376, 8865, 449, 613, 3158, 353, 376, 8899, 613, 2322, 353, 29871, 29900, 29889, 29945, 8443, 13, 5085, 29889, 1202, 29918, 23516, 877, 489, 1022, 2878, 29879, 742, 2731, 543, 1022, 2878, 29879, 613, 3158, 543, 8899, 613, 1134, 29922, 524, 29892, 2322, 29922, 29946, 8443, 13, 5085, 29889, 1202, 29918, 23516, 877, 489, 1279, 742, 2731, 543, 1279, 613, 3158, 543, 8899, 613, 2322, 543, 29894, 1505, 29896, 29953, 613, 1134, 353, 851, 8443, 13, 5085, 29889, 1202, 29918, 23516, 877, 489, 10892, 29918, 348, 1169, 742, 1134, 29922, 524, 29892, 2731, 543, 10892, 29918, 348, 1169, 613, 3158, 543, 8899, 613, 2322, 29922, 29896, 29906, 29900, 8443, 13, 30004, 13, 3274, 353, 6389, 29889, 5510, 29918, 5085, 26471, 13, 3062, 353, 3300, 29889, 1272, 29918, 3972, 30004, 13, 2084, 353, 3300, 29889, 7620, 29918, 3972, 30004, 13, 29212, 353, 3300, 29889, 21891, 29918, 10492, 30004, 13, 23905, 353, 3300, 29889, 1279, 30004, 13, 8865, 449, 353, 3300, 29889, 8865, 449, 30004, 13, 10892, 29918, 13148, 29896, 353, 3300, 29889, 10892, 29918, 348, 1169, 30004, 13, 13519, 353, 3300, 29889, 29887, 3746, 30004, 13, 1022, 2878, 29879, 353, 3300, 29889, 1022, 2878, 29879, 30004, 13, 30004, 13, 2158, 703, 4189, 2328, 17435, 5323, 2827, 7370, 4866, 4189, 2328, 17435, 1159, 30004, 13, 2158, 703, 26915, 29901, 1159, 30004, 13, 2158, 703, 848, 4516, 29901, 9162, 3300, 29889, 1272, 29918, 3972, 8443, 13, 2158, 703, 4078, 2224, 29901, 9162, 3300, 29889, 7620, 29918, 3972, 8443, 13, 2158, 703, 6509, 6554, 29901, 9162, 3300, 29889, 21891, 29918, 10492, 8443, 13, 2158, 703, 3829, 29901, 9162, 3300, 29889, 1279, 8443, 13, 2158, 703, 5768, 449, 29901, 9162, 3300, 29889, 8865, 449, 8443, 13, 2158, 703, 7934, 7546, 29901, 9162, 3300, 29889, 10892, 29918, 348, 1169, 8443, 13, 2158, 703, 3081, 29901, 9162, 3300, 29889, 29887, 3746, 8443, 13, 2158, 703, 21502, 305, 29901, 9162, 3300, 29889, 1022, 2878, 29879, 8443, 13, 2158, 703, 1159, 30004, 13, 30004, 13, 29937, 16012, 2448, 3631, 3564, 30004, 13, 2158, 703, 23456, 3630, 2683, 2683, 5634, 1159, 30004, 13, 14968, 12657, 29892, 325, 29918, 12657, 29892, 1243, 12657, 29892, 7945, 29918, 1272, 353, 302, 29876, 13239, 29906, 29889, 1359, 29918, 1272, 29898, 3062, 8443, 13, 2158, 703, 1469, 4309, 11932, 2683, 2683, 5634, 1159, 30004, 13, 2158, 703, 1159, 30004, 13, 30004, 13, 29937, 3789, 786, 2448, 3631, 3564, 30004, 13, 2158, 703, 29020, 2448, 3631, 8527, 2683, 1378, 29899, 1159, 30004, 13, 4299, 29892, 5994, 3950, 29892, 28770, 291, 353, 302, 29876, 13239, 29906, 29889, 15755, 29918, 14669, 29898, 23905, 29892, 8865, 449, 29892, 10892, 29918, 13148, 29896, 29892, 29212, 29892, 13519, 8443, 13, 2158, 703, 8139, 3631, 8527, 3789, 2683, 9072, 29899, 1159, 30004, 13, 2158, 703, 1159, 30004, 13, 30004, 13, 29937, 28186, 2448, 3631, 3564, 30004, 13, 2158, 703, 5323, 2827, 2448, 3631, 8527, 2683, 1378, 1159, 30004, 13, 15755, 13239, 29906, 29889, 14968, 29918, 11618, 29898, 4299, 29892, 5994, 3950, 29892, 28770, 291, 29892, 21502, 12168, 29892, 29871, 29906, 29900, 29892, 7945, 12657, 29892, 3081, 8443, 13, 2158, 703, 8139, 3631, 8527, 3201, 1312, 2683, 1378, 1159, 30004, 13, 2158, 703, 1159, 30004, 13, 30004, 13, 29937, 16913, 30004, 13, 2158, 703, 29903, 5555, 2448, 3631, 8527, 2683, 1378, 1159, 30004, 13, 15755, 13239, 29906, 29889, 7620, 29918, 3198, 3149, 29898, 4299, 29892, 14968, 29918, 1272, 29892, 2224, 29892, 23905, 29892, 10892, 29918, 13148, 29896, 29892, 8865, 449, 29892, 29212, 8443, 13, 2158, 703, 8139, 3631, 8527, 9583, 287, 2683, 1378, 29899, 1159, 30004, 13, 2158, 703, 1159, 30004, 13, 30004, 13, 30004, 13, 29937, 2254, 29918, 1272, 30004, 13, 2158, 703, 5896, 2448, 3631, 8527, 2683, 1378, 29899, 1159, 30004, 13, 15755, 13239, 29906, 29889, 1359, 29918, 3198, 3149, 29898, 2084, 8443, 13, 2158, 26471, 13, 2158, 26471, 13, 2158, 703, 4189, 2328, 17435, 5323, 2827, 4866, 4189, 2328, 17435, 1159, 30004, 13, 2 ]
lilac/__init__.py
mba811/lilac
1
46836
<filename>lilac/__init__.py # coding=utf8 # # OOO$QHHHQ$$$$$$$$$QQQHHHHNHHHNNNNNNNNNNN # OO$$QHHNHQ$$$$$O$$$QQQHHHNNHHHNNNNNNMNNN # $$$QQHHHH$$$OOO$$$$QQQQHHHHHHHNHNNNMNNNN # HHQQQHHH--:!OOO$$$QQQQQQQHHHHHNNNNNNNNNN # NNNHQHQ-;-:-:O$$$$$QQQ$QQQQHHHHNNNNNNNNN # NMNHHQ;-;----:$$$$$$$:::OQHHHHHNNNNHHNNN # NNNHH;;;-----:C$$$$$::----::-::>NNNNNNNN # NNHHQ:;;--:---:$$$$$:::--;;;;;-HNNNNNNNN # HHQQQ:-;-----:--$$$7::-;;;.;.;;HNNMMNNNH # QQQ$Q>-:---:----Q$$!!:;;;...;;QHNMMMNNHH # $$$$$$$:::-:--:!7Q$!:::::;;;;OQHMMMNNHHH # OOO$$$$O:!--:!:-7HQ>:!---.-;7O$HMMMNHHHQ # OOOOOO$OO:::!:!!>N7!7:!-.;:;CC$HMMMNNQQQ # OOOOOOOOOO!::>7C!N>!!C-!7--O?COHMMMNNQQQ # OOOO?7?OOOO!!!!:CH7>7>7--:QC??OC>NMNNHQQ # OOOO?>>>>COO!>?!7H?O>!:::H$:-;---:!ONHHH # OOOO?7>>>>!>?7!>>$O>QOC?N7;;;..;;;;-!NNN # COCC77>>>>!!>7>!>?7C7!>O:;;-.;..-----!MM # OCCC>>>>!!!!7>>O?OOOO>!!;-;-..;.;;;;-:CN # OOCC!!!!!!!>>!>7COCC$C7>->-;:;.;;;;;;-:M # CCOO7::!!!!!!!!CCOOC$?7::-;-:;;;;-----:7 # OOOQH!-!!!!!!!>C7$OC7?!:-;!;-----;---::O # CO$QNN7:!>!!!!!!>?CC$7C!!?CC?CO$$7---->N # CO$QHNNNO7>!!>O?C??!7C>!---7CO$QOOQHHHHN # OO$HHNNNNNNNNNNCCO?!!!------7$QQOO$QQQQH # O$QHHNNMNNNNNNNQO$C!!!:----::QQ$OCOQQ$QQ # $QHQHHNMMMMNNNNQQ$C>!::------QQ$OCO$$$$$ # QHHHHNNMMNHHHHHQQQQQ7!!:-----?Q$$OO$$$O$ # HHQQHHNNH$$$$$$QQHHHH$>!:--::7QQ$OOO$OOO # $$$QQQHQ$OCO$O$QQ$QQQ$$C!::::$HQ$OOO$OOO # OOO$$QQ$OCCOOOOQO$$$$$OC>!!:?HHQ$OO$$OOO # OCCO$Q$$OOO77>>7CO$$OOOOOCQQHQQQ$$O$$$$O # # lilac - a static blog generator. # https://github.com/hit9/lilac # nz2324 AT 126.com """global vars""" version = "0.3.9" charset = "utf8" # utf8 read and write everywhere src_ext = ".md" # source filename extension out_ext = ".html" # output filename extension src_dir = "src" # source directory, './src' out_dir = "." # output directory, './'
[ 1, 529, 9507, 29958, 29880, 309, 562, 29914, 1649, 2344, 26914, 2272, 13, 29937, 14137, 29922, 9420, 29947, 13, 29937, 13, 29937, 438, 29949, 29949, 29938, 29984, 27590, 29950, 29984, 3997, 3997, 3997, 3997, 29938, 29984, 29984, 29984, 27590, 27590, 29940, 27590, 29950, 10262, 10262, 10262, 10262, 10262, 29940, 13, 29937, 438, 29949, 3997, 29984, 27590, 29940, 29950, 29984, 3997, 3997, 29938, 29949, 3997, 29938, 29984, 29984, 29984, 27590, 29950, 10262, 27590, 29950, 10262, 10262, 10262, 29924, 10262, 29940, 13, 29937, 2046, 29938, 29984, 29984, 27590, 27590, 3997, 29938, 29949, 29949, 29949, 3997, 3997, 29984, 29984, 29984, 29984, 27590, 27590, 27590, 29950, 29940, 29950, 10262, 29940, 29924, 10262, 10262, 13, 29937, 379, 29950, 29984, 29984, 29984, 27590, 29950, 489, 29901, 29991, 29949, 29949, 29949, 3997, 29938, 29984, 29984, 29984, 29984, 29984, 29984, 29984, 27590, 27590, 29950, 10262, 10262, 10262, 10262, 10262, 13, 29937, 405, 10262, 29950, 29984, 29950, 29984, 29899, 29936, 29899, 13018, 29901, 29949, 3997, 3997, 29938, 29984, 29984, 29984, 29938, 29984, 29984, 29984, 29984, 27590, 27590, 10262, 10262, 10262, 10262, 29940, 13, 29937, 405, 29924, 29940, 27590, 29984, 29936, 29899, 29936, 807, 29901, 3997, 3997, 3997, 29938, 1057, 29901, 29949, 29984, 27590, 27590, 29950, 10262, 10262, 27590, 10262, 29940, 13, 29937, 405, 10262, 27590, 7859, 29936, 23648, 29901, 29907, 3997, 3997, 29938, 1057, 807, 1057, 29899, 1057, 29958, 10262, 10262, 10262, 10262, 13, 29937, 405, 29940, 27590, 29984, 29901, 7859, 489, 29901, 5634, 29901, 3997, 3997, 29938, 1057, 20296, 19603, 29936, 29899, 29950, 10262, 10262, 10262, 10262, 13, 29937, 379, 29950, 29984, 29984, 29984, 13018, 29936, 23648, 20296, 3997, 29938, 29955, 1057, 29899, 7859, 29936, 8670, 29889, 7859, 29950, 10262, 7428, 10262, 29940, 29950, 13, 29937, 660, 29984, 29984, 29938, 29984, 29958, 29899, 29901, 5634, 29901, 807, 29984, 3997, 6824, 29901, 7859, 29936, 856, 7859, 29984, 29950, 29940, 7428, 29924, 10262, 27590, 13, 29937, 2046, 3997, 3997, 29938, 1057, 13018, 20296, 29901, 29991, 29955, 29984, 29938, 29991, 1057, 1057, 29901, 19603, 29949, 29984, 29950, 7428, 29924, 10262, 27590, 29950, 13, 29937, 438, 29949, 29949, 3997, 3997, 29949, 29901, 6172, 29901, 29991, 13018, 29955, 29950, 29984, 23917, 29991, 5634, 9229, 29936, 29955, 29949, 29938, 29950, 7428, 29924, 29940, 27590, 29950, 29984, 13, 29937, 438, 29949, 29949, 29949, 29949, 29949, 29938, 29949, 29949, 1057, 29901, 29991, 29901, 6824, 29958, 29940, 29955, 29991, 29955, 29901, 29991, 29899, 8670, 29901, 29936, 4174, 29938, 29950, 7428, 29924, 10262, 29984, 29984, 29984, 13, 29937, 438, 29949, 29949, 29949, 29949, 29949, 29949, 29949, 29949, 29949, 29991, 1057, 29958, 29955, 29907, 29991, 29940, 29958, 6824, 29907, 29899, 29991, 29955, 489, 29949, 29973, 3217, 29950, 7428, 29924, 10262, 29984, 29984, 29984, 13, 29937, 438, 29949, 29949, 29949, 29973, 29955, 29973, 29949, 29949, 29949, 29949, 6824, 6824, 29901, 3210, 29955, 29958, 29955, 29958, 29955, 489, 29901, 29984, 29907, 8773, 20166, 29958, 29940, 29924, 10262, 29950, 29984, 29984, 13, 29937, 438, 29949, 29949, 29949, 29973, 6778, 6778, 3217, 29949, 29991, 29958, 29973, 29991, 29955, 29950, 29973, 29949, 29958, 29991, 1057, 29901, 29950, 29938, 13018, 29936, 5634, 29901, 29991, 1164, 27590, 29950, 13, 29937, 438, 29949, 29949, 29949, 29973, 29955, 6778, 6778, 29991, 29958, 29973, 29955, 29991, 6778, 29938, 29949, 29958, 29984, 20166, 29973, 29940, 29955, 7859, 29936, 636, 19603, 29899, 29991, 10262, 29940, 13, 29937, 4810, 4174, 29955, 29955, 6778, 6778, 6824, 29958, 29955, 29958, 29991, 29958, 29973, 29955, 29907, 29955, 29991, 29958, 29949, 29901, 7859, 29899, 8670, 636, 23648, 29991, 7428, 13, 29937, 438, 4174, 29907, 6778, 6778, 6824, 6824, 29955, 6778, 29949, 29973, 29949, 29949, 29949, 29949, 29958, 6824, 29936, 29899, 29936, 29899, 636, 29936, 29889, 19603, 29899, 29901, 13778, 13, 29937, 438, 29949, 4174, 6824, 6824, 21004, 6778, 29991, 29958, 29955, 3217, 4174, 29938, 29907, 29955, 29958, 976, 29899, 29936, 29901, 29936, 29889, 19603, 7859, 29899, 29901, 29924, 13, 29937, 315, 3217, 29949, 29955, 1057, 6824, 6824, 6824, 6824, 29907, 3217, 20166, 15485, 29955, 1057, 29899, 29936, 29899, 29901, 19603, 23648, 29901, 29955, 13, 29937, 438, 29949, 29949, 29984, 29950, 29991, 29899, 6824, 6824, 21004, 29958, 29907, 29955, 29938, 20166, 29955, 29973, 29991, 13018, 29936, 29991, 29936, 23648, 29936, 5634, 1057, 29949, 13, 29937, 4810, 29938, 29984, 10262, 29955, 29901, 29991, 29958, 6824, 6824, 6824, 29958, 29973, 4174, 29938, 29955, 29907, 6824, 29973, 4174, 29973, 3217, 3997, 29955, 807, 29958, 29940, 13, 29937, 4810, 29938, 29984, 29950, 10262, 6632, 29955, 29958, 6824, 29958, 29949, 29973, 29907, 8773, 29991, 29955, 29907, 29958, 29991, 5634, 29955, 3217, 29938, 29984, 29949, 29949, 29984, 27590, 27590, 29940, 13, 29937, 438, 29949, 29938, 27590, 10262, 10262, 10262, 10262, 10262, 29907, 3217, 29973, 21004, 22158, 29955, 29938, 29984, 29984, 29949, 29949, 29938, 29984, 29984, 29984, 29984, 29950, 13, 29937, 438, 29938, 29984, 27590, 10262, 29924, 10262, 10262, 10262, 29940, 29984, 29949, 29938, 29907, 21004, 29901, 807, 1057, 29984, 29984, 29938, 29949, 3217, 29984, 29984, 29938, 29984, 29984, 13, 29937, 395, 29984, 29950, 29984, 27590, 29940, 7428, 7428, 10262, 10262, 29984, 29984, 29938, 29907, 29958, 29991, 1057, 22158, 29984, 29984, 29938, 29949, 3217, 3997, 3997, 29938, 13, 29937, 660, 27590, 27590, 10262, 7428, 29940, 27590, 27590, 29950, 29984, 29984, 29984, 29984, 29984, 29955, 6824, 29901, 23648, 29973, 29984, 3997, 29949, 29949, 3997, 29938, 29949, 29938, 13, 29937, 379, 29950, 29984, 29984, 27590, 10262, 29950, 3997, 3997, 3997, 29984, 29984, 27590, 27590, 29938, 29958, 29991, 20296, 1057, 29955, 29984, 29984, 29938, 29949, 29949, 29949, 29938, 29949, 29949, 29949, 13, 29937, 2046, 29938, 29984, 29984, 29984, 29950, 29984, 29938, 29949, 3217, 29938, 29949, 29938, 29984, 29984, 29938, 29984, 29984, 29984, 3997, 29907, 29991, 1057, 1057, 29938, 29950, 29984, 29938, 29949, 29949, 29949, 29938, 29949, 29949, 29949, 13, 29937, 438, 29949, 29949, 3997, 29984, 29984, 29938, 20166, 3217, 29949, 29949, 29949, 29984, 29949, 3997, 3997, 29938, 20166, 29958, 6824, 29901, 29973, 27590, 29984, 29938, 29949, 29949, 3997, 29949, 29949, 29949, 13, 29937, 438, 29907, 3217, 29938, 29984, 3997, 29949, 29949, 29949, 29955, 29955, 6778, 29955, 3217, 3997, 29949, 29949, 29949, 29949, 20166, 29984, 29984, 29950, 29984, 29984, 29984, 3997, 29949, 3997, 3997, 29949, 13, 29937, 13, 29937, 301, 309, 562, 448, 263, 2294, 12618, 15299, 29889, 13, 29937, 2045, 597, 3292, 29889, 510, 29914, 27342, 29929, 29914, 29880, 309, 562, 13, 29937, 302, 29920, 29906, 29941, 29906, 29946, 15531, 29871, 29896, 29906, 29953, 29889, 510, 13, 13, 15945, 29908, 10945, 24987, 15945, 29908, 13, 13, 3259, 353, 376, 29900, 29889, 29941, 29889, 29929, 29908, 13, 3090, 842, 353, 376, 9420, 29947, 29908, 29871, 396, 23616, 29947, 1303, 322, 2436, 16978, 13, 4351, 29918, 1062, 353, 11393, 3487, 29908, 259, 396, 2752, 10422, 6081, 13, 449, 29918, 1062, 353, 11393, 1420, 29908, 396, 1962, 10422, 6081, 13, 4351, 29918, 3972, 353, 376, 4351, 29908, 259, 396, 2752, 3884, 29892, 19283, 4351, 29915, 13, 449, 29918, 3972, 353, 376, 1213, 29871, 396, 1962, 3884, 29892, 19283, 29915, 13, 2 ]
examples/utils/interaction.py
epuzanov/pivy
29
18475
import sys from PySide2.QtWidgets import QApplication from PySide2.QtGui import QColor from pivy import quarter, coin, graphics, utils class ConnectionMarker(graphics.Marker): def __init__(self, points): super(ConnectionMarker, self).__init__(points, True) class ConnectionPolygon(graphics.Polygon): std_col = "green" def __init__(self, markers): super(ConnectionPolygon, self).__init__( sum([m.points for m in markers], []), True) self.markers = markers for m in self.markers: m.on_drag.append(self.update_polygon) def update_polygon(self): self.points = sum([m.points for m in self.markers], []) @property def drag_objects(self): return self.markers def check_dependency(self): if any([m._delete for m in self.markers]): self.delete() class ConnectionLine(graphics.Line): def __init__(self, markers): super(ConnectionLine, self).__init__( sum([m.points for m in markers], []), True) self.markers = markers for m in self.markers: m.on_drag.append(self.update_line) def update_line(self): self.points = sum([m.points for m in self.markers], []) @property def drag_objects(self): return self.markers def check_dependency(self): if any([m._delete for m in self.markers]): self.delete() def main(): app = QApplication(sys.argv) utils.addMarkerFromSvg("test.svg", "CUSTOM_MARKER", 40) viewer = quarter.QuarterWidget() root = graphics.InteractionSeparator(viewer.sorendermanager) root.pick_radius = 40 m1 = ConnectionMarker([[-1, -1, -1]]) m2 = ConnectionMarker([[-1, 1, -1]]) m3 = ConnectionMarker([[ 1, 1, -1]]) m4 = ConnectionMarker([[ 1, -1, -1]]) m5 = ConnectionMarker([[-1, -1, 1]]) m6 = ConnectionMarker([[-1, 1, 1]]) m7 = ConnectionMarker([[ 1, 1, 1]]) m8 = ConnectionMarker([[ 1, -1, 1]]) points = [m1, m2, m3, m4, m5, m6, m7, m8] l01 = ConnectionLine([m1, m2]) l02 = ConnectionLine([m2, m3]) l03 = ConnectionLine([m3, m4]) l04 = ConnectionLine([m4, m1]) l05 = ConnectionLine([m5, m6]) l06 = ConnectionLine([m6, m7]) l07 = ConnectionLine([m7, m8]) l08 = ConnectionLine([m8, m5]) l09 = ConnectionLine([m1, m5]) l10 = ConnectionLine([m2, m6]) l11 = ConnectionLine([m3, m7]) l12 = ConnectionLine([m4, m8]) lines = [l01, l02, l03, l04, l05, l06, l07, l08, l09, l10, l11, l12] p1 = ConnectionPolygon([m1, m2, m3, m4]) p2 = ConnectionPolygon([m8, m7, m6, m5]) p3 = ConnectionPolygon([m5, m6, m2, m1]) p4 = ConnectionPolygon([m6, m7, m3, m2]) p5 = ConnectionPolygon([m7, m8, m4, m3]) p6 = ConnectionPolygon([m8, m5, m1, m4]) polygons = [p1, p2, p3, p4, p5, p6] root += points + lines + polygons root.register() viewer.setSceneGraph(root) viewer.setBackgroundColor(QColor(255, 255, 255)) viewer.setWindowTitle("minimal") viewer.show() sys.exit(app.exec_()) if __name__ == '__main__': main()
[ 1, 1053, 10876, 13, 3166, 10772, 23908, 29906, 29889, 17303, 8801, 29879, 1053, 660, 4873, 13, 3166, 10772, 23908, 29906, 29889, 17303, 28707, 1053, 660, 3306, 13, 3166, 282, 440, 29891, 1053, 12616, 29892, 19480, 29892, 18533, 29892, 3667, 29879, 13, 13, 1990, 15160, 24619, 29898, 6420, 29889, 24619, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3291, 1125, 13, 4706, 2428, 29898, 5350, 24619, 29892, 1583, 467, 1649, 2344, 12035, 9748, 29892, 5852, 29897, 13, 13, 13, 1990, 15160, 7713, 17125, 29898, 6420, 29889, 7713, 17125, 1125, 13, 1678, 3659, 29918, 1054, 353, 376, 12692, 29908, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 29320, 1125, 13, 4706, 2428, 29898, 5350, 7713, 17125, 29892, 1583, 467, 1649, 2344, 12035, 13, 9651, 2533, 4197, 29885, 29889, 9748, 363, 286, 297, 29320, 1402, 5159, 511, 5852, 29897, 13, 4706, 1583, 29889, 3502, 414, 353, 29320, 13, 13, 4706, 363, 286, 297, 1583, 29889, 3502, 414, 29901, 13, 9651, 286, 29889, 265, 29918, 20515, 29889, 4397, 29898, 1311, 29889, 5504, 29918, 3733, 17125, 29897, 13, 13, 1678, 822, 2767, 29918, 3733, 17125, 29898, 1311, 1125, 13, 4706, 1583, 29889, 9748, 353, 2533, 4197, 29885, 29889, 9748, 363, 286, 297, 1583, 29889, 3502, 414, 1402, 518, 2314, 13, 13, 1678, 732, 6799, 13, 1678, 822, 8338, 29918, 12650, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 3502, 414, 13, 13, 1678, 822, 1423, 29918, 10836, 29898, 1311, 1125, 13, 4706, 565, 738, 4197, 29885, 3032, 8143, 363, 286, 297, 1583, 29889, 3502, 414, 29962, 1125, 13, 9651, 1583, 29889, 8143, 580, 13, 13, 13, 1990, 15160, 3542, 29898, 6420, 29889, 3542, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 29320, 1125, 13, 4706, 2428, 29898, 5350, 3542, 29892, 1583, 467, 1649, 2344, 12035, 13, 9651, 2533, 4197, 29885, 29889, 9748, 363, 286, 297, 29320, 1402, 5159, 511, 5852, 29897, 13, 4706, 1583, 29889, 3502, 414, 353, 29320, 13, 4706, 363, 286, 297, 1583, 29889, 3502, 414, 29901, 13, 9651, 286, 29889, 265, 29918, 20515, 29889, 4397, 29898, 1311, 29889, 5504, 29918, 1220, 29897, 13, 13, 1678, 822, 2767, 29918, 1220, 29898, 1311, 1125, 13, 4706, 1583, 29889, 9748, 353, 2533, 4197, 29885, 29889, 9748, 363, 286, 297, 1583, 29889, 3502, 414, 1402, 518, 2314, 13, 13, 1678, 732, 6799, 13, 1678, 822, 8338, 29918, 12650, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 3502, 414, 13, 13, 1678, 822, 1423, 29918, 10836, 29898, 1311, 1125, 13, 4706, 565, 738, 4197, 29885, 3032, 8143, 363, 286, 297, 1583, 29889, 3502, 414, 29962, 1125, 13, 9651, 1583, 29889, 8143, 580, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 623, 353, 660, 4873, 29898, 9675, 29889, 19218, 29897, 13, 1678, 3667, 29879, 29889, 1202, 24619, 4591, 29903, 29894, 29887, 703, 1688, 29889, 15120, 613, 376, 29907, 17321, 6488, 29918, 1529, 29934, 29968, 1001, 613, 259, 29946, 29900, 29897, 13, 1678, 6316, 556, 353, 12616, 29889, 2182, 4254, 8801, 580, 13, 1678, 3876, 353, 18533, 29889, 4074, 2467, 2008, 17954, 29898, 29894, 15580, 29889, 29879, 272, 355, 3504, 1875, 29897, 13, 1678, 3876, 29889, 23945, 29918, 13471, 353, 29871, 29946, 29900, 13, 13, 1678, 286, 29896, 353, 15160, 24619, 4197, 14352, 29896, 29892, 448, 29896, 29892, 448, 29896, 24960, 13, 1678, 286, 29906, 353, 15160, 24619, 4197, 14352, 29896, 29892, 259, 29896, 29892, 448, 29896, 24960, 13, 1678, 286, 29941, 353, 15160, 24619, 4197, 29961, 29871, 29896, 29892, 259, 29896, 29892, 448, 29896, 24960, 13, 1678, 286, 29946, 353, 15160, 24619, 4197, 29961, 29871, 29896, 29892, 448, 29896, 29892, 448, 29896, 24960, 13, 13, 1678, 286, 29945, 353, 15160, 24619, 4197, 14352, 29896, 29892, 448, 29896, 29892, 259, 29896, 24960, 13, 1678, 286, 29953, 353, 15160, 24619, 4197, 14352, 29896, 29892, 259, 29896, 29892, 259, 29896, 24960, 13, 1678, 286, 29955, 353, 15160, 24619, 4197, 29961, 29871, 29896, 29892, 259, 29896, 29892, 259, 29896, 24960, 13, 1678, 286, 29947, 353, 15160, 24619, 4197, 29961, 29871, 29896, 29892, 448, 29896, 29892, 259, 29896, 24960, 13, 13, 1678, 3291, 353, 518, 29885, 29896, 29892, 286, 29906, 29892, 286, 29941, 29892, 286, 29946, 29892, 286, 29945, 29892, 286, 29953, 29892, 286, 29955, 29892, 286, 29947, 29962, 13, 13, 1678, 301, 29900, 29896, 353, 15160, 3542, 4197, 29885, 29896, 29892, 286, 29906, 2314, 13, 1678, 301, 29900, 29906, 353, 15160, 3542, 4197, 29885, 29906, 29892, 286, 29941, 2314, 13, 1678, 301, 29900, 29941, 353, 15160, 3542, 4197, 29885, 29941, 29892, 286, 29946, 2314, 13, 1678, 301, 29900, 29946, 353, 15160, 3542, 4197, 29885, 29946, 29892, 286, 29896, 2314, 13, 13, 1678, 301, 29900, 29945, 353, 15160, 3542, 4197, 29885, 29945, 29892, 286, 29953, 2314, 13, 1678, 301, 29900, 29953, 353, 15160, 3542, 4197, 29885, 29953, 29892, 286, 29955, 2314, 13, 1678, 301, 29900, 29955, 353, 15160, 3542, 4197, 29885, 29955, 29892, 286, 29947, 2314, 13, 1678, 301, 29900, 29947, 353, 15160, 3542, 4197, 29885, 29947, 29892, 286, 29945, 2314, 13, 13, 1678, 301, 29900, 29929, 353, 15160, 3542, 4197, 29885, 29896, 29892, 286, 29945, 2314, 13, 1678, 301, 29896, 29900, 353, 15160, 3542, 4197, 29885, 29906, 29892, 286, 29953, 2314, 13, 1678, 301, 29896, 29896, 353, 15160, 3542, 4197, 29885, 29941, 29892, 286, 29955, 2314, 13, 1678, 301, 29896, 29906, 353, 15160, 3542, 4197, 29885, 29946, 29892, 286, 29947, 2314, 13, 13, 1678, 3454, 353, 518, 29880, 29900, 29896, 29892, 301, 29900, 29906, 29892, 301, 29900, 29941, 29892, 301, 29900, 29946, 29892, 301, 29900, 29945, 29892, 301, 29900, 29953, 29892, 301, 29900, 29955, 29892, 301, 29900, 29947, 29892, 301, 29900, 29929, 29892, 301, 29896, 29900, 29892, 301, 29896, 29896, 29892, 301, 29896, 29906, 29962, 13, 13, 1678, 282, 29896, 353, 15160, 7713, 17125, 4197, 29885, 29896, 29892, 286, 29906, 29892, 286, 29941, 29892, 286, 29946, 2314, 13, 1678, 282, 29906, 353, 15160, 7713, 17125, 4197, 29885, 29947, 29892, 286, 29955, 29892, 286, 29953, 29892, 286, 29945, 2314, 13, 1678, 282, 29941, 353, 15160, 7713, 17125, 4197, 29885, 29945, 29892, 286, 29953, 29892, 286, 29906, 29892, 286, 29896, 2314, 13, 1678, 282, 29946, 353, 15160, 7713, 17125, 4197, 29885, 29953, 29892, 286, 29955, 29892, 286, 29941, 29892, 286, 29906, 2314, 13, 1678, 282, 29945, 353, 15160, 7713, 17125, 4197, 29885, 29955, 29892, 286, 29947, 29892, 286, 29946, 29892, 286, 29941, 2314, 13, 1678, 282, 29953, 353, 15160, 7713, 17125, 4197, 29885, 29947, 29892, 286, 29945, 29892, 286, 29896, 29892, 286, 29946, 2314, 13, 13, 1678, 1248, 4790, 787, 353, 518, 29886, 29896, 29892, 282, 29906, 29892, 282, 29941, 29892, 282, 29946, 29892, 282, 29945, 29892, 282, 29953, 29962, 13, 1678, 3876, 4619, 3291, 718, 3454, 718, 1248, 4790, 787, 13, 1678, 3876, 29889, 9573, 580, 13, 13, 1678, 6316, 556, 29889, 842, 23472, 9527, 29898, 4632, 29897, 13, 1678, 6316, 556, 29889, 842, 10581, 3306, 29898, 29984, 3306, 29898, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 876, 13, 1678, 6316, 556, 29889, 842, 5907, 7030, 703, 1195, 3039, 1159, 13, 1678, 6316, 556, 29889, 4294, 580, 13, 1678, 10876, 29889, 13322, 29898, 932, 29889, 4258, 29918, 3101, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 13, 2 ]
src/simulator/services/resources/atlas.py
ed741/PathBench
46
2040
from typing import Dict, List from simulator.services.resources.directory import Directory from simulator.services.services import Services class Atlas(Directory): def __init__(self, services: Services, name: str, parent: str, create: bool = False) -> None: super().__init__(services, name, parent, create) if create: metadata: Dict[str, any] = { "next_index": 0, } self._save_metadata(metadata) def append(self, obj: any) -> None: self.save(str(self._get_next_index()), obj) self._increment_index() def load_all(self, max_els: int = float("inf")) -> List[any]: ret: List[any] = [] idx: int = 0 while idx < max_els: obj: any = self.load(str(idx)) if obj: ret.append(obj) idx += 1 else: break return ret def _get_next_index(self) -> int: metadata: Dict[str, any] = self._get_metadata() return metadata["next_index"] def _increment_index(self) -> None: metadata: Dict[str, any] = self._get_metadata() metadata["next_index"] += 1 self._save_metadata(metadata) def _save_metadata(self, metadata: Dict[str, any]) -> None: super().save("metadata", metadata) def _get_metadata(self) -> Dict[str, any]: return super().load("metadata")
[ 1, 515, 19229, 1053, 360, 919, 29892, 2391, 13, 13, 3166, 1027, 9183, 29889, 9916, 29889, 13237, 29889, 12322, 1053, 18862, 13, 3166, 1027, 9183, 29889, 9916, 29889, 9916, 1053, 15538, 13, 13, 13, 1990, 27076, 29898, 9882, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5786, 29901, 15538, 29892, 1024, 29901, 851, 29892, 3847, 29901, 851, 29892, 1653, 29901, 6120, 353, 7700, 29897, 1599, 6213, 29901, 13, 4706, 2428, 2141, 1649, 2344, 12035, 9916, 29892, 1024, 29892, 3847, 29892, 1653, 29897, 13, 13, 4706, 565, 1653, 29901, 13, 9651, 15562, 29901, 360, 919, 29961, 710, 29892, 738, 29962, 353, 426, 13, 18884, 376, 4622, 29918, 2248, 1115, 29871, 29900, 29892, 13, 9651, 500, 13, 9651, 1583, 3032, 7620, 29918, 19635, 29898, 19635, 29897, 13, 13, 1678, 822, 9773, 29898, 1311, 29892, 5446, 29901, 738, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 7620, 29898, 710, 29898, 1311, 3032, 657, 29918, 4622, 29918, 2248, 25739, 5446, 29897, 13, 4706, 1583, 3032, 25629, 29918, 2248, 580, 13, 13, 1678, 822, 2254, 29918, 497, 29898, 1311, 29892, 4236, 29918, 1379, 29901, 938, 353, 5785, 703, 7192, 5783, 1599, 2391, 29961, 1384, 5387, 13, 4706, 3240, 29901, 2391, 29961, 1384, 29962, 353, 5159, 13, 4706, 22645, 29901, 938, 353, 29871, 29900, 13, 13, 4706, 1550, 22645, 529, 4236, 29918, 1379, 29901, 13, 9651, 5446, 29901, 738, 353, 1583, 29889, 1359, 29898, 710, 29898, 13140, 876, 13, 9651, 565, 5446, 29901, 13, 18884, 3240, 29889, 4397, 29898, 5415, 29897, 13, 18884, 22645, 4619, 29871, 29896, 13, 9651, 1683, 29901, 13, 18884, 2867, 13, 13, 4706, 736, 3240, 13, 13, 1678, 822, 903, 657, 29918, 4622, 29918, 2248, 29898, 1311, 29897, 1599, 938, 29901, 13, 4706, 15562, 29901, 360, 919, 29961, 710, 29892, 738, 29962, 353, 1583, 3032, 657, 29918, 19635, 580, 13, 4706, 736, 15562, 3366, 4622, 29918, 2248, 3108, 13, 13, 1678, 822, 903, 25629, 29918, 2248, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 15562, 29901, 360, 919, 29961, 710, 29892, 738, 29962, 353, 1583, 3032, 657, 29918, 19635, 580, 13, 4706, 15562, 3366, 4622, 29918, 2248, 3108, 4619, 29871, 29896, 13, 4706, 1583, 3032, 7620, 29918, 19635, 29898, 19635, 29897, 13, 13, 1678, 822, 903, 7620, 29918, 19635, 29898, 1311, 29892, 15562, 29901, 360, 919, 29961, 710, 29892, 738, 2314, 1599, 6213, 29901, 13, 4706, 2428, 2141, 7620, 703, 19635, 613, 15562, 29897, 13, 13, 1678, 822, 903, 657, 29918, 19635, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 738, 5387, 13, 4706, 736, 2428, 2141, 1359, 703, 19635, 1159, 13, 2 ]
4.13/demo/reqresp/urls.py
1179069501/-
0
140042
from django.urls import re_path from .import views urlpatterns = [ re_path(r'^query/$',views.queryfunc), # re_path(r'^weather/([a-z]+)/(\d{4})/$',views.routerfunc), re_path(r'^weather/(?P<city>[a-z]+)/(?P<year>\d{4})/$',views.routerfunc1), re_path(r'^form/$',views.formfunc), ]
[ 1, 515, 9557, 29889, 26045, 1053, 337, 29918, 2084, 13, 3166, 869, 5215, 8386, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 337, 29918, 2084, 29898, 29878, 29915, 29985, 1972, 13346, 742, 7406, 29889, 1972, 9891, 511, 13, 1678, 396, 337, 29918, 2084, 29898, 29878, 29915, 29985, 705, 1624, 29914, 4197, 29874, 29899, 29920, 10062, 6802, 1194, 29881, 29912, 29946, 1800, 13346, 742, 7406, 29889, 15140, 9891, 511, 13, 1678, 337, 29918, 2084, 29898, 29878, 29915, 29985, 705, 1624, 29914, 10780, 29925, 29966, 12690, 24566, 29874, 29899, 29920, 10062, 6802, 10780, 29925, 29966, 6360, 14247, 29881, 29912, 29946, 1800, 13346, 742, 7406, 29889, 15140, 9891, 29896, 511, 13, 1678, 337, 29918, 2084, 29898, 29878, 29915, 29985, 689, 13346, 742, 7406, 29889, 689, 9891, 511, 13, 29962, 13, 2 ]
salika/urls/city_urls.py
BarisSari/django_crud
0
1606708
from django.conf.urls import url from ..views import (CityListView, CityCreateView, CityDetailView, CityUpdateView, CityDeleteView) from django.contrib.auth.decorators import login_required urlpatterns = [ url(r'^create/$', # NOQA login_required(CityCreateView.as_view()), name="city_create"), url(r'^(?P<pk>\d+)/update/$', login_required(CityUpdateView.as_view()), name="city_update"), url(r'^(?P<pk>\d+)/delete/$', login_required(CityDeleteView.as_view()), name="city_delete"), url(r'^(?P<pk>\d+)/$', CityDetailView.as_view(), name="city_detail"), url(r'^$', CityListView.as_view(), name="city_list"), ]
[ 1, 515, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 3166, 6317, 7406, 1053, 313, 16885, 15660, 29892, 4412, 4391, 1043, 29892, 4412, 16570, 1043, 29892, 13, 462, 268, 4412, 6422, 1043, 29892, 4412, 12498, 1043, 29897, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 19557, 4097, 1053, 6464, 29918, 12403, 13, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 3142, 29898, 29878, 29915, 29985, 3258, 13346, 742, 29871, 396, 11698, 29984, 29909, 13, 4706, 6464, 29918, 12403, 29898, 16885, 4391, 1043, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 12690, 29918, 3258, 4968, 13, 13, 1678, 3142, 29898, 29878, 29915, 29985, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 5504, 13346, 742, 13, 4706, 6464, 29918, 12403, 29898, 16885, 6422, 1043, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 12690, 29918, 5504, 4968, 13, 13, 1678, 3142, 29898, 29878, 29915, 29985, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 8143, 13346, 742, 13, 4706, 6464, 29918, 12403, 29898, 16885, 12498, 1043, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 12690, 29918, 8143, 4968, 13, 13, 1678, 3142, 29898, 29878, 29915, 29985, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 29938, 742, 13, 4706, 4412, 16570, 1043, 29889, 294, 29918, 1493, 3285, 13, 4706, 1024, 543, 12690, 29918, 16432, 4968, 13, 13, 1678, 3142, 29898, 29878, 29915, 29985, 29938, 742, 13, 4706, 4412, 15660, 29889, 294, 29918, 1493, 3285, 13, 4706, 1024, 543, 12690, 29918, 1761, 4968, 13, 29962, 13, 2 ]
simba/ROI_directionality_to_other_animals.py
justinshenk/simba
1
158718
<filename>simba/ROI_directionality_to_other_animals.py from __future__ import division import os from _datetime import datetime import pandas as pd import numpy as np from configparser import ConfigParser, NoOptionError, NoSectionError import glob import cv2 from pylab import cm from simba.rw_dfs import * from simba.drop_bp_cords import * def directing_to_other_animals(inifile): dateTimes = datetime.now().strftime('%Y%m%d%H%M%S') config = ConfigParser() config.read(inifile) noAnimals = config.getint('General settings', 'animal_no') try: wfileType = config.get('General settings', 'workflow_file_type') except NoOptionError: wfileType = 'csv' projectPath = config.get('General settings', 'project_path') csv_dir_in = os.path.join(projectPath, 'csv', 'outlier_corrected_movement_location') csv_dir_out = os.path.join(projectPath, 'csv', 'directionality_dataframes') if not os.path.exists(csv_dir_out): os.makedirs(csv_dir_out) vidInfPath = os.path.join(projectPath, 'logs', 'video_info.csv') vidinfDf = pd.read_csv(vidInfPath) animalIDlist = config.get('Multi animal IDs', 'id_list') if not animalIDlist: animalIDlist = [] for animal in range(noAnimals): animalIDlist.append('Animal_' + str(animal + 1)) multiAnimalStatus = False print('Applying settings for classical tracking...') else: animalIDlist = animalIDlist.split(",") multiAnimalStatus = True print('Applying settings for multi-animal tracking...') x_cols, y_cols, p_cols = getBpNames(inifile) animalBpDict = create_body_part_dictionary(multiAnimalStatus, animalIDlist, noAnimals, x_cols, y_cols, p_cols, []) def line_length(p, q, n, M, coord): Px = np.abs(p[0] - M[0]) Py = np.abs(p[1] - M[1]) Qx = np.abs(q[0] - M[0]) Qy = np.abs(q[1] - M[1]) Nx = np.abs(n[0] - M[0]) Ny = np.abs(n[1] - M[1]) Ph = np.sqrt(Px*Px + Py*Py) Qh = np.sqrt(Qx*Qx + Qy*Qy) Nh = np.sqrt(Nx*Nx + Ny*Ny) if (Nh < Ph and Nh < Qh and Qh < Ph): coord.extend((q[0], q[1])) return True, coord elif (Nh < Ph and Nh < Qh and Ph < Qh): coord.extend((p[0], p[1])) return True, coord else: return False, coord filesFound = glob.glob(csv_dir_in + '/*.' + wfileType) videoCounter = 1 for filePath in filesFound: fileBaseName = os.path.basename(filePath) filename, fileType = os.path.splitext(fileBaseName)[0], os.path.splitext(fileBaseName)[1] print('Analyzing ROI features for ' + filename + '...') currVideoSettings = vidinfDf.loc[vidinfDf['Video'] == filename] fps = float(currVideoSettings['fps']) currDf = read_df(filePath, wfileType) currDf = currDf.fillna(0) currDf = currDf.apply(pd.to_numeric) currDf = currDf.reset_index(drop=True) currDf = currDf.loc[:, ~currDf.columns.str.contains('^Unnamed')] directionalityDict = checkDirectionalityCords(animalBpDict) facingDfcols, directionColheaders, directionColEyeXHeads, directionColEyeYHeads, directionColBpXHeads, directionColBpYHeads = [],[],[],[],[],[] listofListColHeaders = [] ####### CREATE DESTINATION DATAFRAME ############# for animal in directionalityDict.keys(): otherAnimals = animalIDlist.copy() otherAnimals.remove(animal) for otherAnimal in otherAnimals: otherAnimalDictX = animalBpDict[otherAnimal]['X_bps'] currColHeaders = [] for otherAnimalBp in otherAnimalDictX: currBp = otherAnimal + '_' + otherAnimalBp currBp = currBp.replace('_x', '') directionColheaders.append(str(animal) + '_directing_' + currBp) currColHeaders.append(directionColheaders[-1]) directionColEyeXHeads.append(str(animal) + '_directing_' + currBp + '_eye_x') directionColEyeYHeads.append(str(animal) + '_directing_' + currBp + '_eye_y') directionColBpXHeads.append(str(animal) + '_directing_' + currBp + '_bp_x') directionColBpYHeads.append(str(animal) + '_directing_' + currBp + '_bp_y') listofListColHeaders.append(currColHeaders) for col1, col2, col3, col4, col5 in zip(directionColheaders, directionColEyeXHeads, directionColEyeYHeads, directionColBpXHeads, directionColBpYHeads): facingDfcols.extend((col1,col2,col3,col4,col5)) emptyNumpy = np.zeros(shape=(currDf.shape[0],len(facingDfcols))) facingDf = pd.DataFrame(emptyNumpy, columns=facingDfcols) print('Calculating measurements.... say NO to BIG-O! :)!') #### FEATURES COLUMNS AND NUMPY ARRAYS WITH COORDINATES###### frameCounter = 0 for index, row in currDf.iterrows(): for animal in directionalityDict.keys(): otherAnimals = animalIDlist.copy() otherAnimals.remove(animal) p, q, n = ([] for i in range(3)) earLeftXcol, earLeftYcol = directionalityDict[animal]['Ear_left']['X_bps'], directionalityDict[animal]['Ear_left']['Y_bps'] earRightXcol, earRightYcol = directionalityDict[animal]['Ear_right']['X_bps'], directionalityDict[animal]['Ear_right']['Y_bps'] noseXcol, noseYcol = directionalityDict[animal]['Nose']['X_bps'], directionalityDict[animal]['Nose']['Y_bps'] p.extend((row[earLeftXcol], row[earLeftYcol])) q.extend((row[earRightXcol], row[earRightYcol])) n.extend((row[noseXcol], row[noseYcol])) for otherAnimal in otherAnimals: otherAnimalDictX = animalBpDict[otherAnimal]['X_bps'] otherAnimalDictY = animalBpDict[otherAnimal]['Y_bps'] for otherAnimalBpX, otherAnimalBpY in zip(otherAnimalDictX, otherAnimalDictY): currBp = otherAnimal + '_' + otherAnimalBpX currBp = currBp.replace('_x', '') currCol = str(animal) + '_directing_' + str(currBp) m, coord = ([] for i in range(2)) m.extend((row[otherAnimalBpX], row[otherAnimalBpY])) center_facing_check = line_length(p, q, n, m, coord) if center_facing_check[0] == True: x0, y0 = min(center_facing_check[1][0], row[noseXcol]), min(center_facing_check[1][1], row[noseYcol]) deltaX, deltaY = abs((center_facing_check[1][0] - row[noseXcol]) / 2), abs((center_facing_check[1][1] - row[noseYcol]) / 2) Xmid, Ymid = int(x0 + deltaX), int(y0 + deltaY) facingDf.loc[index, currCol + '_eye_x'] = Xmid facingDf.loc[index, currCol + '_eye_y'] = Ymid facingDf.loc[index, currCol + '_bp_x'] = row[otherAnimalBpX] facingDf.loc[index, currCol + '_bp_y'] = row[otherAnimalBpY] if (int(Xmid) != 0 and int(Ymid) != 0): if (int(row[otherAnimalBpX]) != 0 and int(row[otherAnimalBpY]) != 0): facingDf.loc[index, currCol] = 1 if center_facing_check[0] == False: pass frameCounter += 1 print('Analysing frame ' + str(frameCounter) + '/' + str(len(currDf)) + '. Video ' + str(videoCounter) + '/' + str(len(filesFound))) save_df(facingDf, wfileType, os.path.join(csv_dir_out, filename + '.' + wfileType)) videoCounter +=1 print('Summary dataframe statistics saved in project_folder/csv/directionality_dataframes subdirectory.') print('Calculating summary statistics for ' + str(filename) + '...') columnCounter = 0 outputRow, outPutHeaders = [], ['Video'] for animal in directionalityDict.keys(): otherAnimals = animalIDlist.copy() otherAnimals.remove(animal) for otherAnimal in otherAnimals: who2who = listofListColHeaders[columnCounter] outPutHeaders.append(animal + ' directing towards ' + otherAnimal + ' (s)') currDf = facingDf[who2who] summedSeries = currDf.sum(axis=1) frameCount = len(summedSeries[summedSeries > 0]) outputRow.append(round((frameCount/ fps), 2)) columnCounter += 1 outputRow.insert(0, filename) try: outputDf.loc[len(outputDf)] = outputRow except (ValueError, UnboundLocalError): outputDf = pd.DataFrame(columns=[outPutHeaders]) outputDf.loc[len(outputDf)] = outputRow outputDf.to_csv(os.path.join(projectPath, 'logs', 'Direction_data_' + str(dateTimes) + '.csv'), index=False) print('Summary directionality statistics saved in project_folder/logs/' + str('Direction_data_' + str(dateTimes) + '.csv'))
[ 1, 529, 9507, 29958, 3601, 2291, 29914, 1672, 29902, 29918, 20845, 2877, 29918, 517, 29918, 1228, 29918, 11576, 1338, 29889, 2272, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 30004, 13, 5215, 2897, 30004, 13, 3166, 903, 12673, 1053, 12865, 30004, 13, 5215, 11701, 408, 10518, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 3166, 2295, 16680, 1053, 12782, 11726, 29892, 1939, 8375, 2392, 29892, 1939, 13438, 2392, 30004, 13, 5215, 13149, 30004, 13, 5215, 13850, 29906, 30004, 13, 3166, 282, 2904, 370, 1053, 7477, 30004, 13, 3166, 1027, 2291, 29889, 13975, 29918, 29069, 1053, 334, 30004, 13, 3166, 1027, 2291, 29889, 8865, 29918, 25288, 29918, 29883, 4339, 1053, 334, 30004, 13, 30004, 13, 1753, 1513, 292, 29918, 517, 29918, 1228, 29918, 11576, 1338, 29898, 262, 361, 488, 1125, 30004, 13, 1678, 2635, 29164, 353, 12865, 29889, 3707, 2141, 710, 615, 603, 877, 29995, 29979, 29995, 29885, 29995, 29881, 29995, 29950, 29995, 29924, 29995, 29903, 1495, 30004, 13, 1678, 2295, 353, 12782, 11726, 26471, 13, 1678, 2295, 29889, 949, 29898, 262, 361, 488, 8443, 13, 1678, 694, 21645, 1338, 353, 2295, 29889, 657, 524, 877, 15263, 6055, 742, 525, 273, 3039, 29918, 1217, 1495, 30004, 13, 1678, 1018, 29901, 30004, 13, 4706, 281, 1445, 1542, 353, 2295, 29889, 657, 877, 15263, 6055, 742, 525, 1287, 1731, 29918, 1445, 29918, 1853, 1495, 30004, 13, 1678, 5174, 1939, 8375, 2392, 29901, 30004, 13, 4706, 281, 1445, 1542, 353, 525, 7638, 29915, 30004, 13, 1678, 2060, 2605, 353, 2295, 29889, 657, 877, 15263, 6055, 742, 525, 4836, 29918, 2084, 1495, 30004, 13, 1678, 11799, 29918, 3972, 29918, 262, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4836, 2605, 29892, 525, 7638, 742, 525, 449, 4926, 29918, 15728, 287, 29918, 13529, 882, 29918, 5479, 1495, 30004, 13, 1678, 11799, 29918, 3972, 29918, 449, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4836, 2605, 29892, 525, 7638, 742, 525, 20845, 2877, 29918, 1272, 19935, 1495, 30004, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 7638, 29918, 3972, 29918, 449, 1125, 2897, 29889, 29885, 12535, 12935, 29898, 7638, 29918, 3972, 29918, 449, 8443, 13, 1678, 7840, 25433, 2605, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4836, 2605, 29892, 525, 20756, 742, 525, 9641, 29918, 3888, 29889, 7638, 1495, 30004, 13, 1678, 7840, 7192, 29928, 29888, 353, 10518, 29889, 949, 29918, 7638, 29898, 8590, 25433, 2605, 8443, 13, 30004, 13, 1678, 13019, 1367, 1761, 353, 2295, 29889, 657, 877, 15329, 13019, 23481, 742, 525, 333, 29918, 1761, 1495, 30004, 13, 30004, 13, 1678, 565, 451, 13019, 1367, 1761, 29901, 30004, 13, 4706, 13019, 1367, 1761, 353, 5159, 30004, 13, 4706, 363, 13019, 297, 3464, 29898, 1217, 21645, 1338, 1125, 30004, 13, 9651, 13019, 1367, 1761, 29889, 4397, 877, 2744, 3039, 29918, 29915, 718, 851, 29898, 273, 3039, 718, 29871, 29896, 876, 30004, 13, 4706, 2473, 2744, 3039, 5709, 353, 7700, 30004, 13, 4706, 1596, 877, 2052, 5890, 6055, 363, 14499, 23110, 856, 1495, 30004, 13, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 13019, 1367, 1761, 353, 13019, 1367, 1761, 29889, 5451, 28165, 1159, 30004, 13, 4706, 2473, 2744, 3039, 5709, 353, 5852, 30004, 13, 4706, 1596, 877, 2052, 5890, 6055, 363, 2473, 29899, 273, 3039, 23110, 856, 1495, 30004, 13, 30004, 13, 30004, 13, 30004, 13, 1678, 921, 29918, 22724, 29892, 343, 29918, 22724, 29892, 282, 29918, 22724, 353, 679, 29933, 29886, 8659, 29898, 262, 361, 488, 8443, 13, 1678, 13019, 29933, 29886, 21533, 353, 1653, 29918, 2587, 29918, 1595, 29918, 27126, 29898, 9910, 2744, 3039, 5709, 29892, 13019, 1367, 1761, 29892, 694, 21645, 1338, 29892, 921, 29918, 22724, 29892, 343, 29918, 22724, 29892, 282, 29918, 22724, 29892, 518, 2314, 30004, 13, 30004, 13, 30004, 13, 1678, 822, 1196, 29918, 2848, 29898, 29886, 29892, 3855, 29892, 302, 29892, 341, 29892, 29311, 1125, 30004, 13, 4706, 349, 29916, 353, 7442, 29889, 6897, 29898, 29886, 29961, 29900, 29962, 448, 341, 29961, 29900, 2314, 30004, 13, 4706, 10772, 353, 7442, 29889, 6897, 29898, 29886, 29961, 29896, 29962, 448, 341, 29961, 29896, 2314, 30004, 13, 4706, 660, 29916, 353, 7442, 29889, 6897, 29898, 29939, 29961, 29900, 29962, 448, 341, 29961, 29900, 2314, 30004, 13, 4706, 660, 29891, 353, 7442, 29889, 6897, 29898, 29939, 29961, 29896, 29962, 448, 341, 29961, 29896, 2314, 30004, 13, 4706, 405, 29916, 353, 7442, 29889, 6897, 29898, 29876, 29961, 29900, 29962, 448, 341, 29961, 29900, 2314, 30004, 13, 4706, 16693, 353, 7442, 29889, 6897, 29898, 29876, 29961, 29896, 29962, 448, 341, 29961, 29896, 2314, 30004, 13, 4706, 1963, 353, 7442, 29889, 3676, 29898, 29925, 29916, 29930, 29925, 29916, 718, 10772, 29930, 19737, 8443, 13, 4706, 660, 29882, 353, 7442, 29889, 3676, 29898, 29984, 29916, 29930, 29984, 29916, 718, 660, 29891, 29930, 29984, 29891, 8443, 13, 4706, 405, 29882, 353, 7442, 29889, 3676, 29898, 29940, 29916, 29930, 29940, 29916, 718, 16693, 29930, 29940, 29891, 8443, 13, 4706, 565, 313, 29940, 29882, 529, 1963, 322, 405, 29882, 529, 660, 29882, 322, 660, 29882, 529, 1963, 1125, 30004, 13, 9651, 29311, 29889, 21843, 3552, 29939, 29961, 29900, 1402, 3855, 29961, 29896, 12622, 30004, 13, 9651, 736, 5852, 29892, 29311, 30004, 13, 4706, 25342, 313, 29940, 29882, 529, 1963, 322, 405, 29882, 529, 660, 29882, 322, 1963, 529, 660, 29882, 1125, 30004, 13, 9651, 29311, 29889, 21843, 3552, 29886, 29961, 29900, 1402, 282, 29961, 29896, 12622, 30004, 13, 9651, 736, 5852, 29892, 29311, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 736, 7700, 29892, 29311, 30004, 13, 30004, 13, 1678, 2066, 9692, 353, 13149, 29889, 23705, 29898, 7638, 29918, 3972, 29918, 262, 718, 525, 5515, 6169, 718, 281, 1445, 1542, 8443, 13, 1678, 4863, 17779, 353, 29871, 29896, 30004, 13, 30004, 13, 1678, 363, 934, 2605, 297, 2066, 9692, 29901, 30004, 13, 4706, 934, 5160, 1170, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 1445, 2605, 8443, 13, 4706, 10422, 29892, 934, 1542, 353, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 1445, 5160, 1170, 9601, 29900, 1402, 29871, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 1445, 5160, 1170, 9601, 29896, 29962, 30004, 13, 4706, 1596, 877, 21067, 12339, 292, 16641, 29902, 5680, 363, 525, 718, 10422, 718, 525, 856, 1495, 30004, 13, 4706, 16256, 15167, 9585, 353, 7840, 7192, 29928, 29888, 29889, 2029, 29961, 8590, 7192, 29928, 29888, 1839, 15167, 2033, 1275, 10422, 29962, 30004, 13, 4706, 285, 567, 353, 5785, 29898, 21962, 15167, 9585, 1839, 29888, 567, 2033, 8443, 13, 4706, 16256, 29928, 29888, 353, 1303, 29918, 2176, 29898, 1445, 2605, 29892, 281, 1445, 1542, 8443, 13, 4706, 16256, 29928, 29888, 353, 16256, 29928, 29888, 29889, 5589, 1056, 29898, 29900, 8443, 13, 4706, 16256, 29928, 29888, 353, 16256, 29928, 29888, 29889, 7302, 29898, 15926, 29889, 517, 29918, 21574, 8443, 13, 4706, 16256, 29928, 29888, 353, 16256, 29928, 29888, 29889, 12071, 29918, 2248, 29898, 8865, 29922, 5574, 8443, 13, 4706, 16256, 29928, 29888, 353, 16256, 29928, 29888, 29889, 2029, 7503, 29892, 3695, 21962, 29928, 29888, 29889, 13099, 29889, 710, 29889, 11516, 877, 29985, 2525, 17514, 1495, 29962, 30004, 13, 4706, 5305, 2877, 21533, 353, 1423, 21602, 2877, 29907, 4339, 29898, 273, 3039, 29933, 29886, 21533, 8443, 13, 30004, 13, 4706, 14870, 29928, 29888, 22724, 29892, 5305, 1625, 13662, 29892, 5305, 1625, 29923, 4099, 29990, 5494, 29879, 29892, 5305, 1625, 29923, 4099, 29979, 5494, 29879, 29892, 5305, 1625, 29933, 29886, 29990, 5494, 29879, 29892, 5305, 1625, 29933, 29886, 29979, 5494, 29879, 353, 518, 16272, 16272, 16272, 16272, 1402, 2636, 30004, 13, 4706, 1051, 974, 1293, 1625, 18163, 353, 5159, 30004, 13, 30004, 13, 4706, 835, 4136, 14602, 5012, 1254, 1177, 8098, 27640, 5098, 4717, 2303, 835, 7346, 2277, 30004, 13, 4706, 363, 13019, 297, 5305, 2877, 21533, 29889, 8149, 7295, 30004, 13, 9651, 916, 21645, 1338, 353, 13019, 1367, 1761, 29889, 8552, 26471, 13, 9651, 916, 21645, 1338, 29889, 5992, 29898, 273, 3039, 8443, 13, 9651, 363, 916, 2744, 3039, 297, 916, 21645, 1338, 29901, 30004, 13, 18884, 916, 2744, 3039, 21533, 29990, 353, 13019, 29933, 29886, 21533, 29961, 1228, 2744, 3039, 22322, 29990, 29918, 29890, 567, 2033, 30004, 13, 18884, 16256, 1625, 18163, 353, 5159, 30004, 13, 18884, 363, 916, 2744, 3039, 29933, 29886, 297, 916, 2744, 3039, 21533, 29990, 29901, 30004, 13, 462, 1678, 16256, 29933, 29886, 353, 916, 2744, 3039, 718, 22868, 29915, 718, 916, 2744, 3039, 29933, 29886, 30004, 13, 462, 1678, 16256, 29933, 29886, 353, 16256, 29933, 29886, 29889, 6506, 877, 29918, 29916, 742, 27255, 30004, 13, 462, 1678, 5305, 1625, 13662, 29889, 4397, 29898, 710, 29898, 273, 3039, 29897, 718, 22868, 11851, 292, 29918, 29915, 718, 16256, 29933, 29886, 8443, 13, 462, 1678, 16256, 1625, 18163, 29889, 4397, 29898, 20845, 1625, 13662, 14352, 29896, 2314, 30004, 13, 462, 1678, 5305, 1625, 29923, 4099, 29990, 5494, 29879, 29889, 4397, 29898, 710, 29898, 273, 3039, 29897, 718, 22868, 11851, 292, 29918, 29915, 718, 16256, 29933, 29886, 718, 22868, 1032, 29872, 29918, 29916, 1495, 30004, 13, 462, 1678, 5305, 1625, 29923, 4099, 29979, 5494, 29879, 29889, 4397, 29898, 710, 29898, 273, 3039, 29897, 718, 22868, 11851, 292, 29918, 29915, 718, 16256, 29933, 29886, 718, 22868, 1032, 29872, 29918, 29891, 1495, 30004, 13, 462, 1678, 5305, 1625, 29933, 29886, 29990, 5494, 29879, 29889, 4397, 29898, 710, 29898, 273, 3039, 29897, 718, 22868, 11851, 292, 29918, 29915, 718, 16256, 29933, 29886, 718, 22868, 25288, 29918, 29916, 1495, 30004, 13, 462, 1678, 5305, 1625, 29933, 29886, 29979, 5494, 29879, 29889, 4397, 29898, 710, 29898, 273, 3039, 29897, 718, 22868, 11851, 292, 29918, 29915, 718, 16256, 29933, 29886, 718, 22868, 25288, 29918, 29891, 1495, 30004, 13, 18884, 1051, 974, 1293, 1625, 18163, 29889, 4397, 29898, 21962, 1625, 18163, 8443, 13, 4706, 363, 784, 29896, 29892, 784, 29906, 29892, 784, 29941, 29892, 784, 29946, 29892, 784, 29945, 297, 14319, 29898, 20845, 1625, 13662, 29892, 5305, 1625, 29923, 4099, 29990, 5494, 29879, 29892, 5305, 1625, 29923, 4099, 29979, 5494, 29879, 29892, 5305, 1625, 29933, 29886, 29990, 5494, 29879, 29892, 5305, 1625, 29933, 29886, 29979, 5494, 29879, 1125, 30004, 13, 9651, 14870, 29928, 29888, 22724, 29889, 21843, 3552, 1054, 29896, 29892, 1054, 29906, 29892, 1054, 29941, 29892, 1054, 29946, 29892, 1054, 29945, 876, 30004, 13, 4706, 4069, 8009, 2272, 353, 7442, 29889, 3298, 359, 29898, 12181, 7607, 21962, 29928, 29888, 29889, 12181, 29961, 29900, 1402, 2435, 29898, 29888, 9390, 29928, 29888, 22724, 4961, 30004, 13, 4706, 14870, 29928, 29888, 353, 10518, 29889, 17271, 29898, 6310, 8009, 2272, 29892, 4341, 29922, 29888, 9390, 29928, 29888, 22724, 8443, 13, 30004, 13, 4706, 1596, 877, 27065, 1218, 20398, 3045, 1827, 11698, 304, 350, 6259, 29899, 29949, 29991, 4248, 29991, 1495, 30004, 13, 4706, 3191, 383, 29923, 1299, 11499, 29903, 23958, 5005, 3059, 5300, 405, 29965, 3580, 29979, 9033, 4717, 21554, 22659, 4810, 25593, 1177, 1299, 2890, 4136, 2277, 30004, 13, 4706, 3515, 17779, 353, 29871, 29900, 30004, 13, 4706, 363, 2380, 29892, 1948, 297, 16256, 29928, 29888, 29889, 1524, 5727, 7295, 30004, 13, 9651, 363, 13019, 297, 5305, 2877, 21533, 29889, 8149, 7295, 30004, 13, 18884, 916, 21645, 1338, 353, 13019, 1367, 1761, 29889, 8552, 26471, 13, 18884, 916, 21645, 1338, 29889, 5992, 29898, 273, 3039, 8443, 13, 18884, 282, 29892, 3855, 29892, 302, 353, 313, 2636, 363, 474, 297, 3464, 29898, 29941, 876, 30004, 13, 18884, 2326, 8091, 29990, 1054, 29892, 2326, 8091, 29979, 1054, 353, 5305, 2877, 21533, 29961, 273, 3039, 22322, 29923, 279, 29918, 1563, 16215, 29990, 29918, 29890, 567, 7464, 5305, 2877, 21533, 29961, 273, 3039, 22322, 29923, 279, 29918, 1563, 16215, 29979, 29918, 29890, 567, 2033, 30004, 13, 18884, 2326, 7341, 29990, 1054, 29892, 2326, 7341, 29979, 1054, 353, 5305, 2877, 21533, 29961, 273, 3039, 22322, 29923, 279, 29918, 1266, 16215, 29990, 29918, 29890, 567, 7464, 5305, 2877, 21533, 29961, 273, 3039, 22322, 29923, 279, 29918, 1266, 16215, 29979, 29918, 29890, 567, 2033, 30004, 13, 18884, 26414, 29990, 1054, 29892, 26414, 29979, 1054, 353, 5305, 2877, 21533, 29961, 273, 3039, 22322, 29940, 852, 16215, 29990, 29918, 29890, 567, 7464, 5305, 2877, 21533, 29961, 273, 3039, 22322, 29940, 852, 16215, 29979, 29918, 29890, 567, 2033, 30004, 13, 18884, 282, 29889, 21843, 3552, 798, 29961, 799, 8091, 29990, 1054, 1402, 1948, 29961, 799, 8091, 29979, 1054, 12622, 30004, 13, 18884, 3855, 29889, 21843, 3552, 798, 29961, 799, 7341, 29990, 1054, 1402, 1948, 29961, 799, 7341, 29979, 1054, 12622, 30004, 13, 18884, 302, 29889, 21843, 3552, 798, 29961, 29876, 852, 29990, 1054, 1402, 1948, 29961, 29876, 852, 29979, 1054, 12622, 30004, 13, 18884, 363, 916, 2744, 3039, 297, 916, 21645, 1338, 29901, 30004, 13, 462, 1678, 916, 2744, 3039, 21533, 29990, 353, 13019, 29933, 29886, 21533, 29961, 1228, 2744, 3039, 22322, 29990, 29918, 29890, 567, 2033, 30004, 13, 462, 1678, 916, 2744, 3039, 21533, 29979, 353, 13019, 29933, 29886, 21533, 29961, 1228, 2744, 3039, 22322, 29979, 29918, 29890, 567, 2033, 30004, 13, 462, 1678, 363, 916, 2744, 3039, 29933, 29886, 29990, 29892, 916, 2744, 3039, 29933, 29886, 29979, 297, 14319, 29898, 1228, 2744, 3039, 21533, 29990, 29892, 916, 2744, 3039, 21533, 29979, 1125, 30004, 13, 462, 4706, 16256, 29933, 29886, 353, 916, 2744, 3039, 718, 22868, 29915, 718, 916, 2744, 3039, 29933, 29886, 29990, 30004, 13, 462, 4706, 16256, 29933, 29886, 353, 16256, 29933, 29886, 29889, 6506, 877, 29918, 29916, 742, 27255, 30004, 13, 462, 4706, 16256, 1625, 353, 851, 29898, 273, 3039, 29897, 718, 22868, 11851, 292, 29918, 29915, 718, 851, 29898, 21962, 29933, 29886, 8443, 13, 462, 4706, 286, 29892, 29311, 353, 313, 2636, 363, 474, 297, 3464, 29898, 29906, 876, 30004, 13, 462, 4706, 286, 29889, 21843, 3552, 798, 29961, 1228, 2744, 3039, 29933, 29886, 29990, 1402, 1948, 29961, 1228, 2744, 3039, 29933, 29886, 29979, 12622, 30004, 13, 462, 4706, 4818, 29918, 29888, 9390, 29918, 3198, 353, 1196, 29918, 2848, 29898, 29886, 29892, 3855, 29892, 302, 29892, 286, 29892, 29311, 8443, 13, 462, 4706, 565, 4818, 29918, 29888, 9390, 29918, 3198, 29961, 29900, 29962, 1275, 5852, 29901, 30004, 13, 462, 9651, 921, 29900, 29892, 343, 29900, 353, 1375, 29898, 5064, 29918, 29888, 9390, 29918, 3198, 29961, 29896, 3816, 29900, 1402, 1948, 29961, 29876, 852, 29990, 1054, 11724, 1375, 29898, 5064, 29918, 29888, 9390, 29918, 3198, 29961, 29896, 3816, 29896, 1402, 1948, 29961, 29876, 852, 29979, 1054, 2314, 30004, 13, 462, 9651, 19471, 29990, 29892, 19471, 29979, 353, 6425, 3552, 5064, 29918, 29888, 9390, 29918, 3198, 29961, 29896, 3816, 29900, 29962, 448, 1948, 29961, 29876, 852, 29990, 1054, 2314, 847, 29871, 29906, 511, 6425, 3552, 5064, 29918, 29888, 9390, 29918, 3198, 29961, 29896, 3816, 29896, 29962, 448, 1948, 29961, 29876, 852, 29979, 1054, 2314, 847, 29871, 29906, 8443, 13, 462, 9651, 1060, 6563, 29892, 612, 6563, 353, 938, 29898, 29916, 29900, 718, 19471, 29990, 511, 938, 29898, 29891, 29900, 718, 19471, 29979, 8443, 13, 462, 9651, 14870, 29928, 29888, 29889, 2029, 29961, 2248, 29892, 16256, 1625, 718, 22868, 1032, 29872, 29918, 29916, 2033, 353, 1060, 6563, 30004, 13, 462, 9651, 14870, 29928, 29888, 29889, 2029, 29961, 2248, 29892, 16256, 1625, 718, 22868, 1032, 29872, 29918, 29891, 2033, 353, 612, 6563, 30004, 13, 462, 9651, 14870, 29928, 29888, 29889, 2029, 29961, 2248, 29892, 16256, 1625, 718, 22868, 25288, 29918, 29916, 2033, 353, 1948, 29961, 1228, 2744, 3039, 29933, 29886, 29990, 29962, 30004, 13, 462, 9651, 14870, 29928, 29888, 29889, 2029, 29961, 2248, 29892, 16256, 1625, 718, 22868, 25288, 29918, 29891, 2033, 353, 1948, 29961, 1228, 2744, 3039, 29933, 29886, 29979, 29962, 30004, 13, 462, 9651, 565, 313, 524, 29898, 29990, 6563, 29897, 2804, 29871, 29900, 322, 938, 29898, 29979, 6563, 29897, 2804, 29871, 29900, 1125, 30004, 13, 462, 18884, 565, 313, 524, 29898, 798, 29961, 1228, 2744, 3039, 29933, 29886, 29990, 2314, 2804, 29871, 29900, 322, 938, 29898, 798, 29961, 1228, 2744, 3039, 29933, 29886, 29979, 2314, 2804, 29871, 29900, 1125, 30004, 13, 462, 462, 1678, 14870, 29928, 29888, 29889, 2029, 29961, 2248, 29892, 16256, 1625, 29962, 353, 29871, 29896, 30004, 13, 462, 4706, 565, 4818, 29918, 29888, 9390, 29918, 3198, 29961, 29900, 29962, 1275, 7700, 29901, 30004, 13, 462, 9651, 1209, 30004, 13, 9651, 3515, 17779, 4619, 29871, 29896, 30004, 13, 9651, 1596, 877, 21067, 952, 292, 3515, 525, 718, 851, 29898, 2557, 17779, 29897, 718, 8207, 29915, 718, 851, 29898, 2435, 29898, 21962, 29928, 29888, 876, 718, 15300, 13987, 525, 718, 851, 29898, 9641, 17779, 29897, 718, 8207, 29915, 718, 851, 29898, 2435, 29898, 5325, 9692, 4961, 30004, 13, 30004, 13, 4706, 4078, 29918, 2176, 29898, 29888, 9390, 29928, 29888, 29892, 281, 1445, 1542, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 7638, 29918, 3972, 29918, 449, 29892, 10422, 718, 525, 6169, 718, 281, 1445, 1542, 876, 30004, 13, 4706, 4863, 17779, 4619, 29896, 30004, 13, 4706, 1596, 877, 26289, 12205, 13964, 7160, 297, 2060, 29918, 12083, 29914, 7638, 29914, 20845, 2877, 29918, 1272, 19935, 1014, 12322, 29889, 1495, 30004, 13, 30004, 13, 4706, 1596, 877, 27065, 1218, 15837, 13964, 363, 525, 718, 851, 29898, 9507, 29897, 718, 525, 856, 1495, 30004, 13, 4706, 1897, 17779, 353, 29871, 29900, 30004, 13, 4706, 1962, 4301, 29892, 714, 22908, 18163, 353, 19997, 6024, 15167, 2033, 30004, 13, 4706, 363, 13019, 297, 5305, 2877, 21533, 29889, 8149, 7295, 30004, 13, 9651, 916, 21645, 1338, 353, 13019, 1367, 1761, 29889, 8552, 26471, 13, 9651, 916, 21645, 1338, 29889, 5992, 29898, 273, 3039, 8443, 13, 9651, 363, 916, 2744, 3039, 297, 916, 21645, 1338, 29901, 30004, 13, 18884, 1058, 29906, 15970, 353, 1051, 974, 1293, 1625, 18163, 29961, 4914, 17779, 29962, 30004, 13, 18884, 714, 22908, 18163, 29889, 4397, 29898, 273, 3039, 718, 525, 1513, 292, 7113, 525, 718, 916, 2744, 3039, 718, 525, 313, 29879, 29897, 1495, 30004, 13, 18884, 16256, 29928, 29888, 353, 14870, 29928, 29888, 29961, 15970, 29906, 15970, 29962, 30004, 13, 18884, 2533, 2168, 19204, 353, 16256, 29928, 29888, 29889, 2083, 29898, 8990, 29922, 29896, 8443, 13, 18884, 3515, 3981, 353, 7431, 29898, 2083, 2168, 19204, 29961, 2083, 2168, 19204, 1405, 29871, 29900, 2314, 30004, 13, 18884, 1962, 4301, 29889, 4397, 29898, 14486, 3552, 2557, 3981, 29914, 285, 567, 511, 29871, 29906, 876, 30004, 13, 18884, 1897, 17779, 4619, 29871, 29896, 30004, 13, 4706, 1962, 4301, 29889, 7851, 29898, 29900, 29892, 10422, 8443, 13, 4706, 1018, 29901, 30004, 13, 9651, 1962, 29928, 29888, 29889, 2029, 29961, 2435, 29898, 4905, 29928, 29888, 4638, 353, 1962, 4301, 30004, 13, 4706, 5174, 313, 1917, 2392, 29892, 853, 9917, 7717, 2392, 1125, 30004, 13, 9651, 1962, 29928, 29888, 353, 10518, 29889, 17271, 29898, 13099, 11759, 449, 22908, 18163, 2314, 30004, 13, 9651, 1962, 29928, 29888, 29889, 2029, 29961, 2435, 29898, 4905, 29928, 29888, 4638, 353, 1962, 4301, 30004, 13, 30004, 13, 30004, 13, 1678, 1962, 29928, 29888, 29889, 517, 29918, 7638, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4836, 2605, 29892, 525, 20756, 742, 525, 21602, 29918, 1272, 29918, 29915, 718, 851, 29898, 1256, 29164, 29897, 718, 15300, 7638, 5477, 2380, 29922, 8824, 8443, 13, 1678, 1596, 877, 26289, 5305, 2877, 13964, 7160, 297, 2060, 29918, 12083, 29914, 20756, 22208, 718, 851, 877, 21602, 29918, 1272, 29918, 29915, 718, 851, 29898, 1256, 29164, 29897, 718, 15300, 7638, 8785, 2 ]
ltrc/inicio/views.py
iscenigmax/ltrc-registry
0
84407
<reponame>iscenigmax/ltrc-registry<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render def inicio(request, id=None): # return render(request, 'w2r.html', {'id':id}) return render(request, 'inicio.html', {})
[ 1, 529, 276, 1112, 420, 29958, 275, 10278, 2934, 29916, 29914, 29880, 509, 29883, 29899, 1727, 6020, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 13, 13, 13, 1753, 297, 11088, 29898, 3827, 29892, 1178, 29922, 8516, 1125, 13, 1678, 396, 736, 4050, 29898, 3827, 29892, 525, 29893, 29906, 29878, 29889, 1420, 742, 11117, 333, 2396, 333, 1800, 13, 1678, 736, 4050, 29898, 3827, 29892, 525, 262, 11088, 29889, 1420, 742, 426, 1800, 2 ]
app/files/Archive/calweek - alt.py
aiakobou/Wochenplanung
0
171682
<filename>app/files/Archive/calweek - alt.py #!/usr/bin/env python '''Berechnung der Kalenderwoche''' __author__ = '<NAME>' __version__ = '1.0' __email__ = '<EMAIL>' import datetime def calweek(): while True: KWalternativ = input('KW eingeben oder Enter für folgende KW: ') if len(KWalternativ) < 1: KW = datetime.date.today().isocalendar()[1] +1 break else: try: KW = int(KWalternativ) break except: print('Keine gültige KW. Erneut eingeben') return(KW)
[ 1, 529, 9507, 29958, 932, 29914, 5325, 29914, 13197, 573, 29914, 1052, 18448, 448, 5272, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 12008, 29933, 406, 3049, 686, 589, 9172, 1581, 827, 1173, 12008, 13, 13, 1649, 8921, 1649, 353, 12801, 5813, 16299, 13, 1649, 3259, 1649, 353, 525, 29896, 29889, 29900, 29915, 13, 1649, 5269, 1649, 353, 12801, 26862, 6227, 16299, 13, 13, 5215, 12865, 13, 13, 1753, 1208, 18448, 7295, 13, 13, 1678, 1550, 5852, 29901, 13, 4706, 476, 29956, 26123, 1926, 353, 1881, 877, 29968, 29956, 6867, 5154, 4461, 9041, 1865, 900, 11693, 476, 29956, 29901, 25710, 13, 4706, 565, 7431, 29898, 29968, 29956, 26123, 1926, 29897, 529, 29871, 29896, 29901, 13, 9651, 476, 29956, 353, 12865, 29889, 1256, 29889, 27765, 2141, 275, 18642, 6486, 580, 29961, 29896, 29962, 718, 29896, 13, 9651, 2867, 13, 4706, 1683, 29901, 13, 9651, 1018, 29901, 13, 18884, 476, 29956, 353, 938, 29898, 29968, 29956, 26123, 1926, 29897, 13, 18884, 2867, 13, 9651, 5174, 29901, 13, 18884, 1596, 877, 9598, 457, 330, 12100, 2231, 476, 29956, 29889, 1425, 17821, 6867, 5154, 1495, 13, 1678, 736, 29898, 29968, 29956, 29897, 13, 2 ]
Code/ViloSky/ViloSkyApp/migrations/0002_auto_20210323_1149.py
andrewwu531/Student_Enquiry_AI_Chatbot
0
162188
# Generated by Django 3.1.4 on 2021-03-23 11:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ViloSkyApp', '0001_initial'), ] operations = [ migrations.RenameModel( old_name='RadioButtonsAdminInput', new_name='MultiselectAdminInput', ), migrations.AlterField( model_name='admininput', name='input_type', field=models.CharField(choices=[('DROPDOWN', 'Dropdown'), ('TEXT', 'Text'), ('TEXTAREA', 'Textarea'), ('CHECKBOX', 'Checkbox'), ('MULTISELECT', 'Multiselect')], max_length=255), ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29941, 29889, 29896, 29889, 29946, 373, 29871, 29906, 29900, 29906, 29896, 29899, 29900, 29941, 29899, 29906, 29941, 29871, 29896, 29896, 29901, 29946, 29929, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702, 29963, 7820, 29903, 3459, 2052, 742, 525, 29900, 29900, 29900, 29896, 29918, 11228, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 29934, 3871, 3195, 29898, 13, 9651, 2030, 29918, 978, 2433, 21818, 29819, 787, 12754, 4290, 742, 13, 9651, 716, 29918, 978, 2433, 6857, 895, 781, 12754, 4290, 742, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2499, 357, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 6406, 2080, 742, 13, 9651, 1024, 2433, 2080, 29918, 1853, 742, 13, 9651, 1746, 29922, 9794, 29889, 27890, 29898, 1859, 1575, 11759, 877, 29928, 29366, 3970, 16048, 742, 525, 15063, 3204, 5477, 6702, 16975, 742, 525, 1626, 5477, 6702, 4330, 29990, 6040, 1525, 29909, 742, 525, 1626, 6203, 5477, 6702, 3210, 16658, 8456, 29990, 742, 525, 5596, 1884, 5477, 6702, 29924, 8647, 29902, 6404, 742, 525, 6857, 895, 781, 1495, 1402, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 511, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
python/OSGridConverter/base.py
EdwardBetts/OSGridConverter
6
1601111
''' Created on 27 Jul 2017 @author: julianporter ''' import traceback from numbers import Number import logging class OSGridError(Exception): def __init__(self,message,inner=None): super(OSGridError,self).__init__() self.message='OSGridConverter error: {}'.format(message) self.inner=inner self.traceback=traceback.format_stack() def __str__(self): return self.message def areNumbers(args): return all([isinstance(x,Number) and not isinstance(x,bool) for x in args]) class Log(object): def __init__(self,level=None): self.logger=logging.getLogger() if level: handler=logging.StreamHandler() self.logger.setLevel(level) else: handler=logging.NullHandler() self.logger.addHandler(handler) def debug(self,*args): self.logger.debug(args[0].format(*args[1:])) def info(self,*args): self.logger.info(args[0].format(*args[1:])) def warning(self,*args): self.logger.warning(args[0].format(*args[1:])) def error(self,*args): self.logger.error(args[0].format(*args[1:])) def exception(self,e): self.logger.error('{} {}',e,traceback.format_exc()) log=Log()
[ 1, 14550, 13, 20399, 373, 29871, 29906, 29955, 2739, 29871, 29906, 29900, 29896, 29955, 13, 13, 29992, 8921, 29901, 5757, 713, 18505, 13, 12008, 13, 5215, 9637, 1627, 13, 3166, 3694, 1053, 9681, 13, 5215, 12183, 13, 13, 1990, 6570, 5756, 2392, 29898, 2451, 1125, 13, 268, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4906, 29892, 3993, 29922, 8516, 1125, 13, 4706, 2428, 29898, 3267, 5756, 2392, 29892, 1311, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 4906, 2433, 3267, 5756, 18545, 1059, 29901, 6571, 4286, 4830, 29898, 4906, 29897, 13, 4706, 1583, 29889, 3993, 29922, 3993, 13, 4706, 1583, 29889, 15003, 1627, 29922, 15003, 1627, 29889, 4830, 29918, 1429, 580, 13, 308, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 4906, 13, 268, 13, 1753, 526, 29478, 29898, 5085, 1125, 13, 1678, 736, 599, 4197, 275, 8758, 29898, 29916, 29892, 4557, 29897, 322, 451, 338, 8758, 29898, 29916, 29892, 11227, 29897, 363, 921, 297, 6389, 2314, 13, 13, 1990, 4522, 29898, 3318, 1125, 13, 268, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5563, 29922, 8516, 1125, 13, 4706, 1583, 29889, 21707, 29922, 21027, 29889, 657, 16363, 580, 13, 4706, 565, 3233, 29901, 13, 9651, 7834, 29922, 21027, 29889, 3835, 4598, 580, 13, 9651, 1583, 29889, 21707, 29889, 842, 10108, 29898, 5563, 29897, 13, 4706, 1683, 29901, 13, 9651, 7834, 29922, 21027, 29889, 7327, 4598, 580, 13, 4706, 1583, 29889, 21707, 29889, 1202, 4598, 29898, 13789, 29897, 13, 308, 13, 1678, 822, 4744, 29898, 1311, 29892, 29930, 5085, 1125, 13, 4706, 1583, 29889, 21707, 29889, 8382, 29898, 5085, 29961, 29900, 1822, 4830, 10456, 5085, 29961, 29896, 29901, 12622, 13, 308, 13, 1678, 822, 5235, 29898, 1311, 29892, 29930, 5085, 1125, 13, 4706, 1583, 29889, 21707, 29889, 3888, 29898, 5085, 29961, 29900, 1822, 4830, 10456, 5085, 29961, 29896, 29901, 12622, 13, 308, 13, 1678, 822, 9177, 29898, 1311, 29892, 29930, 5085, 1125, 13, 4706, 1583, 29889, 21707, 29889, 27392, 29898, 5085, 29961, 29900, 1822, 4830, 10456, 5085, 29961, 29896, 29901, 12622, 13, 308, 13, 1678, 822, 1059, 29898, 1311, 29892, 29930, 5085, 1125, 13, 4706, 1583, 29889, 21707, 29889, 2704, 29898, 5085, 29961, 29900, 1822, 4830, 10456, 5085, 29961, 29896, 29901, 12622, 13, 308, 13, 1678, 822, 3682, 29898, 1311, 29892, 29872, 1125, 13, 4706, 1583, 29889, 21707, 29889, 2704, 877, 8875, 6571, 742, 29872, 29892, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 13, 1188, 29922, 3403, 580, 13, 268, 13, 308, 2 ]
algorithmic-toolbox/w4/majority_element/majority_element.py
macsz/coursera-data-structures-and-algorithms
0
78634
<reponame>macsz/coursera-data-structures-and-algorithms # Uses python3 import sys b_print = False def mprint(*args, **kwargs): if b_print: print(*args) def get_majority_element(a, left, right): m = {} for elem in a: mprint('*'*10, elem, '*'*10) try: m[str(elem)] += 1 mprint('exists', m[str(elem)]) except: m[str(elem)] = 1 if m[str(elem)] > len(a)/2: return 1 return -1 if __name__ == '__main__': input = sys.stdin.read() n, *a = list(map(int, input.split())) if get_majority_element(a, 0, n) != -1: print(1) else: print(0)
[ 1, 529, 276, 1112, 420, 29958, 8628, 3616, 29914, 29883, 473, 643, 29874, 29899, 1272, 29899, 4984, 1973, 29899, 392, 29899, 9564, 12404, 13, 29937, 10783, 267, 3017, 29941, 13, 5215, 10876, 13, 13, 29890, 29918, 2158, 353, 7700, 13, 13, 1753, 286, 2158, 10456, 5085, 29892, 3579, 19290, 1125, 13, 1678, 565, 289, 29918, 2158, 29901, 13, 4706, 1596, 10456, 5085, 29897, 13, 13, 1753, 679, 29918, 21355, 537, 29918, 5029, 29898, 29874, 29892, 2175, 29892, 1492, 1125, 13, 1678, 286, 353, 6571, 13, 1678, 363, 21268, 297, 263, 29901, 13, 4706, 286, 2158, 877, 29930, 29915, 29930, 29896, 29900, 29892, 21268, 29892, 525, 29930, 29915, 29930, 29896, 29900, 29897, 13, 4706, 1018, 29901, 13, 9651, 286, 29961, 710, 29898, 20461, 4638, 4619, 29871, 29896, 13, 9651, 286, 2158, 877, 9933, 742, 286, 29961, 710, 29898, 20461, 29897, 2314, 13, 4706, 5174, 29901, 13, 9651, 286, 29961, 710, 29898, 20461, 4638, 353, 29871, 29896, 13, 4706, 565, 286, 29961, 710, 29898, 20461, 4638, 1405, 7431, 29898, 29874, 6802, 29906, 29901, 13, 9651, 736, 29871, 29896, 13, 1678, 736, 448, 29896, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1881, 353, 10876, 29889, 4172, 262, 29889, 949, 580, 13, 1678, 302, 29892, 334, 29874, 353, 1051, 29898, 1958, 29898, 524, 29892, 1881, 29889, 5451, 22130, 13, 1678, 565, 679, 29918, 21355, 537, 29918, 5029, 29898, 29874, 29892, 29871, 29900, 29892, 302, 29897, 2804, 448, 29896, 29901, 13, 4706, 1596, 29898, 29896, 29897, 13, 1678, 1683, 29901, 13, 4706, 1596, 29898, 29900, 29897, 13, 2 ]
meus_modulos/mensagem.py
danielle8farias/Exercicios-Python-3
0
60151
######## # autora: <EMAIL> # repositório: https://github.com/danielle8farias # Descrição: Funções para: # ler e criar um cabeçalho; # criar um rodapé; # criar linha; # ler e validar resposta se deseja continuar # validar recebimento de uma string formada apenas por letras. ######## def ler_cabecalho(msg): ''' recebe uma string e retorna a mesma em caixa alta com espaçamento de 50 caracteres, incluindo a string passada. linha pontilhada em baixo e em cima. ''' print('-'*50) print(f'{msg.upper():^50}') print('-'*50) def criar_rodape(): ''' sem parâmetro retorna a string FIM com espaçamento de 50 caracteres, incluindo a string. linha pontilhada em baixo e em cima. ''' print('-'*50) print(f'{str.upper("fim"):^50}') print('-'*50) def criar_linha(tam=50): ''' sem parâmetro. retorna sinais de = repetidos em 50 caracteres. ''' print() print('-'*tam) print() def ler_resposta(msg): ''' Aceita que o usuário digite apenas S/SIM ou N/Não ''' while True: try: #[0] captura apenas o primeiro caractere da string #strip() remove os espaços no começo e no fim #upper() transforma string em maiúscula #input() captura o que é digitado #atribuindo valor à variável 'resposta' resposta = input(msg).upper().strip()[0] #verifica se não está contido na string 'SN'; # não há conflito, pois 'resposta' captura apenas a posição inicial da string if resposta not in 'SN': #criando exceção raise Exception('S para sim ou N para não') #em caso de resposta vazia; # caso não haja string para pegar a posição inicial except IndexError: print(f'Resposta inválida.') continue #chama a exceção criada #variável 'e' retorna a mensagem da exceção except Exception as erro: #print(f'') retorna uma string formatada na tela print(f'Resposta inválida: {erro}') #volta para o início do laço continue #se o 'try' for válido else: #retorna o valor da resposta return resposta def ler_palavra(msg): ''' Verifica se o que foi digitado foram apenas letras ''' while True: try: palavra = input(msg).upper().strip() #retirando espaços palavras = palavra.split() palavras = ''.join(palavras) #isalpha() se possui apenas letras #verificando se palavra possui caracteres que não sejam letras if not palavras.isalpha(): raise Exception('Digite apenas letras.') except Exception as erro: print(f'Valor inválido: {erro}') continue #se o 'try' for válido else: return palavra
[ 1, 835, 4136, 29937, 13, 29937, 1120, 2207, 29901, 529, 26862, 6227, 29958, 29871, 13, 29937, 17573, 277, 29980, 5378, 29901, 2045, 597, 3292, 29889, 510, 29914, 18386, 11381, 29947, 29888, 20225, 13, 29937, 20355, 2340, 29901, 13811, 5616, 1702, 29901, 13, 29937, 965, 301, 261, 321, 14783, 279, 1922, 27444, 30019, 284, 1251, 29936, 13, 29937, 965, 14783, 279, 1922, 15382, 481, 29948, 29936, 13, 29937, 965, 14783, 279, 6276, 2350, 29936, 13, 29937, 965, 301, 261, 321, 2854, 279, 620, 27363, 409, 553, 29872, 1764, 3133, 279, 13, 29937, 965, 2854, 279, 2414, 29890, 6174, 316, 3672, 1347, 883, 1114, 22321, 1277, 454, 10678, 29889, 13, 7346, 13, 13, 1753, 301, 261, 29918, 29883, 370, 687, 284, 1251, 29898, 7645, 1125, 13, 1678, 14550, 13, 1678, 2414, 915, 3672, 1347, 321, 3240, 272, 1056, 263, 4883, 655, 953, 5777, 19892, 21352, 419, 9015, 30019, 4487, 316, 29871, 29945, 29900, 15215, 267, 29892, 13654, 15036, 263, 1347, 1209, 1114, 29889, 13, 1678, 6276, 2350, 13185, 309, 29882, 1114, 953, 9922, 861, 29877, 321, 953, 274, 2946, 29889, 13, 1678, 14550, 13, 1678, 1596, 877, 29899, 29915, 29930, 29945, 29900, 29897, 13, 1678, 1596, 29898, 29888, 29915, 29912, 7645, 29889, 21064, 7295, 29985, 29945, 29900, 29913, 1495, 13, 1678, 1596, 877, 29899, 29915, 29930, 29945, 29900, 29897, 13, 13, 13, 1753, 14783, 279, 29918, 307, 1388, 412, 7295, 13, 1678, 14550, 13, 1678, 3031, 610, 30057, 27995, 13, 1678, 3240, 272, 1056, 263, 1347, 383, 7833, 419, 9015, 30019, 4487, 316, 29871, 29945, 29900, 15215, 267, 29892, 13654, 15036, 263, 1347, 29889, 13, 1678, 6276, 2350, 13185, 309, 29882, 1114, 953, 9922, 861, 29877, 321, 953, 274, 2946, 29889, 13, 1678, 14550, 13, 1678, 1596, 877, 29899, 29915, 29930, 29945, 29900, 29897, 13, 1678, 1596, 29898, 29888, 29915, 29912, 710, 29889, 21064, 703, 29888, 326, 29908, 1125, 29985, 29945, 29900, 29913, 1495, 13, 1678, 1596, 877, 29899, 29915, 29930, 29945, 29900, 29897, 13, 13, 13, 1753, 14783, 279, 29918, 1915, 2350, 29898, 29873, 314, 29922, 29945, 29900, 1125, 13, 1678, 14550, 13, 1678, 3031, 610, 30057, 27995, 29889, 13, 1678, 3240, 272, 1056, 269, 1099, 275, 316, 353, 21159, 4396, 953, 29871, 29945, 29900, 15215, 267, 29889, 13, 1678, 14550, 13, 1678, 1596, 580, 13, 1678, 1596, 877, 29899, 29915, 29930, 29873, 314, 29897, 13, 1678, 1596, 580, 13, 13, 13, 1753, 301, 261, 29918, 690, 27363, 29898, 7645, 1125, 13, 1678, 14550, 13, 1678, 319, 346, 2028, 712, 288, 502, 29884, 12288, 4697, 568, 22321, 317, 29914, 5425, 29924, 2123, 405, 29914, 29940, 1368, 13, 1678, 14550, 13, 1678, 1550, 5852, 29901, 13, 4706, 1018, 29901, 13, 9651, 14330, 29900, 29962, 4332, 2002, 22321, 288, 19695, 1559, 627, 406, 1146, 1347, 13, 9651, 396, 17010, 580, 3349, 2897, 9015, 16152, 694, 2041, 6102, 321, 694, 285, 326, 13, 9651, 396, 21064, 580, 4327, 29874, 1347, 953, 5530, 30030, 1557, 2497, 13, 9651, 396, 2080, 580, 4332, 2002, 288, 712, 904, 13615, 912, 13, 9651, 396, 271, 7741, 15036, 16497, 818, 1197, 28691, 525, 690, 27363, 29915, 13, 9651, 620, 27363, 353, 1881, 29898, 7645, 467, 21064, 2141, 17010, 580, 29961, 29900, 29962, 13, 9651, 396, 369, 15039, 409, 8145, 7919, 640, 1941, 1055, 1347, 525, 19296, 2670, 13, 9651, 396, 259, 8145, 14859, 18669, 2049, 29892, 772, 275, 525, 690, 27363, 29915, 4332, 2002, 22321, 263, 926, 12556, 24879, 1146, 1347, 13, 9651, 565, 620, 27363, 451, 297, 525, 19296, 2396, 13, 18884, 396, 699, 1743, 429, 346, 2340, 13, 18884, 12020, 8960, 877, 29903, 1702, 1027, 2123, 405, 1702, 8145, 1495, 13, 4706, 396, 331, 11986, 316, 620, 27363, 325, 834, 423, 29936, 29871, 13, 4706, 396, 259, 11986, 8145, 447, 1764, 1347, 1702, 282, 387, 279, 263, 926, 12556, 24879, 13, 4706, 5174, 11374, 2392, 29901, 13, 9651, 1596, 29898, 29888, 29915, 1666, 27363, 2437, 2464, 1458, 29889, 1495, 13, 9651, 6773, 13, 4706, 396, 305, 3304, 263, 429, 346, 2340, 14783, 1114, 13, 4706, 396, 5927, 28691, 525, 29872, 29915, 3240, 272, 1056, 263, 18664, 13904, 1146, 429, 346, 2340, 13, 4706, 5174, 8960, 408, 604, 307, 29901, 13, 9651, 396, 2158, 29898, 29888, 29915, 1495, 3240, 272, 1056, 3672, 1347, 3402, 1114, 1055, 260, 3100, 13, 9651, 1596, 29898, 29888, 29915, 1666, 27363, 2437, 2464, 1458, 29901, 426, 261, 307, 29913, 1495, 13, 9651, 396, 1555, 941, 1702, 288, 297, 24394, 437, 425, 6102, 13, 9651, 6773, 13, 4706, 396, 344, 288, 525, 2202, 29915, 363, 12196, 1941, 13, 4706, 1683, 29901, 13, 9651, 396, 2267, 272, 1056, 288, 16497, 1146, 620, 27363, 13, 9651, 736, 620, 27363, 13, 13, 13, 1753, 301, 261, 29918, 7830, 485, 336, 29898, 7645, 1125, 13, 1678, 14550, 13, 1678, 1798, 15039, 409, 288, 712, 4732, 13615, 912, 15305, 22321, 454, 10678, 13, 1678, 14550, 13, 1678, 1550, 5852, 29901, 13, 4706, 1018, 29901, 13, 9651, 5112, 485, 336, 353, 1881, 29898, 7645, 467, 21064, 2141, 17010, 580, 13, 9651, 396, 2267, 381, 1743, 9015, 16152, 13, 9651, 5112, 485, 3417, 353, 5112, 485, 336, 29889, 5451, 580, 13, 9651, 5112, 485, 3417, 353, 525, 4286, 7122, 29898, 7830, 485, 3417, 29897, 13, 9651, 396, 275, 2312, 580, 409, 3119, 1481, 22321, 454, 10678, 13, 9651, 396, 369, 928, 1743, 409, 5112, 485, 336, 3119, 1481, 15215, 267, 712, 8145, 409, 29926, 314, 454, 10678, 13, 9651, 565, 451, 5112, 485, 3417, 29889, 275, 2312, 7295, 13, 18884, 12020, 8960, 877, 14991, 568, 22321, 454, 10678, 29889, 1495, 13, 4706, 5174, 8960, 408, 604, 307, 29901, 13, 9651, 1596, 29898, 29888, 29915, 1440, 272, 2437, 2464, 1941, 29901, 426, 261, 307, 29913, 1495, 13, 9651, 6773, 13, 4706, 396, 344, 288, 525, 2202, 29915, 363, 12196, 1941, 13, 4706, 1683, 29901, 13, 9651, 736, 5112, 485, 336, 13, 13, 2 ]
compsocsite/polls/migrations/0005_auto_20160502_0301.py
ReedyChen/opra
8
123442
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-05-02 08:01 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('polls', '0004_auto_20160501_1622'), ] operations = [ migrations.CreateModel( name='Response', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('timestamp', models.DateTimeField(verbose_name='response timestamp')), ], ), migrations.RemoveField( model_name='choice', name='item', ), migrations.RemoveField( model_name='item', name='rank', ), migrations.RemoveField( model_name='student', name='preference_dict', ), migrations.AlterField( model_name='keyvaluepair', name='key', field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='polls.Item'), ), migrations.AlterField( model_name='keyvaluepair', name='value', field=models.IntegerField(default=0), ), migrations.DeleteModel( name='Choice', ), migrations.AddField( model_name='response', name='allocation', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Item'), ), migrations.AddField( model_name='response', name='question', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Question'), ), migrations.AddField( model_name='response', name='student', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Student'), ), migrations.AddField( model_name='dictionary', name='response', field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='polls.Response'), ), ]
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 3251, 630, 491, 15337, 29871, 29896, 29889, 29929, 29889, 29945, 373, 29871, 29906, 29900, 29896, 29953, 29899, 29900, 29945, 29899, 29900, 29906, 29871, 29900, 29947, 29901, 29900, 29896, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 5215, 9557, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702, 29886, 3028, 29879, 742, 525, 29900, 29900, 29900, 29946, 29918, 6921, 29918, 29906, 29900, 29896, 29953, 29900, 29945, 29900, 29896, 29918, 29896, 29953, 29906, 29906, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 5103, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 333, 742, 4733, 29889, 12300, 3073, 29898, 6921, 29918, 11600, 29922, 5574, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 29892, 26952, 29918, 978, 2433, 1367, 1495, 511, 13, 18884, 6702, 16394, 742, 4733, 29889, 11384, 3073, 29898, 369, 15828, 29918, 978, 2433, 5327, 14334, 1495, 511, 13, 9651, 21251, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 15941, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 16957, 742, 13, 9651, 1024, 2433, 667, 742, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 15941, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 667, 742, 13, 9651, 1024, 2433, 10003, 742, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 15941, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 18945, 742, 13, 9651, 1024, 2433, 1457, 1659, 29918, 8977, 742, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2499, 357, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 1989, 1767, 18784, 742, 13, 9651, 1024, 2433, 1989, 742, 13, 9651, 1746, 29922, 9794, 29889, 27755, 2558, 29898, 4381, 29922, 8516, 29892, 373, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 304, 2433, 29886, 3028, 29879, 29889, 2001, 5477, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2499, 357, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 1989, 1767, 18784, 742, 13, 9651, 1024, 2433, 1767, 742, 13, 9651, 1746, 29922, 9794, 29889, 7798, 3073, 29898, 4381, 29922, 29900, 511, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 12498, 3195, 29898, 13, 9651, 1024, 2433, 29620, 742, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2528, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 5327, 742, 13, 9651, 1024, 2433, 284, 5479, 742, 13, 9651, 1746, 29922, 9794, 29889, 27755, 2558, 29898, 265, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 304, 2433, 29886, 3028, 29879, 29889, 2001, 5477, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2528, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 5327, 742, 13, 9651, 1024, 2433, 12470, 742, 13, 9651, 1746, 29922, 9794, 29889, 27755, 2558, 29898, 265, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 304, 2433, 29886, 3028, 29879, 29889, 16492, 5477, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2528, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 5327, 742, 13, 9651, 1024, 2433, 18945, 742, 13, 9651, 1746, 29922, 9794, 29889, 27755, 2558, 29898, 265, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 304, 2433, 29886, 3028, 29879, 29889, 20791, 5477, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2528, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 27126, 742, 13, 9651, 1024, 2433, 5327, 742, 13, 9651, 1746, 29922, 9794, 29889, 27755, 2558, 29898, 4381, 29922, 8516, 29892, 373, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 304, 2433, 29886, 3028, 29879, 29889, 5103, 5477, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
viseron/watchdog/thread_watchdog.py
magicmonkey/viseron
0
37520
<filename>viseron/watchdog/thread_watchdog.py """Watchdog for long-running threads.""" import datetime import logging import threading from typing import Callable, Dict, List, Optional from viseron.watchdog import WatchDog LOGGER = logging.getLogger(__name__) class RestartableThread(threading.Thread): """Thread which can be reinstantiated with the clone method. Arguments are the same as a standard Thread, with a few additions: :param stop_target: (default=None) A callable which is called when stop method is called. :param poll_timer: (default=None) A mutable list which contains a single element with a timestamp :param poll_timeout: (default=None) A timeout in seconds. If poll_timer has not been updated in poll_timeout seconds the thread is considered stuck and is restarted :param poll_target: (default=None) A callable which is called when a timeout occurs. :param thread_store_category: (default=None) Thread will be stored in a RestartableThread.thread_store with thread_store_category as key. :param register: (default=True) If true, threads will be registered in the ThreadWatchDog and automatically restart incase of an exception. """ thread_store: Dict[str, List[threading.Thread]] = {} def __init__( self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None, stop_target=None, poll_timer: Optional[List[float]] = None, poll_timeout=None, poll_target=None, thread_store_category=None, register=True, base_class=None, base_class_args=(), ): super().__init__( group=group, target=target, name=name, args=args, kwargs=kwargs, daemon=daemon, ) self._restartable_group = group self._restartable_target = target self._restartable_name = name self._restartable_args = args self._restartable_kwargs = None self._restartable_daemon = daemon self._stop_target = stop_target if any([poll_timer, poll_timeout, poll_target]) and not all( [poll_timer, poll_timeout, poll_target] ): LOGGER.error("poll_timer, poll_timeout, poll_target are mutually inclusive") if poll_timer: if not isinstance(poll_timer, list) and len(poll_timer) != 1: LOGGER.error( "poll_timer needs to be a list with a single element " "to keep it mutable" ) self._poll_timer = poll_timer self._poll_timeout = poll_timeout self._poll_target = poll_target self._thread_store_category = thread_store_category if thread_store_category: self.thread_store.setdefault(thread_store_category, []).append(self) self._register = register if register: ThreadWatchDog.register(self) self._base_class = base_class self._base_class_args = base_class_args @property def started(self): """Return if thread has started.""" return self._started.is_set() @property def poll_timer(self): """Return if thread has started.""" return self._poll_timer @property def poll_timeout(self) -> Optional[int]: """Return max duration of inactivity for poll timer.""" return self._poll_timeout @property def poll_target(self) -> Optional[Callable]: """Return target poll method.""" return self._poll_target @property def thread_store_category(self) -> Optional[str]: """Return given thread store category.""" return self._thread_store_category def stop(self) -> bool: """Calls given stop target method.""" if self._thread_store_category: self.thread_store[self._thread_store_category].remove(self) ThreadWatchDog.unregister(self) return self._stop_target() if self._stop_target else True def clone(self): """Return a clone of the thread to restart it.""" if self._base_class: return self._base_class(*self._base_class_args, register=False) return RestartableThread( group=self._restartable_group, target=self._restartable_target, name=self._restartable_name, args=self._restartable_args, kwargs=self._restartable_kwargs, daemon=self._restartable_daemon, stop_target=self._stop_target, poll_timer=self._poll_timer, poll_timeout=self._poll_timeout, poll_target=self._poll_target, thread_store_category=self._thread_store_category, register=False, base_class=self._base_class, base_class_args=self._base_class_args, ) class ThreadWatchDog(WatchDog): """A watchdog for long running threads.""" registered_items: List[RestartableThread] = [] def __init__(self): super().__init__() self._scheduler.add_job(self.watchdog, "interval", seconds=15) def watchdog(self): """Check for stopped threads and restart them.""" for index, registered_thread in enumerate(self.registered_items): if not registered_thread.started: continue if registered_thread.poll_timer and registered_thread.poll_timer[0]: now = datetime.datetime.now().timestamp() if ( now - registered_thread.poll_timer[0] > registered_thread.poll_timeout ): LOGGER.debug("Thread {} is stuck".format(registered_thread.name)) registered_thread.poll_target() registered_thread.join() else: continue elif registered_thread.is_alive(): continue LOGGER.debug("Thread {} is dead, restarting".format(registered_thread.name)) if registered_thread.thread_store_category: RestartableThread.thread_store[ registered_thread.thread_store_category ].remove(registered_thread) self.registered_items[index] = registered_thread.clone() if not self.registered_items[index].started: self.registered_items[index].start()
[ 1, 529, 9507, 29958, 1730, 261, 265, 29914, 12344, 26169, 29914, 7097, 29918, 12344, 26169, 29889, 2272, 13, 15945, 29908, 24709, 26169, 363, 1472, 29899, 21094, 9717, 1213, 15945, 13, 5215, 12865, 13, 5215, 12183, 13, 5215, 3244, 292, 13, 3166, 19229, 1053, 8251, 519, 29892, 360, 919, 29892, 2391, 29892, 28379, 13, 13, 3166, 1998, 261, 265, 29889, 12344, 26169, 1053, 24274, 29928, 468, 13, 13, 14480, 17070, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 1990, 11654, 442, 519, 4899, 29898, 7097, 292, 29889, 4899, 1125, 13, 1678, 9995, 4899, 607, 508, 367, 337, 2611, 3656, 630, 411, 278, 17432, 1158, 29889, 13, 1678, 11842, 9331, 526, 278, 1021, 408, 263, 3918, 10480, 29892, 411, 263, 2846, 788, 2187, 29901, 13, 1678, 584, 3207, 5040, 29918, 5182, 29901, 313, 4381, 29922, 8516, 29897, 13, 4706, 319, 1246, 519, 607, 338, 2000, 746, 5040, 1158, 338, 2000, 29889, 13, 1678, 584, 3207, 21180, 29918, 20404, 29901, 313, 4381, 29922, 8516, 29897, 13, 4706, 319, 26691, 1051, 607, 3743, 263, 2323, 1543, 411, 263, 14334, 13, 1678, 584, 3207, 21180, 29918, 15619, 29901, 313, 4381, 29922, 8516, 29897, 13, 4706, 319, 11815, 297, 6923, 29889, 960, 21180, 29918, 20404, 756, 451, 1063, 4784, 297, 21180, 29918, 15619, 6923, 13, 4706, 278, 3244, 338, 5545, 10771, 322, 338, 10715, 287, 13, 1678, 584, 3207, 21180, 29918, 5182, 29901, 313, 4381, 29922, 8516, 29897, 13, 4706, 319, 1246, 519, 607, 338, 2000, 746, 263, 11815, 10008, 29889, 13, 1678, 584, 3207, 3244, 29918, 8899, 29918, 7320, 29901, 313, 4381, 29922, 8516, 29897, 13, 4706, 10480, 674, 367, 6087, 297, 263, 11654, 442, 519, 4899, 29889, 7097, 29918, 8899, 411, 13, 4706, 3244, 29918, 8899, 29918, 7320, 408, 1820, 29889, 13, 1678, 584, 3207, 6036, 29901, 313, 4381, 29922, 5574, 29897, 13, 4706, 960, 1565, 29892, 9717, 674, 367, 15443, 297, 278, 10480, 24709, 29928, 468, 322, 6336, 13, 4706, 10715, 297, 4878, 310, 385, 3682, 29889, 13, 1678, 9995, 13, 13, 1678, 3244, 29918, 8899, 29901, 360, 919, 29961, 710, 29892, 2391, 29961, 7097, 292, 29889, 4899, 5262, 353, 6571, 13, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 2318, 29922, 8516, 29892, 13, 4706, 3646, 29922, 8516, 29892, 13, 4706, 1024, 29922, 8516, 29892, 13, 4706, 6389, 29922, 3285, 13, 4706, 9049, 5085, 29922, 8516, 29892, 13, 4706, 334, 29892, 13, 4706, 1146, 9857, 29922, 8516, 29892, 13, 4706, 5040, 29918, 5182, 29922, 8516, 29892, 13, 4706, 21180, 29918, 20404, 29901, 28379, 29961, 1293, 29961, 7411, 5262, 353, 6213, 29892, 13, 4706, 21180, 29918, 15619, 29922, 8516, 29892, 13, 4706, 21180, 29918, 5182, 29922, 8516, 29892, 13, 4706, 3244, 29918, 8899, 29918, 7320, 29922, 8516, 29892, 13, 4706, 6036, 29922, 5574, 29892, 13, 4706, 2967, 29918, 1990, 29922, 8516, 29892, 13, 4706, 2967, 29918, 1990, 29918, 5085, 29922, 3285, 13, 268, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 13, 9651, 2318, 29922, 2972, 29892, 13, 9651, 3646, 29922, 5182, 29892, 13, 9651, 1024, 29922, 978, 29892, 13, 9651, 6389, 29922, 5085, 29892, 13, 9651, 9049, 5085, 29922, 19290, 29892, 13, 9651, 1146, 9857, 29922, 1388, 9857, 29892, 13, 4706, 1723, 13, 13, 4706, 1583, 3032, 5060, 442, 519, 29918, 2972, 353, 2318, 13, 4706, 1583, 3032, 5060, 442, 519, 29918, 5182, 353, 3646, 13, 4706, 1583, 3032, 5060, 442, 519, 29918, 978, 353, 1024, 13, 4706, 1583, 3032, 5060, 442, 519, 29918, 5085, 353, 6389, 13, 4706, 1583, 3032, 5060, 442, 519, 29918, 19290, 353, 6213, 13, 4706, 1583, 3032, 5060, 442, 519, 29918, 1388, 9857, 353, 1146, 9857, 13, 4706, 1583, 3032, 9847, 29918, 5182, 353, 5040, 29918, 5182, 13, 4706, 565, 738, 4197, 29886, 3028, 29918, 20404, 29892, 21180, 29918, 15619, 29892, 21180, 29918, 5182, 2314, 322, 451, 599, 29898, 13, 9651, 518, 29886, 3028, 29918, 20404, 29892, 21180, 29918, 15619, 29892, 21180, 29918, 5182, 29962, 13, 308, 1125, 13, 9651, 25401, 17070, 29889, 2704, 703, 29886, 3028, 29918, 20404, 29892, 21180, 29918, 15619, 29892, 21180, 29918, 5182, 526, 5478, 1474, 20978, 573, 1159, 13, 4706, 565, 21180, 29918, 20404, 29901, 13, 9651, 565, 451, 338, 8758, 29898, 29886, 3028, 29918, 20404, 29892, 1051, 29897, 322, 7431, 29898, 29886, 3028, 29918, 20404, 29897, 2804, 29871, 29896, 29901, 13, 18884, 25401, 17070, 29889, 2704, 29898, 13, 462, 1678, 376, 29886, 3028, 29918, 20404, 4225, 304, 367, 263, 1051, 411, 263, 2323, 1543, 376, 13, 462, 1678, 376, 517, 3013, 372, 26691, 29908, 13, 18884, 1723, 13, 4706, 1583, 3032, 29886, 3028, 29918, 20404, 353, 21180, 29918, 20404, 13, 4706, 1583, 3032, 29886, 3028, 29918, 15619, 353, 21180, 29918, 15619, 13, 4706, 1583, 3032, 29886, 3028, 29918, 5182, 353, 21180, 29918, 5182, 13, 4706, 1583, 3032, 7097, 29918, 8899, 29918, 7320, 353, 3244, 29918, 8899, 29918, 7320, 13, 4706, 565, 3244, 29918, 8899, 29918, 7320, 29901, 13, 9651, 1583, 29889, 7097, 29918, 8899, 29889, 842, 4381, 29898, 7097, 29918, 8899, 29918, 7320, 29892, 5159, 467, 4397, 29898, 1311, 29897, 13, 4706, 1583, 3032, 9573, 353, 6036, 13, 4706, 565, 6036, 29901, 13, 9651, 10480, 24709, 29928, 468, 29889, 9573, 29898, 1311, 29897, 13, 4706, 1583, 3032, 3188, 29918, 1990, 353, 2967, 29918, 1990, 13, 4706, 1583, 3032, 3188, 29918, 1990, 29918, 5085, 353, 2967, 29918, 1990, 29918, 5085, 13, 13, 1678, 732, 6799, 13, 1678, 822, 4687, 29898, 1311, 1125, 13, 4706, 9995, 11609, 565, 3244, 756, 4687, 1213, 15945, 13, 4706, 736, 1583, 3032, 2962, 287, 29889, 275, 29918, 842, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 21180, 29918, 20404, 29898, 1311, 1125, 13, 4706, 9995, 11609, 565, 3244, 756, 4687, 1213, 15945, 13, 4706, 736, 1583, 3032, 29886, 3028, 29918, 20404, 13, 13, 1678, 732, 6799, 13, 1678, 822, 21180, 29918, 15619, 29898, 1311, 29897, 1599, 28379, 29961, 524, 5387, 13, 4706, 9995, 11609, 4236, 14385, 310, 297, 10072, 363, 21180, 12237, 1213, 15945, 13, 4706, 736, 1583, 3032, 29886, 3028, 29918, 15619, 13, 13, 1678, 732, 6799, 13, 1678, 822, 21180, 29918, 5182, 29898, 1311, 29897, 1599, 28379, 29961, 5594, 519, 5387, 13, 4706, 9995, 11609, 3646, 21180, 1158, 1213, 15945, 13, 4706, 736, 1583, 3032, 29886, 3028, 29918, 5182, 13, 13, 1678, 732, 6799, 13, 1678, 822, 3244, 29918, 8899, 29918, 7320, 29898, 1311, 29897, 1599, 28379, 29961, 710, 5387, 13, 4706, 9995, 11609, 2183, 3244, 3787, 7663, 1213, 15945, 13, 4706, 736, 1583, 3032, 7097, 29918, 8899, 29918, 7320, 13, 13, 1678, 822, 5040, 29898, 1311, 29897, 1599, 6120, 29901, 13, 4706, 9995, 29907, 4293, 2183, 5040, 3646, 1158, 1213, 15945, 13, 4706, 565, 1583, 3032, 7097, 29918, 8899, 29918, 7320, 29901, 13, 9651, 1583, 29889, 7097, 29918, 8899, 29961, 1311, 3032, 7097, 29918, 8899, 29918, 7320, 1822, 5992, 29898, 1311, 29897, 13, 4706, 10480, 24709, 29928, 468, 29889, 348, 9573, 29898, 1311, 29897, 13, 4706, 736, 1583, 3032, 9847, 29918, 5182, 580, 565, 1583, 3032, 9847, 29918, 5182, 1683, 5852, 13, 13, 1678, 822, 17432, 29898, 1311, 1125, 13, 4706, 9995, 11609, 263, 17432, 310, 278, 3244, 304, 10715, 372, 1213, 15945, 13, 4706, 565, 1583, 3032, 3188, 29918, 1990, 29901, 13, 9651, 736, 1583, 3032, 3188, 29918, 1990, 10456, 1311, 3032, 3188, 29918, 1990, 29918, 5085, 29892, 6036, 29922, 8824, 29897, 13, 13, 4706, 736, 11654, 442, 519, 4899, 29898, 13, 9651, 2318, 29922, 1311, 3032, 5060, 442, 519, 29918, 2972, 29892, 13, 9651, 3646, 29922, 1311, 3032, 5060, 442, 519, 29918, 5182, 29892, 13, 9651, 1024, 29922, 1311, 3032, 5060, 442, 519, 29918, 978, 29892, 13, 9651, 6389, 29922, 1311, 3032, 5060, 442, 519, 29918, 5085, 29892, 13, 9651, 9049, 5085, 29922, 1311, 3032, 5060, 442, 519, 29918, 19290, 29892, 13, 9651, 1146, 9857, 29922, 1311, 3032, 5060, 442, 519, 29918, 1388, 9857, 29892, 13, 9651, 5040, 29918, 5182, 29922, 1311, 3032, 9847, 29918, 5182, 29892, 13, 9651, 21180, 29918, 20404, 29922, 1311, 3032, 29886, 3028, 29918, 20404, 29892, 13, 9651, 21180, 29918, 15619, 29922, 1311, 3032, 29886, 3028, 29918, 15619, 29892, 13, 9651, 21180, 29918, 5182, 29922, 1311, 3032, 29886, 3028, 29918, 5182, 29892, 13, 9651, 3244, 29918, 8899, 29918, 7320, 29922, 1311, 3032, 7097, 29918, 8899, 29918, 7320, 29892, 13, 9651, 6036, 29922, 8824, 29892, 13, 9651, 2967, 29918, 1990, 29922, 1311, 3032, 3188, 29918, 1990, 29892, 13, 9651, 2967, 29918, 1990, 29918, 5085, 29922, 1311, 3032, 3188, 29918, 1990, 29918, 5085, 29892, 13, 4706, 1723, 13, 13, 13, 1990, 10480, 24709, 29928, 468, 29898, 24709, 29928, 468, 1125, 13, 1678, 9995, 29909, 6505, 26169, 363, 1472, 2734, 9717, 1213, 15945, 13, 13, 1678, 15443, 29918, 7076, 29901, 2391, 29961, 15078, 442, 519, 4899, 29962, 353, 5159, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1583, 3032, 816, 14952, 29889, 1202, 29918, 9057, 29898, 1311, 29889, 12344, 26169, 29892, 376, 19207, 613, 6923, 29922, 29896, 29945, 29897, 13, 13, 1678, 822, 6505, 26169, 29898, 1311, 1125, 13, 4706, 9995, 5596, 363, 11084, 9717, 322, 10715, 963, 1213, 15945, 13, 4706, 363, 2380, 29892, 15443, 29918, 7097, 297, 26985, 29898, 1311, 29889, 9573, 287, 29918, 7076, 1125, 13, 9651, 565, 451, 15443, 29918, 7097, 29889, 2962, 287, 29901, 13, 18884, 6773, 13, 13, 9651, 565, 15443, 29918, 7097, 29889, 29886, 3028, 29918, 20404, 322, 15443, 29918, 7097, 29889, 29886, 3028, 29918, 20404, 29961, 29900, 5387, 13, 18884, 1286, 353, 12865, 29889, 12673, 29889, 3707, 2141, 16394, 580, 13, 18884, 565, 313, 13, 462, 1678, 1286, 448, 15443, 29918, 7097, 29889, 29886, 3028, 29918, 20404, 29961, 29900, 29962, 13, 462, 1678, 1405, 15443, 29918, 7097, 29889, 29886, 3028, 29918, 15619, 13, 462, 1125, 13, 462, 1678, 25401, 17070, 29889, 8382, 703, 4899, 6571, 338, 10771, 1642, 4830, 29898, 9573, 287, 29918, 7097, 29889, 978, 876, 13, 462, 1678, 15443, 29918, 7097, 29889, 29886, 3028, 29918, 5182, 580, 13, 462, 1678, 15443, 29918, 7097, 29889, 7122, 580, 13, 18884, 1683, 29901, 13, 462, 1678, 6773, 13, 9651, 25342, 15443, 29918, 7097, 29889, 275, 29918, 284, 573, 7295, 13, 18884, 6773, 13, 13, 9651, 25401, 17070, 29889, 8382, 703, 4899, 6571, 338, 7123, 29892, 10715, 292, 1642, 4830, 29898, 9573, 287, 29918, 7097, 29889, 978, 876, 13, 9651, 565, 15443, 29918, 7097, 29889, 7097, 29918, 8899, 29918, 7320, 29901, 13, 18884, 11654, 442, 519, 4899, 29889, 7097, 29918, 8899, 29961, 13, 462, 1678, 15443, 29918, 7097, 29889, 7097, 29918, 8899, 29918, 7320, 13, 462, 1822, 5992, 29898, 9573, 287, 29918, 7097, 29897, 13, 9651, 1583, 29889, 9573, 287, 29918, 7076, 29961, 2248, 29962, 353, 15443, 29918, 7097, 29889, 16513, 580, 13, 9651, 565, 451, 1583, 29889, 9573, 287, 29918, 7076, 29961, 2248, 1822, 2962, 287, 29901, 13, 18884, 1583, 29889, 9573, 287, 29918, 7076, 29961, 2248, 1822, 2962, 580, 13, 2 ]
delete_unneeded.py
DamianS6/different-programs
0
156307
<reponame>DamianS6/different-programs<filename>delete_unneeded.py #!/usr/bin/env python3 """A program that looks for files larger than given size (100MB by default).""" import os def delete_unneeded(folder, size='100MB'): sizes = { 'kb': 1024, 'mb': 1048576, 'gb': 1073741824, } num_size = sizes[size[-2:].lower()] * float(size[:-2]) print('Files and folders larger than %s in %s:' % (size, folder)) for dirpath, dirnames, filenames in os.walk(folder): try: for filename in filenames: if os.path.getsize(os.path.join(dirpath, filename)) > num_size: print(os.path.join(dirpath, filename)) except FileNotFoundError: continue
[ 1, 529, 276, 1112, 420, 29958, 29928, 314, 713, 29903, 29953, 29914, 29881, 15622, 29899, 8860, 29879, 29966, 9507, 29958, 8143, 29918, 348, 484, 19226, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 15945, 29908, 29909, 1824, 393, 3430, 363, 2066, 7200, 1135, 2183, 2159, 313, 29896, 29900, 29900, 9486, 491, 2322, 467, 15945, 29908, 13, 13, 5215, 2897, 13, 13, 13, 1753, 5217, 29918, 348, 484, 19226, 29898, 12083, 29892, 2159, 2433, 29896, 29900, 29900, 9486, 29374, 13, 12, 29879, 7093, 353, 426, 13, 12, 12, 29915, 21066, 2396, 29871, 29896, 29900, 29906, 29946, 29892, 13, 12, 12, 29915, 8337, 2396, 29871, 29896, 29900, 29946, 29947, 29945, 29955, 29953, 29892, 13, 12, 12, 29915, 26300, 2396, 29871, 29896, 29900, 29955, 29941, 29955, 29946, 29896, 29947, 29906, 29946, 29892, 13, 12, 29913, 13, 12, 1949, 29918, 2311, 353, 15786, 29961, 2311, 14352, 29906, 29901, 1822, 13609, 580, 29962, 334, 5785, 29898, 2311, 7503, 29899, 29906, 2314, 13, 13, 12, 2158, 877, 10547, 322, 16495, 7200, 1135, 1273, 29879, 297, 1273, 29879, 11283, 1273, 313, 2311, 29892, 4138, 876, 13, 12, 1454, 4516, 2084, 29892, 4516, 7039, 29892, 977, 264, 1280, 297, 2897, 29889, 20919, 29898, 12083, 1125, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 1454, 10422, 297, 977, 264, 1280, 29901, 13, 12, 12, 12, 12, 361, 2897, 29889, 2084, 29889, 657, 2311, 29898, 359, 29889, 2084, 29889, 7122, 29898, 3972, 2084, 29892, 10422, 876, 1405, 954, 29918, 2311, 29901, 13, 12, 12, 12, 12, 12, 2158, 29898, 359, 29889, 2084, 29889, 7122, 29898, 3972, 2084, 29892, 10422, 876, 13, 12, 12, 19499, 3497, 17413, 2392, 29901, 13, 12, 12, 12, 19878, 13, 2 ]
bot/game.py
thequeenofspades/AlphaGOLADZero
1
20757
from sys import stdin, stdout, stderr import traceback import time from player import Player from field.field import Field class Game: def __init__(self): self.time_per_move = -1 self.timebank = -1 self.last_update = None self.max_rounds = -1 self.round = 0 self.player_names = [] self.players = {} self.me = None self.opponent = None self.field = Field() def update(self, data): # start timer self.last_update = time.time() for line in data.split('\n'): line = line.strip() if len(line) <= 0: continue tokens = line.split() if tokens[0] == "settings": self.parse_settings(tokens[1], tokens[2]) elif tokens[0] == "update": if tokens[1] == "game": self.parse_game_updates(tokens[2], tokens[3]) else: self.parse_player_updates(tokens[1], tokens[2], tokens[3]) elif tokens[0] == "action": self.timebank = int(tokens[2]) # Launching bot logic happens after setup finishes def parse_settings(self, key, value): if key == "timebank": self.timebank = int(value) elif key == "time_per_move": self.time_per_move = int(value) elif key == "player_names": self.player_names = value.split(',') self.players = {name: Player(name) for name in self.player_names} elif key == "your_bot": self.me = self.players[value] self.opponent = self.players[[name for name in self.player_names if name != value][0]] elif key == "your_botid": self.me.id = value self.opponent.id = str(2 - (int(value) + 1)) elif key == "field_width": self.field.width = int(value) elif key == "field_height": self.field.height = int(value) elif key == "max_rounds": self.max_rounds = int(value) else: stderr.write('Cannot parse settings input with key {}'.format(key)) def parse_game_updates(self, key, value): if key == "round": self.round = int(value) elif key == "field": self.field.parse(value) else: stderr.write('Cannot parse game update with key {}'.format(key)) def parse_player_updates(self, player_name, key, value): player = self.players.get(player_name) if player is None: stderr.write('Cannot find player with name {}'.format(player_name)) return if key == "living_cells": player.living_cells = int(value) elif key == "move": player.previous_move = value else: stderr.write('Cannot parse {} update with key {}'.format(player_name, key)) def time_remaining(self): return self.timebank - int(1000 * (time.clock() - self.last_update)) @staticmethod def print_move(move): """issue an order""" stdout.write('{}\n'.format(move)) stdout.flush() def run(self, bot): """parse input, update game state and call the bot classes do_turn method""" not_finished = True data = '' while not stdin.closed and not_finished: try: current_line = stdin.readline().rstrip('\r\n') if len(current_line) <= 0: time.sleep(1) continue data += current_line + "\n" if current_line.lower().startswith("action"): self.update(data) move = bot.make_move(self) self.print_move(move) data = '' elif current_line.lower().startswith("quit"): not_finished = False except EOFError: break except KeyboardInterrupt: raise except: # don't raise error or return so that bot attempts to stay alive traceback.print_exc(file=stderr) stderr.flush()
[ 1, 515, 10876, 1053, 3659, 262, 29892, 27591, 29892, 380, 20405, 13, 5215, 9637, 1627, 13, 5215, 931, 13, 13, 3166, 4847, 1053, 14574, 13, 3166, 1746, 29889, 2671, 1053, 8989, 13, 13, 1990, 8448, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 2230, 29918, 546, 29918, 11631, 353, 448, 29896, 13, 4706, 1583, 29889, 2230, 9157, 353, 448, 29896, 13, 4706, 1583, 29889, 4230, 29918, 5504, 353, 6213, 13, 4706, 1583, 29889, 3317, 29918, 29878, 3885, 353, 448, 29896, 13, 13, 4706, 1583, 29889, 14486, 353, 29871, 29900, 13, 4706, 1583, 29889, 9106, 29918, 7039, 353, 5159, 13, 4706, 1583, 29889, 1456, 414, 353, 6571, 13, 4706, 1583, 29889, 1004, 353, 6213, 13, 4706, 1583, 29889, 9354, 265, 296, 353, 6213, 13, 4706, 1583, 29889, 2671, 353, 8989, 580, 13, 13, 1678, 822, 2767, 29898, 1311, 29892, 848, 1125, 13, 4706, 396, 1369, 12237, 13, 4706, 1583, 29889, 4230, 29918, 5504, 353, 931, 29889, 2230, 580, 13, 4706, 363, 1196, 297, 848, 29889, 5451, 28909, 29876, 29374, 13, 13, 9651, 1196, 353, 1196, 29889, 17010, 580, 13, 9651, 565, 7431, 29898, 1220, 29897, 5277, 29871, 29900, 29901, 13, 18884, 6773, 13, 13, 9651, 18897, 353, 1196, 29889, 5451, 580, 13, 9651, 565, 18897, 29961, 29900, 29962, 1275, 376, 11027, 1115, 13, 18884, 1583, 29889, 5510, 29918, 11027, 29898, 517, 12360, 29961, 29896, 1402, 18897, 29961, 29906, 2314, 13, 9651, 25342, 18897, 29961, 29900, 29962, 1275, 376, 5504, 1115, 13, 18884, 565, 18897, 29961, 29896, 29962, 1275, 376, 11802, 1115, 13, 462, 1678, 1583, 29889, 5510, 29918, 11802, 29918, 786, 15190, 29898, 517, 12360, 29961, 29906, 1402, 18897, 29961, 29941, 2314, 13, 18884, 1683, 29901, 13, 462, 1678, 1583, 29889, 5510, 29918, 9106, 29918, 786, 15190, 29898, 517, 12360, 29961, 29896, 1402, 18897, 29961, 29906, 1402, 18897, 29961, 29941, 2314, 13, 9651, 25342, 18897, 29961, 29900, 29962, 1275, 376, 2467, 1115, 13, 18884, 1583, 29889, 2230, 9157, 353, 938, 29898, 517, 12360, 29961, 29906, 2314, 13, 18884, 396, 997, 3322, 292, 9225, 5900, 5930, 1156, 6230, 8341, 267, 13, 13, 1678, 822, 6088, 29918, 11027, 29898, 1311, 29892, 1820, 29892, 995, 1125, 13, 4706, 565, 1820, 1275, 376, 2230, 9157, 1115, 13, 9651, 1583, 29889, 2230, 9157, 353, 938, 29898, 1767, 29897, 13, 4706, 25342, 1820, 1275, 376, 2230, 29918, 546, 29918, 11631, 1115, 13, 9651, 1583, 29889, 2230, 29918, 546, 29918, 11631, 353, 938, 29898, 1767, 29897, 13, 4706, 25342, 1820, 1275, 376, 9106, 29918, 7039, 1115, 13, 9651, 1583, 29889, 9106, 29918, 7039, 353, 995, 29889, 5451, 29317, 1495, 13, 9651, 1583, 29889, 1456, 414, 353, 426, 978, 29901, 14574, 29898, 978, 29897, 363, 1024, 297, 1583, 29889, 9106, 29918, 7039, 29913, 13, 4706, 25342, 1820, 1275, 376, 8066, 29918, 7451, 1115, 13, 9651, 1583, 29889, 1004, 353, 1583, 29889, 1456, 414, 29961, 1767, 29962, 13, 9651, 1583, 29889, 9354, 265, 296, 353, 1583, 29889, 1456, 414, 8999, 978, 363, 1024, 297, 1583, 29889, 9106, 29918, 7039, 565, 1024, 2804, 995, 3816, 29900, 5262, 13, 4706, 25342, 1820, 1275, 376, 8066, 29918, 7451, 333, 1115, 13, 9651, 1583, 29889, 1004, 29889, 333, 353, 995, 13, 9651, 1583, 29889, 9354, 265, 296, 29889, 333, 353, 851, 29898, 29906, 448, 313, 524, 29898, 1767, 29897, 718, 29871, 29896, 876, 13, 4706, 25342, 1820, 1275, 376, 2671, 29918, 2103, 1115, 13, 9651, 1583, 29889, 2671, 29889, 2103, 353, 938, 29898, 1767, 29897, 13, 4706, 25342, 1820, 1275, 376, 2671, 29918, 3545, 1115, 13, 9651, 1583, 29889, 2671, 29889, 3545, 353, 938, 29898, 1767, 29897, 13, 4706, 25342, 1820, 1275, 376, 3317, 29918, 29878, 3885, 1115, 13, 9651, 1583, 29889, 3317, 29918, 29878, 3885, 353, 938, 29898, 1767, 29897, 13, 4706, 1683, 29901, 13, 9651, 380, 20405, 29889, 3539, 877, 29089, 6088, 6055, 1881, 411, 1820, 6571, 4286, 4830, 29898, 1989, 876, 13, 13, 1678, 822, 6088, 29918, 11802, 29918, 786, 15190, 29898, 1311, 29892, 1820, 29892, 995, 1125, 13, 4706, 565, 1820, 1275, 376, 14486, 1115, 13, 9651, 1583, 29889, 14486, 353, 938, 29898, 1767, 29897, 13, 4706, 25342, 1820, 1275, 376, 2671, 1115, 13, 9651, 1583, 29889, 2671, 29889, 5510, 29898, 1767, 29897, 13, 4706, 1683, 29901, 13, 9651, 380, 20405, 29889, 3539, 877, 29089, 6088, 3748, 2767, 411, 1820, 6571, 4286, 4830, 29898, 1989, 876, 13, 13, 1678, 822, 6088, 29918, 9106, 29918, 786, 15190, 29898, 1311, 29892, 4847, 29918, 978, 29892, 1820, 29892, 995, 1125, 13, 4706, 4847, 353, 1583, 29889, 1456, 414, 29889, 657, 29898, 9106, 29918, 978, 29897, 13, 13, 4706, 565, 4847, 338, 6213, 29901, 13, 9651, 380, 20405, 29889, 3539, 877, 29089, 1284, 4847, 411, 1024, 6571, 4286, 4830, 29898, 9106, 29918, 978, 876, 13, 9651, 736, 13, 13, 4706, 565, 1820, 1275, 376, 29880, 4357, 29918, 3729, 29879, 1115, 13, 9651, 4847, 29889, 29880, 4357, 29918, 3729, 29879, 353, 938, 29898, 1767, 29897, 13, 4706, 25342, 1820, 1275, 376, 11631, 1115, 13, 9651, 4847, 29889, 24957, 29918, 11631, 353, 995, 13, 4706, 1683, 29901, 13, 9651, 380, 20405, 29889, 3539, 877, 29089, 6088, 6571, 2767, 411, 1820, 6571, 4286, 4830, 29898, 9106, 29918, 978, 29892, 1820, 876, 13, 13, 1678, 822, 931, 29918, 1745, 17225, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 2230, 9157, 448, 938, 29898, 29896, 29900, 29900, 29900, 334, 313, 2230, 29889, 13058, 580, 448, 1583, 29889, 4230, 29918, 5504, 876, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1596, 29918, 11631, 29898, 11631, 1125, 13, 4706, 9995, 15118, 385, 1797, 15945, 29908, 13, 4706, 27591, 29889, 3539, 877, 29912, 1012, 29876, 4286, 4830, 29898, 11631, 876, 13, 4706, 27591, 29889, 23126, 580, 13, 13, 1678, 822, 1065, 29898, 1311, 29892, 9225, 1125, 13, 4706, 9995, 5510, 1881, 29892, 2767, 3748, 2106, 322, 1246, 278, 9225, 4413, 437, 29918, 685, 1158, 15945, 29908, 13, 4706, 451, 29918, 4951, 3276, 353, 5852, 13, 4706, 848, 353, 6629, 13, 13, 4706, 1550, 451, 3659, 262, 29889, 15603, 322, 451, 29918, 4951, 3276, 29901, 13, 9651, 1018, 29901, 13, 18884, 1857, 29918, 1220, 353, 3659, 262, 29889, 949, 1220, 2141, 29878, 17010, 28909, 29878, 29905, 29876, 1495, 13, 13, 18884, 565, 7431, 29898, 3784, 29918, 1220, 29897, 5277, 29871, 29900, 29901, 13, 462, 1678, 931, 29889, 17059, 29898, 29896, 29897, 13, 462, 1678, 6773, 13, 13, 18884, 848, 4619, 1857, 29918, 1220, 718, 6634, 29876, 29908, 13, 18884, 565, 1857, 29918, 1220, 29889, 13609, 2141, 27382, 2541, 703, 2467, 29908, 1125, 13, 462, 1678, 1583, 29889, 5504, 29898, 1272, 29897, 13, 13, 462, 1678, 4337, 353, 9225, 29889, 5675, 29918, 11631, 29898, 1311, 29897, 13, 462, 1678, 1583, 29889, 2158, 29918, 11631, 29898, 11631, 29897, 13, 13, 462, 1678, 848, 353, 6629, 13, 18884, 25342, 1857, 29918, 1220, 29889, 13609, 2141, 27382, 2541, 703, 28358, 29908, 1125, 13, 462, 1678, 451, 29918, 4951, 3276, 353, 7700, 13, 9651, 5174, 382, 9800, 2392, 29901, 13, 18884, 2867, 13, 9651, 5174, 7670, 3377, 4074, 6685, 29901, 13, 18884, 12020, 13, 9651, 5174, 29901, 13, 18884, 396, 1016, 29915, 29873, 12020, 1059, 470, 736, 577, 393, 9225, 14734, 304, 7952, 18758, 13, 18884, 9637, 1627, 29889, 2158, 29918, 735, 29883, 29898, 1445, 29922, 303, 20405, 29897, 13, 18884, 380, 20405, 29889, 23126, 580, 13, 2 ]
classroom/management/commands/create_issues.py
pizzapanther/codacation
0
98403
import logging from django.core.management.base import BaseCommand, CommandError from classroom.tasks import create_issues class Command (BaseCommand): help = 'Create Github Issues for Assignment' def add_arguments(self, parser): parser.add_argument('ass_id', nargs='+', type=int) def handle(self, *args, **options): root_logger = logging.getLogger('') root_logger.setLevel(logging.DEBUG) for ass_id in options['ass_id']: create_issues(ass_id)
[ 1, 1053, 12183, 13, 13, 3166, 9557, 29889, 3221, 29889, 21895, 29889, 3188, 1053, 7399, 6255, 29892, 10516, 2392, 13, 3166, 770, 8345, 29889, 20673, 1053, 1653, 29918, 12175, 13, 13, 1990, 10516, 313, 5160, 6255, 1125, 13, 29871, 1371, 353, 525, 4391, 402, 2985, 16982, 1041, 363, 4007, 10194, 29915, 13, 259, 13, 29871, 822, 788, 29918, 25699, 29898, 1311, 29892, 13812, 1125, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 465, 29918, 333, 742, 302, 5085, 2433, 29974, 742, 1134, 29922, 524, 29897, 13, 13, 29871, 822, 4386, 29898, 1311, 29892, 334, 5085, 29892, 3579, 6768, 1125, 13, 1678, 3876, 29918, 21707, 353, 12183, 29889, 657, 16363, 877, 1495, 13, 1678, 3876, 29918, 21707, 29889, 842, 10108, 29898, 21027, 29889, 18525, 29897, 13, 268, 13, 1678, 363, 1223, 29918, 333, 297, 3987, 1839, 465, 29918, 333, 2033, 29901, 13, 418, 1653, 29918, 12175, 29898, 465, 29918, 333, 29897, 13, 2 ]
bayarea_urbansim/data_regeneration/counties/ala.py
ual/DOE-repo-deliverable
0
76344
import numpy as np import pandas as pd from spandex import TableLoader, TableFrame from spandex.io import df_to_db import urbansim.sim.simulation as sim import utils loader = TableLoader() staging = loader.tables.staging ## Assumptions. # Use codes were classified manually because the assessor classifications # are meant for property tax purposes. These classifications should be # reviewed and revised. res_codes = {'single': ([1100] + range(1120, 1151) + range(1200, 1501) + range(1900, 2000)), 'multi': (range(600, 1100) + [1700] + range(2000, 3000) + range(5000, 5300) + range(7000, 7701) + [7800]), 'mixed': (range(3900, 4000) + [4101] + [4191] + [4240] + [9401] + [9491])} exempt_codes = range(1, 1000) ## Register input tables. tf = TableFrame(staging.parcels_ala, index_col='apn_sort') sim.add_table('parcels_in', tf, copy_col=False) @sim.table(cache=True) def ie670(): filepath = \ loader.get_path('built/parcel/2010/ala/assessor_nov10/IE670c.txt') df = pd.read_table(filepath, sep='\t', index_col=False, low_memory=False) df.set_index("Assessor's Parcel Number (APN) sort format", inplace=True) assert df.index.is_unique assert not df.index.hasnans() return df @sim.table(cache=True) def ie673(): filepath = \ loader.get_path('built/parcel/2010/ala/assessor_nov10/IE673c.txt') df = pd.read_table(filepath, sep='\t', index_col=False) df.set_index('APNsort', inplace=True) assert df.index.is_unique assert not df.index.hasnans() return df ## Register output table. @sim.table(cache=True) def parcels_out(parcels_in): index = pd.Series(parcels_in.index).dropna().unique() df = pd.DataFrame(index=index) df.index.name = 'apn' return df ## Register output columns. out = sim.column('parcels_out', cache=True) @out def county_id(): return '001' @out def parcel_id_local(): pass @out def land_use_type_id(parcels_out, code='ie673.UseCode'): # Alternate inputs: # - "Use Code": from IE670, values are identical return code.reindex(parcels_out.index, copy=False).fillna(0).astype(int) @out def res_type(land_use_type_id='parcels_out.land_use_type_id'): return utils.get_res_type(land_use_type_id, res_codes) @out def land_value(value='ie670.Land value'): # Alternate inputs: # - "CLCA land value": less data available return value @out def improvement_value(value='ie670.Improvements value'): # Alternate inputs: # - "CLCA improvements value": less data available return value @out def year_assessed(date='ie670.Last document date (CCYYMMDD)'): # Alternate inputs: # - "Last document prefix": not always numeric # - "Last document input date (CCYYMMDD)" # - "Property characteristic change date (CCYYMMDD)": from IE673 date.replace(0, np.nan, inplace=True) return date.floordiv(10000) @out def year_built(year='ie673.YearBuilt'): return year.str.strip().replace('', np.nan).astype(float) @out def building_sqft(sqft='ie673.BldgArea'): return sqft @out def non_residential_sqft(building_sqft='parcels_out.building_sqft', res_type='parcels_out.res_type', residential_units='parcels_out.residential_units'): return utils.get_nonresidential_sqft(building_sqft, res_type, residential_units) @out def residential_units(tot_units='ie673.Units', res_type='parcels_out.res_type'): return utils.get_residential_units(tot_units, res_type) @out def condo_identifier(): code = ' ' return code @out def sqft_per_unit(building_sqft='parcels_out.building_sqft', non_residential_sqft='parcels_out.non_residential_sqft', residential_units='parcels_out.residential_units'): return utils.get_sqft_per_unit(building_sqft, non_residential_sqft, residential_units) @out def stories(stories='ie673.Stories'): # 1 story = 10 Alameda County stories. return 0.1 * stories @out def tax_exempt(land_use_type_id='parcels_out.land_use_type_id'): return utils.get_tax_exempt(land_use_type_id, exempt_codes) ## Export back to database. @sim.model() def export_ala(parcels_out): df = parcels_out.to_frame() # Cast "land_use_type_id" to string for compatibility with other counties. df['land_use_type_id'] = df.land_use_type_id.astype(str) assert df.index.is_unique assert not df.index.hasnans() df_to_db(df, 'attributes_ala', schema=staging) sim.run(['export_ala'])
[ 1, 1053, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 3166, 10638, 1390, 1053, 6137, 10036, 29892, 6137, 4308, 13, 3166, 10638, 1390, 29889, 601, 1053, 4489, 29918, 517, 29918, 2585, 13, 5215, 23499, 550, 326, 29889, 3601, 29889, 3601, 2785, 408, 1027, 13, 13, 5215, 3667, 29879, 13, 13, 13, 12657, 353, 6137, 10036, 580, 13, 303, 6751, 353, 23466, 29889, 24051, 29889, 303, 6751, 13, 13, 13, 2277, 4007, 398, 1980, 29889, 13, 13, 13, 29937, 4803, 11561, 892, 770, 2164, 7522, 1363, 278, 1223, 6329, 770, 8232, 13, 29937, 526, 6839, 363, 2875, 8818, 11976, 29889, 4525, 770, 8232, 881, 367, 13, 29937, 9076, 287, 322, 337, 11292, 29889, 13, 690, 29918, 18137, 353, 11117, 14369, 2396, 9310, 29896, 29896, 29900, 29900, 29962, 718, 3464, 29898, 29896, 29896, 29906, 29900, 29892, 29871, 29896, 29896, 29945, 29896, 29897, 718, 3464, 29898, 29896, 29906, 29900, 29900, 29892, 29871, 29896, 29945, 29900, 29896, 29897, 718, 13, 462, 4706, 3464, 29898, 29896, 29929, 29900, 29900, 29892, 29871, 29906, 29900, 29900, 29900, 8243, 13, 632, 525, 9910, 2396, 313, 3881, 29898, 29953, 29900, 29900, 29892, 29871, 29896, 29896, 29900, 29900, 29897, 718, 518, 29896, 29955, 29900, 29900, 29962, 718, 3464, 29898, 29906, 29900, 29900, 29900, 29892, 29871, 29941, 29900, 29900, 29900, 29897, 718, 13, 462, 539, 3464, 29898, 29945, 29900, 29900, 29900, 29892, 29871, 29945, 29941, 29900, 29900, 29897, 718, 3464, 29898, 29955, 29900, 29900, 29900, 29892, 29871, 29955, 29955, 29900, 29896, 29897, 718, 518, 29955, 29947, 29900, 29900, 11724, 13, 632, 525, 29885, 11925, 2396, 313, 3881, 29898, 29941, 29929, 29900, 29900, 29892, 29871, 29946, 29900, 29900, 29900, 29897, 718, 518, 29946, 29896, 29900, 29896, 29962, 718, 518, 29946, 29896, 29929, 29896, 29962, 718, 518, 29946, 29906, 29946, 29900, 29962, 718, 13, 462, 539, 518, 29929, 29946, 29900, 29896, 29962, 718, 518, 29929, 29946, 29929, 29896, 2314, 29913, 13, 735, 3456, 29918, 18137, 353, 3464, 29898, 29896, 29892, 29871, 29896, 29900, 29900, 29900, 29897, 13, 13, 13, 2277, 12577, 1881, 6131, 29889, 13, 13, 13, 13264, 353, 6137, 4308, 29898, 303, 6751, 29889, 862, 29883, 1379, 29918, 2883, 29892, 2380, 29918, 1054, 2433, 481, 29876, 29918, 6605, 1495, 13, 3601, 29889, 1202, 29918, 2371, 877, 862, 29883, 1379, 29918, 262, 742, 15886, 29892, 3509, 29918, 1054, 29922, 8824, 29897, 13, 13, 13, 29992, 3601, 29889, 2371, 29898, 8173, 29922, 5574, 29897, 13, 1753, 19282, 29953, 29955, 29900, 7295, 13, 1678, 934, 2084, 353, 320, 13, 4706, 23466, 29889, 657, 29918, 2084, 877, 16145, 29914, 862, 2242, 29914, 29906, 29900, 29896, 29900, 29914, 2883, 29914, 465, 6329, 29918, 13715, 29896, 29900, 29914, 8673, 29953, 29955, 29900, 29883, 29889, 3945, 1495, 13, 1678, 4489, 353, 10518, 29889, 949, 29918, 2371, 29898, 1445, 2084, 29892, 16345, 2433, 29905, 29873, 742, 2380, 29918, 1054, 29922, 8824, 29892, 4482, 29918, 14834, 29922, 8824, 29897, 13, 1678, 4489, 29889, 842, 29918, 2248, 703, 7900, 6329, 29915, 29879, 1459, 2242, 9681, 313, 3301, 29940, 29897, 2656, 3402, 613, 297, 6689, 29922, 5574, 29897, 13, 1678, 4974, 4489, 29889, 2248, 29889, 275, 29918, 13092, 13, 1678, 4974, 451, 4489, 29889, 2248, 29889, 5349, 29876, 550, 580, 13, 1678, 736, 4489, 13, 13, 13, 29992, 3601, 29889, 2371, 29898, 8173, 29922, 5574, 29897, 13, 1753, 19282, 29953, 29955, 29941, 7295, 13, 1678, 934, 2084, 353, 320, 13, 4706, 23466, 29889, 657, 29918, 2084, 877, 16145, 29914, 862, 2242, 29914, 29906, 29900, 29896, 29900, 29914, 2883, 29914, 465, 6329, 29918, 13715, 29896, 29900, 29914, 8673, 29953, 29955, 29941, 29883, 29889, 3945, 1495, 13, 1678, 4489, 353, 10518, 29889, 949, 29918, 2371, 29898, 1445, 2084, 29892, 16345, 2433, 29905, 29873, 742, 2380, 29918, 1054, 29922, 8824, 29897, 13, 1678, 4489, 29889, 842, 29918, 2248, 877, 3301, 29940, 6605, 742, 297, 6689, 29922, 5574, 29897, 13, 1678, 4974, 4489, 29889, 2248, 29889, 275, 29918, 13092, 13, 1678, 4974, 451, 4489, 29889, 2248, 29889, 5349, 29876, 550, 580, 13, 1678, 736, 4489, 13, 13, 13, 2277, 12577, 1962, 1591, 29889, 13, 13, 13, 29992, 3601, 29889, 2371, 29898, 8173, 29922, 5574, 29897, 13, 1753, 20067, 1379, 29918, 449, 29898, 862, 29883, 1379, 29918, 262, 1125, 13, 1678, 2380, 353, 10518, 29889, 19204, 29898, 862, 29883, 1379, 29918, 262, 29889, 2248, 467, 8865, 1056, 2141, 13092, 580, 13, 1678, 4489, 353, 10518, 29889, 17271, 29898, 2248, 29922, 2248, 29897, 13, 1678, 4489, 29889, 2248, 29889, 978, 353, 525, 481, 29876, 29915, 13, 1678, 736, 4489, 13, 13, 13, 2277, 12577, 1962, 4341, 29889, 13, 13, 13, 449, 353, 1027, 29889, 4914, 877, 862, 29883, 1379, 29918, 449, 742, 7090, 29922, 5574, 29897, 13, 13, 13, 29992, 449, 13, 1753, 15178, 29918, 333, 7295, 13, 1678, 736, 525, 29900, 29900, 29896, 29915, 13, 13, 13, 29992, 449, 13, 1753, 610, 2242, 29918, 333, 29918, 2997, 7295, 13, 1678, 1209, 13, 13, 13, 29992, 449, 13, 1753, 2982, 29918, 1509, 29918, 1853, 29918, 333, 29898, 862, 29883, 1379, 29918, 449, 29892, 775, 2433, 347, 29953, 29955, 29941, 29889, 11403, 3399, 29374, 13, 1678, 396, 12440, 403, 10970, 29901, 13, 1678, 396, 448, 376, 11403, 5920, 1115, 515, 7159, 29953, 29955, 29900, 29892, 1819, 526, 13557, 13, 1678, 736, 775, 29889, 276, 2248, 29898, 862, 29883, 1379, 29918, 449, 29889, 2248, 29892, 3509, 29922, 8824, 467, 5589, 1056, 29898, 29900, 467, 579, 668, 29898, 524, 29897, 13, 13, 13, 29992, 449, 13, 1753, 620, 29918, 1853, 29898, 1049, 29918, 1509, 29918, 1853, 29918, 333, 2433, 862, 29883, 1379, 29918, 449, 29889, 1049, 29918, 1509, 29918, 1853, 29918, 333, 29374, 13, 1678, 736, 3667, 29879, 29889, 657, 29918, 690, 29918, 1853, 29898, 1049, 29918, 1509, 29918, 1853, 29918, 333, 29892, 620, 29918, 18137, 29897, 13, 13, 13, 29992, 449, 13, 1753, 2982, 29918, 1767, 29898, 1767, 2433, 347, 29953, 29955, 29900, 29889, 22677, 995, 29374, 13, 1678, 396, 12440, 403, 10970, 29901, 13, 1678, 396, 29871, 448, 376, 6154, 5454, 2982, 995, 1115, 3109, 848, 3625, 13, 1678, 736, 995, 13, 13, 13, 29992, 449, 13, 1753, 20414, 29918, 1767, 29898, 1767, 2433, 347, 29953, 29955, 29900, 29889, 1888, 16123, 4110, 995, 29374, 13, 1678, 396, 12440, 403, 10970, 29901, 13, 1678, 396, 29871, 448, 376, 6154, 5454, 28473, 995, 1115, 3109, 848, 3625, 13, 1678, 736, 995, 13, 13, 13, 29992, 449, 13, 1753, 1629, 29918, 465, 11517, 29898, 1256, 2433, 347, 29953, 29955, 29900, 29889, 8897, 1842, 2635, 313, 4174, 14995, 29924, 5773, 29928, 16029, 1125, 13, 1678, 396, 12440, 403, 10970, 29901, 13, 1678, 396, 448, 376, 8897, 1842, 10944, 1115, 451, 2337, 16985, 13, 1678, 396, 448, 376, 8897, 1842, 1881, 2635, 313, 4174, 14995, 29924, 5773, 29928, 5513, 13, 1678, 396, 448, 376, 4854, 17443, 1735, 2635, 313, 4174, 14995, 29924, 5773, 29928, 29897, 1115, 515, 7159, 29953, 29955, 29941, 13, 1678, 2635, 29889, 6506, 29898, 29900, 29892, 7442, 29889, 13707, 29892, 297, 6689, 29922, 5574, 29897, 13, 1678, 736, 2635, 29889, 29888, 417, 536, 440, 29898, 29896, 29900, 29900, 29900, 29900, 29897, 13, 13, 13, 29992, 449, 13, 1753, 1629, 29918, 16145, 29898, 6360, 2433, 347, 29953, 29955, 29941, 29889, 12883, 3727, 2782, 29374, 13, 1678, 736, 1629, 29889, 710, 29889, 17010, 2141, 6506, 877, 742, 7442, 29889, 13707, 467, 579, 668, 29898, 7411, 29897, 13, 13, 13, 29992, 449, 13, 1753, 5214, 29918, 3044, 615, 29898, 3044, 615, 2433, 347, 29953, 29955, 29941, 29889, 29933, 430, 29887, 13799, 29374, 13, 1678, 736, 18074, 615, 13, 13, 13, 29992, 449, 13, 1753, 1661, 29918, 690, 1693, 616, 29918, 3044, 615, 29898, 25237, 29918, 3044, 615, 2433, 862, 29883, 1379, 29918, 449, 29889, 25237, 29918, 3044, 615, 742, 13, 462, 308, 620, 29918, 1853, 2433, 862, 29883, 1379, 29918, 449, 29889, 690, 29918, 1853, 742, 13, 462, 308, 20201, 616, 29918, 348, 1169, 2433, 862, 29883, 1379, 29918, 449, 29889, 690, 1693, 616, 29918, 348, 1169, 29374, 13, 1678, 736, 3667, 29879, 29889, 657, 29918, 5464, 690, 1693, 616, 29918, 3044, 615, 29898, 25237, 29918, 3044, 615, 29892, 620, 29918, 1853, 29892, 13, 462, 462, 308, 20201, 616, 29918, 348, 1169, 29897, 13, 13, 13, 29992, 449, 13, 1753, 20201, 616, 29918, 348, 1169, 29898, 4260, 29918, 348, 1169, 2433, 347, 29953, 29955, 29941, 29889, 2525, 1169, 742, 13, 462, 418, 620, 29918, 1853, 2433, 862, 29883, 1379, 29918, 449, 29889, 690, 29918, 1853, 29374, 13, 1678, 736, 3667, 29879, 29889, 657, 29918, 690, 1693, 616, 29918, 348, 1169, 29898, 4260, 29918, 348, 1169, 29892, 620, 29918, 1853, 29897, 13, 268, 13, 29992, 449, 13, 1753, 378, 1867, 29918, 25378, 7295, 13, 1678, 775, 353, 525, 525, 13, 1678, 736, 775, 13, 13, 13, 29992, 449, 13, 1753, 18074, 615, 29918, 546, 29918, 5441, 29898, 25237, 29918, 3044, 615, 2433, 862, 29883, 1379, 29918, 449, 29889, 25237, 29918, 3044, 615, 742, 13, 462, 29871, 1661, 29918, 690, 1693, 616, 29918, 3044, 615, 2433, 862, 29883, 1379, 29918, 449, 29889, 5464, 29918, 690, 1693, 616, 29918, 3044, 615, 742, 13, 462, 29871, 20201, 616, 29918, 348, 1169, 2433, 862, 29883, 1379, 29918, 449, 29889, 690, 1693, 616, 29918, 348, 1169, 29374, 13, 1678, 736, 3667, 29879, 29889, 657, 29918, 3044, 615, 29918, 546, 29918, 5441, 29898, 25237, 29918, 3044, 615, 29892, 1661, 29918, 690, 1693, 616, 29918, 3044, 615, 29892, 13, 462, 462, 259, 20201, 616, 29918, 348, 1169, 29897, 13, 13, 13, 29992, 449, 13, 1753, 15874, 29898, 303, 3842, 2433, 347, 29953, 29955, 29941, 29889, 855, 3842, 29374, 13, 1678, 396, 29871, 29896, 5828, 353, 29871, 29896, 29900, 838, 2795, 29874, 5127, 15874, 29889, 13, 1678, 736, 29871, 29900, 29889, 29896, 334, 15874, 13, 13, 13, 29992, 449, 13, 1753, 8818, 29918, 735, 3456, 29898, 1049, 29918, 1509, 29918, 1853, 29918, 333, 2433, 862, 29883, 1379, 29918, 449, 29889, 1049, 29918, 1509, 29918, 1853, 29918, 333, 29374, 13, 1678, 736, 3667, 29879, 29889, 657, 29918, 20725, 29918, 735, 3456, 29898, 1049, 29918, 1509, 29918, 1853, 29918, 333, 29892, 429, 3456, 29918, 18137, 29897, 13, 13, 13, 2277, 1222, 637, 1250, 304, 2566, 29889, 13, 13, 13, 29992, 3601, 29889, 4299, 580, 13, 1753, 5609, 29918, 2883, 29898, 862, 29883, 1379, 29918, 449, 1125, 13, 1678, 4489, 353, 20067, 1379, 29918, 449, 29889, 517, 29918, 2557, 580, 13, 13, 1678, 396, 4834, 376, 1049, 29918, 1509, 29918, 1853, 29918, 333, 29908, 304, 1347, 363, 24521, 411, 916, 2302, 583, 29889, 13, 1678, 4489, 1839, 1049, 29918, 1509, 29918, 1853, 29918, 333, 2033, 353, 4489, 29889, 1049, 29918, 1509, 29918, 1853, 29918, 333, 29889, 579, 668, 29898, 710, 29897, 13, 13, 1678, 4974, 4489, 29889, 2248, 29889, 275, 29918, 13092, 13, 1678, 4974, 451, 4489, 29889, 2248, 29889, 5349, 29876, 550, 580, 13, 1678, 4489, 29918, 517, 29918, 2585, 29898, 2176, 29892, 525, 15697, 29918, 2883, 742, 10938, 29922, 303, 6751, 29897, 13, 13, 3601, 29889, 3389, 18959, 15843, 29918, 2883, 11287, 13, 2 ]
Project4/views_templates.py
sockduct/Udacity-FSND
0
67140
<filename>Project4/views_templates.py<gh_stars>0 #!/usr/bin/env python # -*- coding: ascii -*- ################################################################################################### # # Python version(s) used/tested: # * Python 2.7.12-32 on Ubuntu 16.04.2 LTS # * Python 2.7.13-32 on Windows 7 # * Python 3.5.2-32 on Ubuntu 16.04.2 LTS # * Python 3.6.1-32 on Windows 7 # # Notes on Style: # * PEP 8 followed with maximum line length of 99 characters (allowable # per: https://www.python.org/dev/peps/pep-0008/#maximum-line-length) # * Per above, comments and docstrings must be wrapped at 72 characters # * Interpreting this as just the comment/docstring text and not the # leading quotes or '# ' # # # Template version used: 0.1.2 # # ------------------------------------------------------------------------------------------------- # # Issues/PLanned Improvements: # * TBD # '''<module/program description> - triple quotes should end on this line if on liner...''' # Future Imports - Must be first, provides Python 2/3 interoperability from __future__ import print_function # print(<strings...>, file=sys.stdout, end='\n') from __future__ import division # 3/2 == 1.5, 3//2 == 1 from __future__ import absolute_import # prevent implicit relative imports in v2.x from __future__ import unicode_literals # all string literals treated as unicode strings # Imports from flask import Flask, jsonify, request, url_for, abort, g, render_template, make_response from flask_httpauth import HTTPBasicAuth from functools import update_wrapper import json from models import Base, Item, User from oauth2client.client import flow_from_clientsecrets from oauth2client.client import FlowExchangeError import os from pprint import pprint import ratelimit import requests # SQLAlchemy extension to map classes to database tables from sqlalchemy.ext.declarative import declarative_base # SQLAlchemy database handle to interact with underlying database from sqlalchemy.orm import sessionmaker # x from sqlalchemy.orm import relationship # SQLAlchemy module to connect to underlying database from sqlalchemy import create_engine import time # Globals # Note: Consider using function/class/method default parameters instead # of global constants where it makes sense # SQLAlchemy setup - create an instance of a connection to the underlying # database # Default database - SQLite: DB_PATH = os.path.join(os.path.dirname(__file__), 'catalog.db') engine = create_engine('sqlite:///' + DB_PATH) # Use PostgreSQL, with user catalog: # engine = create_engine('postgresql+psycopg2://catalog:NEKpPllvkcVEP4W9QzyIgDbKH15NM1I96BclRWG5@/catalog') # Not sure what this does or if it's needed Base.metadata.bind = engine # Create ORM handle to underlying database DBSession = sessionmaker(bind=engine) # Used to interact with underlying database session = DBSession() # # Flask setup app = Flask(__name__) auth = HTTPBasicAuth() # # OAuth setup OAUTH_CLIENT_FILE = 'client_secret_google.json' OAUTH_CLIENT_FILE_PATH = os.path.join(os.path.dirname(__file__), OAUTH_CLIENT_FILE) CLIENT_ID = json.loads(open(OAUTH_CLIENT_FILE_PATH).read())['web']['client_id'] # Metadata __author__ = '<NAME>' __contact__ = 'james<dot>r<dot>small<at>att<dot>com' __date__ = 'July 28, 2017' __version__ = '0.0.1' # Integrate these: @auth.verify_password def verify_password(username, password): user = session.query(User).filter_by(username=username).first() # Don't want to notify agent if username not found or password verification # failed - this would constitute a security vulnerability if not user or not user.verify_password(password): return False else: g.user = user return True # # Another version: @auth.verify_password def verify_password(username_or_token, password): #Try to see if it's a token first user_id = User.verify_auth_token(username_or_token) if user_id: user = session.query(User).filter_by(id = user_id).one() else: user = session.query(User).filter_by(username = username_or_token).first() if not user or not user.verify_password(password): return False g.user = user return True # # Don't like this approach where token is in username, what about using separate # header like GitHub does? @auth.verify_password def verify_password(username_or_token, password): # First check if its a token # Debugging print('Received: {}:{}'.format(username_or_token, password)) user_id = User.verify_auth_token(username_or_token) if user_id: # Debugging print('Validated by token') user = session.query(User).filter_by(id=user_id).one() else: # Debugging print('Trying to validate by username/password...') user = session.query(User).filter_by(username=username_or_token).first() if not user or not user.verify_password(password): # Debugging print('Failed to validate auth credentials') return False # Debugging print('Validated by username/password') # Successful authentication g.user = user return True @app.route('/clientOAuth') def start(): return render_template('clientOAuth.html') @app.route('/oauth/<provider>', methods = ['POST']) def login(provider): # print('Request: {}'.format(request)) # print('Request introspection:') # pprint(request.__dict__) # print('-=-' * 25) #STEP 1 - Parse the auth code # Use this way if running seafood_test.py script ## auth_code = request.json.get('auth_code') # Use this way if coming from browser auth_code = request.data print "Step 1 - Complete, received auth code %s" % auth_code # print('-=-' * 25) if provider == 'google': #STEP 2 - Exchange for a token try: # Upgrade the authorization code into a credentials object oauth_flow = flow_from_clientsecrets(OAUTH_CLIENT_FILE, scope='', redirect_uri='postmessage') ## oauth_flow = flow_from_clientsecrets(OAUTH_CLIENT_FILE, scope='') ## oauth_flow.redirect_uri = 'postmessage' credentials = oauth_flow.step2_exchange(auth_code) except FlowExchangeError: response = make_response(json.dumps('Failed to upgrade the authorization code.'), 401) response.headers['Content-Type'] = 'application/json' return response # Check that the access token is valid. access_token = credentials.access_token url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=%s' % access_token) h = httplib2.Http() result = json.loads(h.request(url, 'GET')[1]) # If there was an error in the access token info, abort. if result.get('error') is not None: response = make_response(json.dumps(result.get('error')), 500) response.headers['Content-Type'] = 'application/json' # # Verify that the access token is used for the intended user. # gplus_id = credentials.id_token['sub'] # if result['user_id'] != gplus_id: # response = make_response(json.dumps("Token's user ID doesn't match given user ID."), # 401) # response.headers['Content-Type'] = 'application/json' # return response # # Verify that the access token is valid for this app. # if result['issued_to'] != CLIENT_ID: # response = make_response(json.dumps("Token's client ID does not match app's."), 401) # response.headers['Content-Type'] = 'application/json' # return response # stored_credentials = login_session.get('credentials') # stored_gplus_id = login_session.get('gplus_id') # if stored_credentials is not None and gplus_id == stored_gplus_id: # response = make_response(json.dumps('Current user is already connected.'), 200) # response.headers['Content-Type'] = 'application/json' # return response print "Step 2 Complete! Access Token : %s " % credentials.access_token #STEP 3 - Find User or make a new one #Get user info h = httplib2.Http() userinfo_url = "https://www.googleapis.com/oauth2/v1/userinfo" params = {'access_token': credentials.access_token, 'alt':'json'} answer = requests.get(userinfo_url, params=params) data = answer.json() name = data['name'] picture = data['picture'] email = data['email'] print('Received:\nName: {}\nPicture: {}\nEmail: {}\n'.format(name, picture, email)) #see if user exists, if it doesn't make a new one user = session.query(User).filter_by(email=email).first() if not user: print('Creating database entry for user...') user = User(username = name, picture = picture, email = email) session.add(user) session.commit() else: print('User already in database') #STEP 4 - Make token token = user.generate_auth_token(600) #STEP 5 - Send back token to the client print('Generated auth token: {}'.format(token)) return jsonify({'token': token.decode('ascii')}) #return jsonify({'token': token.decode('ascii'), 'duration': 600}) else: return 'Unrecoginized Provider' # /token route to get a token for a user with login credentials @app.route('/token') @auth.login_required def get_auth_token(): token = g.user.generate_auth_token() # token.decode(<str>) converts the ASCII "byte-string" to Unicode # Believe Python 2.x only but not sure return jsonify({'token': token.decode('ascii')}) #ADD a /users route here @app.route('/users', methods=['POST']) def registerUser(): try: username = request.json.get('username', '') password = request.json.get('password', '') except AttributeError as err: username = password = None if not username or not password: print('Missing required parameters (username, password).') abort(400) user = session.query(User).filter_by(username=username).first() if user: print('User already exists.') return (jsonify({'message': 'User already exists.'}), 200, {'Location': url_for('get_user', id=user.id, _external=True)}) user = User(username=username) user.hash_password(password) session.add(user) session.commit() return (jsonify({'username': user.username}), 201, {'Location': url_for('get_user', id=user.id, _external=True)}) @app.route('/api/users/<int:id>') def get_user(id): user = session.query(User).filter_by(id=id).one() if not user: abort(400) else: return jsonify({'username': user.username}) @app.route('/resource') @auth.login_required def get_resource(): return jsonify({ 'data': 'Hello, %s!' % g.user.username }) @app.route('/bagels', methods = ['GET','POST']) #protect this route with a required login @auth.login_required def showAllBagels(): if request.method == 'GET': print('Hello {}!'.format(g.user.username)) bagels = session.query(Bagel).all() return jsonify(bagels=[bagel.serialize for bagel in bagels]) elif request.method == 'POST': name = request.json.get('name') description = request.json.get('description') picture = request.json.get('picture') price = request.json.get('price') newBagel = Bagel(name=name, description=description, picture=picture, price=price) session.add(newBagel) session.commit() return jsonify(newBagel.serialize) @app.route('/rate-limited') @ratelimit(limit=300, per=30 * 1) # Limit to 300 requests per 30 seconds def index(): return jsonify({'response':'This is a rate limited response'}) @app.route('/products', methods=['GET', 'POST']) @auth.login_required def showAllProducts(): print('Request: {}'.format(request)) if request.method == 'GET': products = session.query(Product).all() return jsonify(products = [p.serialize for p in products]) if request.method == 'POST': name = request.json.get('name') category = request.json.get('category') price = request.json.get('price') newItem = Product(name=name, category=category, price=price) session.add(newItem) session.commit() return jsonify(newItem.serialize) @app.route('/products/<category>') @auth.login_required def showCategoriedProducts(category): if category == 'fruit': fruit_items = session.query(Product).filter_by(category = 'fruit').all() return jsonify(fruit_products = [f.serialize for f in fruit_items]) if category == 'legume': legume_items = session.query(Product).filter_by(category = 'legume').all() return jsonify(legume_products = [l.serialize for l in legume_items]) if category == 'vegetable': vegetable_items = session.query(Product).filter_by(category = 'vegetable').all() return jsonify(produce_products = [p.serialize for p in produce_items]) @app.route('/catalog') @ratelimit.ratelimit(limit=60, per=60 * 1) # Limit to 300 requests per 30 seconds def getCatalog(): items = session.query(Item).all() #Populate an empty database if items == []: item1 = Item(name="Pineapple", price="$2.50", picture=("https://upload.wikimedia.org/wikipedia/commons/c/" "cb/Pineapple_and_cross_section.jpg"), description="Organically Grown in Hawai'i") session.add(item1) item2 = Item(name="Carrots", price = "$1.99", picture=("http://media.mercola.com/assets/images/food-facts/" "carrot-fb.jpg"), description="High in Vitamin A") session.add(item2) item3 = Item(name="Aluminum Foil", price="$3.50", picture=( "http://images.wisegeek.com/aluminum-foil.jpg"), description= "300 feet long") session.add(item3) item4 = Item(name="Eggs", price="$2.00", picture=( "http://whatsyourdeal.com/grocery-coupons/wp-content/uploads/" "2015/01/eggs.png"), description = "Farm Fresh Organic Eggs") session.add(item4) item5 = Item(name="Bananas", price="$2.15", picture= "http://dreamatico.com/data_images/banana/banana-3.jpg", description="Fresh, delicious, and full of potassium") session.add(item5) session.commit() items = session.query(Item).all() return jsonify(catalog=[i.serialize for i in items]) if __name__ == '__main__': #app.config['SECRET_KEY'] = ''.join(random.choice(string.ascii_uppercase + string.digits) # for x in xrange(32)) app.secret_key = os.urandom(40) app.debug = True app.run(host='0.0.0.0', port=5000) # Watch out for multi-threaded interaction with your database!!! ## app.run(host='0.0.0.0', port=5000, threaded=True) ## app.run(host='0.0.0.0', port=5000, processes=3) ################################################################################################### # Post coding # # Only test for Python 3 compatibility: pylint --py3k <script>.py # pylint <script>.py # Score should be >= 8.0 # Alternatives: # pep8, flake8 # # python warning options: # * -Qwarnall - Believe check for old division usage # * -t - issue warnings about inconsitent tab usage # * -3 - warn about Python 3.x incompatibilities # # python3 warning options: # * -b - issue warnings about mixing strings and bytes # # Future: # * Testing - doctest/unittest/pytest/other # * Logging #
[ 1, 529, 9507, 29958, 7653, 29946, 29914, 7406, 29918, 20943, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 408, 18869, 448, 29930, 29899, 13, 13383, 13383, 13383, 13383, 13383, 13383, 2277, 29937, 13, 29937, 13, 29937, 5132, 1873, 29898, 29879, 29897, 1304, 29914, 1688, 287, 29901, 13, 29937, 334, 5132, 29871, 29906, 29889, 29955, 29889, 29896, 29906, 29899, 29941, 29906, 373, 8294, 29871, 29896, 29953, 29889, 29900, 29946, 29889, 29906, 365, 9375, 13, 29937, 334, 5132, 29871, 29906, 29889, 29955, 29889, 29896, 29941, 29899, 29941, 29906, 373, 3852, 29871, 29955, 13, 29937, 334, 5132, 29871, 29941, 29889, 29945, 29889, 29906, 29899, 29941, 29906, 29871, 373, 8294, 29871, 29896, 29953, 29889, 29900, 29946, 29889, 29906, 365, 9375, 13, 29937, 334, 5132, 29871, 29941, 29889, 29953, 29889, 29896, 29899, 29941, 29906, 29871, 373, 3852, 29871, 29955, 13, 29937, 13, 29937, 8695, 373, 22135, 29901, 13, 29937, 334, 349, 15488, 29871, 29947, 5643, 411, 7472, 1196, 3309, 310, 29871, 29929, 29929, 4890, 313, 9536, 519, 13, 29937, 259, 639, 29901, 2045, 597, 1636, 29889, 4691, 29889, 990, 29914, 3359, 29914, 412, 567, 29914, 412, 29886, 29899, 29900, 29900, 29900, 29947, 8484, 27525, 398, 29899, 1220, 29899, 2848, 29897, 13, 29937, 259, 334, 2431, 2038, 29892, 6589, 322, 1574, 19651, 1818, 367, 21021, 472, 29871, 29955, 29906, 4890, 13, 29937, 259, 334, 4124, 1457, 1259, 445, 408, 925, 278, 3440, 29914, 1514, 1807, 1426, 322, 451, 278, 13, 29937, 268, 8236, 11839, 470, 16321, 525, 13, 29937, 13, 29937, 13, 29937, 25663, 1873, 1304, 29901, 259, 29900, 29889, 29896, 29889, 29906, 13, 29937, 13, 29937, 448, 2683, 2683, 2683, 2683, 2683, 2683, 13, 29937, 13, 29937, 16982, 1041, 29914, 7390, 11310, 1954, 16123, 4110, 29901, 13, 29937, 334, 323, 29121, 13, 29937, 13, 12008, 29966, 5453, 29914, 8860, 6139, 29958, 448, 21954, 11839, 881, 1095, 373, 445, 1196, 565, 13, 259, 373, 301, 4983, 856, 12008, 13, 13, 29937, 16367, 1954, 4011, 448, 19928, 367, 937, 29892, 8128, 5132, 29871, 29906, 29914, 29941, 1006, 3372, 3097, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 539, 396, 1596, 29898, 29966, 19651, 856, 10202, 934, 29922, 9675, 29889, 25393, 29892, 1095, 2433, 29905, 29876, 1495, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 632, 396, 29871, 29941, 29914, 29906, 1275, 29871, 29896, 29889, 29945, 29892, 29871, 29941, 458, 29906, 1275, 29871, 29896, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 418, 396, 5557, 12235, 6198, 24802, 297, 325, 29906, 29889, 29916, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 268, 396, 599, 1347, 4631, 1338, 14914, 408, 29104, 6031, 13, 13, 29937, 1954, 4011, 13, 3166, 29784, 1053, 2379, 1278, 29892, 4390, 1598, 29892, 2009, 29892, 3142, 29918, 1454, 29892, 27450, 29892, 330, 29892, 4050, 29918, 6886, 29892, 1207, 29918, 5327, 13, 3166, 29784, 29918, 1124, 5150, 1053, 7331, 16616, 6444, 13, 3166, 2090, 312, 8789, 1053, 2767, 29918, 17699, 13, 5215, 4390, 13, 3166, 4733, 1053, 7399, 29892, 10976, 29892, 4911, 13, 3166, 288, 5150, 29906, 4645, 29889, 4645, 1053, 4972, 29918, 3166, 29918, 4645, 344, 1037, 1372, 13, 3166, 288, 5150, 29906, 4645, 29889, 4645, 1053, 22787, 1252, 3167, 2392, 13, 5215, 2897, 13, 3166, 282, 2158, 1053, 282, 2158, 13, 5215, 7548, 295, 13083, 13, 5215, 7274, 13, 29937, 3758, 2499, 305, 6764, 6081, 304, 2910, 4413, 304, 2566, 6131, 13, 3166, 4576, 284, 305, 6764, 29889, 1062, 29889, 311, 16544, 1230, 1053, 7669, 1230, 29918, 3188, 13, 29937, 3758, 2499, 305, 6764, 2566, 4386, 304, 16254, 411, 14407, 2566, 13, 3166, 4576, 284, 305, 6764, 29889, 555, 1053, 4867, 28107, 13, 29937, 921, 13, 3166, 4576, 284, 305, 6764, 29889, 555, 1053, 9443, 13, 29937, 3758, 2499, 305, 6764, 3883, 304, 4511, 304, 14407, 2566, 13, 3166, 4576, 284, 305, 6764, 1053, 1653, 29918, 10599, 13, 5215, 931, 13, 13, 29937, 402, 2127, 1338, 13, 29937, 3940, 29901, 29871, 10056, 773, 740, 29914, 1990, 29914, 5696, 2322, 4128, 2012, 13, 29937, 4706, 310, 5534, 17727, 988, 372, 3732, 4060, 13, 29937, 3758, 2499, 305, 6764, 6230, 448, 1653, 385, 2777, 310, 263, 3957, 304, 278, 14407, 13, 29937, 2566, 13, 29937, 13109, 2566, 448, 23299, 29901, 13, 4051, 29918, 10145, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 525, 28045, 29889, 2585, 1495, 13, 10599, 353, 1653, 29918, 10599, 877, 22793, 597, 22208, 718, 6535, 29918, 10145, 29897, 13, 29937, 4803, 4918, 7979, 4176, 29892, 411, 1404, 16653, 29901, 13, 29937, 6012, 353, 1653, 29918, 10599, 877, 29272, 29974, 567, 29891, 9708, 29887, 29906, 597, 28045, 29901, 8186, 29968, 29886, 29925, 645, 29894, 12192, 12064, 29925, 29946, 29956, 29929, 29984, 1537, 28600, 10234, 29968, 29950, 29896, 29945, 29940, 29924, 29896, 29902, 29929, 29953, 29933, 695, 29934, 29956, 29954, 29945, 29992, 29914, 28045, 1495, 13, 29937, 2216, 1854, 825, 445, 947, 470, 565, 372, 29915, 29879, 4312, 13, 5160, 29889, 19635, 29889, 5355, 353, 6012, 13, 29937, 6204, 6323, 29924, 4386, 304, 14407, 2566, 13, 4051, 7317, 353, 4867, 28107, 29898, 5355, 29922, 10599, 29897, 13, 29937, 501, 8485, 304, 16254, 411, 14407, 2566, 13, 7924, 353, 6535, 7317, 580, 13, 29937, 13, 29937, 2379, 1278, 6230, 13, 932, 353, 2379, 1278, 22168, 978, 1649, 29897, 13, 5150, 353, 7331, 16616, 6444, 580, 13, 29937, 13, 29937, 438, 6444, 6230, 13, 29949, 20656, 29950, 29918, 27205, 3919, 29918, 7724, 353, 525, 4645, 29918, 19024, 29918, 3608, 29889, 3126, 29915, 13, 29949, 20656, 29950, 29918, 27205, 3919, 29918, 7724, 29918, 10145, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 438, 20656, 29950, 29918, 27205, 3919, 29918, 7724, 29897, 13, 27205, 3919, 29918, 1367, 353, 4390, 29889, 18132, 29898, 3150, 29898, 29949, 20656, 29950, 29918, 27205, 3919, 29918, 7724, 29918, 10145, 467, 949, 3101, 1839, 2676, 16215, 4645, 29918, 333, 2033, 13, 13, 13, 29937, 4737, 7221, 13, 1649, 8921, 1649, 353, 12801, 5813, 16299, 13, 1649, 12346, 1649, 353, 525, 29926, 1280, 29966, 6333, 29958, 29878, 29966, 6333, 29958, 9278, 29966, 271, 29958, 1131, 29966, 6333, 29958, 510, 29915, 13, 1649, 1256, 1649, 353, 525, 29967, 11850, 29871, 29906, 29947, 29892, 29871, 29906, 29900, 29896, 29955, 29915, 13, 1649, 3259, 1649, 353, 525, 29900, 29889, 29900, 29889, 29896, 29915, 13, 13, 13, 29937, 17100, 403, 1438, 29901, 13, 29992, 5150, 29889, 27902, 29918, 5630, 13, 1753, 11539, 29918, 5630, 29898, 6786, 29892, 4800, 1125, 13, 1678, 1404, 353, 4867, 29889, 1972, 29898, 2659, 467, 4572, 29918, 1609, 29898, 6786, 29922, 6786, 467, 4102, 580, 13, 1678, 396, 3872, 29915, 29873, 864, 304, 26051, 10823, 565, 8952, 451, 1476, 470, 4800, 1147, 2450, 13, 1678, 396, 5229, 448, 445, 723, 1040, 12356, 263, 6993, 23180, 3097, 13, 1678, 565, 451, 1404, 470, 451, 1404, 29889, 27902, 29918, 5630, 29898, 5630, 1125, 13, 4706, 736, 7700, 13, 1678, 1683, 29901, 13, 4706, 330, 29889, 1792, 353, 1404, 13, 4706, 736, 5852, 13, 29937, 13, 29937, 7280, 1873, 29901, 13, 29992, 5150, 29889, 27902, 29918, 5630, 13, 1753, 11539, 29918, 5630, 29898, 6786, 29918, 272, 29918, 6979, 29892, 4800, 1125, 13, 1678, 396, 15870, 304, 1074, 565, 372, 29915, 29879, 263, 5993, 937, 13, 1678, 1404, 29918, 333, 353, 4911, 29889, 27902, 29918, 5150, 29918, 6979, 29898, 6786, 29918, 272, 29918, 6979, 29897, 13, 1678, 565, 1404, 29918, 333, 29901, 13, 4706, 1404, 353, 4867, 29889, 1972, 29898, 2659, 467, 4572, 29918, 1609, 29898, 333, 353, 1404, 29918, 333, 467, 650, 580, 13, 1678, 1683, 29901, 13, 4706, 1404, 353, 4867, 29889, 1972, 29898, 2659, 467, 4572, 29918, 1609, 29898, 6786, 353, 8952, 29918, 272, 29918, 6979, 467, 4102, 580, 13, 4706, 565, 451, 1404, 470, 451, 1404, 29889, 27902, 29918, 5630, 29898, 5630, 1125, 13, 9651, 736, 7700, 13, 1678, 330, 29889, 1792, 353, 1404, 13, 1678, 736, 5852, 13, 29937, 13, 29937, 3872, 29915, 29873, 763, 445, 2948, 988, 5993, 338, 297, 8952, 29892, 825, 1048, 773, 5004, 13, 29937, 4839, 763, 25492, 947, 29973, 13, 29992, 5150, 29889, 27902, 29918, 5630, 13, 1753, 11539, 29918, 5630, 29898, 6786, 29918, 272, 29918, 6979, 29892, 4800, 1125, 13, 1678, 396, 3824, 1423, 565, 967, 263, 5993, 13, 1678, 396, 16171, 3460, 13, 1678, 1596, 877, 29816, 29901, 29871, 426, 6177, 8875, 4286, 4830, 29898, 6786, 29918, 272, 29918, 6979, 29892, 4800, 876, 13, 1678, 1404, 29918, 333, 353, 4911, 29889, 27902, 29918, 5150, 29918, 6979, 29898, 6786, 29918, 272, 29918, 6979, 29897, 13, 1678, 565, 1404, 29918, 333, 29901, 13, 4706, 396, 16171, 3460, 13, 4706, 1596, 877, 7211, 630, 491, 5993, 1495, 13, 4706, 1404, 353, 4867, 29889, 1972, 29898, 2659, 467, 4572, 29918, 1609, 29898, 333, 29922, 1792, 29918, 333, 467, 650, 580, 13, 1678, 1683, 29901, 13, 4706, 396, 16171, 3460, 13, 4706, 1596, 877, 15870, 292, 304, 12725, 491, 8952, 29914, 5630, 856, 1495, 13, 4706, 1404, 353, 4867, 29889, 1972, 29898, 2659, 467, 4572, 29918, 1609, 29898, 6786, 29922, 6786, 29918, 272, 29918, 6979, 467, 4102, 580, 13, 4706, 565, 451, 1404, 470, 451, 1404, 29889, 27902, 29918, 5630, 29898, 5630, 1125, 13, 9651, 396, 16171, 3460, 13, 9651, 1596, 877, 17776, 304, 12725, 4817, 16140, 1495, 13, 9651, 736, 7700, 13, 13, 4706, 396, 16171, 3460, 13, 4706, 1596, 877, 7211, 630, 491, 8952, 29914, 5630, 1495, 13, 13, 1678, 396, 21397, 1319, 10760, 13, 1678, 330, 29889, 1792, 353, 1404, 13, 1678, 736, 5852, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 4645, 29949, 6444, 1495, 13, 1753, 1369, 7295, 13, 1678, 736, 4050, 29918, 6886, 877, 4645, 29949, 6444, 29889, 1420, 1495, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 23106, 29914, 29966, 18121, 29958, 742, 3519, 353, 6024, 5438, 11287, 13, 1753, 6464, 29898, 18121, 1125, 13, 1678, 396, 1596, 877, 3089, 29901, 29871, 6571, 4286, 4830, 29898, 3827, 876, 13, 1678, 396, 1596, 877, 3089, 25956, 27988, 29901, 1495, 13, 1678, 396, 282, 2158, 29898, 3827, 17255, 8977, 1649, 29897, 13, 1678, 396, 1596, 877, 29899, 10457, 29915, 334, 29871, 29906, 29945, 29897, 13, 1678, 396, 1254, 15488, 29871, 29896, 448, 20969, 278, 4817, 775, 13, 1678, 396, 4803, 445, 982, 565, 2734, 7205, 1181, 397, 29918, 1688, 29889, 2272, 2471, 13, 1678, 444, 4817, 29918, 401, 353, 2009, 29889, 3126, 29889, 657, 877, 5150, 29918, 401, 1495, 13, 1678, 396, 4803, 445, 982, 565, 6421, 515, 4714, 13, 1678, 4817, 29918, 401, 353, 2009, 29889, 1272, 13, 1678, 1596, 376, 14448, 29871, 29896, 448, 25034, 29892, 4520, 4817, 775, 1273, 29879, 29908, 1273, 4817, 29918, 401, 13, 1678, 396, 1596, 877, 29899, 10457, 29915, 334, 29871, 29906, 29945, 29897, 13, 1678, 565, 13113, 1275, 525, 3608, 2396, 13, 4706, 396, 1254, 15488, 29871, 29906, 448, 24004, 363, 263, 5993, 13, 4706, 1018, 29901, 13, 9651, 396, 5020, 8228, 278, 28733, 775, 964, 263, 16140, 1203, 13, 9651, 288, 5150, 29918, 1731, 353, 4972, 29918, 3166, 29918, 4645, 344, 1037, 1372, 29898, 29949, 20656, 29950, 29918, 27205, 3919, 29918, 7724, 29892, 6874, 2433, 742, 13, 462, 462, 462, 6684, 29918, 5338, 2433, 2490, 4906, 1495, 13, 9651, 444, 288, 5150, 29918, 1731, 353, 4972, 29918, 3166, 29918, 4645, 344, 1037, 1372, 29898, 29949, 20656, 29950, 29918, 27205, 3919, 29918, 7724, 29892, 6874, 2433, 1495, 13, 9651, 444, 288, 5150, 29918, 1731, 29889, 17886, 29918, 5338, 353, 525, 2490, 4906, 29915, 13, 9651, 16140, 353, 288, 5150, 29918, 1731, 29889, 10568, 29906, 29918, 6543, 29898, 5150, 29918, 401, 29897, 13, 4706, 5174, 22787, 1252, 3167, 2392, 29901, 13, 9651, 2933, 353, 1207, 29918, 5327, 29898, 3126, 29889, 29881, 17204, 877, 17776, 304, 14955, 278, 28733, 775, 29889, 5477, 29871, 29946, 29900, 29896, 29897, 13, 9651, 2933, 29889, 13662, 1839, 3916, 29899, 1542, 2033, 353, 525, 6214, 29914, 3126, 29915, 13, 9651, 736, 2933, 13, 13, 4706, 396, 5399, 393, 278, 2130, 5993, 338, 2854, 29889, 13, 4706, 2130, 29918, 6979, 353, 16140, 29889, 5943, 29918, 6979, 13, 4706, 3142, 353, 6702, 991, 597, 1636, 29889, 15947, 29889, 510, 29914, 23106, 29906, 29914, 29894, 29896, 29914, 6979, 3888, 29973, 5943, 29918, 6979, 16328, 29879, 29915, 1273, 2130, 29918, 6979, 29897, 13, 4706, 298, 353, 1732, 1982, 29906, 29889, 5506, 580, 13, 4706, 1121, 353, 4390, 29889, 18132, 29898, 29882, 29889, 3827, 29898, 2271, 29892, 525, 7194, 29861, 29896, 2314, 13, 4706, 396, 960, 727, 471, 385, 1059, 297, 278, 2130, 5993, 5235, 29892, 27450, 29889, 13, 4706, 565, 1121, 29889, 657, 877, 2704, 1495, 338, 451, 6213, 29901, 13, 9651, 2933, 353, 1207, 29918, 5327, 29898, 3126, 29889, 29881, 17204, 29898, 2914, 29889, 657, 877, 2704, 1495, 511, 29871, 29945, 29900, 29900, 29897, 13, 9651, 2933, 29889, 13662, 1839, 3916, 29899, 1542, 2033, 353, 525, 6214, 29914, 3126, 29915, 13, 13, 4706, 396, 396, 1798, 1598, 393, 278, 2130, 5993, 338, 1304, 363, 278, 9146, 1404, 29889, 13, 4706, 396, 330, 11242, 29918, 333, 353, 16140, 29889, 333, 29918, 6979, 1839, 1491, 2033, 13, 4706, 396, 565, 1121, 1839, 1792, 29918, 333, 2033, 2804, 330, 11242, 29918, 333, 29901, 13, 4706, 396, 268, 2933, 353, 1207, 29918, 5327, 29898, 3126, 29889, 29881, 17204, 703, 6066, 29915, 29879, 1404, 3553, 1838, 29915, 29873, 1993, 2183, 1404, 3553, 1213, 511, 13, 4706, 396, 462, 1669, 29946, 29900, 29896, 29897, 13, 4706, 396, 268, 2933, 29889, 13662, 1839, 3916, 29899, 1542, 2033, 353, 525, 6214, 29914, 3126, 29915, 13, 4706, 396, 268, 736, 2933, 13, 13, 4706, 396, 396, 1798, 1598, 393, 278, 2130, 5993, 338, 2854, 363, 445, 623, 29889, 13, 4706, 396, 565, 1121, 1839, 790, 6742, 29918, 517, 2033, 2804, 24492, 3919, 29918, 1367, 29901, 13, 4706, 396, 268, 2933, 353, 1207, 29918, 5327, 29898, 3126, 29889, 29881, 17204, 703, 6066, 29915, 29879, 3132, 3553, 947, 451, 1993, 623, 29915, 29879, 1213, 511, 29871, 29946, 29900, 29896, 29897, 13, 4706, 396, 268, 2933, 29889, 13662, 1839, 3916, 29899, 1542, 2033, 353, 525, 6214, 29914, 3126, 29915, 13, 4706, 396, 268, 736, 2933, 13, 13, 4706, 396, 6087, 29918, 11944, 9409, 353, 6464, 29918, 7924, 29889, 657, 877, 11944, 9409, 1495, 13, 4706, 396, 6087, 29918, 29887, 11242, 29918, 333, 353, 6464, 29918, 7924, 29889, 657, 877, 29887, 11242, 29918, 333, 1495, 13, 4706, 396, 565, 6087, 29918, 11944, 9409, 338, 451, 6213, 322, 330, 11242, 29918, 333, 1275, 6087, 29918, 29887, 11242, 29918, 333, 29901, 13, 4706, 396, 268, 2933, 353, 1207, 29918, 5327, 29898, 3126, 29889, 29881, 17204, 877, 7583, 1404, 338, 2307, 6631, 29889, 5477, 29871, 29906, 29900, 29900, 29897, 13, 4706, 396, 268, 2933, 29889, 13662, 1839, 3916, 29899, 1542, 2033, 353, 525, 6214, 29914, 3126, 29915, 13, 4706, 396, 268, 736, 2933, 13, 4706, 1596, 376, 14448, 29871, 29906, 25034, 29991, 11028, 25159, 584, 1273, 29879, 376, 1273, 16140, 29889, 5943, 29918, 6979, 13, 13, 4706, 396, 1254, 15488, 29871, 29941, 448, 10987, 4911, 470, 1207, 263, 716, 697, 13, 13, 4706, 396, 2577, 1404, 5235, 13, 4706, 298, 353, 1732, 1982, 29906, 29889, 5506, 580, 13, 4706, 1404, 3888, 29918, 2271, 353, 29871, 376, 991, 597, 1636, 29889, 15947, 29889, 510, 29914, 23106, 29906, 29914, 29894, 29896, 29914, 1792, 3888, 29908, 13, 4706, 8636, 353, 11117, 5943, 29918, 6979, 2396, 16140, 29889, 5943, 29918, 6979, 29892, 525, 1997, 22099, 3126, 10827, 13, 4706, 1234, 353, 7274, 29889, 657, 29898, 1792, 3888, 29918, 2271, 29892, 8636, 29922, 7529, 29897, 13, 13, 4706, 848, 353, 1234, 29889, 3126, 580, 13, 13, 4706, 1024, 353, 848, 1839, 978, 2033, 13, 4706, 7623, 353, 848, 1839, 12095, 2033, 13, 4706, 4876, 353, 848, 1839, 5269, 2033, 13, 13, 4706, 1596, 877, 29816, 3583, 29876, 1170, 29901, 29871, 426, 1012, 29876, 28210, 29901, 29871, 426, 1012, 29876, 9823, 29901, 29871, 426, 1012, 29876, 4286, 4830, 29898, 978, 29892, 7623, 29892, 4876, 876, 13, 4706, 396, 4149, 565, 1404, 4864, 29892, 565, 372, 1838, 29915, 29873, 1207, 263, 716, 697, 13, 4706, 1404, 353, 4867, 29889, 1972, 29898, 2659, 467, 4572, 29918, 1609, 29898, 5269, 29922, 5269, 467, 4102, 580, 13, 4706, 565, 451, 1404, 29901, 13, 9651, 1596, 877, 9832, 1218, 2566, 6251, 363, 1404, 856, 1495, 13, 9651, 1404, 353, 4911, 29898, 6786, 353, 1024, 29892, 7623, 353, 7623, 29892, 4876, 353, 4876, 29897, 13, 9651, 4867, 29889, 1202, 29898, 1792, 29897, 13, 9651, 4867, 29889, 15060, 580, 13, 4706, 1683, 29901, 13, 9651, 1596, 877, 2659, 2307, 297, 2566, 1495, 13, 13, 4706, 396, 1254, 15488, 29871, 29946, 448, 8561, 5993, 13, 4706, 5993, 353, 1404, 29889, 17158, 29918, 5150, 29918, 6979, 29898, 29953, 29900, 29900, 29897, 13, 13, 4706, 396, 1254, 15488, 29871, 29945, 448, 15076, 1250, 5993, 304, 278, 3132, 13, 4706, 1596, 877, 24565, 4817, 5993, 29901, 29871, 6571, 4286, 4830, 29898, 6979, 876, 13, 4706, 736, 4390, 1598, 3319, 29915, 6979, 2396, 5993, 29889, 13808, 877, 294, 18869, 1495, 1800, 13, 13, 4706, 396, 2457, 4390, 1598, 3319, 29915, 6979, 2396, 5993, 29889, 13808, 877, 294, 18869, 5477, 525, 19708, 2396, 29871, 29953, 29900, 29900, 1800, 13, 1678, 1683, 29901, 13, 4706, 736, 525, 2525, 3757, 468, 262, 1891, 1019, 5489, 29915, 13, 13, 13, 29937, 847, 6979, 5782, 304, 679, 263, 5993, 363, 263, 1404, 411, 6464, 16140, 13, 29992, 932, 29889, 13134, 11219, 6979, 1495, 13, 29992, 5150, 29889, 7507, 29918, 12403, 13, 1753, 679, 29918, 5150, 29918, 6979, 7295, 13, 1678, 5993, 353, 330, 29889, 1792, 29889, 17158, 29918, 5150, 29918, 6979, 580, 13, 1678, 396, 5993, 29889, 13808, 29898, 29966, 710, 12948, 29436, 278, 27196, 376, 10389, 29899, 1807, 29908, 304, 23862, 13, 1678, 396, 3741, 2418, 5132, 29871, 29906, 29889, 29916, 871, 541, 451, 1854, 13, 1678, 736, 4390, 1598, 3319, 29915, 6979, 2396, 5993, 29889, 13808, 877, 294, 18869, 1495, 1800, 13, 13, 13, 29937, 17744, 263, 847, 7193, 5782, 1244, 13, 29992, 932, 29889, 13134, 11219, 7193, 742, 3519, 29922, 1839, 5438, 11287, 13, 1753, 6036, 2659, 7295, 13, 1678, 1018, 29901, 13, 4706, 8952, 353, 2009, 29889, 3126, 29889, 657, 877, 6786, 742, 27255, 13, 4706, 4800, 353, 2009, 29889, 3126, 29889, 657, 877, 5630, 742, 27255, 13, 1678, 5174, 23833, 2392, 408, 4589, 29901, 13, 4706, 8952, 353, 4800, 353, 6213, 13, 1678, 565, 451, 8952, 470, 451, 4800, 29901, 13, 4706, 1596, 877, 18552, 292, 3734, 4128, 313, 6786, 29892, 4800, 467, 1495, 13, 4706, 27450, 29898, 29946, 29900, 29900, 29897, 13, 13, 1678, 1404, 353, 4867, 29889, 1972, 29898, 2659, 467, 4572, 29918, 1609, 29898, 6786, 29922, 6786, 467, 4102, 580, 13, 1678, 565, 1404, 29901, 13, 4706, 1596, 877, 2659, 2307, 4864, 29889, 1495, 13, 4706, 736, 313, 3126, 1598, 3319, 29915, 4906, 2396, 525, 2659, 2307, 4864, 6169, 9594, 29871, 29906, 29900, 29900, 29892, 13, 18884, 11117, 6508, 2396, 3142, 29918, 1454, 877, 657, 29918, 1792, 742, 1178, 29922, 1792, 29889, 333, 29892, 903, 23176, 29922, 5574, 26972, 13, 13, 1678, 1404, 353, 4911, 29898, 6786, 29922, 6786, 29897, 13, 1678, 1404, 29889, 8568, 29918, 5630, 29898, 5630, 29897, 13, 1678, 4867, 29889, 1202, 29898, 1792, 29897, 13, 1678, 4867, 29889, 15060, 580, 13, 1678, 736, 313, 3126, 1598, 3319, 29915, 6786, 2396, 1404, 29889, 6786, 9594, 29871, 29906, 29900, 29896, 29892, 11117, 6508, 2396, 13, 9651, 3142, 29918, 1454, 877, 657, 29918, 1792, 742, 1178, 29922, 1792, 29889, 333, 29892, 903, 23176, 29922, 5574, 26972, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 7193, 29914, 29966, 524, 29901, 333, 29958, 1495, 13, 1753, 679, 29918, 1792, 29898, 333, 1125, 13, 1678, 1404, 353, 4867, 29889, 1972, 29898, 2659, 467, 4572, 29918, 1609, 29898, 333, 29922, 333, 467, 650, 580, 13, 1678, 565, 451, 1404, 29901, 13, 4706, 27450, 29898, 29946, 29900, 29900, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 4390, 1598, 3319, 29915, 6786, 2396, 1404, 29889, 6786, 1800, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 10314, 1495, 13, 29992, 5150, 29889, 7507, 29918, 12403, 13, 1753, 679, 29918, 10314, 7295, 13, 1678, 736, 4390, 1598, 3319, 525, 1272, 2396, 525, 10994, 29892, 1273, 29879, 20714, 1273, 330, 29889, 1792, 29889, 6786, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 23156, 1379, 742, 3519, 353, 6024, 7194, 3788, 5438, 11287, 13, 29937, 14676, 312, 445, 5782, 411, 263, 3734, 6464, 13, 29992, 5150, 29889, 7507, 29918, 12403, 13, 1753, 1510, 3596, 23544, 1379, 7295, 13, 1678, 565, 2009, 29889, 5696, 1275, 525, 7194, 2396, 13, 4706, 1596, 877, 10994, 6571, 29991, 4286, 4830, 29898, 29887, 29889, 1792, 29889, 6786, 876, 13, 4706, 19548, 1379, 353, 4867, 29889, 1972, 29898, 23544, 295, 467, 497, 580, 13, 4706, 736, 4390, 1598, 29898, 23156, 1379, 11759, 23156, 295, 29889, 643, 6646, 363, 19548, 295, 297, 19548, 1379, 2314, 13, 1678, 25342, 2009, 29889, 5696, 1275, 525, 5438, 2396, 13, 4706, 1024, 353, 2009, 29889, 3126, 29889, 657, 877, 978, 1495, 13, 4706, 6139, 353, 2009, 29889, 3126, 29889, 657, 877, 8216, 1495, 13, 4706, 7623, 353, 2009, 29889, 3126, 29889, 657, 877, 12095, 1495, 13, 4706, 8666, 353, 2009, 29889, 3126, 29889, 657, 877, 9175, 1495, 13, 4706, 716, 23544, 295, 353, 18341, 295, 29898, 978, 29922, 978, 29892, 6139, 29922, 8216, 29892, 7623, 29922, 12095, 29892, 8666, 29922, 9175, 29897, 13, 4706, 4867, 29889, 1202, 29898, 1482, 23544, 295, 29897, 13, 4706, 4867, 29889, 15060, 580, 13, 4706, 736, 4390, 1598, 29898, 1482, 23544, 295, 29889, 643, 6646, 29897, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 10492, 29899, 29044, 1495, 13, 29992, 3605, 295, 13083, 29898, 13400, 29922, 29941, 29900, 29900, 29892, 639, 29922, 29941, 29900, 334, 29871, 29896, 29897, 29871, 396, 9628, 277, 304, 29871, 29941, 29900, 29900, 7274, 639, 29871, 29941, 29900, 6923, 13, 1753, 2380, 7295, 13, 1678, 736, 4390, 1598, 3319, 29915, 5327, 22099, 4013, 338, 263, 6554, 9078, 2933, 29915, 1800, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 14456, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 11287, 13, 29992, 5150, 29889, 7507, 29918, 12403, 13, 1753, 1510, 3596, 25767, 7295, 13, 1678, 1596, 877, 3089, 29901, 29871, 6571, 4286, 4830, 29898, 3827, 876, 13, 1678, 565, 2009, 29889, 5696, 1275, 525, 7194, 2396, 13, 4706, 9316, 353, 4867, 29889, 1972, 29898, 7566, 467, 497, 580, 13, 4706, 736, 4390, 1598, 29898, 14456, 353, 518, 29886, 29889, 643, 6646, 363, 282, 297, 9316, 2314, 13, 1678, 565, 2009, 29889, 5696, 1275, 525, 5438, 2396, 13, 4706, 1024, 353, 2009, 29889, 3126, 29889, 657, 877, 978, 1495, 13, 4706, 7663, 353, 2009, 29889, 3126, 29889, 657, 877, 7320, 1495, 13, 4706, 8666, 353, 2009, 29889, 3126, 29889, 657, 877, 9175, 1495, 13, 4706, 716, 2001, 353, 10969, 29898, 978, 29922, 978, 29892, 7663, 29922, 7320, 29892, 8666, 29922, 9175, 29897, 13, 4706, 4867, 29889, 1202, 29898, 1482, 2001, 29897, 13, 4706, 4867, 29889, 15060, 580, 13, 4706, 736, 4390, 1598, 29898, 1482, 2001, 29889, 643, 6646, 29897, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 14456, 29914, 29966, 7320, 29958, 1495, 13, 29992, 5150, 29889, 7507, 29918, 12403, 13, 1753, 1510, 29907, 20440, 1000, 25767, 29898, 7320, 1125, 13, 1678, 565, 7663, 1275, 525, 29888, 9216, 2396, 13, 4706, 15774, 29918, 7076, 353, 4867, 29889, 1972, 29898, 7566, 467, 4572, 29918, 1609, 29898, 7320, 353, 525, 29888, 9216, 2824, 497, 580, 13, 4706, 736, 4390, 1598, 29898, 29888, 9216, 29918, 14456, 353, 518, 29888, 29889, 643, 6646, 363, 285, 297, 15774, 29918, 7076, 2314, 13, 1678, 565, 7663, 1275, 525, 1397, 2017, 2396, 13, 4706, 2814, 2017, 29918, 7076, 353, 4867, 29889, 1972, 29898, 7566, 467, 4572, 29918, 1609, 29898, 7320, 353, 525, 1397, 2017, 2824, 497, 580, 13, 4706, 736, 4390, 1598, 29898, 1397, 2017, 29918, 14456, 353, 518, 29880, 29889, 643, 6646, 363, 301, 297, 2814, 2017, 29918, 7076, 2314, 13, 1678, 565, 7663, 1275, 525, 345, 657, 519, 2396, 13, 4706, 18655, 519, 29918, 7076, 353, 4867, 29889, 1972, 29898, 7566, 467, 4572, 29918, 1609, 29898, 7320, 353, 525, 345, 657, 519, 2824, 497, 580, 13, 4706, 736, 4390, 1598, 29898, 5498, 346, 29918, 14456, 353, 518, 29886, 29889, 643, 6646, 363, 282, 297, 7738, 29918, 7076, 2314, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 28045, 1495, 13, 29992, 3605, 295, 13083, 29889, 3605, 295, 13083, 29898, 13400, 29922, 29953, 29900, 29892, 639, 29922, 29953, 29900, 334, 29871, 29896, 29897, 29871, 396, 9628, 277, 304, 29871, 29941, 29900, 29900, 7274, 639, 29871, 29941, 29900, 6923, 13, 1753, 679, 29907, 3968, 7295, 13, 1678, 4452, 353, 4867, 29889, 1972, 29898, 2001, 467, 497, 580, 13, 13, 1678, 396, 12310, 5987, 385, 4069, 2566, 13, 1678, 565, 4452, 1275, 5159, 29901, 13, 4706, 2944, 29896, 353, 10976, 29898, 978, 543, 29925, 457, 11548, 613, 8666, 18965, 29906, 29889, 29945, 29900, 613, 13, 462, 268, 7623, 29922, 703, 991, 597, 9009, 29889, 2851, 3393, 29889, 990, 29914, 6011, 29914, 22382, 29914, 29883, 12975, 13, 462, 795, 376, 10702, 29914, 29925, 457, 11548, 29918, 392, 29918, 19128, 29918, 2042, 29889, 6173, 4968, 13, 462, 268, 6139, 543, 27356, 1711, 402, 4708, 297, 26901, 29915, 29875, 1159, 13, 4706, 4867, 29889, 1202, 29898, 667, 29896, 29897, 13, 4706, 2944, 29906, 353, 10976, 29898, 978, 543, 8179, 307, 1372, 613, 8666, 353, 3908, 29896, 29889, 29929, 29929, 613, 13, 462, 268, 7623, 29922, 703, 1124, 597, 9799, 29889, 1050, 15519, 29889, 510, 29914, 16596, 29914, 8346, 29914, 1181, 397, 29899, 17028, 29879, 12975, 13, 462, 795, 376, 4287, 5450, 29899, 14943, 29889, 6173, 4968, 6139, 543, 16382, 297, 22491, 9103, 319, 1159, 13, 4706, 4867, 29889, 1202, 29898, 667, 29906, 29897, 13, 4706, 2944, 29941, 353, 10976, 29898, 978, 543, 2499, 9735, 398, 28532, 309, 613, 8666, 18965, 29941, 29889, 29945, 29900, 613, 7623, 7607, 13, 462, 268, 376, 1124, 597, 8346, 29889, 29893, 275, 26103, 1416, 29889, 510, 29914, 284, 9735, 398, 29899, 1181, 309, 29889, 6173, 4968, 6139, 29922, 13, 462, 268, 376, 29941, 29900, 29900, 6900, 1472, 1159, 13, 4706, 4867, 29889, 1202, 29898, 667, 29941, 29897, 13, 4706, 2944, 29946, 353, 10976, 29898, 978, 543, 29923, 1505, 29879, 613, 8666, 18965, 29906, 29889, 29900, 29900, 613, 7623, 7607, 13, 462, 268, 376, 1124, 597, 1332, 1446, 8066, 311, 284, 29889, 510, 29914, 29887, 10198, 708, 29899, 29883, 1132, 787, 29914, 11912, 29899, 3051, 29914, 9009, 29879, 12975, 13, 462, 268, 376, 29906, 29900, 29896, 29945, 29914, 29900, 29896, 29914, 387, 3174, 29889, 2732, 4968, 6139, 353, 376, 29943, 2817, 383, 3781, 9205, 293, 382, 1505, 29879, 1159, 13, 4706, 4867, 29889, 1202, 29898, 667, 29946, 29897, 13, 4706, 2944, 29945, 353, 10976, 29898, 978, 543, 29933, 273, 16397, 613, 8666, 18965, 29906, 29889, 29896, 29945, 613, 7623, 29922, 13, 462, 268, 376, 1124, 597, 29881, 1633, 271, 1417, 29889, 510, 29914, 1272, 29918, 8346, 29914, 2571, 1648, 29914, 2571, 1648, 29899, 29941, 29889, 6173, 613, 13, 462, 268, 6139, 543, 29943, 3781, 29892, 628, 14803, 29892, 322, 2989, 310, 3104, 465, 1974, 1159, 13, 4706, 4867, 29889, 1202, 29898, 667, 29945, 29897, 13, 4706, 4867, 29889, 15060, 580, 13, 4706, 4452, 353, 4867, 29889, 1972, 29898, 2001, 467, 497, 580, 13, 1678, 736, 4390, 1598, 29898, 28045, 11759, 29875, 29889, 643, 6646, 363, 474, 297, 4452, 2314, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 396, 932, 29889, 2917, 1839, 1660, 22245, 29911, 29918, 10818, 2033, 353, 525, 4286, 7122, 29898, 8172, 29889, 16957, 29898, 1807, 29889, 294, 18869, 29918, 21064, 4878, 718, 1347, 29889, 7501, 1169, 29897, 13, 1678, 396, 462, 462, 259, 363, 921, 297, 921, 3881, 29898, 29941, 29906, 876, 13, 1678, 623, 29889, 19024, 29918, 1989, 353, 2897, 29889, 332, 2685, 29898, 29946, 29900, 29897, 13, 1678, 623, 29889, 8382, 353, 5852, 13, 1678, 623, 29889, 3389, 29898, 3069, 2433, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 2011, 29922, 29945, 29900, 29900, 29900, 29897, 13, 1678, 396, 24274, 714, 363, 2473, 29899, 7097, 287, 14881, 411, 596, 2566, 21004, 13, 1678, 444, 623, 29889, 3389, 29898, 3069, 2433, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 2011, 29922, 29945, 29900, 29900, 29900, 29892, 3244, 287, 29922, 5574, 29897, 13, 1678, 444, 623, 29889, 3389, 29898, 3069, 2433, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 2011, 29922, 29945, 29900, 29900, 29900, 29892, 10174, 29922, 29941, 29897, 13, 13, 13383, 13383, 13383, 13383, 13383, 13383, 2277, 29937, 13, 29937, 4918, 14137, 13, 29937, 13, 29937, 9333, 1243, 363, 5132, 29871, 29941, 24521, 29901, 29871, 282, 2904, 524, 1192, 2272, 29941, 29895, 529, 2154, 15513, 2272, 13, 29937, 282, 2904, 524, 529, 2154, 15513, 2272, 13, 29937, 259, 2522, 487, 881, 367, 6736, 29871, 29947, 29889, 29900, 13, 29937, 12440, 5056, 29901, 13, 29937, 282, 1022, 29947, 29892, 17422, 446, 29947, 13, 29937, 13, 29937, 3017, 9177, 3987, 29901, 13, 29937, 334, 448, 29984, 25442, 497, 448, 3741, 2418, 1423, 363, 2030, 8542, 8744, 13, 29937, 334, 448, 29873, 448, 2228, 18116, 1048, 22435, 277, 296, 4434, 8744, 13, 29937, 334, 448, 29941, 448, 29383, 1048, 5132, 29871, 29941, 29889, 29916, 297, 12667, 747, 9770, 13, 29937, 13, 29937, 3017, 29941, 9177, 3987, 29901, 13, 29937, 334, 448, 29890, 448, 2228, 18116, 1048, 24907, 6031, 322, 6262, 13, 29937, 13, 29937, 16367, 29901, 13, 29937, 334, 4321, 292, 448, 437, 312, 342, 29914, 348, 27958, 29914, 2272, 1688, 29914, 1228, 13, 29937, 334, 4522, 3460, 13, 29937, 13, 13, 2 ]
tnasnet.py
deepak7376/tNASnet
1
110015
<reponame>deepak7376/tNASnet # -*- coding: utf-8 -*- """tNASnet.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1yl3flXhYBNmjQ2bXVZcXZmhHfHXoSWHB """ import pandas as pd #read the file df = pd.read_csv("/Users/deepak/Documents/OpenSource/tNASnet/dataset/jena_climate_2009_2016.csv") df.head() TRAIN_SPLIT = 3000 uni_data = df['T (degC)'] uni_data.index = df['Date Time'] uni_data.head() uni_data = uni_data.values uni_train_mean = uni_data[:300].mean() uni_train_std = uni_data[:300].std() uni_data = (uni_data-uni_train_mean)/uni_train_std univariate_past_history = 20 univariate_future_target = 0 #pip install tensorboardcolab # from tensorboardcolab import TensorBoardColab, TensorBoardColabCallback # tbc=TensorBoardColab() # univariate stacked lstm example from numpy import array from keras.models import Sequential from keras.layers import LSTM from keras.layers import Dense from sklearn.model_selection import train_test_split # split a univariate sequence def split_sequence(sequence, n_steps): X, y = list(), list() for i in range(len(sequence)): # find the end of this pattern end_ix = i + n_steps # check if we are beyond the sequence if end_ix > len(sequence)-1: break # gather input and output parts of the pattern seq_x, seq_y = sequence[i:end_ix], sequence[end_ix] X.append(seq_x) y.append(seq_y) return array(X), array(y) # define input sequence #raw_seq = [10, 20, 30, 40, 50, 60, 70, 80, 90] # choose a number of time steps n_steps = 20 # split into samples X, y = split_sequence(uni_data, n_steps) # reshape from [samples, timesteps] into [samples, timesteps, features] n_features = 1 X = X.reshape((X.shape[0], X.shape[1], n_features)) # train test split x_train, x_val, y_train, y_val = train_test_split(X, y, test_size=0.2) # # define model # model = Sequential() # model.add(LSTM(50, activation='relu', return_sequences=True, input_shape=(n_steps, n_features))) # model.add(LSTM(50, activation='relu')) # model.add(Dense(1)) # model.compile(optimizer='adam', loss='mse') # # fit model # history = model.fit(x_train, y_train, epochs=2, batch_size = 32, validation_data=(x_val, y_val),verbose=1) #verbose=1, callbacks=[TensorBoardColabCallback(tbc)]) #from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import os import pandas as pd mpl.rcParams['figure.figsize'] = (8, 6) mpl.rcParams['axes.grid'] = False # def create_time_steps(length): # return list(range(-length, 0)) # def show_plot(plot_data, delta, title): # labels = ['History', 'True Future', 'Model Prediction'] # marker = ['.-', 'rx', 'go'] # time_steps = create_time_steps(plot_data[0].shape[0]) # if delta: # future = delta # else: # future = 0 # plt.title(title) # for i, x in enumerate(plot_data): # if i: # plt.plot(future, plot_data[i], marker[i], markersize=10, # label=labels[i]) # else: # plt.plot(time_steps, plot_data[i].flatten(), marker[i], label=labels[i]) # plt.legend() # plt.xlim([time_steps[0], (future+5)*2]) # plt.xlabel('Time-Step') # return plt # show_plot([x_train[0], y_train[0]], 0, 'Sample Example') #pip install deap import random as rnd from deap import base from deap import creator from deap import tools IND_SIZE = 8 creator.create("FitnessMin", base.Fitness, weights=(-1.0,)) creator.create("Individual", list, fitness=creator.FitnessMin) toolbox = base.Toolbox() toolbox.register("attr_pre_abs", (lambda : rnd.choice([0, 1]))) toolbox.register("attr_units", (lambda : rnd.choice([4, 8, 16, 32, 64, 128]))) func_seq = [toolbox.attr_pre_abs, toolbox.attr_units] toolbox.register("individual", tools.initCycle, creator.Individual, func_seq, n=IND_SIZE) toolbox.register("population", tools.initRepeat, list, toolbox.individual) from keras.models import Sequential from keras.layers import LSTM from keras.layers import Dense from keras.layers import Flatten import matplotlib.pyplot as plt import tensorflow as tf def evaluate(individual): num_params = len(func_seq) input_layer_flag = False return_flag = False model = Sequential() for i in range(IND_SIZE): index = i*num_params if individual[index] > 0: if input_layer_flag==False: model.add(LSTM(individual[index+1],activation='relu', input_shape=(n_steps, n_features), return_sequences=True)) input_layer_flag=True else: model.add(LSTM(individual[index+1],activation='relu', return_sequences=True)) return_flag=True # final layer model.add(Flatten()) model.add(Dense(1)) model.compile(loss='mean_squared_error', optimizer='adam') hist = model.fit(x_train, y_train, batch_size = 32, validation_data= (x_val, y_val) , epochs=2 ,verbose=2) print(hist.history['val_loss']) return hist.history['val_loss'][1], def mutate(individual, indpb = 0.5): if rnd.random() < indpb: individual[0] = toolbox.attr_pre_abs() if rnd.random() < indpb: individual[1] = toolbox.attr_units() toolbox.register("evaluate", evaluate) toolbox.register("mutate", mutate, indpb = 0.15) toolbox.register("crossover", tools.cxTwoPoint) toolbox.register("select", tools.selTournament, tournsize = 3) CXPB, MUTPB, NGEN, POPSIZE = 1, 0.2, 2, 4 pop = toolbox.population(n=POPSIZE) print("\n--Initialization--") # Evaluate the entire population fitnesses = list(map(toolbox.evaluate, pop)) for ind, fit in zip(pop, fitnesses): ind.fitness.values = fit # Begin the evolution for g in range(NGEN): print("-- Generation:%i --" % g) # Select the next generation individuals offspring = toolbox.select(pop, len(pop)) # Clone the selected individuals offspring = list(map(toolbox.clone, offspring)) # Apply crossover and mutation on the offspring for child1, child2 in zip(offspring[::2], offspring[1::2]): # cross two individuals with probability CXPB if rnd.random() < CXPB: c1 = toolbox.clone(child1) c2 = toolbox.clone(child2) toolbox.crossover(child1, child2) # fitness values of the children # must be recalculated later if c1!=child1: del child1.fitness.values if c2!=child2: del child2.fitness.values for mutant in offspring: # mutate an individual with probability MUTPB if rnd.random() < MUTPB: #print("mut") #print(mutant) m1 = toolbox.clone(mutant) toolbox.mutate(mutant) if m1!=mutant: del mutant.fitness.values # Evaluate the individuals with an invalid fitness invalid_ind = [ind for ind in offspring if not ind.fitness.valid] print(invalid_ind) fitnesses = map(toolbox.evaluate, invalid_ind) for ind, fit in zip(invalid_ind, fitnesses): ind.fitness.values = fit # print(" Evaluated %i individuals" % len(invalid_ind)) # print(invalid_ind) # The population is entirely replaced by the offspring pop[:] = offspring # Gather all the fitnesses in one list and print the stats fits = [ind.fitness.values[0] for ind in pop] length = len(pop) mean = sum(fits) / length sum2 = sum(x*x for x in fits) std = abs(sum2 / length - mean**2)**0.5 best_ind = tools.selBest(pop, POPSIZE)[0] print("Best individual is %s, %s" % (best_ind, best_ind.fitness.values)) print(" Min %s" % min(fits)) print(" Max %s" % max(fits)) print(" Avg %s" % mean) print(" Std %s" % std) print("-- End of (successful) evolution --")
[ 1, 529, 276, 1112, 420, 29958, 24535, 557, 29955, 29941, 29955, 29953, 29914, 29873, 29940, 3289, 1212, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 29873, 29940, 3289, 1212, 29889, 666, 948, 29890, 13, 13, 28451, 19574, 5759, 491, 1530, 3717, 7606, 29889, 13, 13, 26036, 934, 338, 5982, 472, 13, 1678, 2045, 597, 1054, 370, 29889, 690, 2842, 29889, 3608, 29889, 510, 29914, 21594, 29914, 29896, 2904, 29941, 1579, 29990, 29882, 29979, 29933, 29940, 29885, 29926, 29984, 29906, 29890, 28462, 29999, 29883, 29990, 29999, 29885, 29882, 29950, 29888, 29950, 29990, 29877, 23066, 29950, 29933, 13, 15945, 29908, 13, 5215, 11701, 408, 10518, 13, 29937, 949, 278, 934, 13, 2176, 353, 10518, 29889, 949, 29918, 7638, 11974, 5959, 29914, 24535, 557, 29914, 20128, 29914, 6585, 4435, 29914, 29873, 29940, 3289, 1212, 29914, 24713, 29914, 29926, 2386, 29918, 695, 6490, 29918, 29906, 29900, 29900, 29929, 29918, 29906, 29900, 29896, 29953, 29889, 7638, 1159, 13, 13, 2176, 29889, 2813, 580, 13, 13, 29911, 4717, 1177, 29918, 5550, 29931, 1806, 353, 29871, 29941, 29900, 29900, 29900, 13, 13, 3909, 29918, 1272, 353, 4489, 1839, 29911, 313, 12163, 29907, 29897, 2033, 13, 3909, 29918, 1272, 29889, 2248, 353, 4489, 1839, 2539, 5974, 2033, 13, 3909, 29918, 1272, 29889, 2813, 580, 13, 13, 3909, 29918, 1272, 353, 443, 29875, 29918, 1272, 29889, 5975, 13, 13, 3909, 29918, 14968, 29918, 12676, 353, 443, 29875, 29918, 1272, 7503, 29941, 29900, 29900, 1822, 12676, 580, 13, 3909, 29918, 14968, 29918, 4172, 353, 443, 29875, 29918, 1272, 7503, 29941, 29900, 29900, 1822, 4172, 580, 13, 13, 3909, 29918, 1272, 353, 313, 3909, 29918, 1272, 29899, 3909, 29918, 14968, 29918, 12676, 6802, 3909, 29918, 14968, 29918, 4172, 13, 13, 348, 27432, 403, 29918, 29886, 579, 29918, 18434, 353, 29871, 29906, 29900, 13, 348, 27432, 403, 29918, 29888, 9130, 29918, 5182, 353, 29871, 29900, 13, 13, 29937, 13096, 2601, 12489, 3377, 1054, 370, 13, 13, 29937, 515, 12489, 3377, 1054, 370, 1053, 323, 6073, 28397, 1625, 370, 29892, 323, 6073, 28397, 1625, 370, 10717, 13, 29937, 260, 12328, 29922, 29911, 6073, 28397, 1625, 370, 580, 13, 13, 29937, 443, 27432, 403, 5096, 287, 24471, 29885, 1342, 13, 3166, 12655, 1053, 1409, 13, 3166, 13023, 294, 29889, 9794, 1053, 922, 339, 2556, 13, 3166, 13023, 294, 29889, 29277, 1053, 365, 1254, 29924, 13, 3166, 13023, 294, 29889, 29277, 1053, 360, 1947, 13, 3166, 2071, 19668, 29889, 4299, 29918, 21731, 1053, 7945, 29918, 1688, 29918, 5451, 13, 13, 13, 13, 29937, 6219, 263, 443, 27432, 403, 5665, 13, 1753, 6219, 29918, 16506, 29898, 16506, 29892, 302, 29918, 24530, 1125, 13, 29871, 1060, 29892, 343, 353, 1051, 3285, 1051, 580, 13, 29871, 363, 474, 297, 3464, 29898, 2435, 29898, 16506, 22164, 13, 1678, 396, 1284, 278, 1095, 310, 445, 4766, 13, 1678, 1095, 29918, 861, 353, 474, 718, 302, 29918, 24530, 13, 1678, 396, 1423, 565, 591, 526, 8724, 278, 5665, 13, 1678, 565, 1095, 29918, 861, 1405, 7431, 29898, 16506, 6817, 29896, 29901, 13, 418, 2867, 13, 1678, 396, 11705, 1881, 322, 1962, 5633, 310, 278, 4766, 13, 1678, 19359, 29918, 29916, 29892, 19359, 29918, 29891, 353, 5665, 29961, 29875, 29901, 355, 29918, 861, 1402, 5665, 29961, 355, 29918, 861, 29962, 13, 1678, 1060, 29889, 4397, 29898, 11762, 29918, 29916, 29897, 13, 1678, 343, 29889, 4397, 29898, 11762, 29918, 29891, 29897, 13, 29871, 736, 1409, 29898, 29990, 511, 1409, 29898, 29891, 29897, 13, 13, 29937, 4529, 1881, 5665, 13, 29937, 1610, 29918, 11762, 353, 518, 29896, 29900, 29892, 29871, 29906, 29900, 29892, 29871, 29941, 29900, 29892, 29871, 29946, 29900, 29892, 29871, 29945, 29900, 29892, 29871, 29953, 29900, 29892, 29871, 29955, 29900, 29892, 29871, 29947, 29900, 29892, 29871, 29929, 29900, 29962, 13, 13, 29937, 6755, 263, 1353, 310, 931, 6576, 13, 29876, 29918, 24530, 353, 29871, 29906, 29900, 13, 29937, 6219, 964, 11916, 13, 29990, 29892, 343, 353, 6219, 29918, 16506, 29898, 3909, 29918, 1272, 29892, 302, 29918, 24530, 29897, 13, 29937, 620, 14443, 515, 518, 27736, 29892, 5335, 4196, 567, 29962, 964, 518, 27736, 29892, 5335, 4196, 567, 29892, 5680, 29962, 13, 29876, 29918, 22100, 353, 29871, 29896, 13, 29990, 353, 1060, 29889, 690, 14443, 3552, 29990, 29889, 12181, 29961, 29900, 1402, 1060, 29889, 12181, 29961, 29896, 1402, 302, 29918, 22100, 876, 13, 13, 29937, 7945, 1243, 6219, 13, 29916, 29918, 14968, 29892, 921, 29918, 791, 29892, 343, 29918, 14968, 29892, 343, 29918, 791, 353, 7945, 29918, 1688, 29918, 5451, 29898, 29990, 29892, 343, 29892, 1243, 29918, 2311, 29922, 29900, 29889, 29906, 29897, 13, 29937, 396, 4529, 1904, 13, 29937, 1904, 353, 922, 339, 2556, 580, 13, 29937, 1904, 29889, 1202, 29898, 29931, 1254, 29924, 29898, 29945, 29900, 29892, 26229, 2433, 2674, 29884, 742, 736, 29918, 6831, 2063, 29922, 5574, 29892, 1881, 29918, 12181, 7607, 29876, 29918, 24530, 29892, 302, 29918, 22100, 4961, 13, 29937, 1904, 29889, 1202, 29898, 29931, 1254, 29924, 29898, 29945, 29900, 29892, 26229, 2433, 2674, 29884, 8785, 13, 29937, 1904, 29889, 1202, 29898, 29928, 1947, 29898, 29896, 876, 13, 29937, 1904, 29889, 12198, 29898, 20640, 3950, 2433, 328, 314, 742, 6410, 2433, 29885, 344, 1495, 13, 29937, 396, 6216, 1904, 13, 29937, 4955, 353, 1904, 29889, 9202, 29898, 29916, 29918, 14968, 29892, 343, 29918, 14968, 29892, 21502, 12168, 29922, 29906, 29892, 9853, 29918, 2311, 353, 29871, 29941, 29906, 29892, 8845, 29918, 1272, 7607, 29916, 29918, 791, 29892, 343, 29918, 791, 511, 369, 15828, 29922, 29896, 29897, 13, 3986, 396, 369, 15828, 29922, 29896, 29892, 6939, 29879, 11759, 29911, 6073, 28397, 1625, 370, 10717, 29898, 29873, 12328, 29897, 2314, 13, 13, 29937, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 29892, 8542, 29892, 1596, 29918, 2220, 29892, 29104, 29918, 20889, 1338, 13, 5215, 26110, 408, 15886, 13, 13, 5215, 22889, 408, 286, 572, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 5215, 11701, 408, 10518, 13, 13, 29885, 572, 29889, 2214, 9629, 1839, 4532, 29889, 1003, 2311, 2033, 353, 313, 29947, 29892, 29871, 29953, 29897, 13, 29885, 572, 29889, 2214, 9629, 1839, 1165, 267, 29889, 7720, 2033, 353, 7700, 13, 13, 13, 29937, 822, 1653, 29918, 2230, 29918, 24530, 29898, 2848, 1125, 13, 29937, 259, 736, 1051, 29898, 3881, 6278, 2848, 29892, 29871, 29900, 876, 13, 13, 13, 29937, 822, 1510, 29918, 5317, 29898, 5317, 29918, 1272, 29892, 19471, 29892, 3611, 1125, 13, 29937, 259, 11073, 353, 6024, 20570, 742, 525, 5574, 16367, 742, 525, 3195, 21099, 2463, 2033, 13, 29937, 259, 17456, 353, 518, 4286, 29899, 742, 525, 17697, 742, 525, 1484, 2033, 13, 29937, 259, 931, 29918, 24530, 353, 1653, 29918, 2230, 29918, 24530, 29898, 5317, 29918, 1272, 29961, 29900, 1822, 12181, 29961, 29900, 2314, 13, 29937, 259, 565, 19471, 29901, 13, 29937, 268, 5434, 353, 19471, 13, 29937, 259, 1683, 29901, 13, 29937, 268, 5434, 353, 29871, 29900, 13, 13, 29937, 259, 14770, 29889, 3257, 29898, 3257, 29897, 13, 29937, 259, 363, 474, 29892, 921, 297, 26985, 29898, 5317, 29918, 1272, 1125, 13, 29937, 268, 565, 474, 29901, 13, 29937, 539, 14770, 29889, 5317, 29898, 29888, 9130, 29892, 6492, 29918, 1272, 29961, 29875, 1402, 17456, 29961, 29875, 1402, 29320, 675, 29922, 29896, 29900, 29892, 13, 29937, 18884, 3858, 29922, 21134, 29961, 29875, 2314, 13, 29937, 268, 1683, 29901, 13, 29937, 539, 14770, 29889, 5317, 29898, 2230, 29918, 24530, 29892, 6492, 29918, 1272, 29961, 29875, 1822, 1579, 8606, 3285, 17456, 29961, 29875, 1402, 3858, 29922, 21134, 29961, 29875, 2314, 13, 29937, 259, 14770, 29889, 26172, 580, 13, 29937, 259, 14770, 29889, 29916, 2576, 4197, 2230, 29918, 24530, 29961, 29900, 1402, 313, 29888, 9130, 29974, 29945, 11877, 29906, 2314, 13, 29937, 259, 14770, 29889, 29916, 1643, 877, 2481, 29899, 14448, 1495, 13, 29937, 259, 736, 14770, 13, 13, 29937, 1510, 29918, 5317, 4197, 29916, 29918, 14968, 29961, 29900, 1402, 343, 29918, 14968, 29961, 29900, 20526, 29871, 29900, 29892, 525, 17708, 8741, 1495, 13, 13, 29937, 13096, 2601, 316, 481, 13, 13, 5215, 4036, 408, 364, 299, 13, 3166, 316, 481, 1053, 2967, 13, 3166, 316, 481, 1053, 907, 1061, 13, 3166, 316, 481, 1053, 8492, 13, 13, 22255, 29918, 14226, 353, 29871, 29947, 13, 1037, 1061, 29889, 3258, 703, 29943, 277, 2264, 8140, 613, 2967, 29889, 29943, 277, 2264, 29892, 18177, 29922, 6278, 29896, 29889, 29900, 29892, 876, 13, 1037, 1061, 29889, 3258, 703, 2568, 23352, 613, 1051, 29892, 6216, 2264, 29922, 1037, 1061, 29889, 29943, 277, 2264, 8140, 29897, 13, 13, 10154, 1884, 353, 2967, 29889, 12229, 1884, 580, 13, 10154, 1884, 29889, 9573, 703, 5552, 29918, 1457, 29918, 6897, 613, 313, 2892, 584, 364, 299, 29889, 16957, 4197, 29900, 29892, 29871, 29896, 29962, 4961, 13, 10154, 1884, 29889, 9573, 703, 5552, 29918, 348, 1169, 613, 313, 2892, 584, 364, 299, 29889, 16957, 4197, 29946, 29892, 29871, 29947, 29892, 29871, 29896, 29953, 29892, 29871, 29941, 29906, 29892, 29871, 29953, 29946, 29892, 29871, 29896, 29906, 29947, 29962, 4961, 13, 13, 9891, 29918, 11762, 353, 518, 10154, 1884, 29889, 5552, 29918, 1457, 29918, 6897, 29892, 29871, 13, 9651, 5780, 1884, 29889, 5552, 29918, 348, 1169, 29962, 13, 10154, 1884, 29889, 9573, 703, 513, 23352, 613, 8492, 29889, 2344, 29907, 13317, 29892, 907, 1061, 29889, 2568, 23352, 29892, 13, 462, 3653, 29918, 11762, 29892, 302, 29922, 22255, 29918, 14226, 29897, 13, 10154, 1884, 29889, 9573, 703, 7323, 2785, 613, 8492, 29889, 2344, 1123, 11666, 29892, 1051, 29892, 5780, 1884, 29889, 513, 23352, 29897, 13, 13, 3166, 13023, 294, 29889, 9794, 1053, 922, 339, 2556, 13, 3166, 13023, 294, 29889, 29277, 1053, 365, 1254, 29924, 13, 3166, 13023, 294, 29889, 29277, 1053, 360, 1947, 13, 3166, 13023, 294, 29889, 29277, 1053, 2379, 8606, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 5215, 26110, 408, 15886, 13, 13, 1753, 14707, 29898, 513, 23352, 1125, 13, 13, 1678, 954, 29918, 7529, 353, 7431, 29898, 9891, 29918, 11762, 29897, 13, 1678, 1881, 29918, 13148, 29918, 15581, 353, 7700, 13, 1678, 736, 29918, 15581, 353, 7700, 13, 13, 1678, 1904, 353, 922, 339, 2556, 580, 29871, 13, 13, 1678, 363, 474, 297, 3464, 29898, 22255, 29918, 14226, 1125, 13, 308, 13, 4706, 2380, 353, 474, 29930, 1949, 29918, 7529, 13, 308, 13, 4706, 565, 5375, 29961, 2248, 29962, 1405, 29871, 29900, 29901, 13, 9651, 565, 1881, 29918, 13148, 29918, 15581, 1360, 8824, 29901, 13, 18884, 1904, 29889, 1202, 29898, 29931, 1254, 29924, 29898, 513, 23352, 29961, 2248, 29974, 29896, 1402, 11236, 362, 2433, 2674, 29884, 742, 13, 462, 9651, 1881, 29918, 12181, 7607, 29876, 29918, 24530, 29892, 302, 29918, 22100, 511, 13, 462, 18884, 736, 29918, 6831, 2063, 29922, 5574, 876, 13, 308, 13, 18884, 1881, 29918, 13148, 29918, 15581, 29922, 5574, 13, 308, 13, 9651, 1683, 29901, 13, 18884, 1904, 29889, 1202, 29898, 29931, 1254, 29924, 29898, 513, 23352, 29961, 2248, 29974, 29896, 1402, 11236, 362, 2433, 2674, 29884, 742, 29871, 13, 462, 9651, 736, 29918, 6831, 2063, 29922, 5574, 876, 13, 308, 13, 9651, 736, 29918, 15581, 29922, 5574, 13, 268, 13, 1678, 396, 2186, 7546, 13, 1678, 1904, 29889, 1202, 29898, 29943, 5066, 841, 3101, 13, 1678, 1904, 29889, 1202, 29898, 29928, 1947, 29898, 29896, 876, 13, 1678, 1904, 29889, 12198, 29898, 6758, 2433, 12676, 29918, 26613, 1965, 29918, 2704, 742, 5994, 3950, 2433, 328, 314, 1495, 13, 268, 13, 1678, 9825, 353, 1904, 29889, 9202, 29898, 29916, 29918, 14968, 29892, 343, 29918, 14968, 29892, 9853, 29918, 2311, 353, 29871, 29941, 29906, 29892, 29871, 13, 462, 268, 8845, 29918, 1272, 29922, 313, 29916, 29918, 791, 29892, 343, 29918, 791, 29897, 1919, 13, 462, 268, 21502, 12168, 29922, 29906, 1919, 369, 15828, 29922, 29906, 29897, 13, 268, 13, 1678, 1596, 29898, 29882, 391, 29889, 18434, 1839, 791, 29918, 6758, 11287, 13, 1678, 736, 9825, 29889, 18434, 1839, 791, 29918, 6758, 2033, 29961, 29896, 1402, 13, 13, 1753, 5478, 403, 29898, 513, 23352, 29892, 1399, 24381, 353, 29871, 29900, 29889, 29945, 1125, 13, 1678, 565, 364, 299, 29889, 8172, 580, 529, 1399, 24381, 29901, 13, 4706, 5375, 29961, 29900, 29962, 353, 5780, 1884, 29889, 5552, 29918, 1457, 29918, 6897, 580, 13, 13, 1678, 565, 364, 299, 29889, 8172, 580, 529, 1399, 24381, 29901, 13, 4706, 5375, 29961, 29896, 29962, 353, 5780, 1884, 29889, 5552, 29918, 348, 1169, 580, 13, 13, 10154, 1884, 29889, 9573, 703, 24219, 403, 613, 14707, 29897, 13, 10154, 1884, 29889, 9573, 703, 6149, 403, 613, 5478, 403, 29892, 1399, 24381, 353, 29871, 29900, 29889, 29896, 29945, 29897, 13, 10154, 1884, 29889, 9573, 703, 29883, 1883, 578, 369, 613, 8492, 29889, 18904, 13985, 5228, 29897, 13, 10154, 1884, 29889, 9573, 703, 2622, 613, 8492, 29889, 2838, 29911, 2905, 1166, 29892, 6282, 1983, 675, 353, 29871, 29941, 29897, 13, 13, 29907, 29990, 29925, 29933, 29892, 341, 2692, 29925, 29933, 29892, 405, 24647, 29892, 349, 4590, 14226, 353, 29871, 29896, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29906, 29892, 29871, 29946, 13, 13, 7323, 353, 5780, 1884, 29889, 7323, 2785, 29898, 29876, 29922, 29925, 4590, 14226, 29897, 13, 13, 2158, 14182, 29876, 489, 15514, 2133, 489, 1159, 13, 13, 29937, 382, 4387, 403, 278, 4152, 4665, 13, 9202, 2264, 267, 353, 1051, 29898, 1958, 29898, 10154, 1884, 29889, 24219, 403, 29892, 1835, 876, 13, 1454, 1399, 29892, 6216, 297, 14319, 29898, 7323, 29892, 6216, 2264, 267, 1125, 13, 1678, 1399, 29889, 9202, 2264, 29889, 5975, 353, 6216, 13, 13, 29937, 14893, 278, 14675, 13, 1454, 330, 297, 3464, 29898, 9312, 1430, 1125, 13, 1678, 1596, 703, 489, 28203, 16664, 29875, 1192, 29908, 1273, 330, 29897, 13, 268, 13, 1678, 396, 7605, 278, 2446, 12623, 15724, 13, 1678, 1283, 4278, 353, 5780, 1884, 29889, 2622, 29898, 7323, 29892, 7431, 29898, 7323, 876, 13, 13, 1678, 396, 2233, 650, 278, 4629, 15724, 13, 1678, 1283, 4278, 353, 1051, 29898, 1958, 29898, 10154, 1884, 29889, 16513, 29892, 1283, 4278, 876, 13, 13, 1678, 396, 2401, 368, 274, 1883, 578, 369, 322, 5478, 362, 373, 278, 1283, 4278, 13, 1678, 363, 2278, 29896, 29892, 2278, 29906, 297, 14319, 29898, 2696, 4278, 29961, 1057, 29906, 1402, 1283, 4278, 29961, 29896, 1057, 29906, 29962, 1125, 13, 13, 4706, 396, 4891, 1023, 15724, 411, 6976, 315, 29990, 29925, 29933, 13, 4706, 565, 364, 299, 29889, 8172, 580, 529, 315, 29990, 29925, 29933, 29901, 13, 9651, 274, 29896, 353, 5780, 1884, 29889, 16513, 29898, 5145, 29896, 29897, 13, 9651, 274, 29906, 353, 5780, 1884, 29889, 16513, 29898, 5145, 29906, 29897, 13, 9651, 5780, 1884, 29889, 29883, 1883, 578, 369, 29898, 5145, 29896, 29892, 2278, 29906, 29897, 13, 9651, 396, 6216, 2264, 1819, 310, 278, 4344, 13, 9651, 396, 1818, 367, 337, 15807, 630, 2678, 13, 9651, 565, 274, 29896, 19216, 5145, 29896, 29901, 628, 2278, 29896, 29889, 9202, 2264, 29889, 5975, 13, 9651, 565, 274, 29906, 19216, 5145, 29906, 29901, 628, 2278, 29906, 29889, 9202, 2264, 29889, 5975, 13, 13, 1678, 363, 5478, 424, 297, 1283, 4278, 29901, 13, 4706, 396, 5478, 403, 385, 5375, 411, 6976, 341, 2692, 29925, 29933, 13, 4706, 565, 364, 299, 29889, 8172, 580, 529, 341, 2692, 29925, 29933, 29901, 13, 9651, 396, 2158, 703, 6149, 1159, 13, 9651, 396, 2158, 29898, 6149, 424, 29897, 13, 9651, 286, 29896, 353, 5780, 1884, 29889, 16513, 29898, 6149, 424, 29897, 13, 9651, 5780, 1884, 29889, 6149, 403, 29898, 6149, 424, 29897, 13, 9651, 565, 286, 29896, 19216, 6149, 424, 29901, 628, 5478, 424, 29889, 9202, 2264, 29889, 5975, 13, 268, 13, 1678, 396, 382, 4387, 403, 278, 15724, 411, 385, 8340, 6216, 2264, 13, 1678, 8340, 29918, 513, 353, 518, 513, 363, 1399, 297, 1283, 4278, 565, 451, 1399, 29889, 9202, 2264, 29889, 3084, 29962, 13, 1678, 1596, 29898, 20965, 29918, 513, 29897, 13, 1678, 6216, 2264, 267, 353, 2910, 29898, 10154, 1884, 29889, 24219, 403, 29892, 8340, 29918, 513, 29897, 13, 1678, 363, 1399, 29892, 6216, 297, 14319, 29898, 20965, 29918, 513, 29892, 6216, 2264, 267, 1125, 13, 4706, 1399, 29889, 9202, 2264, 29889, 5975, 353, 6216, 13, 13, 1678, 396, 1596, 703, 29871, 382, 4387, 630, 1273, 29875, 15724, 29908, 1273, 7431, 29898, 20965, 29918, 513, 876, 13, 1678, 396, 1596, 29898, 20965, 29918, 513, 29897, 13, 268, 13, 1678, 396, 450, 4665, 338, 9186, 8611, 491, 278, 1283, 4278, 13, 1678, 1835, 7503, 29962, 353, 1283, 4278, 13, 268, 13, 1678, 396, 402, 1624, 599, 278, 6216, 2264, 267, 297, 697, 1051, 322, 1596, 278, 22663, 13, 1678, 23994, 353, 518, 513, 29889, 9202, 2264, 29889, 5975, 29961, 29900, 29962, 363, 1399, 297, 1835, 29962, 13, 268, 13, 1678, 3309, 353, 7431, 29898, 7323, 29897, 13, 1678, 2099, 353, 2533, 29898, 29888, 1169, 29897, 847, 3309, 13, 1678, 2533, 29906, 353, 2533, 29898, 29916, 29930, 29916, 363, 921, 297, 23994, 29897, 13, 1678, 3659, 353, 6425, 29898, 2083, 29906, 847, 3309, 448, 2099, 1068, 29906, 29897, 1068, 29900, 29889, 29945, 13, 1678, 1900, 29918, 513, 353, 8492, 29889, 2838, 25353, 29898, 7323, 29892, 349, 4590, 14226, 9601, 29900, 29962, 13, 13, 1678, 1596, 703, 25353, 5375, 338, 1273, 29879, 29892, 1273, 29879, 29908, 1273, 313, 13318, 29918, 513, 29892, 1900, 29918, 513, 29889, 9202, 2264, 29889, 5975, 876, 13, 1678, 1596, 703, 29871, 3080, 1273, 29879, 29908, 1273, 1375, 29898, 29888, 1169, 876, 13, 1678, 1596, 703, 29871, 5918, 1273, 29879, 29908, 1273, 4236, 29898, 29888, 1169, 876, 13, 1678, 1596, 703, 29871, 7740, 29887, 1273, 29879, 29908, 1273, 2099, 29897, 13, 1678, 1596, 703, 29871, 624, 29881, 1273, 29879, 29908, 1273, 3659, 29897, 13, 1678, 1596, 703, 489, 2796, 310, 313, 8698, 1319, 29897, 14675, 1192, 1159, 2 ]
setup.py
aaren/pharminv
12
32986
<gh_stars>10-100 import subprocess from setuptools import setup, Extension try: pandoc = subprocess.Popen(['pandoc', 'README.md', '--to', 'rst'], stdout=subprocess.PIPE) readme = pandoc.communicate()[0].decode() except OSError: with open('README.md') as f: readme = f.read() cmdclass = {} try: from Cython.Build import cythonize USE_CYTHON = True except ImportError: USE_CYTHON = False ext = '.pyx' if USE_CYTHON else '.c' try: import numpy except ImportError: exit('Install numpy before installing pharminv.') extensions = [Extension('harminv.charminv', ["harminv/charminv" + ext], include_dirs=[numpy.get_include()], libraries=['harminv'], )] if USE_CYTHON: extensions = cythonize(extensions) from Cython.Distutils import build_ext cmdclass.update(build_ext=build_ext) setup( name='pharminv', version="0.4", description='Python interface to harminv', long_description=readme, packages=['harminv'], author="<NAME>", author_email='<EMAIL>', license='GPLv3', url='http://github.com/aaren/pharminv', cmdclass=cmdclass, ext_modules=extensions )
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 1014, 5014, 13, 13, 3166, 731, 21245, 8789, 1053, 6230, 29892, 7338, 2673, 13, 13, 2202, 29901, 13, 1678, 282, 392, 542, 353, 1014, 5014, 29889, 29925, 3150, 18959, 29886, 392, 542, 742, 525, 16310, 2303, 29889, 3487, 742, 525, 489, 517, 742, 525, 29878, 303, 7464, 13, 462, 795, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29897, 13, 1678, 1303, 1004, 353, 282, 392, 542, 29889, 27820, 403, 580, 29961, 29900, 1822, 13808, 580, 13, 13, 19499, 438, 29173, 29901, 13, 1678, 411, 1722, 877, 16310, 2303, 29889, 3487, 1495, 408, 285, 29901, 13, 4706, 1303, 1004, 353, 285, 29889, 949, 580, 13, 13, 9006, 1990, 353, 6571, 13, 13, 2202, 29901, 13, 1678, 515, 315, 1656, 29889, 8893, 1053, 274, 1656, 675, 13, 1678, 501, 1660, 29918, 29907, 29979, 4690, 1164, 353, 5852, 13, 19499, 16032, 2392, 29901, 13, 1678, 501, 1660, 29918, 29907, 29979, 4690, 1164, 353, 7700, 13, 13, 1062, 353, 15300, 2272, 29916, 29915, 565, 501, 1660, 29918, 29907, 29979, 4690, 1164, 1683, 15300, 29883, 29915, 13, 13, 2202, 29901, 13, 1678, 1053, 12655, 13, 19499, 16032, 2392, 29901, 13, 1678, 6876, 877, 23271, 12655, 1434, 15476, 1374, 279, 1195, 29894, 29889, 1495, 13, 13, 24299, 353, 518, 17657, 877, 8222, 1195, 29894, 29889, 3090, 1195, 29894, 742, 13, 462, 4706, 6796, 8222, 1195, 29894, 29914, 3090, 1195, 29894, 29908, 718, 1294, 1402, 13, 462, 4706, 3160, 29918, 3972, 29879, 11759, 23749, 29889, 657, 29918, 2856, 580, 1402, 13, 462, 4706, 9562, 29922, 1839, 8222, 1195, 29894, 7464, 13, 462, 4706, 1723, 29962, 13, 13, 361, 501, 1660, 29918, 29907, 29979, 4690, 1164, 29901, 13, 1678, 17752, 353, 274, 1656, 675, 29898, 24299, 29897, 13, 1678, 515, 315, 1656, 29889, 13398, 13239, 1053, 2048, 29918, 1062, 13, 1678, 9920, 1990, 29889, 5504, 29898, 4282, 29918, 1062, 29922, 4282, 29918, 1062, 29897, 13, 13, 14669, 29898, 13, 1678, 1024, 2433, 561, 279, 1195, 29894, 742, 13, 1678, 1873, 543, 29900, 29889, 29946, 613, 13, 1678, 6139, 2433, 11980, 5067, 304, 4023, 1195, 29894, 742, 13, 1678, 1472, 29918, 8216, 29922, 949, 1004, 29892, 13, 1678, 9741, 29922, 1839, 8222, 1195, 29894, 7464, 13, 1678, 4148, 543, 29966, 5813, 28341, 13, 1678, 4148, 29918, 5269, 2433, 29966, 26862, 6227, 29958, 742, 13, 1678, 19405, 2433, 29954, 7390, 29894, 29941, 742, 13, 1678, 3142, 2433, 1124, 597, 3292, 29889, 510, 29914, 4025, 264, 29914, 561, 279, 1195, 29894, 742, 13, 1678, 9920, 1990, 29922, 9006, 1990, 29892, 13, 1678, 1294, 29918, 7576, 29922, 24299, 13, 29897, 13, 2 ]
chronos/docker/chronos/main.py
guadaltech/kubernetes-containers-tools
6
44836
#!/usr/bin/python3 # -*- coding: utf-8 -*- # By: <NAME> (Tedezed) # Source: https://github.com/Tedezed # Mail: <EMAIL> from sys import argv from copy import deepcopy from chronos import * from module_control import * debug = True def argument_to_dic(list): dic = {} for z in list: dic[z[0]] = z[1] return dic def main(): list_argv = [] argv_ext = deepcopy(argv) argv_ext.remove(argv_ext[0]) for elements in argv_ext: var_input = elements.split("=") if len(var_input) == 1 or var_input[1] == '': raise NameError('[ERROR] (main) Invalid Arguments [python example.py var="text"]') list_argv.append(var_input) dic_argv = argument_to_dic(list_argv) chronos_backup = chronos(dic_argv, debug) chronos_backup.check_disk("/chronos/backups") try: chronos_backup.start_chronos() except Exception as error: print("[ERROR] (main) %s" % str(error)) logging.error(error) send_mail("[ERROR] Mode %s" \ % ("(main)"), str(error).replace("<","").replace(">",""), debug) else: print("[ERROR] (main) Mode not found") if __name__ == '__main__': # Start main()
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 29937, 2648, 29901, 529, 5813, 29958, 313, 29911, 2742, 24688, 29897, 13, 29937, 7562, 29901, 2045, 597, 3292, 29889, 510, 29914, 29911, 2742, 24688, 13, 29937, 18623, 29901, 529, 26862, 6227, 29958, 13, 13, 3166, 10876, 1053, 1852, 29894, 13, 3166, 3509, 1053, 6483, 8552, 13, 13, 3166, 17168, 359, 1053, 334, 13, 3166, 3883, 29918, 6451, 1053, 334, 13, 13, 8382, 353, 5852, 13, 13, 1753, 2980, 29918, 517, 29918, 27774, 29898, 1761, 1125, 13, 1678, 12124, 353, 6571, 13, 1678, 363, 503, 297, 1051, 29901, 13, 4706, 12124, 29961, 29920, 29961, 29900, 5262, 353, 503, 29961, 29896, 29962, 13, 1678, 736, 12124, 13, 13, 1753, 1667, 7295, 13, 1678, 1051, 29918, 19218, 353, 5159, 13, 1678, 1852, 29894, 29918, 1062, 353, 6483, 8552, 29898, 19218, 29897, 13, 13, 1678, 1852, 29894, 29918, 1062, 29889, 5992, 29898, 19218, 29918, 1062, 29961, 29900, 2314, 13, 1678, 363, 3161, 297, 1852, 29894, 29918, 1062, 29901, 13, 4706, 722, 29918, 2080, 353, 3161, 29889, 5451, 703, 543, 29897, 13, 4706, 565, 7431, 29898, 1707, 29918, 2080, 29897, 1275, 29871, 29896, 470, 722, 29918, 2080, 29961, 29896, 29962, 1275, 525, 2396, 13, 9651, 12020, 4408, 2392, 877, 29961, 11432, 29962, 313, 3396, 29897, 21403, 11842, 9331, 518, 4691, 1342, 29889, 2272, 722, 543, 726, 3108, 1495, 13, 4706, 1051, 29918, 19218, 29889, 4397, 29898, 1707, 29918, 2080, 29897, 13, 1678, 12124, 29918, 19218, 353, 2980, 29918, 517, 29918, 27774, 29898, 1761, 29918, 19218, 29897, 13, 13, 1678, 17168, 359, 29918, 1627, 786, 353, 17168, 359, 29898, 27774, 29918, 19218, 29892, 4744, 29897, 13, 1678, 17168, 359, 29918, 1627, 786, 29889, 3198, 29918, 20960, 11974, 5904, 359, 29914, 1627, 14340, 1159, 13, 13, 1678, 1018, 29901, 13, 4706, 17168, 359, 29918, 1627, 786, 29889, 2962, 29918, 5904, 359, 580, 13, 1678, 5174, 8960, 408, 1059, 29901, 13, 4706, 1596, 703, 29961, 11432, 29962, 313, 3396, 29897, 1273, 29879, 29908, 1273, 851, 29898, 2704, 876, 13, 4706, 12183, 29889, 2704, 29898, 2704, 29897, 13, 4706, 3638, 29918, 2549, 703, 29961, 11432, 29962, 21864, 1273, 29879, 29908, 320, 13, 9651, 1273, 4852, 29898, 3396, 29897, 4968, 851, 29898, 2704, 467, 6506, 28945, 3284, 2564, 6506, 703, 29958, 3284, 4968, 4744, 29897, 13, 13, 1678, 1683, 29901, 13, 4706, 1596, 703, 29961, 11432, 29962, 313, 3396, 29897, 21864, 451, 1476, 1159, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 396, 7370, 13, 1678, 1667, 580, 13, 2 ]
_solved/_solutions/visualization_02_seaborn14.py
jorisvandenbossche/ICES-python-data
1
35045
<reponame>jorisvandenbossche/ICES-python-data # Optional solution with tidy data representation (providing x and y) monthly_victim_counts_melt = monthly_victim_counts.reset_index().melt( id_vars="datetime", var_name="victim_type", value_name="count" ) sns.relplot( data=monthly_victim_counts_melt, x="datetime", y="count", hue="victim_type", kind="line", palette="colorblind", height=3, aspect=4, )
[ 1, 529, 276, 1112, 420, 29958, 3418, 275, 29894, 7257, 27737, 5955, 29914, 2965, 2890, 29899, 4691, 29899, 1272, 13, 29937, 28379, 1650, 411, 10668, 29891, 848, 8954, 313, 16123, 4821, 921, 322, 343, 29897, 13, 10874, 368, 29918, 29894, 919, 326, 29918, 2798, 29879, 29918, 29885, 2152, 353, 4098, 368, 29918, 29894, 919, 326, 29918, 2798, 29879, 29889, 12071, 29918, 2248, 2141, 29885, 2152, 29898, 13, 1678, 1178, 29918, 16908, 543, 12673, 613, 722, 29918, 978, 543, 29894, 919, 326, 29918, 1853, 613, 995, 29918, 978, 543, 2798, 29908, 13, 29897, 13, 13, 29879, 1983, 29889, 2674, 5317, 29898, 13, 1678, 848, 29922, 10874, 368, 29918, 29894, 919, 326, 29918, 2798, 29879, 29918, 29885, 2152, 29892, 13, 1678, 921, 543, 12673, 613, 29871, 13, 1678, 343, 543, 2798, 613, 13, 1678, 298, 434, 543, 29894, 919, 326, 29918, 1853, 613, 13, 1678, 2924, 543, 1220, 613, 13, 1678, 282, 26456, 543, 2780, 2204, 513, 613, 13, 1678, 3171, 29922, 29941, 29892, 9565, 29922, 29946, 29892, 13, 29897, 2 ]
klien.py
amirsayonara/SYR-Python-Voice-Talk
0
67455
<reponame>amirsayonara/SYR-Python-Voice-Talk import socket, threading, pyaudio class Klien: def __init__(self, ip, port, nama_channel): self.ip = ip self.port = port self.channel = nama_channel self._tersambung = 0 def sambungkan(self): if self._tersambung: return self._s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: self._s.connect((self.ip, self.port)) except: print('Tidak dapat terhubung ke server') return chunk_size = 1024 # 512 audio_format = pyaudio.paInt16 channels = 1 rate = 20000 # penyiapan mic dan speaker self.p = pyaudio.PyAudio() self.playing_stream = self.p.open(format=audio_format, channels=channels, rate=rate, output=True, frames_per_buffer=chunk_size) self.recording_stream = self.p.open(format=audio_format, channels=channels, rate=rate, input=True, frames_per_buffer=chunk_size) print("Terhubung server") try: self._s.sendall(self.channel.encode()) print('Terhubung ke channel', self.channel) except: self._s.close() print('Koneksi terputus') threading.Thread(target=self._menerima_data).start() threading.Thread(target=self._mengirim_data).start() self._tersambung = 1 def _mengirim_data(self): self.mengirim = 1 while 1: if self.mengirim: try: data = self.recording_stream.read(1024) self._s.sendall(data) except: self._s.close() self._tersambung = 0 print('Koneksi terputus') break def _menerima_data(self): self.menerima = 1 while 1: try: data = self._s.recv(1024) if self.menerima: self.playing_stream.write(data) except: self._s.close() self._tersambung = 0 print('Koneksi terputus') break def putuskan(self): self._tersambung = 0 self._s.close()
[ 1, 529, 276, 1112, 420, 29958, 314, 12935, 388, 265, 2518, 29914, 14816, 29934, 29899, 11980, 29899, 29963, 29877, 625, 29899, 29911, 2235, 13, 5215, 9909, 29892, 3244, 292, 29892, 282, 3761, 2881, 13, 13, 1990, 476, 492, 264, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 10377, 29892, 2011, 29892, 302, 3304, 29918, 12719, 1125, 13, 4706, 1583, 29889, 666, 353, 10377, 13, 4706, 1583, 29889, 637, 353, 2011, 13, 4706, 1583, 29889, 12719, 353, 302, 3304, 29918, 12719, 13, 4706, 1583, 3032, 2153, 1117, 686, 353, 29871, 29900, 13, 308, 13, 1678, 822, 269, 1117, 686, 11052, 29898, 1311, 1125, 13, 4706, 565, 1583, 3032, 2153, 1117, 686, 29901, 736, 13, 13, 4706, 1583, 3032, 29879, 353, 9909, 29889, 11514, 29898, 11514, 29889, 5098, 29918, 1177, 2544, 29892, 9909, 29889, 6156, 7077, 29918, 1254, 1525, 5194, 29897, 13, 4706, 1018, 29901, 13, 9651, 1583, 3032, 29879, 29889, 6915, 3552, 1311, 29889, 666, 29892, 1583, 29889, 637, 876, 13, 4706, 5174, 29901, 13, 9651, 1596, 877, 29911, 333, 557, 270, 26347, 1935, 29882, 431, 686, 1589, 1923, 1495, 13, 9651, 736, 13, 308, 13, 4706, 19875, 29918, 2311, 353, 29871, 29896, 29900, 29906, 29946, 396, 29871, 29945, 29896, 29906, 13, 4706, 10348, 29918, 4830, 353, 282, 3761, 2881, 29889, 3274, 2928, 29896, 29953, 13, 4706, 18196, 353, 29871, 29896, 13, 4706, 6554, 353, 29871, 29906, 29900, 29900, 29900, 29900, 13, 13, 4706, 396, 6584, 29891, 423, 8357, 20710, 6025, 25657, 13, 4706, 1583, 29889, 29886, 353, 282, 3761, 2881, 29889, 19737, 17111, 580, 13, 4706, 1583, 29889, 1456, 292, 29918, 5461, 353, 1583, 29889, 29886, 29889, 3150, 29898, 4830, 29922, 18494, 29918, 4830, 29892, 18196, 29922, 305, 12629, 29892, 6554, 29922, 10492, 29892, 1962, 29922, 5574, 29892, 16608, 29918, 546, 29918, 9040, 29922, 29812, 29918, 2311, 29897, 13, 4706, 1583, 29889, 3757, 3278, 29918, 5461, 353, 1583, 29889, 29886, 29889, 3150, 29898, 4830, 29922, 18494, 29918, 4830, 29892, 18196, 29922, 305, 12629, 29892, 6554, 29922, 10492, 29892, 1881, 29922, 5574, 29892, 16608, 29918, 546, 29918, 9040, 29922, 29812, 29918, 2311, 29897, 13, 308, 13, 4706, 1596, 703, 29911, 261, 29882, 431, 686, 1923, 1159, 13, 308, 13, 4706, 1018, 29901, 13, 9651, 1583, 3032, 29879, 29889, 6717, 497, 29898, 1311, 29889, 12719, 29889, 12508, 3101, 13, 9651, 1596, 877, 29911, 261, 29882, 431, 686, 1589, 8242, 742, 1583, 29889, 12719, 29897, 13, 4706, 5174, 29901, 13, 9651, 1583, 3032, 29879, 29889, 5358, 580, 13, 9651, 1596, 877, 29968, 650, 29895, 1039, 1935, 649, 375, 1495, 13, 13, 4706, 3244, 292, 29889, 4899, 29898, 5182, 29922, 1311, 3032, 29885, 759, 2946, 29918, 1272, 467, 2962, 580, 13, 4706, 3244, 292, 29889, 4899, 29898, 5182, 29922, 1311, 3032, 29885, 996, 381, 326, 29918, 1272, 467, 2962, 580, 13, 13, 4706, 1583, 3032, 2153, 1117, 686, 353, 29871, 29896, 13, 13, 1678, 822, 903, 29885, 996, 381, 326, 29918, 1272, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29885, 996, 381, 326, 353, 29871, 29896, 13, 4706, 1550, 29871, 29896, 29901, 13, 9651, 565, 1583, 29889, 29885, 996, 381, 326, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 848, 353, 1583, 29889, 3757, 3278, 29918, 5461, 29889, 949, 29898, 29896, 29900, 29906, 29946, 29897, 13, 462, 1678, 1583, 3032, 29879, 29889, 6717, 497, 29898, 1272, 29897, 13, 18884, 5174, 29901, 13, 462, 1678, 1583, 3032, 29879, 29889, 5358, 580, 13, 462, 1678, 1583, 3032, 2153, 1117, 686, 353, 29871, 29900, 13, 462, 1678, 1596, 877, 29968, 650, 29895, 1039, 1935, 649, 375, 1495, 13, 462, 1678, 2867, 13, 13, 1678, 822, 903, 29885, 759, 2946, 29918, 1272, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29885, 759, 2946, 353, 29871, 29896, 13, 4706, 1550, 29871, 29896, 29901, 13, 9651, 1018, 29901, 13, 18884, 848, 353, 1583, 3032, 29879, 29889, 3757, 29894, 29898, 29896, 29900, 29906, 29946, 29897, 13, 18884, 565, 1583, 29889, 29885, 759, 2946, 29901, 13, 462, 1678, 1583, 29889, 1456, 292, 29918, 5461, 29889, 3539, 29898, 1272, 29897, 13, 9651, 5174, 29901, 13, 18884, 1583, 3032, 29879, 29889, 5358, 580, 13, 18884, 1583, 3032, 2153, 1117, 686, 353, 29871, 29900, 13, 18884, 1596, 877, 29968, 650, 29895, 1039, 1935, 649, 375, 1495, 13, 18884, 2867, 13, 13, 1678, 822, 1925, 375, 11052, 29898, 1311, 1125, 13, 4706, 1583, 3032, 2153, 1117, 686, 353, 29871, 29900, 13, 4706, 1583, 3032, 29879, 29889, 5358, 580, 2 ]
core/views.py
DjangoBoston/django-mulsite
0
45815
from django.contrib.sites.models import Site from django.contrib.auth import get_user_model from django.contrib.sites.shortcuts import get_current_site from rest_framework import viewsets from core.models import SiteUser from core import sites from core.serializers import SiteUserSerializer, SiteSerializer, UserSerializer class UserViewSet(viewsets.ModelViewSet): model = get_user_model() serializer_class = UserSerializer def get_queryset(self): site = get_current_site(self.request) queryset = sites.get_users_for_site(site) return queryset class SiteUserViewSet(viewsets.ModelViewSet): model = SiteUser serializer_class = SiteUserSerializer def get_queryset(self): site = get_current_site(self.request) queryset = sites.get_siteusers_for_site(site) return queryset class SiteViewSet(viewsets.ReadOnlyModelViewSet): """ TODO: Restrict this viewset to global admins Example: Users who have `is_superuser` set to `True` """ model = Site queryset = Site.objects.all() serializer_class = SiteSerializer
[ 1, 29871, 13, 3166, 9557, 29889, 21570, 29889, 16315, 29889, 9794, 1053, 10781, 13, 3166, 9557, 29889, 21570, 29889, 5150, 1053, 679, 29918, 1792, 29918, 4299, 13, 3166, 9557, 29889, 21570, 29889, 16315, 29889, 12759, 7582, 29879, 1053, 679, 29918, 3784, 29918, 2746, 13, 13, 3166, 1791, 29918, 4468, 1053, 1776, 7224, 13, 13, 3166, 7136, 29889, 9794, 1053, 10781, 2659, 13, 3166, 7136, 1053, 11840, 13, 3166, 7136, 29889, 15550, 19427, 1053, 10781, 2659, 17679, 29892, 10781, 17679, 29892, 4911, 17679, 13, 13, 13, 1990, 4911, 1043, 2697, 29898, 1493, 7224, 29889, 3195, 1043, 2697, 1125, 13, 1678, 1904, 353, 679, 29918, 1792, 29918, 4299, 580, 13, 1678, 7797, 3950, 29918, 1990, 353, 4911, 17679, 13, 13, 1678, 822, 679, 29918, 1972, 842, 29898, 1311, 1125, 13, 4706, 3268, 353, 679, 29918, 3784, 29918, 2746, 29898, 1311, 29889, 3827, 29897, 13, 4706, 2346, 842, 353, 11840, 29889, 657, 29918, 7193, 29918, 1454, 29918, 2746, 29898, 2746, 29897, 13, 4706, 736, 2346, 842, 13, 13, 13, 1990, 10781, 2659, 1043, 2697, 29898, 1493, 7224, 29889, 3195, 1043, 2697, 1125, 13, 1678, 1904, 353, 10781, 2659, 13, 1678, 7797, 3950, 29918, 1990, 353, 10781, 2659, 17679, 13, 13, 1678, 822, 679, 29918, 1972, 842, 29898, 1311, 1125, 13, 4706, 3268, 353, 679, 29918, 3784, 29918, 2746, 29898, 1311, 29889, 3827, 29897, 13, 4706, 2346, 842, 353, 11840, 29889, 657, 29918, 2746, 7193, 29918, 1454, 29918, 2746, 29898, 2746, 29897, 13, 4706, 736, 2346, 842, 13, 13, 13, 1990, 10781, 1043, 2697, 29898, 1493, 7224, 29889, 6359, 11730, 3195, 1043, 2697, 1125, 13, 1678, 9995, 13, 1678, 14402, 29901, 11654, 4146, 445, 1776, 842, 304, 5534, 7336, 1144, 13, 1678, 8741, 29901, 23861, 1058, 505, 421, 275, 29918, 9136, 1792, 29952, 731, 304, 421, 5574, 29952, 13, 1678, 9995, 13, 1678, 1904, 353, 10781, 13, 1678, 2346, 842, 353, 10781, 29889, 12650, 29889, 497, 580, 13, 1678, 7797, 3950, 29918, 1990, 353, 10781, 17679, 13, 2 ]
DjangoTry/testDJ/main/migrations/0001_initial.py
PavelKoksharov/QR-BOOK
0
189489
# Generated by Django 4.0.1 on 2022-01-17 21:56 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Books', fields=[ ('Id', models.AutoField(primary_key=True, serialize=False)), ('BookTitle', models.CharField(max_length=100, verbose_name='Название Книги')), ('Author', models.CharField(default='Неизвестен', max_length=50, verbose_name='Автор')), ('Year', models.IntegerField(default=0, verbose_name='Год')), ('Position', models.CharField(default=None, max_length=4, unique=True, verbose_name='Ячейка')), ('Description', models.TextField(default='Простое описание', verbose_name='Описание')), ('InfoForDocuments', models.TextField(default='В конец', verbose_name='Для ссылок в библиографический список')), ('Free', models.BooleanField(default=True, verbose_name='Наличие')), ('Img', models.ImageField(upload_to='static/UploadImg', verbose_name='Img')), ], options={ 'verbose_name': 'Книга', 'verbose_name_plural': 'Книги', }, ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29946, 29889, 29900, 29889, 29896, 373, 29871, 29906, 29900, 29906, 29906, 29899, 29900, 29896, 29899, 29896, 29955, 29871, 29906, 29896, 29901, 29945, 29953, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 2847, 353, 5852, 13, 13, 1678, 9962, 353, 518, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 10967, 29879, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 1204, 742, 4733, 29889, 12300, 3073, 29898, 16072, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 8243, 13, 18884, 6702, 10967, 7030, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 26952, 29918, 978, 2433, 19193, 7617, 1755, 1069, 507, 1892, 1495, 511, 13, 18884, 6702, 13720, 742, 4733, 29889, 27890, 29898, 4381, 2433, 30029, 29919, 6531, 10411, 656, 742, 4236, 29918, 2848, 29922, 29945, 29900, 29892, 26952, 29918, 978, 2433, 30018, 29942, 2374, 1495, 511, 13, 18884, 6702, 12883, 742, 4733, 29889, 7798, 3073, 29898, 4381, 29922, 29900, 29892, 26952, 29918, 978, 2433, 30040, 10285, 1495, 511, 13, 18884, 6702, 8003, 742, 4733, 29889, 27890, 29898, 4381, 29922, 8516, 29892, 4236, 29918, 2848, 29922, 29946, 29892, 5412, 29922, 5574, 29892, 26952, 29918, 978, 2433, 30096, 22587, 642, 1495, 511, 13, 18884, 6702, 9868, 742, 4733, 29889, 15778, 29898, 4381, 2433, 30013, 576, 1578, 29919, 614, 7832, 1755, 742, 26952, 29918, 978, 2433, 30038, 7832, 1755, 1495, 511, 13, 18884, 6702, 3401, 2831, 20128, 742, 4733, 29889, 15778, 29898, 4381, 2433, 30012, 1046, 27720, 742, 26952, 29918, 978, 2433, 30032, 1225, 531, 5551, 16023, 490, 5660, 5116, 8755, 14760, 531, 18021, 1495, 511, 13, 18884, 6702, 20475, 742, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 5574, 29892, 26952, 29918, 978, 2433, 30029, 12172, 1499, 29919, 1495, 511, 13, 18884, 6702, 25518, 742, 4733, 29889, 2940, 3073, 29898, 9009, 29918, 517, 2433, 7959, 29914, 17553, 25518, 742, 26952, 29918, 978, 2433, 25518, 1495, 511, 13, 9651, 21251, 13, 9651, 3987, 3790, 13, 18884, 525, 369, 15828, 29918, 978, 2396, 525, 30014, 507, 1779, 742, 13, 18884, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 30014, 507, 1892, 742, 13, 9651, 2981, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]