content
stringlengths
1
1.04M
input_ids
sequencelengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-08-29 07:54 from __future__ import unicode_literals from django.db import migrations, models
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 1157, 13, 18, 319, 2177, 12, 2919, 12, 1959, 8753, 25, 4051, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.736842
57
import io import logging import mock import mocks import monitor import re import time import unittest if __name__ == '__main__': unittest.main()
[ 11748, 33245, 198, 11748, 18931, 198, 11748, 15290, 198, 11748, 285, 3320, 198, 11748, 5671, 198, 11748, 302, 198, 11748, 640, 198, 11748, 555, 715, 395, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
3.122449
49
import os import numpy as np from scipy.interpolate import InterpolatedUnivariateSpline as ius from scipy import integrate import george from george import kernels
[ 11748, 28686, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 629, 541, 88, 13, 3849, 16104, 378, 1330, 4225, 16104, 515, 3118, 42524, 26568, 500, 355, 1312, 385, 198, 6738, 629, 541, 88, 1330, 19386, 198, 11748, 4903, 3643, 198, 6738, 4903, 3643, 1330, 50207, 628, 198 ]
3.531915
47
import geopandas as gpd import rasterio as rio from shapely.geometry import box import matplotlib.pyplot as plt from descartes import PolygonPatch from application_logger import logghandler logger=logghandler('test','Geo_log') user_logger= logger.get_logger("DEBUG") if __name__=="__main__": plotter_obj= Plotter("IA_FullState.tif","IA_FullState.shp") #plotter_obj.get_shp_from_tif() plotter_obj.plot_geometry()
[ 11748, 30324, 392, 292, 355, 27809, 67, 198, 11748, 374, 1603, 952, 355, 374, 952, 198, 6738, 5485, 306, 13, 469, 15748, 1330, 3091, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 1715, 433, 274, 1330, 12280, 14520, 33952, 198, 198, 6738, 3586, 62, 6404, 1362, 1330, 2604, 456, 392, 1754, 628, 198, 6404, 1362, 28, 6404, 456, 392, 1754, 10786, 9288, 41707, 10082, 78, 62, 6404, 11537, 198, 7220, 62, 6404, 1362, 28, 49706, 13, 1136, 62, 6404, 1362, 7203, 30531, 4943, 628, 628, 198, 361, 11593, 3672, 834, 855, 1, 834, 12417, 834, 1298, 198, 220, 220, 220, 7110, 353, 62, 26801, 28, 28114, 353, 7203, 3539, 62, 13295, 9012, 13, 49929, 2430, 3539, 62, 13295, 9012, 13, 1477, 79, 4943, 198, 220, 220, 220, 1303, 29487, 353, 62, 26801, 13, 1136, 62, 1477, 79, 62, 6738, 62, 49929, 3419, 198, 220, 220, 220, 7110, 353, 62, 26801, 13, 29487, 62, 469, 15748, 3419, 628, 628 ]
2.662577
163
import pandas as pd from finnhub_python.utils import RequestCache class FinnHubOptionChain(RequestCache): """ Wrapper class for option chain data returned by FinnHubs api. """ @property @property @property @property def get_calls(self, expiry): """ Get a dataframe of calls for an expiration. Dataframe is indexed by strike :param expiry: str, date :return: pandas.DataFrame """ opts = self._get_side(expiry, 'CALL') df = pd.DataFrame(opts) df.index = df.strike return df def get_puts(self, expiry): """ Get a dataframe of puts for an expiration. Dataframe is indexed by strike :param expiry: str, date :return: pandas.DataFrame """ opts = self._get_side(expiry, 'PUT') df = pd.DataFrame(opts) df.index = df.strike return df def get_option(self, expiry, side, strike): """ Get a single option row """ if side.upper() == 'CALL': opts = self.get_calls(expiry) elif side.upper() == 'PUT': opts = self.get_puts(expiry) else: raise ValueError('Invalid Option Side: {}'.format(side)) return opts.loc[strike]
[ 11748, 19798, 292, 355, 279, 67, 198, 198, 6738, 957, 77, 40140, 62, 29412, 13, 26791, 1330, 19390, 30562, 628, 198, 4871, 15368, 16066, 19722, 35491, 7, 18453, 30562, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 27323, 2848, 1398, 329, 3038, 6333, 1366, 4504, 198, 220, 220, 220, 416, 15368, 16066, 82, 40391, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2488, 26745, 628, 220, 220, 220, 2488, 26745, 628, 220, 220, 220, 2488, 26745, 628, 220, 220, 220, 2488, 26745, 628, 220, 220, 220, 825, 651, 62, 66, 5691, 7, 944, 11, 1033, 9045, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3497, 257, 1366, 14535, 286, 3848, 329, 281, 28385, 13, 198, 220, 220, 220, 220, 220, 220, 220, 6060, 14535, 318, 41497, 416, 5587, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1033, 9045, 25, 965, 11, 3128, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 19798, 292, 13, 6601, 19778, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2172, 82, 796, 2116, 13557, 1136, 62, 1589, 7, 1069, 4063, 88, 11, 705, 34, 7036, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 47764, 796, 279, 67, 13, 6601, 19778, 7, 404, 912, 8, 198, 220, 220, 220, 220, 220, 220, 220, 47764, 13, 9630, 796, 47764, 13, 33069, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 47764, 628, 220, 220, 220, 825, 651, 62, 1996, 82, 7, 944, 11, 1033, 9045, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3497, 257, 1366, 14535, 286, 7584, 329, 281, 28385, 13, 198, 220, 220, 220, 220, 220, 220, 220, 6060, 14535, 318, 41497, 416, 5587, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1033, 9045, 25, 965, 11, 3128, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 19798, 292, 13, 6601, 19778, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2172, 82, 796, 2116, 13557, 1136, 62, 1589, 7, 1069, 4063, 88, 11, 705, 30076, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 47764, 796, 279, 67, 13, 6601, 19778, 7, 404, 912, 8, 198, 220, 220, 220, 220, 220, 220, 220, 47764, 13, 9630, 796, 47764, 13, 33069, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 47764, 628, 220, 220, 220, 825, 651, 62, 18076, 7, 944, 11, 1033, 9045, 11, 1735, 11, 5587, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 3497, 257, 2060, 3038, 5752, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1735, 13, 45828, 3419, 6624, 705, 34, 7036, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2172, 82, 796, 2116, 13, 1136, 62, 66, 5691, 7, 1069, 4063, 88, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 1735, 13, 45828, 3419, 6624, 705, 30076, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2172, 82, 796, 2116, 13, 1136, 62, 1996, 82, 7, 1069, 4063, 88, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 11052, 12331, 10786, 44651, 16018, 12075, 25, 23884, 4458, 18982, 7, 1589, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2172, 82, 13, 17946, 58, 33069, 60, 198 ]
2.189509
591
# Stub models file from dimagi.ext.couchdbkit import Document
[ 2, 41135, 4981, 2393, 198, 6738, 5391, 18013, 13, 2302, 13, 66, 7673, 9945, 15813, 1330, 16854, 198 ]
3.444444
18
from django.utils.translation import ugettext_lazy as _ from django import forms from protocols.models import Step,Protocol,OperateStep,ThermocycleStep,Input,Output
[ 198, 6738, 42625, 14208, 13, 26791, 13, 41519, 1330, 334, 1136, 5239, 62, 75, 12582, 355, 4808, 198, 198, 6738, 42625, 14208, 1330, 5107, 198, 6738, 19565, 13, 27530, 1330, 5012, 11, 19703, 4668, 11, 18843, 378, 8600, 11, 35048, 76, 13733, 2375, 8600, 11, 20560, 11, 26410, 198 ]
3.408163
49
import requests import re url="http://zyk.bjhd.gov.cn/zwdt/hdyw/" headers={ 'Referer':'http://zyk.bjhd.gov.cn/zwdt/hdyw/', 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; LCTE; rv:11.0) like Gecko' } response=requests.get(url) response.encoding='utf-8' # r=respose.text HTML=response.text # compile预编译 适用于文本过长 regex=re.compile('.*?if\(!strLink\){document\.write\(\'<a href="\.(.*shtml)".*\'\)}') result=regex.findall(HTML) print(result) url = ['http://zyk.bjhd.gov.cn/zwdt/hdyw' + i for i in result] print(url) print() for j in url: print(j) # with open('/home/gz/Desktop/zy3.txt',mode='w',encoding='utf8')as f: # f.write(r)
[ 11748, 7007, 198, 11748, 302, 198, 6371, 2625, 4023, 1378, 46355, 13, 50007, 31298, 13, 9567, 13, 31522, 14, 89, 16993, 83, 14, 71, 9892, 86, 30487, 198, 50145, 34758, 220, 198, 220, 220, 220, 220, 220, 220, 220, 705, 8134, 11882, 10354, 6, 4023, 1378, 46355, 13, 50007, 31298, 13, 9567, 13, 31522, 14, 89, 16993, 83, 14, 71, 9892, 86, 14, 3256, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 705, 12982, 12, 36772, 10354, 6, 44, 8590, 5049, 14, 20, 13, 15, 357, 11209, 24563, 838, 13, 15, 26, 370, 3913, 2414, 26, 47907, 14, 22, 13, 15, 26, 15957, 26, 406, 4177, 36, 26, 374, 85, 25, 1157, 13, 15, 8, 588, 2269, 37549, 6, 198, 220, 220, 220, 1782, 198, 26209, 28, 8897, 3558, 13, 1136, 7, 6371, 8, 198, 26209, 13, 12685, 7656, 11639, 40477, 12, 23, 6, 198, 2, 374, 28, 411, 3455, 13, 5239, 198, 28656, 28, 26209, 13, 5239, 198, 2, 17632, 165, 95, 226, 163, 120, 244, 46237, 239, 16268, 222, 224, 18796, 101, 12859, 236, 23877, 229, 17312, 105, 32573, 229, 165, 243, 123, 198, 260, 25636, 28, 260, 13, 5589, 576, 7, 4458, 9, 30, 361, 59, 7, 0, 2536, 11280, 59, 19953, 22897, 17405, 13564, 59, 38016, 6, 27, 64, 13291, 2625, 59, 12195, 15885, 1477, 20369, 8, 1911, 9, 43054, 22725, 92, 11537, 198, 20274, 28, 260, 25636, 13, 19796, 439, 7, 28656, 8, 198, 4798, 7, 20274, 8, 198, 198, 6371, 796, 37250, 4023, 1378, 46355, 13, 50007, 31298, 13, 9567, 13, 31522, 14, 89, 16993, 83, 14, 71, 9892, 86, 6, 1343, 1312, 329, 1312, 287, 1255, 60, 198, 4798, 7, 6371, 8, 198, 4798, 3419, 198, 1640, 474, 287, 19016, 25, 198, 220, 220, 220, 3601, 7, 73, 8, 628, 628, 628, 198, 2, 351, 1280, 10786, 14, 11195, 14, 34586, 14, 36881, 14, 7357, 18, 13, 14116, 3256, 14171, 11639, 86, 3256, 12685, 7656, 11639, 40477, 23, 11537, 292, 277, 25, 198, 220, 220, 220, 1303, 277, 13, 13564, 7, 81, 8, 628, 628, 198 ]
1.977337
353
import tensorflow as tf import numpy as np from tensorflow.keras import Model, Sequential from tensorflow.keras.applications import MobileNetV2 from tensorflow.keras.layers import (Dense, Conv1D, Embedding, UpSampling1D, AveragePooling1D, AveragePooling2D, GlobalAveragePooling2D, Activation, LayerNormalization, Dropout, Layer) import sys import tensorflow_probability as tfp tfd = tfp.distributions from torchvision.transforms import ToTensor import torch #takes a grayscale image (with the last channel) with pixels [0, 255] #rescales to [-1, 1] and repeats along the channel axis for 3 channels #uses a MobileNetV2 with pretrained weights from imagenet as initial weights
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 1330, 9104, 11, 24604, 1843, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 13, 1324, 677, 602, 1330, 12173, 7934, 53, 17, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 13, 75, 6962, 1330, 357, 35, 1072, 11, 34872, 16, 35, 11, 13302, 6048, 278, 11, 3205, 16305, 11347, 16, 35, 11, 13475, 27201, 278, 16, 35, 11, 220, 198, 26287, 27201, 278, 17, 35, 11, 8060, 26287, 27201, 278, 17, 35, 11, 13144, 341, 11, 34398, 26447, 1634, 11, 14258, 448, 11, 34398, 8, 198, 198, 11748, 25064, 198, 198, 11748, 11192, 273, 11125, 62, 1676, 65, 1799, 355, 256, 46428, 198, 83, 16344, 796, 256, 46428, 13, 17080, 2455, 507, 198, 198, 6738, 28034, 10178, 13, 7645, 23914, 1330, 1675, 51, 22854, 198, 11748, 28034, 198, 220, 220, 220, 1303, 83, 1124, 257, 1036, 592, 38765, 2939, 357, 4480, 262, 938, 6518, 8, 351, 17848, 685, 15, 11, 14280, 60, 198, 220, 220, 220, 1303, 411, 66, 2040, 284, 25915, 16, 11, 352, 60, 290, 29819, 1863, 262, 6518, 16488, 329, 513, 9619, 198, 220, 220, 220, 1303, 2664, 257, 12173, 7934, 53, 17, 351, 2181, 13363, 19590, 422, 3590, 268, 316, 355, 4238, 19590 ]
3.184332
217
# coding: utf-8 # import pytest import numpy as np import os from sympde.topology import Domain, Line, Square, Cube from psydac.cad.geometry import Geometry, export_nurbs_to_hdf5, refine_nurbs from psydac.cad.geometry import import_geopdes_to_nurbs from psydac.cad.cad import elevate, refine from psydac.cad.gallery import quart_circle, circle from psydac.mapping.discrete import SplineMapping, NurbsMapping from psydac.mapping.discrete_gallery import discrete_mapping from psydac.fem.splines import SplineSpace from psydac.fem.tensor import TensorFemSpace from psydac.utilities.utils import refine_array_1d base_dir = os.path.dirname(os.path.realpath(__file__)) #============================================================================== #============================================================================== #============================================================================== # TODO to be removed #============================================================================== # TODO to be removed #============================================================================== @pytest.mark.parametrize( 'ncells', [[8,8], [12,12], [14,14]] ) @pytest.mark.parametrize( 'degree', [[2,2], [3,2], [2,3], [3,3], [4,4]] ) @pytest.mark.parametrize( 'ncells', [[8,8], [12,12], [14,14]] ) @pytest.mark.parametrize( 'degree', [[2,2], [3,2], [2,3], [3,3], [4,4]] ) #============================================================================== @pytest.mark.xfail #============================================================================== # CLEAN UP SYMPY NAMESPACE #==============================================================================
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 2, 198, 11748, 12972, 9288, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 198, 6738, 10558, 2934, 13, 4852, 1435, 1330, 20021, 11, 6910, 11, 9276, 11, 23315, 198, 198, 6738, 17331, 67, 330, 13, 66, 324, 13, 469, 15748, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 2269, 15748, 11, 10784, 62, 77, 333, 1443, 62, 1462, 62, 71, 7568, 20, 11, 35139, 62, 77, 333, 1443, 198, 6738, 17331, 67, 330, 13, 66, 324, 13, 469, 15748, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 1330, 62, 469, 404, 8906, 62, 1462, 62, 77, 333, 1443, 198, 6738, 17331, 67, 330, 13, 66, 324, 13, 66, 324, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 36830, 11, 35139, 198, 6738, 17331, 67, 330, 13, 66, 324, 13, 24460, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 28176, 62, 45597, 11, 9197, 198, 6738, 17331, 67, 330, 13, 76, 5912, 13, 15410, 8374, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 13341, 500, 44, 5912, 11, 49281, 1443, 44, 5912, 198, 6738, 17331, 67, 330, 13, 76, 5912, 13, 15410, 8374, 62, 24460, 1330, 28810, 62, 76, 5912, 198, 6738, 17331, 67, 330, 13, 69, 368, 13, 22018, 1127, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 13341, 500, 14106, 198, 6738, 17331, 67, 330, 13, 69, 368, 13, 83, 22854, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 309, 22854, 37, 368, 14106, 198, 6738, 17331, 67, 330, 13, 315, 2410, 13, 26791, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 35139, 62, 18747, 62, 16, 67, 198, 198, 8692, 62, 15908, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 5305, 6978, 7, 834, 7753, 834, 4008, 198, 2, 23926, 25609, 855, 198, 198, 2, 23926, 25609, 855, 198, 198, 2, 23926, 25609, 855, 198, 2, 16926, 46, 284, 307, 4615, 198, 198, 2, 23926, 25609, 855, 198, 2, 16926, 46, 284, 307, 4615, 198, 198, 2, 23926, 25609, 855, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7, 705, 1198, 297, 82, 3256, 16410, 23, 11, 23, 4357, 685, 1065, 11, 1065, 4357, 685, 1415, 11, 1415, 11907, 1267, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7, 705, 16863, 3256, 16410, 17, 11, 17, 4357, 685, 18, 11, 17, 4357, 685, 17, 11, 18, 4357, 685, 18, 11, 18, 4357, 685, 19, 11, 19, 11907, 1267, 198, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7, 705, 1198, 297, 82, 3256, 16410, 23, 11, 23, 4357, 685, 1065, 11, 1065, 4357, 685, 1415, 11, 1415, 11907, 1267, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7, 705, 16863, 3256, 16410, 17, 11, 17, 4357, 685, 18, 11, 17, 4357, 685, 17, 11, 18, 4357, 685, 18, 11, 18, 4357, 685, 19, 11, 19, 11907, 1267, 198, 198, 2, 23926, 25609, 855, 198, 31, 9078, 9288, 13, 4102, 13, 26152, 603, 198, 198, 2, 23926, 25609, 855, 198, 2, 30301, 1565, 15958, 19704, 7378, 56, 399, 29559, 47, 11598, 198, 2, 23926, 25609, 855, 198 ]
3.136042
566
import numpy as np import matplotlib.pyplot as plt from sklearn import preprocessing from skimage.feature import local_binary_pattern #from skimage import io from sklearn.cross_validation import train_test_split from sklearn.metrics import accuracy_score from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC import glob radius = 3 n_points = 8 * radius X = [] y = [] cls_fldrs = sorted(glob.glob('GTSRB_subset/*')) for i , folder in enumerate(cls_fldrs): # i = 0 or 1 folder = ['GTSRB_subset\\class1', 'GTSRB_subset\\class2'] names = glob.glob(folder + '/*jpg') for name in names: img = plt.imread(name) lbp = local_binary_pattern(img, n_points, radius) histogram = np.histogram(lbp, bins = range(2**8+1))[0] X.append(histogram) y.append(i) X = preprocessing.scale(X) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) clf_list = [LogisticRegression(), SVC()] clf_name = ['LR', 'SVC'] C_range = 10.0 ** np.arange(-5, 0) for clf,name in zip(clf_list, clf_name): for C in C_range: for penalty in ["l1", "l2"]: clf.C = C clf.penalty = penalty clf.fit(X_train, y_train) y_pred = clf.predict(X_test) score = accuracy_score(y_test, y_pred) print ("Accuracy for C = %.2e and penalty = %s is %.3f" % (C, penalty, score))
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 1341, 35720, 1330, 662, 36948, 198, 198, 6738, 1341, 9060, 13, 30053, 1330, 1957, 62, 39491, 62, 33279, 198, 2, 6738, 1341, 9060, 1330, 33245, 198, 198, 6738, 1341, 35720, 13, 19692, 62, 12102, 341, 1330, 4512, 62, 9288, 62, 35312, 198, 6738, 1341, 35720, 13, 4164, 10466, 1330, 9922, 62, 26675, 198, 6738, 1341, 35720, 13, 29127, 62, 19849, 1330, 5972, 2569, 8081, 2234, 198, 6738, 1341, 35720, 13, 82, 14761, 1330, 311, 15922, 198, 198, 11748, 15095, 198, 198, 42172, 796, 513, 198, 77, 62, 13033, 796, 807, 1635, 16874, 198, 198, 55, 796, 17635, 198, 88, 796, 17635, 628, 198, 198, 565, 82, 62, 69, 335, 3808, 796, 23243, 7, 4743, 672, 13, 4743, 672, 10786, 38, 4694, 27912, 62, 7266, 2617, 15211, 6, 4008, 220, 198, 1640, 1312, 837, 9483, 287, 27056, 378, 7, 565, 82, 62, 69, 335, 3808, 2599, 220, 1303, 1312, 796, 657, 393, 352, 220, 9483, 796, 37250, 38, 4694, 27912, 62, 7266, 2617, 6852, 4871, 16, 3256, 705, 38, 4694, 27912, 62, 7266, 2617, 6852, 4871, 17, 20520, 198, 220, 220, 220, 3891, 796, 15095, 13, 4743, 672, 7, 43551, 1343, 705, 15211, 9479, 11537, 220, 198, 220, 220, 220, 329, 1438, 287, 3891, 25, 220, 198, 220, 220, 220, 220, 220, 220, 220, 33705, 796, 458, 83, 13, 320, 961, 7, 3672, 8, 198, 220, 220, 220, 220, 220, 220, 220, 18360, 79, 796, 1957, 62, 39491, 62, 33279, 7, 9600, 11, 299, 62, 13033, 11, 16874, 8, 220, 198, 220, 220, 220, 220, 220, 220, 220, 1554, 21857, 796, 45941, 13, 10034, 21857, 7, 23160, 79, 11, 41701, 796, 2837, 7, 17, 1174, 23, 10, 16, 4008, 58, 15, 60, 198, 220, 220, 220, 220, 220, 220, 220, 1395, 13, 33295, 7, 10034, 21857, 8, 220, 198, 220, 220, 220, 220, 220, 220, 220, 331, 13, 33295, 7, 72, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 55, 796, 662, 36948, 13, 9888, 7, 55, 8, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 55, 62, 27432, 11, 1395, 62, 9288, 11, 331, 62, 27432, 11, 331, 62, 9288, 796, 4512, 62, 9288, 62, 35312, 7, 55, 11, 331, 11, 1332, 62, 7857, 28, 15, 13, 17, 8, 198, 198, 565, 69, 62, 4868, 796, 685, 11187, 2569, 8081, 2234, 22784, 311, 15922, 3419, 60, 198, 565, 69, 62, 3672, 796, 37250, 35972, 3256, 705, 50, 15922, 20520, 198, 34, 62, 9521, 796, 838, 13, 15, 12429, 45941, 13, 283, 858, 32590, 20, 11, 657, 8, 198, 198, 1640, 537, 69, 11, 3672, 287, 19974, 7, 565, 69, 62, 4868, 11, 537, 69, 62, 3672, 2599, 198, 220, 220, 220, 329, 327, 287, 327, 62, 9521, 25, 198, 220, 220, 220, 220, 220, 220, 220, 329, 7389, 287, 14631, 75, 16, 1600, 366, 75, 17, 1, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 537, 69, 13, 34, 796, 327, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 537, 69, 13, 3617, 6017, 796, 7389, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 537, 69, 13, 11147, 7, 55, 62, 27432, 11, 331, 62, 27432, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 331, 62, 28764, 796, 537, 69, 13, 79, 17407, 7, 55, 62, 9288, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4776, 796, 9922, 62, 26675, 7, 88, 62, 9288, 11, 331, 62, 28764, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 5855, 17320, 23843, 329, 327, 796, 4064, 13, 17, 68, 290, 7389, 796, 4064, 82, 318, 4064, 13, 18, 69, 1, 4064, 357, 34, 11, 7389, 11, 4776, 4008, 628, 628 ]
2.204615
650
# coding: utf-8 # Import dos módulos necessários e declaração de constantes # --- # In[1]: import numpy as np import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten from keras.layers import Conv2D, MaxPooling2D from sklearn import metrics from sklearn.model_selection import train_test_split # quantidade de canais que as imagens de entrada possuem # escalar cor de cinza, entao 1 CHANNEL = 1 # valor da largura e da altura das imagens de entrada WIDTH_HEIGHT = 20 # tamanho do batch BATCH = 128 # Load do arquivo de dados # --- # In[2]: load = np.loadtxt('exdata.csv', delimiter=',') # cada coluna tem um padrao de digito data = load[:-1].T # a ultima linha eh a classificacao do digito result = load[-1] # digito 0 corresponde ao valor 10 result[result == 10] = 0 # Pré-processamento dos dados e das classes # --- # In[3]: # trasformar cada linha (digito) em uma matriz 20 x 20 x 1 data = data.reshape(data.shape[0], WIDTH_HEIGHT, WIDTH_HEIGHT, CHANNEL) # converte array de 1 dimensao para uma matriz de dimensao 10 # ou seja, criar 10 classes, uma para cada digito possivel result = keras.utils.to_categorical(result, 10) # Separação dos dados em treinamento e teste # --- # In[4]: in_train, in_test, out_train, out_test = train_test_split(data, result, test_size=(25/100), train_size=(75/100)) # Definição da arquitetura da rede neural # --- # In[5]: # 'pilha' de camadas lineares model = Sequential() # primeira camada precisa saber o que espera de entrada # Conv2D cria uma camada de 'convolution' (add cada elemento da imagem com o seu vizinho local) # isso eh feito atraves do input_shape # 32 eh o numero de filtros # relu = rectified linear unit model.add(Conv2D(32, kernel_size=(3, 3), activation='relu', input_shape=(WIDTH_HEIGHT, WIDTH_HEIGHT, CHANNEL))) model.add(Conv2D(64, (3, 3), activation='relu')) # MaxPooling2D cria uma camada que faz um processo de discretizacao baseada em amostra model.add(MaxPooling2D(pool_size=(2, 2))) # Dropout cria uma camada de regularizacao # 0.25 eh a fracao da quantidade de entrada que entrara na camada model.add(Dropout(0.25)) # Flatten cria uma camada que 'flatteniza' model.add(Flatten()) # Dense cria uma camada que representa uma multiplicacao de matrizes # 128 eh a dimensionalidade da saida model.add(Dense(128, activation='relu')) model.add(Dropout(0.5)) model.add(Dense(10, activation='softmax')) # Compilação da rede neural # --- # In[6]: # configuracao de que como sera o aprendizado de processo # para qualquer problema de classificacao deve-se usar o accuracy model.compile(loss=keras.losses.categorical_crossentropy, optimizer=keras.optimizers.Adadelta(), metrics=['accuracy']) # Input dos dados de treinamento # --- # In[7]: # batch_size eh o numero de amostras por update do gradiente # epochs = um epoch eh uma iteracao sobre os dados fornecidos model.fit(in_train, out_train, batch_size=BATCH, epochs=10, verbose=1, validation_data=(in_test, out_test)) # Avaliação com os dados de teste # --- # In[8]: # valores do modelo no modo de teste score = model.evaluate(in_test, out_test, verbose=0) print('Teste loss:', score[0]) print('Teste acurácia:', score[1]) # Matriz de confusão # --- # In[9]: # gera a predicao para o conjunto de teste prediction = model.predict(in_test, batch_size=BATCH, verbose=0) # ajuste dado para ter info correta prediction_classes = np.argmax(prediction, axis=1) out_test_classes = np.argmax(out_test, axis=1) # gera a 'confusion matrix' matrix = metrics.confusion_matrix(out_test_classes , prediction_classes) print(matrix) # In[10]: # gera um relatorio com as principais metricas da classificacao report = metrics.classification_report(out_test_classes, prediction_classes) print(report) # Precisão final # --- # In[11]: # calcula a precisao da classificacao value = metrics.accuracy_score(out_test_classes, prediction_classes) print("Precisão no conjunto de teste: {:.2%}".format(value))
[ 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 2, 17267, 23430, 285, 10205, 67, 377, 418, 2418, 6557, 380, 418, 304, 2377, 3301, 16175, 28749, 390, 6937, 274, 198, 2, 11420, 198, 198, 2, 554, 58, 16, 5974, 628, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 41927, 292, 198, 6738, 41927, 292, 13, 19608, 292, 1039, 1330, 285, 77, 396, 198, 6738, 41927, 292, 13, 27530, 1330, 24604, 1843, 198, 6738, 41927, 292, 13, 75, 6962, 1330, 360, 1072, 11, 14258, 448, 11, 1610, 41769, 198, 6738, 41927, 292, 13, 75, 6962, 1330, 34872, 17, 35, 11, 5436, 27201, 278, 17, 35, 198, 198, 6738, 1341, 35720, 1330, 20731, 198, 6738, 1341, 35720, 13, 19849, 62, 49283, 1330, 4512, 62, 9288, 62, 35312, 198, 198, 2, 5554, 312, 671, 390, 460, 15152, 8358, 355, 3590, 641, 390, 24481, 4763, 1184, 84, 368, 198, 2, 12221, 283, 1162, 390, 269, 259, 4496, 11, 920, 5488, 352, 198, 3398, 22846, 3698, 796, 352, 198, 2, 1188, 273, 12379, 2552, 5330, 304, 12379, 5988, 5330, 288, 292, 3590, 641, 390, 24481, 4763, 198, 54, 2389, 4221, 62, 13909, 9947, 796, 1160, 198, 2, 256, 10546, 8873, 466, 15458, 198, 33, 11417, 796, 13108, 628, 198, 2, 8778, 466, 610, 421, 23593, 390, 9955, 418, 198, 2, 11420, 198, 198, 2, 554, 58, 17, 5974, 628, 198, 2220, 796, 45941, 13, 2220, 14116, 10786, 1069, 7890, 13, 40664, 3256, 46728, 2676, 28, 3256, 11537, 198, 198, 2, 269, 4763, 951, 9613, 2169, 23781, 14841, 430, 78, 390, 3100, 10094, 198, 7890, 796, 3440, 58, 21912, 16, 4083, 51, 198, 198, 2, 257, 3789, 8083, 9493, 3099, 32622, 257, 1398, 811, 330, 5488, 466, 3100, 10094, 198, 20274, 796, 3440, 58, 12, 16, 60, 220, 198, 2, 3100, 10094, 657, 6053, 68, 257, 78, 1188, 273, 838, 198, 20274, 58, 20274, 6624, 838, 60, 796, 657, 628, 198, 2, 1736, 2634, 12, 14681, 3263, 78, 23430, 9955, 418, 304, 288, 292, 6097, 198, 2, 11420, 198, 198, 2, 554, 58, 18, 5974, 628, 198, 2, 491, 292, 687, 283, 269, 4763, 9493, 3099, 357, 12894, 10094, 8, 795, 334, 2611, 2603, 47847, 1160, 2124, 1160, 2124, 352, 198, 7890, 796, 1366, 13, 3447, 1758, 7, 7890, 13, 43358, 58, 15, 4357, 370, 2389, 4221, 62, 13909, 9947, 11, 370, 2389, 4221, 62, 13909, 9947, 11, 5870, 22846, 3698, 8, 198, 198, 2, 6718, 660, 7177, 390, 352, 5391, 641, 5488, 31215, 334, 2611, 2603, 47847, 390, 5391, 641, 5488, 838, 198, 2, 267, 84, 384, 6592, 11, 269, 380, 283, 838, 6097, 11, 334, 2611, 31215, 269, 4763, 3100, 10094, 1184, 425, 75, 198, 20274, 796, 41927, 292, 13, 26791, 13, 1462, 62, 66, 2397, 12409, 7, 20274, 11, 838, 8, 628, 198, 2, 8621, 3301, 16175, 28749, 23430, 9955, 418, 795, 2054, 259, 3263, 78, 304, 1332, 68, 198, 2, 11420, 198, 198, 2, 554, 58, 19, 5974, 628, 198, 259, 62, 27432, 11, 287, 62, 9288, 11, 503, 62, 27432, 11, 503, 62, 9288, 796, 4512, 62, 9288, 62, 35312, 7, 7890, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1255, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 7857, 16193, 1495, 14, 3064, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 7857, 16193, 2425, 14, 3064, 4008, 628, 198, 2, 2896, 5362, 16175, 28749, 12379, 610, 47391, 316, 5330, 12379, 21459, 17019, 198, 2, 11420, 198, 198, 2, 554, 58, 20, 5974, 628, 198, 2, 705, 79, 346, 3099, 6, 390, 12172, 38768, 1627, 3565, 198, 19849, 796, 24604, 1843, 3419, 198, 198, 2, 6994, 8704, 12172, 4763, 3718, 9160, 17463, 263, 267, 8358, 1658, 525, 64, 390, 24481, 4763, 198, 2, 34872, 17, 35, 269, 7496, 334, 2611, 12172, 4763, 390, 705, 42946, 2122, 6, 357, 2860, 269, 4763, 5002, 78, 12379, 3590, 368, 401, 267, 384, 84, 48569, 20327, 1957, 8, 198, 2, 318, 568, 32622, 730, 10094, 379, 430, 1158, 466, 5128, 62, 43358, 198, 2, 3933, 32622, 267, 997, 3529, 390, 1226, 83, 4951, 198, 2, 823, 84, 796, 13621, 1431, 14174, 4326, 198, 19849, 13, 2860, 7, 3103, 85, 17, 35, 7, 2624, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 9720, 62, 7857, 16193, 18, 11, 513, 828, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14916, 11639, 260, 2290, 3256, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5128, 62, 43358, 16193, 54, 2389, 4221, 62, 13909, 9947, 11, 370, 2389, 4221, 62, 13909, 9947, 11, 5870, 22846, 3698, 22305, 198, 19849, 13, 2860, 7, 3103, 85, 17, 35, 7, 2414, 11, 357, 18, 11, 513, 828, 14916, 11639, 260, 2290, 6, 4008, 198, 198, 2, 5436, 27201, 278, 17, 35, 269, 7496, 334, 2611, 12172, 4763, 8358, 277, 1031, 23781, 1429, 78, 390, 1221, 1186, 528, 330, 5488, 2779, 4763, 795, 716, 455, 430, 198, 19849, 13, 2860, 7, 11518, 27201, 278, 17, 35, 7, 7742, 62, 7857, 16193, 17, 11, 362, 22305, 198, 198, 2, 14258, 448, 269, 7496, 334, 2611, 12172, 4763, 390, 3218, 528, 330, 5488, 198, 2, 657, 13, 1495, 32622, 257, 1216, 330, 5488, 12379, 5554, 312, 671, 390, 24481, 4763, 8358, 24481, 3301, 12385, 12172, 4763, 198, 19849, 13, 2860, 7, 26932, 448, 7, 15, 13, 1495, 4008, 198, 198, 2, 1610, 41769, 269, 7496, 334, 2611, 12172, 4763, 8358, 705, 2704, 41769, 23638, 6, 198, 19849, 13, 2860, 7, 7414, 41769, 28955, 198, 198, 2, 360, 1072, 269, 7496, 334, 2611, 12172, 4763, 8358, 2380, 64, 334, 2611, 15082, 291, 330, 5488, 390, 2603, 380, 12271, 198, 2, 13108, 32622, 257, 38517, 312, 671, 12379, 531, 64, 198, 19849, 13, 2860, 7, 35, 1072, 7, 12762, 11, 14916, 11639, 260, 2290, 6, 4008, 198, 198, 19849, 13, 2860, 7, 26932, 448, 7, 15, 13, 20, 4008, 198, 19849, 13, 2860, 7, 35, 1072, 7, 940, 11, 14916, 11639, 4215, 9806, 6, 4008, 628, 198, 2, 3082, 10102, 16175, 28749, 12379, 21459, 17019, 198, 2, 11420, 198, 198, 2, 554, 58, 21, 5974, 628, 198, 2, 4566, 333, 330, 5488, 390, 8358, 401, 78, 1055, 64, 267, 2471, 10920, 528, 4533, 390, 1429, 78, 198, 2, 31215, 4140, 10819, 1917, 64, 390, 1398, 811, 330, 5488, 390, 303, 12, 325, 514, 283, 267, 9922, 198, 19849, 13, 5589, 576, 7, 22462, 28, 6122, 292, 13, 22462, 274, 13, 66, 2397, 12409, 62, 19692, 298, 28338, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6436, 7509, 28, 6122, 292, 13, 40085, 11341, 13, 2782, 324, 12514, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20731, 28, 17816, 4134, 23843, 6, 12962, 628, 198, 2, 23412, 23430, 9955, 418, 390, 2054, 259, 3263, 78, 198, 2, 11420, 198, 198, 2, 554, 58, 22, 5974, 628, 198, 2, 15458, 62, 7857, 32622, 267, 997, 3529, 390, 716, 455, 8847, 16964, 4296, 466, 31312, 68, 198, 2, 36835, 82, 796, 23781, 36835, 32622, 334, 2611, 11629, 330, 5488, 523, 4679, 28686, 9955, 418, 329, 32984, 312, 418, 198, 19849, 13, 11147, 7, 259, 62, 27432, 11, 503, 62, 27432, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15458, 62, 7857, 28, 33, 11417, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 36835, 82, 28, 940, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15942, 577, 28, 16, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 21201, 62, 7890, 16193, 259, 62, 9288, 11, 503, 62, 9288, 4008, 628, 198, 2, 23587, 544, 16175, 28749, 401, 28686, 9955, 418, 390, 1332, 68, 198, 2, 11420, 198, 198, 2, 554, 58, 23, 5974, 628, 198, 2, 1188, 2850, 466, 2746, 78, 645, 953, 78, 390, 1332, 68, 220, 198, 26675, 796, 2746, 13, 49786, 7, 259, 62, 9288, 11, 503, 62, 9288, 11, 15942, 577, 28, 15, 8, 198, 4798, 10786, 14402, 68, 2994, 25, 3256, 4776, 58, 15, 12962, 198, 4798, 10786, 14402, 68, 936, 333, 6557, 33743, 25, 3256, 4776, 58, 16, 12962, 628, 198, 2, 6550, 47847, 390, 1013, 385, 28749, 198, 2, 11420, 198, 198, 2, 554, 58, 24, 5974, 628, 198, 2, 308, 8607, 257, 2747, 3970, 78, 31215, 267, 11644, 403, 1462, 390, 1332, 68, 198, 28764, 2867, 796, 2746, 13, 79, 17407, 7, 259, 62, 9288, 11, 15458, 62, 7857, 28, 33, 11417, 11, 15942, 577, 28, 15, 8, 198, 198, 2, 257, 3137, 68, 288, 4533, 31215, 1059, 7508, 1162, 1186, 64, 198, 28764, 2867, 62, 37724, 796, 45941, 13, 853, 9806, 7, 28764, 2867, 11, 16488, 28, 16, 8, 198, 448, 62, 9288, 62, 37724, 796, 45941, 13, 853, 9806, 7, 448, 62, 9288, 11, 16488, 28, 16, 8, 198, 198, 2, 308, 8607, 257, 705, 10414, 4241, 17593, 6, 198, 6759, 8609, 796, 20731, 13, 10414, 4241, 62, 6759, 8609, 7, 448, 62, 9288, 62, 37724, 837, 17724, 62, 37724, 8, 198, 4798, 7, 6759, 8609, 8, 628, 198, 2, 554, 58, 940, 5974, 628, 198, 2, 308, 8607, 23781, 823, 1352, 952, 401, 355, 26303, 15152, 18663, 292, 12379, 1398, 811, 330, 5488, 198, 13116, 796, 20731, 13, 4871, 2649, 62, 13116, 7, 448, 62, 9288, 62, 37724, 11, 17724, 62, 37724, 8, 198, 4798, 7, 13116, 8, 628, 198, 2, 28737, 271, 28749, 2457, 198, 2, 11420, 198, 198, 2, 554, 58, 1157, 5974, 628, 198, 2, 5204, 64, 257, 3718, 271, 5488, 12379, 1398, 811, 330, 5488, 198, 8367, 796, 20731, 13, 4134, 23843, 62, 26675, 7, 448, 62, 9288, 62, 37724, 11, 17724, 62, 37724, 8, 198, 4798, 7203, 6719, 66, 271, 28749, 645, 11644, 403, 1462, 390, 1332, 68, 25, 46110, 13, 17, 4, 92, 1911, 18982, 7, 8367, 4008, 628 ]
2.391496
1,811
from boa3.builtin import contract @contract('0x0102030405060708090A0B0C0D0E0F1011121314')
[ 6738, 1489, 64, 18, 13, 18780, 259, 1330, 2775, 628, 198, 31, 28484, 10786, 15, 87, 20943, 1238, 1270, 1821, 1120, 1899, 2154, 1795, 3829, 32, 15, 33, 15, 34, 15, 35, 15, 36, 15, 37, 8784, 14686, 1485, 1415, 11537, 198 ]
2.190476
42
from pymongo import MongoClient from umongo import Instance from umongo import Document, EmbeddedDocument from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm.session import sessionmaker, Session from .standard_logger import Logger from .consts import *
[ 6738, 279, 4948, 25162, 1330, 42591, 11792, 198, 6738, 23781, 25162, 1330, 2262, 590, 198, 6738, 23781, 25162, 1330, 16854, 11, 13302, 47238, 24941, 198, 6738, 44161, 282, 26599, 13, 2302, 13, 32446, 283, 876, 1330, 2377, 283, 876, 62, 8692, 198, 6738, 44161, 282, 26599, 13, 579, 13, 29891, 1330, 6246, 10297, 11, 23575, 198, 6738, 764, 20307, 62, 6404, 1362, 1330, 5972, 1362, 198, 6738, 764, 1102, 6448, 1330, 1635, 628, 628, 628, 628 ]
3.736842
76
#!/usr/bin/python # # Pickle deserialization RCE payload. # To be invoked with command to execute at it's first parameter. # Otherwise, the default one will be used. # import pickle with open('rce.png', 'rb') as inF: pickle.load(inF)
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 198, 2, 12346, 293, 748, 48499, 1634, 371, 5222, 21437, 13, 198, 2, 1675, 307, 24399, 351, 3141, 284, 12260, 379, 340, 338, 717, 11507, 13, 198, 2, 15323, 11, 262, 4277, 530, 481, 307, 973, 13, 198, 2, 198, 198, 11748, 2298, 293, 198, 198, 4480, 1280, 10786, 81, 344, 13, 11134, 3256, 705, 26145, 11537, 355, 287, 37, 25, 198, 220, 220, 220, 2298, 293, 13, 2220, 7, 259, 37, 8, 198 ]
2.891566
83
''' Created on Feb 1, 2014 @author: efarhan ''' from engine.const import log from engine.init import engine from render_engine.input import input_manager from engine.vector import Vector2 from input.mouse_input import get_mouse, show_mouse from game_object.game_object_main import GameObject from game_object.text import Text from json_export.level_json import save_level
[ 7061, 6, 201, 198, 41972, 319, 3158, 352, 11, 1946, 201, 198, 201, 198, 31, 9800, 25, 304, 16370, 7637, 201, 198, 7061, 6, 201, 198, 201, 198, 6738, 3113, 13, 9979, 1330, 2604, 201, 198, 6738, 3113, 13, 15003, 1330, 3113, 201, 198, 6738, 8543, 62, 18392, 13, 15414, 1330, 5128, 62, 37153, 201, 198, 6738, 3113, 13, 31364, 1330, 20650, 17, 201, 198, 6738, 5128, 13, 35888, 62, 15414, 1330, 651, 62, 35888, 11, 905, 62, 35888, 201, 198, 6738, 983, 62, 15252, 13, 6057, 62, 15252, 62, 12417, 1330, 3776, 10267, 201, 198, 6738, 983, 62, 15252, 13, 5239, 1330, 8255, 201, 198, 6738, 33918, 62, 39344, 13, 5715, 62, 17752, 1330, 3613, 62, 5715, 201, 198, 201 ]
3.214876
121
##################################################### # Copyright (c) 2014 Diogo Barradas # # # # See the file LICENSE.txt for copying permission. # ##################################################### #!/usr/bin/env python import argparse import sys import socket import scanner from scanner import scan parser = argparse.ArgumentParser(prog='rainfall') parser.add_argument('--version', action='version', version='%(prog)s 1.0') parser.add_argument('-p', '--ports', nargs=2, required=True, help='Port interval to scan') parser.add_argument('-t', '--target', required=True, help='Target host') parser.add_argument('-m', '--mode', nargs=1, required=True, help='scan mode: 1-syn, 2-xmas, 3-fin, 4-null, 5-ack ') args = parser.parse_args() try: beginPort = int(args.ports[0]) endPort = int(args.ports[1]) assert beginPort > 0 and endPort > 0 and beginPort <= endPort except AssertionError: print "[ERROR] Port range is invalid - startPort must be <= endPort, both of which > 0" sys.exit() target = args.target mode = args.mode scan(target, beginPort, endPort, int(mode[0]))
[ 29113, 14468, 4242, 2, 198, 2, 15069, 357, 66, 8, 1946, 6031, 24076, 2409, 6335, 292, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 198, 2, 4091, 262, 2393, 38559, 24290, 13, 14116, 329, 23345, 7170, 13, 220, 1303, 198, 29113, 14468, 4242, 2, 198, 198, 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 1822, 29572, 198, 11748, 25064, 198, 11748, 17802, 198, 11748, 27474, 198, 6738, 27474, 1330, 9367, 628, 198, 48610, 796, 1822, 29572, 13, 28100, 1713, 46677, 7, 1676, 70, 11639, 3201, 7207, 11537, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 9641, 3256, 2223, 11639, 9641, 3256, 2196, 11639, 4, 7, 1676, 70, 8, 82, 352, 13, 15, 11537, 198, 48610, 13, 2860, 62, 49140, 10786, 12, 79, 3256, 705, 438, 3742, 3256, 299, 22046, 28, 17, 11, 2672, 28, 17821, 11, 1037, 11639, 13924, 16654, 284, 9367, 11537, 198, 48610, 13, 2860, 62, 49140, 10786, 12, 83, 3256, 705, 438, 16793, 3256, 2672, 28, 17821, 11, 1037, 11639, 21745, 2583, 11537, 198, 48610, 13, 2860, 62, 49140, 10786, 12, 76, 3256, 705, 438, 14171, 3256, 299, 22046, 28, 16, 11, 2672, 28, 17821, 11, 1037, 11639, 35836, 4235, 25, 352, 12, 28869, 11, 362, 12, 87, 5356, 11, 513, 12, 15643, 11, 604, 12, 8423, 11, 642, 12, 441, 705, 8, 628, 198, 22046, 796, 30751, 13, 29572, 62, 22046, 3419, 198, 198, 28311, 25, 198, 220, 220, 220, 2221, 13924, 796, 493, 7, 22046, 13, 3742, 58, 15, 12962, 198, 220, 220, 220, 886, 13924, 796, 493, 7, 22046, 13, 3742, 58, 16, 12962, 198, 220, 220, 220, 6818, 2221, 13924, 1875, 657, 290, 886, 13924, 1875, 657, 290, 2221, 13924, 19841, 886, 13924, 198, 16341, 2195, 861, 295, 12331, 25, 198, 220, 220, 220, 3601, 12878, 24908, 60, 4347, 2837, 318, 12515, 532, 923, 13924, 1276, 307, 19841, 886, 13924, 11, 1111, 286, 543, 1875, 657, 1, 198, 220, 220, 220, 25064, 13, 37023, 3419, 628, 198, 16793, 796, 26498, 13, 16793, 198, 14171, 796, 26498, 13, 14171, 198, 198, 35836, 7, 16793, 11, 2221, 13924, 11, 886, 13924, 11, 493, 7, 14171, 58, 15, 60, 4008 ]
2.787589
419
from argparse import ArgumentParser
[ 6738, 1822, 29572, 1330, 45751, 46677, 628, 198 ]
4.75
8
from execicio110 import moedas from time import sleep p = float(input('Digite um preço: R$ ')) #1º preço /2º aumenta / 3º diminui moedas.resumo(p,10, 20)
[ 6738, 2452, 46441, 11442, 1330, 6941, 276, 292, 198, 6738, 640, 1330, 3993, 198, 198, 79, 796, 12178, 7, 15414, 10786, 19511, 578, 23781, 662, 16175, 78, 25, 371, 3, 705, 4008, 198, 2, 16, 36165, 662, 16175, 78, 1220, 17, 36165, 257, 1713, 64, 1220, 513, 36165, 12110, 9019, 198, 5908, 276, 292, 13, 411, 43712, 7, 79, 11, 940, 11, 1160, 8, 198 ]
2.384615
65
#!/usr/bin/python # Filename: autopatch.py ### File Information ### """ Patch the files automatically based on the autopatch.xsd. Usage: $shell autopatch.py [PATCH_XML] - PATCH_XML : The patch XML definition. Default to be bringup.xml """ __author__ = '[email protected] (duanqz)' import os.path import shutil import sys import fnmatch import traceback from diff_patch import DiffPatch from xml_patch import Patcher as XMLPatcher from target_finder import TargetFinder from config import Config from log import Log from format import Format try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET # End of class AutoPatch class Version: """ Version control for file """ ANDROID_4_0 = 1 ANDROID_4_1 = ANDROID_4_0 << 1 ANDROID_4_2 = ANDROID_4_1 << 1 ANDROID_4_3 = ANDROID_4_2 << 1 ANDROID_4_4 = ANDROID_4_3 << 1 CURRENT_VERSION = ~0 @staticmethod def parseCurrentVersion(patchXML): """ Parse out current version from the patch XML """ try: Version.CURRENT_VERSION = Version.parse(patchXML.getroot().attrib['version']) except KeyError: pass @staticmethod @staticmethod class AutoPatchXML: """ Represent the tree model of the patch XML. """ def parse(self): """ Parse the XML with the schema defined in autopatch.xsd """ XMLDom = ET.parse(Config.PATCH_XML) Version.parseCurrentVersion(XMLDom) for feature in XMLDom.findall('feature'): self.handleRevise(feature) def handleRevise(self, feature): """ Parse the revise node to handle the revise action. """ require = feature.attrib['require'] description = feature.attrib['description'] if self.needRevise(require): Log.i("\n [%s]" % description) for revise in feature: ReviseExecutor(revise).run() # End of class AutoPatchXML class ReviseExecutor: """ Execute revise action to a unique file. Actions including ADD, MERGE, REPLACE. """ ADD = "ADD" MERGE = "MERGE" REPLACE = "REPLACE" def __init__(self, revise): """ @args revise: the revise XML node. """ self.action = revise.attrib['action'] # Compose the source and target file path target = revise.attrib['target'] self.mOldSrc = os.path.join(Config.OLDER_DIR, target) self.mNewSrc = os.path.join(Config.NEWER_DIR, target) self.mTarget = TargetFinder().find(target) # Initialize patch if defined try: patch = revise.attrib['patch'] self.mPatch = os.path.join(Config.PATCH_XML_DIR, patch) except KeyError: self.mPatch = None # Initialize version if defined try: self.mVersion = revise.attrib['version'] except KeyError: self.mVersion = None def replaceOrAddSingleFile(self, source, target): """ Add a file from source to target. Replace the target if exist. """ if not os.path.exists(source): Log.fail("File not exist: " + source) return if os.path.exists(target): Log.i(" REPLACE " + target) else: Log.i(" ADD " + target) self.createIfNotExist(os.path.dirname(target)) action = Format.REMOVE_LINE | Format.ACCESS_TO_NAME | Format.RESID_TO_NAME formatSource = Format(Config.NEWER_DIR, source).do(action) formatTarget = Format(Config.PRJ_ROOT, target).do(action) shutil.copy(source, target) formatSource.undo() formatTarget.undo() # End of class ReviseExecutor # End of class Log if __name__ == "__main__": Config.setup(sys.argv[1:]) AutoPatch()
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 7066, 12453, 25, 22320, 963, 13, 9078, 198, 198, 21017, 9220, 6188, 44386, 198, 37811, 198, 33952, 262, 3696, 6338, 1912, 319, 262, 22320, 963, 13, 87, 21282, 13, 198, 198, 28350, 25, 720, 29149, 22320, 963, 13, 9078, 685, 47, 11417, 62, 55, 5805, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 350, 11417, 62, 55, 5805, 220, 1058, 383, 8529, 23735, 6770, 13, 15161, 284, 307, 2222, 929, 13, 19875, 198, 37811, 198, 198, 834, 9800, 834, 796, 705, 646, 272, 80, 528, 5303, 486, 31, 65, 1698, 84, 13, 785, 357, 646, 272, 80, 89, 33047, 628, 198, 198, 11748, 28686, 13, 6978, 198, 11748, 4423, 346, 198, 11748, 25064, 198, 11748, 24714, 15699, 198, 11748, 12854, 1891, 198, 6738, 814, 62, 17147, 1330, 10631, 33952, 198, 6738, 35555, 62, 17147, 1330, 3208, 2044, 355, 23735, 12130, 2044, 198, 6738, 2496, 62, 22805, 1330, 12744, 37, 5540, 198, 6738, 4566, 1330, 17056, 198, 6738, 2604, 1330, 5972, 198, 6738, 5794, 1330, 18980, 198, 198, 28311, 25, 198, 220, 220, 220, 1330, 35555, 13, 316, 631, 13, 66, 20180, 27660, 355, 12152, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 1330, 35555, 13, 316, 631, 13, 20180, 27660, 355, 12152, 628, 198, 198, 2, 5268, 286, 1398, 11160, 33952, 628, 198, 4871, 10628, 25, 198, 220, 220, 220, 37227, 10628, 1630, 329, 2393, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 5357, 13252, 2389, 62, 19, 62, 15, 796, 352, 198, 220, 220, 220, 5357, 13252, 2389, 62, 19, 62, 16, 796, 5357, 13252, 2389, 62, 19, 62, 15, 9959, 352, 198, 220, 220, 220, 5357, 13252, 2389, 62, 19, 62, 17, 796, 5357, 13252, 2389, 62, 19, 62, 16, 9959, 352, 198, 220, 220, 220, 5357, 13252, 2389, 62, 19, 62, 18, 796, 5357, 13252, 2389, 62, 19, 62, 17, 9959, 352, 198, 220, 220, 220, 5357, 13252, 2389, 62, 19, 62, 19, 796, 5357, 13252, 2389, 62, 19, 62, 18, 9959, 352, 628, 198, 220, 220, 220, 327, 39237, 62, 43717, 796, 5299, 15, 628, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 21136, 11297, 14815, 7, 17147, 55, 5805, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 2547, 325, 503, 1459, 2196, 422, 262, 8529, 23735, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10628, 13, 34, 39237, 62, 43717, 796, 10628, 13, 29572, 7, 17147, 55, 5805, 13, 1136, 15763, 22446, 1078, 822, 17816, 9641, 6, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 7383, 12331, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1208, 628, 220, 220, 220, 2488, 12708, 24396, 628, 220, 220, 220, 2488, 12708, 24396, 198, 198, 4871, 11160, 33952, 55, 5805, 25, 198, 220, 220, 220, 37227, 10858, 262, 5509, 2746, 286, 262, 8529, 23735, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 21136, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 2547, 325, 262, 23735, 351, 262, 32815, 5447, 287, 22320, 963, 13, 87, 21282, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 23735, 24510, 796, 12152, 13, 29572, 7, 16934, 13, 47, 11417, 62, 55, 5805, 8, 628, 220, 220, 220, 220, 220, 220, 220, 10628, 13, 29572, 11297, 14815, 7, 55, 5805, 24510, 8, 628, 220, 220, 220, 220, 220, 220, 220, 329, 3895, 287, 23735, 24510, 13, 19796, 439, 10786, 30053, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 28144, 18009, 786, 7, 30053, 8, 628, 220, 220, 220, 825, 5412, 18009, 786, 7, 944, 11, 3895, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 2547, 325, 262, 32548, 10139, 284, 5412, 262, 32548, 2223, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 2421, 796, 3895, 13, 1078, 822, 17816, 46115, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 6764, 796, 3895, 13, 1078, 822, 17816, 11213, 20520, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 31227, 18009, 786, 7, 46115, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5972, 13, 72, 7203, 59, 77, 685, 4, 82, 30866, 4064, 6764, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 32548, 287, 3895, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5416, 786, 23002, 38409, 7, 18218, 786, 737, 5143, 3419, 198, 198, 2, 5268, 286, 1398, 11160, 33952, 55, 5805, 628, 198, 4871, 5416, 786, 23002, 38409, 25, 198, 220, 220, 220, 37227, 8393, 1133, 32548, 2223, 284, 257, 3748, 2393, 13, 198, 220, 220, 220, 220, 220, 220, 220, 24439, 1390, 27841, 11, 34482, 8264, 11, 45285, 11598, 13, 220, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 27841, 220, 220, 220, 220, 796, 366, 29266, 1, 198, 220, 220, 220, 34482, 8264, 220, 220, 796, 366, 29296, 8264, 1, 198, 220, 220, 220, 45285, 11598, 796, 366, 2200, 6489, 11598, 1, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 32548, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 2488, 22046, 32548, 25, 262, 32548, 23735, 10139, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 2673, 796, 32548, 13, 1078, 822, 17816, 2673, 20520, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 3082, 577, 262, 2723, 290, 2496, 2393, 3108, 198, 220, 220, 220, 220, 220, 220, 220, 2496, 796, 32548, 13, 1078, 822, 17816, 16793, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 76, 19620, 50, 6015, 796, 28686, 13, 6978, 13, 22179, 7, 16934, 13, 3535, 14418, 62, 34720, 11, 2496, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 76, 3791, 50, 6015, 796, 28686, 13, 6978, 13, 22179, 7, 16934, 13, 13965, 1137, 62, 34720, 11, 2496, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 76, 21745, 796, 12744, 37, 5540, 22446, 19796, 7, 16793, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 20768, 1096, 8529, 611, 5447, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8529, 796, 32548, 13, 1078, 822, 17816, 17147, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 76, 33952, 796, 28686, 13, 6978, 13, 22179, 7, 16934, 13, 47, 11417, 62, 55, 5805, 62, 34720, 11, 8529, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 7383, 12331, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 76, 33952, 796, 6045, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 20768, 1096, 2196, 611, 5447, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 76, 14815, 796, 32548, 13, 1078, 822, 17816, 9641, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 7383, 12331, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 76, 14815, 796, 6045, 628, 198, 220, 220, 220, 825, 6330, 5574, 4550, 28008, 8979, 7, 944, 11, 2723, 11, 2496, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 3060, 257, 2393, 422, 2723, 284, 2496, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 40177, 262, 2496, 611, 2152, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 611, 407, 28686, 13, 6978, 13, 1069, 1023, 7, 10459, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5972, 13, 32165, 7203, 8979, 407, 2152, 25, 366, 1343, 2723, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 628, 220, 220, 220, 220, 220, 220, 220, 611, 28686, 13, 6978, 13, 1069, 1023, 7, 16793, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5972, 13, 72, 7203, 45285, 11598, 220, 366, 1343, 2496, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5972, 13, 72, 7203, 27841, 220, 220, 220, 220, 220, 366, 1343, 2496, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 17953, 1532, 3673, 3109, 396, 7, 418, 13, 6978, 13, 15908, 3672, 7, 16793, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 2223, 796, 18980, 13, 2200, 11770, 6089, 62, 24027, 930, 18980, 13, 26861, 7597, 62, 10468, 62, 20608, 930, 18980, 13, 19535, 2389, 62, 10468, 62, 20608, 198, 220, 220, 220, 220, 220, 220, 220, 5794, 7416, 796, 18980, 7, 16934, 13, 13965, 1137, 62, 34720, 11, 2723, 737, 4598, 7, 2673, 8, 198, 220, 220, 220, 220, 220, 220, 220, 5794, 21745, 796, 18980, 7, 16934, 13, 4805, 41, 62, 13252, 2394, 11, 2496, 737, 4598, 7, 2673, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4423, 346, 13, 30073, 7, 10459, 11, 2496, 8, 198, 220, 220, 220, 220, 220, 220, 220, 5794, 7416, 13, 41204, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 5794, 21745, 13, 41204, 3419, 198, 198, 2, 5268, 286, 1398, 5416, 786, 23002, 38409, 628, 198, 2, 5268, 286, 1398, 5972, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 17056, 13, 40406, 7, 17597, 13, 853, 85, 58, 16, 25, 12962, 198, 220, 220, 220, 11160, 33952, 3419, 198 ]
2.341757
1,662
import discord from discord.ext import commands import random, asyncio, aiohttp, datetime
[ 11748, 36446, 201, 198, 6738, 36446, 13, 2302, 1330, 9729, 201, 198, 11748, 4738, 11, 30351, 952, 11, 257, 952, 4023, 11, 4818, 8079, 201 ]
3.68
25
""" Main program to run the detection """ from argparse import ArgumentParser import cv2 import mediapipe as mp import numpy as np # for TCP connection with unity import socket from collections import deque from platform import system # face detection and facial landmark from facial_landmark import FaceMeshDetector # pose estimation and stablization from pose_estimator import PoseEstimator from stabilizer import Stabilizer # Miscellaneous detections (eyes/ mouth...) from facial_features import FacialFeatures, Eyes # global variable port = 5066 # have to be same as unity # init TCP connection with unity # return the socket connected if __name__ == "__main__": parser = ArgumentParser() parser.add_argument("--cam", type=int, help="specify the camera number if you have multiple cameras", default=0) parser.add_argument("--connect", action="store_true", help="connect to unity character", default=False) parser.add_argument("--debug", action="store_true", help="showing the camera's image for debugging", default=False) args = parser.parse_args() # demo code main()
[ 37811, 201, 198, 13383, 1430, 284, 1057, 262, 13326, 201, 198, 37811, 201, 198, 201, 198, 6738, 1822, 29572, 1330, 45751, 46677, 201, 198, 11748, 269, 85, 17, 201, 198, 11748, 16957, 499, 3757, 355, 29034, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 201, 198, 2, 329, 23633, 4637, 351, 14111, 201, 198, 11748, 17802, 201, 198, 6738, 17268, 1330, 390, 4188, 201, 198, 6738, 3859, 1330, 1080, 201, 198, 201, 198, 2, 1986, 13326, 290, 16324, 20533, 201, 198, 6738, 16324, 62, 1044, 4102, 1330, 15399, 37031, 11242, 9250, 201, 198, 201, 198, 2, 12705, 31850, 290, 8303, 75, 1634, 201, 198, 6738, 12705, 62, 395, 320, 1352, 1330, 37557, 22362, 320, 1352, 201, 198, 6738, 14349, 7509, 1330, 520, 14991, 7509, 201, 198, 201, 198, 2, 46253, 4886, 507, 357, 48418, 14, 5422, 23029, 201, 198, 6738, 16324, 62, 40890, 1330, 13585, 498, 23595, 11, 18301, 201, 198, 201, 198, 2, 3298, 7885, 201, 198, 634, 796, 2026, 2791, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 423, 284, 307, 976, 355, 14111, 201, 198, 201, 198, 2, 2315, 23633, 4637, 351, 14111, 201, 198, 2, 1441, 262, 17802, 5884, 201, 198, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 201, 198, 201, 198, 220, 220, 220, 30751, 796, 45751, 46677, 3419, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 20991, 1600, 2099, 28, 600, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 16684, 1958, 262, 4676, 1271, 611, 345, 423, 3294, 9073, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 15, 8, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 8443, 1600, 2223, 2625, 8095, 62, 7942, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 8443, 284, 14111, 2095, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 25101, 8, 201, 198, 201, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7203, 438, 24442, 1600, 2223, 2625, 8095, 62, 7942, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 1477, 7855, 262, 4676, 338, 2939, 329, 28769, 1600, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 25101, 8, 201, 198, 220, 220, 220, 26498, 796, 30751, 13, 29572, 62, 22046, 3419, 201, 198, 201, 198, 220, 220, 220, 1303, 13605, 2438, 201, 198, 220, 220, 220, 1388, 3419, 201, 198 ]
2.576471
510
#!/bin/env python from __future__ import print_function import sys fileName = sys.argv[1] f = open(fileName,'r') messageToIgnore = [ 'edm::FunctorTask' ,'edm::FunctorWaitingTask' ,'edm::ModuleCallingContext::setContext' ,'edm::SerialTaskQueue::' ,'edm::SerialTaskQueueChain::' ,'edm::WaitingTaskList' ,'edm::Worker::RunModuleTask<' ,'edm::Worker::beginStream' ,'edm::eventsetup::EventSetupRecord::getFromProxy' ,'edm::GlobalSchedule::processOneGlobalAsync' ,'edm::SerialTaskQueueChain::push' ,'edm::Worker::doWorkNoPrefetchingAsync' ,'edm::ServiceRegistry::setContext' ,'edm::ServiceRegistry::presentToken()' ,'edm::service::InitRootHandlers::ThreadTracker::on_scheduler_entry' ,'__TBB_machine_fetchstore4' ,'__TBB_machine_cmpswp4' ,'__TBB_machine_fetchstore1' ,'acquire (spin_rw_mutex.h:118)' ,'reset_extra_state (' ,'priority (scheduler_common.h:130)' ,'edm::service::MessageLogger::' # ,'edm::service::MessageLogger::establishModule(' # ,'edm::Run::Run(edm::RunPrincipal const&,' ,'edm::service::MessageLogger::unEstablishModule' ,'tbb::' ,'edm::RunForOutput::RunForOutput(' ,'edm::stream::EDAnalyzerAdaptor<' ,'edm::EventSetup::find(' ,'edm::eventsetup::EventSetupRecord::find(' ,'edm::eventsetup::DataKey::operator<(' ,'edm::eventsetup::SimpleStringTag::operator<(' ,'std::__shared_ptr<edm::serviceregistry::ServicesManager' ,'try_acquire (spin_mutex.h:109)' ,'edm::Run::Run(' ,'FastTimerService::preStreamBeginRun(' ,'decltype ({parm#1}()) edm::convertException::wrap<bool edm::Worker::runModule' ,'edm::Worker::reset()' ,'edm::stream::ProducingModuleAdaptorBase<edm::stream::EDProducerBase>::doStreamBeginLuminosityBlock(' ,'edm::stream::ProducingModuleAdaptorBase<edm::stream::EDFilterBase>::doStreamBeginLuminosityBlock(' ,'edm::LuminosityBlock::LuminosityBlock(edm::LuminosityBlockPrincipal' ,'edm::StreamSchedule::processOneStreamAsync<' ,'edm::Worker::doWorkAsync<' ,'edm::StreamSchedule::processOneEventAsync(' ,'edm::ParentContext::moduleCallingContext()' ,'edm::ModuleCallingContext::getTopModuleCallingContext' ,'edm::Event::Event(' ,'edm::Path::workerFinished(' ,'edm::Path::updateCounters(' ,'edm::Path::recordStatus(' ,'FastTimerService::postPathEvent(' ,'edm::hash_detail::isCompactForm_(' ,'edm::InputProductResolver::resolveProduct_' ,'edm::NoProcessProductResolver::dataValidFromResolver(' ,'edm::DataManagingProductResolver::productWasFetchedAndIsValid_(bool)' ,'FastTimerService::postModuleEvent(' ,'edm::UnscheduledProductResolver::prefetchAsync_' # ,'edm::NoProcessProductResolver::prefetchAsync_' # ,'edm::NoProcessProductResolver::resolveProduct_(' ,'edm::NoProcessProductResolver::' ,'reco::Jet::detectorP4' ,'edm::EarlyDeleteHelper::moduleRan' ,'edm::clearLoggedErrorsSummary(' ,'edm::ProductProvenanceRetriever::branchIDToProvenance(' ,'HistogramProbabilityEstimator::probability' #protected by an atomic ,'edm::EventPrincipal::setLuminosityBlockPrincipal' ,'edm::DataManagingProductResolver::' ] stackToIgnore = [ 'edm::service::MessageLogger::' ,'edm::MessageSender::ErrorObjDeleter' ,'edm::Run::runPrincipal() const' ,'edm::WaitingTaskList::' ,'edm::EventProcessor::beginJob()' ,'edm::StreamSchedule::processOneEventAsync' ,'edm::WorkerManager::resetAll()' ,'edm::ParentageRegistry::insertMapped(' ,'edm::one::EDFilterBase::doEvent(' ,'edm::one::EDProducerBase' ,'edm::EventBase::triggerNames_' ,'edm::EDFilter::doEvent(' ,'edm::EDAnalyzer::doEvent(' ,'edm::one::OutputModuleBase::doEvent' ,'edm::EDProducer::doEvent' ,'edm::Principal::clearPrincipal' ,'edm::RootOutputFile::writeOne' ,'edm::PrincipalCache::deleteRun(' ,'edm::eventsetup::EventSetupProvider::eventSetupForInstance' ,'edm::EventPrincipal::clearEventPrincipal()' ,'FastTimerService::Resources::operator+=' ,'FastTimerService::preSourceEvent(edm::StreamID)' ,'edm::EventPrincipal::fillEventPrincipal(' ,'edm::InputProductResolver::putProduct_(' ] addressesToIgnore = [ # 'edm::eventsetup::makeEventSetupProvider(' # ,' edm::eventsetup::DataProxy::get(' # ,'cond::createPayload<' # ,'edm::pset::Registry::getMapped(' 'is in a rw- anonymous segment' #not sure about this one # ,'edm::RootFile::fillRunAuxiliary' ,'tbb::internal::arena::arena(' # ,'edm::EventPrincipal::fillEventPrincipal(' # ,'edm::Principal::addUnscheduledProduct(' # ,'edm::RootDelayedReader::getProduct_' # ,'TBranchElement::GetEntry(' # ,'edm::Event::put<' # ,'edm::stream::EDProducerAdaptorBase::doEvent' # ,'edm::stream::EDFilterAdaptorBase::doEvent(' # ,'edm::EventProcessor::init(' #this may ignore too much, but needed to ignore member data of streams # ,'edm::global::EDProducerBase::doEvent' # ,'FastTimerService::postBeginJob()' # ,'edm::EDProducer::doEvent(' # ,'_ZN3pat15PackedCandidate27covarianceParameterization_E' # ,'edm::RootOutputFile::writeOne' ,'DQMStore::book' ,'L1TdeCSCTF::L1TdeCSCTF' #legacy #,'MeasurementTrackerEventProducer::produce(' #MeasurementTrackerEvent ultimately hits edmNew::DetSetVector's lazy caching of DetSet which is supposed to be thread safe (but may not be?) ,'std::vector<reco::TrackExtra' #this is the cache in Ref ,'std::vector<reco::Track' ,'std::vector<reco::PFConversion' ] addressesToIgnoreIfRead = [ 'edm::eventsetup::makeEventSetupProvider(' ,' edm::eventsetup::DataProxy::get(' ,'cond::createPayload<' ,'edm::pset::Registry::getMapped(' # ,'is in a rw- anonymous segment' #not sure about this one ,'edm::RootFile::fillRunAuxiliary' # ,'tbb::internal::arena::arena(' ,'edm::EventPrincipal::fillEventPrincipal(' ,'edm::Principal::addUnscheduledProduct(' ,'edm::RootDelayedReader::getProduct_' ,'TBranchElement::GetEntry(' ,'edm::Event::put<' ,'edm::stream::EDProducerAdaptorBase::doEvent' ,'edm::stream::EDFilterAdaptorBase::doEvent(' ,'edm::EventProcessor::init(' #this may ignore too much, but needed to ignore member data of streams ,'edm::global::EDProducerBase::doEvent' ,'FastTimerService::postBeginJob()' ,'edm::EDProducer::doEvent(' ,'_ZN3pat15PackedCandidate27covarianceParameterization_E' ,'edm::RootOutputFile::writeOne' ,'BSS segment' ,'bytes inside data symbol' #this shows the writes but will miss the reads ,'FSQ::HandlerTemplate' #some function statics # ,'DQMStore::book' ,'TBufferFile::' ,'edm::service::MessageLogger::' ,'TClass::GetClass(' ] #startOfMessage ='-------------------' endOfMessage ='-------------------' startOfMessage = 'Possible data race' startOfMessageLength = len(startOfMessage) messageStarted = False lineCount = 100 buffer = [] maxCount = 20 lookForAddress = False foundAddress = False addressCount = 100 possibleDataRaceRead = False foundStartOfMessage = False for l in f.readlines(): if l[:2] != '==': continue if l.find(endOfMessage) != -1: foundAddress = False addressCount = 100 if l.find(startOfMessage) != -1: lookForAddress = False foundAddress = False possibleDataRaceRead = (l.find('data race during read') != -1) if buffer: #print buffer print('---------------------') for b in buffer: print(b[:-1]) buffer=[l] lineCount = 0 continue # if lineCount == 2: # if l.find('data race') == -1: # buffer = [] # lineCount = 100 # possibleDataRaceRead = (l.find('data race during read') != -1) if lineCount < maxCount: skipThis = False for i in stackToIgnore: if l.find(i) != -1: lineCount = 100 skipThis = True buffer = [] break if skipThis: continue buffer.append(l) lineCount +=1 if ' at 0x' in l: for i in messageToIgnore: if l.find(i) != -1: buffer = [] lineCount = 100 break if lineCount == 100: continue if l.find('Address 0x') != -1: lookForAddress = True foundAddress = False lineCount = 100 if lineCount == maxCount: lookForAddress = True foundAddress = False lineCount = 100 if lookForAddress: if l.find('Address 0x') != -1: foundAddress = True lookForAddress = False addressCount = 0 lineCount = 100 if foundAddress: addressCount +=1 if addressCount < maxCount: buffer.append(l) for i in addressesToIgnore: if l.find(i) != -1: buffer = [] foundAddress = False addressCount = 100 break if possibleDataRaceRead: for i in addressesToIgnoreIfRead: if l.find(i) != -1: buffer = [] foundAddress = False addressCount = 100 break if l[-3:]=="== ": foundAddress = False addressCount = 100
[ 2, 48443, 8800, 14, 24330, 21015, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 11748, 25064, 198, 198, 7753, 5376, 796, 25064, 13, 853, 85, 58, 16, 60, 198, 198, 69, 796, 1280, 7, 7753, 5376, 4032, 81, 11537, 198, 198, 20500, 2514, 32916, 382, 796, 685, 198, 220, 220, 220, 705, 276, 76, 3712, 24629, 2715, 25714, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 24629, 2715, 33484, 1780, 25714, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 26796, 48593, 21947, 3712, 2617, 21947, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 32634, 25714, 34991, 3712, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 32634, 25714, 34991, 35491, 3712, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 33484, 1780, 25714, 8053, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12468, 263, 3712, 10987, 26796, 25714, 27, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12468, 263, 3712, 27471, 12124, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 31534, 316, 929, 3712, 9237, 40786, 23739, 3712, 1136, 4863, 44148, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 22289, 27054, 5950, 3712, 14681, 3198, 22289, 42367, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 32634, 25714, 34991, 35491, 3712, 14689, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12468, 263, 3712, 4598, 12468, 2949, 36698, 7569, 278, 42367, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 16177, 8081, 4592, 3712, 2617, 21947, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 16177, 8081, 4592, 3712, 25579, 30642, 3419, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 15271, 3712, 31768, 30016, 12885, 8116, 3712, 16818, 35694, 3712, 261, 62, 1416, 704, 18173, 62, 13000, 6, 198, 220, 220, 220, 837, 6, 834, 51, 15199, 62, 30243, 62, 69, 7569, 8095, 19, 6, 198, 220, 220, 220, 837, 6, 834, 51, 15199, 62, 30243, 62, 11215, 862, 24142, 19, 6, 198, 220, 220, 220, 837, 6, 834, 51, 15199, 62, 30243, 62, 69, 7569, 8095, 16, 6, 198, 220, 220, 220, 837, 6, 330, 29782, 357, 39706, 62, 31653, 62, 21973, 1069, 13, 71, 25, 16817, 33047, 198, 220, 220, 220, 837, 6, 42503, 62, 26086, 62, 5219, 19203, 198, 220, 220, 220, 837, 6, 49336, 357, 1416, 704, 18173, 62, 11321, 13, 71, 25, 12952, 33047, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 15271, 3712, 12837, 11187, 1362, 3712, 6, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 15271, 3712, 12837, 11187, 1362, 3712, 40037, 26796, 10786, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 10987, 3712, 10987, 7, 276, 76, 3712, 10987, 42904, 8521, 1500, 5, 4032, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 15271, 3712, 12837, 11187, 1362, 3712, 403, 22362, 17148, 26796, 6, 198, 220, 220, 220, 837, 6, 83, 11848, 3712, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 10987, 1890, 26410, 3712, 10987, 1890, 26410, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 5532, 3712, 1961, 37702, 9107, 48003, 273, 27, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 40786, 3712, 19796, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 31534, 316, 929, 3712, 9237, 40786, 23739, 3712, 19796, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 31534, 316, 929, 3712, 6601, 9218, 3712, 46616, 27, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 31534, 316, 929, 3712, 26437, 10100, 24835, 3712, 46616, 27, 10786, 198, 220, 220, 220, 837, 6, 19282, 3712, 834, 28710, 62, 20692, 27, 276, 76, 3712, 15271, 2301, 4592, 3712, 31007, 13511, 6, 198, 220, 220, 220, 837, 6, 28311, 62, 330, 29782, 357, 39706, 62, 21973, 1069, 13, 71, 25, 14454, 33047, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 10987, 3712, 10987, 10786, 198, 220, 220, 220, 837, 6, 22968, 48801, 16177, 3712, 3866, 12124, 44140, 10987, 10786, 198, 220, 220, 220, 837, 6, 32446, 4906, 37913, 79, 1670, 2, 16, 92, 28955, 1225, 76, 3712, 1102, 1851, 16922, 3712, 37150, 27, 30388, 1225, 76, 3712, 12468, 263, 3712, 5143, 26796, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12468, 263, 3712, 42503, 3419, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 5532, 3712, 11547, 2259, 26796, 48003, 273, 14881, 27, 276, 76, 3712, 5532, 3712, 1961, 11547, 2189, 14881, 29, 3712, 4598, 12124, 44140, 43, 7230, 16579, 12235, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 5532, 3712, 11547, 2259, 26796, 48003, 273, 14881, 27, 276, 76, 3712, 5532, 3712, 1961, 22417, 14881, 29, 3712, 4598, 12124, 44140, 43, 7230, 16579, 12235, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 43, 7230, 16579, 12235, 3712, 43, 7230, 16579, 12235, 7, 276, 76, 3712, 43, 7230, 16579, 12235, 42904, 8521, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12124, 27054, 5950, 3712, 14681, 3198, 12124, 42367, 27, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12468, 263, 3712, 4598, 12468, 42367, 27, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12124, 27054, 5950, 3712, 14681, 3198, 9237, 42367, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 24546, 21947, 3712, 21412, 48593, 21947, 3419, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 26796, 48593, 21947, 3712, 1136, 9126, 26796, 48593, 21947, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 3712, 9237, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 15235, 3712, 28816, 18467, 1348, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 15235, 3712, 19119, 34, 15044, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 15235, 3712, 22105, 19580, 10786, 198, 220, 220, 220, 837, 6, 22968, 48801, 16177, 3712, 7353, 15235, 9237, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 17831, 62, 49170, 3712, 271, 7293, 529, 8479, 62, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 20560, 15667, 4965, 14375, 3712, 411, 6442, 15667, 62, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 2949, 18709, 15667, 4965, 14375, 3712, 7890, 47139, 4863, 4965, 14375, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 6601, 5124, 3039, 15667, 4965, 14375, 3712, 11167, 16973, 37, 316, 1740, 1870, 3792, 47139, 41052, 30388, 33047, 198, 220, 220, 220, 837, 6, 22968, 48801, 16177, 3712, 7353, 26796, 9237, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 3118, 1416, 704, 6309, 15667, 4965, 14375, 3712, 3866, 69, 7569, 42367, 62, 6, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 2949, 18709, 15667, 4965, 14375, 3712, 3866, 69, 7569, 42367, 62, 6, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 2949, 18709, 15667, 4965, 14375, 3712, 411, 6442, 15667, 62, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 2949, 18709, 15667, 4965, 14375, 3712, 6, 198, 220, 220, 220, 837, 6, 260, 1073, 3712, 42273, 3712, 15255, 9250, 47, 19, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 20457, 38727, 47429, 3712, 21412, 49, 272, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 20063, 11187, 2004, 9139, 5965, 22093, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 15667, 2964, 574, 590, 9781, 380, 964, 3712, 1671, 3702, 2389, 2514, 2964, 574, 590, 10786, 198, 220, 220, 220, 837, 6, 13749, 21857, 2964, 65, 1799, 22362, 320, 1352, 3712, 1676, 65, 1799, 6, 1303, 24326, 416, 281, 17226, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 42904, 8521, 3712, 2617, 43, 7230, 16579, 12235, 42904, 8521, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 6601, 5124, 3039, 15667, 4965, 14375, 3712, 6, 198, 60, 198, 198, 25558, 2514, 32916, 382, 796, 685, 198, 220, 220, 220, 705, 276, 76, 3712, 15271, 3712, 12837, 11187, 1362, 3712, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12837, 50, 2194, 3712, 12331, 49201, 5005, 293, 353, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 10987, 3712, 5143, 42904, 8521, 3419, 1500, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 33484, 1780, 25714, 8053, 3712, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 18709, 273, 3712, 27471, 33308, 3419, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12124, 27054, 5950, 3712, 14681, 3198, 9237, 42367, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 12468, 263, 13511, 3712, 42503, 3237, 3419, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 24546, 496, 8081, 4592, 3712, 28463, 44, 6320, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 505, 3712, 1961, 22417, 14881, 3712, 4598, 9237, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 505, 3712, 1961, 11547, 2189, 14881, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 14881, 3712, 46284, 36690, 62, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 1961, 22417, 3712, 4598, 9237, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 1961, 37702, 9107, 3712, 4598, 9237, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 505, 3712, 26410, 26796, 14881, 3712, 4598, 9237, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 1961, 11547, 2189, 3712, 4598, 9237, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 42904, 8521, 3712, 20063, 42904, 8521, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 30016, 26410, 8979, 3712, 13564, 3198, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 42904, 8521, 30562, 3712, 33678, 10987, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 31534, 316, 929, 3712, 9237, 40786, 29495, 3712, 15596, 40786, 1890, 33384, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 42904, 8521, 3712, 20063, 9237, 42904, 8521, 3419, 6, 198, 220, 220, 220, 837, 6, 22968, 48801, 16177, 3712, 33236, 3712, 46616, 10, 11639, 198, 220, 220, 220, 837, 6, 22968, 48801, 16177, 3712, 3866, 7416, 9237, 7, 276, 76, 3712, 12124, 2389, 33047, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 42904, 8521, 3712, 20797, 9237, 42904, 8521, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 20560, 15667, 4965, 14375, 3712, 1996, 15667, 62, 10786, 198, 60, 198, 198, 2860, 16746, 2514, 32916, 382, 796, 685, 198, 2, 220, 220, 220, 705, 276, 76, 3712, 31534, 316, 929, 3712, 15883, 9237, 40786, 29495, 10786, 198, 2, 220, 220, 220, 837, 6, 1225, 76, 3712, 31534, 316, 929, 3712, 6601, 44148, 3712, 1136, 10786, 198, 2, 220, 220, 220, 837, 6, 17561, 3712, 17953, 19197, 2220, 27, 6, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 862, 316, 3712, 8081, 4592, 3712, 1136, 44, 6320, 10786, 198, 220, 220, 220, 705, 271, 287, 257, 374, 86, 12, 11614, 10618, 6, 1303, 1662, 1654, 546, 428, 530, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 30016, 8979, 3712, 20797, 10987, 32, 2821, 28129, 6, 198, 220, 220, 220, 837, 6, 83, 11848, 3712, 32538, 3712, 533, 2616, 3712, 533, 2616, 10786, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 42904, 8521, 3712, 20797, 9237, 42904, 8521, 10786, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 42904, 8521, 3712, 2860, 3118, 1416, 704, 6309, 15667, 10786, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 30016, 13856, 16548, 33634, 3712, 1136, 15667, 62, 6, 198, 2, 220, 220, 220, 837, 6, 22737, 25642, 20180, 3712, 3855, 30150, 10786, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 3712, 1996, 27, 6, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 5532, 3712, 1961, 11547, 2189, 48003, 273, 14881, 3712, 4598, 9237, 6, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 5532, 3712, 1961, 22417, 48003, 273, 14881, 3712, 4598, 9237, 10786, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 18709, 273, 3712, 15003, 10786, 1303, 5661, 743, 8856, 1165, 881, 11, 475, 2622, 284, 8856, 2888, 1366, 286, 15190, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 20541, 3712, 1961, 11547, 2189, 14881, 3712, 4598, 9237, 6, 198, 2, 220, 220, 220, 837, 6, 22968, 48801, 16177, 3712, 7353, 44140, 33308, 3419, 6, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 1961, 11547, 2189, 3712, 4598, 9237, 10786, 198, 2, 220, 220, 220, 837, 6, 62, 57, 45, 18, 8071, 1314, 47, 6021, 41572, 20540, 1983, 66, 709, 2743, 590, 36301, 1634, 62, 36, 6, 198, 2, 220, 220, 220, 837, 6, 276, 76, 3712, 30016, 26410, 8979, 3712, 13564, 3198, 6, 198, 220, 220, 220, 837, 6, 35, 48, 44, 22658, 3712, 2070, 6, 198, 220, 220, 220, 837, 6, 43, 16, 51, 2934, 7902, 4177, 37, 3712, 43, 16, 51, 2934, 7902, 4177, 37, 6, 1303, 1455, 1590, 198, 220, 220, 220, 1303, 4032, 47384, 434, 35694, 9237, 11547, 2189, 3712, 18230, 344, 10786, 1303, 47384, 434, 35694, 9237, 6165, 7127, 1225, 76, 3791, 3712, 11242, 7248, 38469, 338, 16931, 40918, 286, 4614, 7248, 543, 318, 4385, 284, 307, 4704, 3338, 357, 4360, 743, 407, 307, 10091, 198, 220, 220, 220, 837, 6, 19282, 3712, 31364, 27, 260, 1073, 3712, 24802, 27726, 6, 1303, 5661, 318, 262, 12940, 287, 6524, 198, 220, 220, 220, 837, 6, 19282, 3712, 31364, 27, 260, 1073, 3712, 24802, 6, 198, 220, 220, 220, 837, 6, 19282, 3712, 31364, 27, 260, 1073, 3712, 42668, 3103, 9641, 6, 198, 60, 198, 198, 2860, 16746, 2514, 32916, 382, 1532, 5569, 796, 685, 198, 220, 220, 220, 705, 276, 76, 3712, 31534, 316, 929, 3712, 15883, 9237, 40786, 29495, 10786, 198, 220, 220, 220, 837, 6, 1225, 76, 3712, 31534, 316, 929, 3712, 6601, 44148, 3712, 1136, 10786, 198, 220, 220, 220, 837, 6, 17561, 3712, 17953, 19197, 2220, 27, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 862, 316, 3712, 8081, 4592, 3712, 1136, 44, 6320, 10786, 198, 2, 220, 220, 220, 837, 6, 271, 287, 257, 374, 86, 12, 11614, 10618, 6, 1303, 1662, 1654, 546, 428, 530, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 30016, 8979, 3712, 20797, 10987, 32, 2821, 28129, 6, 198, 2, 220, 220, 220, 837, 6, 83, 11848, 3712, 32538, 3712, 533, 2616, 3712, 533, 2616, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 42904, 8521, 3712, 20797, 9237, 42904, 8521, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 42904, 8521, 3712, 2860, 3118, 1416, 704, 6309, 15667, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 30016, 13856, 16548, 33634, 3712, 1136, 15667, 62, 6, 198, 220, 220, 220, 837, 6, 22737, 25642, 20180, 3712, 3855, 30150, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 3712, 1996, 27, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 5532, 3712, 1961, 11547, 2189, 48003, 273, 14881, 3712, 4598, 9237, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 5532, 3712, 1961, 22417, 48003, 273, 14881, 3712, 4598, 9237, 10786, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 9237, 18709, 273, 3712, 15003, 10786, 1303, 5661, 743, 8856, 1165, 881, 11, 475, 2622, 284, 8856, 2888, 1366, 286, 15190, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 20541, 3712, 1961, 11547, 2189, 14881, 3712, 4598, 9237, 6, 198, 220, 220, 220, 837, 6, 22968, 48801, 16177, 3712, 7353, 44140, 33308, 3419, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 1961, 11547, 2189, 3712, 4598, 9237, 10786, 198, 220, 220, 220, 837, 6, 62, 57, 45, 18, 8071, 1314, 47, 6021, 41572, 20540, 1983, 66, 709, 2743, 590, 36301, 1634, 62, 36, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 30016, 26410, 8979, 3712, 13564, 3198, 6, 198, 220, 220, 220, 837, 6, 4462, 50, 10618, 6, 198, 220, 220, 220, 837, 6, 33661, 2641, 1366, 6194, 6, 1303, 5661, 2523, 262, 6797, 475, 481, 2051, 262, 9743, 198, 220, 220, 220, 837, 6, 10652, 48, 3712, 25060, 30800, 6, 1303, 11246, 2163, 1185, 873, 198, 2, 220, 220, 220, 837, 6, 35, 48, 44, 22658, 3712, 2070, 6, 198, 220, 220, 220, 837, 6, 22737, 13712, 8979, 3712, 6, 198, 220, 220, 220, 837, 6, 276, 76, 3712, 15271, 3712, 12837, 11187, 1362, 3712, 6, 198, 220, 220, 220, 837, 6, 51, 9487, 3712, 3855, 9487, 10786, 198, 60, 198, 198, 2, 9688, 5189, 12837, 796, 6, 1783, 6329, 6, 198, 437, 5189, 12837, 796, 6, 1783, 6329, 6, 198, 9688, 5189, 12837, 796, 705, 47, 4733, 1366, 3234, 6, 198, 9688, 5189, 12837, 24539, 796, 18896, 7, 9688, 5189, 12837, 8, 198, 20500, 10434, 276, 796, 10352, 198, 1370, 12332, 796, 1802, 198, 22252, 796, 17635, 198, 9806, 12332, 796, 1160, 198, 5460, 1890, 20231, 796, 10352, 198, 9275, 20231, 796, 10352, 198, 21975, 12332, 796, 1802, 198, 79, 4733, 6601, 35157, 5569, 796, 10352, 198, 9275, 10434, 5189, 12837, 796, 10352, 198, 1640, 300, 287, 277, 13, 961, 6615, 33529, 198, 220, 220, 220, 611, 300, 58, 25, 17, 60, 14512, 705, 855, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 220, 220, 220, 611, 300, 13, 19796, 7, 437, 5189, 12837, 8, 14512, 532, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1043, 20231, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 2209, 12332, 796, 1802, 198, 220, 220, 220, 611, 300, 13, 19796, 7, 9688, 5189, 12837, 8, 14512, 532, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 804, 1890, 20231, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 1043, 20231, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 1744, 6601, 35157, 5569, 796, 357, 75, 13, 19796, 10786, 7890, 3234, 1141, 1100, 11537, 14512, 532, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 11876, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4798, 11876, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 19351, 12, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 275, 287, 11876, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 65, 58, 21912, 16, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 11876, 41888, 75, 60, 198, 220, 220, 220, 220, 220, 220, 220, 1627, 12332, 796, 657, 198, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 2, 220, 220, 220, 611, 1627, 12332, 6624, 362, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 611, 300, 13, 19796, 10786, 7890, 3234, 11537, 6624, 532, 16, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11876, 796, 17635, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1627, 12332, 796, 1802, 198, 2, 220, 220, 220, 220, 220, 220, 220, 1744, 6601, 35157, 5569, 796, 357, 75, 13, 19796, 10786, 7890, 3234, 1141, 1100, 11537, 14512, 532, 16, 8, 198, 220, 220, 220, 611, 1627, 12332, 1279, 3509, 12332, 25, 198, 220, 220, 220, 220, 220, 220, 220, 14267, 1212, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 8931, 2514, 32916, 382, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 300, 13, 19796, 7, 72, 8, 14512, 532, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1627, 12332, 796, 1802, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14267, 1212, 796, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11876, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 611, 14267, 1212, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 220, 220, 220, 220, 220, 220, 220, 11876, 13, 33295, 7, 75, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1627, 12332, 15853, 16, 198, 220, 220, 220, 220, 220, 220, 220, 611, 705, 379, 657, 87, 6, 287, 300, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 3275, 2514, 32916, 382, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 300, 13, 19796, 7, 72, 8, 14512, 532, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11876, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1627, 12332, 796, 1802, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1627, 12332, 6624, 1802, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 220, 220, 220, 220, 220, 220, 220, 611, 300, 13, 19796, 10786, 20231, 657, 87, 11537, 14512, 532, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 804, 1890, 20231, 796, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1043, 20231, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1627, 12332, 796, 1802, 198, 220, 220, 220, 611, 1627, 12332, 6624, 3509, 12332, 25, 198, 220, 220, 220, 220, 220, 220, 220, 804, 1890, 20231, 796, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 1043, 20231, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 1627, 12332, 796, 1802, 198, 220, 220, 220, 611, 804, 1890, 20231, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 300, 13, 19796, 10786, 20231, 657, 87, 11537, 14512, 532, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1043, 20231, 796, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 804, 1890, 20231, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2209, 12332, 796, 657, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1627, 12332, 796, 1802, 198, 220, 220, 220, 611, 1043, 20231, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2209, 12332, 15853, 16, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2209, 12332, 1279, 3509, 12332, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11876, 13, 33295, 7, 75, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 9405, 2514, 32916, 382, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 300, 13, 19796, 7, 72, 8, 14512, 532, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11876, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1043, 20231, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2209, 12332, 796, 1802, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 1744, 6601, 35157, 5569, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 9405, 2514, 32916, 382, 1532, 5569, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 300, 13, 19796, 7, 72, 8, 14512, 532, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11876, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1043, 20231, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2209, 12332, 796, 1802, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 300, 58, 12, 18, 47715, 855, 1, 855, 366, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1043, 20231, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2209, 12332, 796, 1802, 198 ]
2.265603
4,198
# P003 # The prime factors of 13_195 are 5, 7, 13, and 29 # What is the largest prime factor of the number 600_851_475_143 import math from sympy import isprime if __name__ == "__main__": main()
[ 2, 350, 11245, 198, 2, 383, 6994, 5087, 286, 1511, 62, 22186, 389, 642, 11, 767, 11, 1511, 11, 290, 2808, 198, 2, 1867, 318, 262, 4387, 6994, 5766, 286, 262, 1271, 10053, 62, 23, 4349, 62, 32576, 62, 21139, 198, 11748, 10688, 198, 6738, 10558, 88, 1330, 318, 35505, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ]
2.885714
70
#!/usr/bin/env python3 import os import argparse import pandas as pd if __name__ == '__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 28686, 198, 11748, 1822, 29572, 198, 198, 11748, 19798, 292, 355, 279, 67, 628, 628, 628, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419, 198 ]
2.166667
60
"""This module contains functions that belong to multiple categories. For example, concat can be used to concat strings, varbinary, arrays, etc. """ import functools from typing import Any, ClassVar, List, Type import attr from treeno.base import PrintOptions from treeno.datatypes import types as type_consts from treeno.datatypes.builder import array, char, unknown, varbinary, varchar from treeno.datatypes.conversions import ( STRING_TYPES, common_supertype, promote_varchar_to_char, ) from treeno.expression import ( OPERATOR_PRECEDENCE, Value, value_attr, wrap_literal_list, ) from treeno.functions.base import Function, GenericFunction @value_attr # TODO: See expressions.py OPERATOR_PRECEDENCE[Concatenate] = 5
[ 37811, 1212, 8265, 4909, 5499, 326, 5594, 284, 3294, 9376, 13, 1114, 1672, 11, 198, 1102, 9246, 460, 307, 973, 284, 1673, 265, 13042, 11, 1401, 39491, 11, 26515, 11, 3503, 13, 198, 37811, 198, 11748, 1257, 310, 10141, 198, 6738, 19720, 1330, 4377, 11, 5016, 19852, 11, 7343, 11, 5994, 198, 198, 11748, 708, 81, 198, 198, 6738, 256, 1361, 78, 13, 8692, 1330, 12578, 29046, 198, 6738, 256, 1361, 78, 13, 19608, 265, 9497, 1330, 3858, 355, 2099, 62, 1102, 6448, 198, 6738, 256, 1361, 78, 13, 19608, 265, 9497, 13, 38272, 1330, 7177, 11, 1149, 11, 6439, 11, 1401, 39491, 11, 410, 998, 283, 198, 6738, 256, 1361, 78, 13, 19608, 265, 9497, 13, 1102, 47178, 1330, 357, 198, 220, 220, 220, 19269, 2751, 62, 9936, 47, 1546, 11, 198, 220, 220, 220, 2219, 62, 16668, 4906, 11, 198, 220, 220, 220, 7719, 62, 85, 998, 283, 62, 1462, 62, 10641, 11, 198, 8, 198, 6738, 256, 1361, 78, 13, 38011, 1330, 357, 198, 220, 220, 220, 43521, 25633, 62, 47, 38827, 1961, 18310, 11, 198, 220, 220, 220, 11052, 11, 198, 220, 220, 220, 1988, 62, 35226, 11, 198, 220, 220, 220, 14441, 62, 18250, 1691, 62, 4868, 11, 198, 8, 198, 6738, 256, 1361, 78, 13, 12543, 2733, 13, 8692, 1330, 15553, 11, 42044, 22203, 628, 628, 198, 198, 31, 8367, 62, 35226, 628, 198, 2, 16926, 46, 25, 4091, 14700, 13, 9078, 198, 31054, 25633, 62, 47, 38827, 1961, 18310, 58, 3103, 9246, 268, 378, 60, 796, 642, 198 ]
2.964706
255
import os from tests.poc.context_example.exception import ExampleError
[ 11748, 28686, 198, 198, 6738, 5254, 13, 79, 420, 13, 22866, 62, 20688, 13, 1069, 4516, 1330, 17934, 12331, 628 ]
3.65
20
"""Used to classify if certain strings are words or contain words""" # used to eliminate non whitespace separators import re import sqlite3 import os def load_words(): """Loads the words document into a set""" with open('cryptoline_modules/words.txt') as word_file: valid_words = set(word_file.read().lower().split()) return valid_words def has_english(string: str): """True if a string (separated by anything) has an english word""" # Replaces all non letter characters with spaces not_letter = re.compile('[^0-9a-zA-Z]+') string = not_letter.sub(' ', string) # Determines if the current section of the string occurs in the word text file for item in string.split(" "): if execute_query_contains(item): return True return False def verify_db_file(): """Will error if db does not exist""" try: con = sqlite3.connect('file:cryptoline_modules/word_database.db?mode=rw', uri=True) except: print("Building database (One Time Operation)") make_database() print("Done") return False return True def make_database(): """One time database creation from words.txt file""" db_connection = sqlite3.connect("cryptoline_modules/word_database.db") db_cursor = db_connection.cursor() db_cursor.execute('DROP TABLE IF EXISTS Words ') db_cursor.execute('CREATE TABLE Words (valid_word TEXT)') with open('cryptoline_modules/words.txt') as word_file: valid_words = set(word_file.read().lower().split()) for item in valid_words: db_cursor.execute('INSERT INTO Words VALUES (?)', (item,)) db_connection.commit() db_connection.close() def execute_query_contains(uknown_word: str): """Returns true if the string is contained within the valid_word """ db = sqlite3.connect("cryptoline_modules/word_database.db") db_cursor = db.cursor() db_cursor.execute("SELECT rowid FROM Words WHERE valid_word = ?", (uknown_word.lower(),)) result = db_cursor.fetchone() if result is not None: return True else: return False db.close()
[ 37811, 38052, 284, 36509, 611, 1728, 13042, 389, 2456, 393, 3994, 2456, 37811, 198, 2, 973, 284, 11005, 1729, 13216, 10223, 2880, 2024, 198, 11748, 302, 198, 11748, 44161, 578, 18, 198, 11748, 28686, 628, 198, 4299, 3440, 62, 10879, 33529, 198, 220, 220, 220, 37227, 8912, 82, 262, 2456, 3188, 656, 257, 900, 37811, 198, 220, 220, 220, 351, 1280, 10786, 29609, 14453, 62, 18170, 14, 10879, 13, 14116, 11537, 355, 1573, 62, 7753, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4938, 62, 10879, 796, 900, 7, 4775, 62, 7753, 13, 961, 22446, 21037, 22446, 35312, 28955, 628, 220, 220, 220, 1441, 4938, 62, 10879, 628, 198, 4299, 468, 62, 39126, 7, 8841, 25, 965, 2599, 198, 220, 220, 220, 37227, 17821, 611, 257, 4731, 357, 25512, 515, 416, 1997, 8, 468, 281, 46932, 1573, 37811, 628, 220, 220, 220, 1303, 18407, 2114, 477, 1729, 3850, 3435, 351, 9029, 198, 220, 220, 220, 407, 62, 9291, 796, 302, 13, 5589, 576, 10786, 58, 61, 15, 12, 24, 64, 12, 89, 32, 12, 57, 48688, 11537, 198, 220, 220, 220, 4731, 796, 407, 62, 9291, 13, 7266, 10786, 46083, 4731, 8, 628, 220, 220, 220, 1303, 360, 13221, 274, 611, 262, 1459, 2665, 286, 262, 4731, 8833, 287, 262, 1573, 2420, 2393, 198, 220, 220, 220, 329, 2378, 287, 4731, 13, 35312, 7203, 366, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 12260, 62, 22766, 62, 3642, 1299, 7, 9186, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 198, 220, 220, 220, 1441, 10352, 628, 198, 4299, 11767, 62, 9945, 62, 7753, 33529, 198, 220, 220, 220, 37227, 8743, 4049, 611, 20613, 857, 407, 2152, 37811, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 369, 796, 44161, 578, 18, 13, 8443, 10786, 7753, 25, 29609, 14453, 62, 18170, 14, 4775, 62, 48806, 13, 9945, 30, 14171, 28, 31653, 3256, 2956, 72, 28, 17821, 8, 198, 220, 220, 220, 2845, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 25954, 6831, 357, 3198, 3862, 14680, 8, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 787, 62, 48806, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 45677, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 198, 220, 220, 220, 1441, 6407, 628, 198, 4299, 787, 62, 48806, 33529, 198, 220, 220, 220, 37227, 3198, 640, 6831, 6282, 422, 2456, 13, 14116, 2393, 37811, 198, 220, 220, 220, 20613, 62, 38659, 796, 44161, 578, 18, 13, 8443, 7203, 29609, 14453, 62, 18170, 14, 4775, 62, 48806, 13, 9945, 4943, 198, 220, 220, 220, 20613, 62, 66, 21471, 796, 20613, 62, 38659, 13, 66, 21471, 3419, 628, 220, 220, 220, 20613, 62, 66, 21471, 13, 41049, 10786, 7707, 3185, 43679, 16876, 7788, 1797, 4694, 23087, 705, 8, 198, 220, 220, 220, 20613, 62, 66, 21471, 13, 41049, 10786, 43387, 6158, 43679, 23087, 357, 12102, 62, 4775, 40383, 8, 11537, 628, 220, 220, 220, 351, 1280, 10786, 29609, 14453, 62, 18170, 14, 10879, 13, 14116, 11537, 355, 1573, 62, 7753, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4938, 62, 10879, 796, 900, 7, 4775, 62, 7753, 13, 961, 22446, 21037, 22446, 35312, 28955, 628, 220, 220, 220, 329, 2378, 287, 4938, 62, 10879, 25, 198, 220, 220, 220, 220, 220, 220, 220, 20613, 62, 66, 21471, 13, 41049, 10786, 20913, 17395, 39319, 23087, 26173, 35409, 357, 10091, 3256, 357, 9186, 11, 4008, 628, 220, 220, 220, 20613, 62, 38659, 13, 41509, 3419, 198, 220, 220, 220, 20613, 62, 38659, 13, 19836, 3419, 628, 198, 4299, 12260, 62, 22766, 62, 3642, 1299, 7, 2724, 3408, 62, 4775, 25, 965, 2599, 198, 220, 220, 220, 37227, 35561, 2081, 611, 262, 4731, 318, 7763, 1626, 262, 4938, 62, 4775, 37227, 198, 220, 220, 220, 20613, 796, 44161, 578, 18, 13, 8443, 7203, 29609, 14453, 62, 18170, 14, 4775, 62, 48806, 13, 9945, 4943, 198, 220, 220, 220, 20613, 62, 66, 21471, 796, 20613, 13, 66, 21471, 3419, 628, 220, 220, 220, 20613, 62, 66, 21471, 13, 41049, 7203, 46506, 5752, 312, 16034, 23087, 33411, 4938, 62, 4775, 796, 5633, 1600, 357, 2724, 3408, 62, 4775, 13, 21037, 22784, 4008, 628, 220, 220, 220, 1255, 796, 20613, 62, 66, 21471, 13, 69, 7569, 505, 3419, 628, 220, 220, 220, 611, 1255, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 628, 220, 220, 220, 20613, 13, 19836, 3419, 198 ]
2.785436
769
"""Testing the StringEnum class.""" import ezenum as eze def test_basic(): """Just check it out.""" rgb = eze.StringEnum(['Red', 'Green', 'Blue']) assert rgb.Red == 'Red' assert rgb.Green == 'Green' assert rgb.Blue == 'Blue' assert rgb[0] == 'Red' assert rgb[1] == 'Green' assert rgb[2] == 'Blue' assert len(rgb) == 3 assert repr(rgb) == "['Red', 'Green', 'Blue']"
[ 37811, 44154, 262, 10903, 4834, 388, 1398, 526, 15931, 198, 198, 11748, 304, 4801, 388, 355, 304, 2736, 628, 198, 4299, 1332, 62, 35487, 33529, 198, 220, 220, 220, 37227, 5703, 2198, 340, 503, 526, 15931, 198, 220, 220, 220, 46140, 796, 304, 2736, 13, 10100, 4834, 388, 7, 17816, 7738, 3256, 705, 13719, 3256, 705, 14573, 6, 12962, 198, 220, 220, 220, 6818, 46140, 13, 7738, 6624, 705, 7738, 6, 198, 220, 220, 220, 6818, 46140, 13, 13719, 6624, 705, 13719, 6, 198, 220, 220, 220, 6818, 46140, 13, 14573, 6624, 705, 14573, 6, 198, 220, 220, 220, 6818, 46140, 58, 15, 60, 6624, 705, 7738, 6, 198, 220, 220, 220, 6818, 46140, 58, 16, 60, 6624, 705, 13719, 6, 198, 220, 220, 220, 6818, 46140, 58, 17, 60, 6624, 705, 14573, 6, 198, 220, 220, 220, 6818, 18896, 7, 81, 22296, 8, 6624, 513, 198, 220, 220, 220, 6818, 41575, 7, 81, 22296, 8, 6624, 12878, 6, 7738, 3256, 705, 13719, 3256, 705, 14573, 20520, 1, 198 ]
2.414201
169
from __future__ import annotations import yaml from importlib.resources import read_text from ...config.configuration import Metric, MetricConfiguration from ...config.junos import JunosMetricConfiguration from ...devices import junosdevice from .. import junos from ..base import Collector from . import base
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 198, 11748, 331, 43695, 198, 6738, 1330, 8019, 13, 37540, 1330, 1100, 62, 5239, 198, 198, 6738, 2644, 11250, 13, 11250, 3924, 1330, 3395, 1173, 11, 3395, 1173, 38149, 198, 6738, 2644, 11250, 13, 29741, 418, 1330, 7653, 418, 9171, 1173, 38149, 198, 6738, 2644, 42034, 1330, 10891, 418, 25202, 198, 6738, 11485, 1330, 10891, 418, 198, 6738, 11485, 8692, 1330, 17573, 198, 6738, 764, 1330, 2779, 628 ]
4.173333
75
# -*- coding: utf-8 -*- # Copyright (c) 2013, Sergio Callegari # All rights reserved. # This file is part of PyDSM. # PyDSM 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. # PyDSM is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with PyDSM. If not, see <http://www.gnu.org/licenses/>. """ ISO 226 loudness countours (:mod:`pysdm.iso226`) ================================================ Loudness contours from ISO 226. Contours are returned both as tables of data and as contour functions .. currentmodule:: pydsm.iso226 Functions returning ISO 226 contours ------------------------------------ .. autosummary:: :toctree: generated/ iso226_spl_contour -- Equal loudness contour (tabled) iso226_spl_itpl -- Interpolated equal loudness contour Functions computing loudness/acoustic pressure ---------------------------------------------- .. autosummary:: :toctree: generated/ tabled_L_p -- Return table of sound pressure levels for given loudness tabled_L_N -- Return table of perceived loudness for given sound pressure Functions returning data tabled in the standard ----------------------------------------------- .. autosummary:: :toctree: generated/ tabled_f -- Return table of frequencies in ISO 226 tabled_alpha_f -- Return table of exponents for loudness perception tabled_L_U -- Return table of magnitudes of the linear transfer function tabled_T_f -- Return table of thresholds of hearing Notes ----- This module uses data from the latest revision of ISO 226 [1]_. For reference, also consider [2]_. The ISO standard provides the equal loudness contours as tabled data. Tables end at 12.5 kHz. Above this frequency equal-loudness-level data are relatively scarce and tend to be variable [3]_. Yet, it is known that the human ear has a precipitous decline in sensitivity with increasing frequency above 15 kHz, to the point that at about 20 kHz the percieved sound becomes negligible (> 100 dB attenuation) [4]_. For this reason, this module includes the possibility of delivering some modified ISO contours where the tabled data is augmented by creating a new data point at 20 kHz where the behavior found at 20 Hz is replicated. .. [1] ISO 226:2003 "Acoustics - Normal equal-loudness-level contours" .. [2] Jeff Tackett, "ISO 226 Equal-Loudness-Level Contour Signal," 2005 (http://www.mathworks.com/matlabcentral/fileexchange/7028) .. [3] Yoiti Suzuki et al, "Precise and Full-range Determination of Two-dimensional Equal Loudness Contours," 2003 (http://www.nedo.go.jp/itd/grant-e/report/00pdf/is-01e.pdf) .. [4] Robert A. Wannamaker "Psychoacoustically Optimal Noise Shaping", J. Audio Eng. Soc., Vol. 40, N. 7/8, 1992 July/August """ from __future__ import division, print_function import numpy as np from scipy.interpolate import InterpolatedUnivariateSpline __all__ = ["tabled_f", "tabled_alpha_f", "tabled_L_U", "tabled_T_f", "tabled_L_p", "tabled_L_N", "iso226_spl_contour", "iso226_spl_itpl"] # Tabled ISO 226 parameters tbl_f = np.asarray( [20, 25, 31.5, 40, 50, 63, 80, 100, 125, 160, 200, 250, 315, 400, 500, 630, 800, 1000, 1250, 1600, 2000, 2500, 3150, 4000, 5000, 6300, 8000, 10000, 12500]) tbl_alpha_f = np.asarray( [0.532, 0.506, 0.480, 0.455, 0.432, 0.409, 0.387, 0.367, 0.349, 0.330, 0.315, 0.301, 0.288, 0.276, 0.267, 0.259, 0.253, 0.250, 0.246, 0.244, 0.243, 0.243, 0.243, 0.242, 0.242, 0.245, 0.254, 0.271, 0.301]) tbl_L_U = np.asarray( [-31.6, -27.2, -23.0, -19.1, -15.9, -13.0, -10.3, -8.1, -6.2, -4.5, -3.1, -2.0, -1.1, -0.4, 0.0, 0.3, 0.5, 0.0, -2.7, -4.1, -1.0, 1.7, 2.5, 1.2, -2.1, -7.1, -11.2, -10.7, -3.1]) tbl_T_f = np.asarray( [78.5, 68.7, 59.5, 51.1, 44.0, 37.5, 31.5, 26.5, 22.1, 17.9, 14.4, 11.4, 8.6, 6.2, 4.4, 3.0, 2.2, 2.4, 3.5, 1.7, -1.3, -4.2, -6.0, -5.4, -1.5, 6.0, 12.6, 13.9, 12.3]) def tabled_f(hfe=False): """Table of frequencies in ISO 226. Parameters ---------- hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) Returns ------- f : array of floats the frequency table. """ return np.append(tbl_f, 20E3) if hfe else tbl_f def tabled_alpha_f(hfe=False): """Table of exponents for loudness perception in ISO 226. Parameters ---------- hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) Returns ------- alpha_f : array of floats the exponents table. """ return np.append(tbl_alpha_f, tbl_alpha_f[0]) if hfe else tbl_alpha_f def tabled_L_U(hfe=False): """Table of magnitudes of the linear transfer function in ISO 226. Parameters ---------- hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) Returns ------- L_U : array of floats the magnitudes table. Notes ----- The returned values are the magnitude of the linear transfer function normalized at 1 kHz. """ return np.append(tbl_L_U, tbl_L_U[0]) if hfe else tbl_L_U def tabled_T_f(hfe=False): """Table of thresholds of hearing in ISO 226. Parameters ---------- hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) Returns ------- T_f : array of floats the thresholds table. """ return np.append(tbl_T_f, tbl_T_f[0]) if hfe else tbl_T_f # Check that it works fine when L_N is array def tabled_A_f(L_N, hfe=False): """Table of A_f values for given loundess in ISO 226. Parameters ---------- L_N : float percieved loudness level in phons hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) Returns ------- A_f : array of floats the A_f table. Notes ----- 1 phon is 1 dB_SPL (sound pressure level) at 1 kHz. Sound pressure levels are measured in dBs by referring to a reference pressure level P0 (close to the hearing threshold at 1 kHz and set to 20 uPa RMS). """ A_f = (4.47E-3*(10.0**(0.025*L_N)-1.15) + (0.4*10.0**((tbl_T_f+tbl_L_U)/10.0-9.0))**tbl_alpha_f) return np.append(A_f, A_f[0]) if hfe else A_f # Check that it works fine when L_N is array def tabled_L_p(L_N, hfe=False): """Table of sound pressure levels for given loudness in ISO 226. This function returns a table according to ISO 226 sect 4.1. Parameters ---------- L_N : float percieved loudness level in phons hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) Returns ------- L_p : array of floats the sound pressure level table. Sound pressure levels are returned in DB_SPL Notes ----- 1 phon is 1 dB_SPL (sound pressure level) at 1 kHz. Sound pressure levels are measured in dBs by referring to a reference pressure level P0 (close to the hearing threshold at 1 kHz and set to 20 uPa RMS). """ L_p = (10.0/tbl_alpha_f)*np.log10(tabled_A_f(L_N))-tbl_L_U + 94.0 return np.append(L_p, L_p[0]) if hfe else L_p # Check that it works fine when L_P is array def tabled_B_f(L_p, hfe=False): """Table of B_f values for given sound pressure in ISO 226. Parameters ---------- L_p : float sound pressure level in dB_SPL hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) Returns ------- B_f : array of floats the B_f table. Notes ----- Sound pressure levels are measured in dBs by referring to a reference pressure level P0 (close to the hearing threshold at 1 kHz and set to 20 uPa RMS). """ B_f = ((0.4*10**(L_p+tbl_L_U)/10.-9.)**tbl_alpha_f - (0.4*10**(tbl_T_f+tbl_L_U)/10.-9.)**tbl_alpha_f + 0.005135) return np.append(B_f, B_f[0]) if hfe else B_f # Check that it works fine when L_N is array def tabled_L_N(L_p, hfe=False): """Table of perceived loudness levels for given sound pressure in ISO 226. This function returns a table according to ISO 226 sect 4.2. Parameters ---------- L_p : float sound pressure level in dB_SPL hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) Returns ------- L_N : array of floats the perceived loudness level table. Loudness levels are returned in phons Notes ----- 1 phon is 1 dB_SPL (sound pressure level) at 1 kHz. Sound pressure levels are measured in dBs by referring to a reference pressure level P0 (close to the hearing threshold at 1 kHz and set to 20 uPa RMS). """ L_N = 40*np.log10(tabled_B_f(L_p))+94.0 return np.append(L_N, L_N[0]) if hfe else L_N def iso226_spl_contour(L_N=40, hfe=False): """Generates an equal loudness contour as described in ISO 226. This function returns the control points describing the equal loudness contour for the input phon level, according to ISO 226 sect 4.1. Parameters ---------- L_N : float, optional perceived loudness level in phons. hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) Returns ------- f : ndarray frequencies where the loudness is evaluated. spl : ndarray equivalent sound pressure level at the frequencies f. Notes ----- 1 phon is 1 dB_SPL (sound pressure level) at 1 kHz. Sound pressure levels are measured in dBs by referring to a reference pressure level P0 (close to the hearing threshold at 1 kHz and set to 20 uPa RMS). The valid input phon range is 0-90 dB_SPL. Above 80 dB, only the frequency range 20-4000 Hz is significant. """ # Check for valid input range if L_N < 0 or L_N > 90: raise ValueError('Parameter L_N out of bounds [0-90].') # Derive sound pressure level from loudness level (ISO 226 sect 4.1) return tabled_f(hfe), tabled_L_p(L_N, hfe) def iso226_spl_itpl(L_N=40, hfe=False, k=3): """Generates an interpolation of an equal loudness contour. This function returns an interpolation object describing the equal loudness contour for the input phon level, according to ISO 226 sect 4.1. Parameters ---------- L_N : float, optional perceived loudness level in phons. hfe : bool whether the table should be augmented with a data point at 20 kHz (High-Frequency-Enhanced table) k : int interpolation order Returns ------- itpl : univariate interpolation object function-like object that takes a frequency f as its input and returns the equivalent sound pressure level at f Notes ----- 1 phon is 1 dB_SPL (sound pressure level) at 1 kHz. Sound pressure levels are measured in dBs by referring to a reference pressure level P0 (close to the hearing threshold at 1 kHz and set to 20 uPa RMS). The valid input phon range is 0-90 dB_SPL. Above 80 dB, only the frequency range 20-4000 Hz is significant. """ ff, yy = iso226_spl_contour(L_N, hfe) return InterpolatedUnivariateSpline(ff, yy, k=k)
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 15069, 357, 66, 8, 2211, 11, 36759, 2199, 1455, 2743, 198, 2, 1439, 2489, 10395, 13, 198, 198, 2, 770, 2393, 318, 636, 286, 9485, 5258, 44, 13, 198, 198, 2, 9485, 5258, 44, 318, 1479, 3788, 25, 345, 460, 17678, 4163, 340, 290, 14, 273, 13096, 340, 198, 2, 739, 262, 2846, 286, 262, 22961, 3611, 5094, 13789, 355, 3199, 416, 198, 2, 262, 3232, 10442, 5693, 11, 2035, 2196, 513, 286, 262, 13789, 11, 393, 198, 2, 357, 265, 534, 3038, 8, 597, 1568, 2196, 13, 198, 198, 2, 9485, 5258, 44, 318, 9387, 287, 262, 2911, 326, 340, 481, 307, 4465, 11, 198, 2, 475, 42881, 15529, 34764, 56, 26, 1231, 772, 262, 17142, 18215, 286, 198, 2, 34482, 3398, 1565, 5603, 25382, 393, 376, 46144, 7473, 317, 16652, 2149, 37232, 33079, 48933, 13, 220, 4091, 262, 198, 2, 22961, 3611, 5094, 13789, 329, 517, 3307, 13, 198, 198, 2, 921, 815, 423, 2722, 257, 4866, 286, 262, 22961, 3611, 5094, 13789, 198, 2, 1863, 351, 9485, 5258, 44, 13, 220, 1002, 407, 11, 766, 1279, 4023, 1378, 2503, 13, 41791, 13, 2398, 14, 677, 4541, 15913, 13, 198, 198, 37811, 198, 40734, 31510, 7812, 1108, 954, 4662, 357, 25, 4666, 25, 63, 79, 893, 36020, 13, 26786, 24909, 63, 8, 198, 10052, 4770, 198, 198, 43, 2778, 1108, 542, 4662, 422, 19694, 31510, 13, 198, 198, 4264, 4662, 389, 4504, 1111, 355, 8893, 286, 1366, 290, 355, 542, 454, 5499, 198, 198, 492, 1459, 21412, 3712, 279, 5173, 5796, 13, 26786, 24909, 628, 198, 24629, 2733, 8024, 19694, 31510, 542, 4662, 198, 3880, 650, 198, 198, 492, 44619, 388, 6874, 3712, 198, 220, 220, 1058, 1462, 310, 631, 25, 7560, 14, 628, 220, 220, 47279, 24909, 62, 22018, 62, 3642, 454, 1377, 28701, 7812, 1108, 542, 454, 357, 83, 4510, 8, 198, 220, 220, 47279, 24909, 62, 22018, 62, 270, 489, 220, 1377, 4225, 16104, 515, 4961, 7812, 1108, 542, 454, 628, 198, 24629, 2733, 14492, 7812, 1108, 14, 330, 21618, 3833, 198, 3880, 26171, 198, 198, 492, 44619, 388, 6874, 3712, 198, 220, 220, 1058, 1462, 310, 631, 25, 7560, 14, 628, 220, 220, 256, 4510, 62, 43, 62, 79, 220, 1377, 8229, 3084, 286, 2128, 3833, 2974, 329, 1813, 7812, 1108, 198, 220, 220, 256, 4510, 62, 43, 62, 45, 220, 1377, 8229, 3084, 286, 11067, 7812, 1108, 329, 1813, 2128, 3833, 628, 198, 24629, 2733, 8024, 1366, 256, 4510, 287, 262, 3210, 198, 3880, 24305, 198, 198, 492, 44619, 388, 6874, 3712, 198, 220, 220, 1058, 1462, 310, 631, 25, 7560, 14, 628, 220, 220, 256, 4510, 62, 69, 220, 1377, 8229, 3084, 286, 19998, 287, 19694, 31510, 198, 220, 220, 256, 4510, 62, 26591, 62, 69, 220, 1377, 8229, 3084, 286, 1033, 3906, 329, 7812, 1108, 11202, 198, 220, 220, 256, 4510, 62, 43, 62, 52, 220, 1377, 8229, 3084, 286, 7842, 10455, 286, 262, 14174, 4351, 2163, 198, 220, 220, 256, 4510, 62, 51, 62, 69, 220, 1377, 8229, 3084, 286, 40885, 286, 4854, 628, 198, 16130, 198, 30934, 198, 1212, 8265, 3544, 1366, 422, 262, 3452, 18440, 286, 19694, 31510, 685, 16, 60, 44807, 198, 1890, 4941, 11, 635, 2074, 685, 17, 60, 44807, 198, 198, 464, 19694, 3210, 3769, 262, 4961, 7812, 1108, 542, 4662, 355, 256, 4510, 1366, 13, 198, 51, 2977, 886, 379, 1105, 13, 20, 37597, 13, 23302, 428, 8373, 4961, 12, 75, 2778, 1108, 12, 5715, 1366, 389, 198, 2411, 9404, 18549, 290, 4327, 284, 307, 7885, 685, 18, 60, 44807, 6430, 11, 340, 318, 1900, 198, 5562, 262, 1692, 1027, 468, 257, 18812, 22109, 7794, 287, 14233, 351, 3649, 198, 35324, 2029, 1315, 37597, 11, 284, 262, 966, 326, 379, 546, 1160, 37597, 262, 583, 66, 39591, 2128, 198, 9423, 2586, 36480, 45160, 1802, 30221, 31919, 2288, 8, 685, 19, 60, 44807, 1114, 428, 1738, 11, 198, 5661, 8265, 3407, 262, 5885, 286, 13630, 617, 9518, 19694, 542, 4662, 198, 3003, 262, 256, 4510, 1366, 318, 30259, 416, 4441, 257, 649, 1366, 966, 379, 1160, 37597, 198, 3003, 262, 4069, 1043, 379, 1160, 26109, 318, 35108, 13, 198, 198, 492, 685, 16, 60, 19694, 31510, 25, 16088, 366, 12832, 23968, 873, 532, 14435, 4961, 12, 75, 2778, 1108, 12, 5715, 542, 4662, 1, 198, 492, 685, 17, 60, 5502, 309, 441, 3087, 11, 366, 40734, 31510, 28701, 12, 43, 2778, 1108, 12, 4971, 2345, 454, 26484, 553, 198, 220, 220, 5075, 198, 220, 220, 357, 4023, 1378, 2503, 13, 11018, 5225, 13, 785, 14, 6759, 23912, 31463, 14, 7753, 1069, 3803, 14, 2154, 2078, 8, 198, 492, 685, 18, 60, 25455, 8846, 35807, 2123, 435, 11, 366, 6719, 37561, 290, 6462, 12, 9521, 360, 29610, 286, 198, 220, 220, 4930, 12, 19577, 28701, 41520, 1108, 2345, 4662, 553, 5816, 198, 220, 220, 357, 4023, 1378, 2503, 13, 2817, 78, 13, 2188, 13, 34523, 14, 270, 67, 14, 2164, 415, 12, 68, 14, 13116, 14, 405, 12315, 14, 271, 12, 486, 68, 13, 12315, 8, 198, 492, 685, 19, 60, 5199, 317, 13, 370, 1236, 321, 3110, 366, 31923, 78, 330, 23968, 1146, 13123, 4402, 30964, 198, 220, 220, 911, 9269, 1600, 449, 13, 13491, 1985, 13, 3345, 1539, 4709, 13, 2319, 11, 399, 13, 767, 14, 23, 11, 9768, 2901, 14, 17908, 198, 37811, 198, 198, 6738, 11593, 37443, 834, 1330, 7297, 11, 3601, 62, 8818, 198, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 629, 541, 88, 13, 3849, 16104, 378, 1330, 4225, 16104, 515, 3118, 42524, 26568, 500, 198, 198, 834, 439, 834, 796, 14631, 83, 4510, 62, 69, 1600, 366, 83, 4510, 62, 26591, 62, 69, 1600, 366, 83, 4510, 62, 43, 62, 52, 1600, 366, 83, 4510, 62, 51, 62, 69, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 83, 4510, 62, 43, 62, 79, 1600, 366, 83, 4510, 62, 43, 62, 45, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 26786, 24909, 62, 22018, 62, 3642, 454, 1600, 366, 26786, 24909, 62, 22018, 62, 270, 489, 8973, 198, 198, 2, 309, 4510, 19694, 31510, 10007, 198, 83, 2436, 62, 69, 796, 45941, 13, 292, 18747, 7, 198, 220, 220, 220, 685, 1238, 11, 1679, 11, 3261, 13, 20, 11, 2319, 11, 2026, 11, 8093, 11, 4019, 11, 1802, 11, 13151, 11, 13454, 11, 939, 11, 8646, 11, 32647, 11, 7337, 11, 198, 220, 220, 220, 220, 5323, 11, 44505, 11, 10460, 11, 8576, 11, 1105, 1120, 11, 26143, 11, 4751, 11, 33507, 11, 3261, 1120, 11, 30123, 11, 23336, 11, 718, 6200, 11, 198, 220, 220, 220, 220, 38055, 11, 33028, 11, 1105, 4059, 12962, 198, 83, 2436, 62, 26591, 62, 69, 796, 45941, 13, 292, 18747, 7, 198, 220, 220, 220, 685, 15, 13, 20, 2624, 11, 657, 13, 35638, 11, 657, 13, 22148, 11, 657, 13, 30505, 11, 657, 13, 45331, 11, 657, 13, 29416, 11, 657, 13, 32220, 11, 657, 13, 27824, 11, 657, 13, 27371, 11, 657, 13, 26073, 11, 198, 220, 220, 220, 220, 657, 13, 27936, 11, 657, 13, 18938, 11, 657, 13, 25270, 11, 657, 13, 27988, 11, 657, 13, 25674, 11, 657, 13, 25191, 11, 657, 13, 28592, 11, 657, 13, 9031, 11, 657, 13, 26912, 11, 657, 13, 25707, 11, 198, 220, 220, 220, 220, 657, 13, 26660, 11, 657, 13, 26660, 11, 657, 13, 26660, 11, 657, 13, 27877, 11, 657, 13, 27877, 11, 657, 13, 22995, 11, 657, 13, 24970, 11, 657, 13, 28977, 11, 657, 13, 18938, 12962, 198, 83, 2436, 62, 43, 62, 52, 796, 45941, 13, 292, 18747, 7, 198, 220, 220, 220, 25915, 3132, 13, 21, 11, 532, 1983, 13, 17, 11, 532, 1954, 13, 15, 11, 532, 1129, 13, 16, 11, 532, 1314, 13, 24, 11, 532, 1485, 13, 15, 11, 532, 940, 13, 18, 11, 532, 23, 13, 16, 11, 532, 21, 13, 17, 11, 532, 19, 13, 20, 11, 198, 220, 220, 220, 220, 532, 18, 13, 16, 11, 532, 17, 13, 15, 11, 532, 16, 13, 16, 11, 532, 15, 13, 19, 11, 657, 13, 15, 11, 657, 13, 18, 11, 657, 13, 20, 11, 657, 13, 15, 11, 532, 17, 13, 22, 11, 532, 19, 13, 16, 11, 532, 16, 13, 15, 11, 352, 13, 22, 11, 198, 220, 220, 220, 220, 362, 13, 20, 11, 352, 13, 17, 11, 532, 17, 13, 16, 11, 532, 22, 13, 16, 11, 532, 1157, 13, 17, 11, 532, 940, 13, 22, 11, 532, 18, 13, 16, 12962, 198, 83, 2436, 62, 51, 62, 69, 796, 45941, 13, 292, 18747, 7, 198, 220, 220, 220, 685, 3695, 13, 20, 11, 8257, 13, 22, 11, 7863, 13, 20, 11, 6885, 13, 16, 11, 5846, 13, 15, 11, 5214, 13, 20, 11, 3261, 13, 20, 11, 2608, 13, 20, 11, 2534, 13, 16, 11, 1596, 13, 24, 11, 1478, 13, 19, 11, 198, 220, 220, 220, 220, 1367, 13, 19, 11, 807, 13, 21, 11, 718, 13, 17, 11, 604, 13, 19, 11, 513, 13, 15, 11, 362, 13, 17, 11, 362, 13, 19, 11, 513, 13, 20, 11, 352, 13, 22, 11, 532, 16, 13, 18, 11, 532, 19, 13, 17, 11, 532, 21, 13, 15, 11, 532, 20, 13, 19, 11, 198, 220, 220, 220, 220, 532, 16, 13, 20, 11, 718, 13, 15, 11, 1105, 13, 21, 11, 1511, 13, 24, 11, 1105, 13, 18, 12962, 628, 198, 4299, 256, 4510, 62, 69, 7, 71, 5036, 28, 25101, 2599, 198, 220, 220, 220, 37227, 10962, 286, 19998, 287, 19694, 31510, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 277, 1058, 7177, 286, 36016, 198, 220, 220, 220, 220, 220, 220, 220, 262, 8373, 3084, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 45941, 13, 33295, 7, 83, 2436, 62, 69, 11, 1160, 36, 18, 8, 611, 289, 5036, 2073, 256, 2436, 62, 69, 628, 198, 4299, 256, 4510, 62, 26591, 62, 69, 7, 71, 5036, 28, 25101, 2599, 198, 220, 220, 220, 37227, 10962, 286, 1033, 3906, 329, 7812, 1108, 11202, 287, 19694, 31510, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 17130, 62, 69, 1058, 7177, 286, 36016, 198, 220, 220, 220, 220, 220, 220, 220, 262, 1033, 3906, 3084, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 45941, 13, 33295, 7, 83, 2436, 62, 26591, 62, 69, 11, 256, 2436, 62, 26591, 62, 69, 58, 15, 12962, 611, 289, 5036, 2073, 256, 2436, 62, 26591, 62, 69, 628, 198, 4299, 256, 4510, 62, 43, 62, 52, 7, 71, 5036, 28, 25101, 2599, 198, 220, 220, 220, 37227, 10962, 286, 7842, 10455, 286, 262, 14174, 4351, 2163, 287, 19694, 31510, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 406, 62, 52, 1058, 7177, 286, 36016, 198, 220, 220, 220, 220, 220, 220, 220, 262, 7842, 10455, 3084, 13, 628, 220, 220, 220, 11822, 198, 220, 220, 220, 37404, 198, 220, 220, 220, 383, 4504, 3815, 389, 262, 14735, 286, 262, 14174, 4351, 2163, 198, 220, 220, 220, 39279, 379, 352, 37597, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 45941, 13, 33295, 7, 83, 2436, 62, 43, 62, 52, 11, 256, 2436, 62, 43, 62, 52, 58, 15, 12962, 611, 289, 5036, 2073, 256, 2436, 62, 43, 62, 52, 628, 198, 4299, 256, 4510, 62, 51, 62, 69, 7, 71, 5036, 28, 25101, 2599, 198, 220, 220, 220, 37227, 10962, 286, 40885, 286, 4854, 287, 19694, 31510, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 309, 62, 69, 1058, 7177, 286, 36016, 198, 220, 220, 220, 220, 220, 220, 220, 262, 40885, 3084, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 45941, 13, 33295, 7, 83, 2436, 62, 51, 62, 69, 11, 256, 2436, 62, 51, 62, 69, 58, 15, 12962, 611, 289, 5036, 2073, 256, 2436, 62, 51, 62, 69, 628, 198, 2, 6822, 326, 340, 2499, 3734, 618, 406, 62, 45, 318, 7177, 198, 4299, 256, 4510, 62, 32, 62, 69, 7, 43, 62, 45, 11, 289, 5036, 28, 25101, 2599, 198, 220, 220, 220, 37227, 10962, 286, 317, 62, 69, 3815, 329, 1813, 300, 633, 408, 287, 19694, 31510, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 406, 62, 45, 1058, 12178, 198, 220, 220, 220, 220, 220, 220, 220, 583, 66, 39591, 7812, 1108, 1241, 287, 872, 684, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 317, 62, 69, 1058, 7177, 286, 36016, 198, 220, 220, 220, 220, 220, 220, 220, 262, 317, 62, 69, 3084, 13, 628, 220, 220, 220, 11822, 198, 220, 220, 220, 37404, 198, 220, 220, 220, 352, 32896, 318, 352, 30221, 62, 4303, 43, 357, 23661, 3833, 1241, 8, 379, 352, 37597, 13, 9506, 3833, 2974, 198, 220, 220, 220, 389, 8630, 287, 30221, 82, 416, 9759, 284, 257, 4941, 3833, 1241, 350, 15, 357, 19836, 198, 220, 220, 220, 284, 262, 4854, 11387, 379, 352, 37597, 290, 900, 284, 1160, 334, 28875, 371, 5653, 737, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 317, 62, 69, 796, 357, 19, 13, 2857, 36, 12, 18, 9, 7, 940, 13, 15, 1174, 7, 15, 13, 36629, 9, 43, 62, 45, 13219, 16, 13, 1314, 8, 1343, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 15, 13, 19, 9, 940, 13, 15, 1174, 19510, 83, 2436, 62, 51, 62, 69, 10, 83, 2436, 62, 43, 62, 52, 20679, 940, 13, 15, 12, 24, 13, 15, 4008, 1174, 83, 2436, 62, 26591, 62, 69, 8, 198, 220, 220, 220, 1441, 45941, 13, 33295, 7, 32, 62, 69, 11, 317, 62, 69, 58, 15, 12962, 611, 289, 5036, 2073, 317, 62, 69, 628, 198, 2, 6822, 326, 340, 2499, 3734, 618, 406, 62, 45, 318, 7177, 198, 4299, 256, 4510, 62, 43, 62, 79, 7, 43, 62, 45, 11, 289, 5036, 28, 25101, 2599, 198, 220, 220, 220, 37227, 10962, 286, 2128, 3833, 2974, 329, 1813, 7812, 1108, 287, 19694, 31510, 13, 628, 220, 220, 220, 770, 2163, 5860, 257, 3084, 1864, 284, 19694, 31510, 15951, 604, 13, 16, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 406, 62, 45, 1058, 12178, 198, 220, 220, 220, 220, 220, 220, 220, 583, 66, 39591, 7812, 1108, 1241, 287, 872, 684, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 406, 62, 79, 1058, 7177, 286, 36016, 198, 220, 220, 220, 220, 220, 220, 220, 262, 2128, 3833, 1241, 3084, 13, 9506, 3833, 2974, 389, 4504, 198, 220, 220, 220, 220, 220, 220, 220, 287, 20137, 62, 4303, 43, 628, 220, 220, 220, 11822, 198, 220, 220, 220, 37404, 198, 220, 220, 220, 352, 32896, 318, 352, 30221, 62, 4303, 43, 357, 23661, 3833, 1241, 8, 379, 352, 37597, 13, 9506, 3833, 2974, 198, 220, 220, 220, 389, 8630, 287, 30221, 82, 416, 9759, 284, 257, 4941, 3833, 1241, 350, 15, 357, 19836, 198, 220, 220, 220, 284, 262, 4854, 11387, 379, 352, 37597, 290, 900, 284, 1160, 334, 28875, 371, 5653, 737, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 406, 62, 79, 796, 357, 940, 13, 15, 14, 83, 2436, 62, 26591, 62, 69, 27493, 37659, 13, 6404, 940, 7, 83, 4510, 62, 32, 62, 69, 7, 43, 62, 45, 4008, 12, 83, 2436, 62, 43, 62, 52, 1343, 10048, 13, 15, 198, 220, 220, 220, 1441, 45941, 13, 33295, 7, 43, 62, 79, 11, 406, 62, 79, 58, 15, 12962, 611, 289, 5036, 2073, 406, 62, 79, 628, 198, 2, 6822, 326, 340, 2499, 3734, 618, 406, 62, 47, 318, 7177, 198, 4299, 256, 4510, 62, 33, 62, 69, 7, 43, 62, 79, 11, 289, 5036, 28, 25101, 2599, 198, 220, 220, 220, 37227, 10962, 286, 347, 62, 69, 3815, 329, 1813, 2128, 3833, 287, 19694, 31510, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 406, 62, 79, 1058, 12178, 198, 220, 220, 220, 220, 220, 220, 220, 2128, 3833, 1241, 287, 30221, 62, 4303, 43, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 347, 62, 69, 1058, 7177, 286, 36016, 198, 220, 220, 220, 220, 220, 220, 220, 262, 347, 62, 69, 3084, 13, 628, 220, 220, 220, 11822, 198, 220, 220, 220, 37404, 198, 220, 220, 220, 9506, 3833, 2974, 389, 8630, 287, 30221, 82, 416, 9759, 284, 257, 198, 220, 220, 220, 4941, 3833, 1241, 350, 15, 357, 19836, 284, 262, 4854, 11387, 379, 352, 37597, 290, 198, 220, 220, 220, 900, 284, 1160, 334, 28875, 371, 5653, 737, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 347, 62, 69, 796, 14808, 15, 13, 19, 9, 940, 1174, 7, 43, 62, 79, 10, 83, 2436, 62, 43, 62, 52, 20679, 940, 7874, 24, 2014, 1174, 83, 2436, 62, 26591, 62, 69, 532, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 15, 13, 19, 9, 940, 1174, 7, 83, 2436, 62, 51, 62, 69, 10, 83, 2436, 62, 43, 62, 52, 20679, 940, 7874, 24, 2014, 1174, 83, 2436, 62, 26591, 62, 69, 1343, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 657, 13, 22544, 17059, 8, 198, 220, 220, 220, 1441, 45941, 13, 33295, 7, 33, 62, 69, 11, 347, 62, 69, 58, 15, 12962, 611, 289, 5036, 2073, 347, 62, 69, 628, 198, 2, 6822, 326, 340, 2499, 3734, 618, 406, 62, 45, 318, 7177, 198, 4299, 256, 4510, 62, 43, 62, 45, 7, 43, 62, 79, 11, 289, 5036, 28, 25101, 2599, 198, 220, 220, 220, 37227, 10962, 286, 11067, 7812, 1108, 2974, 329, 1813, 2128, 3833, 287, 19694, 31510, 13, 628, 220, 220, 220, 770, 2163, 5860, 257, 3084, 1864, 284, 19694, 31510, 15951, 604, 13, 17, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 406, 62, 79, 1058, 12178, 198, 220, 220, 220, 220, 220, 220, 220, 2128, 3833, 1241, 287, 30221, 62, 4303, 43, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 406, 62, 45, 1058, 7177, 286, 36016, 198, 220, 220, 220, 220, 220, 220, 220, 262, 11067, 7812, 1108, 1241, 3084, 13, 41520, 1108, 2974, 389, 4504, 198, 220, 220, 220, 220, 220, 220, 220, 287, 872, 684, 628, 220, 220, 220, 11822, 198, 220, 220, 220, 37404, 198, 220, 220, 220, 352, 32896, 318, 352, 30221, 62, 4303, 43, 357, 23661, 3833, 1241, 8, 379, 352, 37597, 13, 9506, 3833, 2974, 198, 220, 220, 220, 389, 8630, 287, 30221, 82, 416, 9759, 284, 257, 4941, 3833, 1241, 350, 15, 357, 19836, 198, 220, 220, 220, 284, 262, 4854, 11387, 379, 352, 37597, 290, 900, 284, 1160, 334, 28875, 371, 5653, 737, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 406, 62, 45, 796, 2319, 9, 37659, 13, 6404, 940, 7, 83, 4510, 62, 33, 62, 69, 7, 43, 62, 79, 4008, 10, 5824, 13, 15, 198, 220, 220, 220, 1441, 45941, 13, 33295, 7, 43, 62, 45, 11, 406, 62, 45, 58, 15, 12962, 611, 289, 5036, 2073, 406, 62, 45, 628, 198, 4299, 47279, 24909, 62, 22018, 62, 3642, 454, 7, 43, 62, 45, 28, 1821, 11, 289, 5036, 28, 25101, 2599, 198, 220, 220, 220, 37227, 8645, 689, 281, 4961, 7812, 1108, 542, 454, 355, 3417, 287, 19694, 31510, 13, 628, 220, 220, 220, 770, 2163, 5860, 262, 1630, 2173, 12059, 262, 4961, 7812, 1108, 198, 220, 220, 220, 542, 454, 329, 262, 5128, 32896, 1241, 11, 1864, 284, 19694, 31510, 15951, 604, 13, 16, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 406, 62, 45, 1058, 12178, 11, 11902, 198, 220, 220, 220, 220, 220, 220, 220, 11067, 7812, 1108, 1241, 287, 872, 684, 13, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 277, 1058, 299, 67, 18747, 198, 220, 220, 220, 220, 220, 220, 220, 19998, 810, 262, 7812, 1108, 318, 16726, 13, 198, 220, 220, 220, 4328, 1058, 299, 67, 18747, 198, 220, 220, 220, 220, 220, 220, 220, 7548, 2128, 3833, 1241, 379, 262, 19998, 277, 13, 628, 220, 220, 220, 11822, 198, 220, 220, 220, 37404, 198, 220, 220, 220, 352, 32896, 318, 352, 30221, 62, 4303, 43, 357, 23661, 3833, 1241, 8, 379, 352, 37597, 13, 9506, 3833, 2974, 198, 220, 220, 220, 389, 8630, 287, 30221, 82, 416, 9759, 284, 257, 4941, 3833, 1241, 350, 15, 357, 19836, 198, 220, 220, 220, 284, 262, 4854, 11387, 379, 352, 37597, 290, 900, 284, 1160, 334, 28875, 371, 5653, 737, 628, 220, 220, 220, 383, 4938, 5128, 32896, 2837, 318, 657, 12, 3829, 30221, 62, 4303, 43, 13, 23302, 4019, 30221, 11, 691, 262, 198, 220, 220, 220, 8373, 2837, 1160, 12, 27559, 26109, 318, 2383, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 6822, 329, 4938, 5128, 2837, 198, 220, 220, 220, 611, 406, 62, 45, 1279, 657, 393, 406, 62, 45, 1875, 4101, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 11052, 12331, 10786, 36301, 406, 62, 45, 503, 286, 22303, 685, 15, 12, 3829, 60, 2637, 8, 198, 220, 220, 220, 1303, 9626, 425, 2128, 3833, 1241, 422, 7812, 1108, 1241, 357, 40734, 31510, 15951, 604, 13, 16, 8, 198, 220, 220, 220, 1441, 256, 4510, 62, 69, 7, 71, 5036, 828, 256, 4510, 62, 43, 62, 79, 7, 43, 62, 45, 11, 289, 5036, 8, 628, 198, 4299, 47279, 24909, 62, 22018, 62, 270, 489, 7, 43, 62, 45, 28, 1821, 11, 289, 5036, 28, 25101, 11, 479, 28, 18, 2599, 198, 220, 220, 220, 37227, 8645, 689, 281, 39555, 341, 286, 281, 4961, 7812, 1108, 542, 454, 13, 628, 220, 220, 220, 770, 2163, 5860, 281, 39555, 341, 2134, 12059, 262, 4961, 198, 220, 220, 220, 7812, 1108, 542, 454, 329, 262, 5128, 32896, 1241, 11, 1864, 284, 19694, 31510, 15951, 604, 13, 16, 13, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 406, 62, 45, 1058, 12178, 11, 11902, 198, 220, 220, 220, 220, 220, 220, 220, 11067, 7812, 1108, 1241, 287, 872, 684, 13, 198, 220, 220, 220, 289, 5036, 1058, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1771, 262, 3084, 815, 307, 30259, 351, 257, 1366, 966, 198, 220, 220, 220, 220, 220, 220, 220, 379, 1160, 37597, 357, 11922, 12, 37, 28707, 12, 49026, 3084, 8, 198, 220, 220, 220, 479, 1058, 493, 198, 220, 220, 220, 220, 220, 220, 220, 39555, 341, 1502, 628, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 340, 489, 1058, 555, 42524, 39555, 341, 2134, 198, 220, 220, 220, 220, 220, 220, 220, 2163, 12, 2339, 2134, 326, 2753, 257, 8373, 277, 355, 663, 5128, 290, 5860, 198, 220, 220, 220, 220, 220, 220, 220, 262, 7548, 2128, 3833, 1241, 379, 277, 628, 220, 220, 220, 11822, 198, 220, 220, 220, 37404, 198, 220, 220, 220, 352, 32896, 318, 352, 30221, 62, 4303, 43, 357, 23661, 3833, 1241, 8, 379, 352, 37597, 13, 9506, 3833, 2974, 198, 220, 220, 220, 389, 8630, 287, 30221, 82, 416, 9759, 284, 257, 4941, 3833, 1241, 350, 15, 357, 19836, 198, 220, 220, 220, 284, 262, 4854, 11387, 379, 352, 37597, 290, 900, 284, 1160, 334, 28875, 371, 5653, 737, 628, 220, 220, 220, 383, 4938, 5128, 32896, 2837, 318, 657, 12, 3829, 30221, 62, 4303, 43, 13, 23302, 4019, 30221, 11, 691, 262, 198, 220, 220, 220, 8373, 2837, 1160, 12, 27559, 26109, 318, 2383, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 31246, 11, 331, 88, 796, 47279, 24909, 62, 22018, 62, 3642, 454, 7, 43, 62, 45, 11, 289, 5036, 8, 198, 220, 220, 220, 1441, 4225, 16104, 515, 3118, 42524, 26568, 500, 7, 487, 11, 331, 88, 11, 479, 28, 74, 8, 198 ]
2.668518
4,501
import logging import sys from pyzabbix import ZabbixMetric, ZabbixSender from mongodb_consistent_backup.Errors import NotifyError, OperationError from mongodb_consistent_backup.Pipeline import Task
[ 11748, 18931, 198, 11748, 25064, 198, 198, 6738, 12972, 89, 6485, 844, 1330, 1168, 6485, 844, 9171, 1173, 11, 1168, 6485, 844, 50, 2194, 198, 198, 6738, 285, 506, 375, 65, 62, 5936, 7609, 62, 1891, 929, 13, 9139, 5965, 1330, 1892, 1958, 12331, 11, 14680, 12331, 198, 6738, 285, 506, 375, 65, 62, 5936, 7609, 62, 1891, 929, 13, 47, 541, 4470, 1330, 15941, 628 ]
3.060606
66
import pickle import os from detectron2.utils.file_io import PathManager from detectron2.checkpoint import DetectionCheckpointer from mmcv.runner.checkpoint import ( _load_checkpoint, load_state_dict, _process_mmcls_checkpoint, ) import math import logging from timm.models.helpers import load_state_dict_from_hf, load_state_dict_from_url, has_hf_hub, adapt_input_conv _logger = logging.getLogger(__name__) class MyCheckpointer(DetectionCheckpointer): """https://github.com/aim- uofa/AdelaiDet/blob/master/adet/checkpoint/adet_checkpoint.py Same as :class:`DetectronCheckpointer`, but is able to convert models in AdelaiDet, such as LPF backbone.""" def load_timm_pretrained( model, default_cfg=None, num_classes=1000, in_chans=3, filter_fn=None, strict=True, progress=True, adapt_input_mode="custom", ): """Load pretrained checkpoint Args: model (nn.Module) : PyTorch model module default_cfg (Optional[Dict]): default configuration for pretrained weights / target dataset num_classes (int): num_classes for model in_chans (int): in_chans for model filter_fn (Optional[Callable]): state_dict filter fn for load (takes state_dict, model as args) strict (bool): strict load of checkpoint progress (bool): enable progress bar for weight download """ default_cfg = default_cfg or getattr(model, "default_cfg", None) or {} pretrained_url = default_cfg.get("url", None) hf_hub_id = default_cfg.get("hf_hub", None) if not pretrained_url and not hf_hub_id: _logger.warning("No pretrained weights exist for this model. Using random initialization.") return if hf_hub_id and has_hf_hub(necessary=not pretrained_url): _logger.info(f"Loading pretrained weights from Hugging Face hub ({hf_hub_id})") state_dict = load_state_dict_from_hf(hf_hub_id) else: _logger.info(f"Loading pretrained weights from url ({pretrained_url})") state_dict = load_state_dict_from_url(pretrained_url, progress=progress, map_location="cpu") if filter_fn is not None: # for backwards compat with filter fn that take one arg, try one first, the two try: state_dict = filter_fn(state_dict) except TypeError: state_dict = filter_fn(state_dict, model) input_convs = default_cfg.get("first_conv", None) if input_convs is not None and in_chans != 3: if isinstance(input_convs, str): input_convs = (input_convs,) for input_conv_name in input_convs: weight_name = input_conv_name + ".weight" try: if adapt_input_mode == "timm": state_dict[weight_name] = adapt_input_conv(in_chans, state_dict[weight_name]) _logger.warning( f"Converted input conv {input_conv_name} pretrained weights from 3 to {in_chans} channel(s) using timm strategy" ) else: state_dict[weight_name] = my_adapt_input_conv( in_chans, state_dict[weight_name], model_conv_weight=model.state_dict()[weight_name] ) _logger.warning( f"Converted input conv {input_conv_name} pretrained weights from 3 to {in_chans} channel(s) using custom strategy" ) except NotImplementedError as e: del state_dict[weight_name] strict = False _logger.warning( f"Unable to convert pretrained {input_conv_name} weights, using random init for this layer." ) classifiers = default_cfg.get("classifier", None) label_offset = default_cfg.get("label_offset", 0) if classifiers is not None: if isinstance(classifiers, str): classifiers = (classifiers,) if num_classes != default_cfg["num_classes"]: for classifier_name in classifiers: # completely discard fully connected if model num_classes doesn't match pretrained weights del state_dict[classifier_name + ".weight"] del state_dict[classifier_name + ".bias"] strict = False elif label_offset > 0: for classifier_name in classifiers: # special case for pretrained weights with an extra background class in pretrained weights classifier_weight = state_dict[classifier_name + ".weight"] state_dict[classifier_name + ".weight"] = classifier_weight[label_offset:] classifier_bias = state_dict[classifier_name + ".bias"] state_dict[classifier_name + ".bias"] = classifier_bias[label_offset:] model.load_state_dict(state_dict, strict=strict)
[ 11748, 2298, 293, 198, 11748, 28686, 198, 6738, 4886, 1313, 17, 13, 26791, 13, 7753, 62, 952, 1330, 10644, 13511, 198, 6738, 4886, 1313, 17, 13, 9122, 4122, 1330, 46254, 9787, 29536, 198, 6738, 8085, 33967, 13, 16737, 13, 9122, 4122, 1330, 357, 198, 220, 220, 220, 4808, 2220, 62, 9122, 4122, 11, 198, 220, 220, 220, 3440, 62, 5219, 62, 11600, 11, 198, 220, 220, 220, 4808, 14681, 62, 3020, 565, 82, 62, 9122, 4122, 11, 198, 8, 198, 11748, 10688, 198, 11748, 18931, 198, 6738, 4628, 76, 13, 27530, 13, 16794, 364, 1330, 3440, 62, 5219, 62, 11600, 62, 6738, 62, 71, 69, 11, 3440, 62, 5219, 62, 11600, 62, 6738, 62, 6371, 11, 468, 62, 71, 69, 62, 40140, 11, 6068, 62, 15414, 62, 42946, 198, 198, 62, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 198, 4871, 2011, 9787, 29536, 7, 11242, 3213, 9787, 29536, 2599, 198, 220, 220, 220, 37227, 5450, 1378, 12567, 13, 785, 14, 1385, 12, 198, 220, 220, 220, 334, 1659, 64, 14, 2782, 417, 1872, 11242, 14, 2436, 672, 14, 9866, 14, 324, 316, 14, 9122, 4122, 14, 324, 316, 62, 9122, 4122, 13, 9078, 16766, 355, 198, 220, 220, 220, 1058, 4871, 25, 63, 47504, 1313, 9787, 29536, 47671, 475, 318, 1498, 284, 10385, 4981, 287, 1215, 417, 1872, 11242, 11, 198, 220, 220, 220, 884, 355, 18470, 37, 32774, 526, 15931, 628, 628, 198, 4299, 3440, 62, 83, 8608, 62, 5310, 13363, 7, 198, 220, 220, 220, 2746, 11, 198, 220, 220, 220, 4277, 62, 37581, 28, 14202, 11, 198, 220, 220, 220, 997, 62, 37724, 28, 12825, 11, 198, 220, 220, 220, 287, 62, 354, 504, 28, 18, 11, 198, 220, 220, 220, 8106, 62, 22184, 28, 14202, 11, 198, 220, 220, 220, 7646, 28, 17821, 11, 198, 220, 220, 220, 4371, 28, 17821, 11, 198, 220, 220, 220, 6068, 62, 15414, 62, 14171, 2625, 23144, 1600, 198, 2599, 198, 220, 220, 220, 37227, 8912, 2181, 13363, 26954, 198, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2746, 357, 20471, 13, 26796, 8, 1058, 9485, 15884, 354, 2746, 8265, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 62, 37581, 357, 30719, 58, 35, 713, 60, 2599, 4277, 8398, 329, 2181, 13363, 19590, 1220, 2496, 27039, 198, 220, 220, 220, 220, 220, 220, 220, 997, 62, 37724, 357, 600, 2599, 997, 62, 37724, 329, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 287, 62, 354, 504, 357, 600, 2599, 287, 62, 354, 504, 329, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 8106, 62, 22184, 357, 30719, 58, 14134, 540, 60, 2599, 1181, 62, 11600, 8106, 24714, 329, 3440, 357, 83, 1124, 1181, 62, 11600, 11, 2746, 355, 26498, 8, 198, 220, 220, 220, 220, 220, 220, 220, 7646, 357, 30388, 2599, 7646, 3440, 286, 26954, 198, 220, 220, 220, 220, 220, 220, 220, 4371, 357, 30388, 2599, 7139, 4371, 2318, 329, 3463, 4321, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4277, 62, 37581, 796, 4277, 62, 37581, 393, 651, 35226, 7, 19849, 11, 366, 12286, 62, 37581, 1600, 6045, 8, 393, 23884, 198, 220, 220, 220, 2181, 13363, 62, 6371, 796, 4277, 62, 37581, 13, 1136, 7203, 6371, 1600, 6045, 8, 198, 220, 220, 220, 289, 69, 62, 40140, 62, 312, 796, 4277, 62, 37581, 13, 1136, 7203, 71, 69, 62, 40140, 1600, 6045, 8, 198, 220, 220, 220, 611, 407, 2181, 13363, 62, 6371, 290, 407, 289, 69, 62, 40140, 62, 312, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 13, 43917, 7203, 2949, 2181, 13363, 19590, 2152, 329, 428, 2746, 13, 8554, 4738, 37588, 19570, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 198, 220, 220, 220, 611, 289, 69, 62, 40140, 62, 312, 290, 468, 62, 71, 69, 62, 40140, 7, 49986, 28, 1662, 2181, 13363, 62, 6371, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 13, 10951, 7, 69, 1, 19031, 2181, 13363, 19590, 422, 12905, 2667, 15399, 12575, 37913, 71, 69, 62, 40140, 62, 312, 30072, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1181, 62, 11600, 796, 3440, 62, 5219, 62, 11600, 62, 6738, 62, 71, 69, 7, 71, 69, 62, 40140, 62, 312, 8, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 13, 10951, 7, 69, 1, 19031, 2181, 13363, 19590, 422, 19016, 37913, 5310, 13363, 62, 6371, 30072, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1181, 62, 11600, 796, 3440, 62, 5219, 62, 11600, 62, 6738, 62, 6371, 7, 5310, 13363, 62, 6371, 11, 4371, 28, 33723, 11, 3975, 62, 24886, 2625, 36166, 4943, 198, 220, 220, 220, 611, 8106, 62, 22184, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 329, 16196, 8330, 351, 8106, 24714, 326, 1011, 530, 1822, 11, 1949, 530, 717, 11, 262, 734, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 62, 11600, 796, 8106, 62, 22184, 7, 5219, 62, 11600, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 5994, 12331, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 62, 11600, 796, 8106, 62, 22184, 7, 5219, 62, 11600, 11, 2746, 8, 628, 220, 220, 220, 5128, 62, 1102, 14259, 796, 4277, 62, 37581, 13, 1136, 7203, 11085, 62, 42946, 1600, 6045, 8, 198, 220, 220, 220, 611, 5128, 62, 1102, 14259, 318, 407, 6045, 290, 287, 62, 354, 504, 14512, 513, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 15414, 62, 1102, 14259, 11, 965, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5128, 62, 1102, 14259, 796, 357, 15414, 62, 1102, 14259, 35751, 198, 220, 220, 220, 220, 220, 220, 220, 329, 5128, 62, 42946, 62, 3672, 287, 5128, 62, 1102, 14259, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3463, 62, 3672, 796, 5128, 62, 42946, 62, 3672, 1343, 27071, 6551, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 6068, 62, 15414, 62, 14171, 6624, 366, 83, 8608, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 62, 11600, 58, 6551, 62, 3672, 60, 796, 6068, 62, 15414, 62, 42946, 7, 259, 62, 354, 504, 11, 1181, 62, 11600, 58, 6551, 62, 3672, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 13, 43917, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 3103, 13658, 5128, 3063, 1391, 15414, 62, 42946, 62, 3672, 92, 2181, 13363, 19590, 422, 513, 284, 1391, 259, 62, 354, 504, 92, 6518, 7, 82, 8, 1262, 4628, 76, 4811, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 62, 11600, 58, 6551, 62, 3672, 60, 796, 616, 62, 42552, 62, 15414, 62, 42946, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 287, 62, 354, 504, 11, 1181, 62, 11600, 58, 6551, 62, 3672, 4357, 2746, 62, 42946, 62, 6551, 28, 19849, 13, 5219, 62, 11600, 3419, 58, 6551, 62, 3672, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 13, 43917, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 3103, 13658, 5128, 3063, 1391, 15414, 62, 42946, 62, 3672, 92, 2181, 13363, 19590, 422, 513, 284, 1391, 259, 62, 354, 504, 92, 6518, 7, 82, 8, 1262, 2183, 4811, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2845, 1892, 3546, 1154, 12061, 12331, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 1181, 62, 11600, 58, 6551, 62, 3672, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7646, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 6404, 1362, 13, 43917, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 3118, 540, 284, 10385, 2181, 13363, 1391, 15414, 62, 42946, 62, 3672, 92, 19590, 11, 1262, 4738, 2315, 329, 428, 7679, 526, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 1398, 13350, 796, 4277, 62, 37581, 13, 1136, 7203, 4871, 7483, 1600, 6045, 8, 198, 220, 220, 220, 6167, 62, 28968, 796, 4277, 62, 37581, 13, 1136, 7203, 18242, 62, 28968, 1600, 657, 8, 198, 220, 220, 220, 611, 1398, 13350, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 4871, 13350, 11, 965, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1398, 13350, 796, 357, 4871, 13350, 35751, 198, 220, 220, 220, 220, 220, 220, 220, 611, 997, 62, 37724, 14512, 4277, 62, 37581, 14692, 22510, 62, 37724, 1, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1398, 7483, 62, 3672, 287, 1398, 13350, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 3190, 27537, 3938, 5884, 611, 2746, 997, 62, 37724, 1595, 470, 2872, 2181, 13363, 19590, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 1181, 62, 11600, 58, 4871, 7483, 62, 3672, 1343, 27071, 6551, 8973, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 1181, 62, 11600, 58, 4871, 7483, 62, 3672, 1343, 27071, 65, 4448, 8973, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7646, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 6167, 62, 28968, 1875, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1398, 7483, 62, 3672, 287, 1398, 13350, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2041, 1339, 329, 2181, 13363, 19590, 351, 281, 3131, 4469, 1398, 287, 2181, 13363, 19590, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1398, 7483, 62, 6551, 796, 1181, 62, 11600, 58, 4871, 7483, 62, 3672, 1343, 27071, 6551, 8973, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 62, 11600, 58, 4871, 7483, 62, 3672, 1343, 27071, 6551, 8973, 796, 1398, 7483, 62, 6551, 58, 18242, 62, 28968, 47715, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1398, 7483, 62, 65, 4448, 796, 1181, 62, 11600, 58, 4871, 7483, 62, 3672, 1343, 27071, 65, 4448, 8973, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 62, 11600, 58, 4871, 7483, 62, 3672, 1343, 27071, 65, 4448, 8973, 796, 1398, 7483, 62, 65, 4448, 58, 18242, 62, 28968, 47715, 628, 220, 220, 220, 2746, 13, 2220, 62, 5219, 62, 11600, 7, 5219, 62, 11600, 11, 7646, 28, 301, 2012, 8, 198 ]
2.339913
2,077
import os.path import time from array import LoxArray from instance import Instance from lox_callable import Callable from lox_class import LoxClass from exception import NativeException
[ 11748, 28686, 13, 6978, 198, 11748, 640, 198, 198, 6738, 7177, 1330, 406, 1140, 19182, 198, 6738, 4554, 1330, 2262, 590, 198, 6738, 300, 1140, 62, 13345, 540, 1330, 4889, 540, 198, 6738, 300, 1140, 62, 4871, 1330, 406, 1140, 9487, 198, 6738, 6631, 1330, 12547, 16922, 628, 628, 628, 628, 628 ]
3.788462
52
import ast from typing import Iterable, List, Tuple, Type, TypeVar from .exceptions import EmptyBlock from .helpers import filter_arrange_nodes, get_first_token, get_last_token from .types import LineType _Block = TypeVar('_Block', bound='Block') class Block: """ An Arrange, Act or Assert block of code as parsed from the test function. Note: This may just become the Act Block *AND* since the Act Block is just a single node, this might not even be required. Args: nodes: Nodes that make up this block. line_type: Type of line that this blocks writes into the line markers instance for the function. Notes: * Blocks with no nodes are allowed (at the moment). """ @classmethod def build_act(cls: Type[_Block], node: ast.stmt) -> _Block: """ Act block is a single node. """ return cls([node], LineType.act) @classmethod def build_arrange(cls: Type[_Block], nodes: List[ast.stmt], act_block_first_line: int) -> _Block: """ Arrange block is all non-pass and non-docstring nodes before the Act block start. Args: nodes: Body of test function / method. act_block_first_line """ return cls(filter_arrange_nodes(nodes, act_block_first_line), LineType.arrange) def get_span(self, first_line_no: int) -> Tuple[int, int]: """ Args: first_line_no: First line number of Block. Used to calculate relative line numbers. Returns: First and last line covered by this block, counted relative to the start of the Function. Raises: EmptyBlock: when block has no nodes """ if not self.nodes: raise EmptyBlock(f'span requested from {self.line_type} block with no nodes') # start and end are (<line number>, <indent>) pairs, so just the line # numbers are picked out. return ( get_first_token(self.nodes[0]).start[0] - first_line_no, get_last_token(self.nodes[-1]).end[0] - first_line_no, )
[ 11748, 6468, 198, 6738, 19720, 1330, 40806, 540, 11, 7343, 11, 309, 29291, 11, 5994, 11, 5994, 19852, 198, 198, 6738, 764, 1069, 11755, 1330, 33523, 12235, 198, 6738, 764, 16794, 364, 1330, 8106, 62, 3258, 858, 62, 77, 4147, 11, 651, 62, 11085, 62, 30001, 11, 651, 62, 12957, 62, 30001, 198, 6738, 764, 19199, 1330, 6910, 6030, 198, 198, 62, 12235, 796, 5994, 19852, 10786, 62, 12235, 3256, 5421, 11639, 12235, 11537, 628, 198, 4871, 9726, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1052, 943, 9521, 11, 2191, 393, 2195, 861, 2512, 286, 2438, 355, 44267, 422, 262, 1332, 2163, 13, 628, 220, 220, 220, 5740, 25, 198, 220, 220, 220, 220, 220, 220, 220, 770, 743, 655, 1716, 262, 2191, 9726, 1635, 6981, 9, 1201, 262, 2191, 9726, 318, 655, 257, 198, 220, 220, 220, 220, 220, 220, 220, 2060, 10139, 11, 428, 1244, 407, 772, 307, 2672, 13, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 13760, 25, 399, 4147, 326, 787, 510, 428, 2512, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1627, 62, 4906, 25, 5994, 286, 1627, 326, 428, 7021, 6797, 656, 262, 1627, 19736, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4554, 329, 262, 2163, 13, 628, 220, 220, 220, 11822, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 35111, 351, 645, 13760, 389, 3142, 357, 265, 262, 2589, 737, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2488, 4871, 24396, 198, 220, 220, 220, 825, 1382, 62, 529, 7, 565, 82, 25, 5994, 29795, 12235, 4357, 10139, 25, 6468, 13, 301, 16762, 8, 4613, 4808, 12235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2191, 2512, 318, 257, 2060, 10139, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 537, 82, 26933, 17440, 4357, 6910, 6030, 13, 529, 8, 628, 220, 220, 220, 2488, 4871, 24396, 198, 220, 220, 220, 825, 1382, 62, 3258, 858, 7, 565, 82, 25, 5994, 29795, 12235, 4357, 13760, 25, 7343, 58, 459, 13, 301, 16762, 4357, 719, 62, 9967, 62, 11085, 62, 1370, 25, 493, 8, 4613, 4808, 12235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 943, 9521, 2512, 318, 477, 1729, 12, 6603, 290, 1729, 12, 15390, 8841, 13760, 878, 262, 2191, 198, 220, 220, 220, 220, 220, 220, 220, 2512, 923, 13, 628, 220, 220, 220, 220, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13760, 25, 12290, 286, 1332, 2163, 1220, 2446, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 719, 62, 9967, 62, 11085, 62, 1370, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 537, 82, 7, 24455, 62, 3258, 858, 62, 77, 4147, 7, 77, 4147, 11, 719, 62, 9967, 62, 11085, 62, 1370, 828, 6910, 6030, 13, 3258, 858, 8, 628, 220, 220, 220, 825, 651, 62, 12626, 7, 944, 11, 717, 62, 1370, 62, 3919, 25, 493, 8, 4613, 309, 29291, 58, 600, 11, 493, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 717, 62, 1370, 62, 3919, 25, 3274, 1627, 1271, 286, 9726, 13, 16718, 284, 15284, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3585, 1627, 3146, 13, 628, 220, 220, 220, 220, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3274, 290, 938, 1627, 5017, 416, 428, 2512, 11, 14789, 3585, 284, 262, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 286, 262, 15553, 13, 628, 220, 220, 220, 220, 220, 220, 220, 7567, 2696, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 33523, 12235, 25, 618, 2512, 468, 645, 13760, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 407, 2116, 13, 77, 4147, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 33523, 12235, 7, 69, 338, 6839, 9167, 422, 1391, 944, 13, 1370, 62, 4906, 92, 2512, 351, 645, 13760, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 923, 290, 886, 389, 38155, 1370, 1271, 22330, 1279, 521, 298, 43734, 14729, 11, 523, 655, 262, 1627, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 3146, 389, 6497, 503, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 651, 62, 11085, 62, 30001, 7, 944, 13, 77, 4147, 58, 15, 35944, 9688, 58, 15, 60, 532, 717, 62, 1370, 62, 3919, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 651, 62, 12957, 62, 30001, 7, 944, 13, 77, 4147, 58, 12, 16, 35944, 437, 58, 15, 60, 532, 717, 62, 1370, 62, 3919, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198 ]
2.419463
894
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Logging module to be used by all scripts. cros_logging is a wrapper around logging with additional support for NOTICE level. This is to be used instead of the default logging module. The new logging level can only be used from here. """ from __future__ import print_function import sys # pylint: disable=unused-wildcard-import, wildcard-import from logging import * # pylint: enable=unused-wildcard-import, wildcard-import # Have to import shutdown explicitly from logging because it is not included # in logging's __all__. # pylint: disable=unused-import from logging import shutdown # pylint: enable=unused-import # Import as private to avoid polluting module namespace. from chromite.lib import buildbot_annotations as _annotations # Notice Level. NOTICE = 25 addLevelName(NOTICE, 'NOTICE') # Notice implementation. def notice(message, *args, **kwargs): """Log 'msg % args' with severity 'NOTICE'.""" log(NOTICE, message, *args, **kwargs) # Only buildbot aware entry-points need to spew buildbot specific logs. Require # user action for the special log lines. _buildbot_markers_enabled = False def _PrintForBuildbot(handle, annotation_class, *args): """Log a line for buildbot. This function dumps a line to log recognizable by buildbot if EnableBuildbotMarkers has been called. Otherwise, it dumps the same line in a human friendly way that buildbot ignores. Args: handle: The pipe to dump the log to. If None, log to sys.stderr. annotation_class: Annotation subclass for the type of buildbot log. buildbot_tag: A tag specifying the type of buildbot log. *args: The rest of the str arguments to be dumped to the log. """ if handle is None: handle = sys.stderr # Cast each argument, because we end up getting all sorts of objects from # callers. str_args = [str(x) for x in args] annotation = annotation_class(*str_args) if _buildbot_markers_enabled: line = str(annotation) else: line = annotation.human_friendly handle.write('\n' + line + '\n') def PrintBuildbotLink(text, url, handle=None): """Prints out a link to buildbot.""" _PrintForBuildbot(handle, _annotations.StepLink, text, url) def PrintBuildbotStepText(text, handle=None): """Prints out stage text to buildbot.""" _PrintForBuildbot(handle, _annotations.StepText, text) def PrintBuildbotStepWarnings(handle=None): """Marks a stage as having warnings.""" _PrintForBuildbot(handle, _annotations.StepWarnings) def PrintBuildbotStepFailure(handle=None): """Marks a stage as having failures.""" _PrintForBuildbot(handle, _annotations.StepFailure) def PrintBuildbotStepName(name, handle=None): """Marks a step name for buildbot to display.""" _PrintForBuildbot(handle, _annotations.BuildStep, name)
[ 2, 15069, 1853, 383, 18255, 1505, 7294, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 257, 347, 10305, 12, 7635, 5964, 326, 460, 307, 198, 2, 1043, 287, 262, 38559, 24290, 2393, 13, 198, 198, 37811, 11187, 2667, 8265, 284, 307, 973, 416, 477, 14750, 13, 198, 198, 66, 4951, 62, 6404, 2667, 318, 257, 29908, 1088, 18931, 351, 3224, 1104, 329, 28536, 198, 5715, 13, 770, 318, 284, 307, 973, 2427, 286, 262, 4277, 18931, 8265, 13, 383, 649, 198, 6404, 2667, 1241, 460, 691, 307, 973, 422, 994, 13, 198, 37811, 198, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 11748, 25064, 198, 2, 279, 2645, 600, 25, 15560, 28, 403, 1484, 12, 21992, 9517, 12, 11748, 11, 4295, 9517, 12, 11748, 198, 6738, 18931, 1330, 1635, 198, 2, 279, 2645, 600, 25, 7139, 28, 403, 1484, 12, 21992, 9517, 12, 11748, 11, 4295, 9517, 12, 11748, 198, 198, 2, 8192, 284, 1330, 18325, 11777, 422, 18931, 780, 340, 318, 407, 3017, 198, 2, 287, 18931, 338, 11593, 439, 834, 13, 198, 2, 279, 2645, 600, 25, 15560, 28, 403, 1484, 12, 11748, 198, 6738, 18931, 1330, 18325, 198, 2, 279, 2645, 600, 25, 7139, 28, 403, 1484, 12, 11748, 198, 198, 2, 17267, 355, 2839, 284, 3368, 3278, 15129, 8265, 25745, 13, 198, 6738, 15358, 578, 13, 8019, 1330, 1382, 13645, 62, 34574, 602, 355, 4808, 34574, 602, 628, 198, 2, 17641, 5684, 13, 198, 11929, 8476, 796, 1679, 198, 2860, 4971, 5376, 7, 11929, 8476, 11, 705, 11929, 8476, 11537, 628, 198, 2, 17641, 7822, 13, 198, 4299, 4003, 7, 20500, 11, 1635, 22046, 11, 12429, 46265, 22046, 2599, 198, 220, 37227, 11187, 705, 19662, 4064, 26498, 6, 351, 19440, 705, 11929, 8476, 30827, 15931, 198, 220, 2604, 7, 11929, 8476, 11, 3275, 11, 1635, 22046, 11, 12429, 46265, 22046, 8, 628, 198, 2, 5514, 1382, 13645, 3910, 5726, 12, 13033, 761, 284, 38645, 1382, 13645, 2176, 17259, 13, 9394, 557, 198, 2, 2836, 2223, 329, 262, 2041, 2604, 3951, 13, 198, 62, 11249, 13645, 62, 4102, 364, 62, 25616, 796, 10352, 628, 198, 4299, 4808, 18557, 1890, 15580, 13645, 7, 28144, 11, 23025, 62, 4871, 11, 1635, 22046, 2599, 198, 220, 37227, 11187, 257, 1627, 329, 1382, 13645, 13, 628, 220, 770, 2163, 45514, 257, 1627, 284, 2604, 30264, 416, 1382, 13645, 611, 198, 220, 27882, 15580, 13645, 9704, 364, 468, 587, 1444, 13, 15323, 11, 340, 45514, 262, 976, 1627, 287, 257, 198, 220, 1692, 8030, 835, 326, 1382, 13645, 24245, 13, 628, 220, 943, 14542, 25, 198, 220, 220, 220, 5412, 25, 383, 12656, 284, 10285, 262, 2604, 284, 13, 1002, 6045, 11, 2604, 284, 25064, 13, 301, 1082, 81, 13, 198, 220, 220, 220, 23025, 62, 4871, 25, 1052, 38983, 47611, 329, 262, 2099, 286, 1382, 13645, 2604, 13, 198, 220, 220, 220, 1382, 13645, 62, 12985, 25, 317, 7621, 31577, 262, 2099, 286, 1382, 13645, 2604, 13, 198, 220, 220, 220, 1635, 22046, 25, 383, 1334, 286, 262, 965, 7159, 284, 307, 24105, 284, 262, 2604, 13, 198, 220, 37227, 198, 220, 611, 5412, 318, 6045, 25, 198, 220, 220, 220, 5412, 796, 25064, 13, 301, 1082, 81, 198, 220, 1303, 5833, 1123, 4578, 11, 780, 356, 886, 510, 1972, 477, 10524, 286, 5563, 422, 198, 220, 1303, 869, 364, 13, 198, 220, 965, 62, 22046, 796, 685, 2536, 7, 87, 8, 329, 2124, 287, 26498, 60, 198, 220, 23025, 796, 23025, 62, 4871, 46491, 2536, 62, 22046, 8, 198, 220, 611, 4808, 11249, 13645, 62, 4102, 364, 62, 25616, 25, 198, 220, 220, 220, 1627, 796, 965, 7, 1236, 14221, 8, 198, 220, 2073, 25, 198, 220, 220, 220, 1627, 796, 23025, 13, 10734, 62, 13120, 198, 220, 5412, 13, 13564, 10786, 59, 77, 6, 1343, 1627, 1343, 705, 59, 77, 11537, 628, 198, 4299, 12578, 15580, 13645, 11280, 7, 5239, 11, 19016, 11, 5412, 28, 14202, 2599, 198, 220, 37227, 18557, 82, 503, 257, 2792, 284, 1382, 13645, 526, 15931, 198, 220, 4808, 18557, 1890, 15580, 13645, 7, 28144, 11, 4808, 34574, 602, 13, 8600, 11280, 11, 2420, 11, 19016, 8, 628, 198, 4299, 12578, 15580, 13645, 8600, 8206, 7, 5239, 11, 5412, 28, 14202, 2599, 198, 220, 37227, 18557, 82, 503, 3800, 2420, 284, 1382, 13645, 526, 15931, 198, 220, 4808, 18557, 1890, 15580, 13645, 7, 28144, 11, 4808, 34574, 602, 13, 8600, 8206, 11, 2420, 8, 628, 198, 4299, 12578, 15580, 13645, 8600, 54, 1501, 654, 7, 28144, 28, 14202, 2599, 198, 220, 37227, 44, 5558, 257, 3800, 355, 1719, 14601, 526, 15931, 198, 220, 4808, 18557, 1890, 15580, 13645, 7, 28144, 11, 4808, 34574, 602, 13, 8600, 54, 1501, 654, 8, 628, 198, 4299, 12578, 15580, 13645, 8600, 50015, 7, 28144, 28, 14202, 2599, 198, 220, 37227, 44, 5558, 257, 3800, 355, 1719, 15536, 526, 15931, 198, 220, 4808, 18557, 1890, 15580, 13645, 7, 28144, 11, 4808, 34574, 602, 13, 8600, 50015, 8, 628, 198, 4299, 12578, 15580, 13645, 8600, 5376, 7, 3672, 11, 5412, 28, 14202, 2599, 198, 220, 37227, 44, 5558, 257, 2239, 1438, 329, 1382, 13645, 284, 3359, 526, 15931, 198, 220, 4808, 18557, 1890, 15580, 13645, 7, 28144, 11, 4808, 34574, 602, 13, 15580, 8600, 11, 1438, 8, 198 ]
3.339408
878
# encoding: utf-8 from time import strptime __author__ = "Patrick Lampe" __email__ = "uni at lampep.de"
[ 2, 21004, 25, 3384, 69, 12, 23, 628, 198, 6738, 640, 1330, 965, 457, 524, 198, 198, 834, 9800, 834, 796, 366, 32718, 10923, 431, 1, 198, 834, 12888, 834, 796, 366, 35657, 379, 30592, 431, 79, 13, 2934, 1, 628 ]
2.634146
41
#!/usr/bin/env python3 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright 2013 California Institute of Technology. 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. # # United States Government Sponsorship acknowledged. This software is subject to # U.S. export control laws and regulations and has been classified as 'EAR99 NLR' # (No [Export] License Required except when exporting to an embargoed country, # end user, or in support of a prohibited end use). By downloading this software, # the user agrees to comply with all applicable U.S. export laws and regulations. # The user has the responsibility to obtain export licenses, or other export # authority as may be required before exporting this software to any 'EAR99' # embargoed foreign country or citizen of those countries. # # Author: Eric Gurrola #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import collections Tag = collections.namedtuple('Tag', 'version svn_revision yyyymmdd') releases = (Tag('1.0.0', '739', '20120814'), Tag('1.5.0', '1180', '20131018'), Tag('1.5.01', '1191', '20131028'), Tag('2.0.0', '1554', '20140724'), Tag('2.0.0_201409', '1612', '20140918'), Tag('2.0.0_201410', '1651', '20141103'), Tag('2.0.0_201505', '1733', '20150504'), Tag('2.0.0_201506', '1783', '20150619'), Tag('2.0.0_201511', '1917', '20151123'), Tag('2.0.0_201512', '1931', '20151221'), Tag('2.0.0_201604', '2047', '20160426'), Tag('2.0.0_201604_dempatch', '2118:2047', '20160727'), Tag('2.0.0_201609', '2143', '20160903'), Tag('2.0.0_20160906', '2145', '20160906'), Tag('2.0.0_20160908', '2150', '20160908'), Tag('2.0.0_20160912', '2153', '20160912'), Tag('2.0.0_20170403', '2256', '20170403'), Tag('2.1.0', '2366', '20170806'), Tag('2.2.0', '2497', '20180714'), Tag('2.2.1', '2517', '20181221'), Tag('2.3', '2531', '20190112'), # git migration Tag('2.3.1', '', '20190220'), Tag('2.3.2', '', '20190618'), Tag('2.3.3', '', '20200402'), Tag('2.4.0', '', '20200730'), Tag('2.4.1', '', '20200915'), Tag('2.4.2', '', '20201116'), Tag('2.5.0', '', '20210304'), Tag('2.5.1', '', '20210305'), Tag('2.5.2', '', '20210528'), ) release_version = releases[-1].version release_svn_revision = releases[-1].svn_revision release_date = releases[-1].yyyymmdd
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 27156, 27156, 27156, 27156, 15116, 8728, 4907, 93, 198, 2, 15069, 2211, 3442, 5136, 286, 8987, 13, 11096, 371, 34874, 15731, 1137, 53, 1961, 13, 198, 2, 220, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 220, 198, 2, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 220, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 2, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 2, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2, 11247, 739, 262, 13789, 13, 198, 2, 220, 198, 2, 1578, 1829, 5070, 18972, 11094, 10810, 13, 770, 3788, 318, 2426, 284, 198, 2, 471, 13, 50, 13, 10784, 1630, 3657, 290, 6647, 290, 468, 587, 10090, 355, 705, 17133, 2079, 22879, 49, 6, 198, 2, 357, 2949, 685, 43834, 60, 13789, 20906, 2845, 618, 39133, 284, 281, 38286, 276, 1499, 11, 198, 2, 886, 2836, 11, 393, 287, 1104, 286, 257, 12244, 886, 779, 737, 2750, 22023, 428, 3788, 11, 198, 2, 262, 2836, 14386, 284, 11997, 351, 477, 9723, 471, 13, 50, 13, 10784, 3657, 290, 6647, 13, 198, 2, 383, 2836, 468, 262, 5798, 284, 7330, 10784, 16625, 11, 393, 584, 10784, 198, 2, 4934, 355, 743, 307, 2672, 878, 39133, 428, 3788, 284, 597, 705, 17133, 2079, 6, 198, 2, 38286, 276, 3215, 1499, 393, 9511, 286, 883, 2678, 13, 198, 2, 198, 2, 6434, 25, 7651, 24797, 3225, 64, 198, 2, 27156, 27156, 27156, 27156, 15116, 8728, 4907, 93, 628, 628, 198, 11748, 17268, 198, 198, 24835, 796, 17268, 13, 13190, 83, 29291, 10786, 24835, 3256, 705, 9641, 38487, 77, 62, 260, 10178, 331, 22556, 26621, 1860, 11537, 198, 198, 260, 29329, 796, 357, 24835, 10786, 16, 13, 15, 13, 15, 3256, 220, 220, 705, 22, 2670, 3256, 705, 1264, 21315, 1415, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 16, 13, 20, 13, 15, 3256, 220, 705, 1157, 1795, 3256, 705, 1264, 3132, 29159, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 16, 13, 20, 13, 486, 3256, 705, 16315, 16, 3256, 705, 6390, 940, 2078, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 3256, 220, 705, 1314, 4051, 3256, 705, 1264, 30120, 1731, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 29416, 3256, 220, 705, 1433, 1065, 3256, 705, 1264, 29416, 1507, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 4967, 940, 3256, 220, 705, 1433, 4349, 3256, 705, 1264, 3901, 15197, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 31654, 3256, 220, 705, 1558, 2091, 3256, 705, 1264, 1120, 33580, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 35638, 3256, 220, 705, 1558, 5999, 3256, 705, 1264, 35638, 1129, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 4626, 1157, 3256, 220, 705, 1129, 1558, 3256, 705, 1264, 4349, 10163, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 4626, 1065, 3256, 220, 705, 1129, 3132, 3256, 705, 4626, 1065, 2481, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 31916, 3256, 220, 705, 1238, 2857, 3256, 705, 1264, 31916, 2075, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 31916, 62, 9536, 17147, 3256, 705, 17, 16817, 25, 1238, 2857, 3256, 705, 1264, 31980, 1983, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 31751, 3256, 220, 705, 17, 21139, 3256, 705, 1264, 31751, 3070, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 31751, 3312, 3256, 220, 705, 17, 18781, 3256, 705, 1264, 31751, 3312, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 31751, 2919, 3256, 220, 705, 2481, 1120, 3256, 705, 1264, 31751, 2919, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 31751, 1065, 3256, 220, 705, 17, 21395, 3256, 705, 1264, 31751, 1065, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 15, 13, 15, 62, 1264, 2154, 31552, 3256, 220, 705, 17, 11645, 3256, 705, 1264, 2154, 31552, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 16, 13, 15, 3256, 220, 705, 1954, 2791, 3256, 705, 1264, 2154, 37988, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 17, 13, 15, 3256, 220, 705, 1731, 5607, 3256, 705, 1264, 36928, 1415, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 17, 13, 16, 3256, 220, 705, 1495, 1558, 3256, 705, 7908, 1065, 2481, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 18, 3256, 220, 220, 220, 705, 1495, 3132, 3256, 705, 23344, 486, 1065, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 17606, 13472, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 18, 13, 16, 3256, 705, 3256, 705, 23344, 2999, 1238, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 18, 13, 17, 3256, 705, 3256, 705, 23344, 3312, 1507, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 18, 13, 18, 3256, 705, 3256, 705, 1238, 2167, 32531, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 19, 13, 15, 3256, 705, 3256, 705, 1238, 12726, 1270, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 19, 13, 16, 3256, 705, 3256, 705, 1238, 10531, 1314, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 19, 13, 17, 3256, 705, 3256, 705, 1238, 1264, 18298, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 20, 13, 15, 3256, 705, 3256, 705, 19004, 940, 21288, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 20, 13, 16, 3256, 705, 3256, 705, 19004, 940, 22515, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17467, 10786, 17, 13, 20, 13, 17, 3256, 705, 3256, 705, 19004, 13348, 2078, 33809, 198, 8, 628, 198, 20979, 62, 9641, 796, 10050, 58, 12, 16, 4083, 9641, 198, 20979, 62, 21370, 77, 62, 260, 10178, 796, 10050, 58, 12, 16, 4083, 21370, 77, 62, 260, 10178, 198, 20979, 62, 4475, 796, 10050, 58, 12, 16, 4083, 22556, 22556, 3020, 1860, 198 ]
2.366071
1,344
#@+leo-ver=5-thin #@+node:ekr.20140726091031.18143: * @file writers/basewriter.py '''A module defining the base class for all writers in leo.plugins.writers.''' class BaseWriter: '''The base writer class for all writers in leo.plugins.writers.''' def __init__(self, c): '''Ctor for leo.plugins.writers.BaseWriter.''' self.c = c self.at = c.atFileCommands #@+others #@+node:ekr.20150626092123.1: ** basewriter.put def put(self, s): '''Write line s using at.os, taking special care of newlines.''' at = self.at at.os(s[: -1] if s.endswith('\n') else s) at.onl() #@+node:ekr.20150626092140.1: ** basewriter.put_node_sentinel def put_node_sentinel(self, p, delim, delim2=''): '''Put an @+node sentinel for node p.''' at = self.at # Like at.nodeSentinelText. gnx = p.v.fileIndex level = p.level() if level > 2: s = "%s: *%s* %s" % (gnx, level, p.h) else: s = "%s: %s %s" % (gnx, '*' * level, p.h) # Like at.putSentinel. at.os('%s@+node:%s%s' % (delim, s, delim2)) at.onl() #@+node:ekr.20161125140611.1: ** basewriter.split_lines def split_lines(self, s): '''Exactly the same as g.splitLines(s).''' return s.splitlines(True) if s else [] # This is a Python string function! #@-others #@@language python #@@tabwidth -4 #@-leo
[ 2, 31, 10, 293, 78, 12, 332, 28, 20, 12, 40871, 198, 2, 31, 10, 17440, 25, 988, 81, 13, 1264, 1821, 4761, 31751, 940, 3132, 13, 1507, 21139, 25, 1635, 2488, 7753, 8786, 14, 12093, 413, 43407, 13, 9078, 198, 7061, 6, 32, 8265, 16215, 262, 2779, 1398, 329, 477, 8786, 287, 443, 78, 13, 37390, 13, 34422, 2637, 7061, 198, 198, 4871, 7308, 34379, 25, 198, 220, 220, 220, 705, 7061, 464, 2779, 6260, 1398, 329, 477, 8786, 287, 443, 78, 13, 37390, 13, 34422, 2637, 7061, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 269, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 34, 13165, 329, 443, 78, 13, 37390, 13, 34422, 13, 14881, 34379, 2637, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 66, 796, 269, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 265, 796, 269, 13, 265, 8979, 6935, 1746, 628, 220, 220, 220, 1303, 31, 10, 847, 82, 198, 220, 220, 220, 1303, 31, 10, 17440, 25, 988, 81, 13, 1264, 1120, 5237, 1899, 5892, 10163, 13, 16, 25, 12429, 1615, 413, 43407, 13, 1996, 198, 220, 220, 220, 825, 1234, 7, 944, 11, 264, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 16594, 1627, 264, 1262, 379, 13, 418, 11, 2263, 2041, 1337, 286, 649, 6615, 2637, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 379, 796, 2116, 13, 265, 198, 220, 220, 220, 220, 220, 220, 220, 379, 13, 418, 7, 82, 58, 25, 532, 16, 60, 611, 264, 13, 437, 2032, 342, 10786, 59, 77, 11537, 2073, 264, 8, 198, 220, 220, 220, 220, 220, 220, 220, 379, 13, 261, 75, 3419, 198, 220, 220, 220, 1303, 31, 10, 17440, 25, 988, 81, 13, 1264, 1120, 5237, 1899, 5892, 15187, 13, 16, 25, 12429, 1615, 413, 43407, 13, 1996, 62, 17440, 62, 34086, 20538, 198, 220, 220, 220, 825, 1234, 62, 17440, 62, 34086, 20538, 7, 944, 11, 279, 11, 46728, 11, 46728, 17, 28, 7061, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 11588, 281, 2488, 10, 17440, 1908, 20538, 329, 10139, 279, 2637, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 379, 796, 2116, 13, 265, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4525, 379, 13, 17440, 31837, 20538, 8206, 13, 198, 220, 220, 220, 220, 220, 220, 220, 19967, 87, 796, 279, 13, 85, 13, 7753, 15732, 198, 220, 220, 220, 220, 220, 220, 220, 1241, 796, 279, 13, 5715, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1241, 1875, 362, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 264, 796, 36521, 82, 25, 1635, 4, 82, 9, 4064, 82, 1, 4064, 357, 4593, 87, 11, 1241, 11, 279, 13, 71, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 264, 796, 36521, 82, 25, 4064, 82, 4064, 82, 1, 4064, 357, 4593, 87, 11, 705, 9, 6, 1635, 1241, 11, 279, 13, 71, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4525, 379, 13, 1996, 31837, 20538, 13, 198, 220, 220, 220, 220, 220, 220, 220, 379, 13, 418, 10786, 4, 82, 31, 10, 17440, 25, 4, 82, 4, 82, 6, 4064, 357, 12381, 320, 11, 264, 11, 46728, 17, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 379, 13, 261, 75, 3419, 198, 220, 220, 220, 1303, 31, 10, 17440, 25, 988, 81, 13, 5304, 16, 11623, 1415, 3312, 1157, 13, 16, 25, 12429, 1615, 413, 43407, 13, 35312, 62, 6615, 198, 220, 220, 220, 825, 6626, 62, 6615, 7, 944, 11, 264, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 47173, 262, 976, 355, 308, 13, 35312, 43, 1127, 7, 82, 737, 7061, 6, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 264, 13, 35312, 6615, 7, 17821, 8, 611, 264, 2073, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 770, 318, 257, 11361, 4731, 2163, 0, 198, 220, 220, 220, 1303, 31, 12, 847, 82, 198, 198, 2, 12404, 16129, 21015, 198, 2, 12404, 8658, 10394, 532, 19, 198, 2, 31, 12, 293, 78, 198 ]
2.02371
717
from pathlib import Path from osgeo import ogr, gdal import os import geopandas as pd from geopandas._vectorized import simplify import rasterio from rasterstats import zonal_stats import time import shutil def intersection(ShpA, ShpB, fname): """ This function is used to get the intersection between shapefile A and shapefile B. :param shpPath: the path of input shapefile A :param roadShp: the path of input shapefile B :param fname: the path of output shapefile :return: """ driver = ogr.GetDriverByName("ESRI Shapefile") dataSourceA = driver.Open(ShpA, 1) layerA = dataSourceA.GetLayer() dataSourceB = driver.Open(ShpB, 1) layerB = dataSourceB.GetLayer() # 新建DataSource,Layer out_ds = driver.CreateDataSource(fname) out_lyr = out_ds.CreateLayer(fname, layerA.GetSpatialRef(), ogr.wkbPolygon) def_feature = out_lyr.GetLayerDefn() # 遍历原始的Shapefile文件给每个Geometry做Buffer操作 # current_union = layer[0].Clone() print('the length of layer:', len(layerA)) if len(layerA) == 0: return for featureA in layerA: geometryA = featureA.GetGeometryRef() for featureB in layerB: geometryB = featureB.GetGeometryRef() inter = geometryB.Intersection(geometryA).Clone() out_feature = ogr.Feature(def_feature) out_feature.SetGeometry(inter) out_lyr.ResetReading() out_lyr.CreateFeature(out_feature) del dataSourceA, dataSourceB, out_ds def MergeOneShp(inShp, outShp): """ merge all features in one shapefile :param inShp: the path of input shapefile :param outShp: the path of output shapefile :return: """ driver = ogr.GetDriverByName("ESRI Shapefile") dataSource = driver.Open(inShp, 1) layer = dataSource.GetLayer() # 新建DataSource,Layer out_ds = driver.CreateDataSource(outShp) out_lyr = out_ds.CreateLayer(outShp, layer.GetSpatialRef(), ogr.wkbPolygon) def_feature = out_lyr.GetLayerDefn() # 遍历原始的Shapefile文件给每个Geometry做Buffer操作 # current_union = layer[0].Clone() print('the length of layer:', len(layer)) if len(layer) == 0: return for i, feature in enumerate(layer): geometry = feature.GetGeometryRef() if i == 0: current_union = geometry.Clone() current_union = current_union.Union(geometry).Clone() if i == len(layer) - 1: out_feature = ogr.Feature(def_feature) out_feature.SetGeometry(current_union) out_lyr.ResetReading() out_lyr.CreateFeature(out_feature) del dataSource, out_ds def multipoly2singlepoly(inputshp, outputshp): """ multi part to single part :param inputshp: the path of input shapefile :param outputshp: the path of output shapefile :return: """ gdal.UseExceptions() driver = ogr.GetDriverByName('ESRI Shapefile') in_ds = driver.Open(inputshp, 0) in_lyr = in_ds.GetLayer() if os.path.exists(outputshp): driver.DeleteDataSource(outputshp) out_ds = driver.CreateDataSource(outputshp) out_lyr = out_ds.CreateLayer('poly', in_lyr.GetSpatialRef(), geom_type=ogr.wkbPolygon) for in_feat in in_lyr: geom = in_feat.GetGeometryRef() if geom.GetGeometryName() == 'MULTIPOLYGON': for geom_part in geom: addPolygon(geom_part.ExportToWkb(), out_lyr) else: addPolygon(geom.ExportToWkb(), out_lyr) del in_ds, out_ds def remove_big_feature(inputShp, outputShp, area_threshold): """ This function is used to remove big area of feature from shapefile :param inputShp: the path of input shapefile :param outputShp: the path of output shapefile :param area_thresold: the threshold of area :return: """ driver = ogr.GetDriverByName("ESRI Shapefile") dataSource = driver.Open(inputShp, 1) layer = dataSource.GetLayer() new_field = ogr.FieldDefn("Area", ogr.OFTReal) new_field.SetWidth(32) new_field.SetPrecision(16) # 设置面积精度,小数点后16位 layer.CreateField(new_field) # 新建DataSource,Layer out_ds = driver.CreateDataSource(outputShp) out_lyr = out_ds.CreateLayer(outputShp, layer.GetSpatialRef(), ogr.wkbPolygon) def_feature = out_lyr.GetLayerDefn() for feature in layer: geom = feature.GetGeometryRef() area = geom.GetArea() # 计算面积 if area > area_threshold: continue feature.SetField("Area", area) # 将面积添加到属性表中 layer.SetFeature(feature) out_feature = ogr.Feature(def_feature) out_feature.SetGeometry(geom) out_lyr.CreateFeature(out_feature) out_feature = None out_ds.FlushCache() del dataSource, out_ds def remove_small_feature(inputShp, outputShp, area_threshold): """ This function is used to remove small area of feature from shapefile :param inputShp: the path of input shapefile :param outputShp: the path of output shapefile :param area_thresold: the threshold of area :return: """ driver = ogr.GetDriverByName("ESRI Shapefile") dataSource = driver.Open(inputShp, 1) layer = dataSource.GetLayer() new_field = ogr.FieldDefn("Area", ogr.OFTReal) new_field.SetWidth(32) new_field.SetPrecision(16) # 设置面积精度,小数点后16位 layer.CreateField(new_field) # 新建DataSource,Layer out_ds = driver.CreateDataSource(outputShp) out_lyr = out_ds.CreateLayer(outputShp, layer.GetSpatialRef(), ogr.wkbPolygon) def_feature = out_lyr.GetLayerDefn() for feature in layer: geom = feature.GetGeometryRef() area = geom.GetArea() # 计算面积 if area < area_threshold: continue feature.SetField("Area", area) # 将面积添加到属性表中 layer.SetFeature(feature) out_feature = ogr.Feature(def_feature) out_feature.SetGeometry(geom) out_lyr.CreateFeature(out_feature) out_feature = None out_ds.FlushCache() del dataSource, out_ds def buffer(inShp, outShp, bdistance=0.02): """ setting up buffer zone in shapefile :param inShp: the path of input shapefile :param outShp: the path of output shapefile :param bdistance: the distance of buffer :return: """ ogr.UseExceptions() in_ds = ogr.Open(inShp) in_lyr = in_ds.GetLayer() # 创建输出Buffer文件 driver = ogr.GetDriverByName('ESRI Shapefile') if Path(outShp).exists(): driver.DeleteDataSource(outShp) # 新建DataSource,Layer out_ds = driver.CreateDataSource(outShp) out_lyr = out_ds.CreateLayer(outShp, in_lyr.GetSpatialRef(), ogr.wkbPolygon) def_feature = out_lyr.GetLayerDefn() # 遍历原始的Shapefile文件给每个Geometry做Buffer操作 for feature in in_lyr: geometry = feature.GetGeometryRef() buffer = geometry.Buffer(bdistance) out_feature = ogr.Feature(def_feature) out_feature.SetGeometry(buffer) out_lyr.CreateFeature(out_feature) out_feature = None out_ds.FlushCache() del in_ds, out_ds def smoothing(inShp, fname, bdistance=0.001): """ :param inShp: the path of input shapefile :param fname: the path of output shapefile :param bdistance: the distance of buffer :return: """ ogr.UseExceptions() in_ds = ogr.Open(inShp) in_lyr = in_ds.GetLayer() # 创建输出Buffer文件 driver = ogr.GetDriverByName('ESRI Shapefile') if Path(fname).exists(): driver.DeleteDataSource(fname) # 新建DataSource,Layer out_ds = driver.CreateDataSource(fname) out_lyr = out_ds.CreateLayer(fname, in_lyr.GetSpatialRef(), ogr.wkbPolygon) def_feature = out_lyr.GetLayerDefn() # 遍历原始的Shapefile文件给每个Geometry做Buffer操作 for feature in in_lyr: geometry = feature.GetGeometryRef() buffer = geometry.Buffer(bdistance).Buffer(-bdistance) out_feature = ogr.Feature(def_feature) out_feature.SetGeometry(buffer) out_lyr.CreateFeature(out_feature) out_feature = None out_ds.FlushCache() del in_ds, out_ds def pol2line(polyfn, linefn): """ This function is used to make polygon convert to line :param polyfn: the path of input, the shapefile of polygon :param linefn: the path of output, the shapefile of line :return: """ driver = ogr.GetDriverByName('ESRI Shapefile') polyds = ogr.Open(polyfn, 0) polyLayer = polyds.GetLayer() spatialref = polyLayer.GetSpatialRef() #创建输出文件 if os.path.exists(linefn): driver.DeleteDataSource(linefn) lineds =driver.CreateDataSource(linefn) linelayer = lineds.CreateLayer(linefn, srs=spatialref, geom_type=ogr.wkbLineString) featuredefn = linelayer.GetLayerDefn() #获取ring到几何体 #geomline = ogr.Geometry(ogr.wkbGeometryCollection) for feat in polyLayer: geom = feat.GetGeometryRef() ring = geom.GetGeometryRef(0) #geomcoll.AddGeometry(ring) outfeature = ogr.Feature(featuredefn) outfeature.SetGeometry(ring) linelayer.CreateFeature(outfeature) outfeature = None def ZonalStatisticsAsTable(ras_path, shp_path, stats_list=['majority']): """ please refer to https://blog.csdn.net/weixin_42990464/article/details/114652193 """ start = time.time() ras_driver = rasterio.open(ras_path) array = ras_driver.read(1) affine = ras_driver.transform shp_driver = pd.read_file(shp_path) zs = zonal_stats(shp_path, array, affine=affine, stats=stats_list) driver = ogr.GetDriverByName('ESRI Shapefile') layer_source = driver.Open(shp_path, 1) lyr = layer_source.GetLayer() defn = lyr.GetLayerDefn() featureCount = defn.GetFieldCount() exists_fields = [] for i in range(featureCount): field = defn.GetFieldDefn(i) field_name = field.GetNameRef() exists_fields.append(field_name) for ele in stats_list: if ele in exists_fields: pass else: # cls_name = ogr.FieldDefn(k, ogr.OFTString) cls_name = ogr.FieldDefn(ele, ogr.OFTReal) # cls_name.SetWidth(64) lyr.CreateField(cls_name) driver = None driver = ogr.GetDriverByName('ESRI Shapefile') layer_source = driver.Open(shp_path, 1) lyr = layer_source.GetLayer() defn = lyr.GetLayerDefn() featureCount = defn.GetFieldCount() count = 0 feature = lyr.GetNextFeature() while feature is not None: for i in range(featureCount): field = defn.GetFieldDefn(i) field_name = field.GetNameRef() if field_name in stats_list: feature.SetField(field_name, zs[count][field_name]) lyr.SetFeature(feature) else: pass count += 1 feature = lyr.GetNextFeature() end = time.time() print((end - start) / 3600.0) def compute_max_area(shpPath): ''' compute max area among all features :param shpPath: the absolute path of shapefile :return: the max area ''' max_area = 0 driver = ogr.GetDriverByName("ESRI Shapefile") dataSource = driver.Open(shpPath, 1) layer = dataSource.GetLayer() new_field = ogr.FieldDefn("Area", ogr.OFTReal) new_field.SetWidth(32) new_field.SetPrecision(16) # 设置面积精度,小数点后16位 layer.CreateField(new_field) for feature in layer: geom = feature.GetGeometryRef() area = geom.GetArea() # 计算面积 if area > max_area: max_area = area feature.SetField("Area", area) # 将面积添加到属性表中 layer.SetFeature(feature) dataSource = None return max_area def extract_isolated_features(inShp, outshp, bdistance=0.008, temproot='./temp'): """ extract isolated features among all features(point, line, polygon) :param inShp: the path of input shapefile :param outshp: the path of output shapefile :param bdistance: the distance of buffer :param temproot: temporary file directory :return: None """ mkdir(temproot) fname = f'{temproot}/buffer.shp' fname2 = f'{temproot}/buffer2.shp' buffer(inShp, fname, bdistance=bdistance) max_area = compute_max_area(fname) MergeOneShp(fname, fname2) multipoly2singlepoly(fname2, fname) remove_big_feature(fname, fname2, max_area) MergeOneShp(fname2, fname) intersection(fname, inShp, outshp) # remove temporary directory if os.path.exists(temproot): shutil.rmtree(temproot) def simplify_shp(in_shp, out_shp, tolerance=0.0001): """ :param in_shp: the path of input shapefile :param out_shp: the path of output shapefile :return: Returns a simplified shapefile produced by the Douglas-Peucker """ gdf = pd.read_file(in_shp) #LINESTRING gdf['geometry'] = simplify( gdf['geometry'], tolerance=tolerance) gdf.to_file(out_shp, driver="ESRI Shapefile")
[ 6738, 3108, 8019, 1330, 10644, 198, 6738, 28686, 469, 78, 1330, 267, 2164, 11, 308, 31748, 198, 11748, 28686, 198, 11748, 30324, 392, 292, 355, 279, 67, 198, 6738, 30324, 392, 292, 13557, 31364, 1143, 1330, 30276, 198, 11748, 374, 1603, 952, 198, 6738, 374, 1603, 34242, 1330, 1976, 20996, 62, 34242, 198, 11748, 640, 198, 11748, 4423, 346, 628, 198, 4299, 16246, 7, 2484, 79, 32, 11, 911, 79, 33, 11, 277, 3672, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 2163, 318, 973, 284, 651, 262, 16246, 1022, 5485, 7753, 317, 290, 5485, 7753, 347, 13, 198, 220, 220, 220, 1058, 17143, 427, 79, 15235, 25, 262, 3108, 286, 5128, 5485, 7753, 317, 198, 220, 220, 220, 1058, 17143, 2975, 2484, 79, 25, 262, 3108, 286, 5128, 5485, 7753, 347, 198, 220, 220, 220, 1058, 17143, 277, 3672, 25, 262, 3108, 286, 5072, 5485, 7753, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 7203, 1546, 7112, 25959, 7753, 4943, 198, 220, 220, 220, 1366, 7416, 32, 796, 4639, 13, 11505, 7, 2484, 79, 32, 11, 352, 8, 198, 220, 220, 220, 7679, 32, 796, 1366, 7416, 32, 13, 3855, 49925, 3419, 628, 220, 220, 220, 1366, 7416, 33, 796, 4639, 13, 11505, 7, 2484, 79, 33, 11, 352, 8, 198, 220, 220, 220, 7679, 33, 796, 1366, 7416, 33, 13, 3855, 49925, 3419, 628, 220, 220, 220, 1303, 10545, 244, 108, 161, 119, 118, 6601, 7416, 171, 120, 234, 49925, 198, 220, 220, 220, 503, 62, 9310, 796, 4639, 13, 16447, 6601, 7416, 7, 69, 3672, 8, 198, 220, 220, 220, 503, 62, 306, 81, 796, 503, 62, 9310, 13, 16447, 49925, 7, 69, 3672, 11, 7679, 32, 13, 3855, 4561, 34961, 8134, 22784, 267, 2164, 13, 86, 32812, 34220, 14520, 8, 198, 220, 220, 220, 825, 62, 30053, 796, 503, 62, 306, 81, 13, 3855, 49925, 7469, 77, 3419, 198, 220, 220, 220, 1303, 16268, 223, 235, 43889, 228, 43889, 253, 34650, 233, 21410, 33383, 7753, 23877, 229, 20015, 114, 163, 119, 247, 162, 107, 237, 10310, 103, 10082, 15748, 161, 223, 248, 28632, 162, 241, 235, 43291, 198, 220, 220, 220, 1303, 1459, 62, 24592, 796, 7679, 58, 15, 4083, 2601, 505, 3419, 198, 220, 220, 220, 3601, 10786, 1169, 4129, 286, 7679, 25, 3256, 18896, 7, 29289, 32, 4008, 198, 220, 220, 220, 611, 18896, 7, 29289, 32, 8, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 628, 220, 220, 220, 329, 3895, 32, 287, 7679, 32, 25, 198, 220, 220, 220, 220, 220, 220, 220, 22939, 32, 796, 3895, 32, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 329, 3895, 33, 287, 7679, 33, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 22939, 33, 796, 3895, 33, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 987, 796, 22939, 33, 13, 9492, 5458, 7, 469, 15748, 32, 737, 2601, 505, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 267, 2164, 13, 38816, 7, 4299, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 13, 7248, 10082, 15748, 7, 3849, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 306, 81, 13, 4965, 316, 36120, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 306, 81, 13, 16447, 38816, 7, 448, 62, 30053, 8, 198, 220, 220, 220, 1619, 1366, 7416, 32, 11, 1366, 7416, 33, 11, 503, 62, 9310, 628, 198, 4299, 39407, 3198, 2484, 79, 7, 259, 2484, 79, 11, 503, 2484, 79, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 20121, 477, 3033, 287, 530, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 287, 2484, 79, 25, 262, 3108, 286, 5128, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 503, 2484, 79, 25, 262, 3108, 286, 5072, 5485, 7753, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 7203, 1546, 7112, 25959, 7753, 4943, 198, 220, 220, 220, 1366, 7416, 796, 4639, 13, 11505, 7, 259, 2484, 79, 11, 352, 8, 198, 220, 220, 220, 7679, 796, 1366, 7416, 13, 3855, 49925, 3419, 628, 220, 220, 220, 1303, 10545, 244, 108, 161, 119, 118, 6601, 7416, 171, 120, 234, 49925, 198, 220, 220, 220, 503, 62, 9310, 796, 4639, 13, 16447, 6601, 7416, 7, 448, 2484, 79, 8, 198, 220, 220, 220, 503, 62, 306, 81, 796, 503, 62, 9310, 13, 16447, 49925, 7, 448, 2484, 79, 11, 7679, 13, 3855, 4561, 34961, 8134, 22784, 267, 2164, 13, 86, 32812, 34220, 14520, 8, 198, 220, 220, 220, 825, 62, 30053, 796, 503, 62, 306, 81, 13, 3855, 49925, 7469, 77, 3419, 198, 220, 220, 220, 1303, 16268, 223, 235, 43889, 228, 43889, 253, 34650, 233, 21410, 33383, 7753, 23877, 229, 20015, 114, 163, 119, 247, 162, 107, 237, 10310, 103, 10082, 15748, 161, 223, 248, 28632, 162, 241, 235, 43291, 198, 220, 220, 220, 1303, 1459, 62, 24592, 796, 7679, 58, 15, 4083, 2601, 505, 3419, 198, 220, 220, 220, 3601, 10786, 1169, 4129, 286, 7679, 25, 3256, 18896, 7, 29289, 4008, 198, 220, 220, 220, 611, 18896, 7, 29289, 8, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 628, 220, 220, 220, 329, 1312, 11, 3895, 287, 27056, 378, 7, 29289, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 22939, 796, 3895, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1312, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1459, 62, 24592, 796, 22939, 13, 2601, 505, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1459, 62, 24592, 796, 1459, 62, 24592, 13, 38176, 7, 469, 15748, 737, 2601, 505, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 611, 1312, 6624, 18896, 7, 29289, 8, 532, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 267, 2164, 13, 38816, 7, 4299, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 13, 7248, 10082, 15748, 7, 14421, 62, 24592, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 306, 81, 13, 4965, 316, 36120, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 306, 81, 13, 16447, 38816, 7, 448, 62, 30053, 8, 628, 220, 220, 220, 1619, 1366, 7416, 11, 503, 62, 9310, 628, 198, 4299, 18540, 3366, 17, 29762, 35428, 7, 15414, 1477, 79, 11, 5072, 1477, 79, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 5021, 636, 284, 2060, 636, 198, 220, 220, 220, 1058, 17143, 5128, 1477, 79, 25, 262, 3108, 286, 5128, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 5072, 1477, 79, 25, 262, 3108, 286, 5072, 5485, 7753, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 308, 31748, 13, 11041, 3109, 11755, 3419, 198, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 10786, 1546, 7112, 25959, 7753, 11537, 198, 220, 220, 220, 287, 62, 9310, 796, 4639, 13, 11505, 7, 15414, 1477, 79, 11, 657, 8, 198, 220, 220, 220, 287, 62, 306, 81, 796, 287, 62, 9310, 13, 3855, 49925, 3419, 198, 220, 220, 220, 611, 28686, 13, 6978, 13, 1069, 1023, 7, 22915, 1477, 79, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 4639, 13, 38727, 6601, 7416, 7, 22915, 1477, 79, 8, 198, 220, 220, 220, 503, 62, 9310, 796, 4639, 13, 16447, 6601, 7416, 7, 22915, 1477, 79, 8, 198, 220, 220, 220, 503, 62, 306, 81, 796, 503, 62, 9310, 13, 16447, 49925, 10786, 35428, 3256, 287, 62, 306, 81, 13, 3855, 4561, 34961, 8134, 22784, 4903, 296, 62, 4906, 28, 519, 81, 13, 86, 32812, 34220, 14520, 8, 198, 220, 220, 220, 329, 287, 62, 27594, 287, 287, 62, 306, 81, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4903, 296, 796, 287, 62, 27594, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 611, 4903, 296, 13, 3855, 10082, 15748, 5376, 3419, 6624, 705, 44, 16724, 4061, 3535, 56, 38, 1340, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 4903, 296, 62, 3911, 287, 4903, 296, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 751, 34220, 14520, 7, 469, 296, 62, 3911, 13, 43834, 2514, 54, 32812, 22784, 503, 62, 306, 81, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 751, 34220, 14520, 7, 469, 296, 13, 43834, 2514, 54, 32812, 22784, 503, 62, 306, 81, 8, 198, 220, 220, 220, 1619, 287, 62, 9310, 11, 503, 62, 9310, 628, 198, 198, 4299, 4781, 62, 14261, 62, 30053, 7, 15414, 2484, 79, 11, 5072, 2484, 79, 11, 1989, 62, 400, 10126, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 2163, 318, 973, 284, 4781, 1263, 1989, 286, 3895, 422, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 5128, 2484, 79, 25, 262, 3108, 286, 5128, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 5072, 2484, 79, 25, 262, 3108, 286, 5072, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 1989, 62, 400, 411, 727, 25, 262, 11387, 286, 1989, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 7203, 1546, 7112, 25959, 7753, 4943, 198, 220, 220, 220, 1366, 7416, 796, 4639, 13, 11505, 7, 15414, 2484, 79, 11, 352, 8, 198, 220, 220, 220, 7679, 796, 1366, 7416, 13, 3855, 49925, 3419, 198, 220, 220, 220, 649, 62, 3245, 796, 267, 2164, 13, 15878, 7469, 77, 7203, 30547, 1600, 267, 2164, 13, 19238, 5446, 2287, 8, 198, 220, 220, 220, 649, 62, 3245, 13, 7248, 30916, 7, 2624, 8, 198, 220, 220, 220, 649, 62, 3245, 13, 7248, 6719, 16005, 7, 1433, 8, 220, 1303, 5525, 106, 122, 163, 121, 106, 165, 251, 95, 163, 100, 107, 163, 39333, 41753, 99, 11, 22887, 237, 46763, 108, 163, 224, 117, 28938, 236, 1433, 19526, 235, 198, 220, 220, 220, 7679, 13, 16447, 15878, 7, 3605, 62, 3245, 8, 628, 220, 220, 220, 1303, 10545, 244, 108, 161, 119, 118, 6601, 7416, 171, 120, 234, 49925, 198, 220, 220, 220, 503, 62, 9310, 796, 4639, 13, 16447, 6601, 7416, 7, 22915, 2484, 79, 8, 198, 220, 220, 220, 503, 62, 306, 81, 796, 503, 62, 9310, 13, 16447, 49925, 7, 22915, 2484, 79, 11, 7679, 13, 3855, 4561, 34961, 8134, 22784, 267, 2164, 13, 86, 32812, 34220, 14520, 8, 198, 220, 220, 220, 825, 62, 30053, 796, 503, 62, 306, 81, 13, 3855, 49925, 7469, 77, 3419, 628, 220, 220, 220, 329, 3895, 287, 7679, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4903, 296, 796, 3895, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1989, 796, 4903, 296, 13, 3855, 30547, 3419, 220, 1303, 5525, 106, 94, 163, 106, 245, 165, 251, 95, 163, 100, 107, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1989, 1875, 1989, 62, 400, 10126, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 220, 220, 220, 220, 220, 220, 220, 3895, 13, 7248, 15878, 7203, 30547, 1600, 1989, 8, 220, 1303, 10263, 108, 228, 165, 251, 95, 163, 100, 107, 162, 115, 119, 27950, 254, 26344, 108, 161, 109, 252, 45250, 100, 26193, 101, 40792, 198, 220, 220, 220, 220, 220, 220, 220, 7679, 13, 7248, 38816, 7, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 267, 2164, 13, 38816, 7, 4299, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 13, 7248, 10082, 15748, 7, 469, 296, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 306, 81, 13, 16447, 38816, 7, 448, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 6045, 628, 220, 220, 220, 503, 62, 9310, 13, 7414, 1530, 30562, 3419, 198, 220, 220, 220, 1619, 1366, 7416, 11, 503, 62, 9310, 628, 198, 4299, 4781, 62, 17470, 62, 30053, 7, 15414, 2484, 79, 11, 5072, 2484, 79, 11, 1989, 62, 400, 10126, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 2163, 318, 973, 284, 4781, 1402, 1989, 286, 3895, 422, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 5128, 2484, 79, 25, 262, 3108, 286, 5128, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 5072, 2484, 79, 25, 262, 3108, 286, 5072, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 1989, 62, 400, 411, 727, 25, 262, 11387, 286, 1989, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 7203, 1546, 7112, 25959, 7753, 4943, 198, 220, 220, 220, 1366, 7416, 796, 4639, 13, 11505, 7, 15414, 2484, 79, 11, 352, 8, 198, 220, 220, 220, 7679, 796, 1366, 7416, 13, 3855, 49925, 3419, 198, 220, 220, 220, 649, 62, 3245, 796, 267, 2164, 13, 15878, 7469, 77, 7203, 30547, 1600, 267, 2164, 13, 19238, 5446, 2287, 8, 198, 220, 220, 220, 649, 62, 3245, 13, 7248, 30916, 7, 2624, 8, 198, 220, 220, 220, 649, 62, 3245, 13, 7248, 6719, 16005, 7, 1433, 8, 220, 1303, 5525, 106, 122, 163, 121, 106, 165, 251, 95, 163, 100, 107, 163, 39333, 41753, 99, 11, 22887, 237, 46763, 108, 163, 224, 117, 28938, 236, 1433, 19526, 235, 198, 220, 220, 220, 7679, 13, 16447, 15878, 7, 3605, 62, 3245, 8, 628, 220, 220, 220, 1303, 10545, 244, 108, 161, 119, 118, 6601, 7416, 171, 120, 234, 49925, 198, 220, 220, 220, 503, 62, 9310, 796, 4639, 13, 16447, 6601, 7416, 7, 22915, 2484, 79, 8, 198, 220, 220, 220, 503, 62, 306, 81, 796, 503, 62, 9310, 13, 16447, 49925, 7, 22915, 2484, 79, 11, 7679, 13, 3855, 4561, 34961, 8134, 22784, 267, 2164, 13, 86, 32812, 34220, 14520, 8, 198, 220, 220, 220, 825, 62, 30053, 796, 503, 62, 306, 81, 13, 3855, 49925, 7469, 77, 3419, 628, 220, 220, 220, 329, 3895, 287, 7679, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4903, 296, 796, 3895, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1989, 796, 4903, 296, 13, 3855, 30547, 3419, 220, 1303, 5525, 106, 94, 163, 106, 245, 165, 251, 95, 163, 100, 107, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1989, 1279, 1989, 62, 400, 10126, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 220, 220, 220, 220, 220, 220, 220, 3895, 13, 7248, 15878, 7203, 30547, 1600, 1989, 8, 220, 1303, 10263, 108, 228, 165, 251, 95, 163, 100, 107, 162, 115, 119, 27950, 254, 26344, 108, 161, 109, 252, 45250, 100, 26193, 101, 40792, 198, 220, 220, 220, 220, 220, 220, 220, 7679, 13, 7248, 38816, 7, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 267, 2164, 13, 38816, 7, 4299, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 13, 7248, 10082, 15748, 7, 469, 296, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 306, 81, 13, 16447, 38816, 7, 448, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 6045, 628, 220, 220, 220, 503, 62, 9310, 13, 7414, 1530, 30562, 3419, 198, 220, 220, 220, 1619, 1366, 7416, 11, 503, 62, 9310, 628, 198, 4299, 11876, 7, 259, 2484, 79, 11, 503, 2484, 79, 11, 275, 30246, 28, 15, 13, 2999, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 4634, 510, 11876, 6516, 287, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 287, 2484, 79, 25, 262, 3108, 286, 5128, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 503, 2484, 79, 25, 262, 3108, 286, 5072, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 275, 30246, 25, 262, 5253, 286, 11876, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 267, 2164, 13, 11041, 3109, 11755, 3419, 198, 220, 220, 220, 287, 62, 9310, 796, 267, 2164, 13, 11505, 7, 259, 2484, 79, 8, 198, 220, 220, 220, 287, 62, 306, 81, 796, 287, 62, 9310, 13, 3855, 49925, 3419, 198, 220, 220, 220, 1303, 10263, 230, 249, 161, 119, 118, 164, 122, 241, 49035, 118, 28632, 23877, 229, 20015, 114, 198, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 10786, 1546, 7112, 25959, 7753, 11537, 198, 220, 220, 220, 611, 10644, 7, 448, 2484, 79, 737, 1069, 1023, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 4639, 13, 38727, 6601, 7416, 7, 448, 2484, 79, 8, 198, 220, 220, 220, 1303, 10545, 244, 108, 161, 119, 118, 6601, 7416, 171, 120, 234, 49925, 198, 220, 220, 220, 503, 62, 9310, 796, 4639, 13, 16447, 6601, 7416, 7, 448, 2484, 79, 8, 198, 220, 220, 220, 503, 62, 306, 81, 796, 503, 62, 9310, 13, 16447, 49925, 7, 448, 2484, 79, 11, 287, 62, 306, 81, 13, 3855, 4561, 34961, 8134, 22784, 267, 2164, 13, 86, 32812, 34220, 14520, 8, 198, 220, 220, 220, 825, 62, 30053, 796, 503, 62, 306, 81, 13, 3855, 49925, 7469, 77, 3419, 628, 220, 220, 220, 1303, 16268, 223, 235, 43889, 228, 43889, 253, 34650, 233, 21410, 33383, 7753, 23877, 229, 20015, 114, 163, 119, 247, 162, 107, 237, 10310, 103, 10082, 15748, 161, 223, 248, 28632, 162, 241, 235, 43291, 198, 220, 220, 220, 329, 3895, 287, 287, 62, 306, 81, 25, 198, 220, 220, 220, 220, 220, 220, 220, 22939, 796, 3895, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 11876, 796, 22939, 13, 28632, 7, 17457, 9311, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 267, 2164, 13, 38816, 7, 4299, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 13, 7248, 10082, 15748, 7, 22252, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 306, 81, 13, 16447, 38816, 7, 448, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 6045, 198, 220, 220, 220, 503, 62, 9310, 13, 7414, 1530, 30562, 3419, 198, 220, 220, 220, 1619, 287, 62, 9310, 11, 503, 62, 9310, 628, 198, 4299, 32746, 722, 7, 259, 2484, 79, 11, 277, 3672, 11, 275, 30246, 28, 15, 13, 8298, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1058, 17143, 287, 2484, 79, 25, 262, 3108, 286, 5128, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 277, 3672, 25, 262, 3108, 286, 5072, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 275, 30246, 25, 262, 5253, 286, 11876, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 267, 2164, 13, 11041, 3109, 11755, 3419, 198, 220, 220, 220, 287, 62, 9310, 796, 267, 2164, 13, 11505, 7, 259, 2484, 79, 8, 198, 220, 220, 220, 287, 62, 306, 81, 796, 287, 62, 9310, 13, 3855, 49925, 3419, 198, 220, 220, 220, 1303, 10263, 230, 249, 161, 119, 118, 164, 122, 241, 49035, 118, 28632, 23877, 229, 20015, 114, 198, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 10786, 1546, 7112, 25959, 7753, 11537, 198, 220, 220, 220, 611, 10644, 7, 69, 3672, 737, 1069, 1023, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 4639, 13, 38727, 6601, 7416, 7, 69, 3672, 8, 198, 220, 220, 220, 1303, 10545, 244, 108, 161, 119, 118, 6601, 7416, 171, 120, 234, 49925, 198, 220, 220, 220, 503, 62, 9310, 796, 4639, 13, 16447, 6601, 7416, 7, 69, 3672, 8, 198, 220, 220, 220, 503, 62, 306, 81, 796, 503, 62, 9310, 13, 16447, 49925, 7, 69, 3672, 11, 287, 62, 306, 81, 13, 3855, 4561, 34961, 8134, 22784, 267, 2164, 13, 86, 32812, 34220, 14520, 8, 198, 220, 220, 220, 825, 62, 30053, 796, 503, 62, 306, 81, 13, 3855, 49925, 7469, 77, 3419, 198, 220, 220, 220, 1303, 16268, 223, 235, 43889, 228, 43889, 253, 34650, 233, 21410, 33383, 7753, 23877, 229, 20015, 114, 163, 119, 247, 162, 107, 237, 10310, 103, 10082, 15748, 161, 223, 248, 28632, 162, 241, 235, 43291, 198, 220, 220, 220, 329, 3895, 287, 287, 62, 306, 81, 25, 198, 220, 220, 220, 220, 220, 220, 220, 22939, 796, 3895, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 11876, 796, 22939, 13, 28632, 7, 17457, 9311, 737, 28632, 32590, 17457, 9311, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 267, 2164, 13, 38816, 7, 4299, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 13, 7248, 10082, 15748, 7, 22252, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 306, 81, 13, 16447, 38816, 7, 448, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 30053, 796, 6045, 198, 220, 220, 220, 503, 62, 9310, 13, 7414, 1530, 30562, 3419, 198, 220, 220, 220, 1619, 287, 62, 9310, 11, 503, 62, 9310, 628, 198, 4299, 755, 17, 1370, 7, 35428, 22184, 11, 1627, 22184, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 770, 2163, 318, 973, 284, 787, 7514, 14520, 10385, 284, 1627, 198, 220, 220, 220, 1058, 17143, 7514, 22184, 25, 262, 3108, 286, 5128, 11, 262, 5485, 7753, 286, 7514, 14520, 198, 220, 220, 220, 1058, 17143, 1627, 22184, 25, 262, 3108, 286, 5072, 11, 262, 5485, 7753, 286, 1627, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 10786, 1546, 7112, 25959, 7753, 11537, 198, 220, 220, 220, 7514, 9310, 796, 267, 2164, 13, 11505, 7, 35428, 22184, 11, 657, 8, 198, 220, 220, 220, 7514, 49925, 796, 7514, 9310, 13, 3855, 49925, 3419, 198, 220, 220, 220, 21739, 5420, 796, 7514, 49925, 13, 3855, 4561, 34961, 8134, 3419, 198, 220, 220, 220, 1303, 26344, 249, 161, 119, 118, 164, 122, 241, 49035, 118, 23877, 229, 20015, 114, 198, 220, 220, 220, 611, 28686, 13, 6978, 13, 1069, 1023, 7, 1370, 22184, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 4639, 13, 38727, 6601, 7416, 7, 1370, 22184, 8, 198, 220, 220, 220, 16566, 82, 796, 26230, 13, 16447, 6601, 7416, 7, 1370, 22184, 8, 198, 220, 220, 220, 9493, 417, 2794, 796, 16566, 82, 13, 16447, 49925, 7, 1370, 22184, 11, 264, 3808, 28, 2777, 34961, 5420, 11, 4903, 296, 62, 4906, 28, 519, 81, 13, 86, 32812, 13949, 10100, 8, 198, 220, 220, 220, 8096, 891, 77, 796, 9493, 417, 2794, 13, 3855, 49925, 7469, 77, 3419, 198, 220, 220, 220, 1303, 164, 236, 115, 20998, 244, 1806, 26344, 108, 49035, 254, 19526, 243, 19526, 241, 198, 220, 220, 220, 1303, 469, 296, 1370, 796, 267, 2164, 13, 10082, 15748, 7, 519, 81, 13, 86, 32812, 10082, 15748, 36307, 8, 198, 220, 220, 220, 329, 2218, 287, 7514, 49925, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4903, 296, 796, 2218, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 5858, 796, 4903, 296, 13, 3855, 10082, 15748, 8134, 7, 15, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 469, 296, 26000, 13, 4550, 10082, 15748, 7, 1806, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 30053, 796, 267, 2164, 13, 38816, 7, 69, 20980, 891, 77, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 30053, 13, 7248, 10082, 15748, 7, 1806, 8, 198, 220, 220, 220, 220, 220, 220, 220, 9493, 417, 2794, 13, 16447, 38816, 7, 448, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 503, 30053, 796, 6045, 628, 198, 4299, 1168, 20996, 48346, 1722, 10962, 7, 8847, 62, 6978, 11, 427, 79, 62, 6978, 11, 9756, 62, 4868, 28, 17816, 35839, 20520, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3387, 3522, 284, 3740, 1378, 14036, 13, 6359, 32656, 13, 3262, 14, 732, 844, 259, 62, 11785, 24, 3023, 2414, 14, 20205, 14, 36604, 14, 16562, 43193, 24943, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 198, 220, 220, 220, 374, 292, 62, 26230, 796, 374, 1603, 952, 13, 9654, 7, 8847, 62, 6978, 8, 198, 220, 220, 220, 7177, 796, 374, 292, 62, 26230, 13, 961, 7, 16, 8, 198, 220, 220, 220, 1527, 500, 796, 374, 292, 62, 26230, 13, 35636, 198, 220, 220, 220, 427, 79, 62, 26230, 796, 279, 67, 13, 961, 62, 7753, 7, 1477, 79, 62, 6978, 8, 198, 220, 220, 220, 1976, 82, 796, 1976, 20996, 62, 34242, 7, 1477, 79, 62, 6978, 11, 7177, 11, 1527, 500, 28, 2001, 500, 11, 9756, 28, 34242, 62, 4868, 8, 628, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 10786, 1546, 7112, 25959, 7753, 11537, 198, 220, 220, 220, 7679, 62, 10459, 796, 4639, 13, 11505, 7, 1477, 79, 62, 6978, 11, 352, 8, 198, 220, 220, 220, 47188, 796, 7679, 62, 10459, 13, 3855, 49925, 3419, 198, 220, 220, 220, 825, 77, 796, 47188, 13, 3855, 49925, 7469, 77, 3419, 628, 220, 220, 220, 3895, 12332, 796, 825, 77, 13, 3855, 15878, 12332, 3419, 198, 220, 220, 220, 7160, 62, 25747, 796, 17635, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 30053, 12332, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2214, 796, 825, 77, 13, 3855, 15878, 7469, 77, 7, 72, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2214, 62, 3672, 796, 2214, 13, 3855, 5376, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 7160, 62, 25747, 13, 33295, 7, 3245, 62, 3672, 8, 628, 220, 220, 220, 329, 9766, 287, 9756, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 9766, 287, 7160, 62, 25747, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1208, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 537, 82, 62, 3672, 796, 267, 2164, 13, 15878, 7469, 77, 7, 74, 11, 267, 2164, 13, 46, 9792, 10100, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 537, 82, 62, 3672, 796, 267, 2164, 13, 15878, 7469, 77, 7, 11129, 11, 267, 2164, 13, 19238, 5446, 2287, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 537, 82, 62, 3672, 13, 7248, 30916, 7, 2414, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 47188, 13, 16447, 15878, 7, 565, 82, 62, 3672, 8, 628, 220, 220, 220, 4639, 796, 6045, 628, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 10786, 1546, 7112, 25959, 7753, 11537, 198, 220, 220, 220, 7679, 62, 10459, 796, 4639, 13, 11505, 7, 1477, 79, 62, 6978, 11, 352, 8, 198, 220, 220, 220, 47188, 796, 7679, 62, 10459, 13, 3855, 49925, 3419, 198, 220, 220, 220, 825, 77, 796, 47188, 13, 3855, 49925, 7469, 77, 3419, 628, 220, 220, 220, 3895, 12332, 796, 825, 77, 13, 3855, 15878, 12332, 3419, 628, 220, 220, 220, 954, 796, 657, 198, 220, 220, 220, 3895, 796, 47188, 13, 3855, 10019, 38816, 3419, 198, 220, 220, 220, 981, 3895, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 30053, 12332, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2214, 796, 825, 77, 13, 3855, 15878, 7469, 77, 7, 72, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2214, 62, 3672, 796, 2214, 13, 3855, 5376, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2214, 62, 3672, 287, 9756, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3895, 13, 7248, 15878, 7, 3245, 62, 3672, 11, 1976, 82, 58, 9127, 7131, 3245, 62, 3672, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 47188, 13, 7248, 38816, 7, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1208, 198, 220, 220, 220, 220, 220, 220, 220, 954, 15853, 352, 198, 220, 220, 220, 220, 220, 220, 220, 3895, 796, 47188, 13, 3855, 10019, 38816, 3419, 628, 220, 220, 220, 886, 796, 640, 13, 2435, 3419, 198, 220, 220, 220, 3601, 19510, 437, 532, 923, 8, 1220, 4570, 405, 13, 15, 8, 628, 198, 4299, 24061, 62, 9806, 62, 20337, 7, 1477, 79, 15235, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 24061, 3509, 1989, 1871, 477, 3033, 198, 220, 220, 220, 1058, 17143, 427, 79, 15235, 25, 262, 4112, 3108, 286, 5485, 7753, 198, 220, 220, 220, 1058, 7783, 25, 262, 3509, 1989, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 3509, 62, 20337, 796, 657, 198, 220, 220, 220, 4639, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 7203, 1546, 7112, 25959, 7753, 4943, 198, 220, 220, 220, 1366, 7416, 796, 4639, 13, 11505, 7, 1477, 79, 15235, 11, 352, 8, 198, 220, 220, 220, 7679, 796, 1366, 7416, 13, 3855, 49925, 3419, 198, 220, 220, 220, 649, 62, 3245, 796, 267, 2164, 13, 15878, 7469, 77, 7203, 30547, 1600, 267, 2164, 13, 19238, 5446, 2287, 8, 198, 220, 220, 220, 649, 62, 3245, 13, 7248, 30916, 7, 2624, 8, 198, 220, 220, 220, 649, 62, 3245, 13, 7248, 6719, 16005, 7, 1433, 8, 220, 1303, 5525, 106, 122, 163, 121, 106, 165, 251, 95, 163, 100, 107, 163, 39333, 41753, 99, 11, 22887, 237, 46763, 108, 163, 224, 117, 28938, 236, 1433, 19526, 235, 198, 220, 220, 220, 7679, 13, 16447, 15878, 7, 3605, 62, 3245, 8, 198, 220, 220, 220, 329, 3895, 287, 7679, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4903, 296, 796, 3895, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1989, 796, 4903, 296, 13, 3855, 30547, 3419, 220, 1303, 5525, 106, 94, 163, 106, 245, 165, 251, 95, 163, 100, 107, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1989, 1875, 3509, 62, 20337, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3509, 62, 20337, 796, 1989, 198, 220, 220, 220, 220, 220, 220, 220, 3895, 13, 7248, 15878, 7203, 30547, 1600, 1989, 8, 220, 1303, 10263, 108, 228, 165, 251, 95, 163, 100, 107, 162, 115, 119, 27950, 254, 26344, 108, 161, 109, 252, 45250, 100, 26193, 101, 40792, 198, 220, 220, 220, 220, 220, 220, 220, 7679, 13, 7248, 38816, 7, 30053, 8, 198, 220, 220, 220, 1366, 7416, 796, 6045, 198, 220, 220, 220, 1441, 3509, 62, 20337, 628, 198, 4299, 7925, 62, 30152, 515, 62, 40890, 7, 259, 2484, 79, 11, 503, 1477, 79, 11, 275, 30246, 28, 15, 13, 25257, 11, 2169, 1676, 313, 28, 4458, 14, 29510, 6, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 7925, 11557, 3033, 1871, 477, 3033, 7, 4122, 11, 1627, 11, 7514, 14520, 8, 198, 220, 220, 220, 1058, 17143, 287, 2484, 79, 25, 262, 3108, 286, 5128, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 503, 1477, 79, 25, 262, 3108, 286, 5072, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 275, 30246, 25, 262, 5253, 286, 11876, 198, 220, 220, 220, 1058, 17143, 2169, 1676, 313, 25, 8584, 2393, 8619, 198, 220, 220, 220, 1058, 7783, 25, 6045, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 33480, 15908, 7, 11498, 1676, 313, 8, 198, 220, 220, 220, 277, 3672, 796, 277, 6, 90, 11498, 1676, 313, 92, 14, 22252, 13, 1477, 79, 6, 198, 220, 220, 220, 277, 3672, 17, 796, 277, 6, 90, 11498, 1676, 313, 92, 14, 22252, 17, 13, 1477, 79, 6, 198, 220, 220, 220, 11876, 7, 259, 2484, 79, 11, 277, 3672, 11, 275, 30246, 28, 17457, 9311, 8, 198, 220, 220, 220, 3509, 62, 20337, 796, 24061, 62, 9806, 62, 20337, 7, 69, 3672, 8, 198, 220, 220, 220, 39407, 3198, 2484, 79, 7, 69, 3672, 11, 277, 3672, 17, 8, 198, 220, 220, 220, 18540, 3366, 17, 29762, 35428, 7, 69, 3672, 17, 11, 277, 3672, 8, 198, 220, 220, 220, 4781, 62, 14261, 62, 30053, 7, 69, 3672, 11, 277, 3672, 17, 11, 3509, 62, 20337, 8, 198, 220, 220, 220, 39407, 3198, 2484, 79, 7, 69, 3672, 17, 11, 277, 3672, 8, 198, 220, 220, 220, 16246, 7, 69, 3672, 11, 287, 2484, 79, 11, 503, 1477, 79, 8, 628, 220, 220, 220, 1303, 4781, 8584, 8619, 198, 220, 220, 220, 611, 28686, 13, 6978, 13, 1069, 1023, 7, 11498, 1676, 313, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 4423, 346, 13, 81, 16762, 631, 7, 11498, 1676, 313, 8, 628, 198, 4299, 30276, 62, 1477, 79, 7, 259, 62, 1477, 79, 11, 503, 62, 1477, 79, 11, 15621, 28, 15, 13, 18005, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1058, 17143, 287, 62, 1477, 79, 25, 262, 3108, 286, 5128, 5485, 7753, 198, 220, 220, 220, 1058, 17143, 503, 62, 1477, 79, 25, 262, 3108, 286, 5072, 5485, 7753, 198, 220, 220, 220, 1058, 7783, 25, 16409, 257, 27009, 5485, 7753, 4635, 416, 262, 15796, 12, 6435, 12603, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 308, 7568, 796, 279, 67, 13, 961, 62, 7753, 7, 259, 62, 1477, 79, 8, 1303, 34509, 1546, 5446, 2751, 198, 220, 220, 220, 308, 7568, 17816, 469, 15748, 20520, 796, 30276, 7, 308, 7568, 17816, 469, 15748, 6, 4357, 15621, 28, 83, 37668, 8, 198, 220, 220, 220, 308, 7568, 13, 1462, 62, 7753, 7, 448, 62, 1477, 79, 11, 4639, 2625, 1546, 7112, 25959, 7753, 4943, 628 ]
2.211545
5,838
from memoized import memoized from custom.inddex import filters from custom.inddex.ucr.data_providers.nutrient_intakes_data import ( NutrientIntakesByFoodData, NutrientIntakesByRespondentData, ) from custom.inddex.utils import MultiTabularReport
[ 6738, 16155, 1143, 1330, 16155, 1143, 198, 198, 6738, 2183, 13, 521, 67, 1069, 1330, 16628, 198, 6738, 2183, 13, 521, 67, 1069, 13, 1229, 81, 13, 7890, 62, 15234, 4157, 13, 14930, 8289, 62, 600, 1124, 62, 7890, 1330, 357, 198, 220, 220, 220, 11959, 8289, 5317, 1124, 3886, 24602, 6601, 11, 198, 220, 220, 220, 11959, 8289, 5317, 1124, 3886, 19309, 623, 298, 6601, 11, 198, 8, 198, 6738, 2183, 13, 521, 67, 1069, 13, 26791, 1330, 15237, 33349, 934, 19100, 628 ]
3.047619
84
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of the minifold project. # https://github.com/nokia/minifold __author__ = "Marc-Olivier Buob" __maintainer__ = "Marc-Olivier Buob" __email__ = "[email protected]" __copyright__ = "Copyright (C) 2018, Nokia" __license__ = "BSD-3" def cast_none(s :str): """ Cast a string into None if possible. Args: s: The input str. Raises: ValueError: if the cast cannot be achieved. Returns: None if successful. """ if s is None: return None elif isinstance(s, str) and s.lower() == "none": return None raise ValueError("Invalid literal for cast_none(): %s" % s) def cast_bool(s :str) -> bool: """ Cast a string into a bool if possible. Args: s: The input str. Raises: ValueError: if the cast cannot be achieved. Returns: The boolean corresponding to s if successful. """ if isinstance(s, bool): return s elif isinstance(s, str): l = s.lower() if l == "true": return True elif l == "false": return False raise ValueError("Invalid literal for cast_bool(): %s" % s) def lexical_cast(s :str, cast): """ Cast a string according to an operator. Args: cast: The cast operator. s: The string to be casted. Raises: ValueError: if the cast cannot be achieved. Returns: The corresponding value. """ return cast(s) def lexical_casts(s :str, cast_operators = None): """ Cast a string according to several cast operators. Args: s: The string to be casted. cast_operators: A list of cast operators. Operators must be ordered from the less strict to the more strict (e.g. int before float). Returns: The original string if no cast worked, the corresponding casted value otherwise. """ if cast_operators is None: cast_operators = [cast_none, cast_bool, int, float] for cast in cast_operators: try: ret = lexical_cast(s, cast) return ret except ValueError: pass return s
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 770, 2393, 318, 636, 286, 262, 949, 361, 727, 1628, 13, 198, 2, 3740, 1378, 12567, 13, 785, 14, 77, 22903, 14, 1084, 361, 727, 198, 198, 834, 9800, 834, 220, 220, 220, 220, 796, 366, 22697, 12, 46, 16017, 959, 9842, 672, 1, 198, 834, 76, 2913, 10613, 834, 796, 366, 22697, 12, 46, 16017, 959, 9842, 672, 1, 198, 834, 12888, 834, 220, 220, 220, 220, 220, 796, 366, 3876, 66, 12, 349, 452, 959, 13, 11110, 672, 31, 77, 22903, 12, 7923, 12, 75, 8937, 13, 785, 1, 198, 834, 22163, 4766, 834, 220, 796, 366, 15269, 357, 34, 8, 2864, 11, 26182, 1, 198, 834, 43085, 834, 220, 220, 220, 796, 366, 21800, 12, 18, 1, 198, 198, 4299, 3350, 62, 23108, 7, 82, 1058, 2536, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5833, 257, 4731, 656, 6045, 611, 1744, 13, 198, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 264, 25, 383, 5128, 965, 13, 198, 220, 220, 220, 7567, 2696, 25, 198, 220, 220, 220, 220, 220, 220, 220, 11052, 12331, 25, 611, 262, 3350, 2314, 307, 8793, 13, 198, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 6045, 611, 4388, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 264, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 6045, 198, 220, 220, 220, 1288, 361, 318, 39098, 7, 82, 11, 965, 8, 290, 264, 13, 21037, 3419, 6624, 366, 23108, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 6045, 198, 220, 220, 220, 5298, 11052, 12331, 7203, 44651, 18875, 329, 3350, 62, 23108, 33529, 4064, 82, 1, 4064, 264, 8, 198, 198, 4299, 3350, 62, 30388, 7, 82, 1058, 2536, 8, 4613, 20512, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5833, 257, 4731, 656, 257, 20512, 611, 1744, 13, 198, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 264, 25, 383, 5128, 965, 13, 198, 220, 220, 220, 7567, 2696, 25, 198, 220, 220, 220, 220, 220, 220, 220, 11052, 12331, 25, 611, 262, 3350, 2314, 307, 8793, 13, 198, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 383, 25131, 11188, 284, 264, 611, 4388, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 318, 39098, 7, 82, 11, 20512, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 264, 198, 220, 220, 220, 1288, 361, 318, 39098, 7, 82, 11, 965, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 300, 796, 264, 13, 21037, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 611, 300, 6624, 366, 7942, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 300, 6624, 366, 9562, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 198, 220, 220, 220, 5298, 11052, 12331, 7203, 44651, 18875, 329, 3350, 62, 30388, 33529, 4064, 82, 1, 4064, 264, 8, 198, 198, 4299, 31191, 605, 62, 2701, 7, 82, 1058, 2536, 11, 3350, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5833, 257, 4731, 1864, 284, 281, 10088, 13, 198, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3350, 25, 383, 3350, 10088, 13, 198, 220, 220, 220, 220, 220, 220, 220, 264, 25, 383, 4731, 284, 307, 3350, 276, 13, 198, 220, 220, 220, 7567, 2696, 25, 198, 220, 220, 220, 220, 220, 220, 220, 11052, 12331, 25, 611, 262, 3350, 2314, 307, 8793, 13, 198, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 383, 11188, 1988, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 3350, 7, 82, 8, 198, 198, 4299, 31191, 605, 62, 40924, 7, 82, 1058, 2536, 11, 3350, 62, 3575, 2024, 796, 6045, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5833, 257, 4731, 1864, 284, 1811, 3350, 12879, 13, 198, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 264, 25, 383, 4731, 284, 307, 3350, 276, 13, 198, 220, 220, 220, 220, 220, 220, 220, 3350, 62, 3575, 2024, 25, 317, 1351, 286, 3350, 12879, 13, 6564, 2024, 1276, 307, 6149, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 422, 262, 1342, 7646, 284, 262, 517, 7646, 357, 68, 13, 70, 13, 493, 878, 12178, 737, 198, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 383, 2656, 4731, 611, 645, 3350, 3111, 11, 262, 11188, 3350, 276, 1988, 198, 220, 220, 220, 220, 220, 220, 220, 4306, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 3350, 62, 3575, 2024, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3350, 62, 3575, 2024, 796, 685, 2701, 62, 23108, 11, 3350, 62, 30388, 11, 493, 11, 12178, 60, 198, 220, 220, 220, 329, 3350, 287, 3350, 62, 3575, 2024, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1005, 796, 31191, 605, 62, 2701, 7, 82, 11, 3350, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 1005, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 11052, 12331, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1208, 198, 220, 220, 220, 1441, 264, 198 ]
2.330553
959
import streamlit as st import pandas as pd import numpy as np #Pour la modélisation from sklearn import preprocessing from sklearn.preprocessing import PolynomialFeatures from sklearn.model_selection import train_test_split , cross_val_score, GridSearchCV from sklearn.metrics import mean_squared_error, f1_score from sklearn import linear_model from sklearn.linear_model import RidgeCV , LassoCV, lasso_path, Ridge from imblearn.metrics import classification_report_imbalanced, geometric_mean_score import xgboost from xgboost import XGBRegressor #Pour les graphs import matplotlib.pyplot as plt import seaborn as sns from bokeh.io import output_file, show from bokeh.plotting import figure from numpy import histogram, linspace from scipy.stats.kde import gaussian_kde from bokeh.models import HoverTool, LinearAxis, Range1d, ColumnDataSource from bokeh.models.widgets import Panel, Tabs from bokeh.models.annotations import BoxAnnotation #Pour l'interprétabilité' import streamlit.components.v1 as components import random import shap shap.initjs() import eli5 from skater.core.explanations import Interpretation interpreter = Interpretation() from skater.data import DataManager from skater.model import InMemoryModel , DeployedModel title = "Modélisation" sidebar_name = "Modélisation" @st.cache @st.cache() @st.cache() @st.cache(hash_funcs={XGBRegressor: id})
[ 11748, 4269, 18250, 355, 336, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 198, 2, 47, 454, 8591, 953, 2634, 75, 5612, 198, 6738, 1341, 35720, 1330, 662, 36948, 198, 6738, 1341, 35720, 13, 3866, 36948, 1330, 12280, 26601, 498, 23595, 198, 6738, 1341, 35720, 13, 19849, 62, 49283, 1330, 4512, 62, 9288, 62, 35312, 837, 3272, 62, 2100, 62, 26675, 11, 24846, 18243, 33538, 198, 6738, 1341, 35720, 13, 4164, 10466, 1330, 1612, 62, 16485, 1144, 62, 18224, 11, 277, 16, 62, 26675, 198, 6738, 1341, 35720, 1330, 14174, 62, 19849, 198, 6738, 1341, 35720, 13, 29127, 62, 19849, 1330, 20614, 33538, 837, 406, 28372, 33538, 11, 300, 28372, 62, 6978, 11, 20614, 198, 6738, 545, 903, 1501, 13, 4164, 10466, 1330, 17923, 62, 13116, 62, 320, 27753, 11, 38445, 62, 32604, 62, 26675, 198, 11748, 2124, 70, 39521, 198, 6738, 2124, 70, 39521, 1330, 1395, 4579, 8081, 44292, 198, 198, 2, 47, 454, 10287, 28770, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 384, 397, 1211, 355, 3013, 82, 198, 6738, 1489, 365, 71, 13, 952, 1330, 5072, 62, 7753, 11, 905, 198, 6738, 1489, 365, 71, 13, 29487, 889, 1330, 3785, 198, 6738, 299, 32152, 1330, 1554, 21857, 11, 300, 1040, 10223, 198, 6738, 629, 541, 88, 13, 34242, 13, 74, 2934, 1330, 31986, 31562, 62, 74, 2934, 198, 6738, 1489, 365, 71, 13, 27530, 1330, 38452, 25391, 11, 44800, 31554, 271, 11, 13667, 16, 67, 11, 29201, 6601, 7416, 198, 6738, 1489, 365, 71, 13, 27530, 13, 28029, 11407, 1330, 18810, 11, 309, 8937, 198, 6738, 1489, 365, 71, 13, 27530, 13, 34574, 602, 1330, 8315, 2025, 38983, 198, 198, 2, 47, 454, 300, 6, 3849, 1050, 2634, 8658, 6392, 2634, 6, 198, 11748, 4269, 18250, 13, 5589, 3906, 13, 85, 16, 355, 6805, 198, 11748, 4738, 198, 11748, 427, 499, 198, 1477, 499, 13, 15003, 8457, 3419, 198, 11748, 1288, 72, 20, 198, 6738, 1341, 729, 13, 7295, 13, 1069, 11578, 602, 1330, 48907, 341, 198, 3849, 3866, 353, 796, 48907, 341, 3419, 198, 6738, 1341, 729, 13, 7890, 1330, 6060, 13511, 198, 6738, 1341, 729, 13, 19849, 1330, 554, 30871, 17633, 837, 34706, 276, 17633, 628, 198, 7839, 796, 366, 5841, 2634, 75, 5612, 1, 198, 1589, 5657, 62, 3672, 796, 366, 5841, 2634, 75, 5612, 1, 628, 198, 31, 301, 13, 23870, 628, 198, 31, 301, 13, 23870, 3419, 198, 198, 31, 301, 13, 23870, 3419, 198, 220, 220, 220, 220, 198, 31, 301, 13, 23870, 7, 17831, 62, 12543, 6359, 34758, 55, 4579, 8081, 44292, 25, 4686, 30072, 628, 198 ]
3.150342
439
from django.core.paginator import Paginator, PageNotAnInteger, InvalidPage, EmptyPage from django.http import HttpResponse from django.shortcuts import render from .models import Tweets # Create your views here.
[ 6738, 42625, 14208, 13, 7295, 13, 79, 363, 20900, 1330, 31525, 20900, 11, 7873, 3673, 2025, 46541, 11, 17665, 9876, 11, 33523, 9876, 201, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 31077, 201, 198, 6738, 42625, 14208, 13, 19509, 23779, 1330, 8543, 201, 198, 6738, 764, 27530, 1330, 24205, 1039, 201, 198, 201, 198, 201, 198, 201, 198, 2, 13610, 534, 5009, 994, 13, 201, 198 ]
3.279412
68
from spook.base import SpookBase from spook.lin_solve import SpookLinSolve from spook.quad_program import SpookPosL1,SpookPosL2,SpookL1 import spook.utils as utils # from spook.vmi_special import PhotonFreqResVMI
[ 6738, 599, 566, 13, 8692, 1330, 1338, 566, 14881, 198, 6738, 599, 566, 13, 2815, 62, 82, 6442, 1330, 1338, 566, 14993, 50, 6442, 198, 6738, 599, 566, 13, 47003, 62, 23065, 1330, 1338, 566, 21604, 43, 16, 11, 4561, 566, 21604, 43, 17, 11, 4561, 566, 43, 16, 198, 11748, 599, 566, 13, 26791, 355, 3384, 4487, 198, 2, 422, 599, 566, 13, 85, 11632, 62, 20887, 1330, 5919, 261, 20366, 80, 4965, 53, 8895 ]
2.789474
76
from tkinter import Frame from .mixins import WidgetMixin, ContainerMixin from .tkmixins import ScheduleMixin, DestroyMixin, FocusMixin, DisplayMixin, ColorMixin, ReprMixin from . import utilities as utils
[ 6738, 256, 74, 3849, 1330, 25184, 198, 6738, 764, 19816, 1040, 1330, 370, 17484, 35608, 259, 11, 43101, 35608, 259, 198, 6738, 764, 83, 13276, 844, 1040, 1330, 19281, 35608, 259, 11, 19448, 35608, 259, 11, 17061, 35608, 259, 11, 16531, 35608, 259, 11, 5315, 35608, 259, 11, 1432, 81, 35608, 259, 198, 6738, 764, 1330, 20081, 355, 3384, 4487, 198 ]
3.377049
61
# # Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ # Written by Angelos Katharopoulos <[email protected]> # """Provide utilities for training attention sampling models.""" from keras.utils import Sequence import numpy as np class Batcher(Sequence): """Assemble a sequence of things into a sequence of batches.""" class DataTransform(Sequence): """Apply a transform to the inputs before passing them to keras.""" class LambdaTransform(DataTransform): """Apply the data transformation defined by the passed in transform function.""" def compose_sequences(sequence, sequences): """Compose a sequence with other sequences. Example sequence = compose_sequences(Dataset(), [ (Batcher, 32), (LambdaTransform, lambda x: x.expand_dims(-1)) ]) """ for s in sequences: sequence = s[0](sequence, *s[1:]) return sequence
[ 2, 198, 2, 15069, 357, 66, 8, 13130, 5121, 72, 499, 4992, 5136, 11, 2638, 1378, 2503, 13, 19830, 499, 13, 354, 14, 198, 2, 22503, 416, 3905, 418, 18341, 283, 20338, 1279, 8368, 418, 13, 74, 776, 283, 20338, 31, 19830, 499, 13, 354, 29, 198, 2, 198, 198, 37811, 15946, 485, 20081, 329, 3047, 3241, 19232, 4981, 526, 15931, 198, 198, 6738, 41927, 292, 13, 26791, 1330, 45835, 198, 11748, 299, 32152, 355, 45941, 628, 198, 4871, 6577, 2044, 7, 44015, 594, 2599, 198, 220, 220, 220, 37227, 1722, 15140, 257, 8379, 286, 1243, 656, 257, 8379, 286, 37830, 526, 15931, 628, 198, 4871, 6060, 41762, 7, 44015, 594, 2599, 198, 220, 220, 220, 37227, 44836, 257, 6121, 284, 262, 17311, 878, 6427, 606, 284, 41927, 292, 526, 15931, 628, 198, 4871, 21114, 6814, 41762, 7, 6601, 41762, 2599, 198, 220, 220, 220, 37227, 44836, 262, 1366, 13389, 5447, 416, 262, 3804, 287, 6121, 198, 220, 220, 220, 2163, 526, 15931, 628, 198, 4299, 36664, 62, 3107, 3007, 7, 43167, 11, 16311, 2599, 198, 220, 220, 220, 37227, 7293, 577, 257, 8379, 351, 584, 16311, 13, 628, 220, 220, 220, 17934, 198, 220, 220, 220, 220, 220, 220, 220, 8379, 796, 36664, 62, 3107, 3007, 7, 27354, 292, 316, 22784, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 24541, 2044, 11, 3933, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 43, 4131, 6814, 41762, 11, 37456, 2124, 25, 2124, 13, 11201, 392, 62, 67, 12078, 32590, 16, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 33761, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 329, 264, 287, 16311, 25, 198, 220, 220, 220, 220, 220, 220, 220, 8379, 796, 264, 58, 15, 16151, 43167, 11, 1635, 82, 58, 16, 25, 12962, 198, 220, 220, 220, 1441, 8379, 198 ]
2.977707
314
import frappe
[ 11748, 5306, 27768 ]
4.333333
3
from couchdbkit import ResourceNotFound from dimagi.utils.couch.database import get_db from dimagi.utils.couch.undo import DELETED_SUFFIX from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from dimagi.ext.jsonobject import * from corehq.apps.users.models import CouchUser from corehq.apps.users.util import raw_username from couchforms import models as couchforms_models def get_doc_info(doc, domain_hint=None, cache=None): """ cache is just a dictionary that you can keep passing in to speed up info retrieval. """ domain = doc.get('domain') or domain_hint doc_type = doc.get('doc_type') doc_id = doc.get('_id') generic_delete = doc_type.endswith(DELETED_SUFFIX) assert doc.get('domain') == domain or domain in doc.get('domains', ()) if cache and doc_id in cache: return cache[doc_id] if has_doc_type(doc_type, 'Application') or has_doc_type(doc_type, 'RemoteApp'): if doc.get('copy_of'): doc_info = DocInfo( display=u'%s (#%s)' % (doc['name'], doc['version']), type_display=_('Application Build'), link=reverse( 'corehq.apps.app_manager.views.download_index', args=[domain, doc_id], ), is_deleted=generic_delete, ) else: doc_info = DocInfo( display=doc['name'], type_display=_('Application'), link=reverse( 'corehq.apps.app_manager.views.view_app', args=[domain, doc_id], ), is_deleted=generic_delete, ) elif has_doc_type(doc_type, 'CommCareCaseGroup'): from corehq.apps.data_interfaces.views import CaseGroupCaseManagementView doc_info = DocInfo( type_display=_('Case Group'), display=doc['name'], link=reverse( CaseGroupCaseManagementView.urlname, args=[domain, doc_id], ), is_deleted=generic_delete, ) elif has_doc_type(doc_type, 'CommCareCase'): doc_info = DocInfo( display=doc['name'], type_display=_('Case'), link=reverse( 'case_details', args=[domain, doc_id], ), is_deleted=generic_delete, ) elif any([has_doc_type(doc_type, d) for d in couchforms_models.doc_types().keys()]): doc_info = DocInfo( type_display=_('Form'), link=reverse( 'render_form_data', args=[domain, doc_id], ), is_deleted=generic_delete, ) elif doc_type in ('CommCareUser',): doc_info = DocInfo( display=raw_username(doc['username']), type_display=_('Mobile Worker'), link=reverse( 'edit_commcare_user', args=[domain, doc_id], ), is_deleted=doc.get('base_doc', '').endswith(DELETED_SUFFIX), ) elif doc_type in ('WebUser',): doc_info = DocInfo( type_display=_('Web User'), display=doc['username'], link=reverse( 'user_account', args=[domain, doc_id], ), is_deleted=doc.get('base_doc', '').endswith(DELETED_SUFFIX), ) elif has_doc_type(doc_type, 'Group'): from corehq.apps.users.views.mobile import EditGroupMembersView doc_info = DocInfo( type_display=_('Group'), display=doc['name'], link=reverse( EditGroupMembersView.urlname, args=[domain, doc_id], ), is_deleted=generic_delete, ) elif has_doc_type(doc_type, 'Domain'): if doc['is_snapshot'] and doc['published']: urlname = 'project_info' else: urlname = 'domain_basic_info' doc_info = DocInfo( type_display=_('Domain'), display=doc['name'], link=reverse( urlname, kwargs={'domain' : doc['name']} ), is_deleted=generic_delete, ) elif has_doc_type(doc_type, 'Location'): from corehq.apps.locations.views import EditLocationView doc_info = DocInfo( type_display=_('Location'), display=doc['name'], link=reverse( EditLocationView.urlname, args=[domain, doc_id], ), is_deleted=generic_delete, ) else: doc_info = DocInfo( is_deleted=generic_delete, ) doc_info.id = doc_id doc_info.domain = domain doc_info.type = doc_type if cache: cache[doc_id] = doc_info return doc_info def get_object_info(obj, cache=None): """ This function is intended to behave just like get_doc_info, only you call it with objects other than Couch docs (such as objects that use the Django ORM). """ class_name = obj.__class__.__name__ cache_key = '%s-%s' % (class_name, obj.pk) if cache and cache_key in cache: return cache[cache_key] from corehq.apps.locations.models import SQLLocation if isinstance(obj, SQLLocation): from corehq.apps.locations.views import EditLocationView doc_info = DocInfo( type_display=_('Location'), display=obj.name, link=reverse( EditLocationView.urlname, args=[obj.domain, obj.location_id], ), is_deleted=False, ) else: doc_info = DocInfo( is_deleted=False, ) doc_info.id = str(obj.pk) doc_info.domain = obj.domain if hasattr(obj, 'domain') else None doc_info.type = class_name if cache: cache[cache_key] = doc_info return doc_info
[ 6738, 18507, 9945, 15813, 1330, 20857, 3673, 21077, 198, 6738, 5391, 18013, 13, 26791, 13, 66, 7673, 13, 48806, 1330, 651, 62, 9945, 198, 6738, 5391, 18013, 13, 26791, 13, 66, 7673, 13, 41204, 1330, 5550, 28882, 1961, 62, 12564, 5777, 10426, 198, 6738, 42625, 14208, 13, 7295, 13, 6371, 411, 349, 690, 1330, 9575, 198, 6738, 42625, 14208, 13, 26791, 13, 41519, 1330, 334, 1136, 5239, 355, 4808, 198, 6738, 5391, 18013, 13, 2302, 13, 17752, 15252, 1330, 1635, 198, 6738, 4755, 71, 80, 13, 18211, 13, 18417, 13, 27530, 1330, 48225, 12982, 198, 6738, 4755, 71, 80, 13, 18211, 13, 18417, 13, 22602, 1330, 8246, 62, 29460, 198, 6738, 18507, 23914, 1330, 4981, 355, 18507, 23914, 62, 27530, 628, 628, 198, 4299, 651, 62, 15390, 62, 10951, 7, 15390, 11, 7386, 62, 71, 600, 28, 14202, 11, 12940, 28, 14202, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 12940, 318, 655, 257, 22155, 326, 345, 460, 1394, 6427, 287, 284, 2866, 510, 7508, 198, 220, 220, 220, 45069, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 7386, 796, 2205, 13, 1136, 10786, 27830, 11537, 393, 7386, 62, 71, 600, 198, 220, 220, 220, 2205, 62, 4906, 796, 2205, 13, 1136, 10786, 15390, 62, 4906, 11537, 198, 220, 220, 220, 2205, 62, 312, 796, 2205, 13, 1136, 10786, 62, 312, 11537, 198, 220, 220, 220, 14276, 62, 33678, 796, 2205, 62, 4906, 13, 437, 2032, 342, 7, 7206, 28882, 1961, 62, 12564, 5777, 10426, 8, 628, 220, 220, 220, 6818, 2205, 13, 1136, 10786, 27830, 11537, 6624, 7386, 393, 7386, 287, 2205, 13, 1136, 10786, 3438, 1299, 3256, 32865, 628, 220, 220, 220, 611, 12940, 290, 2205, 62, 312, 287, 12940, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 12940, 58, 15390, 62, 312, 60, 628, 220, 220, 220, 611, 468, 62, 15390, 62, 4906, 7, 15390, 62, 4906, 11, 705, 23416, 11537, 393, 468, 62, 15390, 62, 4906, 7, 15390, 62, 4906, 11, 705, 36510, 4677, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2205, 13, 1136, 10786, 30073, 62, 1659, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 84, 6, 4, 82, 17426, 4, 82, 33047, 4064, 357, 15390, 17816, 3672, 6, 4357, 2205, 17816, 9641, 20520, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 23416, 10934, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 7295, 71, 80, 13, 18211, 13, 1324, 62, 37153, 13, 33571, 13, 15002, 62, 9630, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 27830, 11, 2205, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 41357, 62, 33678, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 15390, 17816, 3672, 6, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 23416, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 7295, 71, 80, 13, 18211, 13, 1324, 62, 37153, 13, 33571, 13, 1177, 62, 1324, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 27830, 11, 2205, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 41357, 62, 33678, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1288, 361, 468, 62, 15390, 62, 4906, 7, 15390, 62, 4906, 11, 705, 6935, 17784, 20448, 13247, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 422, 4755, 71, 80, 13, 18211, 13, 7890, 62, 3849, 32186, 13, 33571, 1330, 8913, 13247, 20448, 48032, 7680, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 20448, 4912, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 15390, 17816, 3672, 6, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8913, 13247, 20448, 48032, 7680, 13, 6371, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 27830, 11, 2205, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 41357, 62, 33678, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1288, 361, 468, 62, 15390, 62, 4906, 7, 15390, 62, 4906, 11, 705, 6935, 17784, 20448, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 15390, 17816, 3672, 6, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 20448, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 7442, 62, 36604, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 27830, 11, 2205, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 41357, 62, 33678, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1288, 361, 597, 26933, 10134, 62, 15390, 62, 4906, 7, 15390, 62, 4906, 11, 288, 8, 329, 288, 287, 18507, 23914, 62, 27530, 13, 15390, 62, 19199, 22446, 13083, 3419, 60, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 8479, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 13287, 62, 687, 62, 7890, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 27830, 11, 2205, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 41357, 62, 33678, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1288, 361, 2205, 62, 4906, 287, 19203, 6935, 17784, 12982, 3256, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 1831, 62, 29460, 7, 15390, 17816, 29460, 20520, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 17066, 35412, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19312, 62, 9503, 6651, 62, 7220, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 27830, 11, 2205, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 15390, 13, 1136, 10786, 8692, 62, 15390, 3256, 10148, 737, 437, 2032, 342, 7, 7206, 28882, 1961, 62, 12564, 5777, 10426, 828, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1288, 361, 2205, 62, 4906, 287, 19203, 13908, 12982, 3256, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 13908, 11787, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 15390, 17816, 29460, 6, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 7220, 62, 23317, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 27830, 11, 2205, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 15390, 13, 1136, 10786, 8692, 62, 15390, 3256, 10148, 737, 437, 2032, 342, 7, 7206, 28882, 1961, 62, 12564, 5777, 10426, 828, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1288, 361, 468, 62, 15390, 62, 4906, 7, 15390, 62, 4906, 11, 705, 13247, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 422, 4755, 71, 80, 13, 18211, 13, 18417, 13, 33571, 13, 24896, 1330, 5312, 13247, 25341, 7680, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 13247, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 15390, 17816, 3672, 6, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5312, 13247, 25341, 7680, 13, 6371, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 27830, 11, 2205, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 41357, 62, 33678, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1288, 361, 468, 62, 15390, 62, 4906, 7, 15390, 62, 4906, 11, 705, 43961, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2205, 17816, 271, 62, 45380, 9442, 20520, 290, 2205, 17816, 30271, 6, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19016, 3672, 796, 705, 16302, 62, 10951, 6, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19016, 3672, 796, 705, 27830, 62, 35487, 62, 10951, 6, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 43961, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 15390, 17816, 3672, 6, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19016, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 86, 22046, 34758, 6, 27830, 6, 1058, 2205, 17816, 3672, 20520, 92, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 41357, 62, 33678, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1288, 361, 468, 62, 15390, 62, 4906, 7, 15390, 62, 4906, 11, 705, 14749, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 422, 4755, 71, 80, 13, 18211, 13, 17946, 602, 13, 33571, 1330, 5312, 14749, 7680, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 14749, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 15390, 17816, 3672, 6, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5312, 14749, 7680, 13, 6371, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 27830, 11, 2205, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 41357, 62, 33678, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 41357, 62, 33678, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 2205, 62, 10951, 13, 312, 796, 2205, 62, 312, 198, 220, 220, 220, 2205, 62, 10951, 13, 27830, 796, 7386, 198, 220, 220, 220, 2205, 62, 10951, 13, 4906, 796, 2205, 62, 4906, 628, 220, 220, 220, 611, 12940, 25, 198, 220, 220, 220, 220, 220, 220, 220, 12940, 58, 15390, 62, 312, 60, 796, 2205, 62, 10951, 628, 220, 220, 220, 1441, 2205, 62, 10951, 628, 198, 4299, 651, 62, 15252, 62, 10951, 7, 26801, 11, 12940, 28, 14202, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 2163, 318, 5292, 284, 17438, 655, 588, 651, 62, 15390, 62, 10951, 11, 691, 198, 220, 220, 220, 345, 869, 340, 351, 5563, 584, 621, 48225, 34165, 357, 10508, 355, 5563, 198, 220, 220, 220, 326, 779, 262, 37770, 6375, 44, 737, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1398, 62, 3672, 796, 26181, 13, 834, 4871, 834, 13, 834, 3672, 834, 198, 220, 220, 220, 12940, 62, 2539, 796, 705, 4, 82, 12, 4, 82, 6, 4064, 357, 4871, 62, 3672, 11, 26181, 13, 79, 74, 8, 198, 220, 220, 220, 611, 12940, 290, 12940, 62, 2539, 287, 12940, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 12940, 58, 23870, 62, 2539, 60, 628, 220, 220, 220, 422, 4755, 71, 80, 13, 18211, 13, 17946, 602, 13, 27530, 1330, 49747, 3069, 5040, 198, 220, 220, 220, 611, 318, 39098, 7, 26801, 11, 49747, 3069, 5040, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 422, 4755, 71, 80, 13, 18211, 13, 17946, 602, 13, 33571, 1330, 5312, 14749, 7680, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 62, 13812, 28, 62, 10786, 14749, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3359, 28, 26801, 13, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2792, 28, 50188, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5312, 14749, 7680, 13, 6371, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26498, 41888, 26801, 13, 27830, 11, 26181, 13, 24886, 62, 312, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2205, 62, 10951, 796, 14432, 12360, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 2934, 33342, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 2205, 62, 10951, 13, 312, 796, 965, 7, 26801, 13, 79, 74, 8, 198, 220, 220, 220, 2205, 62, 10951, 13, 27830, 796, 26181, 13, 27830, 611, 468, 35226, 7, 26801, 11, 705, 27830, 11537, 2073, 6045, 198, 220, 220, 220, 2205, 62, 10951, 13, 4906, 796, 1398, 62, 3672, 628, 220, 220, 220, 611, 12940, 25, 198, 220, 220, 220, 220, 220, 220, 220, 12940, 58, 23870, 62, 2539, 60, 796, 2205, 62, 10951, 628, 220, 220, 220, 1441, 2205, 62, 10951, 198 ]
1.980237
3,036
import argparse import sys # import assemble import disassemble import sutil parser = argparse.ArgumentParser( description='The Lida assembler service for Lua', allow_abbrev=True ) # Argument groups action = parser.add_mutually_exclusive_group() g_assembler = parser.add_argument_group('assembler') g_disassembler = parser.add_argument_group('disassembler') output = parser.add_argument_group('output') where = output.add_mutually_exclusive_group() action.add_argument( '-a', '--assemble', action='store_true', help='assemble a file into bytecode' ) action.add_argument( '-d', '--disassemble', action='store_true', help='disassemble a file into listing' ) parser.add_argument( '-v', '--verbose', action='store_true', help='show debug information' ) # Disassembler g_disassembler.add_argument( '-C', '--comments', action='store_true', help='show comments on complex instructions' ) g_disassembler.add_argument( '-L', '--nolines', action='store_true', help='hide line info behind instructions' ) g_disassembler.add_argument( '-I', '--inlconsts', action='store_true', help='inlines use of constants in instructions' ) g_disassembler.add_argument( '-J', '--smartjumps', action='store_true', help='simplify labels for unoptimized JMPs' ) # Output stuff where.add_argument( '-o', '--output', type=str, metavar='file', default='lida.out', help='set the output file for assembly and disassembly (default: lida.out)' ) where.add_argument( '-e', '--echo', action='store_true', help='outputs to stdout instead of a file' ) output.add_argument( 'files', type=str, nargs='+', help='file names to load' ) arg_list = parser.parse_args() if arg_list.assemble: raise NotImplementedError("Assembler is not yet implemented") # process = assemble.process_query elif arg_list.disassemble: process = disassemble.process_query else: process = None # silence warning parser.error('expected a mode') output = get_out_file(arg_list) timer = sutil.LightTimer() process(output, arg_list) if output != sys.stdout: output.close() if arg_list.verbose: print(f"Finished in {timer.pretty()}")
[ 11748, 1822, 29572, 198, 11748, 25064, 198, 198, 2, 1330, 25432, 198, 11748, 595, 292, 15140, 198, 11748, 264, 22602, 628, 198, 198, 48610, 796, 1822, 29572, 13, 28100, 1713, 46677, 7, 198, 197, 11213, 11639, 464, 406, 3755, 11156, 1754, 2139, 329, 43316, 3256, 198, 197, 12154, 62, 397, 4679, 85, 28, 17821, 198, 8, 198, 198, 2, 45751, 2628, 198, 2673, 796, 30751, 13, 2860, 62, 21973, 935, 62, 41195, 62, 8094, 3419, 198, 70, 62, 34455, 1754, 796, 30751, 13, 2860, 62, 49140, 62, 8094, 10786, 34455, 1754, 11537, 198, 70, 62, 6381, 34455, 1754, 796, 30751, 13, 2860, 62, 49140, 62, 8094, 10786, 6381, 34455, 1754, 11537, 198, 22915, 796, 30751, 13, 2860, 62, 49140, 62, 8094, 10786, 22915, 11537, 198, 3003, 796, 5072, 13, 2860, 62, 21973, 935, 62, 41195, 62, 8094, 3419, 198, 198, 2673, 13, 2860, 62, 49140, 7, 198, 197, 29001, 64, 3256, 705, 438, 292, 15140, 3256, 198, 197, 2673, 11639, 8095, 62, 7942, 3256, 198, 197, 16794, 11639, 292, 15140, 257, 2393, 656, 18022, 8189, 6, 198, 8, 198, 198, 2673, 13, 2860, 62, 49140, 7, 198, 197, 29001, 67, 3256, 705, 438, 6381, 292, 15140, 3256, 198, 197, 2673, 11639, 8095, 62, 7942, 3256, 198, 197, 16794, 11639, 6381, 292, 15140, 257, 2393, 656, 13487, 6, 198, 8, 198, 198, 48610, 13, 2860, 62, 49140, 7, 198, 197, 29001, 85, 3256, 705, 438, 19011, 577, 3256, 198, 197, 2673, 11639, 8095, 62, 7942, 3256, 198, 197, 16794, 11639, 12860, 14257, 1321, 6, 198, 8, 198, 198, 2, 3167, 34455, 1754, 198, 70, 62, 6381, 34455, 1754, 13, 2860, 62, 49140, 7, 198, 197, 29001, 34, 3256, 705, 438, 15944, 3256, 198, 197, 2673, 11639, 8095, 62, 7942, 3256, 198, 197, 16794, 11639, 12860, 3651, 319, 3716, 7729, 6, 198, 8, 198, 198, 70, 62, 6381, 34455, 1754, 13, 2860, 62, 49140, 7, 198, 197, 29001, 43, 3256, 705, 438, 77, 349, 1127, 3256, 198, 197, 2673, 11639, 8095, 62, 7942, 3256, 198, 197, 16794, 11639, 24717, 1627, 7508, 2157, 7729, 6, 198, 8, 198, 198, 70, 62, 6381, 34455, 1754, 13, 2860, 62, 49140, 7, 198, 197, 29001, 40, 3256, 705, 438, 259, 75, 1102, 6448, 3256, 198, 197, 2673, 11639, 8095, 62, 7942, 3256, 198, 197, 16794, 11639, 259, 6615, 779, 286, 38491, 287, 7729, 6, 198, 8, 198, 198, 70, 62, 6381, 34455, 1754, 13, 2860, 62, 49140, 7, 198, 197, 29001, 41, 3256, 705, 438, 27004, 73, 8142, 3256, 198, 197, 2673, 11639, 8095, 62, 7942, 3256, 198, 197, 16794, 11639, 14323, 489, 1958, 14722, 329, 555, 40085, 1143, 449, 7378, 82, 6, 198, 8, 198, 198, 2, 25235, 3404, 198, 3003, 13, 2860, 62, 49140, 7, 198, 197, 29001, 78, 3256, 705, 438, 22915, 3256, 198, 197, 4906, 28, 2536, 11, 198, 197, 4164, 615, 283, 11639, 7753, 3256, 198, 197, 12286, 11639, 75, 3755, 13, 448, 3256, 198, 197, 16794, 11639, 2617, 262, 5072, 2393, 329, 10474, 290, 595, 41873, 357, 12286, 25, 300, 3755, 13, 448, 33047, 198, 8, 198, 198, 3003, 13, 2860, 62, 49140, 7, 198, 197, 29001, 68, 3256, 705, 438, 30328, 3256, 198, 197, 2673, 11639, 8095, 62, 7942, 3256, 198, 197, 16794, 11639, 22915, 82, 284, 14367, 448, 2427, 286, 257, 2393, 6, 198, 8, 198, 198, 22915, 13, 2860, 62, 49140, 7, 198, 197, 6, 16624, 3256, 198, 197, 4906, 28, 2536, 11, 198, 197, 77, 22046, 11639, 10, 3256, 198, 197, 16794, 11639, 7753, 3891, 284, 3440, 6, 198, 8, 198, 198, 853, 62, 4868, 796, 30751, 13, 29572, 62, 22046, 3419, 198, 198, 361, 1822, 62, 4868, 13, 292, 15140, 25, 198, 197, 40225, 1892, 3546, 1154, 12061, 12331, 7203, 1722, 4428, 1754, 318, 407, 1865, 9177, 4943, 198, 197, 2, 1429, 796, 25432, 13, 14681, 62, 22766, 198, 417, 361, 1822, 62, 4868, 13, 6381, 292, 15140, 25, 198, 197, 14681, 796, 595, 292, 15140, 13, 14681, 62, 22766, 198, 17772, 25, 198, 197, 14681, 796, 6045, 220, 1303, 9550, 6509, 198, 197, 48610, 13, 18224, 10786, 40319, 257, 4235, 11537, 198, 198, 22915, 796, 651, 62, 448, 62, 7753, 7, 853, 62, 4868, 8, 198, 45016, 796, 264, 22602, 13, 15047, 48801, 3419, 198, 14681, 7, 22915, 11, 1822, 62, 4868, 8, 198, 198, 361, 5072, 14512, 25064, 13, 19282, 448, 25, 198, 197, 22915, 13, 19836, 3419, 198, 198, 361, 1822, 62, 4868, 13, 19011, 577, 25, 198, 197, 4798, 7, 69, 1, 18467, 1348, 287, 1391, 45016, 13, 37784, 3419, 92, 4943, 198 ]
2.823138
752
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from textwrap import dedent import pytest from pants.backend.go.target_types import GoModTarget, GoPackageTarget from pants.backend.go.util_rules import go_mod, sdk from pants.backend.go.util_rules.go_mod import ( GoModInfo, GoModInfoRequest, OwningGoMod, OwningGoModRequest, ) from pants.build_graph.address import Address from pants.engine.rules import QueryRule from pants.testutil.rule_runner import RuleRunner @pytest.fixture
[ 2, 15069, 33448, 41689, 1628, 20420, 357, 3826, 27342, 9865, 3843, 20673, 13, 9132, 737, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 3826, 38559, 24290, 737, 198, 198, 6738, 11593, 37443, 834, 1330, 37647, 198, 198, 6738, 2420, 37150, 1330, 4648, 298, 198, 198, 11748, 12972, 9288, 198, 198, 6738, 12581, 13, 1891, 437, 13, 2188, 13, 16793, 62, 19199, 1330, 1514, 5841, 21745, 11, 1514, 27813, 21745, 198, 6738, 12581, 13, 1891, 437, 13, 2188, 13, 22602, 62, 38785, 1330, 467, 62, 4666, 11, 264, 34388, 198, 6738, 12581, 13, 1891, 437, 13, 2188, 13, 22602, 62, 38785, 13, 2188, 62, 4666, 1330, 357, 198, 220, 220, 220, 1514, 5841, 12360, 11, 198, 220, 220, 220, 1514, 5841, 12360, 18453, 11, 198, 220, 220, 220, 11744, 278, 5247, 5841, 11, 198, 220, 220, 220, 11744, 278, 5247, 5841, 18453, 11, 198, 8, 198, 6738, 12581, 13, 11249, 62, 34960, 13, 21975, 1330, 17917, 198, 6738, 12581, 13, 18392, 13, 38785, 1330, 43301, 31929, 198, 6738, 12581, 13, 9288, 22602, 13, 25135, 62, 16737, 1330, 14330, 49493, 628, 198, 31, 9078, 9288, 13, 69, 9602, 628, 198 ]
3.217617
193
# @Rexhino_Kovaci # This is an extra exercises that I challenged myself with on Google Kickstart 2020 during the online sessions # This algorithm takes user input and compare the left and right subtree # this would allow us to maintain a sorted list of numbers # this program would check if the tree is balanced between the height of right and left subtree is 1 or 0 # This would print all the properties of the nodes list, order, size, height, properties of our Balanced Search Tree
[ 2, 2488, 47389, 71, 2879, 62, 42, 709, 32009, 198, 2, 770, 318, 281, 3131, 13565, 326, 314, 12827, 3589, 351, 319, 3012, 10279, 9688, 12131, 1141, 262, 2691, 10991, 198, 2, 770, 11862, 2753, 2836, 5128, 290, 8996, 262, 1364, 290, 826, 13284, 631, 198, 2, 428, 561, 1249, 514, 284, 5529, 257, 23243, 1351, 286, 3146, 198, 2, 428, 1430, 561, 2198, 611, 262, 5509, 318, 12974, 1022, 262, 6001, 286, 826, 290, 1364, 13284, 631, 318, 352, 393, 657, 628, 628, 198, 2, 220, 220, 220, 220, 770, 561, 3601, 477, 262, 6608, 286, 262, 13760, 1351, 11, 1502, 11, 2546, 11, 6001, 11, 6608, 286, 674, 38984, 11140, 12200, 628, 628 ]
4.304348
115
# coding: utf8 """ This file contains a set of functional tests designed to check the correct execution of the pipeline and the different functions available in Clinica """ import warnings from os import pardir from test.nonregression.testing_tools import * # Determine location for working_directory warnings.filterwarnings("ignore")
[ 2, 19617, 25, 3384, 69, 23, 198, 198, 37811, 198, 1212, 2393, 4909, 257, 900, 286, 10345, 5254, 3562, 284, 2198, 262, 3376, 9706, 286, 262, 11523, 290, 262, 198, 39799, 5499, 1695, 287, 11834, 3970, 198, 37811, 198, 198, 11748, 14601, 198, 6738, 28686, 1330, 41746, 343, 198, 6738, 1332, 13, 13159, 2301, 2234, 13, 33407, 62, 31391, 1330, 1635, 198, 198, 2, 45559, 3810, 4067, 329, 1762, 62, 34945, 198, 40539, 654, 13, 24455, 40539, 654, 7203, 46430, 4943, 628, 628, 628, 628, 628 ]
4.034884
86
from python_qt_binding import QtCore from python_qt_binding import QtGui from python_qt_binding import QtWidgets from ..core import myutils #def config_removed(self, lpath):
[ 6738, 21015, 62, 39568, 62, 30786, 1330, 33734, 14055, 198, 6738, 21015, 62, 39568, 62, 30786, 1330, 33734, 8205, 72, 198, 6738, 21015, 62, 39568, 62, 30786, 1330, 33734, 54, 312, 11407, 198, 198, 6738, 11485, 7295, 1330, 616, 26791, 628, 628, 220, 220, 220, 1303, 4299, 4566, 62, 2787, 2668, 7, 944, 11, 300, 6978, 2599, 628, 198 ]
3.118644
59
base_path_source = './' base_path_target = '../NC2016/' files = ['concatenated_en2de_dev_de.txt', 'concatenated_en2de_dev_en.txt', 'concatenated_en2de_test_de.txt', 'concatenated_en2de_test_en.txt', 'concatenated_en2de_train_de.txt', 'concatenated_en2de_train_en.txt'] for file_path in files: source_path = base_path_source + file_path target_path = base_path_target + file_path fr = open(source_path, 'r') items = [item for item in fr.read().split('<d>\n') if item] fr.close() fw = open(target_path, 'w') fw.write(''.join(items)) fw.close()
[ 8692, 62, 6978, 62, 10459, 796, 705, 19571, 6, 198, 8692, 62, 6978, 62, 16793, 796, 705, 40720, 7792, 5304, 14, 6, 198, 198, 16624, 796, 37250, 1102, 9246, 268, 515, 62, 268, 17, 2934, 62, 7959, 62, 2934, 13, 14116, 3256, 705, 1102, 9246, 268, 515, 62, 268, 17, 2934, 62, 7959, 62, 268, 13, 14116, 3256, 705, 1102, 9246, 268, 515, 62, 268, 17, 2934, 62, 9288, 62, 2934, 13, 14116, 3256, 705, 1102, 9246, 268, 515, 62, 268, 17, 2934, 62, 9288, 62, 268, 13, 14116, 3256, 705, 1102, 9246, 268, 515, 62, 268, 17, 2934, 62, 27432, 62, 2934, 13, 14116, 3256, 705, 1102, 9246, 268, 515, 62, 268, 17, 2934, 62, 27432, 62, 268, 13, 14116, 20520, 198, 198, 1640, 2393, 62, 6978, 287, 3696, 25, 198, 220, 220, 220, 2723, 62, 6978, 796, 2779, 62, 6978, 62, 10459, 1343, 2393, 62, 6978, 220, 198, 220, 220, 220, 2496, 62, 6978, 796, 2779, 62, 6978, 62, 16793, 1343, 2393, 62, 6978, 198, 220, 220, 220, 1216, 796, 1280, 7, 10459, 62, 6978, 11, 705, 81, 11537, 198, 220, 220, 220, 3709, 796, 685, 9186, 329, 2378, 287, 1216, 13, 961, 22446, 35312, 10786, 27, 67, 29, 59, 77, 11537, 611, 2378, 60, 198, 220, 220, 220, 1216, 13, 19836, 3419, 198, 220, 220, 220, 277, 86, 796, 1280, 7, 16793, 62, 6978, 11, 705, 86, 11537, 198, 220, 220, 220, 277, 86, 13, 13564, 10786, 4458, 22179, 7, 23814, 4008, 198, 220, 220, 220, 277, 86, 13, 19836, 3419, 198, 220, 220, 220, 220 ]
2.243243
259
import sys import os import re if __name__ == "__main__": sys.exit(main())
[ 11748, 25064, 201, 198, 11748, 28686, 201, 198, 11748, 302, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 201, 198, 220, 220, 220, 25064, 13, 37023, 7, 12417, 28955 ]
2.139535
43
"""Library function to build Integrate and fire model with square-pulse spike, as a hybrid system. Robert Clewley, March 2005. """ from __future__ import print_function from PyDSTool import * from time import clock # ---------------------------------------------------------------- # ---------------------------------------------------------------- if __name__=='__main__': # need the __main__ to use above functions as imports for other # scripts without running this part print('-------- IF model test 1') par_args_linear = {'Iapp': 1.3, 'gl': 0.1, 'vl': -67, 'threshval': -65, 'C': 1} par_args_spike = {'splen': 0.75} IFmodel = makeIFneuron('IF_fit', par_args_linear, par_args_spike) icdict = {'v': -80, 'excited': 0} start = clock() print('Computing trajectory...') IFmodel.compute(trajname='onespike', tdata=[0, 60], ics=icdict, verboselevel=0) print('\n... finished in %.3f seconds.\n' % (clock()-start)) IFmodel.set(pars={'Iapp': 1.0, 'threshval': -60}) print('Recomputing trajectory with new params...') IFmodel.compute(trajname='twospike', tdata=[0, 60], ics=icdict) print('Preparing plot') plotData = IFmodel.sample('onespike', dt=0.05) plotData2 = IFmodel.sample('twospike', ['v', 'testaux'], 0.05) plt.ylabel('v, testaux') plt.xlabel('t') vline = plt.plot(plotData['t'], plotData['v']) vline2 = plt.plot(plotData2['t'], plotData2['v']) aline = plt.plot(plotData['t'], plotData['testaux']) print("\nLast point of hybrid trajectory: ") print("IFmodel.getEndPoint('onespike') -->\n", end='') print(IFmodel.getEndPoint('onespike')) print("\nFirst point of hybrid trajectory: ") print("IFmodel.getEndPoint('onespike', 0) -->\n", end='') print(IFmodel.getEndPoint('onespike', 0)) print("Testing IF hybrid model as mapping ...") num_parts = len(IFmodel.getTrajTimePartitions('twospike')) #eventvals = IFmodel('onespike', range(0, num_parts+1), asmap=True) eventvals = IFmodel('twospike', list(range(0, num_parts+1)), asmap=True) for i in range(0,num_parts+1): print("(v, t) at event(%i) = (%.4f, %.4f)" % (i, eventvals(i)('v'), eventvals(i)('t'))) print("\nAlternative access to explicit event info using " + \ "getTrajEvents(trajname) method:\n") evs = IFmodel.getTrajEvents('twospike') evtimes = IFmodel.getTrajEventTimes('onespike') print(evs) assert len(evs['threshold']) == 2, "Problem with hybrid events" assert len(evtimes['threshold']) == 4, "Problem with hybrid events" assert allclose(evtimes['threshold'][3], 54.009, 1e-3), \ "Problem with hybrid events" assert allclose(evs['threshold'][1]['v'], -60, 1e-3), \ "Problem with hybrid events" print("\nDepending on your platform and matplotlib configuration you may need") print(" to execute the plt.show() command to see the plots") # plt.show()
[ 37811, 23377, 2163, 284, 1382, 15995, 4873, 290, 2046, 2746, 351, 6616, 12, 79, 9615, 198, 2777, 522, 11, 355, 257, 14554, 1080, 13, 628, 220, 220, 5199, 3779, 86, 1636, 11, 2805, 5075, 13, 198, 37811, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 6738, 9485, 35, 2257, 970, 1330, 1635, 198, 6738, 640, 1330, 8801, 198, 198, 2, 16529, 628, 628, 198, 2, 16529, 198, 198, 361, 11593, 3672, 834, 855, 6, 834, 12417, 834, 10354, 198, 220, 220, 220, 1303, 761, 262, 11593, 12417, 834, 284, 779, 2029, 5499, 355, 17944, 329, 584, 198, 220, 220, 220, 1303, 14750, 1231, 2491, 428, 636, 198, 220, 220, 220, 3601, 10786, 982, 16876, 2746, 1332, 352, 11537, 628, 220, 220, 220, 1582, 62, 22046, 62, 29127, 796, 1391, 6, 40, 1324, 10354, 352, 13, 18, 11, 705, 4743, 10354, 657, 13, 16, 11, 705, 19279, 10354, 532, 3134, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 400, 3447, 2100, 10354, 532, 2996, 11, 705, 34, 10354, 352, 92, 198, 220, 220, 220, 1582, 62, 22046, 62, 2777, 522, 796, 1391, 6, 22018, 268, 10354, 657, 13, 2425, 92, 628, 220, 220, 220, 16876, 19849, 796, 787, 5064, 710, 44372, 10786, 5064, 62, 11147, 3256, 1582, 62, 22046, 62, 29127, 11, 1582, 62, 22046, 62, 2777, 522, 8, 198, 220, 220, 220, 14158, 11600, 796, 1391, 6, 85, 10354, 532, 1795, 11, 705, 41194, 863, 10354, 657, 92, 628, 220, 220, 220, 923, 796, 8801, 3419, 198, 220, 220, 220, 3601, 10786, 5377, 48074, 22942, 986, 11537, 198, 220, 220, 220, 16876, 19849, 13, 5589, 1133, 7, 9535, 73, 3672, 11639, 1952, 79, 522, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 256, 7890, 41888, 15, 11, 3126, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 873, 28, 291, 11600, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15942, 577, 5715, 28, 15, 8, 198, 220, 220, 220, 3601, 10786, 59, 77, 986, 5201, 287, 4064, 13, 18, 69, 4201, 13, 59, 77, 6, 4064, 357, 15750, 3419, 12, 9688, 4008, 628, 220, 220, 220, 16876, 19849, 13, 2617, 7, 79, 945, 34758, 6, 40, 1324, 10354, 352, 13, 15, 11, 705, 400, 3447, 2100, 10354, 532, 1899, 30072, 198, 220, 220, 220, 3601, 10786, 6690, 296, 48074, 22942, 351, 649, 42287, 986, 11537, 198, 220, 220, 220, 16876, 19849, 13, 5589, 1133, 7, 9535, 73, 3672, 11639, 4246, 2117, 522, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 256, 7890, 41888, 15, 11, 3126, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 873, 28, 291, 11600, 8, 628, 198, 220, 220, 220, 3601, 10786, 37534, 1723, 7110, 11537, 198, 220, 220, 220, 7110, 6601, 796, 16876, 19849, 13, 39873, 10786, 1952, 79, 522, 3256, 288, 83, 28, 15, 13, 2713, 8, 198, 220, 220, 220, 7110, 6601, 17, 796, 16876, 19849, 13, 39873, 10786, 4246, 2117, 522, 3256, 37250, 85, 3256, 705, 9288, 14644, 6, 4357, 657, 13, 2713, 8, 198, 220, 220, 220, 458, 83, 13, 2645, 9608, 10786, 85, 11, 1332, 14644, 11537, 198, 220, 220, 220, 458, 83, 13, 87, 18242, 10786, 83, 11537, 198, 220, 220, 220, 410, 1370, 796, 458, 83, 13, 29487, 7, 29487, 6601, 17816, 83, 6, 4357, 7110, 6601, 17816, 85, 6, 12962, 198, 220, 220, 220, 410, 1370, 17, 796, 458, 83, 13, 29487, 7, 29487, 6601, 17, 17816, 83, 6, 4357, 7110, 6601, 17, 17816, 85, 6, 12962, 198, 220, 220, 220, 435, 500, 796, 458, 83, 13, 29487, 7, 29487, 6601, 17816, 83, 6, 4357, 7110, 6601, 17816, 9288, 14644, 6, 12962, 628, 220, 220, 220, 3601, 7203, 59, 77, 5956, 966, 286, 14554, 22942, 25, 366, 8, 198, 220, 220, 220, 3601, 7203, 5064, 19849, 13, 1136, 12915, 12727, 10786, 1952, 79, 522, 11537, 14610, 59, 77, 1600, 886, 28, 7061, 8, 198, 220, 220, 220, 3601, 7, 5064, 19849, 13, 1136, 12915, 12727, 10786, 1952, 79, 522, 6, 4008, 628, 220, 220, 220, 3601, 7203, 59, 77, 5962, 966, 286, 14554, 22942, 25, 366, 8, 198, 220, 220, 220, 3601, 7203, 5064, 19849, 13, 1136, 12915, 12727, 10786, 1952, 79, 522, 3256, 657, 8, 14610, 59, 77, 1600, 886, 28, 7061, 8, 198, 220, 220, 220, 3601, 7, 5064, 19849, 13, 1136, 12915, 12727, 10786, 1952, 79, 522, 3256, 657, 4008, 628, 220, 220, 220, 3601, 7203, 44154, 16876, 14554, 2746, 355, 16855, 35713, 8, 198, 220, 220, 220, 997, 62, 42632, 796, 18896, 7, 5064, 19849, 13, 1136, 15721, 73, 7575, 7841, 1756, 10786, 4246, 2117, 522, 6, 4008, 198, 220, 220, 220, 1303, 15596, 12786, 796, 16876, 19849, 10786, 1952, 79, 522, 3256, 2837, 7, 15, 11, 997, 62, 42632, 10, 16, 828, 355, 8899, 28, 17821, 8, 198, 220, 220, 220, 1785, 12786, 796, 16876, 19849, 10786, 4246, 2117, 522, 3256, 1351, 7, 9521, 7, 15, 11, 997, 62, 42632, 10, 16, 36911, 355, 8899, 28, 17821, 8, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 15, 11, 22510, 62, 42632, 10, 16, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 7, 85, 11, 256, 8, 379, 1785, 7, 4, 72, 8, 796, 357, 7225, 19, 69, 11, 4064, 13, 19, 69, 16725, 4064, 357, 72, 11, 1785, 12786, 7, 72, 5769, 6, 85, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1785, 12786, 7, 72, 5769, 6, 83, 6, 22305, 198, 220, 220, 220, 3601, 7203, 59, 77, 49788, 1895, 284, 7952, 1785, 7508, 1262, 366, 1343, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 1136, 15721, 73, 37103, 7, 9535, 73, 3672, 8, 2446, 7479, 77, 4943, 198, 220, 220, 220, 819, 82, 796, 16876, 19849, 13, 1136, 15721, 73, 37103, 10786, 4246, 2117, 522, 11537, 198, 220, 220, 220, 819, 22355, 796, 16876, 19849, 13, 1136, 15721, 73, 9237, 28595, 10786, 1952, 79, 522, 11537, 198, 220, 220, 220, 3601, 7, 1990, 82, 8, 198, 220, 220, 220, 6818, 18896, 7, 1990, 82, 17816, 400, 10126, 6, 12962, 6624, 362, 11, 366, 40781, 351, 14554, 2995, 1, 198, 220, 220, 220, 6818, 18896, 7, 1990, 22355, 17816, 400, 10126, 6, 12962, 6624, 604, 11, 366, 40781, 351, 14554, 2995, 1, 198, 220, 220, 220, 6818, 477, 19836, 7, 1990, 22355, 17816, 400, 10126, 6, 7131, 18, 4357, 7175, 13, 28694, 11, 352, 68, 12, 18, 828, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 40781, 351, 14554, 2995, 1, 198, 220, 220, 220, 6818, 477, 19836, 7, 1990, 82, 17816, 400, 10126, 6, 7131, 16, 7131, 6, 85, 6, 4357, 532, 1899, 11, 352, 68, 12, 18, 828, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 40781, 351, 14554, 2995, 1, 628, 220, 220, 220, 3601, 7203, 59, 77, 41156, 319, 534, 3859, 290, 2603, 29487, 8019, 8398, 345, 743, 761, 4943, 198, 220, 220, 220, 3601, 7203, 284, 12260, 262, 458, 83, 13, 12860, 3419, 3141, 284, 766, 262, 21528, 4943, 198, 220, 220, 220, 1303, 458, 83, 13, 12860, 3419, 198 ]
2.376987
1,321
# -*- coding: utf-8 -*- """ Eve Demo ~~~~~~~~ A demostration of a simple API powered by Eve REST API. The live demo is available at eve-demo.herokuapp.com. Please keep in mind that the it is running on Heroku's free tier using a free MongoHQ sandbox, which means that the first request to the service will probably be slow. The database gets a reset every now and then. :copyright: (c) 2016 by Nicola Iarocci. :license: BSD, see LICENSE for more details. """ from eve import Eve app = Eve() @app.route('/hello') if __name__ == '__main__': app.run()
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 198, 220, 220, 220, 12882, 34588, 198, 220, 220, 220, 220, 15116, 628, 220, 220, 220, 317, 1357, 455, 1358, 286, 257, 2829, 7824, 13232, 416, 12882, 30617, 7824, 13, 628, 220, 220, 220, 383, 2107, 13605, 318, 1695, 379, 28001, 12, 9536, 78, 13, 11718, 23063, 1324, 13, 785, 13, 4222, 1394, 287, 2000, 198, 220, 220, 220, 326, 262, 340, 318, 2491, 319, 2332, 11601, 338, 1479, 14249, 1262, 257, 1479, 42591, 41275, 198, 220, 220, 220, 35204, 11, 543, 1724, 326, 262, 717, 2581, 284, 262, 2139, 481, 2192, 198, 220, 220, 220, 307, 3105, 13, 383, 6831, 3011, 257, 13259, 790, 783, 290, 788, 13, 628, 220, 220, 220, 1058, 22163, 4766, 25, 357, 66, 8, 1584, 416, 40396, 314, 283, 420, 979, 13, 198, 220, 220, 220, 1058, 43085, 25, 347, 10305, 11, 766, 38559, 24290, 329, 517, 3307, 13, 198, 37811, 198, 198, 6738, 28001, 1330, 12882, 198, 198, 1324, 796, 12882, 3419, 628, 198, 31, 1324, 13, 38629, 10786, 14, 31373, 11537, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 598, 13, 5143, 3419, 198 ]
2.902913
206
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2019 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Jupyter Notebook previewer.""" from __future__ import absolute_import, unicode_literals import nbformat from flask import render_template from nbconvert import HTMLExporter def render(file): """Generate the result HTML.""" with file.open() as fp: content = fp.read() notebook = nbformat.reads(content.decode('utf-8'), as_version=4) html_exporter = HTMLExporter() html_exporter.template_file = 'basic' (body, resources) = html_exporter.from_notebook_node(notebook) return body, resources def can_preview(file): """Determine if file can be previewed.""" return file.is_local() and file.has_extensions('.ipynb') def preview(file): """Render the IPython Notebook.""" body, resources = render(file) default_jupyter_nb_style = resources['inlining']['css'][1] return render_template( 'invenio_previewer/ipynb.html', file=file, content=body, inline_style=default_jupyter_nb_style )
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 770, 2393, 318, 636, 286, 554, 574, 952, 13, 198, 2, 15069, 357, 34, 8, 1584, 12, 23344, 327, 28778, 13, 198, 2, 198, 2, 554, 574, 952, 318, 1479, 3788, 26, 345, 460, 17678, 4163, 340, 290, 14, 273, 13096, 340, 198, 2, 739, 262, 2846, 286, 262, 17168, 13789, 26, 766, 38559, 24290, 2393, 329, 517, 3307, 13, 198, 198, 37811, 41, 929, 88, 353, 5740, 2070, 12714, 263, 526, 15931, 198, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 11, 28000, 1098, 62, 17201, 874, 198, 198, 11748, 299, 65, 18982, 198, 6738, 42903, 1330, 8543, 62, 28243, 198, 6738, 299, 65, 1102, 1851, 1330, 7154, 44, 2538, 87, 26634, 628, 198, 4299, 8543, 7, 7753, 2599, 198, 220, 220, 220, 37227, 8645, 378, 262, 1255, 11532, 526, 15931, 198, 220, 220, 220, 351, 2393, 13, 9654, 3419, 355, 277, 79, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2695, 796, 277, 79, 13, 961, 3419, 628, 220, 220, 220, 20922, 796, 299, 65, 18982, 13, 40779, 7, 11299, 13, 12501, 1098, 10786, 40477, 12, 23, 33809, 355, 62, 9641, 28, 19, 8, 628, 220, 220, 220, 27711, 62, 1069, 26634, 796, 7154, 44, 2538, 87, 26634, 3419, 198, 220, 220, 220, 27711, 62, 1069, 26634, 13, 28243, 62, 7753, 796, 705, 35487, 6, 198, 220, 220, 220, 357, 2618, 11, 4133, 8, 796, 27711, 62, 1069, 26634, 13, 6738, 62, 11295, 2070, 62, 17440, 7, 11295, 2070, 8, 198, 220, 220, 220, 1441, 1767, 11, 4133, 628, 198, 4299, 460, 62, 3866, 1177, 7, 7753, 2599, 198, 220, 220, 220, 37227, 35, 2357, 3810, 611, 2393, 460, 307, 12714, 276, 526, 15931, 198, 220, 220, 220, 1441, 2393, 13, 271, 62, 12001, 3419, 290, 2393, 13, 10134, 62, 2302, 5736, 7, 4458, 541, 2047, 65, 11537, 628, 198, 4299, 12714, 7, 7753, 2599, 198, 220, 220, 220, 37227, 45819, 262, 6101, 7535, 5740, 2070, 526, 15931, 198, 220, 220, 220, 1767, 11, 4133, 796, 8543, 7, 7753, 8, 198, 220, 220, 220, 4277, 62, 73, 929, 88, 353, 62, 46803, 62, 7635, 796, 4133, 17816, 259, 21310, 6, 7131, 6, 25471, 6, 7131, 16, 60, 198, 220, 220, 220, 1441, 8543, 62, 28243, 7, 198, 220, 220, 220, 220, 220, 220, 220, 705, 259, 574, 952, 62, 3866, 1177, 263, 14, 541, 2047, 65, 13, 6494, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 2393, 28, 7753, 11, 198, 220, 220, 220, 220, 220, 220, 220, 2695, 28, 2618, 11, 198, 220, 220, 220, 220, 220, 220, 220, 26098, 62, 7635, 28, 12286, 62, 73, 929, 88, 353, 62, 46803, 62, 7635, 198, 220, 220, 220, 1267, 198 ]
2.636364
462
#! /usr/bin/python3 import os import math from scipy.interpolate import interp1d N = 100 # number of points of approximation f1 = 'data/exp/M186/p_p0.txt' # data for curve №1 f2 = 'data/theory/M186/upper.xy' # data for curve №2 # x must be first column n1 = 2 # column for curve №1 n2 = 2 # column for curve №2 scale1x = 1 # scale for curve №1 along the x axis scale2x = 1 # scale for curve №2 along the x axis scale1y = 638331.089701564 # scale for curve №1 along the y axis 638331.089701564 scale2y = 1 # scale for curve №2 along the y axis # function of extract of data # find X1 and X2 _f1 = open(f1, 'r') _f2 = open(f2, 'r') for line in _f1: words = line.split() if words[0] == '#': _f1.readline() else: x11 = [float(w) for w in _f1.readline().split()] x12 = [float(w) for w in _f1.readlines()[-1].split()] for line in _f2: words = line.split() if words[0] == '#': _f2.readline() else: x21 = [float(w) for w in _f2.readline().split()] x22 = [float(w) for w in _f2.readlines()[-1].split()] _f1.close() _f2.close() if x11[0]*scale1x > x21[0]*scale2x: x1 = x11[0]*scale1x else: x1 = x21[0]*scale2x if x12[0]*scale1x > x22[0]*scale2x: x2 = x22[0]*scale2x else: x2 = x12[0]*scale1x i = 0 lx = [] for _ in range (N): if i+1 < N: lx.append(x1+(x2-x1)/(N-1)*i) else: lx.append(x2) i+=1 _lx1 = extract_data(f1, 0, scale1x) _lx2 = extract_data(f2, 0, scale2x) _ly1 = extract_data(f1, n1-1, scale1y) _ly2 = extract_data(f2, n2-1, scale2y) ly1_f = interp1d(_lx1, _ly1) #ly2_f = interp1d(_lx2, _ly2) ly1 = ly1_f(lx) #ly2 = ly2_f(lx) z = 0 ly2 = [] for _ in range (N): if z < N/2: ly2.append(_ly2[0]) else: ly2.append(_ly2[3]) z+=1 curv = open('Curves.txt', 'w') j = 0 for _ in range (N): curv.write(str(lx[j]) + '\t') curv.write(str(ly1[j]) + '\t') curv.write(str(ly2[j]) + '\n') j+=1 curv.close() k = 0 dy = [] for _ in range (N): dy_ = (ly1[k]-ly2[k]) dy.append(dy_) k+=1 dys = sum(dy)/N l = 0 sig_i = [] otn_i = [] for _ in range (N): sig_i_=(dy[l]-dys)**2 sig_i.append(sig_i_) otn_i_ = math.fabs(dy[l]/ly1[l])*100 otn_i.append(otn_i_) l+=1 sigma = (sum(sig_i)/N)**0.5 otn = sum(otn_i)/N print('Standard deviation: ', sigma) print('Medium relative precision: ', otn, '%')
[ 2, 0, 1220, 14629, 14, 8800, 14, 29412, 18, 198, 11748, 28686, 198, 11748, 10688, 198, 6738, 629, 541, 88, 13, 3849, 16104, 378, 1330, 987, 79, 16, 67, 198, 198, 45, 796, 1802, 197, 197, 197, 197, 197, 2, 1271, 286, 2173, 286, 40874, 198, 69, 16, 796, 705, 7890, 14, 11201, 14, 44, 25096, 14, 79, 62, 79, 15, 13, 14116, 6, 220, 197, 197, 197, 2, 1366, 329, 12133, 2343, 226, 244, 16, 198, 69, 17, 796, 705, 7890, 14, 1169, 652, 14, 44, 25096, 14, 45828, 13, 5431, 6, 197, 197, 197, 197, 197, 2, 1366, 329, 12133, 2343, 226, 244, 17, 198, 2, 2124, 1276, 307, 717, 5721, 198, 77, 16, 796, 362, 197, 197, 197, 197, 197, 197, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 5721, 329, 12133, 2343, 226, 244, 16, 198, 77, 17, 796, 362, 197, 197, 197, 197, 197, 197, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 5721, 329, 12133, 2343, 226, 244, 17, 198, 9888, 16, 87, 796, 352, 197, 197, 197, 197, 197, 220, 220, 220, 220, 220, 220, 220, 1303, 5046, 329, 12133, 2343, 226, 244, 16, 1863, 262, 2124, 16488, 198, 9888, 17, 87, 796, 352, 197, 197, 197, 197, 197, 220, 220, 220, 220, 220, 220, 220, 1303, 5046, 329, 12133, 2343, 226, 244, 17, 1863, 262, 2124, 16488, 198, 9888, 16, 88, 796, 718, 2548, 31697, 13, 2919, 5607, 25150, 2414, 197, 2, 5046, 329, 12133, 2343, 226, 244, 16, 1863, 262, 331, 16488, 718, 2548, 31697, 13, 2919, 5607, 25150, 2414, 198, 9888, 17, 88, 796, 352, 197, 197, 197, 197, 197, 220, 220, 220, 220, 220, 220, 220, 1303, 5046, 329, 12133, 2343, 226, 244, 17, 1863, 262, 331, 16488, 198, 198, 2, 2163, 286, 7925, 286, 1366, 198, 198, 2, 1064, 1395, 16, 290, 1395, 17, 198, 62, 69, 16, 796, 1280, 7, 69, 16, 11, 705, 81, 11537, 198, 62, 69, 17, 796, 1280, 7, 69, 17, 11, 705, 81, 11537, 198, 1640, 1627, 287, 4808, 69, 16, 25, 198, 220, 220, 220, 2456, 796, 1627, 13, 35312, 3419, 198, 220, 220, 220, 611, 2456, 58, 15, 60, 6624, 705, 2, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 69, 16, 13, 961, 1370, 3419, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2124, 1157, 796, 685, 22468, 7, 86, 8, 329, 266, 287, 4808, 69, 16, 13, 961, 1370, 22446, 35312, 3419, 60, 198, 220, 220, 220, 220, 220, 220, 220, 2124, 1065, 796, 685, 22468, 7, 86, 8, 329, 266, 287, 4808, 69, 16, 13, 961, 6615, 3419, 58, 12, 16, 4083, 35312, 3419, 60, 198, 1640, 1627, 287, 4808, 69, 17, 25, 198, 220, 220, 220, 2456, 796, 1627, 13, 35312, 3419, 198, 220, 220, 220, 611, 2456, 58, 15, 60, 6624, 705, 2, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 69, 17, 13, 961, 1370, 3419, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2124, 2481, 796, 685, 22468, 7, 86, 8, 329, 266, 287, 4808, 69, 17, 13, 961, 1370, 22446, 35312, 3419, 60, 198, 220, 220, 220, 220, 220, 220, 220, 2124, 1828, 796, 685, 22468, 7, 86, 8, 329, 266, 287, 4808, 69, 17, 13, 961, 6615, 3419, 58, 12, 16, 4083, 35312, 3419, 60, 198, 62, 69, 16, 13, 19836, 3419, 198, 62, 69, 17, 13, 19836, 3419, 198, 361, 2124, 1157, 58, 15, 60, 9, 9888, 16, 87, 1875, 2124, 2481, 58, 15, 60, 9, 9888, 17, 87, 25, 198, 197, 87, 16, 796, 2124, 1157, 58, 15, 60, 9, 9888, 16, 87, 198, 17772, 25, 198, 197, 87, 16, 796, 2124, 2481, 58, 15, 60, 9, 9888, 17, 87, 198, 361, 2124, 1065, 58, 15, 60, 9, 9888, 16, 87, 1875, 2124, 1828, 58, 15, 60, 9, 9888, 17, 87, 25, 198, 197, 87, 17, 796, 2124, 1828, 58, 15, 60, 9, 9888, 17, 87, 198, 17772, 25, 198, 197, 87, 17, 796, 2124, 1065, 58, 15, 60, 9, 9888, 16, 87, 198, 198, 72, 796, 657, 198, 75, 87, 796, 17635, 198, 1640, 4808, 287, 2837, 357, 45, 2599, 198, 197, 361, 1312, 10, 16, 1279, 399, 25, 198, 197, 197, 75, 87, 13, 33295, 7, 87, 16, 33747, 87, 17, 12, 87, 16, 20679, 7, 45, 12, 16, 27493, 72, 8, 198, 197, 17772, 25, 198, 197, 197, 75, 87, 13, 33295, 7, 87, 17, 8, 198, 197, 72, 47932, 16, 198, 62, 75, 87, 16, 796, 7925, 62, 7890, 7, 69, 16, 11, 657, 11, 5046, 16, 87, 8, 198, 62, 75, 87, 17, 796, 7925, 62, 7890, 7, 69, 17, 11, 657, 11, 5046, 17, 87, 8, 198, 62, 306, 16, 796, 7925, 62, 7890, 7, 69, 16, 11, 299, 16, 12, 16, 11, 5046, 16, 88, 8, 198, 62, 306, 17, 796, 7925, 62, 7890, 7, 69, 17, 11, 299, 17, 12, 16, 11, 5046, 17, 88, 8, 198, 306, 16, 62, 69, 796, 987, 79, 16, 67, 28264, 75, 87, 16, 11, 4808, 306, 16, 8, 198, 2, 306, 17, 62, 69, 796, 987, 79, 16, 67, 28264, 75, 87, 17, 11, 4808, 306, 17, 8, 198, 306, 16, 796, 22404, 16, 62, 69, 7, 75, 87, 8, 198, 2, 306, 17, 796, 22404, 17, 62, 69, 7, 75, 87, 8, 198, 89, 796, 657, 198, 306, 17, 796, 17635, 198, 1640, 4808, 287, 2837, 357, 45, 2599, 198, 197, 361, 1976, 1279, 399, 14, 17, 25, 198, 197, 197, 306, 17, 13, 33295, 28264, 306, 17, 58, 15, 12962, 198, 197, 17772, 25, 198, 197, 197, 306, 17, 13, 33295, 28264, 306, 17, 58, 18, 12962, 198, 197, 89, 47932, 16, 198, 22019, 85, 796, 1280, 10786, 26628, 1158, 13, 14116, 3256, 705, 86, 11537, 198, 73, 796, 657, 198, 1640, 4808, 287, 2837, 357, 45, 2599, 198, 220, 220, 220, 46171, 13, 13564, 7, 2536, 7, 75, 87, 58, 73, 12962, 1343, 705, 59, 83, 11537, 198, 220, 220, 220, 46171, 13, 13564, 7, 2536, 7, 306, 16, 58, 73, 12962, 1343, 705, 59, 83, 11537, 198, 220, 220, 220, 46171, 13, 13564, 7, 2536, 7, 306, 17, 58, 73, 12962, 1343, 705, 59, 77, 11537, 198, 220, 220, 220, 474, 47932, 16, 198, 22019, 85, 13, 19836, 3419, 198, 198, 74, 796, 657, 198, 9892, 796, 17635, 198, 1640, 4808, 287, 2837, 357, 45, 2599, 198, 220, 220, 220, 20268, 62, 796, 357, 306, 16, 58, 74, 45297, 306, 17, 58, 74, 12962, 198, 220, 220, 220, 20268, 13, 33295, 7, 9892, 62, 8, 198, 220, 220, 220, 479, 47932, 16, 198, 67, 893, 796, 2160, 7, 9892, 20679, 45, 198, 75, 796, 657, 198, 82, 328, 62, 72, 796, 17635, 198, 313, 77, 62, 72, 796, 17635, 198, 1640, 4808, 287, 2837, 357, 45, 2599, 198, 220, 220, 220, 43237, 62, 72, 62, 16193, 9892, 58, 75, 45297, 67, 893, 8, 1174, 17, 198, 220, 220, 220, 43237, 62, 72, 13, 33295, 7, 82, 328, 62, 72, 62, 8, 198, 220, 220, 220, 30972, 77, 62, 72, 62, 796, 10688, 13, 69, 8937, 7, 9892, 58, 75, 60, 14, 306, 16, 58, 75, 12962, 9, 3064, 198, 220, 220, 220, 30972, 77, 62, 72, 13, 33295, 7, 313, 77, 62, 72, 62, 8, 198, 220, 220, 220, 300, 47932, 16, 198, 82, 13495, 796, 357, 16345, 7, 82, 328, 62, 72, 20679, 45, 8, 1174, 15, 13, 20, 198, 313, 77, 796, 2160, 7, 313, 77, 62, 72, 20679, 45, 198, 4798, 10786, 23615, 28833, 25, 46083, 264, 13495, 8, 198, 4798, 10786, 31205, 3585, 15440, 25, 46083, 30972, 77, 11, 705, 4, 11537, 198 ]
1.854701
1,287
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc import netaddr from oslo_db import exception from oslo_db.sqlalchemy import test_base from oslo_utils import timeutils from oslo_utils import uuidutils import six import sqlalchemy as sa from neutron import context from neutron.db import sqlalchemytypes from neutron.tests import tools @six.add_metaclass(abc.ABCMeta)
[ 2, 220, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 220, 220, 220, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 921, 743, 7330, 198, 2, 220, 220, 220, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 220, 220, 220, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 220, 220, 220, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 42881, 198, 2, 220, 220, 220, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 4091, 262, 198, 2, 220, 220, 220, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 11247, 198, 2, 220, 220, 220, 739, 262, 13789, 13, 198, 198, 11748, 450, 66, 198, 11748, 2010, 29851, 198, 198, 6738, 28686, 5439, 62, 9945, 1330, 6631, 198, 6738, 28686, 5439, 62, 9945, 13, 25410, 282, 26599, 1330, 1332, 62, 8692, 198, 6738, 28686, 5439, 62, 26791, 1330, 640, 26791, 198, 6738, 28686, 5439, 62, 26791, 1330, 334, 27112, 26791, 198, 11748, 2237, 198, 11748, 44161, 282, 26599, 355, 473, 198, 198, 6738, 49810, 1330, 4732, 198, 6738, 49810, 13, 9945, 1330, 44161, 282, 26599, 19199, 198, 6738, 49810, 13, 41989, 1330, 4899, 628, 198, 31, 19412, 13, 2860, 62, 4164, 330, 31172, 7, 39305, 13, 24694, 48526, 8, 628, 628, 198 ]
3.37037
270
# coding=UTF-8 from scout.server.app import create_app from scout.server.extensions import cloud_tracks def test_align_handler_public_tracks(igv_test_tracks): """Test The class creating cloud tracks with public tracks""" # GIVEN app config settings with a custom cloud public track config = dict(CLOUD_IGV_TRACKS=igv_test_tracks) # THEN the initialized app should create a cloud_tracks extension app = create_app(config=config) # Contanining the public track assert cloud_tracks.public_tracks["37"][0]["name"] == "Test public track"
[ 2, 19617, 28, 48504, 12, 23, 198, 6738, 24490, 13, 15388, 13, 1324, 1330, 2251, 62, 1324, 198, 6738, 24490, 13, 15388, 13, 2302, 5736, 1330, 6279, 62, 46074, 628, 198, 4299, 1332, 62, 31494, 62, 30281, 62, 11377, 62, 46074, 7, 328, 85, 62, 9288, 62, 46074, 2599, 198, 220, 220, 220, 37227, 14402, 383, 1398, 4441, 6279, 8339, 351, 1171, 8339, 37811, 198, 220, 220, 220, 1303, 402, 3824, 1677, 598, 4566, 6460, 351, 257, 2183, 6279, 1171, 2610, 198, 220, 220, 220, 4566, 796, 8633, 7, 5097, 2606, 35, 62, 3528, 53, 62, 5446, 8120, 50, 28, 328, 85, 62, 9288, 62, 46074, 8, 198, 220, 220, 220, 1303, 42243, 262, 23224, 598, 815, 2251, 257, 6279, 62, 46074, 7552, 198, 220, 220, 220, 598, 796, 2251, 62, 1324, 7, 11250, 28, 11250, 8, 628, 220, 220, 220, 1303, 2345, 272, 3191, 262, 1171, 2610, 198, 220, 220, 220, 6818, 6279, 62, 46074, 13, 11377, 62, 46074, 14692, 2718, 1, 7131, 15, 7131, 1, 3672, 8973, 6624, 366, 14402, 1171, 2610, 1, 198 ]
3.204545
176
from regene.expression import Expression, Quantifier
[ 6738, 842, 1734, 13, 38011, 1330, 41986, 11, 16972, 7483, 628 ]
4.909091
11
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Microsoft Public License. A # copy of the license can be found in the License.html file at the root of this distribution. If # you cannot locate the Microsoft Public License, please send an email to # [email protected]. By using this source code in any fashion, you are agreeing to be bound # by the terms of the Microsoft Public License. # # You must not remove this notice, or any other, from this software. # # ##################################################################################### ''' Delegate * How the delegate is defined? - Different signatures (return type, argument list, params, params dictionary, ref/out args) - Generic delegate type * Instantiation - With static/Instance (variable or literal) CLR method on value type/reference type, * When Type.Method has overloads * No match or more than one matching method found. * Type|Instance (dot) StaticMethod|InstanceMethod - Another delegate * Type compatible, or not * Pri 2: it might be interesting to support some "light-weight coercion" here where compatible delegates cast w/o new code gen. It's a feature, but just adding some minimal tests of coercible delegates would be interesting. For example a delegate object foo(subclass a) could have a otherclass bar(baseclass a) cast to it - such conversions should be implicit. - Others: * a type, indexer, field, operator, property, NULL * interface.Method, ...? * Language function/methods - Possible need for type conversion * Static type should not be in the signature - C# reference: http://msdn2.microsoft.com/en-us/library/aa691347(VS.71).aspx * Operations on delegate - +, +=, -, -= * Add the same method multiple times * Removing once - the last occurrence is the one actually removed * Removing the same method multiple times * Impossible removal is benign * Becomes empty invocation list after removing. - invocation * call expression, __call__, "Invoke" - other wild operations Event * Where it is defined - Interface * How it is defined - Add only, remove only, different accessibility / modifiers - Static or instance - Explicit event from interface * Operations on Type|object (dot) (Static|Intance) Event - +=, -=, =, Add/Remove (?) * The choices of the right side: * delegate, method, others * compatible, not compatible * (python) __add__, __iadd__, __sub__, __isub__ direct calls - call operator, explicit "invoke"? - Other operations: * Use it as the right-hand operand somewhere else? '''
[ 29113, 29113, 14468, 4242, 2, 198, 2, 198, 2, 220, 15069, 357, 66, 8, 5413, 10501, 13, 1439, 2489, 10395, 13, 198, 2, 198, 2, 770, 2723, 2438, 318, 2426, 284, 2846, 290, 3403, 286, 262, 5413, 5094, 13789, 13, 317, 198, 2, 4866, 286, 262, 5964, 460, 307, 1043, 287, 262, 13789, 13, 6494, 2393, 379, 262, 6808, 286, 428, 6082, 13, 1002, 198, 2, 345, 2314, 17276, 262, 220, 5413, 5094, 13789, 11, 3387, 3758, 281, 3053, 284, 198, 2, 6953, 9078, 31, 40485, 13, 785, 13, 2750, 1262, 428, 2723, 2438, 287, 597, 6977, 11, 345, 389, 24093, 284, 307, 5421, 198, 2, 416, 262, 2846, 286, 262, 5413, 5094, 13789, 13, 198, 2, 198, 2, 921, 1276, 407, 4781, 428, 4003, 11, 393, 597, 584, 11, 422, 428, 3788, 13, 198, 2, 198, 2, 198, 29113, 29113, 14468, 4242, 2, 198, 198, 7061, 6, 198, 5005, 34637, 198, 9, 1374, 262, 23191, 318, 5447, 30, 198, 220, 532, 20615, 17239, 357, 7783, 2099, 11, 4578, 1351, 11, 42287, 11, 220, 198, 220, 220, 220, 42287, 22155, 11, 1006, 14, 448, 26498, 8, 198, 220, 532, 42044, 23191, 2099, 220, 198, 198, 9, 24470, 3920, 198, 220, 532, 2080, 9037, 14, 33384, 357, 45286, 393, 18875, 8, 49896, 2446, 319, 1988, 2099, 14, 35790, 220, 198, 220, 220, 220, 2099, 11, 220, 198, 220, 220, 220, 1635, 1649, 5994, 13, 17410, 468, 31754, 82, 198, 220, 220, 220, 1635, 1400, 2872, 393, 517, 621, 530, 12336, 2446, 1043, 13, 198, 220, 220, 220, 1635, 5994, 91, 33384, 357, 26518, 8, 36125, 17410, 91, 33384, 17410, 198, 220, 532, 6023, 23191, 198, 220, 220, 220, 1635, 5994, 11670, 11, 393, 407, 198, 9, 4389, 362, 25, 340, 1244, 307, 3499, 284, 1104, 617, 366, 2971, 12, 6551, 32000, 1, 994, 220, 198, 220, 810, 11670, 15265, 3350, 266, 14, 78, 649, 2438, 2429, 13, 220, 632, 338, 257, 3895, 11, 475, 655, 220, 198, 220, 4375, 617, 10926, 5254, 286, 24029, 856, 15265, 561, 307, 3499, 13, 220, 1114, 220, 198, 220, 1672, 257, 23191, 2134, 22944, 7, 7266, 4871, 257, 8, 714, 423, 257, 584, 4871, 2318, 7, 8692, 4871, 257, 8, 220, 198, 220, 3350, 284, 340, 532, 884, 32626, 815, 307, 16992, 13, 198, 220, 532, 12691, 25, 220, 198, 220, 220, 220, 1635, 257, 2099, 11, 6376, 263, 11, 2214, 11, 10088, 11, 3119, 11, 15697, 198, 220, 220, 220, 1635, 7071, 13, 17410, 11, 2644, 30, 198, 220, 220, 220, 1635, 15417, 2163, 14, 24396, 82, 198, 220, 532, 33671, 761, 329, 2099, 11315, 198, 220, 220, 220, 1635, 36125, 2099, 815, 407, 307, 287, 262, 9877, 198, 220, 532, 327, 2, 4941, 25, 2638, 1378, 907, 32656, 17, 13, 40485, 13, 785, 14, 268, 12, 385, 14, 32016, 14, 7252, 3388, 1485, 2857, 7, 20304, 13, 4869, 737, 31740, 220, 198, 9, 16205, 319, 23191, 220, 198, 220, 532, 1343, 11, 15853, 11, 532, 11, 48185, 198, 220, 220, 220, 1635, 3060, 262, 976, 2446, 3294, 1661, 198, 9, 3982, 5165, 1752, 532, 262, 938, 19810, 318, 262, 530, 1682, 4615, 198, 220, 220, 220, 1635, 3982, 5165, 262, 976, 2446, 3294, 1661, 220, 198, 9, 38791, 9934, 318, 32293, 198, 220, 220, 220, 1635, 15780, 2586, 6565, 43219, 1351, 706, 10829, 13, 198, 220, 532, 43219, 198, 220, 220, 220, 1635, 869, 5408, 11, 11593, 13345, 834, 11, 366, 19904, 2088, 1, 198, 220, 532, 584, 4295, 4560, 198, 198, 9237, 220, 198, 9, 6350, 340, 318, 5447, 198, 220, 532, 26491, 198, 9, 1374, 340, 318, 5447, 198, 220, 532, 3060, 691, 11, 4781, 691, 11, 1180, 28969, 1220, 37395, 198, 220, 532, 36125, 393, 4554, 198, 220, 532, 11884, 1785, 422, 7071, 198, 9, 16205, 319, 5994, 91, 15252, 357, 26518, 8, 357, 45442, 91, 5317, 590, 8, 8558, 198, 220, 532, 15853, 11, 48185, 11, 796, 11, 3060, 14, 27914, 357, 10091, 198, 220, 220, 220, 1635, 383, 7747, 286, 262, 826, 1735, 25, 220, 198, 9, 23191, 11, 2446, 11, 1854, 198, 9, 11670, 11, 407, 11670, 220, 220, 198, 220, 220, 220, 1635, 357, 29412, 8, 11593, 2860, 834, 11, 11593, 72, 2860, 834, 11, 11593, 7266, 834, 11, 11593, 271, 549, 834, 1277, 3848, 198, 220, 532, 869, 10088, 11, 7952, 366, 37669, 13984, 198, 220, 532, 3819, 4560, 25, 198, 220, 220, 220, 1635, 5765, 340, 355, 262, 826, 12, 4993, 1515, 392, 7382, 2073, 30, 198, 7061, 6, 198 ]
3.729223
746
# Generated by Django 2.2.6 on 2019-10-21 11:10 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone
[ 2, 2980, 515, 416, 37770, 362, 13, 17, 13, 21, 319, 13130, 12, 940, 12, 2481, 1367, 25, 940, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 42625, 14208, 13, 9945, 13, 27530, 13, 2934, 1616, 295, 198, 11748, 42625, 14208, 13, 26791, 13, 2435, 11340, 628 ]
3.04918
61
"""Utilities Azure IoT Edge utilities. functions: is_edge: depends is edge or not inference_module_url: get inference_module_url """ import logging from azure.iot.device import IoTHubModuleClient logger = logging.getLogger(__name__) def is_edge() -> bool: """is_edge. Args: Returns: is_edge -> bool """ try: IoTHubModuleClient.create_from_edge_environment() return True except: return False def inference_module_url() -> str: """inference_module_url. Args: Returns: str: inference_module_url """ if is_edge(): return "172.18.0.1:5000" return "localhost:5000"
[ 37811, 18274, 2410, 198, 198, 26903, 495, 38488, 13113, 20081, 13, 198, 198, 12543, 2733, 25, 198, 220, 220, 220, 318, 62, 14907, 25, 8338, 318, 5743, 393, 407, 198, 220, 220, 220, 32278, 62, 21412, 62, 6371, 25, 651, 32278, 62, 21412, 62, 6371, 198, 37811, 198, 198, 11748, 18931, 198, 198, 6738, 35560, 495, 13, 5151, 13, 25202, 1330, 27853, 4221, 549, 26796, 11792, 198, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 198, 4299, 318, 62, 14907, 3419, 4613, 20512, 25, 198, 220, 220, 220, 37227, 271, 62, 14907, 13, 628, 220, 220, 220, 943, 14542, 25, 628, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 318, 62, 14907, 4613, 20512, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 27853, 4221, 549, 26796, 11792, 13, 17953, 62, 6738, 62, 14907, 62, 38986, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 198, 220, 220, 220, 2845, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 628, 198, 4299, 32278, 62, 21412, 62, 6371, 3419, 4613, 965, 25, 198, 220, 220, 220, 37227, 259, 4288, 62, 21412, 62, 6371, 13, 628, 220, 220, 220, 943, 14542, 25, 628, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 965, 25, 32278, 62, 21412, 62, 6371, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 611, 318, 62, 14907, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 366, 23628, 13, 1507, 13, 15, 13, 16, 25, 27641, 1, 198, 220, 220, 220, 1441, 366, 36750, 25, 27641, 1, 198 ]
2.400709
282
import smart_imports smart_imports.all()
[ 198, 11748, 4451, 62, 320, 3742, 198, 198, 27004, 62, 320, 3742, 13, 439, 3419, 628 ]
2.75
16
""" Writes strings containing the rate parameters """ # Functions to write the parameters in the correct format def troe(reaction, high_params, low_params, troe_params, colliders=(), ea_units='kcal/mol'): """ Write the string containing the Lindemann fitting parameters formatted for ChemKin input files. :param reaction: ChemKin formatted string with chemical equation :type reaction: str :param high_params: Arrhenius Fitting Parameters used for high-P :type high_params: list(float) :param low_params: Arrhenius Fitting Parameters used for low-P :type low_params: list(float) :param troe_params: Troe alpha, T1, T2, and T3 fitting parameters :type troe_params: list(float) :param colliders: names and collision enhancement factors for bath spc :type colliders: list((str, float)) :return troe_str: ChemKin reaction string with Troe parameters :rtype: str """ if ea_units == 'kcal/mol': ea_factor = 1000 elif ea_units == 'cal/mol': ea_factor = 1 else: raise InputError(f"The units for Ea must be either 'kcal/mol' or 'cal/mol' but were input as {ea_units}") assert len(high_params) == 3 assert len(low_params) == 3 assert len(troe_params) in (3, 4) [high_a, high_n, high_ea] = high_params # Write reaction header (with third body added) and high-pressure params reaction = _format_rxn_str_for_pdep(reaction, pressure='all') troe_str = '{0:<32s}{1:>10.3E}{2:>9.3f}{3:9.0f} /\n'.format( reaction, high_a, high_n, ea_factor*high_ea) # Write the collider efficiencies string if colliders: troe_str += _format_collider_string(colliders) # Now write the low-pressure and Troe params troe_str += _format_params_string('LOW', low_params, newline=True) troe_str += _format_params_string('TROE', troe_params, newline=False) return troe_str def lindemann(reaction, high_params, low_params, colliders=(), ea_units='kcal/mol'): """ Write the string containing the Lindemann fitting parameters formatted for ChemKin input files :param reaction: ChemKin formatted string with chemical equation :type reaction: str :param high_params: Arrhenius Fitting Parameters used for high-P :type high_params: list(float) :param low_params: Arrhenius Fitting Parameters used for low-P :type low_params: list(float) :param colliders: names and collision enhancement factors for bath spc :type colliders: list((str, float)) :return lind_str: ChemKin reaction string with Lindemann parameters :rtype: str """ if ea_units == 'kcal/mol': ea_factor = 1000 elif ea_units == 'cal/mol': ea_factor = 1 else: raise InputError(f"The units for Ea must be either 'kcal/mol' or 'cal/mol' but were input as {ea_units}") [high_a, high_n, high_ea] = high_params # Write reaction header (with third body added) and high-pressure params reaction = _format_rxn_str_for_pdep(reaction, pressure='low') lind_str = '{0:<32s}{1:>10.3E}{2:>9.3f}{3:9.0f} /\n'.format( reaction, high_a, high_n, ea_factor*high_ea) # Write the collider efficiencies string if colliders: lind_str += _format_collider_string(colliders) # Now write the low-pressure and Troe params lind_str += _format_params_string('LOW', low_params, newline=False) return lind_str def plog(reaction, rate_params_dct, temp_dct=None, err_dct=None): """ Write the string containing the PLOG fitting parameters formatted for ChemKin input files. :param reaction: ChemKin formatted string with chemical equation :type reaction: str :param rate_params_dct: Arrhenius fitting parameters at each pressure :type rate_params_dct: dict[pressure: [rate params]] :param temp_dct: temperature ranges for fits at each pressure :type temp_dct: dict[pressure: [temps]] :param err_dct: mean and max ftting errors at each pressure :type err_dct: dict[pressure: [errs]] :return plog_str: ChemKin reaction string with PLOG parameters :rtype: str """ # Find nparams and ensure there are correct num in each dct entry nparams = len(next(iter(rate_params_dct.values()))) assert nparams in (3, 6) assert all(len(params) == nparams for params in rate_params_dct.values()) # Obtain a list of the pressures and sort from low to high pressure pressures = [pressure for pressure in rate_params_dct.keys() if pressure != 'high'] pressures.sort() # Add fake high pressure parameters if they are not in the dictionary if 'high' not in rate_params_dct: if nparams == 3: rate_params_dct['high'] = [1.00, 0.00, 0.00] elif nparams == 6: rate_params_dct['high'] = [1.00, 0.00, 0.00, 1.00, 0.00, 0.00] # Build the reaction string with high-pressure params and any plog params # Loop will build second ('DUPLICATE') section if double fit performed p_str = '' for i in range(nparams // 3): if i == 1: p_str += 'DUPLICATE\n' # Build the initial string with the reaction and high-pressure params high_a, high_n, high_ea = rate_params_dct['high'][3*i:3*i+3] p_str += '{0:<32s}{1:>10.3E}{2:>9.3f}{3:9.0f} /\n'.format( reaction, high_a, high_n, 1000*high_ea) # Build the PLOG string for each pressure, other than the HighP Limit for pressure in pressures: pdep_a, pdep_n, pdep_ea = rate_params_dct[pressure][3*i:3*i+3] p_str += '{0:>18s} /{1:>10.3f} '.format( 'PLOG', float(pressure)) p_str += '{0:>10.3E}{1:>9.3f}{2:9.0f} /\n'.format( pdep_a, pdep_n, 1000*pdep_ea) # Write string showing the temp fit range and fit errors if temp_dct or err_dct: p_str += _fit_info_str(pressures, temp_dct, err_dct) return p_str def chebyshev(reaction, high_params, alpha, tmin, tmax, pmin, pmax): """ Write the string containing the Chebyshev fitting parameters formatted for ChemKin input files. :param reaction: ChemKin formatted string with chemical equation :type reaction: str :param high_params: Arrhenius Fitting Parameters used for high-P :type high_params: list(float) :param alpha: Chebyshev coefficient matrix :type alpha: numpy.ndarray :param tmin: minimum temperature Chebyshev model is defined :type tmin: float :param tmax: maximum temperature Chebyshev model is defined :type tmax: float :param pmin: minimum pressure Chebyshev model is defined :type pmin: float :return cheb_str: ChemKin reaction string with Chebyshev parameters :rtype: str """ assert len(high_params) == 3 # assert alpha mat is a 2d matrix [high_a, high_n, high_ea] = high_params # Write reaction header (with third body added) and high-pressure params reaction = _format_rxn_str_for_pdep(reaction, pressure='all') cheb_str = '{0:<32s}{1:>10.3E}{2:>9.3f}{3:9.0f} /\n'.format( reaction, high_a, high_n, 1000*high_ea) # Write the temperature and pressure ranges cheb_str += _format_params_string('TCHEB', (tmin, tmax), newline=True) cheb_str += _format_params_string('PCHEB', (pmin, pmax), newline=True) # Write the dimensions of the alpha matrix nrows = len(alpha) ncols = len(alpha[0]) cheb_str += '{0:>10s}/ {1:d} {2:d}\n'.format('CHEB', nrows, ncols) # Write the parameters from the alpha matrix for idx, row in enumerate(alpha): newline = bool(idx+1 != nrows) cheb_str += _format_params_string('CHEB', row, newline=newline) return cheb_str # Various formatting functions def _fit_info_str(pressures, temp_dct, err_dct): """ Write the string detailing the temperature ranges and fitting errors associated with the rate-constant fits at each pressure. :param pressures: pressures the k(T,P)s were calculated at :type pressures: list(float) :param temp_dct: temperature ranges (K) fits were done at each pressure :type temp_dct: dict[pressure, [temp range]] :param err_dct: errors associated with the fits at each pressure :type err_dct: dict[pressure, [mean err, max err]] :return inf_str: string containing all of the fitting info :rtype: str """ # Make temp, err dcts empty if fxn receives None; add 'high' to pressures temp_dct = temp_dct if temp_dct else {} err_dct = err_dct if err_dct else {} if 'high' in temp_dct or 'high' in err_dct: pressures += ['high'] # Check the temp and err dcts have same presures as rate_dcts if temp_dct: assert set(pressures) == set(temp_dct.keys()) err_dct = err_dct if err_dct else {} if err_dct: assert set(pressures) == set(err_dct.keys()) # Write string showing the temp fit range and fit errors inf_str = '! Info Regarding Rate Constant Fits\n' for pressure in pressures: if temp_dct: [min_temp, max_temp] = temp_dct[pressure] temps_str = '{0:.0f}-{1:.0f} K'.format( min_temp, max_temp) temp_range_str = 'Temps: {0:>12s}, '.format( temps_str) else: temp_range_str = '' if err_dct: [mean_err, max_err] = err_dct[pressure] err_str = '{0:11s} {1:>5.1f}%, {2:7s} {3:>5.1f}%'.format( 'MeanAbsErr:', mean_err, 'MaxErr:', max_err) else: err_str = '' # Put together the who info string if pressure != 'high': pstr = '{0:<9.3f}'.format(pressure) else: pstr = '{0:<9s}'.format('High') inf_str += '! Pressure: {0} {1} {2}\n'.format( pstr, temp_range_str, err_str) return inf_str def _format_rxn_str_for_pdep(reaction, pressure='all'): """ Add the bath gas M species to the reaction string for pressure dependent reactions in the appropriate format. :param reaction: chemical equation for the reaction :type reaction: str :param pressure: signifies the level of pressure dependence :type pressure: str :return: three_body_reaction: chemical equation with M body :rtype: str """ # Determine format of M string to be added to reaction string assert pressure in ('low', 'all') if pressure == 'all': m_str = ' (+M)' else: m_str = ' + M' # Add the M string to both sides of the reaction string [lhs, rhs] = reaction.split('=') three_body_reaction = lhs + m_str + ' = ' + rhs + m_str return three_body_reaction def _format_collider_string(colliders): """ Write the string for the bath gas collider and their efficiencies for the Lindemann and Troe functional expressions: :param colliders: :type colliders: list(str) :return: collider_str: ChemKin-format string with colliders :rtype: str """ collider_str = ''.join( ('{0:s}/{1:4.3f}/ '.format(collider[0], collider[1]) for collider in colliders)) collider_str += '\n' return collider_str def _format_params_string(header, params, newline=False): """ Write a string containing fitting params used for several functional forms. :param header: name of functional form the parameters correspond to :type header: str :param params: fitting parameters :type params: list(float) :param newline: signals whether to add a newline :type newline: bool :return: params_str: string containing the parameters :rtype: str """ params_str = '{0:>10s}/ '.format(header.upper()) params_str += ''.join(('{0:12.3E}'.format(param) for param in params)) params_str += ' /' if newline: params_str += '\n' return params_str def _format_rxn_name(rxn_key): """ Receives a rxn key from a param_dct and writes it to a string that the above functions can handle. """ rcts = rxn_key[0] prds = rxn_key[1] for idx, rct in enumerate(rcts): if idx == 0: rct_str = rct else: rct_str += '+' + rct for idx, prd in enumerate(prds): if idx == 0: prd_str = prd else: prd_str += '+' + prd rxn_name = rct_str + '=' + prd_str return rxn_name
[ 37811, 198, 20257, 274, 13042, 7268, 262, 2494, 10007, 198, 37811, 628, 198, 2, 40480, 284, 3551, 262, 10007, 287, 262, 3376, 5794, 198, 4299, 4161, 68, 7, 260, 2673, 11, 1029, 62, 37266, 11, 1877, 62, 37266, 11, 4161, 68, 62, 37266, 11, 2927, 4157, 16193, 828, 304, 64, 62, 41667, 11639, 74, 9948, 14, 43132, 6, 2599, 198, 220, 220, 220, 37227, 19430, 262, 4731, 7268, 262, 9329, 368, 1236, 15830, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 39559, 329, 12870, 49681, 5128, 3696, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 6317, 25, 12870, 49681, 39559, 4731, 351, 5931, 16022, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 6317, 25, 965, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1029, 62, 37266, 25, 943, 81, 831, 3754, 376, 2535, 40117, 973, 329, 1029, 12, 47, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 1029, 62, 37266, 25, 1351, 7, 22468, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1877, 62, 37266, 25, 943, 81, 831, 3754, 376, 2535, 40117, 973, 329, 1877, 12, 47, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 1877, 62, 37266, 25, 1351, 7, 22468, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 4161, 68, 62, 37266, 25, 8498, 68, 17130, 11, 309, 16, 11, 309, 17, 11, 290, 309, 18, 15830, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 4161, 68, 62, 37266, 25, 1351, 7, 22468, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 2927, 4157, 25, 3891, 290, 17661, 28554, 5087, 329, 7837, 599, 66, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 2927, 4157, 25, 1351, 19510, 2536, 11, 12178, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 4161, 68, 62, 2536, 25, 12870, 49681, 6317, 4731, 351, 8498, 68, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 965, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 304, 64, 62, 41667, 6624, 705, 74, 9948, 14, 43132, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 304, 64, 62, 31412, 796, 8576, 198, 220, 220, 220, 1288, 361, 304, 64, 62, 41667, 6624, 705, 9948, 14, 43132, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 304, 64, 62, 31412, 796, 352, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 23412, 12331, 7, 69, 1, 464, 4991, 329, 412, 64, 1276, 307, 2035, 705, 74, 9948, 14, 43132, 6, 393, 705, 9948, 14, 43132, 6, 475, 547, 5128, 355, 1391, 18213, 62, 41667, 92, 4943, 628, 220, 220, 220, 6818, 18896, 7, 8929, 62, 37266, 8, 6624, 513, 198, 220, 220, 220, 6818, 18896, 7, 9319, 62, 37266, 8, 6624, 513, 198, 220, 220, 220, 6818, 18896, 7, 83, 20646, 62, 37266, 8, 287, 357, 18, 11, 604, 8, 628, 220, 220, 220, 685, 8929, 62, 64, 11, 1029, 62, 77, 11, 1029, 62, 18213, 60, 796, 1029, 62, 37266, 628, 220, 220, 220, 1303, 19430, 6317, 13639, 357, 4480, 2368, 1767, 2087, 8, 290, 1029, 12, 36151, 42287, 198, 220, 220, 220, 6317, 796, 4808, 18982, 62, 40914, 77, 62, 2536, 62, 1640, 62, 79, 10378, 7, 260, 2673, 11, 3833, 11639, 439, 11537, 198, 220, 220, 220, 4161, 68, 62, 2536, 796, 705, 90, 15, 25, 27, 2624, 82, 18477, 16, 25, 29, 940, 13, 18, 36, 18477, 17, 25, 29, 24, 13, 18, 69, 18477, 18, 25, 24, 13, 15, 69, 92, 1220, 59, 77, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 6317, 11, 1029, 62, 64, 11, 1029, 62, 77, 11, 304, 64, 62, 31412, 9, 8929, 62, 18213, 8, 628, 220, 220, 220, 1303, 19430, 262, 2927, 1304, 4396, 22139, 4731, 198, 220, 220, 220, 611, 2927, 4157, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4161, 68, 62, 2536, 15853, 4808, 18982, 62, 26000, 1304, 62, 8841, 7, 26000, 4157, 8, 628, 220, 220, 220, 1303, 2735, 3551, 262, 1877, 12, 36151, 290, 8498, 68, 42287, 198, 220, 220, 220, 4161, 68, 62, 2536, 15853, 4808, 18982, 62, 37266, 62, 8841, 10786, 43, 3913, 3256, 1877, 62, 37266, 11, 649, 1370, 28, 17821, 8, 198, 220, 220, 220, 4161, 68, 62, 2536, 15853, 4808, 18982, 62, 37266, 62, 8841, 10786, 5446, 27799, 3256, 4161, 68, 62, 37266, 11, 649, 1370, 28, 25101, 8, 628, 220, 220, 220, 1441, 4161, 68, 62, 2536, 628, 198, 4299, 300, 521, 368, 1236, 7, 260, 2673, 11, 1029, 62, 37266, 11, 1877, 62, 37266, 11, 2927, 4157, 16193, 828, 304, 64, 62, 41667, 11639, 74, 9948, 14, 43132, 6, 2599, 198, 220, 220, 220, 37227, 19430, 262, 4731, 7268, 262, 9329, 368, 1236, 15830, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 39559, 329, 12870, 49681, 5128, 3696, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 6317, 25, 12870, 49681, 39559, 4731, 351, 5931, 16022, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 6317, 25, 965, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1029, 62, 37266, 25, 943, 81, 831, 3754, 376, 2535, 40117, 973, 329, 1029, 12, 47, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 1029, 62, 37266, 25, 1351, 7, 22468, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1877, 62, 37266, 25, 943, 81, 831, 3754, 376, 2535, 40117, 973, 329, 1877, 12, 47, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 1877, 62, 37266, 25, 1351, 7, 22468, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 2927, 4157, 25, 3891, 290, 17661, 28554, 5087, 329, 7837, 599, 66, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 2927, 4157, 25, 1351, 19510, 2536, 11, 12178, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 300, 521, 62, 2536, 25, 12870, 49681, 6317, 4731, 351, 9329, 368, 1236, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 965, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 304, 64, 62, 41667, 6624, 705, 74, 9948, 14, 43132, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 304, 64, 62, 31412, 796, 8576, 198, 220, 220, 220, 1288, 361, 304, 64, 62, 41667, 6624, 705, 9948, 14, 43132, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 304, 64, 62, 31412, 796, 352, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 23412, 12331, 7, 69, 1, 464, 4991, 329, 412, 64, 1276, 307, 2035, 705, 74, 9948, 14, 43132, 6, 393, 705, 9948, 14, 43132, 6, 475, 547, 5128, 355, 1391, 18213, 62, 41667, 92, 4943, 628, 220, 220, 220, 685, 8929, 62, 64, 11, 1029, 62, 77, 11, 1029, 62, 18213, 60, 796, 1029, 62, 37266, 628, 220, 220, 220, 1303, 19430, 6317, 13639, 357, 4480, 2368, 1767, 2087, 8, 290, 1029, 12, 36151, 42287, 198, 220, 220, 220, 6317, 796, 4808, 18982, 62, 40914, 77, 62, 2536, 62, 1640, 62, 79, 10378, 7, 260, 2673, 11, 3833, 11639, 9319, 11537, 198, 220, 220, 220, 300, 521, 62, 2536, 796, 705, 90, 15, 25, 27, 2624, 82, 18477, 16, 25, 29, 940, 13, 18, 36, 18477, 17, 25, 29, 24, 13, 18, 69, 18477, 18, 25, 24, 13, 15, 69, 92, 1220, 59, 77, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 6317, 11, 1029, 62, 64, 11, 1029, 62, 77, 11, 304, 64, 62, 31412, 9, 8929, 62, 18213, 8, 628, 220, 220, 220, 1303, 19430, 262, 2927, 1304, 4396, 22139, 4731, 198, 220, 220, 220, 611, 2927, 4157, 25, 198, 220, 220, 220, 220, 220, 220, 220, 300, 521, 62, 2536, 15853, 4808, 18982, 62, 26000, 1304, 62, 8841, 7, 26000, 4157, 8, 628, 220, 220, 220, 1303, 2735, 3551, 262, 1877, 12, 36151, 290, 8498, 68, 42287, 198, 220, 220, 220, 300, 521, 62, 2536, 15853, 4808, 18982, 62, 37266, 62, 8841, 10786, 43, 3913, 3256, 1877, 62, 37266, 11, 649, 1370, 28, 25101, 8, 628, 220, 220, 220, 1441, 300, 521, 62, 2536, 628, 198, 4299, 458, 519, 7, 260, 2673, 11, 2494, 62, 37266, 62, 67, 310, 11, 20218, 62, 67, 310, 28, 14202, 11, 11454, 62, 67, 310, 28, 14202, 2599, 198, 220, 220, 220, 37227, 19430, 262, 4731, 7268, 262, 9297, 7730, 15830, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 39559, 329, 12870, 49681, 5128, 3696, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 6317, 25, 12870, 49681, 39559, 4731, 351, 5931, 16022, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 6317, 25, 965, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 2494, 62, 37266, 62, 67, 310, 25, 943, 81, 831, 3754, 15830, 10007, 379, 1123, 3833, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 2494, 62, 37266, 62, 67, 310, 25, 8633, 58, 36151, 25, 685, 4873, 42287, 11907, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 20218, 62, 67, 310, 25, 5951, 16069, 329, 11414, 379, 1123, 3833, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 20218, 62, 67, 310, 25, 8633, 58, 36151, 25, 685, 11498, 862, 11907, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 11454, 62, 67, 310, 25, 1612, 290, 3509, 10117, 889, 8563, 379, 1123, 3833, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 11454, 62, 67, 310, 25, 8633, 58, 36151, 25, 685, 263, 3808, 11907, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 458, 519, 62, 2536, 25, 12870, 49681, 6317, 4731, 351, 9297, 7730, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 965, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 1303, 9938, 299, 37266, 290, 4155, 612, 389, 3376, 997, 287, 1123, 288, 310, 5726, 198, 220, 220, 220, 299, 37266, 796, 18896, 7, 19545, 7, 2676, 7, 4873, 62, 37266, 62, 67, 310, 13, 27160, 3419, 22305, 198, 220, 220, 220, 6818, 299, 37266, 287, 357, 18, 11, 718, 8, 198, 220, 220, 220, 6818, 477, 7, 11925, 7, 37266, 8, 6624, 299, 37266, 329, 42287, 287, 2494, 62, 37266, 62, 67, 310, 13, 27160, 28955, 628, 220, 220, 220, 1303, 1835, 3153, 257, 1351, 286, 262, 18895, 290, 3297, 422, 1877, 284, 1029, 3833, 198, 220, 220, 220, 18895, 796, 685, 36151, 329, 3833, 287, 2494, 62, 37266, 62, 67, 310, 13, 13083, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 3833, 14512, 705, 8929, 20520, 198, 220, 220, 220, 18895, 13, 30619, 3419, 628, 220, 220, 220, 1303, 3060, 8390, 1029, 3833, 10007, 611, 484, 389, 407, 287, 262, 22155, 198, 220, 220, 220, 611, 705, 8929, 6, 407, 287, 2494, 62, 37266, 62, 67, 310, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 299, 37266, 6624, 513, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2494, 62, 37266, 62, 67, 310, 17816, 8929, 20520, 796, 685, 16, 13, 405, 11, 657, 13, 405, 11, 657, 13, 405, 60, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 299, 37266, 6624, 718, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2494, 62, 37266, 62, 67, 310, 17816, 8929, 20520, 796, 685, 16, 13, 405, 11, 657, 13, 405, 11, 657, 13, 405, 11, 352, 13, 405, 11, 657, 13, 405, 11, 657, 13, 405, 60, 628, 220, 220, 220, 1303, 10934, 262, 6317, 4731, 351, 1029, 12, 36151, 42287, 290, 597, 458, 519, 42287, 198, 220, 220, 220, 1303, 26304, 481, 1382, 1218, 19203, 35, 52, 31484, 6158, 11537, 2665, 611, 4274, 4197, 6157, 198, 220, 220, 220, 279, 62, 2536, 796, 10148, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 77, 37266, 3373, 513, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1312, 6624, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 279, 62, 2536, 15853, 705, 35, 52, 31484, 6158, 59, 77, 6, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 10934, 262, 4238, 4731, 351, 262, 6317, 290, 1029, 12, 36151, 42287, 198, 220, 220, 220, 220, 220, 220, 220, 1029, 62, 64, 11, 1029, 62, 77, 11, 1029, 62, 18213, 796, 2494, 62, 37266, 62, 67, 310, 17816, 8929, 6, 7131, 18, 9, 72, 25, 18, 9, 72, 10, 18, 60, 198, 220, 220, 220, 220, 220, 220, 220, 279, 62, 2536, 15853, 705, 90, 15, 25, 27, 2624, 82, 18477, 16, 25, 29, 940, 13, 18, 36, 18477, 17, 25, 29, 24, 13, 18, 69, 18477, 18, 25, 24, 13, 15, 69, 92, 1220, 59, 77, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6317, 11, 1029, 62, 64, 11, 1029, 62, 77, 11, 8576, 9, 8929, 62, 18213, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 10934, 262, 9297, 7730, 4731, 329, 1123, 3833, 11, 584, 621, 262, 3334, 47, 27272, 198, 220, 220, 220, 220, 220, 220, 220, 329, 3833, 287, 18895, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 279, 10378, 62, 64, 11, 279, 10378, 62, 77, 11, 279, 10378, 62, 18213, 796, 2494, 62, 37266, 62, 67, 310, 58, 36151, 7131, 18, 9, 72, 25, 18, 9, 72, 10, 18, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 279, 62, 2536, 15853, 705, 90, 15, 25, 29, 1507, 82, 92, 1220, 90, 16, 25, 29, 940, 13, 18, 69, 92, 220, 45302, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 6489, 7730, 3256, 12178, 7, 36151, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 279, 62, 2536, 15853, 705, 90, 15, 25, 29, 940, 13, 18, 36, 18477, 16, 25, 29, 24, 13, 18, 69, 18477, 17, 25, 24, 13, 15, 69, 92, 1220, 59, 77, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 279, 10378, 62, 64, 11, 279, 10378, 62, 77, 11, 8576, 9, 79, 10378, 62, 18213, 8, 628, 220, 220, 220, 1303, 19430, 4731, 4478, 262, 20218, 4197, 2837, 290, 4197, 8563, 198, 220, 220, 220, 611, 20218, 62, 67, 310, 393, 11454, 62, 67, 310, 25, 198, 220, 220, 220, 220, 220, 220, 220, 279, 62, 2536, 15853, 4808, 11147, 62, 10951, 62, 2536, 7, 8439, 942, 11, 20218, 62, 67, 310, 11, 11454, 62, 67, 310, 8, 628, 220, 220, 220, 1441, 279, 62, 2536, 628, 198, 4299, 1125, 48209, 258, 85, 7, 260, 2673, 11, 1029, 62, 37266, 11, 17130, 11, 256, 1084, 11, 256, 9806, 11, 279, 1084, 11, 9114, 897, 2599, 198, 220, 220, 220, 37227, 19430, 262, 4731, 7268, 262, 2580, 48209, 258, 85, 15830, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 39559, 329, 12870, 49681, 5128, 3696, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 6317, 25, 12870, 49681, 39559, 4731, 351, 5931, 16022, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 6317, 25, 965, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 1029, 62, 37266, 25, 943, 81, 831, 3754, 376, 2535, 40117, 973, 329, 1029, 12, 47, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 1029, 62, 37266, 25, 1351, 7, 22468, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 17130, 25, 2580, 48209, 258, 85, 35381, 17593, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 17130, 25, 299, 32152, 13, 358, 18747, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 256, 1084, 25, 5288, 5951, 2580, 48209, 258, 85, 2746, 318, 5447, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 256, 1084, 25, 12178, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 256, 9806, 25, 5415, 5951, 2580, 48209, 258, 85, 2746, 318, 5447, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 256, 9806, 25, 12178, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 279, 1084, 25, 5288, 3833, 2580, 48209, 258, 85, 2746, 318, 5447, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 279, 1084, 25, 12178, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 1125, 65, 62, 2536, 25, 12870, 49681, 6317, 4731, 351, 2580, 48209, 258, 85, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 965, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6818, 18896, 7, 8929, 62, 37266, 8, 6624, 513, 198, 220, 220, 220, 1303, 6818, 17130, 2603, 318, 257, 362, 67, 17593, 628, 220, 220, 220, 685, 8929, 62, 64, 11, 1029, 62, 77, 11, 1029, 62, 18213, 60, 796, 1029, 62, 37266, 628, 220, 220, 220, 1303, 19430, 6317, 13639, 357, 4480, 2368, 1767, 2087, 8, 290, 1029, 12, 36151, 42287, 198, 220, 220, 220, 6317, 796, 4808, 18982, 62, 40914, 77, 62, 2536, 62, 1640, 62, 79, 10378, 7, 260, 2673, 11, 3833, 11639, 439, 11537, 198, 220, 220, 220, 1125, 65, 62, 2536, 796, 705, 90, 15, 25, 27, 2624, 82, 18477, 16, 25, 29, 940, 13, 18, 36, 18477, 17, 25, 29, 24, 13, 18, 69, 18477, 18, 25, 24, 13, 15, 69, 92, 1220, 59, 77, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 6317, 11, 1029, 62, 64, 11, 1029, 62, 77, 11, 8576, 9, 8929, 62, 18213, 8, 628, 220, 220, 220, 1303, 19430, 262, 5951, 290, 3833, 16069, 198, 220, 220, 220, 1125, 65, 62, 2536, 15853, 4808, 18982, 62, 37266, 62, 8841, 10786, 51, 3398, 30195, 3256, 357, 83, 1084, 11, 256, 9806, 828, 649, 1370, 28, 17821, 8, 198, 220, 220, 220, 1125, 65, 62, 2536, 15853, 4808, 18982, 62, 37266, 62, 8841, 10786, 47, 3398, 30195, 3256, 357, 79, 1084, 11, 9114, 897, 828, 649, 1370, 28, 17821, 8, 628, 220, 220, 220, 1303, 19430, 262, 15225, 286, 262, 17130, 17593, 198, 220, 220, 220, 299, 8516, 796, 18896, 7, 26591, 8, 198, 220, 220, 220, 299, 4033, 82, 796, 18896, 7, 26591, 58, 15, 12962, 198, 220, 220, 220, 1125, 65, 62, 2536, 15853, 705, 90, 15, 25, 29, 940, 82, 92, 14, 220, 220, 220, 1391, 16, 25, 67, 92, 1391, 17, 25, 67, 32239, 77, 4458, 18982, 10786, 3398, 30195, 3256, 299, 8516, 11, 299, 4033, 82, 8, 628, 220, 220, 220, 1303, 19430, 262, 10007, 422, 262, 17130, 17593, 198, 220, 220, 220, 329, 4686, 87, 11, 5752, 287, 27056, 378, 7, 26591, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 649, 1370, 796, 20512, 7, 312, 87, 10, 16, 14512, 299, 8516, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1125, 65, 62, 2536, 15853, 4808, 18982, 62, 37266, 62, 8841, 10786, 3398, 30195, 3256, 5752, 11, 649, 1370, 28, 3605, 1370, 8, 628, 220, 220, 220, 1441, 1125, 65, 62, 2536, 628, 198, 2, 26386, 33313, 5499, 198, 4299, 4808, 11147, 62, 10951, 62, 2536, 7, 8439, 942, 11, 20218, 62, 67, 310, 11, 11454, 62, 67, 310, 2599, 198, 220, 220, 220, 37227, 19430, 262, 4731, 22976, 262, 5951, 16069, 290, 15830, 8563, 198, 220, 220, 220, 220, 220, 220, 220, 3917, 351, 262, 2494, 12, 9979, 415, 11414, 379, 1123, 3833, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 18895, 25, 18895, 262, 479, 7, 51, 11, 47, 8, 82, 547, 10488, 379, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 18895, 25, 1351, 7, 22468, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 20218, 62, 67, 310, 25, 5951, 16069, 357, 42, 8, 11414, 547, 1760, 379, 1123, 3833, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 20218, 62, 67, 310, 25, 8633, 58, 36151, 11, 685, 29510, 2837, 11907, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 11454, 62, 67, 310, 25, 8563, 3917, 351, 262, 11414, 379, 1123, 3833, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 11454, 62, 67, 310, 25, 8633, 58, 36151, 11, 685, 32604, 11454, 11, 3509, 11454, 11907, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 1167, 62, 2536, 25, 4731, 7268, 477, 286, 262, 15830, 7508, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 965, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 1303, 6889, 20218, 11, 11454, 288, 310, 82, 6565, 611, 277, 87, 77, 11583, 6045, 26, 751, 705, 8929, 6, 284, 18895, 198, 220, 220, 220, 20218, 62, 67, 310, 796, 20218, 62, 67, 310, 611, 20218, 62, 67, 310, 2073, 23884, 198, 220, 220, 220, 11454, 62, 67, 310, 796, 11454, 62, 67, 310, 611, 11454, 62, 67, 310, 2073, 23884, 198, 220, 220, 220, 611, 705, 8929, 6, 287, 20218, 62, 67, 310, 393, 705, 8929, 6, 287, 11454, 62, 67, 310, 25, 198, 220, 220, 220, 220, 220, 220, 220, 18895, 15853, 37250, 8929, 20520, 628, 220, 220, 220, 1303, 6822, 262, 20218, 290, 11454, 288, 310, 82, 423, 976, 906, 942, 355, 2494, 62, 67, 310, 82, 198, 220, 220, 220, 611, 20218, 62, 67, 310, 25, 198, 220, 220, 220, 220, 220, 220, 220, 6818, 900, 7, 8439, 942, 8, 6624, 900, 7, 29510, 62, 67, 310, 13, 13083, 28955, 198, 220, 220, 220, 11454, 62, 67, 310, 796, 11454, 62, 67, 310, 611, 11454, 62, 67, 310, 2073, 23884, 198, 220, 220, 220, 611, 11454, 62, 67, 310, 25, 198, 220, 220, 220, 220, 220, 220, 220, 6818, 900, 7, 8439, 942, 8, 6624, 900, 7, 8056, 62, 67, 310, 13, 13083, 28955, 628, 220, 220, 220, 1303, 19430, 4731, 4478, 262, 20218, 4197, 2837, 290, 4197, 8563, 198, 220, 220, 220, 1167, 62, 2536, 796, 705, 0, 14151, 38687, 14806, 20217, 376, 896, 59, 77, 6, 198, 220, 220, 220, 329, 3833, 287, 18895, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 20218, 62, 67, 310, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 1084, 62, 29510, 11, 3509, 62, 29510, 60, 796, 20218, 62, 67, 310, 58, 36151, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2169, 862, 62, 2536, 796, 705, 90, 15, 25, 13, 15, 69, 92, 12, 90, 16, 25, 13, 15, 69, 92, 509, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 949, 62, 29510, 11, 3509, 62, 29510, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20218, 62, 9521, 62, 2536, 796, 705, 12966, 862, 25, 1391, 15, 25, 29, 1065, 82, 5512, 45302, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2169, 862, 62, 2536, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20218, 62, 9521, 62, 2536, 796, 10148, 198, 220, 220, 220, 220, 220, 220, 220, 611, 11454, 62, 67, 310, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 32604, 62, 8056, 11, 3509, 62, 8056, 60, 796, 11454, 62, 67, 310, 58, 36151, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11454, 62, 2536, 796, 705, 90, 15, 25, 1157, 82, 92, 1391, 16, 25, 29, 20, 13, 16, 69, 92, 7441, 220, 1391, 17, 25, 22, 82, 92, 1391, 18, 25, 29, 20, 13, 16, 69, 92, 4, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 5308, 272, 24849, 9139, 81, 25, 3256, 1612, 62, 8056, 11, 705, 11518, 9139, 81, 25, 3256, 3509, 62, 8056, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11454, 62, 2536, 796, 10148, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 5930, 1978, 262, 508, 7508, 4731, 198, 220, 220, 220, 220, 220, 220, 220, 611, 3833, 14512, 705, 8929, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 279, 2536, 796, 705, 90, 15, 25, 27, 24, 13, 18, 69, 92, 4458, 18982, 7, 36151, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 279, 2536, 796, 705, 90, 15, 25, 27, 24, 82, 92, 4458, 18982, 10786, 11922, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 1167, 62, 2536, 15853, 705, 0, 30980, 25, 1391, 15, 92, 1391, 16, 92, 1391, 17, 32239, 77, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 279, 2536, 11, 20218, 62, 9521, 62, 2536, 11, 11454, 62, 2536, 8, 628, 220, 220, 220, 1441, 1167, 62, 2536, 628, 198, 4299, 4808, 18982, 62, 40914, 77, 62, 2536, 62, 1640, 62, 79, 10378, 7, 260, 2673, 11, 3833, 11639, 439, 6, 2599, 198, 220, 220, 220, 37227, 3060, 262, 7837, 3623, 337, 4693, 284, 262, 6317, 4731, 329, 198, 220, 220, 220, 220, 220, 220, 220, 3833, 10795, 12737, 287, 262, 5035, 5794, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 6317, 25, 5931, 16022, 329, 262, 6317, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 6317, 25, 965, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 3833, 25, 43854, 262, 1241, 286, 3833, 21403, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 3833, 25, 965, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 1115, 62, 2618, 62, 260, 2673, 25, 5931, 16022, 351, 337, 1767, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 965, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 45559, 3810, 5794, 286, 337, 4731, 284, 307, 2087, 284, 6317, 4731, 198, 220, 220, 220, 6818, 3833, 287, 19203, 9319, 3256, 705, 439, 11537, 198, 220, 220, 220, 611, 3833, 6624, 705, 439, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 285, 62, 2536, 796, 705, 11502, 44, 33047, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 285, 62, 2536, 796, 705, 1343, 337, 6, 628, 220, 220, 220, 1303, 3060, 262, 337, 4731, 284, 1111, 5389, 286, 262, 6317, 4731, 198, 220, 220, 220, 685, 75, 11994, 11, 9529, 82, 60, 796, 6317, 13, 35312, 10786, 28, 11537, 198, 220, 220, 220, 1115, 62, 2618, 62, 260, 2673, 796, 300, 11994, 1343, 285, 62, 2536, 1343, 705, 796, 705, 1343, 9529, 82, 1343, 285, 62, 2536, 628, 220, 220, 220, 1441, 1115, 62, 2618, 62, 260, 2673, 628, 198, 4299, 4808, 18982, 62, 26000, 1304, 62, 8841, 7, 26000, 4157, 2599, 198, 220, 220, 220, 37227, 19430, 262, 4731, 329, 262, 7837, 3623, 2927, 1304, 290, 511, 4396, 22139, 198, 220, 220, 220, 220, 220, 220, 220, 329, 262, 9329, 368, 1236, 290, 8498, 68, 10345, 14700, 25, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 2927, 4157, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 2927, 4157, 25, 1351, 7, 2536, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 2927, 1304, 62, 2536, 25, 12870, 49681, 12, 18982, 4731, 351, 2927, 4157, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 965, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2927, 1304, 62, 2536, 796, 705, 4458, 22179, 7, 198, 220, 220, 220, 220, 220, 220, 220, 19203, 90, 15, 25, 82, 92, 14, 90, 16, 25, 19, 13, 18, 69, 92, 14, 45302, 18982, 7, 26000, 1304, 58, 15, 4357, 2927, 1304, 58, 16, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 329, 2927, 1304, 287, 2927, 4157, 4008, 198, 220, 220, 220, 2927, 1304, 62, 2536, 15853, 705, 59, 77, 6, 628, 220, 220, 220, 1441, 2927, 1304, 62, 2536, 628, 198, 4299, 4808, 18982, 62, 37266, 62, 8841, 7, 25677, 11, 42287, 11, 649, 1370, 28, 25101, 2599, 198, 220, 220, 220, 37227, 19430, 257, 4731, 7268, 15830, 42287, 973, 329, 1811, 198, 220, 220, 220, 220, 220, 220, 220, 10345, 5107, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 13639, 25, 1438, 286, 10345, 1296, 262, 10007, 6053, 284, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 13639, 25, 965, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 42287, 25, 15830, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 42287, 25, 1351, 7, 22468, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 649, 1370, 25, 10425, 1771, 284, 751, 257, 649, 1370, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 649, 1370, 25, 20512, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 25, 42287, 62, 2536, 25, 4731, 7268, 262, 10007, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 81, 4906, 25, 965, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 42287, 62, 2536, 796, 705, 90, 15, 25, 29, 940, 82, 92, 14, 45302, 18982, 7, 25677, 13, 45828, 28955, 198, 220, 220, 220, 42287, 62, 2536, 15853, 705, 4458, 22179, 7, 10786, 90, 15, 25, 1065, 13, 18, 36, 92, 4458, 18982, 7, 17143, 8, 329, 5772, 287, 42287, 4008, 198, 220, 220, 220, 42287, 62, 2536, 15853, 705, 1220, 6, 198, 220, 220, 220, 611, 649, 1370, 25, 198, 220, 220, 220, 220, 220, 220, 220, 42287, 62, 2536, 15853, 705, 59, 77, 6, 628, 220, 220, 220, 1441, 42287, 62, 2536, 628, 198, 4299, 4808, 18982, 62, 40914, 77, 62, 3672, 7, 40914, 77, 62, 2539, 2599, 198, 220, 220, 220, 37227, 19520, 1083, 257, 374, 87, 77, 1994, 422, 257, 5772, 62, 67, 310, 290, 198, 220, 220, 220, 220, 220, 220, 220, 6797, 340, 284, 257, 4731, 326, 262, 2029, 5499, 198, 220, 220, 220, 220, 220, 220, 220, 460, 5412, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 374, 310, 82, 796, 374, 87, 77, 62, 2539, 58, 15, 60, 198, 220, 220, 220, 778, 9310, 796, 374, 87, 77, 62, 2539, 58, 16, 60, 198, 220, 220, 220, 329, 4686, 87, 11, 374, 310, 287, 27056, 378, 7, 81, 310, 82, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 4686, 87, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 310, 62, 2536, 796, 374, 310, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 310, 62, 2536, 15853, 705, 10, 6, 1343, 374, 310, 198, 220, 220, 220, 329, 4686, 87, 11, 778, 67, 287, 27056, 378, 7, 1050, 9310, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 4686, 87, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 778, 67, 62, 2536, 796, 778, 67, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 778, 67, 62, 2536, 15853, 705, 10, 6, 1343, 778, 67, 198, 220, 220, 220, 374, 87, 77, 62, 3672, 796, 374, 310, 62, 2536, 1343, 705, 11639, 1343, 778, 67, 62, 2536, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1441, 374, 87, 77, 62, 3672 ]
2.389476
5,302
""" Human Search ideal tag Is rep? Is sense? tag simplification "lizard in control of US gov" "democratics win midterms" "borders cause violence" Find Keywords Yank .txt Reliability Assessment Number of articles Qualification Compare? (John Baudrillard) """ import sys import urllib from urllib.request import urlopen from googlesearch import search from bs4 import BeautifulSoup import newspaper from newspaper import Article from newspaper import fulltext import numpy as np import inspect import requests import nltk nltk.download('punkt') currentFuncName = lambda n=0: sys._getframe(n + 1).f_code.co_name cnn_paper = newspaper.build('http://cnn.com') if __name__ == "__main__": runLoop()
[ 37811, 198, 20490, 198, 220, 220, 220, 11140, 7306, 7621, 628, 220, 220, 220, 1148, 1128, 30, 1148, 2565, 30, 198, 220, 220, 220, 7621, 7106, 2649, 198, 220, 220, 220, 366, 75, 8669, 287, 1630, 286, 1294, 467, 85, 1, 366, 9536, 1696, 23372, 1592, 3095, 38707, 1, 366, 65, 6361, 2728, 3685, 1, 198, 198, 16742, 198, 220, 220, 220, 7383, 10879, 198, 56, 962, 198, 220, 220, 220, 764, 14116, 198, 6892, 12455, 25809, 198, 220, 220, 220, 7913, 286, 6685, 198, 220, 220, 220, 9537, 2649, 628, 220, 220, 220, 27814, 30, 357, 7554, 347, 3885, 20190, 446, 8, 198, 37811, 198, 11748, 25064, 198, 11748, 2956, 297, 571, 198, 6738, 2956, 297, 571, 13, 25927, 1330, 19016, 9654, 198, 6738, 467, 519, 829, 3679, 1330, 2989, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 11748, 7533, 198, 6738, 7533, 1330, 10172, 198, 6738, 7533, 1330, 1336, 5239, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 10104, 198, 198, 11748, 7007, 198, 11748, 299, 2528, 74, 198, 77, 2528, 74, 13, 15002, 10786, 30354, 83, 11537, 198, 198, 14421, 37, 19524, 5376, 796, 37456, 299, 28, 15, 25, 25064, 13557, 1136, 14535, 7, 77, 1343, 352, 737, 69, 62, 8189, 13, 1073, 62, 3672, 198, 66, 20471, 62, 20189, 796, 7533, 13, 11249, 10786, 4023, 1378, 66, 20471, 13, 785, 11537, 628, 628, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1057, 39516, 3419, 198 ]
2.976
250
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import logging import torch from reagent.core.types import PreprocessedTrainingBatch from reagent.training.world_model.seq2reward_trainer import Seq2RewardTrainer logger = logging.getLogger(__name__)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 15069, 357, 66, 8, 3203, 11, 3457, 13, 290, 663, 29116, 13, 1439, 2489, 10395, 13, 198, 11748, 18931, 198, 198, 11748, 28034, 198, 6738, 302, 25781, 13, 7295, 13, 19199, 1330, 3771, 14681, 276, 44357, 33, 963, 198, 6738, 302, 25781, 13, 34409, 13, 6894, 62, 19849, 13, 41068, 17, 260, 904, 62, 2213, 10613, 1330, 1001, 80, 17, 48123, 2898, 10613, 628, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628 ]
3.322222
90
#Notebook Problem import random import time print("Save your notes here, just type what you want to store.") note1 = input("NOTE 1: ") note2 = input("NOTE 2: ") note3 = input("NOTE 3: ") note4 = input("NOTE 4: ") note5 = input("NOTE 5: ") note6 = input("NOTE 6: ") note7 = input("NOTE 7: ") note8 = input("NOTE 8: ") note9 = input("NOTE 9: ") note10 = input("NOTE 10: ") notes = [note1, note2, note3, note4, note5, note6, note7, note8, note9, note10] print(notes)
[ 2, 6425, 2070, 20647, 201, 198, 11748, 4738, 201, 198, 11748, 640, 201, 198, 201, 198, 201, 198, 4798, 7203, 16928, 534, 4710, 994, 11, 655, 2099, 644, 345, 765, 284, 3650, 19570, 201, 198, 11295, 16, 796, 5128, 7203, 16580, 352, 25, 366, 8, 201, 198, 11295, 17, 796, 5128, 7203, 16580, 362, 25, 366, 8, 201, 198, 11295, 18, 796, 5128, 7203, 16580, 513, 25, 366, 8, 201, 198, 11295, 19, 796, 5128, 7203, 16580, 604, 25, 366, 8, 201, 198, 11295, 20, 796, 5128, 7203, 16580, 642, 25, 366, 8, 201, 198, 11295, 21, 796, 5128, 7203, 16580, 718, 25, 366, 8, 201, 198, 11295, 22, 796, 5128, 7203, 16580, 767, 25, 366, 8, 201, 198, 11295, 23, 796, 5128, 7203, 16580, 807, 25, 366, 8, 201, 198, 11295, 24, 796, 5128, 7203, 16580, 860, 25, 366, 8, 201, 198, 11295, 940, 796, 5128, 7203, 16580, 838, 25, 366, 8, 201, 198, 17815, 796, 685, 11295, 16, 11, 3465, 17, 11, 3465, 18, 11, 3465, 19, 11, 3465, 20, 11, 3465, 21, 11, 3465, 22, 11, 3465, 23, 11, 3465, 24, 11, 3465, 940, 60, 201, 198, 4798, 7, 17815, 8, 201, 198, 201, 198, 201, 198 ]
2.44
200
import discord from discord.ext import commands from urllib.parse import urlencode import random import aiohttp import secrets bot = commands.Bot(command_prefix='?') @bot.event # Retrieve query results from Wolfram Short Answer API @bot.command(aliases=['eval']) # Search Python3 Docs @bot.command(aliases=['pyh']) # Roll dice in NdN format @bot.command() # Pick random choice from 2 @bot.command(description='Heads or tails') # Repeat a message N times @bot.command() # Lookup user join timestamp on server @bot.command() # Run the bot bot.run(secrets.discord_token)
[ 11748, 36446, 201, 198, 6738, 36446, 13, 2302, 1330, 9729, 201, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 2956, 11925, 8189, 201, 198, 11748, 4738, 201, 198, 11748, 257, 952, 4023, 201, 198, 201, 198, 11748, 13141, 201, 198, 201, 198, 13645, 796, 9729, 13, 20630, 7, 21812, 62, 40290, 11639, 8348, 8, 201, 198, 201, 198, 201, 198, 31, 13645, 13, 15596, 201, 198, 201, 198, 2, 4990, 30227, 12405, 2482, 422, 8662, 859, 10073, 23998, 7824, 201, 198, 31, 13645, 13, 21812, 7, 7344, 1386, 28, 17816, 18206, 6, 12962, 201, 198, 201, 198, 2, 11140, 11361, 18, 14432, 82, 201, 198, 31, 13645, 13, 21812, 7, 7344, 1386, 28, 17816, 9078, 71, 6, 12962, 201, 198, 201, 198, 2, 8299, 17963, 287, 399, 67, 45, 5794, 201, 198, 31, 13645, 13, 21812, 3419, 201, 198, 201, 198, 2, 12346, 4738, 3572, 422, 362, 201, 198, 31, 13645, 13, 21812, 7, 11213, 11639, 13847, 82, 393, 30514, 11537, 201, 198, 201, 198, 2, 30021, 257, 3275, 399, 1661, 201, 198, 31, 13645, 13, 21812, 3419, 201, 198, 201, 198, 2, 6803, 929, 2836, 4654, 41033, 319, 4382, 201, 198, 31, 13645, 13, 21812, 3419, 201, 198, 201, 198, 2, 5660, 262, 10214, 201, 198, 13645, 13, 5143, 7, 2363, 8004, 13, 15410, 585, 62, 30001, 8, 201, 198 ]
2.769231
221
from requests import get from bs4 import BeautifulSoup import re from datetime import datetime, timedelta import pytz # Ad class to centralize informations #TODO Ajust this shit :/ # Get informations from pages
[ 6738, 7007, 1330, 651, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 11748, 302, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 198, 11748, 12972, 22877, 198, 198, 2, 1215, 1398, 284, 4318, 1096, 4175, 602, 198, 198, 2, 51, 3727, 46, 317, 3137, 428, 7510, 1058, 14, 198, 198, 2, 3497, 4175, 602, 422, 5468 ]
3.55
60
# Return the next leaf node in tree # Given a tree, if query a leaf node, return the next leaf node. If the queried node is an internal node, return whatever you want. You can define the node structure. (Not a binary tree) # Example: # a # z x # w z y o b # If I query 'z' return 'y'. If I query 'y', return 'o'. If I query 'b', return null. print(nextLeaf(query)) # if not node: # return None # leafNodes = [] # tem = node # while node: # if not node.children: # leafNodes.append(node.val) # node = node.children # if query in leafNodes: # index = leafNodes[query] # if leafNodes[index + 1]: # return leafNodes[index + 1] # return None # node = tem.next
[ 2, 8229, 262, 1306, 12835, 10139, 287, 5509, 628, 198, 2, 11259, 257, 5509, 11, 611, 12405, 257, 12835, 10139, 11, 1441, 262, 1306, 12835, 10139, 13, 1002, 262, 42517, 798, 10139, 318, 281, 5387, 10139, 11, 1441, 4232, 345, 765, 13, 921, 460, 8160, 262, 10139, 4645, 13, 357, 3673, 257, 13934, 5509, 8, 198, 198, 2, 17934, 25, 198, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 257, 220, 220, 220, 220, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 1976, 220, 220, 220, 220, 220, 220, 220, 2124, 220, 220, 220, 220, 220, 220, 198, 2, 220, 220, 220, 266, 220, 1976, 220, 331, 220, 220, 220, 220, 220, 267, 220, 220, 275, 198, 2, 1002, 314, 12405, 705, 89, 6, 1441, 705, 88, 4458, 1002, 314, 12405, 705, 88, 3256, 1441, 705, 78, 4458, 1002, 314, 12405, 705, 65, 3256, 1441, 9242, 13, 628, 628, 628, 198, 198, 4798, 7, 19545, 3123, 1878, 7, 22766, 4008, 628, 628, 628, 198, 197, 197, 2, 611, 407, 10139, 25, 198, 197, 197, 2, 220, 197, 7783, 6045, 198, 197, 197, 198, 197, 197, 2, 12835, 45, 4147, 796, 17635, 198, 197, 197, 2, 2169, 796, 10139, 220, 198, 197, 197, 2, 981, 10139, 25, 198, 197, 197, 2, 220, 197, 361, 407, 10139, 13, 17197, 25, 198, 197, 197, 2, 220, 197, 197, 33201, 45, 4147, 13, 33295, 7, 17440, 13, 2100, 8, 198, 197, 197, 2, 220, 197, 17440, 796, 10139, 13, 17197, 628, 197, 197, 2, 611, 12405, 287, 12835, 45, 4147, 25, 198, 197, 197, 2, 220, 197, 9630, 796, 12835, 45, 4147, 58, 22766, 60, 198, 197, 197, 2, 220, 197, 361, 12835, 45, 4147, 58, 9630, 1343, 352, 5974, 198, 197, 197, 2, 220, 197, 197, 7783, 12835, 45, 4147, 58, 9630, 1343, 352, 60, 198, 197, 197, 2, 220, 197, 7783, 6045, 198, 197, 197, 2, 10139, 796, 2169, 13, 19545, 220, 628 ]
2.328267
329
""" This file has function containg main PPO algorithm called in : main.py """ import time from reply_buffer import * from eval_score_and_trace_update import * def train_model(value_model, policy_model, env, policy_optimizer, policy_optimization_epochs, policy_sample_ratio, policy_clip_range, policy_model_max_grad_norm, policy_stopping_kl, entropy_loss_weight, value_optimization_epochs, value_optimizer, value_sample_ratio, value_clip_range, value_model_max_grad_norm, value_stopping_mse, gamma, lambda_, r_1, r_2, r_3, r_4, sample, n_sensor, EPS, evaluation_score): """ Args: value_model: value model instance policy_model: polica model instance env: env class instance policy_optimizer: policy optimizer -> adam policy_optimization_epochs: no of epoch for policy training policy_sample_ratio: no of trajectory to take for training policy_clip_range: clipping parameter of policy loss policy_model_max_grad_norm: maximum norm tolerance of policy optimization policy_stopping_kl: tolerance for training of policy net entropy_loss_weight: factor for entropy loss value_optimization_epochs: no of epochs for value model value_optimizer: value optimizer -> adam value_sample_ratio: no of trajectory to take for training value_clip_range: clipping parameter of value model loss value_model_max_grad_norm: maximum norm tolerance of value optimization value_stopping_mse: tolerance for trainig of value net gamma: discount factor lambda_: TD_lambda method factor r_1: coefficient for reward function r_2: coefficient for reward function r_3 coefficient for reward function r_4: coefficient for reward function sample: number of ppo iteration n_sensor: no of patches at the surface of cylinder EPS: Tolerance for std evaluation_score: evaluation score for post processing results Returns: trajectory running time and time to run one iteration of ppo main algorithm """ # starting time to calculate time of trajectory run and each iteration of main algorithm # getting variable for ppo algorithm from reply_buffer.py traj_start_time = time.perf_counter() states, actions, rewards, returns, logpas = fill_buffer(env, sample, n_sensor, gamma, r_1, r_2, r_3, r_4) traj_time = (time.perf_counter() - traj_start_time) # get V_pi for the state values values_pi = value_model(torch.from_numpy(states)).squeeze().detach().numpy() # compute GAEs of taken actions and the obtained rewards gaes = calculate_gaes(values_pi, rewards, gamma, lambda_) gaes = (gaes - gaes.mean()) / (gaes.std() + EPS) # no of trajectories n_samples = len(actions) for q in range(policy_optimization_epochs): # ramdom selection of trajectories from the reply buffer batch_size = int(policy_sample_ratio * n_samples) batch_idxs = np.random.choice(n_samples, batch_size, replace=False) # get the data for chosen random selected trajectory states_batch = states[batch_idxs] actions_batch = actions[batch_idxs] gaes_batch = gaes[batch_idxs] logpas_batch = logpas[batch_idxs] # log probabilities and entropy for randomly chosen trajectory logpas_pred, entropies_pred = policy_model.get_predictions(states_batch[:, :-1, :], actions_batch) # ratio of log probability to calculate the loss and clipping of policy loss # compute entropy loss ratios = (logpas_pred - torch.from_numpy(logpas_batch)).exp() pi_obj = torch.from_numpy(gaes_batch) * ratios pi_obj_clipped = torch.from_numpy(gaes_batch) * ratios.clamp(1.0 - policy_clip_range, 1.0 + policy_clip_range) policy_loss = -torch.min(pi_obj, pi_obj_clipped).mean() entropy_loss = -entropies_pred.mean() * entropy_loss_weight # total loss (entropy loss + policy loss) back propagation policy_optimizer.zero_grad() (policy_loss + entropy_loss).backward() torch.nn.utils.clip_grad_norm_(policy_model.parameters(), policy_model_max_grad_norm) policy_optimizer.step() # checking for optimization in range of tolerance with torch.no_grad(): logpas_pred_all, _ = policy_model.get_predictions(states[:, :-1, :], actions) kl = (torch.from_numpy(logpas) - logpas_pred_all).mean() if kl.item() > policy_stopping_kl: print(f'kl smaller than tolrence, {q} and {kl.item()}') break model_trace_update(policy_model, sample) for q in range(value_optimization_epochs): # ramdom selection of trajectories from the reply buffer batch_size = int(value_sample_ratio * n_samples) batch_idxs = np.random.choice(n_samples, batch_size, replace=False) # get the data for chosen random selected trajectory states_batch = states[batch_idxs] returns_batch = returns[batch_idxs] values_batch = values_pi[batch_idxs] # getting V_pi for randomly selected trajectories in reply buffer values_pred = value_model(torch.from_numpy(states_batch)).squeeze() values_pred_clipped = torch.from_numpy(values_batch) + (values_pred - torch.from_numpy(values_batch)).clamp( -value_clip_range, value_clip_range) # critic loss v_loss = (torch.from_numpy(returns_batch) - values_pred).pow(2) v_loss_clipped = (torch.from_numpy(returns_batch) - values_pred_clipped).pow(2) value_loss = torch.max(v_loss, v_loss_clipped).mul(0.5).mean() # critic loss optimization value_optimizer.zero_grad() value_loss.backward() torch.nn.utils.clip_grad_norm_(value_model.parameters(), value_model_max_grad_norm) value_optimizer.step() # checking for optimization in range of tolerance with torch.no_grad(): values_pred_all = value_model(torch.from_numpy(states)).squeeze() mse = (torch.from_numpy(values_pi) - values_pred_all).pow(2).mul(0.5).mean() if mse.item() > value_stopping_mse: print(f'mse smaller than tolrence, {q}, {mse.item}') break # saving value model saving_value_model(value_model, sample) # computation time to complete one iteration of main PPO algorithm epoch_time = (time.perf_counter() - traj_start_time) # evaluation score at the end of iteration score = evaluate_score(rewards, sample) evaluation_score.append(score) return traj_time, epoch_time
[ 37811, 198, 220, 220, 220, 770, 2393, 468, 2163, 542, 64, 278, 1388, 350, 16402, 11862, 628, 220, 220, 220, 1444, 287, 1058, 1388, 13, 9078, 198, 37811, 198, 198, 11748, 640, 198, 198, 6738, 10971, 62, 22252, 1330, 1635, 198, 6738, 5418, 62, 26675, 62, 392, 62, 40546, 62, 19119, 1330, 1635, 628, 198, 4299, 4512, 62, 19849, 7, 8367, 62, 19849, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 19849, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17365, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 40085, 7509, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 40085, 1634, 62, 538, 5374, 82, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 39873, 62, 10366, 952, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 15036, 62, 9521, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 19849, 62, 9806, 62, 9744, 62, 27237, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 301, 33307, 62, 41582, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 40709, 62, 22462, 62, 6551, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 40085, 1634, 62, 538, 5374, 82, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 40085, 7509, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 39873, 62, 10366, 952, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 15036, 62, 9521, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 19849, 62, 9806, 62, 9744, 62, 27237, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 301, 33307, 62, 76, 325, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 34236, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 37456, 62, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 62, 16, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 62, 17, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 62, 18, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 62, 19, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6291, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 62, 82, 22854, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 47013, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 12660, 62, 26675, 2599, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 19849, 25, 1988, 2746, 4554, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 19849, 25, 1825, 64, 2746, 4554, 198, 220, 220, 220, 220, 220, 220, 220, 17365, 25, 17365, 1398, 4554, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 40085, 7509, 25, 2450, 6436, 7509, 4613, 23197, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 40085, 1634, 62, 538, 5374, 82, 25, 645, 286, 36835, 329, 2450, 3047, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 39873, 62, 10366, 952, 25, 645, 286, 22942, 284, 1011, 329, 3047, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 15036, 62, 9521, 25, 45013, 11507, 286, 2450, 2994, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 19849, 62, 9806, 62, 9744, 62, 27237, 25, 5415, 2593, 15621, 286, 2450, 23989, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 301, 33307, 62, 41582, 25, 15621, 329, 3047, 286, 2450, 2010, 198, 220, 220, 220, 220, 220, 220, 220, 40709, 62, 22462, 62, 6551, 25, 5766, 329, 40709, 2994, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 40085, 1634, 62, 538, 5374, 82, 25, 645, 286, 36835, 82, 329, 1988, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 40085, 7509, 25, 1988, 6436, 7509, 4613, 23197, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 39873, 62, 10366, 952, 25, 645, 286, 22942, 284, 1011, 329, 3047, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 15036, 62, 9521, 25, 45013, 11507, 286, 1988, 2746, 2994, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 19849, 62, 9806, 62, 9744, 62, 27237, 25, 5415, 2593, 15621, 286, 1988, 23989, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 301, 33307, 62, 76, 325, 25, 15621, 329, 4512, 328, 286, 1988, 2010, 198, 220, 220, 220, 220, 220, 220, 220, 34236, 25, 9780, 5766, 198, 220, 220, 220, 220, 220, 220, 220, 37456, 62, 25, 13320, 62, 50033, 2446, 5766, 198, 220, 220, 220, 220, 220, 220, 220, 374, 62, 16, 25, 35381, 329, 6721, 2163, 198, 220, 220, 220, 220, 220, 220, 220, 374, 62, 17, 25, 35381, 329, 6721, 2163, 198, 220, 220, 220, 220, 220, 220, 220, 374, 62, 18, 35381, 329, 6721, 2163, 198, 220, 220, 220, 220, 220, 220, 220, 374, 62, 19, 25, 35381, 329, 6721, 2163, 198, 220, 220, 220, 220, 220, 220, 220, 6291, 25, 1271, 286, 279, 7501, 24415, 198, 220, 220, 220, 220, 220, 220, 220, 299, 62, 82, 22854, 25, 645, 286, 16082, 379, 262, 4417, 286, 24911, 198, 220, 220, 220, 220, 220, 220, 220, 47013, 25, 309, 37668, 329, 14367, 198, 220, 220, 220, 220, 220, 220, 220, 12660, 62, 26675, 25, 12660, 4776, 329, 1281, 7587, 2482, 628, 220, 220, 220, 16409, 25, 22942, 2491, 640, 290, 640, 284, 1057, 530, 24415, 286, 279, 7501, 1388, 11862, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 3599, 640, 284, 15284, 640, 286, 22942, 1057, 290, 1123, 24415, 286, 1388, 11862, 198, 220, 220, 220, 1303, 1972, 7885, 329, 279, 7501, 11862, 422, 10971, 62, 22252, 13, 9078, 198, 220, 220, 220, 1291, 73, 62, 9688, 62, 2435, 796, 640, 13, 525, 69, 62, 24588, 3419, 198, 220, 220, 220, 2585, 11, 4028, 11, 11530, 11, 5860, 11, 2604, 44429, 796, 6070, 62, 22252, 7, 24330, 11, 6291, 11, 299, 62, 82, 22854, 11, 34236, 11, 374, 62, 16, 11, 374, 62, 17, 11, 374, 62, 18, 11, 374, 62, 19, 8, 198, 220, 220, 220, 1291, 73, 62, 2435, 796, 357, 2435, 13, 525, 69, 62, 24588, 3419, 532, 1291, 73, 62, 9688, 62, 2435, 8, 628, 220, 220, 220, 1303, 651, 569, 62, 14415, 329, 262, 1181, 3815, 198, 220, 220, 220, 3815, 62, 14415, 796, 1988, 62, 19849, 7, 13165, 354, 13, 6738, 62, 77, 32152, 7, 27219, 29720, 16485, 1453, 2736, 22446, 15255, 620, 22446, 77, 32152, 3419, 628, 220, 220, 220, 1303, 24061, 402, 14242, 82, 286, 2077, 4028, 290, 262, 6492, 11530, 198, 220, 220, 220, 31986, 274, 796, 15284, 62, 4908, 274, 7, 27160, 62, 14415, 11, 11530, 11, 34236, 11, 37456, 62, 8, 628, 220, 220, 220, 31986, 274, 796, 357, 4908, 274, 532, 31986, 274, 13, 32604, 28955, 1220, 357, 4908, 274, 13, 19282, 3419, 1343, 47013, 8, 628, 220, 220, 220, 1303, 645, 286, 20134, 1749, 198, 220, 220, 220, 299, 62, 82, 12629, 796, 18896, 7, 4658, 8, 628, 220, 220, 220, 329, 10662, 287, 2837, 7, 30586, 62, 40085, 1634, 62, 538, 5374, 82, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 15770, 3438, 6356, 286, 20134, 1749, 422, 262, 10971, 11876, 198, 220, 220, 220, 220, 220, 220, 220, 15458, 62, 7857, 796, 493, 7, 30586, 62, 39873, 62, 10366, 952, 1635, 299, 62, 82, 12629, 8, 198, 220, 220, 220, 220, 220, 220, 220, 15458, 62, 312, 34223, 796, 45941, 13, 25120, 13, 25541, 7, 77, 62, 82, 12629, 11, 15458, 62, 7857, 11, 6330, 28, 25101, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 651, 262, 1366, 329, 7147, 4738, 220, 6163, 22942, 198, 220, 220, 220, 220, 220, 220, 220, 2585, 62, 43501, 796, 2585, 58, 43501, 62, 312, 34223, 60, 198, 220, 220, 220, 220, 220, 220, 220, 4028, 62, 43501, 796, 4028, 58, 43501, 62, 312, 34223, 60, 198, 220, 220, 220, 220, 220, 220, 220, 31986, 274, 62, 43501, 796, 31986, 274, 58, 43501, 62, 312, 34223, 60, 198, 220, 220, 220, 220, 220, 220, 220, 2604, 44429, 62, 43501, 796, 2604, 44429, 58, 43501, 62, 312, 34223, 60, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 2604, 39522, 290, 40709, 329, 15456, 7147, 22942, 198, 220, 220, 220, 220, 220, 220, 220, 2604, 44429, 62, 28764, 11, 920, 1773, 444, 62, 28764, 796, 2450, 62, 19849, 13, 1136, 62, 28764, 9278, 7, 27219, 62, 43501, 58, 45299, 1058, 12, 16, 11, 1058, 4357, 4028, 62, 43501, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 8064, 286, 2604, 12867, 284, 15284, 262, 2994, 290, 45013, 286, 2450, 2994, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 24061, 40709, 2994, 198, 220, 220, 220, 220, 220, 220, 220, 22423, 796, 357, 6404, 44429, 62, 28764, 532, 28034, 13, 6738, 62, 77, 32152, 7, 6404, 44429, 62, 43501, 29720, 11201, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 31028, 62, 26801, 796, 28034, 13, 6738, 62, 77, 32152, 7, 4908, 274, 62, 43501, 8, 1635, 22423, 198, 220, 220, 220, 220, 220, 220, 220, 31028, 62, 26801, 62, 565, 3949, 796, 28034, 13, 6738, 62, 77, 32152, 7, 4908, 274, 62, 43501, 8, 1635, 22423, 13, 565, 696, 7, 16, 13, 15, 532, 2450, 62, 15036, 62, 9521, 11, 352, 13, 15, 1343, 2450, 62, 15036, 62, 9521, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 22462, 796, 532, 13165, 354, 13, 1084, 7, 14415, 62, 26801, 11, 31028, 62, 26801, 62, 565, 3949, 737, 32604, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 40709, 62, 22462, 796, 532, 298, 1773, 444, 62, 28764, 13, 32604, 3419, 1635, 40709, 62, 22462, 62, 6551, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 2472, 2994, 357, 298, 28338, 2994, 1343, 2450, 2994, 8, 736, 43594, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 40085, 7509, 13, 22570, 62, 9744, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 357, 30586, 62, 22462, 1343, 40709, 62, 22462, 737, 1891, 904, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 28034, 13, 20471, 13, 26791, 13, 15036, 62, 9744, 62, 27237, 41052, 30586, 62, 19849, 13, 17143, 7307, 22784, 2450, 62, 19849, 62, 9806, 62, 9744, 62, 27237, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2450, 62, 40085, 7509, 13, 9662, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 10627, 329, 23989, 287, 2837, 286, 15621, 198, 220, 220, 220, 220, 220, 220, 220, 351, 28034, 13, 3919, 62, 9744, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2604, 44429, 62, 28764, 62, 439, 11, 4808, 796, 2450, 62, 19849, 13, 1136, 62, 28764, 9278, 7, 27219, 58, 45299, 1058, 12, 16, 11, 1058, 4357, 4028, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 75, 796, 357, 13165, 354, 13, 6738, 62, 77, 32152, 7, 6404, 44429, 8, 532, 2604, 44429, 62, 28764, 62, 439, 737, 32604, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 479, 75, 13, 9186, 3419, 1875, 2450, 62, 301, 33307, 62, 41582, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 69, 6, 41582, 4833, 621, 284, 75, 6784, 11, 1391, 80, 92, 290, 1391, 41582, 13, 9186, 3419, 92, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 220, 220, 220, 2746, 62, 40546, 62, 19119, 7, 30586, 62, 19849, 11, 6291, 8, 628, 220, 220, 220, 329, 10662, 287, 2837, 7, 8367, 62, 40085, 1634, 62, 538, 5374, 82, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 15770, 3438, 6356, 286, 20134, 1749, 422, 262, 10971, 11876, 198, 220, 220, 220, 220, 220, 220, 220, 15458, 62, 7857, 796, 493, 7, 8367, 62, 39873, 62, 10366, 952, 1635, 299, 62, 82, 12629, 8, 198, 220, 220, 220, 220, 220, 220, 220, 15458, 62, 312, 34223, 796, 45941, 13, 25120, 13, 25541, 7, 77, 62, 82, 12629, 11, 15458, 62, 7857, 11, 6330, 28, 25101, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 651, 262, 1366, 329, 7147, 4738, 220, 6163, 22942, 198, 220, 220, 220, 220, 220, 220, 220, 2585, 62, 43501, 796, 2585, 58, 43501, 62, 312, 34223, 60, 198, 220, 220, 220, 220, 220, 220, 220, 5860, 62, 43501, 796, 5860, 58, 43501, 62, 312, 34223, 60, 198, 220, 220, 220, 220, 220, 220, 220, 3815, 62, 43501, 796, 3815, 62, 14415, 58, 43501, 62, 312, 34223, 60, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 1972, 569, 62, 14415, 329, 15456, 6163, 20134, 1749, 287, 10971, 11876, 198, 220, 220, 220, 220, 220, 220, 220, 3815, 62, 28764, 796, 1988, 62, 19849, 7, 13165, 354, 13, 6738, 62, 77, 32152, 7, 27219, 62, 43501, 29720, 16485, 1453, 2736, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 3815, 62, 28764, 62, 565, 3949, 796, 28034, 13, 6738, 62, 77, 32152, 7, 27160, 62, 43501, 8, 1343, 357, 27160, 62, 28764, 532, 28034, 13, 6738, 62, 77, 32152, 7, 27160, 62, 43501, 29720, 565, 696, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 8367, 62, 15036, 62, 9521, 11, 1988, 62, 15036, 62, 9521, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4014, 2994, 198, 220, 220, 220, 220, 220, 220, 220, 410, 62, 22462, 796, 357, 13165, 354, 13, 6738, 62, 77, 32152, 7, 7783, 82, 62, 43501, 8, 532, 3815, 62, 28764, 737, 79, 322, 7, 17, 8, 198, 220, 220, 220, 220, 220, 220, 220, 410, 62, 22462, 62, 565, 3949, 796, 357, 13165, 354, 13, 6738, 62, 77, 32152, 7, 7783, 82, 62, 43501, 8, 532, 3815, 62, 28764, 62, 565, 3949, 737, 79, 322, 7, 17, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 22462, 796, 28034, 13, 9806, 7, 85, 62, 22462, 11, 410, 62, 22462, 62, 565, 3949, 737, 76, 377, 7, 15, 13, 20, 737, 32604, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4014, 2994, 23989, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 40085, 7509, 13, 22570, 62, 9744, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 22462, 13, 1891, 904, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 28034, 13, 20471, 13, 26791, 13, 15036, 62, 9744, 62, 27237, 41052, 8367, 62, 19849, 13, 17143, 7307, 22784, 1988, 62, 19849, 62, 9806, 62, 9744, 62, 27237, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 62, 40085, 7509, 13, 9662, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 10627, 329, 23989, 287, 2837, 286, 15621, 198, 220, 220, 220, 220, 220, 220, 220, 351, 28034, 13, 3919, 62, 9744, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3815, 62, 28764, 62, 439, 796, 1988, 62, 19849, 7, 13165, 354, 13, 6738, 62, 77, 32152, 7, 27219, 29720, 16485, 1453, 2736, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 285, 325, 796, 357, 13165, 354, 13, 6738, 62, 77, 32152, 7, 27160, 62, 14415, 8, 532, 3815, 62, 28764, 62, 439, 737, 79, 322, 7, 17, 737, 76, 377, 7, 15, 13, 20, 737, 32604, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 285, 325, 13, 9186, 3419, 1875, 1988, 62, 301, 33307, 62, 76, 325, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 69, 1101, 325, 4833, 621, 284, 75, 6784, 11, 1391, 80, 5512, 1391, 76, 325, 13, 9186, 92, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 220, 220, 220, 1303, 8914, 1988, 2746, 198, 220, 220, 220, 8914, 62, 8367, 62, 19849, 7, 8367, 62, 19849, 11, 6291, 8, 628, 220, 220, 220, 1303, 29964, 640, 284, 1844, 530, 24415, 286, 1388, 350, 16402, 11862, 198, 220, 220, 220, 36835, 62, 2435, 796, 357, 2435, 13, 525, 69, 62, 24588, 3419, 532, 1291, 73, 62, 9688, 62, 2435, 8, 628, 220, 220, 220, 1303, 12660, 4776, 379, 262, 886, 286, 24415, 198, 220, 220, 220, 4776, 796, 13446, 62, 26675, 7, 260, 2017, 11, 6291, 8, 198, 220, 220, 220, 12660, 62, 26675, 13, 33295, 7, 26675, 8, 628, 220, 220, 220, 1441, 1291, 73, 62, 2435, 11, 36835, 62, 2435, 198 ]
2.379751
2,973
#!/usr/bin/env python3 # coding=utf-8 # # Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from xdevice import DeviceError class HdcError(DeviceError): """ Raised when there is an error in hdc operations. """ class HdcCommandRejectedException(HdcError): """ Exception thrown when hdc refuses a command. """ class ShellCommandUnresponsiveException(HdcError): """ Exception thrown when a shell command executed on a device takes too long to send its output. """ class DeviceUnresponsiveException(HdcError): """ Exception thrown when a shell command executed on a device takes too long to send its output. """
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 201, 198, 2, 19617, 28, 40477, 12, 23, 201, 198, 201, 198, 2, 201, 198, 2, 15069, 357, 66, 8, 33448, 43208, 16232, 1766, 1539, 12052, 13, 201, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 201, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 201, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 201, 198, 2, 201, 198, 2, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 201, 198, 2, 201, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 201, 198, 2, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 201, 198, 2, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 201, 198, 2, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 201, 198, 2, 11247, 739, 262, 13789, 13, 201, 198, 2, 201, 198, 201, 198, 6738, 2124, 25202, 1330, 16232, 12331, 201, 198, 201, 198, 201, 198, 4871, 367, 17896, 12331, 7, 24728, 12331, 2599, 201, 198, 220, 220, 220, 37227, 201, 198, 220, 220, 220, 7567, 1417, 618, 612, 318, 281, 4049, 287, 289, 17896, 4560, 13, 201, 198, 220, 220, 220, 37227, 201, 198, 201, 198, 201, 198, 4871, 367, 17896, 21575, 3041, 35408, 16922, 7, 39, 17896, 12331, 2599, 201, 198, 220, 220, 220, 37227, 201, 198, 220, 220, 220, 35528, 8754, 618, 289, 17896, 17567, 257, 3141, 13, 201, 198, 220, 220, 220, 37227, 201, 198, 201, 198, 201, 198, 4871, 17537, 21575, 3118, 39772, 16922, 7, 39, 17896, 12331, 2599, 201, 198, 220, 220, 220, 37227, 201, 198, 220, 220, 220, 35528, 8754, 618, 257, 7582, 3141, 10945, 319, 257, 3335, 2753, 1165, 890, 201, 198, 220, 220, 220, 284, 3758, 663, 5072, 13, 201, 198, 220, 220, 220, 37227, 201, 198, 201, 198, 201, 198, 4871, 16232, 3118, 39772, 16922, 7, 39, 17896, 12331, 2599, 201, 198, 220, 220, 220, 37227, 201, 198, 220, 220, 220, 35528, 8754, 618, 257, 7582, 3141, 10945, 319, 257, 3335, 2753, 1165, 890, 201, 198, 220, 220, 220, 284, 3758, 663, 5072, 13, 201, 198, 220, 220, 220, 37227, 201, 198, 201, 198, 201, 198 ]
3.108374
406
# (C) Datadog, Inc. 2010-2018 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import subprocess import os import time import pytest import mock from datadog_checks.postgres import PostgreSql from .common import HOST, PORT, USER, PASSWORD, DB_NAME HERE = os.path.dirname(os.path.abspath(__file__)) @pytest.fixture @pytest.fixture(scope="session") def postgres_standalone(): """ Start a standalone postgres server requiring authentication before running a test and stopping it afterwards. If there's any problem executing docker-compose, let the exception bubble up. """ env = os.environ args = [ "docker-compose", "-f", os.path.join(HERE, 'compose', 'standalone.compose') ] subprocess.check_call(args + ["up", "-d"], env=env) # waiting for PG to start attempts = 0 while True: if attempts > 10: subprocess.check_call(args + ["down"], env=env) raise Exception("PostgreSQL boot timed out!") output = subprocess.check_output([ "docker", "inspect", "--format='{{json .State.Health.Status}}'", "compose_postgres_1"]) # we get a json string output from docker if output.strip() == "'\"healthy\"'": break attempts += 1 time.sleep(1) yield subprocess.check_call(args + ["down"], env=env) @pytest.fixture @pytest.fixture
[ 2, 357, 34, 8, 16092, 324, 519, 11, 3457, 13, 3050, 12, 7908, 198, 2, 1439, 2489, 10395, 198, 2, 49962, 739, 45157, 1431, 347, 10305, 13789, 357, 3826, 38559, 24290, 8, 198, 11748, 850, 14681, 198, 11748, 28686, 198, 11748, 640, 198, 198, 11748, 12972, 9288, 198, 11748, 15290, 198, 6738, 4818, 324, 519, 62, 42116, 13, 7353, 34239, 1330, 2947, 16694, 50, 13976, 198, 198, 6738, 764, 11321, 1330, 367, 10892, 11, 350, 9863, 11, 1294, 1137, 11, 41752, 54, 12532, 11, 20137, 62, 20608, 628, 198, 39, 9338, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 397, 2777, 776, 7, 834, 7753, 834, 4008, 628, 198, 31, 9078, 9288, 13, 69, 9602, 628, 198, 31, 9078, 9288, 13, 69, 9602, 7, 29982, 2625, 29891, 4943, 198, 4299, 1281, 34239, 62, 1481, 17749, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 7253, 257, 27669, 1281, 34239, 4382, 10616, 18239, 878, 2491, 257, 198, 220, 220, 220, 1332, 290, 12225, 340, 12979, 13, 198, 220, 220, 220, 1002, 612, 338, 597, 1917, 23710, 36253, 12, 785, 3455, 11, 1309, 262, 6631, 14310, 198, 220, 220, 220, 510, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 17365, 796, 28686, 13, 268, 2268, 198, 220, 220, 220, 26498, 796, 685, 198, 220, 220, 220, 220, 220, 220, 220, 366, 45986, 12, 785, 3455, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 27444, 69, 1600, 28686, 13, 6978, 13, 22179, 7, 39, 9338, 11, 705, 785, 3455, 3256, 705, 1481, 17749, 13, 785, 3455, 11537, 198, 220, 220, 220, 2361, 628, 220, 220, 220, 850, 14681, 13, 9122, 62, 13345, 7, 22046, 1343, 14631, 929, 1600, 27444, 67, 33116, 17365, 28, 24330, 8, 628, 220, 220, 220, 1303, 4953, 329, 23842, 284, 923, 198, 220, 220, 220, 6370, 796, 657, 198, 220, 220, 220, 981, 6407, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 6370, 1875, 838, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 850, 14681, 13, 9122, 62, 13345, 7, 22046, 1343, 14631, 2902, 33116, 17365, 28, 24330, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 35528, 7203, 6307, 47701, 6297, 28805, 503, 2474, 8, 628, 220, 220, 220, 220, 220, 220, 220, 5072, 796, 850, 14681, 13, 9122, 62, 22915, 26933, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 45986, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 1040, 806, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 438, 18982, 11639, 27007, 17752, 764, 9012, 13, 18081, 13, 19580, 11709, 6, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 785, 3455, 62, 7353, 34239, 62, 16, 8973, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 356, 651, 257, 33918, 4731, 5072, 422, 36253, 198, 220, 220, 220, 220, 220, 220, 220, 611, 5072, 13, 36311, 3419, 6624, 24018, 7879, 22796, 7879, 6, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 6370, 15853, 352, 198, 220, 220, 220, 220, 220, 220, 220, 640, 13, 42832, 7, 16, 8, 628, 220, 220, 220, 7800, 198, 220, 220, 220, 850, 14681, 13, 9122, 62, 13345, 7, 22046, 1343, 14631, 2902, 33116, 17365, 28, 24330, 8, 628, 198, 31, 9078, 9288, 13, 69, 9602, 628, 198, 31, 9078, 9288, 13, 69, 9602, 198 ]
2.477157
591
from google import search import pprint KEYWORDS = 'duyetdev' data = [] for d in search(KEYWORDS, tld='com.vn', lang='vi', stop=10): data.append(d) print pprint.pprint(data)
[ 6738, 23645, 1330, 2989, 198, 11748, 279, 4798, 198, 198, 20373, 45359, 5258, 796, 705, 646, 25907, 7959, 6, 198, 198, 7890, 796, 17635, 198, 1640, 288, 287, 2989, 7, 20373, 45359, 5258, 11, 256, 335, 11639, 785, 13, 85, 77, 3256, 42392, 11639, 8903, 3256, 2245, 28, 940, 2599, 198, 197, 7890, 13, 33295, 7, 67, 8, 198, 198, 4798, 279, 4798, 13, 381, 22272, 7, 7890, 8 ]
2.565217
69
# import the necessary packages from imutils.video import VideoStream from imutils.video import FPS import sys import os import numpy as np import argparse import imutils import time import cv2 sys.path.append(os.path.abspath('./modules/')) import detection import helpers # construct the argument parser and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-v", "--video", type=str, default = 0, help="path to input video file") ap.add_argument("-fv", "--flip_video", type=bool, default=False, help="Flip video orientation (if the camera is upside down)") ap.add_argument("-t", "--tracker", type=str, default="kcf", help="OpenCV object tracker type") ap.add_argument("-o", "--output", type=str, default=None, help="Should the video capture write to an output file?") ap.add_argument('-c', '--config', required=False, default='yolo.cfg', help = 'path to yolo config file, defaults to yolo.cgf') ap.add_argument('-w', '--weights', required=False, default='yolov3.weights', help = 'path to yolo pre-trained weights, defaults to yolov3.weights.') ap.add_argument('-cl', '--classes', required=False, default = 'yolo-classes.txt', help = 'path to text file containing class names, defaults to yolo-classes.txt') ap.add_argument('-cf', '--confidence', required=False, default = 0.5, help = 'confidence threshold for object detection, defaults to 0.5') args = ap.parse_args() # extract the OpenCV version info (major, minor) = cv2.__version__.split(".")[:2] # if we are using OpenCV 3.2 OR BEFORE, we can use a special factory # function to create our object tracker if int(major) == 3 and int(minor) < 3: tracker = cv2.Tracker_create(args.tracker.upper()) # otherwise, for OpenCV 3.3 OR NEWER, we need to explicity call the # approrpiate object tracker constructor: else: # initialize a dictionary that maps strings to their corresponding # OpenCV object tracker implementations OPENCV_OBJECT_TRACKERS = { "csrt": cv2.TrackerCSRT_create, # High tracking accuracy at the expense of FPS "kcf": cv2.TrackerKCF_create, # Lower tracking accuracy for higher FPS "mil": cv2.TrackerMIL_create } if(hasattr(cv2,'cv2.TrackerMOSSE_create')): OPENCV_OBJECT_TRACKERS["mosse"] = cv2.TrackerMOSSE_create if(hasattr(cv2,'cv2.TrackerMIL_create')): OPENCV_OBJECT_TRACKERS["mil"] = cv2.TrackerMIL_create if(hasattr(cv2,'cv2.TrackerBoosting_create')): OPENCV_OBJECT_TRACKERS["boosting"] = cv2.TrackerBoosting_create if(hasattr(cv2,'cv2.TrackerTLD_create')): OPENCV_OBJECT_TRACKERS["tld"] = cv2.TrackerTLD_create if(hasattr(cv2,'cv2.TrackerMedianFlow_create')): OPENCV_OBJECT_TRACKERS["medianflow"] = cv2.TrackerMedianFlow_create # grab the appropriate object tracker using our dictionary of # OpenCV object tracker objects tracker = OPENCV_OBJECT_TRACKERS[args.tracker]() # initialize the bounding box coordinates of the object we are going # to track initBB = None rotateCode = None # if a video path was not supplied, grab the reference to the web cam if not args.video: print("[INFO] starting video stream...") vs = VideoStream(src=0,resolution=(480,640)).start() time.sleep(1.0) # otherwise, grab a reference to the video file else: vs = cv2.VideoCapture(args.video) # initialize the FPS throughput estimator fps = None # If output writing we will need to initialise thiw writer = None zeros = None # loop over frames from the video stream while True: # grab the current frame, then handle if we are using a # VideoStream or VideoCapture object frame = vs.read() frame = frame[1] if args.video else frame # check to see if we have reached the end of the stream if frame is None: break # resize the frame (so we can process it faster) and grab the # frame dimensions frame = imutils.resize(frame, width=800) (H, W) = frame.shape[:2] # check if the frame needs to be rotated if args.flip_video: frame = cv2.flip(frame,-1) if(args.output and writer is None): # Define the codec and create VideoWriter object fourcc = cv2.VideoWriter_fourcc(*"DIVX") writer = cv2.VideoWriter(args.output + '.mp4',fourcc, 20.0, (W,H), True) zeros = np.zeros((H, W), dtype="uint8") # check to see if we are currently tracking an object if initBB is not None: # grab the new bounding box coordinates of the object (success, box) = tracker.update(frame) # check to see if the tracking was a success if success: (x, y, w, h) = [int(v) for v in box] cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2) # update the FPS counter fps.update() fps.stop() # initialize the set of information we'll be displaying on # the frame info = [ ("Tracker", args.tracker), ("Success", "Yes" if success else "No"), ("FPS", "{:.2f}".format(fps.fps())), ] # loop over the info tuples and draw them on our frame for (i, (k, v)) in enumerate(info): text = "{}: {}".format(k, v) cv2.putText(frame, text, (10, H - ((i * 20) + 20)), cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2) else: initBB = detection.GolfBallDetection(frame) if(initBB): # start OpenCV object tracker using the supplied bounding box # coordinates, then start the FPS throughput estimator as well tracker.init(frame, initBB) fps = FPS().start() # show the output frame cv2.imshow("Frame", frame) if(writer): # write the output frame to file writer.write(frame) key = cv2.waitKey(1) & 0xFF # if the `q` key was pressed, break from the loop if key == ord("q"): break # if we are using a webcam, release the pointer if not args.video: vs.stop() # otherwise, release the file pointer else: vs.release() if(writer): writer.release() # close all windows cv2.destroyAllWindows()
[ 2, 1330, 262, 3306, 10392, 201, 198, 6738, 545, 26791, 13, 15588, 1330, 7623, 12124, 201, 198, 6738, 545, 26791, 13, 15588, 1330, 22082, 201, 198, 11748, 25064, 201, 198, 11748, 28686, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 11748, 1822, 29572, 201, 198, 11748, 545, 26791, 201, 198, 11748, 640, 201, 198, 11748, 269, 85, 17, 201, 198, 17597, 13, 6978, 13, 33295, 7, 418, 13, 6978, 13, 397, 2777, 776, 7, 4458, 14, 18170, 14, 6, 4008, 201, 198, 11748, 13326, 201, 198, 11748, 49385, 201, 198, 201, 198, 2, 5678, 262, 4578, 30751, 290, 21136, 262, 7159, 201, 198, 499, 796, 1822, 29572, 13, 28100, 1713, 46677, 3419, 201, 198, 499, 13, 2860, 62, 49140, 7203, 12, 85, 1600, 366, 438, 15588, 1600, 2099, 28, 2536, 11, 220, 201, 198, 220, 220, 220, 4277, 796, 657, 11, 201, 198, 220, 220, 220, 1037, 2625, 6978, 284, 5128, 2008, 2393, 4943, 201, 198, 499, 13, 2860, 62, 49140, 7203, 12, 69, 85, 1600, 366, 438, 2704, 541, 62, 15588, 1600, 2099, 28, 30388, 11, 4277, 28, 25101, 11, 1037, 2625, 7414, 541, 2008, 12852, 357, 361, 262, 4676, 318, 17196, 866, 8, 4943, 201, 198, 499, 13, 2860, 62, 49140, 7203, 12, 83, 1600, 366, 438, 2213, 10735, 1600, 2099, 28, 2536, 11, 4277, 2625, 74, 12993, 1600, 201, 198, 220, 220, 220, 1037, 2625, 11505, 33538, 2134, 30013, 2099, 4943, 201, 198, 499, 13, 2860, 62, 49140, 7203, 12, 78, 1600, 366, 438, 22915, 1600, 2099, 28, 2536, 11, 4277, 28, 14202, 11, 201, 198, 220, 220, 220, 1037, 2625, 19926, 262, 2008, 8006, 3551, 284, 281, 5072, 2393, 1701, 8, 201, 198, 499, 13, 2860, 62, 49140, 10786, 12, 66, 3256, 705, 438, 11250, 3256, 2672, 28, 25101, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 11639, 88, 14057, 13, 37581, 3256, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 796, 705, 6978, 284, 331, 14057, 4566, 2393, 11, 26235, 284, 331, 14057, 13, 66, 70, 69, 11537, 201, 198, 499, 13, 2860, 62, 49140, 10786, 12, 86, 3256, 705, 438, 43775, 3256, 2672, 28, 25101, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 11639, 88, 349, 709, 18, 13, 43775, 3256, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 796, 705, 6978, 284, 331, 14057, 662, 12, 35311, 19590, 11, 26235, 284, 331, 349, 709, 18, 13, 43775, 2637, 8, 201, 198, 499, 13, 2860, 62, 49140, 10786, 12, 565, 3256, 705, 438, 37724, 3256, 2672, 28, 25101, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 796, 705, 88, 14057, 12, 37724, 13, 14116, 3256, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 796, 705, 6978, 284, 2420, 2393, 7268, 1398, 3891, 11, 26235, 284, 331, 14057, 12, 37724, 13, 14116, 11537, 201, 198, 499, 13, 2860, 62, 49140, 10786, 12, 12993, 3256, 705, 438, 39745, 3256, 2672, 28, 25101, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 796, 657, 13, 20, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 796, 705, 39745, 11387, 329, 2134, 13326, 11, 26235, 284, 657, 13, 20, 11537, 201, 198, 22046, 796, 2471, 13, 29572, 62, 22046, 3419, 201, 198, 201, 198, 2, 7925, 262, 4946, 33538, 2196, 7508, 201, 198, 7, 22478, 11, 4159, 8, 796, 269, 85, 17, 13, 834, 9641, 834, 13, 35312, 7203, 19570, 58, 25, 17, 60, 201, 198, 2, 611, 356, 389, 1262, 4946, 33538, 513, 13, 17, 6375, 38331, 11, 356, 460, 779, 257, 2041, 8860, 201, 198, 2, 2163, 284, 2251, 674, 2134, 30013, 201, 198, 361, 493, 7, 22478, 8, 6624, 513, 290, 493, 7, 1084, 273, 8, 1279, 513, 25, 201, 198, 220, 220, 220, 30013, 796, 269, 85, 17, 13, 35694, 62, 17953, 7, 22046, 13, 2213, 10735, 13, 45828, 28955, 201, 198, 2, 4306, 11, 329, 4946, 33538, 513, 13, 18, 6375, 12682, 1137, 11, 356, 761, 284, 1193, 8467, 869, 262, 201, 198, 2, 598, 1472, 79, 9386, 2134, 30013, 23772, 25, 201, 198, 17772, 25, 201, 198, 220, 220, 220, 1303, 41216, 257, 22155, 326, 8739, 13042, 284, 511, 11188, 201, 198, 220, 220, 220, 1303, 4946, 33538, 2134, 30013, 25504, 201, 198, 220, 220, 220, 13349, 24181, 53, 62, 9864, 23680, 62, 5446, 8120, 4877, 796, 1391, 201, 198, 220, 220, 220, 220, 220, 220, 220, 366, 6359, 17034, 1298, 269, 85, 17, 13, 35694, 7902, 14181, 62, 17953, 11, 1303, 3334, 9646, 9922, 379, 262, 10907, 286, 22082, 201, 198, 220, 220, 220, 220, 220, 220, 220, 366, 74, 12993, 1298, 269, 85, 17, 13, 35694, 42, 22495, 62, 17953, 11, 1303, 16048, 9646, 9922, 329, 2440, 22082, 201, 198, 220, 220, 220, 220, 220, 220, 220, 366, 25433, 1298, 269, 85, 17, 13, 35694, 44, 4146, 62, 17953, 201, 198, 220, 220, 220, 1782, 201, 198, 220, 220, 220, 611, 7, 10134, 35226, 7, 33967, 17, 4032, 33967, 17, 13, 35694, 44, 2640, 5188, 62, 17953, 11537, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 13349, 24181, 53, 62, 9864, 23680, 62, 5446, 8120, 4877, 14692, 16785, 325, 8973, 796, 269, 85, 17, 13, 35694, 44, 2640, 5188, 62, 17953, 201, 198, 220, 220, 220, 611, 7, 10134, 35226, 7, 33967, 17, 4032, 33967, 17, 13, 35694, 44, 4146, 62, 17953, 11537, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 13349, 24181, 53, 62, 9864, 23680, 62, 5446, 8120, 4877, 14692, 25433, 8973, 796, 269, 85, 17, 13, 35694, 44, 4146, 62, 17953, 201, 198, 220, 220, 220, 611, 7, 10134, 35226, 7, 33967, 17, 4032, 33967, 17, 13, 35694, 45686, 278, 62, 17953, 11537, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 13349, 24181, 53, 62, 9864, 23680, 62, 5446, 8120, 4877, 14692, 39521, 278, 8973, 796, 269, 85, 17, 13, 35694, 45686, 278, 62, 17953, 201, 198, 220, 220, 220, 611, 7, 10134, 35226, 7, 33967, 17, 4032, 33967, 17, 13, 35694, 51, 11163, 62, 17953, 11537, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 13349, 24181, 53, 62, 9864, 23680, 62, 5446, 8120, 4877, 14692, 83, 335, 8973, 796, 269, 85, 17, 13, 35694, 51, 11163, 62, 17953, 201, 198, 220, 220, 220, 611, 7, 10134, 35226, 7, 33967, 17, 4032, 33967, 17, 13, 35694, 9921, 666, 37535, 62, 17953, 11537, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 13349, 24181, 53, 62, 9864, 23680, 62, 5446, 8120, 4877, 14692, 1150, 666, 11125, 8973, 796, 269, 85, 17, 13, 35694, 9921, 666, 37535, 62, 17953, 201, 198, 220, 220, 220, 1303, 5552, 262, 5035, 2134, 30013, 1262, 674, 22155, 286, 201, 198, 220, 220, 220, 1303, 4946, 33538, 2134, 30013, 5563, 201, 198, 220, 220, 220, 30013, 796, 13349, 24181, 53, 62, 9864, 23680, 62, 5446, 8120, 4877, 58, 22046, 13, 2213, 10735, 60, 3419, 201, 198, 201, 198, 2, 41216, 262, 5421, 278, 3091, 22715, 286, 262, 2134, 356, 389, 1016, 201, 198, 2, 284, 2610, 201, 198, 15003, 15199, 796, 6045, 201, 198, 10599, 378, 10669, 796, 6045, 201, 198, 201, 198, 2, 611, 257, 2008, 3108, 373, 407, 14275, 11, 5552, 262, 4941, 284, 262, 3992, 12172, 201, 198, 361, 407, 26498, 13, 15588, 25, 201, 198, 220, 220, 220, 3601, 7203, 58, 10778, 60, 3599, 2008, 4269, 9313, 8, 201, 198, 220, 220, 220, 3691, 796, 7623, 12124, 7, 10677, 28, 15, 11, 29268, 16193, 22148, 11, 31102, 29720, 9688, 3419, 201, 198, 220, 220, 220, 640, 13, 42832, 7, 16, 13, 15, 8, 201, 198, 2, 4306, 11, 5552, 257, 4941, 284, 262, 2008, 2393, 201, 198, 17772, 25, 201, 198, 220, 220, 220, 3691, 796, 269, 85, 17, 13, 10798, 49630, 7, 22046, 13, 15588, 8, 201, 198, 2, 41216, 262, 22082, 41997, 3959, 1352, 201, 198, 29647, 796, 6045, 201, 198, 201, 198, 2, 1002, 5072, 3597, 356, 481, 761, 284, 4238, 786, 294, 14246, 201, 198, 16002, 796, 6045, 201, 198, 9107, 418, 796, 6045, 201, 198, 201, 198, 2, 9052, 625, 13431, 422, 262, 2008, 4269, 201, 198, 4514, 6407, 25, 201, 198, 220, 220, 220, 1303, 5552, 262, 1459, 5739, 11, 788, 5412, 611, 356, 389, 1262, 257, 201, 198, 220, 220, 220, 1303, 7623, 12124, 393, 7623, 49630, 2134, 201, 198, 220, 220, 220, 5739, 796, 3691, 13, 961, 3419, 201, 198, 220, 220, 220, 5739, 796, 5739, 58, 16, 60, 611, 26498, 13, 15588, 2073, 5739, 201, 198, 220, 220, 220, 1303, 2198, 284, 766, 611, 356, 423, 4251, 262, 886, 286, 262, 4269, 201, 198, 220, 220, 220, 611, 5739, 318, 6045, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2270, 201, 198, 220, 220, 220, 1303, 47558, 262, 5739, 357, 568, 356, 460, 1429, 340, 5443, 8, 290, 5552, 262, 201, 198, 220, 220, 220, 1303, 5739, 15225, 201, 198, 220, 220, 220, 5739, 796, 545, 26791, 13, 411, 1096, 7, 14535, 11, 9647, 28, 7410, 8, 201, 198, 220, 220, 220, 357, 39, 11, 370, 8, 796, 5739, 13, 43358, 58, 25, 17, 60, 201, 198, 220, 220, 220, 1303, 2198, 611, 262, 5739, 2476, 284, 307, 38375, 201, 198, 220, 220, 220, 611, 26498, 13, 2704, 541, 62, 15588, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 5739, 796, 269, 85, 17, 13, 2704, 541, 7, 14535, 12095, 16, 8, 201, 198, 201, 198, 220, 220, 220, 611, 7, 22046, 13, 22915, 290, 6260, 318, 6045, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 2896, 500, 262, 40481, 290, 2251, 7623, 34379, 2134, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1440, 535, 796, 269, 85, 17, 13, 10798, 34379, 62, 14337, 535, 46491, 1, 33569, 55, 4943, 201, 198, 220, 220, 220, 220, 220, 220, 220, 6260, 796, 269, 85, 17, 13, 10798, 34379, 7, 22046, 13, 22915, 1343, 45302, 3149, 19, 3256, 14337, 535, 11, 1160, 13, 15, 11, 357, 54, 11, 39, 828, 6407, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1976, 27498, 796, 45941, 13, 9107, 418, 19510, 39, 11, 370, 828, 288, 4906, 2625, 28611, 23, 4943, 201, 198, 201, 198, 220, 220, 220, 1303, 2198, 284, 766, 611, 356, 389, 3058, 9646, 281, 2134, 201, 198, 220, 220, 220, 611, 2315, 15199, 318, 407, 6045, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 5552, 262, 649, 5421, 278, 3091, 22715, 286, 262, 2134, 201, 198, 220, 220, 220, 220, 220, 220, 220, 357, 13138, 11, 3091, 8, 796, 30013, 13, 19119, 7, 14535, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 2198, 284, 766, 611, 262, 9646, 373, 257, 1943, 201, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1943, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 87, 11, 331, 11, 266, 11, 289, 8, 796, 685, 600, 7, 85, 8, 329, 410, 287, 3091, 60, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 269, 85, 17, 13, 2554, 9248, 7, 14535, 11, 357, 87, 11, 331, 828, 357, 87, 1343, 266, 11, 331, 1343, 289, 828, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 15, 11, 14280, 11, 657, 828, 362, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4296, 262, 22082, 3753, 201, 198, 220, 220, 220, 220, 220, 220, 220, 32977, 13, 19119, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 32977, 13, 11338, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 41216, 262, 900, 286, 1321, 356, 1183, 307, 19407, 319, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 262, 5739, 201, 198, 220, 220, 220, 220, 220, 220, 220, 7508, 796, 685, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5855, 35694, 1600, 26498, 13, 2213, 10735, 828, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5855, 33244, 1600, 366, 5297, 1, 611, 1943, 2073, 366, 2949, 12340, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5855, 37, 3705, 1600, 45144, 25, 13, 17, 69, 92, 1911, 18982, 7, 29647, 13, 29647, 28955, 828, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2361, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 9052, 625, 262, 7508, 12777, 2374, 290, 3197, 606, 319, 674, 5739, 201, 198, 220, 220, 220, 220, 220, 220, 220, 329, 357, 72, 11, 357, 74, 11, 410, 4008, 287, 27056, 378, 7, 10951, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2420, 796, 45144, 38362, 23884, 1911, 18982, 7, 74, 11, 410, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 269, 85, 17, 13, 1996, 8206, 7, 14535, 11, 2420, 11, 357, 940, 11, 367, 532, 14808, 72, 1635, 1160, 8, 1343, 1160, 36911, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 269, 85, 17, 13, 37, 35830, 62, 39, 4877, 13909, 56, 62, 48913, 16437, 55, 11, 657, 13, 21, 11, 357, 15, 11, 657, 11, 14280, 828, 362, 8, 201, 198, 220, 220, 220, 2073, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2315, 15199, 796, 13326, 13, 38, 4024, 23410, 11242, 3213, 7, 14535, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 611, 7, 15003, 15199, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 923, 4946, 33538, 2134, 30013, 1262, 262, 14275, 5421, 278, 3091, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 22715, 11, 788, 923, 262, 22082, 41997, 3959, 1352, 355, 880, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 30013, 13, 15003, 7, 14535, 11, 2315, 15199, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 32977, 796, 22082, 22446, 9688, 3419, 201, 198, 201, 198, 220, 220, 220, 1303, 905, 262, 5072, 5739, 201, 198, 220, 220, 220, 269, 85, 17, 13, 320, 12860, 7203, 19778, 1600, 5739, 8, 201, 198, 220, 220, 220, 611, 7, 16002, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 3551, 262, 5072, 5739, 284, 2393, 201, 198, 220, 220, 220, 220, 220, 220, 220, 6260, 13, 13564, 7, 14535, 8, 201, 198, 201, 198, 220, 220, 220, 1994, 796, 269, 85, 17, 13, 17077, 9218, 7, 16, 8, 1222, 657, 87, 5777, 201, 198, 220, 220, 220, 1303, 611, 262, 4600, 80, 63, 1994, 373, 12070, 11, 2270, 422, 262, 9052, 201, 198, 220, 220, 220, 611, 1994, 6624, 2760, 7203, 80, 1, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2270, 201, 198, 2, 611, 356, 389, 1262, 257, 49823, 11, 2650, 262, 17562, 201, 198, 361, 407, 26498, 13, 15588, 25, 201, 198, 220, 220, 220, 3691, 13, 11338, 3419, 201, 198, 2, 4306, 11, 2650, 262, 2393, 17562, 201, 198, 17772, 25, 201, 198, 220, 220, 220, 3691, 13, 20979, 3419, 201, 198, 201, 198, 361, 7, 16002, 2599, 201, 198, 220, 220, 220, 6260, 13, 20979, 3419, 201, 198, 201, 198, 2, 1969, 477, 9168, 201, 198, 33967, 17, 13, 41659, 3237, 11209, 3419 ]
2.434816
2,631
import binascii import sys PY26 = sys.version_info[0] == 2 and sys.version_info[1] <= 6 if PY26: import struct class PgpdumpException(Exception): '''Base exception class raised by any parsing errors, etc.''' pass # 256 values corresponding to each possible byte CRC24_TABLE = ( 0x000000, 0x864cfb, 0x8ad50d, 0x0c99f6, 0x93e6e1, 0x15aa1a, 0x1933ec, 0x9f7f17, 0xa18139, 0x27cdc2, 0x2b5434, 0xad18cf, 0x3267d8, 0xb42b23, 0xb8b2d5, 0x3efe2e, 0xc54e89, 0x430272, 0x4f9b84, 0xc9d77f, 0x56a868, 0xd0e493, 0xdc7d65, 0x5a319e, 0x64cfb0, 0xe2834b, 0xee1abd, 0x685646, 0xf72951, 0x7165aa, 0x7dfc5c, 0xfbb0a7, 0x0cd1e9, 0x8a9d12, 0x8604e4, 0x00481f, 0x9f3708, 0x197bf3, 0x15e205, 0x93aefe, 0xad50d0, 0x2b1c2b, 0x2785dd, 0xa1c926, 0x3eb631, 0xb8faca, 0xb4633c, 0x322fc7, 0xc99f60, 0x4fd39b, 0x434a6d, 0xc50696, 0x5a7981, 0xdc357a, 0xd0ac8c, 0x56e077, 0x681e59, 0xee52a2, 0xe2cb54, 0x6487af, 0xfbf8b8, 0x7db443, 0x712db5, 0xf7614e, 0x19a3d2, 0x9fef29, 0x9376df, 0x153a24, 0x8a4533, 0x0c09c8, 0x00903e, 0x86dcc5, 0xb822eb, 0x3e6e10, 0x32f7e6, 0xb4bb1d, 0x2bc40a, 0xad88f1, 0xa11107, 0x275dfc, 0xdced5b, 0x5aa1a0, 0x563856, 0xd074ad, 0x4f0bba, 0xc94741, 0xc5deb7, 0x43924c, 0x7d6c62, 0xfb2099, 0xf7b96f, 0x71f594, 0xee8a83, 0x68c678, 0x645f8e, 0xe21375, 0x15723b, 0x933ec0, 0x9fa736, 0x19ebcd, 0x8694da, 0x00d821, 0x0c41d7, 0x8a0d2c, 0xb4f302, 0x32bff9, 0x3e260f, 0xb86af4, 0x2715e3, 0xa15918, 0xadc0ee, 0x2b8c15, 0xd03cb2, 0x567049, 0x5ae9bf, 0xdca544, 0x43da53, 0xc596a8, 0xc90f5e, 0x4f43a5, 0x71bd8b, 0xf7f170, 0xfb6886, 0x7d247d, 0xe25b6a, 0x641791, 0x688e67, 0xeec29c, 0x3347a4, 0xb50b5f, 0xb992a9, 0x3fde52, 0xa0a145, 0x26edbe, 0x2a7448, 0xac38b3, 0x92c69d, 0x148a66, 0x181390, 0x9e5f6b, 0x01207c, 0x876c87, 0x8bf571, 0x0db98a, 0xf6092d, 0x7045d6, 0x7cdc20, 0xfa90db, 0x65efcc, 0xe3a337, 0xef3ac1, 0x69763a, 0x578814, 0xd1c4ef, 0xdd5d19, 0x5b11e2, 0xc46ef5, 0x42220e, 0x4ebbf8, 0xc8f703, 0x3f964d, 0xb9dab6, 0xb54340, 0x330fbb, 0xac70ac, 0x2a3c57, 0x26a5a1, 0xa0e95a, 0x9e1774, 0x185b8f, 0x14c279, 0x928e82, 0x0df195, 0x8bbd6e, 0x872498, 0x016863, 0xfad8c4, 0x7c943f, 0x700dc9, 0xf64132, 0x693e25, 0xef72de, 0xe3eb28, 0x65a7d3, 0x5b59fd, 0xdd1506, 0xd18cf0, 0x57c00b, 0xc8bf1c, 0x4ef3e7, 0x426a11, 0xc426ea, 0x2ae476, 0xaca88d, 0xa0317b, 0x267d80, 0xb90297, 0x3f4e6c, 0x33d79a, 0xb59b61, 0x8b654f, 0x0d29b4, 0x01b042, 0x87fcb9, 0x1883ae, 0x9ecf55, 0x9256a3, 0x141a58, 0xefaaff, 0x69e604, 0x657ff2, 0xe33309, 0x7c4c1e, 0xfa00e5, 0xf69913, 0x70d5e8, 0x4e2bc6, 0xc8673d, 0xc4fecb, 0x42b230, 0xddcd27, 0x5b81dc, 0x57182a, 0xd154d1, 0x26359f, 0xa07964, 0xace092, 0x2aac69, 0xb5d37e, 0x339f85, 0x3f0673, 0xb94a88, 0x87b4a6, 0x01f85d, 0x0d61ab, 0x8b2d50, 0x145247, 0x921ebc, 0x9e874a, 0x18cbb1, 0xe37b16, 0x6537ed, 0x69ae1b, 0xefe2e0, 0x709df7, 0xf6d10c, 0xfa48fa, 0x7c0401, 0x42fa2f, 0xc4b6d4, 0xc82f22, 0x4e63d9, 0xd11cce, 0x575035, 0x5bc9c3, 0xdd8538 ) def crc24(data): '''Implementation of the CRC-24 algorithm used by OpenPGP.''' # CRC-24-Radix-64 # x24 + x23 + x18 + x17 + x14 + x11 + x10 + x7 + x6 # + x5 + x4 + x3 + x + 1 (OpenPGP) # 0x864CFB / 0xDF3261 / 0xC3267D crc = 0x00b704ce # this saves a bunch of slower global accesses crc_table = CRC24_TABLE for byte in data: tbl_idx = ((crc >> 16) ^ byte) & 0xff crc = (crc_table[tbl_idx] ^ (crc << 8)) & 0x00ffffff return crc def get_int2(data, offset): '''Pull two bytes from data at offset and return as an integer.''' return (data[offset] << 8) + data[offset + 1] def get_int4(data, offset): '''Pull four bytes from data at offset and return as an integer.''' return ((data[offset] << 24) + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3]) def get_int8(data, offset): '''Pull eight bytes from data at offset and return as an integer.''' return (get_int4(data, offset) << 32) + get_int4(data, offset + 4) def get_mpi(data, offset): '''Gets a multi-precision integer as per RFC-4880. Returns the MPI and the new offset. See: http://tools.ietf.org/html/rfc4880#section-3.2''' mpi_len = get_int2(data, offset) offset += 2 to_process = (mpi_len + 7) // 8 mpi = 0 i = -4 for i in range(0, to_process - 3, 4): mpi <<= 32 mpi += get_int4(data, offset + i) for j in range(i + 4, to_process): mpi <<= 8 mpi += data[offset + j] # Python 3.2 and later alternative: #mpi = int.from_bytes(data[offset:offset + to_process], byteorder='big') offset += to_process return mpi, offset def get_hex_data(data, offset, byte_count): '''Pull the given number of bytes from data at offset and return as a hex-encoded string.''' key_data = data[offset:offset + byte_count] if PY26: key_data = buffer(key_data) key_id = binascii.hexlify(key_data) return key_id.upper() def get_key_id(data, offset): '''Pull eight bytes from data at offset and return as a 16-byte hex-encoded string.''' return get_hex_data(data, offset, 8) def get_int_bytes(data): '''Get the big-endian byte form of an integer or MPI.''' hexval = '%X' % data new_len = (len(hexval) + 1) // 2 * 2 hexval = hexval.zfill(new_len) return binascii.unhexlify(hexval.encode('ascii')) def pack_data(data): '''Pack iterable of binary data into a bytestring if necessary.''' if PY26: return struct.pack('%dB' % len(data), *data) return data def same_key(key_a, key_b): '''Comparison function for key ID or fingerprint strings, taking into account varying length.''' if len(key_a) == len(key_b): return key_a == key_b elif len(key_a) < len(key_b): return key_b.endswith(key_a) else: return key_a.endswith(key_b)
[ 11748, 9874, 292, 979, 72, 198, 11748, 25064, 198, 198, 47, 56, 2075, 796, 25064, 13, 9641, 62, 10951, 58, 15, 60, 6624, 362, 290, 25064, 13, 9641, 62, 10951, 58, 16, 60, 19841, 718, 198, 198, 361, 350, 56, 2075, 25, 198, 220, 220, 220, 1330, 2878, 628, 198, 4871, 350, 70, 30094, 931, 16922, 7, 16922, 2599, 198, 220, 220, 220, 705, 7061, 14881, 6631, 1398, 4376, 416, 597, 32096, 8563, 11, 3503, 2637, 7061, 198, 220, 220, 220, 1208, 628, 198, 2, 17759, 3815, 11188, 284, 1123, 1744, 18022, 198, 34, 7397, 1731, 62, 38148, 796, 357, 198, 220, 220, 220, 657, 87, 10535, 11, 657, 87, 39570, 12993, 65, 11, 657, 87, 23, 324, 1120, 67, 11, 657, 87, 15, 66, 2079, 69, 21, 11, 657, 87, 6052, 68, 21, 68, 16, 11, 657, 87, 1314, 7252, 16, 64, 11, 657, 87, 1129, 2091, 721, 11, 198, 220, 220, 220, 657, 87, 24, 69, 22, 69, 1558, 11, 657, 27865, 1507, 20219, 11, 657, 87, 1983, 10210, 66, 17, 11, 657, 87, 17, 65, 4051, 2682, 11, 657, 87, 324, 1507, 12993, 11, 657, 87, 18, 25674, 67, 23, 11, 657, 30894, 3682, 65, 1954, 11, 198, 220, 220, 220, 657, 30894, 23, 65, 17, 67, 20, 11, 657, 87, 18, 22521, 17, 68, 11, 657, 25306, 4051, 68, 4531, 11, 657, 87, 31794, 29807, 11, 657, 87, 19, 69, 24, 65, 5705, 11, 657, 25306, 24, 67, 3324, 69, 11, 657, 87, 3980, 64, 23, 3104, 11, 198, 220, 220, 220, 657, 24954, 15, 68, 43134, 11, 657, 87, 17896, 22, 67, 2996, 11, 657, 87, 20, 64, 35175, 68, 11, 657, 87, 2414, 12993, 65, 15, 11, 657, 27705, 2078, 2682, 65, 11, 657, 87, 1453, 16, 397, 67, 11, 657, 87, 35978, 27720, 11, 198, 220, 220, 220, 657, 26152, 48555, 4349, 11, 657, 87, 22, 20986, 7252, 11, 657, 87, 22, 7568, 66, 20, 66, 11, 657, 26152, 11848, 15, 64, 22, 11, 657, 87, 15, 10210, 16, 68, 24, 11, 657, 87, 23, 64, 24, 67, 1065, 11, 657, 87, 23, 31916, 68, 19, 11, 198, 220, 220, 220, 657, 87, 405, 40271, 69, 11, 657, 87, 24, 69, 20167, 23, 11, 657, 87, 24991, 19881, 18, 11, 657, 87, 1314, 68, 21261, 11, 657, 87, 6052, 64, 22521, 11, 657, 87, 324, 1120, 67, 15, 11, 657, 87, 17, 65, 16, 66, 17, 65, 11, 198, 220, 220, 220, 657, 87, 1983, 5332, 1860, 11, 657, 27865, 16, 66, 24, 2075, 11, 657, 87, 18, 1765, 21, 3132, 11, 657, 30894, 23, 69, 22260, 11, 657, 30894, 3510, 2091, 66, 11, 657, 87, 37283, 16072, 22, 11, 657, 25306, 2079, 69, 1899, 11, 198, 220, 220, 220, 657, 87, 19, 16344, 2670, 65, 11, 657, 87, 47101, 64, 21, 67, 11, 657, 25306, 1120, 38205, 11, 657, 87, 20, 64, 3720, 6659, 11, 657, 87, 17896, 27277, 64, 11, 657, 24954, 15, 330, 23, 66, 11, 657, 87, 3980, 68, 2998, 22, 11, 198, 220, 220, 220, 657, 87, 48564, 68, 3270, 11, 657, 87, 1453, 4309, 64, 17, 11, 657, 27705, 17, 21101, 4051, 11, 657, 87, 2414, 5774, 1878, 11, 657, 26152, 19881, 23, 65, 23, 11, 657, 87, 22, 9945, 34938, 11, 657, 87, 49517, 9945, 20, 11, 198, 220, 220, 220, 657, 26152, 4304, 1415, 68, 11, 657, 87, 1129, 64, 18, 67, 17, 11, 657, 87, 24, 69, 891, 1959, 11, 657, 87, 24, 32128, 7568, 11, 657, 87, 21395, 64, 1731, 11, 657, 87, 23, 64, 2231, 2091, 11, 657, 87, 15, 66, 2931, 66, 23, 11, 198, 220, 220, 220, 657, 87, 28694, 3070, 68, 11, 657, 87, 4521, 67, 535, 20, 11, 657, 30894, 23, 1828, 1765, 11, 657, 87, 18, 68, 21, 68, 940, 11, 657, 87, 2624, 69, 22, 68, 21, 11, 657, 30894, 19, 11848, 16, 67, 11, 657, 87, 17, 15630, 1821, 64, 11, 198, 220, 220, 220, 657, 87, 324, 3459, 69, 16, 11, 657, 27865, 1157, 15982, 11, 657, 87, 23195, 7568, 66, 11, 657, 24954, 771, 20, 65, 11, 657, 87, 20, 7252, 16, 64, 15, 11, 657, 87, 3980, 2548, 3980, 11, 657, 24954, 2998, 19, 324, 11, 198, 220, 220, 220, 657, 87, 19, 69, 15, 65, 7012, 11, 657, 25306, 24, 2857, 3901, 11, 657, 25306, 20, 11275, 22, 11, 657, 87, 47106, 1731, 66, 11, 657, 87, 22, 67, 21, 66, 5237, 11, 657, 87, 21855, 1238, 2079, 11, 657, 26152, 22, 65, 4846, 69, 11, 198, 220, 220, 220, 657, 87, 4869, 69, 46438, 11, 657, 87, 1453, 23, 64, 5999, 11, 657, 87, 3104, 66, 30924, 11, 657, 87, 49259, 69, 23, 68, 11, 657, 27705, 26427, 2425, 11, 657, 87, 18458, 1954, 65, 11, 657, 87, 24, 2091, 721, 15, 11, 198, 220, 220, 220, 657, 87, 24, 13331, 49150, 11, 657, 87, 1129, 1765, 10210, 11, 657, 87, 23, 45214, 6814, 11, 657, 87, 405, 67, 23, 2481, 11, 657, 87, 15, 66, 3901, 67, 22, 11, 657, 87, 23, 64, 15, 67, 17, 66, 11, 657, 30894, 19, 69, 22709, 11, 198, 220, 220, 220, 657, 87, 2624, 65, 487, 24, 11, 657, 87, 18, 68, 21719, 69, 11, 657, 30894, 4521, 1878, 19, 11, 657, 87, 1983, 1314, 68, 18, 11, 657, 27865, 19707, 1507, 11, 657, 87, 324, 66, 15, 1453, 11, 657, 87, 17, 65, 23, 66, 1314, 11, 198, 220, 220, 220, 657, 24954, 3070, 21101, 17, 11, 657, 87, 3980, 2154, 2920, 11, 657, 87, 20, 3609, 24, 19881, 11, 657, 24954, 6888, 47576, 11, 657, 87, 3559, 6814, 4310, 11, 657, 25306, 45734, 64, 23, 11, 657, 25306, 3829, 69, 20, 68, 11, 198, 220, 220, 220, 657, 87, 19, 69, 3559, 64, 20, 11, 657, 87, 4869, 17457, 23, 65, 11, 657, 26152, 22, 69, 17279, 11, 657, 87, 21855, 3104, 4521, 11, 657, 87, 22, 67, 23753, 67, 11, 657, 27705, 1495, 65, 21, 64, 11, 657, 87, 2414, 1558, 6420, 11, 198, 220, 220, 220, 657, 87, 34427, 68, 3134, 11, 657, 27705, 721, 1959, 66, 11, 657, 87, 2091, 2857, 64, 19, 11, 657, 30894, 1120, 65, 20, 69, 11, 657, 30894, 41561, 64, 24, 11, 657, 87, 18, 69, 2934, 4309, 11, 657, 27865, 15, 64, 18781, 11, 198, 220, 220, 220, 657, 87, 2075, 276, 1350, 11, 657, 87, 17, 64, 22, 31115, 11, 657, 87, 330, 2548, 65, 18, 11, 657, 87, 5892, 66, 3388, 67, 11, 657, 87, 18294, 64, 2791, 11, 657, 87, 1507, 1485, 3829, 11, 657, 87, 24, 68, 20, 69, 21, 65, 11, 198, 220, 220, 220, 657, 87, 486, 22745, 66, 11, 657, 87, 23, 4304, 66, 5774, 11, 657, 87, 23, 19881, 42875, 11, 657, 87, 15, 9945, 4089, 64, 11, 657, 26152, 1899, 5892, 67, 11, 657, 87, 2154, 2231, 67, 21, 11, 657, 87, 22, 10210, 66, 1238, 11, 198, 220, 220, 220, 657, 87, 13331, 3829, 9945, 11, 657, 87, 2996, 891, 535, 11, 657, 27705, 18, 64, 31496, 11, 657, 87, 891, 18, 330, 16, 11, 657, 87, 3388, 49641, 64, 11, 657, 87, 3553, 3459, 1415, 11, 657, 24954, 16, 66, 19, 891, 11, 198, 220, 220, 220, 657, 87, 1860, 20, 67, 1129, 11, 657, 87, 20, 65, 1157, 68, 17, 11, 657, 25306, 3510, 891, 20, 11, 657, 87, 44361, 1238, 68, 11, 657, 87, 19, 1765, 19881, 23, 11, 657, 25306, 23, 69, 36809, 11, 657, 87, 18, 69, 24, 2414, 67, 11, 198, 220, 220, 220, 657, 30894, 24, 67, 397, 21, 11, 657, 30894, 20, 3559, 1821, 11, 657, 87, 26073, 69, 11848, 11, 657, 87, 330, 2154, 330, 11, 657, 87, 17, 64, 18, 66, 3553, 11, 657, 87, 2075, 64, 20, 64, 16, 11, 657, 27865, 15, 68, 3865, 64, 11, 198, 220, 220, 220, 657, 87, 24, 68, 1558, 4524, 11, 657, 87, 21652, 65, 23, 69, 11, 657, 87, 1415, 66, 26050, 11, 657, 87, 24, 2078, 68, 6469, 11, 657, 87, 15, 7568, 22186, 11, 657, 87, 23, 11848, 67, 21, 68, 11, 657, 87, 5774, 1731, 4089, 11, 198, 220, 220, 220, 657, 87, 486, 3104, 5066, 11, 657, 26152, 324, 23, 66, 19, 11, 657, 87, 22, 66, 24, 3559, 69, 11, 657, 87, 9879, 17896, 24, 11, 657, 26152, 2414, 19924, 11, 657, 87, 48528, 68, 1495, 11, 657, 87, 891, 4761, 2934, 11, 198, 220, 220, 220, 657, 27705, 18, 1765, 2078, 11, 657, 87, 2996, 64, 22, 67, 18, 11, 657, 87, 20, 65, 3270, 16344, 11, 657, 87, 1860, 8628, 21, 11, 657, 24954, 1507, 12993, 15, 11, 657, 87, 3553, 66, 405, 65, 11, 657, 25306, 23, 19881, 16, 66, 11, 198, 220, 220, 220, 657, 87, 19, 891, 18, 68, 22, 11, 657, 87, 42780, 64, 1157, 11, 657, 25306, 42780, 18213, 11, 657, 87, 17, 3609, 35435, 11, 657, 87, 22260, 3459, 67, 11, 657, 27865, 3070, 1558, 65, 11, 657, 87, 25674, 67, 1795, 11, 198, 220, 220, 220, 657, 30894, 3829, 26561, 11, 657, 87, 18, 69, 19, 68, 21, 66, 11, 657, 87, 2091, 67, 3720, 64, 11, 657, 30894, 3270, 65, 5333, 11, 657, 87, 23, 65, 39111, 69, 11, 657, 87, 15, 67, 1959, 65, 19, 11, 657, 87, 486, 65, 3023, 17, 11, 198, 220, 220, 220, 657, 87, 5774, 16072, 65, 24, 11, 657, 87, 1507, 5999, 3609, 11, 657, 87, 24, 721, 69, 2816, 11, 657, 87, 24, 11645, 64, 18, 11, 657, 87, 23756, 64, 3365, 11, 657, 87, 891, 64, 2001, 11, 657, 87, 3388, 68, 31916, 11, 198, 220, 220, 220, 657, 87, 37680, 487, 17, 11, 657, 27705, 2091, 26895, 11, 657, 87, 22, 66, 19, 66, 16, 68, 11, 657, 87, 13331, 405, 68, 20, 11, 657, 26152, 47325, 1485, 11, 657, 87, 2154, 67, 20, 68, 23, 11, 657, 87, 19, 68, 17, 15630, 21, 11, 198, 220, 220, 220, 657, 25306, 23, 45758, 67, 11, 657, 25306, 19, 69, 721, 65, 11, 657, 87, 3682, 65, 19214, 11, 657, 87, 1860, 10210, 1983, 11, 657, 87, 20, 65, 6659, 17896, 11, 657, 87, 3553, 24294, 64, 11, 657, 24954, 21526, 67, 16, 11, 198, 220, 220, 220, 657, 87, 2075, 30743, 69, 11, 657, 27865, 2998, 24, 2414, 11, 657, 87, 558, 2931, 17, 11, 657, 87, 17, 64, 330, 3388, 11, 657, 30894, 20, 67, 2718, 68, 11, 657, 87, 29626, 69, 5332, 11, 657, 87, 18, 69, 15, 45758, 11, 198, 220, 220, 220, 657, 30894, 5824, 64, 3459, 11, 657, 87, 5774, 65, 19, 64, 21, 11, 657, 87, 486, 69, 5332, 67, 11, 657, 87, 15, 67, 5333, 397, 11, 657, 87, 23, 65, 17, 67, 1120, 11, 657, 87, 18781, 23753, 11, 657, 87, 24, 2481, 1765, 66, 11, 198, 220, 220, 220, 657, 87, 24, 68, 23, 4524, 64, 11, 657, 87, 1507, 66, 11848, 16, 11, 657, 27705, 2718, 65, 1433, 11, 657, 87, 2996, 2718, 276, 11, 657, 87, 3388, 3609, 16, 65, 11, 657, 87, 22521, 17, 68, 15, 11, 657, 87, 31495, 7568, 22, 11, 198, 220, 220, 220, 657, 26152, 21, 67, 940, 66, 11, 657, 87, 13331, 2780, 13331, 11, 657, 87, 22, 66, 3023, 486, 11, 657, 87, 3682, 13331, 17, 69, 11, 657, 25306, 19, 65, 21, 67, 19, 11, 657, 25306, 6469, 69, 1828, 11, 657, 87, 19, 68, 5066, 67, 24, 11, 198, 220, 220, 220, 657, 24954, 1157, 66, 344, 11, 657, 87, 3553, 1120, 2327, 11, 657, 87, 20, 15630, 24, 66, 18, 11, 657, 87, 1860, 5332, 2548, 198, 8, 628, 198, 4299, 1067, 66, 1731, 7, 7890, 2599, 198, 220, 220, 220, 705, 7061, 3546, 32851, 286, 262, 45623, 12, 1731, 11862, 973, 416, 4946, 6968, 47, 2637, 7061, 198, 220, 220, 220, 1303, 45623, 12, 1731, 12, 15546, 844, 12, 2414, 198, 220, 220, 220, 1303, 2124, 1731, 1343, 2124, 1954, 1343, 2124, 1507, 1343, 2124, 1558, 1343, 2124, 1415, 1343, 2124, 1157, 1343, 2124, 940, 1343, 2124, 22, 1343, 2124, 21, 198, 220, 220, 220, 1303, 220, 220, 1343, 2124, 20, 1343, 2124, 19, 1343, 2124, 18, 1343, 2124, 1343, 352, 357, 11505, 6968, 47, 8, 198, 220, 220, 220, 1303, 657, 87, 39570, 22495, 33, 1220, 657, 87, 8068, 18, 30057, 1220, 657, 87, 34, 18, 25674, 35, 198, 220, 220, 220, 1067, 66, 796, 657, 87, 405, 65, 32869, 344, 198, 220, 220, 220, 1303, 428, 16031, 257, 7684, 286, 13611, 3298, 1895, 274, 198, 220, 220, 220, 1067, 66, 62, 11487, 796, 45623, 1731, 62, 38148, 198, 220, 220, 220, 329, 18022, 287, 1366, 25, 198, 220, 220, 220, 220, 220, 220, 220, 256, 2436, 62, 312, 87, 796, 14808, 66, 6015, 9609, 1467, 8, 10563, 18022, 8, 1222, 657, 47596, 198, 220, 220, 220, 220, 220, 220, 220, 1067, 66, 796, 357, 66, 6015, 62, 11487, 58, 83, 2436, 62, 312, 87, 60, 10563, 357, 66, 6015, 9959, 807, 4008, 1222, 657, 87, 405, 12927, 487, 198, 220, 220, 220, 1441, 1067, 66, 628, 198, 4299, 651, 62, 600, 17, 7, 7890, 11, 11677, 2599, 198, 220, 220, 220, 705, 7061, 42940, 734, 9881, 422, 1366, 379, 11677, 290, 1441, 355, 281, 18253, 2637, 7061, 198, 220, 220, 220, 1441, 357, 7890, 58, 28968, 60, 9959, 807, 8, 1343, 1366, 58, 28968, 1343, 352, 60, 628, 198, 4299, 651, 62, 600, 19, 7, 7890, 11, 11677, 2599, 198, 220, 220, 220, 705, 7061, 42940, 1440, 9881, 422, 1366, 379, 11677, 290, 1441, 355, 281, 18253, 2637, 7061, 198, 220, 220, 220, 1441, 14808, 7890, 58, 28968, 60, 9959, 1987, 8, 1343, 357, 7890, 58, 28968, 1343, 352, 60, 9959, 1467, 8, 1343, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 7890, 58, 28968, 1343, 362, 60, 9959, 807, 8, 1343, 1366, 58, 28968, 1343, 513, 12962, 628, 198, 4299, 651, 62, 600, 23, 7, 7890, 11, 11677, 2599, 198, 220, 220, 220, 705, 7061, 42940, 3624, 9881, 422, 1366, 379, 11677, 290, 1441, 355, 281, 18253, 2637, 7061, 198, 220, 220, 220, 1441, 357, 1136, 62, 600, 19, 7, 7890, 11, 11677, 8, 9959, 3933, 8, 1343, 651, 62, 600, 19, 7, 7890, 11, 11677, 1343, 604, 8, 628, 198, 4299, 651, 62, 3149, 72, 7, 7890, 11, 11677, 2599, 198, 220, 220, 220, 705, 7061, 38, 1039, 257, 5021, 12, 3866, 16005, 18253, 355, 583, 30978, 12, 2780, 1795, 13, 198, 220, 220, 220, 16409, 262, 4904, 40, 290, 262, 649, 11677, 13, 198, 220, 220, 220, 4091, 25, 2638, 1378, 31391, 13, 1155, 69, 13, 2398, 14, 6494, 14, 81, 16072, 2780, 1795, 2, 5458, 12, 18, 13, 17, 7061, 6, 198, 220, 220, 220, 285, 14415, 62, 11925, 796, 651, 62, 600, 17, 7, 7890, 11, 11677, 8, 198, 220, 220, 220, 11677, 15853, 362, 198, 220, 220, 220, 284, 62, 14681, 796, 357, 3149, 72, 62, 11925, 1343, 767, 8, 3373, 807, 198, 220, 220, 220, 285, 14415, 796, 657, 198, 220, 220, 220, 1312, 796, 532, 19, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 15, 11, 284, 62, 14681, 532, 513, 11, 604, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 285, 14415, 9959, 28, 3933, 198, 220, 220, 220, 220, 220, 220, 220, 285, 14415, 15853, 651, 62, 600, 19, 7, 7890, 11, 11677, 1343, 1312, 8, 198, 220, 220, 220, 329, 474, 287, 2837, 7, 72, 1343, 604, 11, 284, 62, 14681, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 285, 14415, 9959, 28, 807, 198, 220, 220, 220, 220, 220, 220, 220, 285, 14415, 15853, 1366, 58, 28968, 1343, 474, 60, 198, 220, 220, 220, 1303, 11361, 513, 13, 17, 290, 1568, 5559, 25, 198, 220, 220, 220, 1303, 3149, 72, 796, 493, 13, 6738, 62, 33661, 7, 7890, 58, 28968, 25, 28968, 1343, 284, 62, 14681, 4357, 18022, 2875, 11639, 14261, 11537, 198, 220, 220, 220, 11677, 15853, 284, 62, 14681, 198, 220, 220, 220, 1441, 285, 14415, 11, 11677, 628, 198, 4299, 651, 62, 33095, 62, 7890, 7, 7890, 11, 11677, 11, 18022, 62, 9127, 2599, 198, 220, 220, 220, 705, 7061, 42940, 262, 1813, 1271, 286, 9881, 422, 1366, 379, 11677, 290, 1441, 355, 257, 198, 220, 220, 220, 17910, 12, 12685, 9043, 4731, 2637, 7061, 198, 220, 220, 220, 1994, 62, 7890, 796, 1366, 58, 28968, 25, 28968, 1343, 18022, 62, 9127, 60, 198, 220, 220, 220, 611, 350, 56, 2075, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1994, 62, 7890, 796, 11876, 7, 2539, 62, 7890, 8, 198, 220, 220, 220, 1994, 62, 312, 796, 9874, 292, 979, 72, 13, 33095, 75, 1958, 7, 2539, 62, 7890, 8, 198, 220, 220, 220, 1441, 1994, 62, 312, 13, 45828, 3419, 628, 198, 4299, 651, 62, 2539, 62, 312, 7, 7890, 11, 11677, 2599, 198, 220, 220, 220, 705, 7061, 42940, 3624, 9881, 422, 1366, 379, 11677, 290, 1441, 355, 257, 1467, 12, 26327, 17910, 12, 12685, 9043, 198, 220, 220, 220, 4731, 2637, 7061, 198, 220, 220, 220, 1441, 651, 62, 33095, 62, 7890, 7, 7890, 11, 11677, 11, 807, 8, 628, 198, 4299, 651, 62, 600, 62, 33661, 7, 7890, 2599, 198, 220, 220, 220, 705, 7061, 3855, 262, 1263, 12, 437, 666, 18022, 1296, 286, 281, 18253, 393, 4904, 40, 2637, 7061, 198, 220, 220, 220, 17910, 2100, 796, 705, 4, 55, 6, 4064, 1366, 198, 220, 220, 220, 649, 62, 11925, 796, 357, 11925, 7, 33095, 2100, 8, 1343, 352, 8, 3373, 362, 1635, 362, 198, 220, 220, 220, 17910, 2100, 796, 17910, 2100, 13, 89, 20797, 7, 3605, 62, 11925, 8, 198, 220, 220, 220, 1441, 9874, 292, 979, 72, 13, 403, 33095, 75, 1958, 7, 33095, 2100, 13, 268, 8189, 10786, 292, 979, 72, 6, 4008, 628, 198, 4299, 2353, 62, 7890, 7, 7890, 2599, 198, 220, 220, 220, 705, 7061, 11869, 11629, 540, 286, 13934, 1366, 656, 257, 416, 9288, 1806, 611, 3306, 2637, 7061, 198, 220, 220, 220, 611, 350, 56, 2075, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2878, 13, 8002, 10786, 4, 36077, 6, 4064, 18896, 7, 7890, 828, 1635, 7890, 8, 198, 220, 220, 220, 1441, 1366, 198, 198, 4299, 976, 62, 2539, 7, 2539, 62, 64, 11, 1994, 62, 65, 2599, 198, 220, 220, 220, 705, 7061, 50249, 1653, 2163, 329, 1994, 4522, 393, 25338, 13042, 11, 2263, 656, 198, 220, 220, 220, 1848, 15874, 4129, 2637, 7061, 198, 220, 220, 220, 611, 18896, 7, 2539, 62, 64, 8, 6624, 18896, 7, 2539, 62, 65, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 1994, 62, 64, 6624, 1994, 62, 65, 198, 220, 220, 220, 1288, 361, 18896, 7, 2539, 62, 64, 8, 1279, 18896, 7, 2539, 62, 65, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 1994, 62, 65, 13, 437, 2032, 342, 7, 2539, 62, 64, 8, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 1994, 62, 64, 13, 437, 2032, 342, 7, 2539, 62, 65, 8, 198 ]
1.851538
3,186
import parser_asc as parser_asc f = open("./entrada.txt", "r") input = f.read() instrucciones = parser_asc.parse(input) print('**************** Consola: ****************') for element in parser_asc.consola: print(element) print('**************** Salida: ****************') for element in parser_asc.salida: print(element)
[ 11748, 30751, 62, 3372, 355, 30751, 62, 3372, 198, 198, 69, 796, 1280, 7, 1911, 14, 298, 81, 4763, 13, 14116, 1600, 366, 81, 4943, 198, 15414, 796, 277, 13, 961, 3419, 198, 220, 220, 220, 220, 198, 8625, 622, 535, 295, 274, 796, 30751, 62, 3372, 13, 29572, 7, 15414, 8, 198, 4798, 10786, 8412, 3515, 5708, 25, 220, 8412, 11537, 198, 1640, 5002, 287, 30751, 62, 3372, 13, 5936, 5708, 25, 198, 220, 220, 220, 3601, 7, 30854, 8, 198, 198, 4798, 10786, 8412, 4849, 3755, 25, 220, 8412, 11537, 198, 1640, 5002, 287, 30751, 62, 3372, 13, 21680, 3755, 25, 198, 220, 220, 220, 3601, 7, 30854, 8 ]
3.027027
111
import pygame import pygame.locals from random import randrange, random try: pygame.init() print("O modulo pygame foi inicializado com sucesso") except: print("O modulo pygame não foi inicializado com sucesso") altura = 800 largura = 800 relogio = pygame.time.Clock() fundo = pygame.display.set_mode((altura,largura)) pygame.display.set_caption("Star Field") sky = [] for i in range(300): star = Star() sky.append(star) true = True while true: for event in pygame.event.get(): if event.type == pygame.QUIT: true = False break if event.type == pygame.KEYDOWN: if event.key == pygame.K_SPACE: true = False fundo.fill((0,0,0)) for star in sky: star.show() star.move() pygame.display.update() relogio.tick(60) pygame.quit()
[ 11748, 12972, 6057, 198, 11748, 12972, 6057, 13, 17946, 874, 198, 6738, 4738, 1330, 43720, 9521, 11, 4738, 198, 198, 28311, 25, 198, 220, 220, 220, 12972, 6057, 13, 15003, 3419, 198, 220, 220, 220, 3601, 7203, 46, 953, 43348, 12972, 6057, 11511, 72, 287, 6652, 528, 4533, 401, 424, 919, 78, 4943, 198, 16341, 25, 198, 220, 220, 220, 3601, 7203, 46, 953, 43348, 12972, 6057, 299, 28749, 11511, 72, 287, 6652, 528, 4533, 401, 424, 919, 78, 4943, 198, 198, 2501, 5330, 796, 10460, 198, 15521, 5330, 796, 10460, 628, 198, 2411, 519, 952, 796, 12972, 6057, 13, 2435, 13, 44758, 3419, 198, 10990, 78, 796, 12972, 6057, 13, 13812, 13, 2617, 62, 14171, 19510, 2501, 5330, 11, 15521, 5330, 4008, 198, 9078, 6057, 13, 13812, 13, 2617, 62, 6888, 1159, 7203, 8248, 7663, 4943, 198, 198, 15688, 796, 17635, 198, 1640, 1312, 287, 2837, 7, 6200, 2599, 198, 220, 220, 220, 3491, 796, 2907, 3419, 198, 220, 220, 220, 6766, 13, 33295, 7, 7364, 8, 198, 198, 7942, 796, 6407, 198, 4514, 2081, 25, 198, 220, 220, 220, 329, 1785, 287, 12972, 6057, 13, 15596, 13, 1136, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1785, 13, 4906, 6624, 12972, 6057, 13, 10917, 2043, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2081, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1785, 13, 4906, 6624, 12972, 6057, 13, 20373, 41925, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 1785, 13, 2539, 6624, 12972, 6057, 13, 42, 62, 4303, 11598, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2081, 796, 10352, 198, 220, 220, 220, 1814, 78, 13, 20797, 19510, 15, 11, 15, 11, 15, 4008, 628, 220, 220, 220, 329, 3491, 287, 6766, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3491, 13, 12860, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 3491, 13, 21084, 3419, 628, 220, 220, 220, 12972, 6057, 13, 13812, 13, 19119, 3419, 198, 220, 220, 220, 823, 519, 952, 13, 42298, 7, 1899, 8, 198, 198, 9078, 6057, 13, 47391, 3419 ]
2.248021
379
# -*- coding: utf-8 -*- DEFAULT_TOKEN = b"ThisIsAnInsecurePublicTokenDontUseIt" DEFAULT_SALT = "Quisque vulputate nibh eros, vehicula sollicitudin neque pellentesque quis" DEFAULT_LOGIN_PATH = 'ajaxlogin' DEFAULT_NEW_TOKEN_PATH = 'ajaxtoken'
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 7206, 38865, 62, 10468, 43959, 796, 275, 1, 1212, 3792, 2025, 818, 22390, 15202, 30642, 35, 756, 11041, 1026, 1, 198, 198, 7206, 38865, 62, 50, 31429, 796, 366, 4507, 271, 4188, 24477, 1996, 378, 33272, 71, 1931, 418, 11, 2844, 291, 4712, 523, 297, 3628, 463, 259, 497, 4188, 613, 297, 298, 28939, 627, 271, 1, 198, 198, 7206, 38865, 62, 25294, 1268, 62, 34219, 796, 705, 1228, 897, 38235, 6, 198, 198, 7206, 38865, 62, 13965, 62, 10468, 43959, 62, 34219, 796, 705, 27792, 742, 4233, 6, 198 ]
2.342857
105
from util import excute_query_, excute_query from util import database import sys if __name__ == '__main__': testfile = sys.argv[1] main(testfile)
[ 6738, 7736, 1330, 2859, 1133, 62, 22766, 62, 11, 2859, 1133, 62, 22766, 198, 6738, 7736, 1330, 6831, 198, 11748, 25064, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1332, 7753, 796, 25064, 13, 853, 85, 58, 16, 60, 198, 220, 220, 220, 1388, 7, 9288, 7753, 8, 220, 198, 220, 220, 220, 220, 198 ]
2.164706
85
"""Hazelcast Core objects and constants.""" import json CLIENT_TYPE = "PYH" SERIALIZATION_VERSION = 1 class MemberInfo(object): """ Represents a member in the cluster with its address, uuid, lite member status, attributes, version, and address map. """ __slots__ = ("address", "uuid", "attributes", "lite_member", "version", "address_map") class Address(object): """Represents an address of a member in the cluster.""" class ProtocolType(object): """Types of server sockets. A member typically responds to several types of protocols for member-to-member, client-member protocol, WAN communication etc. The default configuration uses a single server socket to listen for all kinds of protocol types configured, while Advanced Network Config of the server allows configuration of multiple server sockets. """ # We had to put dummy documentations for the constants # so that they are displayed on the API documentation. MEMBER = 0 """Type of member server sockets.""" CLIENT = 1 """Type of client server sockets.""" WAN = 2 """Type of WAN server sockets.""" REST = 3 """Type of REST server sockets.""" MEMCACHE = 4 """Type of Memcached server sockets.""" class EndpointQualifier(object): """Uniquely identifies groups of network connections sharing a common :class:`ProtocolType` and the same network settings, when Hazelcast server is configured with Advanced Network Configuration enabled. In some cases, just the :class:`ProtocolType` is enough (e.g. since there can be only a single member server socket). When just the :class:`ProtocolType` is not enough (for example when configuring outgoing WAN connections to 2 different target clusters), an :attr:`identifier` is used to uniquely identify the network configuration. """ __slots__ = ("_protocol_type", "_identifier") @property def protocol_type(self): """ProtocolType: Protocol type of the endpoint.""" return self._protocol_type @property def identifier(self): """str: Unique identifier for same-protocol-type endpoints.""" return self._identifier class DistributedObjectEventType(object): """Type of the distributed object event.""" CREATED = "CREATED" """ DistributedObject is created. """ DESTROYED = "DESTROYED" """ DistributedObject is destroyed. """ class DistributedObjectEvent(object): """Distributed Object Event""" class SimpleEntryView(object): """EntryView represents a readonly view of a map entry.""" class HazelcastJsonValue(object): """HazelcastJsonValue is a wrapper for JSON formatted strings. It is preferred to store HazelcastJsonValue instead of Strings for JSON formatted strings. Users can run predicates and use indexes on the attributes of the underlying JSON strings. HazelcastJsonValue is queried using Hazelcast's querying language. In terms of querying, numbers in JSON strings are treated as either Long or Double in the Java side. str, bool and None are treated as String, boolean and null respectively. HazelcastJsonValue keeps given string as it is. Strings are not checked for being valid. Ill-formatted JSON strings may cause false positive or false negative results in queries. HazelcastJsonValue can also be constructed from JSON serializable objects. In that case, objects are converted to JSON strings and stored as such. If an error occurs during the conversion, it is raised directly. None values are not allowed. """ def to_string(self): """Returns unaltered string that was used to create this object. Returns: str: The original string. """ return self._json_string def loads(self): """Deserializes the string that was used to create this object and returns as Python object. Returns: any: The Python object represented by the original string. """ return json.loads(self._json_string) class MemberVersion(object): """ Determines the Hazelcast codebase version in terms of major.minor.patch version. """ __slots__ = ("major", "minor", "patch") class MapEntry(object): """ Represents the entry of a Map, with key and value fields. """ __slots__ = ("_key", "_value") @property def key(self): """Key of the entry.""" return self._key @property def value(self): """Value of the entry.""" return self._value
[ 37811, 39, 41319, 2701, 7231, 5563, 290, 38491, 526, 15931, 198, 11748, 33918, 628, 198, 5097, 28495, 62, 25216, 796, 366, 47, 56, 39, 1, 198, 35009, 12576, 14887, 6234, 62, 43717, 796, 352, 628, 198, 4871, 10239, 12360, 7, 15252, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1432, 6629, 257, 2888, 287, 262, 13946, 351, 663, 2209, 11, 334, 27112, 11, 300, 578, 2888, 198, 220, 220, 220, 3722, 11, 12608, 11, 2196, 11, 290, 2209, 3975, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 11593, 6649, 1747, 834, 796, 5855, 21975, 1600, 366, 12303, 312, 1600, 366, 1078, 7657, 1600, 366, 36890, 62, 19522, 1600, 366, 9641, 1600, 366, 21975, 62, 8899, 4943, 628, 198, 4871, 17917, 7, 15252, 2599, 198, 220, 220, 220, 37227, 6207, 6629, 281, 2209, 286, 257, 2888, 287, 262, 13946, 526, 15931, 628, 198, 4871, 20497, 6030, 7, 15252, 2599, 198, 220, 220, 220, 37227, 31431, 286, 4382, 37037, 13, 628, 220, 220, 220, 317, 2888, 6032, 20067, 284, 1811, 3858, 286, 19565, 329, 198, 220, 220, 220, 2888, 12, 1462, 12, 19522, 11, 5456, 12, 19522, 8435, 11, 370, 1565, 6946, 3503, 13, 383, 198, 220, 220, 220, 4277, 8398, 3544, 257, 2060, 4382, 17802, 284, 6004, 329, 477, 6982, 198, 220, 220, 220, 286, 8435, 3858, 17839, 11, 981, 13435, 7311, 17056, 286, 262, 4382, 198, 220, 220, 220, 3578, 8398, 286, 3294, 4382, 37037, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 1303, 775, 550, 284, 1234, 31548, 3188, 602, 329, 262, 38491, 198, 220, 220, 220, 1303, 523, 326, 484, 389, 9066, 319, 262, 7824, 10314, 13, 628, 220, 220, 220, 337, 28952, 796, 657, 198, 220, 220, 220, 37227, 6030, 286, 2888, 4382, 37037, 526, 15931, 628, 220, 220, 220, 45148, 796, 352, 198, 220, 220, 220, 37227, 6030, 286, 5456, 4382, 37037, 526, 15931, 628, 220, 220, 220, 370, 1565, 796, 362, 198, 220, 220, 220, 37227, 6030, 286, 370, 1565, 4382, 37037, 526, 15931, 628, 220, 220, 220, 30617, 796, 513, 198, 220, 220, 220, 37227, 6030, 286, 30617, 4382, 37037, 526, 15931, 628, 220, 220, 220, 35153, 34, 2246, 13909, 796, 604, 198, 220, 220, 220, 37227, 6030, 286, 4942, 66, 2317, 4382, 37037, 526, 15931, 628, 198, 4871, 5268, 4122, 46181, 7483, 7, 15252, 2599, 198, 220, 220, 220, 37227, 40257, 306, 21079, 2628, 286, 3127, 8787, 7373, 257, 2219, 198, 220, 220, 220, 1058, 4871, 25, 63, 19703, 4668, 6030, 63, 290, 262, 976, 3127, 6460, 11, 618, 42805, 2701, 4382, 198, 220, 220, 220, 318, 17839, 351, 13435, 7311, 28373, 9343, 13, 628, 220, 220, 220, 554, 617, 2663, 11, 655, 262, 1058, 4871, 25, 63, 19703, 4668, 6030, 63, 318, 1576, 357, 68, 13, 70, 13, 1201, 612, 198, 220, 220, 220, 460, 307, 691, 257, 2060, 2888, 4382, 17802, 737, 628, 220, 220, 220, 1649, 655, 262, 1058, 4871, 25, 63, 19703, 4668, 6030, 63, 318, 407, 1576, 357, 1640, 1672, 618, 198, 220, 220, 220, 4566, 870, 28181, 370, 1565, 8787, 284, 362, 1180, 2496, 23163, 828, 198, 220, 220, 220, 281, 1058, 35226, 25, 63, 738, 7483, 63, 318, 973, 284, 24139, 5911, 262, 3127, 198, 220, 220, 220, 8398, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 11593, 6649, 1747, 834, 796, 5855, 62, 11235, 4668, 62, 4906, 1600, 45434, 738, 7483, 4943, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 8435, 62, 4906, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 19703, 4668, 6030, 25, 20497, 2099, 286, 262, 36123, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13557, 11235, 4668, 62, 4906, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 27421, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 2536, 25, 30015, 27421, 329, 976, 12, 11235, 4668, 12, 4906, 886, 13033, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13557, 738, 7483, 628, 628, 198, 4871, 4307, 6169, 10267, 9237, 6030, 7, 15252, 2599, 198, 220, 220, 220, 37227, 6030, 286, 262, 9387, 2134, 1785, 526, 15931, 628, 220, 220, 220, 29244, 11617, 796, 366, 43387, 11617, 1, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4307, 6169, 10267, 318, 2727, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 22196, 5446, 21414, 1961, 796, 366, 30910, 5446, 21414, 1961, 1, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4307, 6169, 10267, 318, 6572, 13, 198, 220, 220, 220, 37227, 628, 198, 4871, 4307, 6169, 10267, 9237, 7, 15252, 2599, 198, 220, 220, 220, 37227, 20344, 6169, 9515, 8558, 37811, 628, 198, 4871, 17427, 30150, 7680, 7, 15252, 2599, 198, 220, 220, 220, 37227, 30150, 7680, 6870, 257, 1100, 8807, 1570, 286, 257, 3975, 5726, 526, 15931, 628, 198, 4871, 42805, 2701, 41, 1559, 11395, 7, 15252, 2599, 198, 220, 220, 220, 37227, 39, 41319, 2701, 41, 1559, 11395, 318, 257, 29908, 329, 19449, 39559, 13042, 13, 628, 220, 220, 220, 632, 318, 9871, 284, 3650, 42805, 2701, 41, 1559, 11395, 2427, 286, 4285, 654, 329, 19449, 39559, 13042, 13, 198, 220, 220, 220, 18987, 460, 1057, 2747, 16856, 290, 779, 39199, 319, 262, 12608, 286, 262, 10238, 198, 220, 220, 220, 19449, 13042, 13, 628, 220, 220, 220, 42805, 2701, 41, 1559, 11395, 318, 42517, 798, 1262, 42805, 2701, 338, 42517, 1112, 3303, 13, 628, 220, 220, 220, 554, 2846, 286, 42517, 1112, 11, 3146, 287, 19449, 13042, 389, 5716, 355, 2035, 198, 220, 220, 220, 5882, 393, 11198, 287, 262, 7349, 1735, 13, 965, 11, 20512, 290, 6045, 198, 220, 220, 220, 389, 5716, 355, 10903, 11, 25131, 290, 9242, 8148, 13, 628, 220, 220, 220, 42805, 2701, 41, 1559, 11395, 7622, 1813, 4731, 355, 340, 318, 13, 4285, 654, 389, 407, 198, 220, 220, 220, 10667, 329, 852, 4938, 13, 5821, 12, 687, 16898, 19449, 13042, 743, 2728, 3991, 198, 220, 220, 220, 3967, 393, 3991, 4633, 2482, 287, 20743, 13, 628, 220, 220, 220, 42805, 2701, 41, 1559, 11395, 460, 635, 307, 12006, 422, 19449, 11389, 13821, 5563, 13, 198, 220, 220, 220, 554, 326, 1339, 11, 5563, 389, 11513, 284, 19449, 13042, 290, 8574, 355, 884, 13, 198, 220, 220, 220, 1002, 281, 4049, 8833, 1141, 262, 11315, 11, 340, 318, 4376, 3264, 13, 628, 220, 220, 220, 6045, 3815, 389, 407, 3142, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 284, 62, 8841, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 35561, 555, 282, 4400, 4731, 326, 373, 973, 284, 2251, 428, 2134, 13, 628, 220, 220, 220, 220, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 965, 25, 383, 2656, 4731, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13557, 17752, 62, 8841, 628, 220, 220, 220, 825, 15989, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 5960, 48499, 4340, 262, 4731, 326, 373, 973, 284, 2251, 428, 2134, 198, 220, 220, 220, 220, 220, 220, 220, 290, 5860, 355, 11361, 2134, 13, 628, 220, 220, 220, 220, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 597, 25, 383, 11361, 2134, 7997, 416, 262, 2656, 4731, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 33918, 13, 46030, 7, 944, 13557, 17752, 62, 8841, 8, 628, 198, 4871, 10239, 14815, 7, 15252, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 360, 13221, 274, 262, 42805, 2701, 2438, 8692, 2196, 287, 2846, 286, 1688, 13, 1084, 273, 13, 17147, 2196, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 11593, 6649, 1747, 834, 796, 5855, 22478, 1600, 366, 1084, 273, 1600, 366, 17147, 4943, 628, 198, 4871, 9347, 30150, 7, 15252, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1432, 6629, 262, 5726, 286, 257, 9347, 11, 351, 1994, 290, 1988, 7032, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 11593, 6649, 1747, 834, 796, 5855, 62, 2539, 1600, 45434, 8367, 4943, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 1994, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 9218, 286, 262, 5726, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13557, 2539, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 1988, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 11395, 286, 262, 5726, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13557, 8367, 198 ]
3.175222
1,461
from .signate import Signate __all__ = ['Signate']
[ 6738, 764, 12683, 378, 1330, 5865, 378, 198, 198, 834, 439, 834, 796, 37250, 11712, 378, 20520 ]
3
17
"""Unit test package for otpstore."""
[ 37811, 26453, 1332, 5301, 329, 30972, 79, 8095, 526, 15931, 198 ]
3.454545
11
#!/usr/bin/python from Solution import Solution obj = Solution() #A = [2,3,-2,4] A = [-2,0,-1] print(obj.maxProduct(A))
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 198, 6738, 28186, 1330, 28186, 198, 26801, 796, 28186, 3419, 198, 198, 2, 32, 796, 685, 17, 11, 18, 12095, 17, 11, 19, 60, 198, 32, 796, 25915, 17, 11, 15, 12095, 16, 60, 198, 198, 4798, 7, 26801, 13, 9806, 15667, 7, 32, 4008, 198 ]
2.277778
54
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------- # Copyright (c) 2020 # # See the LICENSE file for details # see the AUTHORS file for authors # ---------------------------------------------------------------------- #-------------------- # System wide imports # ------------------- import sys import sqlite3 import os.path import glob import logging import csv import datetime import math import hashlib import time import re import collections # --------------------- # Third party libraries # --------------------- #-------------- # local imports # ------------- from . import AZOTEA_CSV_DIR, AZOTEA_CFG_DIR from .camera import CameraImage, CameraCache, MetadataError, ConfigError from .utils import merge_two_dicts, paging, LogCounter from .exceptions import MixingCandidates, NoUserInfoError from .config import load_config_file, merge_options # ---------------- # Module constants # ---------------- # values for the 'state' column in table REGISTERED = 0 STATS_COMPUTED = 1 METADATA_UPDATED = 3 DARK_SUBSTRACTED = 3 # (bit) flags for the 'meta_changes' column in table NO_CHANGES = 0 CAMERA_CHANGES = 1 OBSERVER_CHANGES = 2 # Values for the 'tyoe' column LIGHT_FRAME = "LIGHT" BIAS_FRAME = "BIAS" DARK_FRAME = "DARK" UNKNOWN = "UNKNOWN" N_COUNT = 50 # ----------------------- # Module global variables # ----------------------- log = logging.getLogger("azotea") if sys.version_info[0] == 2: import errno # ======================= # Module global functions # ======================= # ----------------- # Utility functions # ----------------- RE_DARK = re.compile(r'.*DARK.*\..{3}') def latest_session(connection): '''Get Last recorded session''' cursor = connection.cursor() cursor.execute(''' SELECT MAX(session) FROM image_t ''') return cursor.fetchone()[0] def hash(filepath): '''Compute a hash from the image''' BLOCK_SIZE = 1048576 # 1MByte, the size of each read from the file # md5() was the fastest algorithm I've tried # but I detected a collision, so I now use blake2b with twice the digest size file_hash = hashlib.blake2b(digest_size=32) #file_hash = hashlib.md5() with open(filepath, 'rb') as f: block = f.read(BLOCK_SIZE) while len(block) > 0: file_hash.update(block) block = f.read(BLOCK_SIZE) return file_hash.digest() # -------------- # Image Register # -------------- def register_insert_image(connection, row): '''slow version to find out the exact duplicate''' cursor = connection.cursor() cursor.execute( ''' INSERT OR IGNORE INTO image_t ( name, hash, session, type, state, meta_changes ) VALUES ( :name, :hash, :session, :type, :state, :changes ) ''', row) connection.commit() def register_insert_images(connection, rows): '''fast version''' cursor = connection.cursor() cursor.executemany( ''' INSERT OR IGNORE INTO image_t ( name, hash, session, type, state, meta_changes ) VALUES ( :name, :hash, :session, :type, :state, :changes ) ''', rows) connection.commit() log.info("Registered %d / %d images in database", cursor.rowcount, len(rows)) def candidates(connection, work_dir, filt, session): '''candidate list of images to be inserted/removed to/from the database''' # New Images in the work dir that should be added to database cursor = connection.cursor() # This commented query may take long to execute if the database is large # better we leave it fail in the insertion, where the hash duplication is detected # cursor.execute( # ''' # SELECT name, hash # FROM candidate_t # WHERE hash NOT IN (SELECT hash FROM image_t) # ''' # ) # This query will have far less elements to fetch # This will introduce duplicates which will be rejected by the INSERT or IGNORE # when inserting new images cursor.execute("SELECT name, hash FROM candidate_t") result = cursor.fetchall() if result: #names_to_add, = zip(*result) names_to_add = result else: names_to_add = [] # Images no longer in the work dir, they should be deleted from database row = {'session': session} cursor.execute( ''' SELECT name, hash FROM image_t WHERE session = :session AND hash NOT IN (SELECT hash FROM candidate_t) ''', row) result = cursor.fetchall() if result: #names_to_del, = zip(*result) names_to_del = result else: names_to_del = [] return names_to_add, names_to_del def register_delete_images(connection, rows): '''delete images''' cursor = connection.cursor() cursor.executemany( ''' DELETE FROM image_t WHERE hash == :hash ''', rows) connection.commit() log.info("Deleted %d / %d images from database", cursor.rowcount, len(rows)) # Tal como esta montado ahora candidates(), es imposible introducir una imagen # duplicada porque se cumprueba primero que su hash no esta ya en la BD # Y por tanbo register_low() es innecesario. # Sin embargo candidates() podría enlentecerse al aumentar el número de imagenes de la BD # Por lo que al final register_slow() podría ser una opcion # -------------- # Image Classify # -------------- # ----------- # Image Stats # ----------- def stats_unregister(connection, rows): '''Unregister an image who gave an exception reaing the pixel data''' cursor = connection.cursor() cursor.executemany( ''' DELETE FROM image_t WHERE hash == :hash ''', rows) connection.commit() log.info("Deleted %d / %d images from database", cursor.rowcount, len(rows)) # --------------- # Metadata Update # --------------- # ----------------------------- # Image Apply Dark Substraction # ----------------------------- # ----------- # Image Export # ----------- EXPORT_HEADERS = [ 'tstamp' , 'name' , 'model' , 'iso' , 'roi' , 'dark_roi' , 'exptime' , 'aver_signal_R1' , 'std_signal_R1' , 'aver_signal_G2' , 'std_signal_G2' , 'aver_signal_G3' , 'std_signal_G3' , 'aver_signal_B4' , 'std_signal_B4' , 'aver_dark_R1' , 'std_dark_R1' , 'aver_dark_G2' , 'std_dark_G2' , 'aver_dark_G3' , 'std_dark_G3' , 'aver_dark_B4' , 'std_dark_B4' , 'bias' , ] # we are not using the image_v VIEW for the time being # We display the RAW data without dark and bias substraction # we are not using the image_v VIEW for the time being # We display the RAW data without dark and bias substraction def var2std(item): '''From Variance to StdDev in several columns''' index, value = item # Calculate stddev from variance and round to one decimal place if index in [13, 15, 17, 19, 21, 23, 25, 27]: value = round(math.sqrt(value),1) # Round the aver_signal channels too elif index in [12, 14, 16, 18, 20, 22, 24, 26]: value = round(value, 1) return value def do_export_work_dir(connection, session, work_dir, options): '''Export a working directory of image redictions to a single file''' fieldnames = ["session","observer","organization","location","type"] fieldnames.extend(EXPORT_HEADERS) if not session_processed(connection, session): log.info("No new CSV file generation") return for (night,) in night_iterable(connection, session): # Write a session CSV file session_csv_file = get_file_path(connection, night, work_dir, options) with myopen(session_csv_file, 'w') as csvfile: writer = csv.writer(csvfile, delimiter=';') writer.writerow(fieldnames) for row in export_session_iterable(connection, session, night): row = map(var2std, enumerate(row)) writer.writerow(row) log.info("Saved data to session CSV file {0}".format(session_csv_file)) def do_export_all(connection, options): '''Exports all the database to a single file''' fieldnames = ["session","observer","organization","location","type"] fieldnames.extend(EXPORT_HEADERS) with myopen(options.csv_file, 'w') as csvfile: writer = csv.writer(csvfile, delimiter=';') writer.writerow(fieldnames) for row in export_all_iterable(connection): row = map(var2std, enumerate(row)) writer.writerow(row) log.info("Saved data to global CSV file {0}".format(options.csv_file)) # ================================== # Image List subcommands and options # ================================== EXIF_HEADERS = [ 'Name', 'Session', 'Timestamp', 'Model', 'Exposure', 'ISO', 'Focal', 'f/' ] GLOBAL_HEADERS = [ 'Name', 'Type', 'Session', 'Observer', 'Organiztaion', 'Location', 'ROI', ] STATE_HEADERS = [ "Name", "Session", "Type", "State", ] DATA_HEADERS = [ "Name", "ROI", "Bias", "\u03BC R1", "\u03C3^2 R1", "\u03BC G2", "\u03C3^2 G2", "\u03BC G3", "\u03C3^2 G3", "\u03BC B4", "\u03C3^2 B4", ] RAW_DATA_HEADERS = [ "Name", "ROI" , "Bias", "Raw \u03BC R1", "Raw \u03C3^2 R1", "Raw \u03BC G2", "Raw \u03C3^2 G2", "Raw \u03BC G3", "Raw \u03C3^2 G3", "Raw \u03BC B4", "Raw \u03C3^2 B4", ] DARK_DATA_HEADERS = [ "Name", "ROI" , "Bias", "Dark \u03BC R1", "Dark \u03C3^2 R1", "Dark \u03BC G2", "Dark \u03C3^2 G2", "Dark \u03BC G3", "Dark \u03C3^2 G3", "Dark \u03BC B4", "Dark \u03C3^2 B4", ] # -------------- # Image metadata # -------------- def view_meta_exif_session_iterable(connection, session): '''session may be None for NULL''' row = {'session': session} cursor = connection.cursor() count = view_session_count(cursor, session) cursor.execute( ''' SELECT name, session, tstamp, model, exptime, iso, focal_length, f_number FROM image_t WHERE session = :session ORDER BY name DESC ''', row) return cursor, count # ------------ # Image General # ------------- def view_meta_global_session_iterable(connection, session): '''session may be None for NULL''' row = {'session': session} cursor = connection.cursor() count = view_session_count(cursor, session) cursor.execute( ''' SELECT name, type, session, observer, organization, email, location, roi FROM image_t WHERE session = :session ORDER BY name ASC ''', row) return cursor, count # ----------- # Image State # ----------- # ----------- # Image Data # ----------- # ------------- # Raw Image Data # -------------- # -------------- # Dark Image Data # --------------- # ---------------- # View Master Dark # ----------------- MASTER_DARK_HEADERS = [ "Session", "# Darks", "ROI", "Good?", "\u03BC R1", "\u03C3^2 R1", "\u03BC G2", "\u03C3^2 G2", "\u03BC G3", "\u03C3^2 G3", "\u03BC B4", "\u03C3^2 B4", ] # --------- # View Dark # ---------- # ===================== # Command esntry points # ===================== # These display various data
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 16529, 23031, 198, 2, 15069, 357, 66, 8, 12131, 198, 2, 198, 2, 4091, 262, 38559, 24290, 2393, 329, 3307, 198, 2, 766, 262, 37195, 20673, 2393, 329, 7035, 198, 2, 16529, 23031, 198, 198, 2, 19351, 198, 2, 4482, 3094, 17944, 198, 2, 34400, 6329, 198, 198, 11748, 25064, 198, 11748, 44161, 578, 18, 198, 11748, 28686, 13, 6978, 198, 11748, 15095, 198, 11748, 18931, 198, 11748, 269, 21370, 198, 11748, 4818, 8079, 198, 11748, 10688, 198, 11748, 12234, 8019, 198, 11748, 640, 198, 11748, 302, 198, 11748, 17268, 198, 198, 2, 41436, 12, 198, 2, 10467, 2151, 12782, 198, 2, 41436, 12, 198, 198, 2, 26171, 198, 2, 1957, 17944, 198, 2, 220, 32501, 198, 198, 6738, 764, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 26253, 2394, 16412, 62, 7902, 53, 62, 34720, 11, 26253, 2394, 16412, 62, 22495, 38, 62, 34720, 198, 6738, 764, 25695, 220, 220, 220, 220, 1330, 20432, 5159, 11, 20432, 30562, 11, 3395, 14706, 12331, 11, 17056, 12331, 198, 6738, 764, 26791, 220, 220, 220, 220, 220, 1330, 20121, 62, 11545, 62, 11600, 82, 11, 279, 3039, 11, 5972, 31694, 198, 6738, 764, 1069, 11755, 1330, 15561, 278, 41572, 37051, 11, 1400, 12982, 12360, 12331, 198, 6738, 764, 11250, 220, 220, 220, 220, 1330, 3440, 62, 11250, 62, 7753, 11, 20121, 62, 25811, 628, 198, 2, 34400, 198, 2, 19937, 38491, 198, 2, 34400, 198, 198, 2, 3815, 329, 262, 705, 5219, 6, 5721, 287, 3084, 198, 31553, 41517, 1961, 220, 220, 220, 220, 220, 220, 796, 657, 198, 2257, 33586, 62, 9858, 30076, 1961, 220, 220, 796, 352, 198, 47123, 2885, 13563, 62, 52, 49316, 796, 513, 198, 35, 14175, 62, 50, 10526, 18601, 38542, 796, 513, 198, 198, 2, 357, 2545, 8, 9701, 329, 262, 705, 28961, 62, 36653, 6, 5721, 287, 3084, 198, 15285, 62, 3398, 15567, 1546, 220, 220, 220, 220, 220, 220, 796, 657, 198, 34, 2390, 46461, 62, 3398, 15567, 1546, 220, 220, 796, 352, 198, 46, 4462, 1137, 5959, 62, 3398, 15567, 1546, 796, 362, 198, 198, 2, 27068, 329, 262, 705, 774, 2577, 6, 5721, 198, 43, 9947, 62, 10913, 10067, 796, 366, 43, 9947, 1, 198, 3483, 1921, 62, 10913, 10067, 220, 796, 366, 3483, 1921, 1, 198, 35, 14175, 62, 10913, 10067, 220, 796, 366, 35, 14175, 1, 198, 4944, 44706, 220, 220, 220, 220, 796, 366, 4944, 44706, 1, 198, 198, 45, 62, 34, 28270, 796, 2026, 198, 198, 2, 41436, 6329, 198, 2, 19937, 3298, 9633, 198, 2, 41436, 6329, 198, 198, 6404, 796, 18931, 13, 1136, 11187, 1362, 7203, 1031, 1258, 64, 4943, 628, 198, 361, 25064, 13, 9641, 62, 10951, 58, 15, 60, 6624, 362, 25, 198, 220, 220, 220, 1330, 11454, 3919, 198, 198, 2, 36658, 50155, 198, 2, 19937, 3298, 5499, 198, 2, 36658, 50155, 198, 198, 2, 34400, 12, 198, 2, 34030, 5499, 198, 2, 34400, 12, 628, 198, 2200, 62, 35, 14175, 796, 302, 13, 5589, 576, 7, 81, 4458, 9, 35, 14175, 15885, 59, 492, 90, 18, 92, 11537, 628, 198, 198, 4299, 3452, 62, 29891, 7, 38659, 2599, 198, 220, 220, 220, 705, 7061, 3855, 4586, 6264, 6246, 7061, 6, 198, 220, 220, 220, 23493, 796, 4637, 13, 66, 21471, 3419, 198, 220, 220, 220, 23493, 13, 41049, 7, 7061, 6, 198, 220, 220, 220, 220, 220, 220, 220, 33493, 25882, 7, 29891, 8, 198, 220, 220, 220, 220, 220, 220, 220, 16034, 2939, 62, 83, 220, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 8, 198, 220, 220, 220, 1441, 23493, 13, 69, 7569, 505, 3419, 58, 15, 60, 628, 198, 198, 4299, 12234, 7, 7753, 6978, 2599, 198, 220, 220, 220, 705, 7061, 7293, 1133, 257, 12234, 422, 262, 2939, 7061, 6, 198, 220, 220, 220, 9878, 11290, 62, 33489, 796, 838, 2780, 37452, 1303, 352, 44, 40778, 11, 262, 2546, 286, 1123, 1100, 422, 262, 2393, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1303, 45243, 20, 3419, 373, 262, 14162, 11862, 314, 1053, 3088, 198, 220, 220, 220, 1303, 475, 314, 12326, 257, 17661, 11, 523, 314, 783, 779, 698, 539, 17, 65, 351, 5403, 262, 16274, 2546, 198, 220, 220, 220, 220, 198, 220, 220, 220, 2393, 62, 17831, 796, 12234, 8019, 13, 2436, 539, 17, 65, 7, 12894, 395, 62, 7857, 28, 2624, 8, 198, 220, 220, 220, 1303, 7753, 62, 17831, 796, 12234, 8019, 13, 9132, 20, 3419, 198, 220, 220, 220, 351, 1280, 7, 7753, 6978, 11, 705, 26145, 11537, 355, 277, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2512, 796, 277, 13, 961, 7, 9148, 11290, 62, 33489, 8, 220, 198, 220, 220, 220, 220, 220, 220, 220, 981, 18896, 7, 9967, 8, 1875, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2393, 62, 17831, 13, 19119, 7, 9967, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 796, 277, 13, 961, 7, 9148, 11290, 62, 33489, 8, 198, 220, 220, 220, 1441, 2393, 62, 17831, 13, 12894, 395, 3419, 628, 628, 628, 628, 628, 198, 198, 2, 220, 26171, 198, 2, 7412, 17296, 198, 2, 220, 26171, 198, 198, 4299, 7881, 62, 28463, 62, 9060, 7, 38659, 11, 5752, 2599, 198, 220, 220, 220, 705, 7061, 38246, 2196, 284, 1064, 503, 262, 2748, 23418, 7061, 6, 198, 220, 220, 220, 23493, 796, 4637, 13, 66, 21471, 3419, 198, 220, 220, 220, 23493, 13, 41049, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 29194, 17395, 6375, 28730, 6965, 39319, 2939, 62, 83, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1438, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 12234, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6246, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13634, 62, 36653, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 26173, 35409, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 3672, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 17831, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 29891, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 5219, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 36653, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10148, 3256, 5752, 8, 198, 220, 220, 220, 4637, 13, 41509, 3419, 198, 220, 220, 220, 220, 198, 198, 4299, 7881, 62, 28463, 62, 17566, 7, 38659, 11, 15274, 2599, 198, 220, 220, 220, 705, 7061, 7217, 2196, 7061, 6, 198, 220, 220, 220, 23493, 796, 4637, 13, 66, 21471, 3419, 198, 220, 220, 220, 23493, 13, 18558, 315, 368, 1092, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 29194, 17395, 6375, 28730, 6965, 39319, 2939, 62, 83, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1438, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 12234, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6246, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13634, 62, 36653, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 26173, 35409, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 3672, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 17831, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 29891, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 5219, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 36653, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10148, 3256, 15274, 8, 198, 220, 220, 220, 4637, 13, 41509, 3419, 198, 220, 220, 220, 2604, 13, 10951, 7203, 47473, 4064, 67, 1220, 4064, 67, 4263, 287, 6831, 1600, 23493, 13, 808, 9127, 11, 18896, 7, 8516, 4008, 628, 198, 4299, 5871, 7, 38659, 11, 670, 62, 15908, 11, 1226, 83, 11, 6246, 2599, 198, 220, 220, 220, 705, 7061, 46188, 20540, 1351, 286, 4263, 284, 307, 18846, 14, 2787, 2668, 284, 14, 6738, 262, 6831, 7061, 6, 198, 220, 220, 220, 1303, 968, 5382, 287, 262, 670, 26672, 326, 815, 307, 2087, 284, 6831, 198, 220, 220, 220, 23493, 796, 4637, 13, 66, 21471, 3419, 198, 220, 220, 220, 1303, 770, 16476, 12405, 743, 1011, 890, 284, 12260, 611, 262, 6831, 318, 1588, 198, 220, 220, 220, 1303, 1365, 356, 2666, 340, 2038, 287, 262, 36075, 11, 810, 262, 12234, 50124, 318, 12326, 198, 220, 220, 220, 1303, 23493, 13, 41049, 7, 198, 220, 220, 220, 1303, 220, 220, 705, 7061, 198, 220, 220, 220, 1303, 220, 220, 33493, 1438, 11, 12234, 198, 220, 220, 220, 1303, 220, 220, 16034, 4540, 62, 83, 198, 220, 220, 220, 1303, 220, 220, 33411, 12234, 5626, 3268, 357, 46506, 12234, 16034, 2939, 62, 83, 8, 198, 220, 220, 220, 1303, 220, 220, 705, 7061, 198, 220, 220, 220, 1303, 220, 220, 1267, 628, 220, 220, 220, 1303, 770, 12405, 481, 423, 1290, 1342, 4847, 284, 21207, 198, 220, 220, 220, 1303, 770, 481, 10400, 14184, 16856, 543, 481, 307, 8606, 416, 262, 29194, 17395, 393, 28730, 6965, 198, 220, 220, 220, 1303, 618, 19319, 649, 4263, 198, 220, 220, 220, 23493, 13, 41049, 7203, 46506, 1438, 11, 12234, 16034, 4540, 62, 83, 4943, 198, 220, 220, 220, 1255, 796, 23493, 13, 69, 7569, 439, 3419, 198, 220, 220, 220, 611, 1255, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 14933, 62, 1462, 62, 2860, 11, 796, 19974, 46491, 20274, 8, 198, 220, 220, 220, 220, 220, 220, 220, 3891, 62, 1462, 62, 2860, 796, 1255, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3891, 62, 1462, 62, 2860, 796, 17635, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1303, 5382, 645, 2392, 287, 262, 670, 26672, 11, 484, 815, 307, 13140, 422, 6831, 198, 220, 220, 220, 5752, 796, 1391, 6, 29891, 10354, 6246, 92, 198, 220, 220, 220, 23493, 13, 41049, 7, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 33493, 1438, 11, 12234, 198, 220, 220, 220, 220, 220, 220, 220, 16034, 2939, 62, 83, 198, 220, 220, 220, 220, 220, 220, 220, 33411, 6246, 796, 1058, 29891, 198, 220, 220, 220, 220, 220, 220, 220, 5357, 12234, 5626, 3268, 357, 46506, 12234, 16034, 4540, 62, 83, 8, 198, 220, 220, 220, 220, 220, 220, 220, 10148, 3256, 5752, 8, 198, 220, 220, 220, 1255, 796, 23493, 13, 69, 7569, 439, 3419, 198, 220, 220, 220, 611, 1255, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 14933, 62, 1462, 62, 12381, 11, 796, 19974, 46491, 20274, 8, 198, 220, 220, 220, 220, 220, 220, 220, 3891, 62, 1462, 62, 12381, 796, 1255, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3891, 62, 1462, 62, 12381, 796, 17635, 198, 220, 220, 220, 1441, 3891, 62, 1462, 62, 2860, 11, 3891, 62, 1462, 62, 12381, 628, 198, 4299, 7881, 62, 33678, 62, 17566, 7, 38659, 11, 15274, 2599, 198, 220, 220, 220, 705, 7061, 33678, 4263, 7061, 6, 198, 220, 220, 220, 23493, 796, 4637, 13, 66, 21471, 3419, 198, 220, 220, 220, 23493, 13, 18558, 315, 368, 1092, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5550, 2538, 9328, 16034, 2939, 62, 83, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 33411, 12234, 220, 6624, 1058, 17831, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10148, 3256, 15274, 8, 198, 220, 220, 220, 4637, 13, 41509, 3419, 198, 220, 220, 220, 2604, 13, 10951, 7203, 5005, 33342, 4064, 67, 1220, 4064, 67, 4263, 422, 6831, 1600, 23493, 13, 808, 9127, 11, 18896, 7, 8516, 4008, 628, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 628, 198, 2, 7193, 401, 78, 1556, 64, 40689, 4533, 29042, 5799, 5871, 22784, 1658, 848, 418, 856, 3120, 66, 343, 555, 64, 3590, 268, 198, 2, 14184, 291, 4763, 16964, 4188, 384, 269, 931, 24508, 7012, 2684, 3529, 8358, 424, 12234, 645, 1556, 64, 21349, 551, 8591, 28023, 198, 2, 575, 16964, 25706, 2127, 7881, 62, 9319, 3419, 1658, 287, 710, 728, 4982, 13, 198, 2, 10884, 38286, 5871, 3419, 24573, 81, 29690, 551, 75, 298, 721, 263, 325, 435, 257, 1713, 283, 1288, 299, 21356, 647, 78, 390, 3590, 18719, 390, 8591, 28023, 198, 2, 20139, 2376, 8358, 435, 2457, 7881, 62, 38246, 3419, 24573, 81, 29690, 1055, 555, 64, 1034, 66, 295, 628, 198, 198, 2, 220, 26171, 198, 2, 7412, 5016, 1958, 198, 2, 220, 26171, 628, 628, 198, 198, 2, 24200, 6329, 198, 2, 7412, 20595, 198, 2, 24200, 6329, 628, 198, 198, 4299, 9756, 62, 403, 30238, 7, 38659, 11, 15274, 2599, 198, 220, 220, 220, 705, 7061, 3118, 30238, 281, 2939, 508, 2921, 281, 6631, 302, 64, 278, 262, 17465, 1366, 7061, 6, 198, 220, 220, 220, 23493, 796, 4637, 13, 66, 21471, 3419, 198, 220, 220, 220, 23493, 13, 18558, 315, 368, 1092, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5550, 2538, 9328, 16034, 2939, 62, 83, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 33411, 12234, 220, 6624, 1058, 17831, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10148, 3256, 15274, 8, 198, 220, 220, 220, 4637, 13, 41509, 3419, 198, 220, 220, 220, 2604, 13, 10951, 7203, 5005, 33342, 4064, 67, 1220, 4064, 67, 4263, 422, 6831, 1600, 23493, 13, 808, 9127, 11, 18896, 7, 8516, 4008, 198, 220, 220, 220, 220, 628, 198, 2, 220, 24305, 198, 2, 3395, 14706, 10133, 198, 2, 220, 24305, 628, 198, 2, 34400, 32501, 198, 2, 7412, 27967, 3801, 24944, 7861, 198, 2, 34400, 32501, 628, 628, 198, 198, 2, 24200, 6329, 198, 2, 7412, 36472, 198, 2, 24200, 6329, 628, 198, 6369, 15490, 62, 37682, 4877, 796, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 83, 301, 696, 6, 220, 220, 220, 220, 220, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 3672, 6, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19849, 6, 220, 220, 220, 220, 220, 220, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 26786, 6, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 305, 72, 6, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 21953, 62, 305, 72, 6, 220, 220, 220, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 1069, 457, 524, 6, 220, 220, 220, 220, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8770, 62, 12683, 282, 62, 49, 16, 6, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19282, 62, 12683, 282, 62, 49, 16, 6, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8770, 62, 12683, 282, 62, 38, 17, 6, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19282, 62, 12683, 282, 62, 38, 17, 6, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8770, 62, 12683, 282, 62, 38, 18, 6, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19282, 62, 12683, 282, 62, 38, 18, 6, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8770, 62, 12683, 282, 62, 33, 19, 6, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19282, 62, 12683, 282, 62, 33, 19, 6, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8770, 62, 21953, 62, 49, 16, 6, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19282, 62, 21953, 62, 49, 16, 6, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8770, 62, 21953, 62, 38, 17, 6, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19282, 62, 21953, 62, 38, 17, 6, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8770, 62, 21953, 62, 38, 18, 6, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19282, 62, 21953, 62, 38, 18, 6, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8770, 62, 21953, 62, 33, 19, 6, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 19282, 62, 21953, 62, 33, 19, 6, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 65, 4448, 6, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 837, 198, 220, 220, 220, 220, 220, 220, 220, 2361, 628, 198, 198, 2, 356, 389, 407, 1262, 262, 2939, 62, 85, 49880, 329, 262, 640, 852, 198, 2, 775, 3359, 262, 33782, 1366, 1231, 3223, 290, 10690, 3293, 7861, 198, 198, 2, 356, 389, 407, 1262, 262, 2939, 62, 85, 49880, 329, 262, 640, 852, 198, 2, 775, 3359, 262, 33782, 1366, 1231, 3223, 290, 10690, 3293, 7861, 628, 198, 4299, 1401, 17, 19282, 7, 9186, 2599, 198, 220, 220, 220, 705, 7061, 4863, 15965, 590, 284, 520, 67, 13603, 287, 1811, 15180, 7061, 6, 198, 220, 220, 220, 6376, 11, 1988, 796, 2378, 198, 220, 220, 220, 1303, 27131, 378, 336, 1860, 1990, 422, 24198, 290, 2835, 284, 530, 32465, 1295, 198, 220, 220, 220, 611, 220, 6376, 287, 220, 685, 1485, 11, 1315, 11, 1596, 11, 678, 11, 2310, 11, 2242, 11, 1679, 11, 2681, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 796, 2835, 7, 11018, 13, 31166, 17034, 7, 8367, 828, 16, 8, 198, 220, 220, 220, 1303, 10485, 262, 9076, 62, 12683, 282, 9619, 1165, 198, 220, 220, 220, 1288, 361, 6376, 287, 685, 1065, 11, 1478, 11, 1467, 11, 1248, 11, 1160, 11, 2534, 11, 1987, 11, 2608, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 1988, 796, 2835, 7, 8367, 11, 352, 8, 198, 220, 220, 220, 1441, 1988, 628, 198, 220, 220, 220, 220, 198, 198, 4299, 466, 62, 39344, 62, 1818, 62, 15908, 7, 38659, 11, 6246, 11, 670, 62, 15908, 11, 3689, 2599, 198, 220, 220, 220, 705, 7061, 43834, 257, 1762, 8619, 286, 2939, 2266, 9278, 284, 257, 2060, 2393, 7061, 6, 198, 220, 220, 220, 2214, 14933, 796, 14631, 29891, 2430, 672, 15388, 2430, 9971, 1634, 2430, 24886, 2430, 4906, 8973, 198, 220, 220, 220, 2214, 14933, 13, 2302, 437, 7, 6369, 15490, 62, 37682, 4877, 8, 198, 220, 220, 220, 611, 407, 6246, 62, 14681, 276, 7, 38659, 11, 6246, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2604, 13, 10951, 7203, 2949, 649, 44189, 2393, 5270, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 628, 220, 220, 220, 329, 357, 3847, 35751, 287, 1755, 62, 2676, 540, 7, 38659, 11, 6246, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 19430, 257, 6246, 44189, 2393, 198, 220, 220, 220, 220, 220, 220, 220, 6246, 62, 40664, 62, 7753, 796, 651, 62, 7753, 62, 6978, 7, 38659, 11, 1755, 11, 670, 62, 15908, 11, 3689, 8, 198, 220, 220, 220, 220, 220, 220, 220, 351, 616, 9654, 7, 29891, 62, 40664, 62, 7753, 11, 705, 86, 11537, 355, 269, 21370, 7753, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6260, 796, 269, 21370, 13, 16002, 7, 40664, 7753, 11, 46728, 2676, 11639, 26, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6260, 13, 16002, 322, 7, 3245, 14933, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 5752, 287, 10784, 62, 29891, 62, 2676, 540, 7, 38659, 11, 6246, 11, 1755, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5752, 796, 3975, 7, 7785, 17, 19282, 11, 27056, 378, 7, 808, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6260, 13, 16002, 322, 7, 808, 8, 198, 220, 220, 220, 2604, 13, 10951, 7203, 50, 9586, 1366, 284, 6246, 44189, 2393, 1391, 15, 92, 1911, 18982, 7, 29891, 62, 40664, 62, 7753, 4008, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198, 198, 4299, 466, 62, 39344, 62, 439, 7, 38659, 11, 220, 3689, 2599, 198, 220, 220, 220, 705, 7061, 3109, 3742, 477, 262, 6831, 284, 257, 2060, 2393, 7061, 6, 198, 220, 220, 220, 2214, 14933, 796, 14631, 29891, 2430, 672, 15388, 2430, 9971, 1634, 2430, 24886, 2430, 4906, 8973, 198, 220, 220, 220, 2214, 14933, 13, 2302, 437, 7, 6369, 15490, 62, 37682, 4877, 8, 198, 220, 220, 220, 351, 616, 9654, 7, 25811, 13, 40664, 62, 7753, 11, 705, 86, 11537, 355, 269, 21370, 7753, 25, 198, 220, 220, 220, 220, 220, 220, 220, 6260, 796, 269, 21370, 13, 16002, 7, 40664, 7753, 11, 46728, 2676, 11639, 26, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 6260, 13, 16002, 322, 7, 3245, 14933, 8, 198, 220, 220, 220, 220, 220, 220, 220, 329, 5752, 287, 10784, 62, 439, 62, 2676, 540, 7, 38659, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5752, 796, 3975, 7, 7785, 17, 19282, 11, 27056, 378, 7, 808, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6260, 13, 16002, 322, 7, 808, 8, 198, 220, 220, 220, 2604, 13, 10951, 7203, 50, 9586, 1366, 284, 3298, 44189, 2393, 1391, 15, 92, 1911, 18982, 7, 25811, 13, 40664, 62, 7753, 4008, 198, 198, 2, 46111, 28, 198, 2, 7412, 7343, 850, 9503, 1746, 290, 3689, 198, 2, 46111, 28, 628, 198, 6369, 5064, 62, 37682, 4877, 796, 685, 198, 220, 220, 220, 705, 5376, 3256, 198, 220, 220, 220, 705, 36044, 3256, 198, 220, 220, 220, 705, 14967, 27823, 3256, 198, 220, 220, 220, 705, 17633, 3256, 198, 220, 220, 220, 705, 3109, 26205, 3256, 198, 220, 220, 220, 705, 40734, 3256, 198, 220, 220, 220, 705, 37, 4374, 3256, 198, 220, 220, 220, 705, 69, 14, 6, 198, 60, 198, 198, 8763, 9864, 1847, 62, 37682, 4877, 796, 685, 198, 220, 220, 220, 705, 5376, 3256, 198, 220, 220, 220, 705, 6030, 3256, 198, 220, 220, 220, 705, 36044, 3256, 198, 220, 220, 220, 705, 31310, 18497, 3256, 198, 220, 220, 220, 705, 26121, 528, 8326, 295, 3256, 198, 220, 220, 220, 705, 14749, 3256, 198, 220, 220, 220, 705, 13252, 40, 3256, 198, 60, 198, 198, 44724, 62, 37682, 4877, 796, 685, 198, 220, 220, 220, 366, 5376, 1600, 198, 220, 220, 220, 366, 36044, 1600, 198, 220, 220, 220, 366, 6030, 1600, 220, 198, 220, 220, 220, 366, 9012, 1600, 198, 60, 198, 198, 26947, 62, 37682, 4877, 796, 685, 198, 220, 220, 220, 366, 5376, 1600, 366, 13252, 40, 1600, 366, 33, 4448, 1600, 198, 220, 220, 220, 37082, 84, 3070, 2749, 371, 16, 1600, 37082, 84, 3070, 34, 18, 61, 17, 371, 16, 1600, 220, 198, 220, 220, 220, 37082, 84, 3070, 2749, 402, 17, 1600, 37082, 84, 3070, 34, 18, 61, 17, 402, 17, 1600, 220, 198, 220, 220, 220, 37082, 84, 3070, 2749, 402, 18, 1600, 37082, 84, 3070, 34, 18, 61, 17, 402, 18, 1600, 198, 220, 220, 220, 37082, 84, 3070, 2749, 347, 19, 1600, 37082, 84, 3070, 34, 18, 61, 17, 347, 19, 1600, 198, 60, 198, 198, 20530, 62, 26947, 62, 37682, 4877, 796, 685, 198, 220, 220, 220, 366, 5376, 1600, 366, 13252, 40, 1, 837, 366, 33, 4448, 1600, 198, 220, 220, 220, 366, 27369, 3467, 84, 3070, 2749, 371, 16, 1600, 366, 27369, 3467, 84, 3070, 34, 18, 61, 17, 371, 16, 1600, 220, 198, 220, 220, 220, 366, 27369, 3467, 84, 3070, 2749, 402, 17, 1600, 366, 27369, 3467, 84, 3070, 34, 18, 61, 17, 402, 17, 1600, 220, 198, 220, 220, 220, 366, 27369, 3467, 84, 3070, 2749, 402, 18, 1600, 366, 27369, 3467, 84, 3070, 34, 18, 61, 17, 402, 18, 1600, 198, 220, 220, 220, 366, 27369, 3467, 84, 3070, 2749, 347, 19, 1600, 366, 27369, 3467, 84, 3070, 34, 18, 61, 17, 347, 19, 1600, 198, 60, 198, 198, 35, 14175, 62, 26947, 62, 37682, 4877, 796, 685, 198, 220, 220, 220, 366, 5376, 1600, 366, 13252, 40, 1, 837, 366, 33, 4448, 1600, 198, 220, 220, 220, 366, 17367, 3467, 84, 3070, 2749, 371, 16, 1600, 366, 17367, 3467, 84, 3070, 34, 18, 61, 17, 371, 16, 1600, 220, 198, 220, 220, 220, 366, 17367, 3467, 84, 3070, 2749, 402, 17, 1600, 366, 17367, 3467, 84, 3070, 34, 18, 61, 17, 402, 17, 1600, 220, 198, 220, 220, 220, 366, 17367, 3467, 84, 3070, 2749, 402, 18, 1600, 366, 17367, 3467, 84, 3070, 34, 18, 61, 17, 402, 18, 1600, 198, 220, 220, 220, 366, 17367, 3467, 84, 3070, 2749, 347, 19, 1600, 366, 17367, 3467, 84, 3070, 34, 18, 61, 17, 347, 19, 1600, 198, 60, 628, 198, 2, 220, 26171, 198, 2, 7412, 20150, 198, 2, 220, 26171, 628, 198, 4299, 1570, 62, 28961, 62, 1069, 361, 62, 29891, 62, 2676, 540, 7, 38659, 11, 6246, 2599, 198, 220, 220, 220, 705, 7061, 29891, 743, 307, 6045, 329, 15697, 7061, 6, 198, 220, 220, 220, 5752, 796, 1391, 6, 29891, 10354, 6246, 92, 198, 220, 220, 220, 23493, 796, 4637, 13, 66, 21471, 3419, 198, 220, 220, 220, 954, 796, 1570, 62, 29891, 62, 9127, 7, 66, 21471, 11, 6246, 8, 198, 220, 220, 220, 23493, 13, 41049, 7, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 33493, 1438, 11, 6246, 11, 256, 301, 696, 11, 2746, 11, 409, 457, 524, 11, 47279, 11, 25397, 62, 13664, 11, 277, 62, 17618, 198, 220, 220, 220, 220, 220, 220, 220, 16034, 2939, 62, 83, 198, 220, 220, 220, 220, 220, 220, 220, 33411, 6246, 796, 1058, 29891, 198, 220, 220, 220, 220, 220, 220, 220, 38678, 11050, 1438, 22196, 34, 198, 220, 220, 220, 220, 220, 220, 220, 10148, 3256, 5752, 8, 198, 220, 220, 220, 1441, 23493, 11, 954, 198, 198, 2, 220, 10541, 198, 2, 7412, 3611, 198, 2, 220, 32501, 628, 198, 4299, 1570, 62, 28961, 62, 20541, 62, 29891, 62, 2676, 540, 7, 38659, 11, 6246, 2599, 198, 220, 220, 220, 705, 7061, 29891, 743, 307, 6045, 329, 15697, 7061, 6, 198, 220, 220, 220, 5752, 796, 1391, 6, 29891, 10354, 6246, 92, 198, 220, 220, 220, 23493, 796, 4637, 13, 66, 21471, 3419, 198, 220, 220, 220, 954, 796, 1570, 62, 29891, 62, 9127, 7, 66, 21471, 11, 6246, 8, 198, 220, 220, 220, 23493, 13, 41049, 7, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 33493, 1438, 11, 2099, 11, 6246, 11, 22890, 11, 4009, 11, 3053, 11, 4067, 11, 686, 72, 198, 220, 220, 220, 220, 220, 220, 220, 16034, 2939, 62, 83, 198, 220, 220, 220, 220, 220, 220, 220, 33411, 6246, 796, 1058, 29891, 198, 220, 220, 220, 220, 220, 220, 220, 38678, 11050, 1438, 25400, 198, 220, 220, 220, 220, 220, 220, 220, 10148, 3256, 5752, 8, 198, 220, 220, 220, 1441, 23493, 11, 954, 198, 198, 2, 24200, 6329, 198, 2, 7412, 1812, 198, 2, 24200, 6329, 628, 198, 2, 24200, 6329, 198, 2, 7412, 6060, 198, 2, 24200, 6329, 628, 198, 2, 220, 32501, 198, 2, 16089, 7412, 6060, 198, 2, 220, 26171, 628, 198, 2, 220, 26171, 198, 2, 3801, 7412, 6060, 198, 2, 220, 24305, 628, 198, 2, 34400, 198, 2, 3582, 5599, 3801, 198, 2, 34400, 12, 628, 198, 198, 31180, 5781, 62, 35, 14175, 62, 37682, 4877, 796, 685, 198, 220, 220, 220, 366, 36044, 1600, 220, 198, 220, 220, 220, 25113, 360, 5558, 1600, 198, 220, 220, 220, 366, 13252, 40, 1600, 198, 220, 220, 220, 366, 10248, 35379, 198, 220, 220, 220, 37082, 84, 3070, 2749, 371, 16, 1600, 37082, 84, 3070, 34, 18, 61, 17, 371, 16, 1600, 220, 198, 220, 220, 220, 37082, 84, 3070, 2749, 402, 17, 1600, 37082, 84, 3070, 34, 18, 61, 17, 402, 17, 1600, 220, 198, 220, 220, 220, 37082, 84, 3070, 2749, 402, 18, 1600, 37082, 84, 3070, 34, 18, 61, 17, 402, 18, 1600, 198, 220, 220, 220, 37082, 84, 3070, 2749, 347, 19, 1600, 37082, 84, 3070, 34, 18, 61, 17, 347, 19, 1600, 198, 60, 628, 198, 2, 45337, 198, 2, 3582, 3801, 198, 2, 24200, 438, 628, 198, 198, 2, 36658, 1421, 198, 2, 9455, 1658, 429, 563, 2173, 198, 2, 36658, 1421, 198, 198, 2, 2312, 3359, 2972, 1366, 628, 220, 220, 220, 220, 628, 198 ]
2.305798
5,278
import aiofiles from hashlib import md5 from pathlib import Path from core import mongodb from decouple import config from base64 import decodebytes from core.buchi_exception import BuchiException from services.pet_finder_service import get_pet_finder_pets pets_collection = mongodb.buchi.get_collection('pets') host = config("HOST") port = config("PORT") cdn_url = config("CDN_HOST_URL_PREFIX")
[ 11748, 257, 952, 16624, 198, 6738, 12234, 8019, 1330, 45243, 20, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 4755, 1330, 285, 506, 375, 65, 198, 6738, 875, 43846, 1330, 4566, 198, 6738, 2779, 2414, 1330, 36899, 33661, 198, 6738, 4755, 13, 65, 22200, 62, 1069, 4516, 1330, 347, 22200, 16922, 198, 6738, 2594, 13, 6449, 62, 22805, 62, 15271, 1330, 651, 62, 6449, 62, 22805, 62, 79, 1039, 198, 198, 79, 1039, 62, 43681, 796, 285, 506, 375, 65, 13, 65, 22200, 13, 1136, 62, 43681, 10786, 79, 1039, 11537, 198, 4774, 796, 4566, 7203, 39, 10892, 4943, 198, 634, 796, 4566, 7203, 15490, 4943, 198, 32341, 62, 6371, 796, 4566, 7203, 8610, 45, 62, 39, 10892, 62, 21886, 62, 47, 31688, 10426, 4943, 198 ]
3.150794
126
"""Console script for unifi_protect_backup.""" import asyncio import click from unifi_protect_backup import UnifiProtectBackup, __version__ @click.command() @click.version_option(__version__) @click.option('--address', required=True, envvar='UFP_ADDRESS', help='Address of Unifi Protect instance') @click.option('--port', default=443, envvar='UFP_PORT', help='Port of Unifi Protect instance') @click.option('--username', required=True, envvar='UFP_USERNAME', help='Username to login to Unifi Protect instance') @click.option('--password', required=True, envvar='UFP_PASSWORD', help='Password for Unifi Protect user') @click.option( '--verify-ssl/--no-verify-ssl', default=True, envvar='UFP_SSL_VERIFY', help="Set if you do not have a valid HTTPS Certificate for your instance", ) @click.option( '--rclone-destination', required=True, envvar='RCLONE_DESTINATION', help="`rclone` destination path in the format {rclone remote}:{path on remote}." " E.g. `gdrive:/backups/unifi_protect`", ) @click.option( '--retention', default='7d', envvar='RCLONE_RETENTION', help="How long should event clips be backed up for. Format as per the `--max-age` argument of " "`rclone` (https://rclone.org/filtering/#max-age-don-t-transfer-any-file-older-than-this)", ) @click.option( '--rclone-args', default='', envvar='RCLONE_ARGS', help="Optional extra arguments to pass to `rclone rcat` directly. Common usage for this would " "be to set a bandwidth limit, for example.", ) @click.option( '--ignore-camera', 'ignore_cameras', multiple=True, envvar="IGNORE_CAMERAS", help="IDs of cameras for which events should not be backed up. Use multiple times to ignore " "multiple IDs. If being set as an environment variable the IDs should be separated by whitespace.", ) @click.option( '-v', '--verbose', count=True, help="How verbose the logging output should be." """ \n None: Only log info messages created by `unifi-protect-backup`, and all warnings -v: Only log info & debug messages created by `unifi-protect-backup`, and all warnings -vv: Log info & debug messages created by `unifi-protect-backup`, command output, and all warnings -vvv Log debug messages created by `unifi-protect-backup`, command output, all info messages, and all warnings -vvvv: Log debug messages created by `unifi-protect-backup` command output, all info messages, all warnings, and websocket data -vvvvv: Log websocket data, command output, all debug messages, all info messages and all warnings """, ) def main(**kwargs): """A Python based tool for backing up Unifi Protect event clips as they occur.""" loop = asyncio.get_event_loop() event_listener = UnifiProtectBackup(**kwargs) loop.run_until_complete(event_listener.start()) if __name__ == "__main__": main() # pragma: no cover
[ 37811, 47581, 4226, 329, 555, 22238, 62, 35499, 62, 1891, 929, 526, 15931, 198, 198, 11748, 30351, 952, 198, 198, 11748, 3904, 198, 198, 6738, 555, 22238, 62, 35499, 62, 1891, 929, 1330, 791, 22238, 41426, 7282, 929, 11, 11593, 9641, 834, 628, 198, 31, 12976, 13, 21812, 3419, 198, 31, 12976, 13, 9641, 62, 18076, 7, 834, 9641, 834, 8, 198, 31, 12976, 13, 18076, 10786, 438, 21975, 3256, 2672, 28, 17821, 11, 17365, 7785, 11639, 52, 5837, 62, 2885, 7707, 7597, 3256, 1037, 11639, 20231, 286, 791, 22238, 21916, 4554, 11537, 198, 31, 12976, 13, 18076, 10786, 438, 634, 3256, 4277, 28, 34938, 11, 17365, 7785, 11639, 52, 5837, 62, 15490, 3256, 1037, 11639, 13924, 286, 791, 22238, 21916, 4554, 11537, 198, 31, 12976, 13, 18076, 10786, 438, 29460, 3256, 2672, 28, 17821, 11, 17365, 7785, 11639, 52, 5837, 62, 29904, 20608, 3256, 1037, 11639, 5842, 13292, 284, 17594, 284, 791, 22238, 21916, 4554, 11537, 198, 31, 12976, 13, 18076, 10786, 438, 28712, 3256, 2672, 28, 17821, 11, 17365, 7785, 11639, 52, 5837, 62, 47924, 54, 12532, 3256, 1037, 11639, 35215, 329, 791, 22238, 21916, 2836, 11537, 198, 31, 12976, 13, 18076, 7, 198, 220, 220, 220, 705, 438, 332, 1958, 12, 45163, 14, 438, 3919, 12, 332, 1958, 12, 45163, 3256, 198, 220, 220, 220, 4277, 28, 17821, 11, 198, 220, 220, 220, 17365, 7785, 11639, 52, 5837, 62, 31127, 62, 5959, 5064, 56, 3256, 198, 220, 220, 220, 1037, 2625, 7248, 611, 345, 466, 407, 423, 257, 4938, 38288, 27895, 329, 534, 4554, 1600, 198, 8, 198, 31, 12976, 13, 18076, 7, 198, 220, 220, 220, 705, 438, 81, 21018, 12, 16520, 1883, 3256, 198, 220, 220, 220, 2672, 28, 17821, 11, 198, 220, 220, 220, 17365, 7785, 11639, 49, 5097, 11651, 62, 35, 6465, 1268, 6234, 3256, 198, 220, 220, 220, 1037, 2625, 63, 81, 21018, 63, 10965, 3108, 287, 262, 5794, 1391, 81, 21018, 6569, 92, 29164, 6978, 319, 6569, 92, 526, 198, 220, 220, 220, 366, 412, 13, 70, 13, 4600, 70, 19472, 14079, 1891, 4739, 14, 403, 22238, 62, 35499, 63, 1600, 198, 8, 198, 31, 12976, 13, 18076, 7, 198, 220, 220, 220, 705, 438, 1186, 1463, 3256, 198, 220, 220, 220, 4277, 11639, 22, 67, 3256, 198, 220, 220, 220, 17365, 7785, 11639, 49, 5097, 11651, 62, 26087, 45589, 3256, 198, 220, 220, 220, 1037, 2625, 2437, 890, 815, 1785, 19166, 307, 9763, 510, 329, 13, 18980, 355, 583, 262, 4600, 438, 9806, 12, 496, 63, 4578, 286, 366, 198, 220, 220, 220, 366, 63, 81, 21018, 63, 357, 5450, 1378, 81, 21018, 13, 2398, 14, 10379, 20212, 31113, 9806, 12, 496, 12, 9099, 12, 83, 12, 39437, 12, 1092, 12, 7753, 12, 19892, 12, 14813, 12, 5661, 42501, 198, 8, 198, 31, 12976, 13, 18076, 7, 198, 220, 220, 220, 705, 438, 81, 21018, 12, 22046, 3256, 198, 220, 220, 220, 4277, 11639, 3256, 198, 220, 220, 220, 17365, 7785, 11639, 49, 5097, 11651, 62, 1503, 14313, 3256, 198, 220, 220, 220, 1037, 2625, 30719, 3131, 7159, 284, 1208, 284, 4600, 81, 21018, 374, 9246, 63, 3264, 13, 8070, 8748, 329, 428, 561, 366, 198, 220, 220, 220, 366, 1350, 284, 900, 257, 19484, 4179, 11, 329, 1672, 33283, 198, 8, 198, 31, 12976, 13, 18076, 7, 198, 220, 220, 220, 705, 438, 46430, 12, 25695, 3256, 198, 220, 220, 220, 705, 46430, 62, 66, 2382, 292, 3256, 198, 220, 220, 220, 3294, 28, 17821, 11, 198, 220, 220, 220, 17365, 7785, 2625, 16284, 6965, 62, 34, 2390, 1137, 1921, 1600, 198, 220, 220, 220, 1037, 2625, 47954, 286, 9073, 329, 543, 2995, 815, 407, 307, 9763, 510, 13, 5765, 3294, 1661, 284, 8856, 366, 198, 220, 220, 220, 366, 48101, 32373, 13, 1002, 852, 900, 355, 281, 2858, 7885, 262, 32373, 815, 307, 11266, 416, 13216, 10223, 33283, 198, 8, 198, 31, 12976, 13, 18076, 7, 198, 220, 220, 220, 705, 12, 85, 3256, 198, 220, 220, 220, 705, 438, 19011, 577, 3256, 198, 220, 220, 220, 954, 28, 17821, 11, 198, 220, 220, 220, 1037, 2625, 2437, 15942, 577, 262, 18931, 5072, 815, 307, 526, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3467, 77, 198, 220, 220, 220, 6045, 25, 5514, 2604, 7508, 6218, 2727, 416, 4600, 403, 22238, 12, 35499, 12, 1891, 929, 47671, 290, 477, 14601, 628, 220, 220, 220, 532, 85, 25, 5514, 2604, 7508, 1222, 14257, 6218, 2727, 416, 4600, 403, 22238, 12, 35499, 12, 1891, 929, 47671, 290, 477, 14601, 628, 220, 220, 220, 532, 25093, 25, 5972, 7508, 1222, 14257, 6218, 2727, 416, 4600, 403, 22238, 12, 35499, 12, 1891, 929, 47671, 3141, 5072, 11, 290, 477, 14601, 628, 220, 220, 220, 532, 25093, 85, 5972, 14257, 6218, 2727, 416, 4600, 403, 22238, 12, 35499, 12, 1891, 929, 47671, 3141, 5072, 11, 477, 7508, 6218, 11, 290, 477, 14601, 628, 220, 220, 220, 532, 25093, 25093, 25, 5972, 14257, 6218, 2727, 416, 4600, 403, 22238, 12, 35499, 12, 1891, 929, 63, 3141, 5072, 11, 477, 7508, 6218, 11, 198, 439, 14601, 11, 290, 2639, 5459, 1366, 628, 220, 220, 220, 532, 25093, 25093, 85, 25, 5972, 2639, 5459, 1366, 11, 3141, 5072, 11, 477, 14257, 6218, 11, 477, 7508, 6218, 290, 477, 14601, 198, 15931, 1600, 198, 8, 198, 4299, 1388, 7, 1174, 46265, 22046, 2599, 198, 220, 220, 220, 37227, 32, 11361, 1912, 2891, 329, 12285, 510, 791, 22238, 21916, 1785, 19166, 355, 484, 3051, 526, 15931, 198, 220, 220, 220, 9052, 796, 30351, 952, 13, 1136, 62, 15596, 62, 26268, 3419, 198, 220, 220, 220, 1785, 62, 4868, 877, 796, 791, 22238, 41426, 7282, 929, 7, 1174, 46265, 22046, 8, 198, 220, 220, 220, 9052, 13, 5143, 62, 28446, 62, 20751, 7, 15596, 62, 4868, 877, 13, 9688, 28955, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 220, 1303, 23864, 2611, 25, 645, 3002, 198 ]
2.956478
988
import os import re import codecs from setuptools import setup, find_packages # Single-source the version from legume/__init__.py here = os.path.abspath(os.path.dirname(__file__)) # with open('README.md', 'r') as f: readme = f.read() with open('requirements.txt') as f: requirements = f.read().splitlines() setup( name='legume-gme', version=find_version('legume', '__init__.py'), description='Differentiable plane-wave and guided-mode expansion for photonic crystals', long_description=readme, long_description_content_type="text/markdown", author='Momchil Minkov', author_email='[email protected]', url='https://github.com/fancompute/legume', packages=find_packages(), install_requires=requirements, classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], include_package_data=True, )
[ 11748, 28686, 198, 11748, 302, 198, 11748, 40481, 82, 198, 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 198, 2, 14206, 12, 10459, 262, 2196, 422, 1232, 2454, 14, 834, 15003, 834, 13, 9078, 198, 1456, 796, 28686, 13, 6978, 13, 397, 2777, 776, 7, 418, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 4008, 198, 2, 198, 198, 4480, 1280, 10786, 15675, 11682, 13, 9132, 3256, 705, 81, 11537, 355, 277, 25, 198, 220, 220, 220, 1100, 1326, 796, 277, 13, 961, 3419, 198, 198, 4480, 1280, 10786, 8897, 18883, 13, 14116, 11537, 355, 277, 25, 198, 220, 220, 220, 5359, 796, 277, 13, 961, 22446, 35312, 6615, 3419, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 11639, 1455, 2454, 12, 70, 1326, 3256, 198, 220, 220, 220, 2196, 28, 19796, 62, 9641, 10786, 1455, 2454, 3256, 705, 834, 15003, 834, 13, 9078, 33809, 198, 220, 220, 220, 6764, 11639, 40341, 3379, 6614, 12, 19204, 290, 17455, 12, 14171, 7118, 329, 2825, 9229, 24770, 3256, 198, 220, 220, 220, 890, 62, 11213, 28, 961, 1326, 11, 198, 220, 220, 220, 890, 62, 11213, 62, 11299, 62, 4906, 2625, 5239, 14, 4102, 2902, 1600, 198, 220, 220, 220, 1772, 11639, 29252, 354, 346, 337, 676, 709, 3256, 198, 220, 220, 220, 1772, 62, 12888, 11639, 32542, 354, 346, 3020, 31, 14816, 13, 785, 3256, 198, 220, 220, 220, 19016, 11639, 5450, 1378, 12567, 13, 785, 14, 24408, 5589, 1133, 14, 1455, 2454, 3256, 198, 220, 220, 220, 10392, 28, 19796, 62, 43789, 22784, 198, 220, 220, 220, 2721, 62, 47911, 28, 8897, 18883, 11, 198, 220, 220, 220, 1398, 13350, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15167, 2229, 15417, 7904, 11361, 7904, 513, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 34156, 7904, 7294, 40, 20010, 1079, 7904, 17168, 13789, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18843, 803, 4482, 7904, 7294, 13362, 1600, 198, 220, 220, 220, 16589, 198, 220, 220, 220, 2291, 62, 26495, 62, 7890, 28, 17821, 11, 198, 8, 198 ]
2.747126
348
import os from enum import Enum from typing import List import attr from sleap.io.format.filehandle import FileHandle @attr.s(auto_attribs=True) class Adaptor(object): """ Abstract base class which defines interface for file format adaptors. """ @property def handles(self) -> SleapObjectType: """Returns the type of object that can be read/written.""" raise NotImplementedError @property @property @property def can_read_file(self, file: FileHandle) -> bool: """Returns whether this adaptor can read this file.""" raise NotImplementedError def can_write_filename(self, filename: str) -> bool: """Returns whether this adaptor can write format of this filename.""" raise NotImplementedError def does_read(self) -> bool: """Returns whether this adaptor supports reading.""" raise NotImplementedError def does_write(self) -> bool: """Returns whether this adaptor supports writing.""" raise NotImplementedError def read(self, file: FileHandle) -> object: """Reads the file and returns the appropriate deserialized object.""" raise NotImplementedError def write(self, filename: str, source_object: object): """Writes the object to a file.""" raise NotImplementedError # Methods with default implementation def does_match_ext(self, filename: str) -> bool: """Returns whether this adaptor can write format of this filename.""" # We don't match the ext against the result of os.path.splitext because # we want to match extensions like ".json.zip". return filename.endswith(tuple(self.all_exts)) @property def formatted_ext_options(self): """String for Qt file dialog extension options.""" return f"{self.name} ({' '.join(self.all_exts)})"
[ 11748, 28686, 198, 6738, 33829, 1330, 2039, 388, 198, 6738, 19720, 1330, 7343, 198, 198, 11748, 708, 81, 198, 198, 6738, 3133, 499, 13, 952, 13, 18982, 13, 7753, 28144, 1330, 9220, 37508, 628, 198, 198, 31, 35226, 13, 82, 7, 23736, 62, 1078, 822, 82, 28, 17821, 8, 198, 4871, 30019, 273, 7, 15252, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 27741, 2779, 1398, 543, 15738, 7071, 329, 2393, 5794, 6068, 669, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 17105, 7, 944, 8, 4613, 19498, 499, 10267, 6030, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 35561, 262, 2099, 286, 2134, 326, 460, 307, 1100, 14, 15266, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 628, 220, 220, 220, 2488, 26745, 628, 220, 220, 220, 2488, 26745, 628, 220, 220, 220, 2488, 26745, 628, 220, 220, 220, 825, 460, 62, 961, 62, 7753, 7, 944, 11, 2393, 25, 9220, 37508, 8, 4613, 20512, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 35561, 1771, 428, 6068, 273, 460, 1100, 428, 2393, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 628, 220, 220, 220, 825, 460, 62, 13564, 62, 34345, 7, 944, 11, 29472, 25, 965, 8, 4613, 20512, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 35561, 1771, 428, 6068, 273, 460, 3551, 5794, 286, 428, 29472, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 628, 220, 220, 220, 825, 857, 62, 961, 7, 944, 8, 4613, 20512, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 35561, 1771, 428, 6068, 273, 6971, 3555, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 628, 220, 220, 220, 825, 857, 62, 13564, 7, 944, 8, 4613, 20512, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 35561, 1771, 428, 6068, 273, 6971, 3597, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 628, 220, 220, 220, 825, 1100, 7, 944, 11, 2393, 25, 9220, 37508, 8, 4613, 2134, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 5569, 82, 262, 2393, 290, 5860, 262, 5035, 748, 48499, 1143, 2134, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 628, 220, 220, 220, 825, 3551, 7, 944, 11, 29472, 25, 965, 11, 2723, 62, 15252, 25, 2134, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 20257, 274, 262, 2134, 284, 257, 2393, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 628, 220, 220, 220, 1303, 25458, 351, 4277, 7822, 628, 220, 220, 220, 825, 857, 62, 15699, 62, 2302, 7, 944, 11, 29472, 25, 965, 8, 4613, 20512, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 35561, 1771, 428, 6068, 273, 460, 3551, 5794, 286, 428, 29472, 526, 15931, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 775, 836, 470, 2872, 262, 1070, 1028, 262, 1255, 286, 28686, 13, 6978, 13, 22018, 578, 742, 780, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 356, 765, 284, 2872, 18366, 588, 27071, 17752, 13, 13344, 1911, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 29472, 13, 437, 2032, 342, 7, 83, 29291, 7, 944, 13, 439, 62, 2302, 82, 4008, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 39559, 62, 2302, 62, 25811, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 10100, 329, 33734, 2393, 17310, 7552, 3689, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 277, 1, 90, 944, 13, 3672, 92, 37913, 6, 45302, 22179, 7, 944, 13, 439, 62, 2302, 82, 38165, 16725, 198 ]
2.874809
655
import tkinter as tk import os import tempfile root = tk.Tk() canvas1 = tk.Canvas(root, width=400, height=300) canvas1.pack() entry1 = tk.Entry(root) entry2 = tk.Entry(root) label2 = tk.Label(root, text='Path') label1 = tk.Label(root, text='Query') canvas1.create_window(200, 160, window=entry1) canvas1.create_window(200, 140, window=label1) canvas1.create_window(200, 100, window=label2) canvas1.create_window(200, 120, window=entry2) button1 = tk.Button(text='Oke', command=letsGO) canvas1.create_window(200, 180, window=button1) root.mainloop()
[ 11748, 256, 74, 3849, 355, 256, 74, 198, 11748, 28686, 198, 11748, 20218, 7753, 198, 15763, 796, 256, 74, 13, 51, 74, 3419, 198, 5171, 11017, 16, 796, 256, 74, 13, 6090, 11017, 7, 15763, 11, 9647, 28, 7029, 11, 6001, 28, 6200, 8, 198, 5171, 11017, 16, 13, 8002, 3419, 198, 198, 13000, 16, 796, 256, 74, 13, 30150, 7, 15763, 8, 198, 13000, 17, 796, 256, 74, 13, 30150, 7, 15763, 8, 198, 18242, 17, 796, 256, 74, 13, 33986, 7, 15763, 11, 2420, 11639, 15235, 11537, 198, 18242, 16, 796, 256, 74, 13, 33986, 7, 15763, 11, 2420, 11639, 20746, 11537, 198, 5171, 11017, 16, 13, 17953, 62, 17497, 7, 2167, 11, 13454, 11, 4324, 28, 13000, 16, 8, 198, 5171, 11017, 16, 13, 17953, 62, 17497, 7, 2167, 11, 12713, 11, 4324, 28, 18242, 16, 8, 198, 5171, 11017, 16, 13, 17953, 62, 17497, 7, 2167, 11, 1802, 11, 4324, 28, 18242, 17, 8, 198, 5171, 11017, 16, 13, 17953, 62, 17497, 7, 2167, 11, 7982, 11, 4324, 28, 13000, 17, 8, 198, 16539, 16, 796, 256, 74, 13, 21864, 7, 5239, 11639, 46, 365, 3256, 3141, 28, 5289, 11230, 8, 198, 5171, 11017, 16, 13, 17953, 62, 17497, 7, 2167, 11, 11546, 11, 4324, 28, 16539, 16, 8, 198, 198, 15763, 13, 12417, 26268, 3419, 198 ]
2.493213
221
import os import re ALLOWED_FLAGS = (0, 16) DEFAULT_TRAINMODELS_OPTIONS = { "fofn": None, "fast5_dir": None, "positions_file": None, "motif": None, "label": None, }
[ 11748, 28686, 198, 11748, 302, 628, 198, 7036, 3913, 1961, 62, 38948, 50, 796, 357, 15, 11, 1467, 8, 198, 198, 7206, 38865, 62, 51, 3861, 1268, 33365, 37142, 62, 3185, 51, 11053, 796, 1391, 198, 220, 220, 220, 366, 69, 1659, 77, 1298, 6045, 11, 198, 220, 220, 220, 366, 7217, 20, 62, 15908, 1298, 6045, 11, 198, 220, 220, 220, 366, 1930, 1756, 62, 7753, 1298, 6045, 11, 198, 220, 220, 220, 366, 27926, 361, 1298, 6045, 11, 198, 220, 220, 220, 366, 18242, 1298, 6045, 11, 198, 92, 628, 628, 198 ]
2.042553
94
# Copyright 2019 Google LLC # # 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. """Unit tests for API calls""" import unittest import requests from mock import patch class BasicTest(unittest.TestCase): """Class to test api calls of Training, Deployment and Prediction""" def is_not_used(self): """"Function to remove no-self-use warning""" pass @patch('requests.post') def test_train(self, mock_post): """ Test case 1 Tested LinearClassifier model on Census data """ self.is_not_used() params = {"bucket": "gs://cmla", "train_csv_path": "census_train.csv", "eval_csv_path": "census_eval.csv", "task_type": "classification", "target_var": "income_bracket", "column_name": "None", "na_values": "None", "condition": "None", "name": "linearclassifier", "n_classes": 2, "hidden_units": 64, "num_layers": 2, "lin_opt": "ftrl", "deep_opt": "adam", "train_steps": 500, "export_dir": "saved_model/export_dir", "to_drop": "None" } _ = requests.post('http://127.0.0.1:8080/train', data=params, headers={'Content-Type': 'application/json'}) mock_post.assert_called_with( "http://127.0.0.1:8080/train", data=params, headers={'Content-Type': 'application/json'}) @patch('requests.post') def test_deploy(self, mock_post): """ Deploy call Positive test """ self.is_not_used() params = { "job_id": "C46f52b9f_9019101920_d7583d1f8286", "model_name": "testing", "runtime_version": "1.12", "version_name": "v6_1", "trained_model_location": "gs://cmla/saved_model/export_dir" } _ = requests.post('http://127.0.0.1:8080/deploy', data=params, headers={'Content-Type': 'application/json'}) mock_post.assert_called_with( "http://127.0.0.1:8080/deploy", data=params, headers={'Content-Type': 'application/json'}) @patch('requests.post') def test_predict(self, mock_post): """ Testing predict call Positive """ self.is_not_used() params = {"model_name": "testing", "instances": [{"capital_gain": 0, "relationship": "Unmarried", "gender": "Female", "marital_status": "Divorced", "education": "7th-8th", "fnlwgt": 140359, "occupation": "Machine-op-inspct", "capital_loss": 3900, "workclass": "Private", "age": 54, "native_country": "United-States", "race": "White", "education_num": 4, "hours_per_week": 40}], "version_name": "v6_1"} _ = requests.post('http://127.0.0.1:8080/predict', data=params, headers={'Content-Type': 'application/json'}) mock_post.assert_called_with( "http://127.0.0.1:8080/predict", data=params, headers={'Content-Type': 'application/json'})
[ 2, 15069, 13130, 3012, 11419, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 2, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 2, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2, 11247, 739, 262, 13789, 13, 198, 198, 37811, 26453, 5254, 329, 7824, 3848, 37811, 198, 11748, 555, 715, 395, 198, 11748, 7007, 198, 6738, 15290, 1330, 8529, 628, 198, 4871, 14392, 14402, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 220, 220, 37227, 9487, 284, 1332, 40391, 3848, 286, 13614, 11, 34706, 434, 290, 46690, 37811, 628, 220, 220, 220, 825, 318, 62, 1662, 62, 1484, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 13538, 15931, 22203, 284, 4781, 645, 12, 944, 12, 1904, 6509, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 1208, 628, 220, 220, 220, 2488, 17147, 10786, 8897, 3558, 13, 7353, 11537, 198, 220, 220, 220, 825, 1332, 62, 27432, 7, 944, 11, 15290, 62, 7353, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 6208, 1339, 352, 198, 220, 220, 220, 220, 220, 220, 220, 6208, 276, 44800, 9487, 7483, 2746, 319, 20962, 1366, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 271, 62, 1662, 62, 1484, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 42287, 796, 19779, 27041, 316, 1298, 366, 14542, 1378, 66, 4029, 64, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 27432, 62, 40664, 62, 6978, 1298, 366, 66, 7314, 62, 27432, 13, 40664, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 18206, 62, 40664, 62, 6978, 1298, 366, 66, 7314, 62, 18206, 13, 40664, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 35943, 62, 4906, 1298, 366, 4871, 2649, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 16793, 62, 7785, 1298, 366, 12519, 62, 1671, 8317, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 28665, 62, 3672, 1298, 366, 14202, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 2616, 62, 27160, 1298, 366, 14202, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 31448, 1298, 366, 14202, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 29127, 4871, 7483, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 77, 62, 37724, 1298, 362, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 30342, 62, 41667, 1298, 5598, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 22510, 62, 75, 6962, 1298, 362, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 2815, 62, 8738, 1298, 366, 701, 45895, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 22089, 62, 8738, 1298, 366, 324, 321, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 27432, 62, 20214, 1298, 5323, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 39344, 62, 15908, 1298, 366, 82, 9586, 62, 19849, 14, 39344, 62, 15908, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 1462, 62, 14781, 1298, 366, 14202, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 796, 7007, 13, 7353, 10786, 4023, 1378, 16799, 13, 15, 13, 15, 13, 16, 25, 1795, 1795, 14, 27432, 3256, 1366, 28, 37266, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 24697, 34758, 6, 19746, 12, 6030, 10354, 705, 31438, 14, 17752, 6, 30072, 198, 220, 220, 220, 220, 220, 220, 220, 15290, 62, 7353, 13, 30493, 62, 7174, 62, 4480, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 4023, 1378, 16799, 13, 15, 13, 15, 13, 16, 25, 1795, 1795, 14, 27432, 1600, 1366, 28, 37266, 11, 24697, 34758, 6, 19746, 12, 6030, 10354, 705, 31438, 14, 17752, 6, 30072, 628, 220, 220, 220, 2488, 17147, 10786, 8897, 3558, 13, 7353, 11537, 198, 220, 220, 220, 825, 1332, 62, 2934, 1420, 7, 944, 11, 15290, 62, 7353, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 34706, 869, 198, 220, 220, 220, 220, 220, 220, 220, 33733, 1332, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 271, 62, 1662, 62, 1484, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 42287, 796, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 21858, 62, 312, 1298, 366, 34, 3510, 69, 4309, 65, 24, 69, 62, 46815, 6420, 30484, 1238, 62, 67, 2425, 5999, 67, 16, 69, 23, 27033, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 19849, 62, 3672, 1298, 366, 33407, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 43282, 62, 9641, 1298, 366, 16, 13, 1065, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 9641, 62, 3672, 1298, 366, 85, 21, 62, 16, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 35311, 62, 19849, 62, 24886, 1298, 366, 14542, 1378, 66, 4029, 64, 14, 82, 9586, 62, 19849, 14, 39344, 62, 15908, 1, 198, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 796, 7007, 13, 7353, 10786, 4023, 1378, 16799, 13, 15, 13, 15, 13, 16, 25, 1795, 1795, 14, 2934, 1420, 3256, 1366, 28, 37266, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 24697, 34758, 6, 19746, 12, 6030, 10354, 705, 31438, 14, 17752, 6, 30072, 198, 220, 220, 220, 220, 220, 220, 220, 15290, 62, 7353, 13, 30493, 62, 7174, 62, 4480, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 4023, 1378, 16799, 13, 15, 13, 15, 13, 16, 25, 1795, 1795, 14, 2934, 1420, 1600, 1366, 28, 37266, 11, 24697, 34758, 6, 19746, 12, 6030, 10354, 705, 31438, 14, 17752, 6, 30072, 628, 220, 220, 220, 2488, 17147, 10786, 8897, 3558, 13, 7353, 11537, 198, 220, 220, 220, 825, 1332, 62, 79, 17407, 7, 944, 11, 15290, 62, 7353, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 23983, 4331, 869, 198, 220, 220, 220, 220, 220, 220, 220, 33733, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 271, 62, 1662, 62, 1484, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 42287, 796, 19779, 19849, 62, 3672, 1298, 366, 33407, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 8625, 1817, 1298, 685, 4895, 27544, 62, 48544, 1298, 657, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 39468, 1056, 1298, 366, 3118, 30526, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 8388, 1298, 366, 27273, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 3876, 1287, 62, 13376, 1298, 366, 24095, 273, 771, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 40796, 1298, 366, 22, 400, 12, 23, 400, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 69, 21283, 86, 13655, 1298, 12713, 30743, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 19596, 341, 1298, 366, 37573, 12, 404, 12, 1040, 79, 310, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 27544, 62, 22462, 1298, 5014, 405, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 1818, 4871, 1298, 366, 29067, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 496, 1298, 7175, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 30191, 62, 19315, 1298, 366, 17013, 12, 42237, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 16740, 1298, 366, 12256, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 40796, 62, 22510, 1298, 604, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 24425, 62, 525, 62, 10464, 1298, 2319, 92, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 9641, 62, 3672, 1298, 366, 85, 21, 62, 16, 20662, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 796, 7007, 13, 7353, 10786, 4023, 1378, 16799, 13, 15, 13, 15, 13, 16, 25, 1795, 1795, 14, 79, 17407, 3256, 1366, 28, 37266, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 24697, 34758, 6, 19746, 12, 6030, 10354, 705, 31438, 14, 17752, 6, 30072, 198, 220, 220, 220, 220, 220, 220, 220, 15290, 62, 7353, 13, 30493, 62, 7174, 62, 4480, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 4023, 1378, 16799, 13, 15, 13, 15, 13, 16, 25, 1795, 1795, 14, 79, 17407, 1600, 1366, 28, 37266, 11, 24697, 34758, 6, 19746, 12, 6030, 10354, 705, 31438, 14, 17752, 6, 30072, 198 ]
1.912963
2,160
""" Tests for Helpers ================= """ import pyconfig from humbledb import _version from humbledb import Document, Mongo from humbledb.helpers import auto_increment from humbledb.errors import DatabaseMismatch, NoConnection from ..util import DBTest, database_name, eq_, ok_, raises, SkipTest SIDECAR = 'sidecars' # The safe= keyword doesn't exist in 3.0 if _version._lt('3.0.0'): _safe = {'safe': True} else: _safe = {} @raises(DatabaseMismatch) @raises(NoConnection)
[ 37811, 198, 51, 3558, 329, 10478, 364, 198, 4770, 28, 198, 198, 37811, 198, 11748, 12972, 11250, 198, 198, 6738, 1311, 9342, 65, 1330, 4808, 9641, 198, 6738, 1311, 9342, 65, 1330, 16854, 11, 42591, 198, 6738, 1311, 9342, 65, 13, 16794, 364, 1330, 8295, 62, 24988, 434, 198, 6738, 1311, 9342, 65, 13, 48277, 1330, 24047, 44, 1042, 963, 11, 1400, 32048, 198, 6738, 11485, 22602, 1330, 20137, 14402, 11, 6831, 62, 3672, 11, 37430, 62, 11, 12876, 62, 11, 12073, 11, 32214, 14402, 628, 198, 50, 2389, 2943, 1503, 796, 705, 1589, 37993, 6, 628, 198, 2, 383, 3338, 28, 21179, 1595, 470, 2152, 287, 513, 13, 15, 198, 361, 4808, 9641, 13557, 2528, 10786, 18, 13, 15, 13, 15, 6, 2599, 198, 220, 220, 220, 4808, 21230, 796, 1391, 6, 21230, 10354, 6407, 92, 198, 17772, 25, 198, 220, 220, 220, 4808, 21230, 796, 23884, 628, 628, 628, 198, 31, 430, 2696, 7, 38105, 44, 1042, 963, 8, 628, 198, 31, 430, 2696, 7, 2949, 32048, 8, 628, 198 ]
2.901163
172
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Function to search reddit comments and submissions and return all metadata available and return a dataFrame """ import pandas as pd import requests import json import csv import time import datetime def RedditSearch(query, before='', after='', search_type='hybrid'): ''' query (string) after (UTC Timestamp) *** Note that these must be integers *** DEFAULT: 7 Days before now before (UTC Timestamp) DEFAULT: now search_type (string) 'comment' -> only search comments 'submission' -> only search submissions 'hybrid' -> search both comments and submissions ''' # Defaults today = datetime.datetime.utcnow().timestamp() delta_time = datetime.timedelta(days=7) if not after or not before: after = datetime.datetime.now() - delta_time after = int(after.timestamp()) before = int(today) print('UTC Before:', before) print('UTC After:', after) search_type = search_type.lower() if search_type not in ['comment', 'submission', 'hybrid']: print('Unknown search_type, defaulting to hybrid') search_type = 'hybrid' subCount = 0 # data counter commCount = 0 # data counter subStats = {} # data for storage commStats = {} #data storage subList = [] commList = [] # subfunctions def getPushshiftData_Submission(query, after, before): ''' query(String) string to search that after (Timestamp) before (Timestamp) ''' url = 'https://api.pushshift.io/reddit/search/submission/?q='+str(query)+\ '&size=1000&after='+str(after)+'&before='+str(before) # url params well documented at https://github.com/pushshift/api for both comments and submissions r = requests.get(url) data = json.loads(r.text) return data['data'] def getPushshiftData_Comments(query, after, before): ''' query(String) string to search that after (Timestamp) before (Timestamp) ''' url = 'https://api.pushshift.io/reddit/search/comment/?q='+str(query)+\ ')&size=1000&after='+str(after)+'&before='+str(before) # url params well documented at https://github.com/pushshift/api for both comments and submissions r = requests.get(url) data = json.loads(r.text) return data['data'] try: # Collect Submissions # Get initial Submissions that fit query if search_type != 'comment': print('Beginning Submission Query') data = getPushshiftData_Submission(query, after, before) # Will run until all posts have been gathered i.e. When the length of data variable = 0 # from the 'after' date up until before date while len(data) > 0: after_ = int(data[-1]['created_utc']) for submission in data: submission['created_utc'] = datetime.datetime.fromtimestamp(submission['created_utc']) subCount+=1 subList.append(submission) # Calls getPushshiftData() with the created date of the last submission print('Oldest Post Date:' + str(data[-1]['created_utc'])) #update after variable to last created date of submission #data has changed due to the new after variable provided by above code data = getPushshiftData_Submission(query, after_, before) print('Submission Query Finished') # Collect Comments if search_type != 'submission': print('Beginning Comment Query') data = getPushshiftData_Comments(query, after, before) # Will run until all posts have been gathered i.e. When the length of data variable = 0 # from the 'after' date up until before date while len(data) > 0: after_ = int(data[-1]['created_utc']) for comment in data: comment['created_utc'] = datetime.datetime.fromtimestamp(comment['created_utc']) commCount+=1 commList.append(comment) # Calls getPushshiftData() with the created date of the last submission print('Oldest Comment Date:' + str((data[-1]['created_utc']))) #update after variable to last created date of submission #data has changed due to the new after variable provided by above code data = getPushshiftData_Comments(query, after_, before) print('Comment Query Finished') except: print('Error while Processing') # Convert to dfs (sub_id,created,sub,title,text,url,author,score,nsfw,numComms,permalink,flair print('Building Output') subDf = pd.DataFrame(subList) # subDf = subDf.set_index('created_utc') commDf = pd.DataFrame(commList) # commDf = commDf.set_index('created_utc') print('Number of Submissions Collected:', subCount) print('Number of Comments Collected:', commCount) return subDf, commDf submissions, comments = RedditSearch('gummy bears') submissions.to_csv('submissions.csv') comments.to_csv('comments.csv')
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 201, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 37811, 15553, 284, 2989, 18374, 3651, 290, 22129, 290, 201, 198, 1441, 477, 20150, 1695, 290, 1441, 257, 1366, 19778, 37227, 201, 198, 201, 198, 11748, 19798, 292, 355, 279, 67, 201, 198, 11748, 7007, 201, 198, 11748, 33918, 201, 198, 11748, 269, 21370, 201, 198, 11748, 640, 201, 198, 11748, 4818, 8079, 201, 198, 201, 198, 4299, 10750, 18243, 7, 22766, 11, 878, 11639, 3256, 706, 11639, 3256, 2989, 62, 4906, 11639, 12114, 10236, 6, 2599, 201, 198, 220, 220, 220, 705, 7061, 201, 198, 220, 220, 220, 12405, 357, 8841, 8, 201, 198, 220, 220, 220, 706, 357, 17429, 5045, 27823, 8, 17202, 5740, 326, 777, 1276, 307, 37014, 17202, 201, 198, 220, 220, 220, 220, 220, 220, 220, 5550, 38865, 25, 767, 12579, 878, 783, 201, 198, 220, 220, 220, 878, 357, 17429, 5045, 27823, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 5550, 38865, 25, 783, 201, 198, 220, 220, 220, 2989, 62, 4906, 357, 8841, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 705, 23893, 6, 4613, 691, 2989, 3651, 201, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7266, 3411, 6, 4613, 691, 2989, 22129, 201, 198, 220, 220, 220, 220, 220, 220, 220, 705, 12114, 10236, 6, 4613, 2989, 1111, 3651, 290, 22129, 201, 198, 220, 220, 220, 705, 7061, 201, 198, 220, 220, 220, 1303, 2896, 13185, 201, 198, 220, 220, 220, 1909, 796, 4818, 8079, 13, 19608, 8079, 13, 315, 66, 2197, 22446, 16514, 27823, 3419, 201, 198, 220, 220, 220, 25979, 62, 2435, 796, 4818, 8079, 13, 16514, 276, 12514, 7, 12545, 28, 22, 8, 201, 198, 220, 220, 220, 611, 407, 706, 393, 407, 878, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 706, 796, 4818, 8079, 13, 19608, 8079, 13, 2197, 3419, 532, 25979, 62, 2435, 201, 198, 220, 220, 220, 220, 220, 220, 220, 706, 796, 493, 7, 8499, 13, 16514, 27823, 28955, 201, 198, 220, 220, 220, 220, 220, 220, 220, 878, 796, 493, 7, 40838, 8, 201, 198, 220, 220, 220, 3601, 10786, 17429, 7413, 25, 3256, 878, 8, 201, 198, 220, 220, 220, 3601, 10786, 17429, 2293, 25, 3256, 706, 8, 201, 198, 220, 220, 220, 2989, 62, 4906, 796, 2989, 62, 4906, 13, 21037, 3419, 201, 198, 220, 220, 220, 611, 2989, 62, 4906, 407, 287, 37250, 23893, 3256, 705, 7266, 3411, 3256, 705, 12114, 10236, 6, 5974, 201, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 20035, 2989, 62, 4906, 11, 4277, 278, 284, 14554, 11537, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2989, 62, 4906, 796, 705, 12114, 10236, 6, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 850, 12332, 796, 657, 220, 1303, 1366, 3753, 201, 198, 220, 220, 220, 725, 12332, 796, 657, 220, 1303, 1366, 3753, 201, 198, 220, 220, 220, 850, 29668, 796, 23884, 1303, 1366, 329, 6143, 201, 198, 220, 220, 220, 725, 29668, 796, 23884, 1303, 7890, 6143, 201, 198, 220, 220, 220, 850, 8053, 796, 17635, 201, 198, 220, 220, 220, 725, 8053, 796, 17635, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 1303, 850, 12543, 2733, 201, 198, 220, 220, 220, 825, 651, 49222, 30846, 6601, 62, 7004, 3411, 7, 22766, 11, 706, 11, 878, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 201, 198, 220, 220, 220, 220, 220, 220, 220, 12405, 7, 10100, 8, 4731, 284, 2989, 326, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 706, 357, 14967, 27823, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 878, 357, 14967, 27823, 8, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 201, 198, 220, 220, 220, 220, 220, 220, 220, 19016, 796, 705, 5450, 1378, 15042, 13, 14689, 30846, 13, 952, 14, 10748, 14, 12947, 14, 7266, 3411, 20924, 80, 11639, 10, 2536, 7, 22766, 47762, 59, 201, 198, 220, 220, 220, 220, 220, 220, 220, 705, 5, 7857, 28, 12825, 5, 8499, 11639, 10, 2536, 7, 8499, 47762, 6, 5, 19052, 11639, 10, 2536, 7, 19052, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 19016, 42287, 880, 12395, 379, 3740, 1378, 12567, 13, 785, 14, 14689, 30846, 14, 15042, 329, 1111, 3651, 290, 22129, 201, 198, 220, 220, 220, 220, 220, 220, 220, 374, 796, 7007, 13, 1136, 7, 6371, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 796, 33918, 13, 46030, 7, 81, 13, 5239, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 1366, 17816, 7890, 20520, 201, 198, 201, 198, 201, 198, 201, 198, 220, 220, 220, 825, 651, 49222, 30846, 6601, 62, 23903, 7, 22766, 11, 706, 11, 878, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 201, 198, 220, 220, 220, 220, 220, 220, 220, 12405, 7, 10100, 8, 4731, 284, 2989, 326, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 706, 357, 14967, 27823, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 878, 357, 14967, 27823, 8, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 201, 198, 220, 220, 220, 220, 220, 220, 220, 19016, 796, 705, 5450, 1378, 15042, 13, 14689, 30846, 13, 952, 14, 10748, 14, 12947, 14, 23893, 20924, 80, 11639, 10, 2536, 7, 22766, 47762, 59, 201, 198, 220, 220, 220, 220, 220, 220, 220, 705, 8, 5, 7857, 28, 12825, 5, 8499, 11639, 10, 2536, 7, 8499, 47762, 6, 5, 19052, 11639, 10, 2536, 7, 19052, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 19016, 42287, 880, 12395, 379, 3740, 1378, 12567, 13, 785, 14, 14689, 30846, 14, 15042, 329, 1111, 3651, 290, 22129, 201, 198, 220, 220, 220, 220, 220, 220, 220, 374, 796, 7007, 13, 1136, 7, 6371, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 796, 33918, 13, 46030, 7, 81, 13, 5239, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 1366, 17816, 7890, 20520, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 1949, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 9745, 3834, 8481, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 3497, 4238, 3834, 8481, 326, 4197, 12405, 201, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2989, 62, 4906, 14512, 705, 23893, 10354, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 45198, 42641, 43301, 11537, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1366, 796, 651, 49222, 30846, 6601, 62, 7004, 3411, 7, 22766, 11, 706, 11, 878, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2561, 1057, 1566, 477, 6851, 423, 587, 9272, 1312, 13, 68, 13, 1649, 262, 4129, 286, 1366, 7885, 796, 657, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 422, 262, 705, 8499, 6, 3128, 510, 1566, 878, 3128, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 981, 18896, 7, 7890, 8, 1875, 657, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 706, 62, 796, 493, 7, 7890, 58, 12, 16, 7131, 6, 25598, 62, 315, 66, 6, 12962, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 14498, 287, 1366, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14498, 17816, 25598, 62, 315, 66, 20520, 796, 4818, 8079, 13, 19608, 8079, 13, 6738, 16514, 27823, 7, 7266, 3411, 17816, 25598, 62, 315, 66, 6, 12962, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 850, 12332, 47932, 16, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 850, 8053, 13, 33295, 7, 7266, 3411, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 27592, 651, 49222, 30846, 6601, 3419, 351, 262, 2727, 3128, 286, 262, 938, 14498, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 19620, 395, 2947, 7536, 32105, 1343, 965, 7, 7890, 58, 12, 16, 7131, 6, 25598, 62, 315, 66, 20520, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 19119, 706, 7885, 284, 938, 2727, 3128, 286, 14498, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 7890, 468, 3421, 2233, 284, 262, 649, 706, 7885, 2810, 416, 2029, 2438, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1366, 796, 651, 49222, 30846, 6601, 62, 7004, 3411, 7, 22766, 11, 706, 62, 11, 878, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 7004, 3411, 43301, 42931, 11537, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 9745, 19502, 201, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2989, 62, 4906, 14512, 705, 7266, 3411, 10354, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 45198, 18957, 43301, 11537, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1366, 796, 651, 49222, 30846, 6601, 62, 23903, 7, 22766, 11, 706, 11, 878, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2561, 1057, 1566, 477, 6851, 423, 587, 9272, 1312, 13, 68, 13, 1649, 262, 4129, 286, 1366, 7885, 796, 657, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 422, 262, 705, 8499, 6, 3128, 510, 1566, 878, 3128, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 981, 18896, 7, 7890, 8, 1875, 657, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 706, 62, 796, 493, 7, 7890, 58, 12, 16, 7131, 6, 25598, 62, 315, 66, 6, 12962, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 2912, 287, 1366, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2912, 17816, 25598, 62, 315, 66, 20520, 796, 4818, 8079, 13, 19608, 8079, 13, 6738, 16514, 27823, 7, 23893, 17816, 25598, 62, 315, 66, 6, 12962, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 725, 12332, 47932, 16, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 725, 8053, 13, 33295, 7, 23893, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 27592, 651, 49222, 30846, 6601, 3419, 351, 262, 2727, 3128, 286, 262, 938, 14498, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 19620, 395, 18957, 7536, 32105, 1343, 965, 19510, 7890, 58, 12, 16, 7131, 6, 25598, 62, 315, 66, 20520, 22305, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 19119, 706, 7885, 284, 938, 2727, 3128, 286, 14498, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 7890, 468, 3421, 2233, 284, 262, 649, 706, 7885, 2810, 416, 2029, 2438, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1366, 796, 651, 49222, 30846, 6601, 62, 23903, 7, 22766, 11, 706, 62, 11, 878, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 21357, 43301, 42931, 11537, 201, 198, 220, 220, 220, 2845, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 12331, 981, 28403, 11537, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 1303, 38240, 284, 288, 9501, 357, 7266, 62, 312, 11, 25598, 11, 7266, 11, 7839, 11, 5239, 11, 6371, 11, 9800, 11, 26675, 11, 5907, 44482, 11, 22510, 5377, 907, 11, 525, 31000, 11, 2704, 958, 201, 198, 220, 220, 220, 3601, 10786, 25954, 25235, 11537, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 850, 35, 69, 796, 279, 67, 13, 6601, 19778, 7, 7266, 8053, 8, 201, 198, 220, 220, 220, 1303, 220, 850, 35, 69, 796, 850, 35, 69, 13, 2617, 62, 9630, 10786, 25598, 62, 315, 66, 11537, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 725, 35, 69, 796, 279, 67, 13, 6601, 19778, 7, 9503, 8053, 8, 201, 198, 220, 220, 220, 1303, 220, 725, 35, 69, 796, 725, 35, 69, 13, 2617, 62, 9630, 10786, 25598, 62, 315, 66, 11537, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 3601, 10786, 15057, 286, 3834, 8481, 9745, 276, 25, 3256, 850, 12332, 8, 201, 198, 220, 220, 220, 3601, 10786, 15057, 286, 19502, 9745, 276, 25, 3256, 725, 12332, 8, 201, 198, 220, 220, 220, 1441, 850, 35, 69, 11, 725, 35, 69, 201, 198, 201, 198, 201, 198, 7266, 8481, 11, 3651, 796, 10750, 18243, 10786, 70, 13513, 13062, 11537, 201, 198, 7266, 8481, 13, 1462, 62, 40664, 10786, 7266, 8481, 13, 40664, 11537, 201, 198, 15944, 13, 1462, 62, 40664, 10786, 15944, 13, 40664, 11537, 201, 198 ]
2.332051
2,340
from bootstrap3.forms import render_form from django import template from ..forms import SearchForm register = template.Library() @register.simple_tag()
[ 6738, 6297, 26418, 18, 13, 23914, 1330, 8543, 62, 687, 198, 6738, 42625, 14208, 1330, 11055, 198, 6738, 11485, 23914, 1330, 11140, 8479, 198, 198, 30238, 796, 11055, 13, 23377, 3419, 628, 198, 31, 30238, 13, 36439, 62, 12985, 3419, 628, 198 ]
3.761905
42
"""Runs a Blue Green deploy of a Cloud Foundry application using a manifest """ from __future__ import print_function import os import sys import json import cf_api from cf_api.deploy_manifest import Deploy from cf_api.deploy_space import Space from getpass import getpass print('----------') # cloud_controller_url = 'https://api.changeme.com' cloud_controller_url = raw_input('cloud controller url: ').strip() username = raw_input('username: ').strip() password = getpass('password: ').strip() print('----------') print('Authenticating with UAA...') cc = cf_api.new_cloud_controller( cloud_controller_url, client_id='cf', # the ``cf`` command uses this client and the secret below client_secret='', username=username, password=password, ) print('Login OK!') print('----------') org_name = raw_input('organization name: ').strip() space_name = raw_input('space name: ').strip() print('Looking up "{0} / {1}"...'.format(org_name, space_name)) space = Space(cc, org_name=org_name, space_name=space_name, is_debug=True) print('Found space!') print('----------') manifest_path = raw_input('manifest path: ').strip() manifest_path = os.path.abspath(manifest_path) space.deploy_blue_green(manifest_path) print('Deployed {0} successfully!'.format(app_name))
[ 37811, 10987, 82, 257, 4518, 3469, 6061, 286, 257, 10130, 4062, 563, 3586, 1262, 257, 10561, 198, 37811, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 33918, 198, 11748, 30218, 62, 15042, 198, 6738, 30218, 62, 15042, 13, 2934, 1420, 62, 805, 8409, 1330, 34706, 198, 6738, 30218, 62, 15042, 13, 2934, 1420, 62, 13200, 1330, 4687, 198, 6738, 651, 6603, 1330, 651, 6603, 628, 198, 4798, 10786, 35937, 11537, 198, 2, 6279, 62, 36500, 62, 6371, 796, 705, 5450, 1378, 15042, 13, 354, 648, 34755, 13, 785, 6, 198, 17721, 62, 36500, 62, 6371, 796, 8246, 62, 15414, 10786, 17721, 10444, 19016, 25, 705, 737, 36311, 3419, 198, 29460, 796, 8246, 62, 15414, 10786, 29460, 25, 705, 737, 36311, 3419, 198, 28712, 796, 651, 6603, 10786, 28712, 25, 705, 737, 36311, 3419, 198, 198, 4798, 10786, 35937, 11537, 198, 4798, 10786, 47649, 12364, 351, 471, 3838, 986, 11537, 198, 535, 796, 30218, 62, 15042, 13, 3605, 62, 17721, 62, 36500, 7, 198, 220, 220, 220, 6279, 62, 36500, 62, 6371, 11, 198, 220, 220, 220, 5456, 62, 312, 11639, 12993, 3256, 220, 1303, 262, 7559, 12993, 15506, 3141, 3544, 428, 5456, 290, 262, 3200, 2174, 198, 220, 220, 220, 5456, 62, 21078, 11639, 3256, 198, 220, 220, 220, 20579, 28, 29460, 11, 198, 220, 220, 220, 9206, 28, 28712, 11, 198, 8, 198, 4798, 10786, 47790, 7477, 0, 11537, 198, 198, 4798, 10786, 35937, 11537, 198, 2398, 62, 3672, 796, 8246, 62, 15414, 10786, 9971, 1634, 1438, 25, 705, 737, 36311, 3419, 198, 13200, 62, 3672, 796, 8246, 62, 15414, 10786, 13200, 1438, 25, 705, 737, 36311, 3419, 198, 4798, 10786, 15784, 510, 45144, 15, 92, 1220, 1391, 16, 92, 26214, 4458, 18982, 7, 2398, 62, 3672, 11, 2272, 62, 3672, 4008, 198, 13200, 796, 4687, 7, 535, 11, 8745, 62, 3672, 28, 2398, 62, 3672, 11, 2272, 62, 3672, 28, 13200, 62, 3672, 11, 318, 62, 24442, 28, 17821, 8, 198, 4798, 10786, 21077, 2272, 0, 11537, 198, 198, 4798, 10786, 35937, 11537, 198, 805, 8409, 62, 6978, 796, 8246, 62, 15414, 10786, 805, 8409, 3108, 25, 705, 737, 36311, 3419, 198, 805, 8409, 62, 6978, 796, 28686, 13, 6978, 13, 397, 2777, 776, 7, 805, 8409, 62, 6978, 8, 198, 198, 13200, 13, 2934, 1420, 62, 17585, 62, 14809, 7, 805, 8409, 62, 6978, 8, 198, 4798, 10786, 49322, 276, 1391, 15, 92, 7675, 0, 4458, 18982, 7, 1324, 62, 3672, 4008, 198 ]
3.081928
415