content
stringlengths
1
1.04M
input_ids
sequencelengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
import requests from apikey import apikey # Your API key, it's better not to store it in the program # Enter the WoS search query to evaluate its self-citation percentage: search_query = '(TS=("self citation*" or selfcitation*)) AND (TP==("HIGHLY CITED PAPERS"))' headers = { 'X-APIKey': apikey } endpoint = "https://api.clarivate.com/api/wos" # This will save several API queries/records received by storing the already checked citing papers locally checked_citing_papers = [('ut', 'cited_paper')] # This is the function that performs the self-citation calculation for every cited reference. If the self-citation event # has been identified by the above calculation() function, then the citing document is analyzed for the number of # references to that particular cited document. This is required because the number of citations and the number of # citing documents are not the same thing. One citing document can have multiple cited references leading to the cited # one, so the total amount of citations to a paper can sometimes be significantly higher than the number of citing # records. a = cited_papers() b = citing_papers(a) self_citations(a)
[ 11748, 7007, 198, 6738, 2471, 522, 88, 1330, 2471, 522, 88, 220, 220, 1303, 3406, 7824, 1994, 11, 340, 338, 1365, 407, 284, 3650, 340, 287, 262, 1430, 198, 198, 2, 6062, 262, 22173, 50, 2989, 12405, 284, 13446, 663, 2116, 12, 66, 3780, 5873, 25, 198, 12947, 62, 22766, 796, 29513, 4694, 28, 7203, 944, 27860, 9, 1, 393, 2116, 66, 3780, 9, 4008, 5357, 357, 7250, 855, 7203, 39, 3528, 6581, 56, 327, 22061, 350, 2969, 4877, 48774, 6, 198, 198, 50145, 796, 1391, 198, 220, 220, 220, 705, 55, 12, 17614, 9218, 10354, 2471, 522, 88, 198, 92, 198, 198, 437, 4122, 796, 366, 5450, 1378, 15042, 13, 565, 283, 452, 378, 13, 785, 14, 15042, 14, 86, 418, 1, 198, 198, 2, 770, 481, 3613, 1811, 7824, 20743, 14, 8344, 3669, 2722, 416, 23069, 262, 1541, 10667, 12988, 9473, 15726, 198, 26752, 62, 66, 1780, 62, 40491, 796, 685, 10786, 315, 3256, 705, 66, 863, 62, 20189, 11537, 60, 628, 628, 628, 628, 628, 628, 198, 2, 770, 318, 262, 2163, 326, 17706, 262, 2116, 12, 66, 3780, 17952, 329, 790, 9181, 4941, 13, 1002, 262, 2116, 12, 66, 3780, 1785, 198, 2, 468, 587, 5174, 416, 262, 2029, 17952, 3419, 2163, 11, 788, 262, 12988, 3188, 318, 15475, 329, 262, 1271, 286, 198, 2, 10288, 284, 326, 1948, 9181, 3188, 13, 770, 318, 2672, 780, 262, 1271, 286, 33499, 290, 262, 1271, 286, 198, 2, 12988, 4963, 389, 407, 262, 976, 1517, 13, 1881, 12988, 3188, 460, 423, 3294, 9181, 10288, 3756, 284, 262, 9181, 198, 2, 530, 11, 523, 262, 2472, 2033, 286, 33499, 284, 257, 3348, 460, 3360, 307, 5566, 2440, 621, 262, 1271, 286, 12988, 198, 2, 4406, 13, 628, 198, 198, 64, 796, 9181, 62, 40491, 3419, 198, 65, 796, 12988, 62, 40491, 7, 64, 8, 198, 944, 62, 66, 20597, 7, 64, 8, 198 ]
3.748408
314
from abc import ABCMeta from types import TracebackType from typing import ContextManager from typing import List from typing import Optional from typing import Type from typing import TypeVar from typing_extensions import Literal from typing_extensions import Protocol from fbsrankings.common import Command from fbsrankings.common import CommandBus from fbsrankings.common import EventBus from fbsrankings.common import Query from fbsrankings.common import QueryBus from fbsrankings.domain import RaiseBehavior from fbsrankings.domain import ValidationError from fbsrankings.domain import ValidationService from fbsrankings.infrastructure import QueryManagerFactory from fbsrankings.infrastructure import TransactionFactory from fbsrankings.infrastructure.memory import DataSource as MemoryDataSource from fbsrankings.infrastructure.sportsreference import SportsReference from fbsrankings.infrastructure.sqlite import DataSource as SqliteDataSource from fbsrankings.service.command import CommandManager from fbsrankings.service.config import Config from fbsrankings.service.config import ConfigStorageType R = TypeVar("R", covariant=True)
[ 6738, 450, 66, 1330, 9738, 48526, 198, 6738, 3858, 1330, 34912, 1891, 6030, 198, 6738, 19720, 1330, 30532, 13511, 198, 6738, 19720, 1330, 7343, 198, 6738, 19720, 1330, 32233, 198, 6738, 19720, 1330, 5994, 198, 6738, 19720, 1330, 5994, 19852, 198, 198, 6738, 19720, 62, 2302, 5736, 1330, 25659, 1691, 198, 6738, 19720, 62, 2302, 5736, 1330, 20497, 198, 198, 6738, 277, 1443, 43027, 654, 13, 11321, 1330, 9455, 198, 6738, 277, 1443, 43027, 654, 13, 11321, 1330, 9455, 16286, 198, 6738, 277, 1443, 43027, 654, 13, 11321, 1330, 8558, 16286, 198, 6738, 277, 1443, 43027, 654, 13, 11321, 1330, 43301, 198, 6738, 277, 1443, 43027, 654, 13, 11321, 1330, 43301, 16286, 198, 6738, 277, 1443, 43027, 654, 13, 27830, 1330, 35123, 25267, 15759, 198, 6738, 277, 1443, 43027, 654, 13, 27830, 1330, 3254, 24765, 12331, 198, 6738, 277, 1443, 43027, 654, 13, 27830, 1330, 3254, 24765, 16177, 198, 6738, 277, 1443, 43027, 654, 13, 10745, 6410, 1330, 43301, 13511, 22810, 198, 6738, 277, 1443, 43027, 654, 13, 10745, 6410, 1330, 45389, 22810, 198, 6738, 277, 1443, 43027, 654, 13, 10745, 6410, 13, 31673, 1330, 6060, 7416, 355, 14059, 6601, 7416, 198, 6738, 277, 1443, 43027, 654, 13, 10745, 6410, 13, 32945, 35790, 1330, 7092, 26687, 198, 6738, 277, 1443, 43027, 654, 13, 10745, 6410, 13, 25410, 578, 1330, 6060, 7416, 355, 311, 13976, 578, 6601, 7416, 198, 6738, 277, 1443, 43027, 654, 13, 15271, 13, 21812, 1330, 9455, 13511, 198, 6738, 277, 1443, 43027, 654, 13, 15271, 13, 11250, 1330, 17056, 198, 6738, 277, 1443, 43027, 654, 13, 15271, 13, 11250, 1330, 17056, 31425, 6030, 198, 198, 49, 796, 5994, 19852, 7203, 49, 1600, 44829, 415, 28, 17821, 8, 628, 198 ]
4.067376
282
import inspect import sys import typing from dataclasses import dataclass if sys.version_info < (3, 9): from typing_extensions import Annotated, get_args, get_origin else: from typing import Annotated, get_origin, get_args from di.typing import get_markers_from_parameter from xpresso._utils.typing import model_field_from_param from xpresso.binders.api import ModelNameMap, OpenAPIBody, OpenAPIBodyMarker, Schemas from xpresso.binders.dependants import BodyBinderMarker from xpresso.openapi import models as openapi_models @dataclass(frozen=True) @dataclass(frozen=True)
[ 11748, 10104, 198, 11748, 25064, 198, 11748, 19720, 198, 6738, 4818, 330, 28958, 1330, 4818, 330, 31172, 198, 198, 361, 25064, 13, 9641, 62, 10951, 1279, 357, 18, 11, 860, 2599, 198, 220, 220, 220, 422, 19720, 62, 2302, 5736, 1330, 1052, 1662, 515, 11, 651, 62, 22046, 11, 651, 62, 47103, 198, 17772, 25, 198, 220, 220, 220, 422, 19720, 1330, 1052, 1662, 515, 11, 651, 62, 47103, 11, 651, 62, 22046, 198, 198, 6738, 2566, 13, 774, 13886, 1330, 651, 62, 4102, 364, 62, 6738, 62, 17143, 2357, 198, 198, 6738, 2124, 18302, 568, 13557, 26791, 13, 774, 13886, 1330, 2746, 62, 3245, 62, 6738, 62, 17143, 198, 6738, 2124, 18302, 568, 13, 21653, 364, 13, 15042, 1330, 9104, 5376, 13912, 11, 4946, 2969, 9865, 1118, 11, 4946, 2969, 9865, 1118, 9704, 263, 11, 1446, 4411, 292, 198, 6738, 2124, 18302, 568, 13, 21653, 364, 13, 45841, 1187, 1330, 12290, 33, 5540, 9704, 263, 198, 6738, 2124, 18302, 568, 13, 9654, 15042, 1330, 4981, 355, 1280, 15042, 62, 27530, 628, 198, 31, 19608, 330, 31172, 7, 69, 42005, 28, 17821, 8, 628, 198, 31, 19608, 330, 31172, 7, 69, 42005, 28, 17821, 8, 198 ]
2.994898
196
from operator import itemgetter import time import math import random import numpy as np import datetime from osgeo import ogr, osr latlongToAlbers = getCoordConverter(4326,5070) albersToLatlong = getCoordConverter(5070,4326) start_date = datetime.datetime(1992,1,1) end_date = datetime.datetime(2017,12,31) current_date = start_date increment = datetime.timedelta(minutes=15) sample_point = (-41.8822705,28.4248646) # (Long, Lat) travel_path = [sample_point] while current_date < end_date: # while line != "": # line = sea_file.readline() # point_data = line.split(',') # try: # print(type(point_data)) # print(type(point_data[1])) # print(datetime.datetime.strptime(point_data[1][1],"%Y-%m-%d")) # # sorted(point_data, key=lambda e: datetime.datetime.strptime(e[1], "%Y-%m-%d")) # except Exception: # print("sorting didn't work") # print(point_data) # line = "" bin_file = f"ecco_{str(current_date.year).zfill(4)}-{str(current_date.month).zfill(2)}_000.npy" curr_vector_field = np.load(f"../images/{bin_file}") [y,x] = latlongToIndex(sample_point) # print(f"Index: {[y,x]}") # print(f"Possible Index: {curr_vector_field[y,x]}") # print(f"Possible Index: {curr_vector_field[x,y]}") # print(f"Does this shit even exist???? {curr_vector_field[360-y-1,x]}") curr_vector = curr_vector_field[y,x] if np.isnan(curr_vector[0]): neighbors = get_neighbors(curr_vector_field, x, y) if len(neighbors) is not 0: curr_vector = random.choice(neighbors) sample_point = move_point(sample_point, curr_vector) travel_path.append(sample_point) current_date += increment
[ 6738, 10088, 1330, 2378, 1136, 353, 198, 11748, 640, 198, 11748, 10688, 198, 11748, 4738, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 4818, 8079, 198, 6738, 28686, 469, 78, 1330, 267, 2164, 11, 267, 27891, 198, 198, 15460, 6511, 2514, 2348, 1213, 796, 651, 7222, 585, 3103, 332, 353, 7, 3559, 2075, 11, 1120, 2154, 8, 198, 282, 1213, 2514, 24220, 6511, 796, 651, 7222, 585, 3103, 332, 353, 7, 1120, 2154, 11, 3559, 2075, 8, 198, 198, 9688, 62, 4475, 796, 4818, 8079, 13, 19608, 8079, 7, 23847, 11, 16, 11, 16, 8, 198, 437, 62, 4475, 796, 4818, 8079, 13, 19608, 8079, 7, 5539, 11, 1065, 11, 3132, 8, 198, 198, 14421, 62, 4475, 796, 923, 62, 4475, 198, 24988, 434, 796, 4818, 8079, 13, 16514, 276, 12514, 7, 1084, 1769, 28, 1314, 8, 198, 198, 39873, 62, 4122, 796, 13841, 3901, 13, 3459, 1828, 34801, 11, 2078, 13, 19, 23045, 27720, 8, 1303, 357, 14617, 11, 5476, 8, 198, 35927, 62, 6978, 796, 685, 39873, 62, 4122, 60, 628, 628, 628, 198, 4514, 1459, 62, 4475, 1279, 886, 62, 4475, 25, 198, 2, 220, 220, 220, 981, 1627, 14512, 366, 1298, 198, 2, 220, 220, 220, 220, 220, 220, 220, 1627, 796, 5417, 62, 7753, 13, 961, 1370, 3419, 198, 2, 220, 220, 220, 220, 220, 220, 220, 966, 62, 7890, 796, 220, 1627, 13, 35312, 7, 3256, 11537, 198, 2, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 220, 220, 220, 220, 220, 220, 220, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 4906, 7, 4122, 62, 7890, 4008, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 4906, 7, 4122, 62, 7890, 58, 16, 60, 4008, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 19608, 8079, 13, 19608, 8079, 13, 2536, 457, 524, 7, 4122, 62, 7890, 58, 16, 7131, 16, 17241, 4, 56, 12, 4, 76, 12, 4, 67, 48774, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 23243, 7, 4122, 62, 7890, 11, 1994, 28, 50033, 304, 25, 4818, 8079, 13, 19608, 8079, 13, 2536, 457, 524, 7, 68, 58, 16, 4357, 36521, 56, 12, 4, 76, 12, 4, 67, 48774, 198, 2, 220, 220, 220, 220, 220, 220, 220, 2845, 35528, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 82, 24707, 1422, 470, 670, 4943, 198, 2, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 4122, 62, 7890, 8, 198, 2, 220, 220, 220, 220, 220, 220, 220, 1627, 796, 13538, 198, 220, 220, 220, 9874, 62, 7753, 796, 277, 1, 68, 535, 78, 23330, 2536, 7, 14421, 62, 4475, 13, 1941, 737, 89, 20797, 7, 19, 38165, 12, 90, 2536, 7, 14421, 62, 4475, 13, 8424, 737, 89, 20797, 7, 17, 38165, 62, 830, 13, 77, 9078, 1, 198, 220, 220, 220, 1090, 81, 62, 31364, 62, 3245, 796, 45941, 13, 2220, 7, 69, 1, 40720, 17566, 14, 90, 8800, 62, 7753, 92, 4943, 198, 220, 220, 220, 685, 88, 11, 87, 60, 796, 3042, 6511, 2514, 15732, 7, 39873, 62, 4122, 8, 198, 220, 220, 1303, 3601, 7, 69, 1, 15732, 25, 1391, 58, 88, 11, 87, 48999, 4943, 198, 220, 220, 1303, 3601, 7, 69, 1, 47, 4733, 12901, 25, 1391, 22019, 81, 62, 31364, 62, 3245, 58, 88, 11, 87, 48999, 4943, 198, 220, 220, 1303, 3601, 7, 69, 1, 47, 4733, 12901, 25, 1391, 22019, 81, 62, 31364, 62, 3245, 58, 87, 11, 88, 48999, 4943, 198, 220, 220, 1303, 3601, 7, 69, 1, 13921, 428, 7510, 772, 2152, 9805, 1391, 22019, 81, 62, 31364, 62, 3245, 58, 15277, 12, 88, 12, 16, 11, 87, 48999, 4943, 198, 220, 220, 220, 1090, 81, 62, 31364, 796, 1090, 81, 62, 31364, 62, 3245, 58, 88, 11, 87, 60, 198, 220, 220, 220, 611, 45941, 13, 271, 12647, 7, 22019, 81, 62, 31364, 58, 15, 60, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 12020, 796, 651, 62, 710, 394, 32289, 7, 22019, 81, 62, 31364, 62, 3245, 11, 2124, 11, 331, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 710, 394, 32289, 8, 318, 407, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1090, 81, 62, 31364, 796, 4738, 13, 25541, 7, 710, 394, 32289, 8, 198, 220, 220, 220, 6291, 62, 4122, 796, 1445, 62, 4122, 7, 39873, 62, 4122, 11, 1090, 81, 62, 31364, 8, 198, 220, 220, 220, 3067, 62, 6978, 13, 33295, 7, 39873, 62, 4122, 8, 628, 220, 220, 220, 1459, 62, 4475, 15853, 18703, 198, 220, 220, 220, 220, 198 ]
2.197484
795
from .example import my_func
[ 6738, 764, 20688, 1330, 616, 62, 20786, 201, 198 ]
3.333333
9
import time from Xboxcmd import * import pygame pygame.init() pygame.joystick.init() #查看现在有几个遥控器 joycount = pygame.joystick.get_count() print("joycount:"+str(joycount)) #连接第一个控制器 joystick = pygame.joystick.Joystick(0) while True: #接收事件 pygame.event.get() axis = get_axis(joystick=joystick) button = get_button(joystick=joystick) hats = get_hats(joystick=joystick) print("_____________") print(" axis_value:") print(axis) print(" button_value") print(button[3]) print("hat_value") print(hats) print("_____________") time.sleep(3)
[ 11748, 640, 198, 6738, 9445, 28758, 1330, 1635, 198, 11748, 12972, 6057, 198, 198, 9078, 6057, 13, 15003, 3419, 198, 9078, 6057, 13, 2633, 13915, 13, 15003, 3419, 198, 198, 2, 162, 253, 98, 40367, 233, 163, 236, 108, 28839, 101, 17312, 231, 49035, 254, 10310, 103, 34402, 98, 162, 236, 100, 161, 247, 101, 198, 2633, 9127, 796, 12972, 6057, 13, 2633, 13915, 13, 1136, 62, 9127, 3419, 198, 4798, 7203, 2633, 9127, 11097, 10, 2536, 7, 2633, 9127, 4008, 198, 198, 2, 32573, 252, 162, 236, 98, 163, 105, 105, 31660, 10310, 103, 162, 236, 100, 26344, 114, 161, 247, 101, 198, 2633, 13915, 796, 12972, 6057, 13, 2633, 13915, 13, 41338, 13915, 7, 15, 8, 198, 198, 4514, 6407, 25, 198, 220, 220, 220, 1303, 162, 236, 98, 162, 242, 114, 12859, 233, 20015, 114, 198, 220, 220, 220, 12972, 6057, 13, 15596, 13, 1136, 3419, 628, 220, 220, 220, 16488, 796, 651, 62, 22704, 7, 2633, 13915, 28, 2633, 13915, 8, 198, 220, 220, 220, 4936, 796, 651, 62, 16539, 7, 2633, 13915, 28, 2633, 13915, 8, 198, 220, 220, 220, 23910, 796, 651, 62, 71, 1381, 7, 2633, 13915, 28, 2633, 13915, 8, 628, 220, 220, 220, 3601, 7203, 2602, 29343, 4943, 198, 220, 220, 220, 3601, 7203, 16488, 62, 8367, 25, 4943, 198, 220, 220, 220, 3601, 7, 22704, 8, 198, 220, 220, 220, 3601, 7203, 4936, 62, 8367, 4943, 198, 220, 220, 220, 3601, 7, 16539, 58, 18, 12962, 198, 220, 220, 220, 3601, 7203, 5183, 62, 8367, 4943, 198, 220, 220, 220, 3601, 7, 71, 1381, 8, 198, 220, 220, 220, 3601, 7203, 2602, 29343, 4943, 198, 220, 220, 220, 640, 13, 42832, 7, 18, 8, 198 ]
2.073684
285
''' @author:yk7333 last modified:2021-4-7 language:python ''' import cv2 as cv import numpy as np import matplotlib.pyplot as plt import os if __name__ == "__main__": os.chdir("C:\\Users\\m\\Desktop\\第四次作业") for i in range(3,8,2): #3,5,7 img=read("test2.tif") #第一问 gaussion=Blur(img,i,"Gaussion") median=Blur(img,i,"Median") save("gaussion2{0}x{1}.jpg".format(i,i),gaussion) save("medium2{0}x{1}.jpg".format(i,i),median) for i in range(3,8,2): print(Gaussion(i,1.5)) #第二问 print("\n") img3=read("test3_corrupt.pgm") img4=read("test4 copy.bmp") #unshape masking img3_blur=Blur(img3,5,sigma=1) #采用5x5高斯滤波进行模糊处理 img4_blur=Blur(img4,5,sigma=1) mask3=img3-img3_blur mask4=img4-img4_blur save("img3_unmask.jpg",mask3) save("img4_unmask.jpg",mask4) #Sobel edge detector sobelx=cv.Sobel(img3,cv.CV_64F,0,1,ksize=3) sobelx=cv.convertScaleAbs(sobelx) sobely=cv.Sobel(img3,cv.CV_64F,1,0,ksize=3) sobely=cv.convertScaleAbs(sobely) sobelxy=cv.addWeighted(sobelx,0.5,sobely,0.5,0) save("img3_sobel.jpg",sobelxy) sobelx=cv.Sobel(img4,cv.CV_64F,0,1,ksize=3) sobelx=cv.convertScaleAbs(sobelx) sobely=cv.Sobel(img4,cv.CV_64F,1,0,ksize=3) sobely=cv.convertScaleAbs(sobely) sobelxy=cv.addWeighted(sobelx,0.5,sobely,0.5,0) save("img4_sobel.jpg",sobelxy) #laplace edge detection laplacian = cv.Laplacian(img3,cv.CV_64F) laplacian = cv.convertScaleAbs(laplacian) save("img3_lap.jpg",laplacian) laplacian = cv.Laplacian(img4,cv.CV_64F) laplacian = cv.convertScaleAbs(laplacian) save("img4_lap.jpg",laplacian) #canny algorithm canny=cv.Canny(img3,50,80) save("img3_canny.jpg",canny) canny=cv.Canny(img4,50,80) save("img4_canny.jpg",canny)
[ 7061, 6, 198, 31, 9800, 25, 48361, 22, 20370, 220, 198, 938, 9518, 25, 1238, 2481, 12, 19, 12, 22, 220, 220, 198, 3303, 25, 29412, 198, 7061, 6, 198, 11748, 269, 85, 17, 355, 269, 85, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 28686, 198, 220, 220, 220, 220, 220, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 28686, 13, 354, 15908, 7203, 34, 25, 6852, 14490, 6852, 76, 6852, 36881, 6852, 163, 105, 105, 32368, 249, 162, 105, 94, 43291, 10310, 248, 4943, 198, 220, 220, 220, 220, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 18, 11, 23, 11, 17, 2599, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 18, 11, 20, 11, 22, 198, 220, 220, 220, 220, 220, 220, 220, 33705, 28, 961, 7203, 9288, 17, 13, 49929, 4943, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 163, 105, 105, 31660, 29785, 106, 628, 220, 220, 220, 220, 220, 220, 220, 31986, 11956, 28, 3629, 333, 7, 9600, 11, 72, 553, 35389, 11956, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 14288, 28, 3629, 333, 7, 9600, 11, 72, 553, 9921, 666, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 3613, 7203, 4908, 11956, 17, 90, 15, 92, 87, 90, 16, 27422, 9479, 1911, 18982, 7, 72, 11, 72, 828, 4908, 11956, 8, 198, 220, 220, 220, 220, 220, 220, 220, 3613, 7203, 24132, 17, 90, 15, 92, 87, 90, 16, 27422, 9479, 1911, 18982, 7, 72, 11, 72, 828, 1150, 666, 8, 628, 220, 220, 220, 329, 1312, 287, 2837, 7, 18, 11, 23, 11, 17, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 35389, 11956, 7, 72, 11, 16, 13, 20, 4008, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 163, 105, 105, 12859, 234, 29785, 106, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 59, 77, 4943, 628, 220, 220, 220, 33705, 18, 28, 961, 7203, 9288, 18, 62, 10215, 3622, 13, 6024, 76, 4943, 198, 220, 220, 220, 33705, 19, 28, 961, 7203, 9288, 19, 4866, 13, 65, 3149, 4943, 198, 2, 403, 43358, 9335, 278, 198, 220, 220, 220, 33705, 18, 62, 2436, 333, 28, 3629, 333, 7, 9600, 18, 11, 20, 11, 82, 13495, 28, 16, 8, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 34932, 229, 18796, 101, 20, 87, 20, 165, 45865, 23877, 107, 162, 119, 97, 37345, 95, 32573, 249, 26193, 234, 162, 101, 94, 163, 111, 232, 13783, 226, 49426, 228, 198, 220, 220, 220, 33705, 19, 62, 2436, 333, 28, 3629, 333, 7, 9600, 19, 11, 20, 11, 82, 13495, 28, 16, 8, 220, 198, 220, 220, 220, 9335, 18, 28, 9600, 18, 12, 9600, 18, 62, 2436, 333, 198, 220, 220, 220, 9335, 19, 28, 9600, 19, 12, 9600, 19, 62, 2436, 333, 198, 220, 220, 220, 3613, 7203, 9600, 18, 62, 403, 27932, 13, 9479, 1600, 27932, 18, 8, 198, 220, 220, 220, 3613, 7203, 9600, 19, 62, 403, 27932, 13, 9479, 1600, 27932, 19, 8, 198, 2, 50, 672, 417, 5743, 31029, 198, 220, 220, 220, 523, 6667, 87, 28, 33967, 13, 50, 672, 417, 7, 9600, 18, 11, 33967, 13, 33538, 62, 2414, 37, 11, 15, 11, 16, 11, 591, 1096, 28, 18, 8, 198, 220, 220, 220, 523, 6667, 87, 28, 33967, 13, 1102, 1851, 29990, 24849, 7, 568, 6667, 87, 8, 198, 220, 220, 220, 523, 1350, 306, 28, 33967, 13, 50, 672, 417, 7, 9600, 18, 11, 33967, 13, 33538, 62, 2414, 37, 11, 16, 11, 15, 11, 591, 1096, 28, 18, 8, 198, 220, 220, 220, 523, 1350, 306, 28, 33967, 13, 1102, 1851, 29990, 24849, 7, 568, 1350, 306, 8, 198, 220, 220, 220, 523, 6667, 5431, 28, 33967, 13, 2860, 25844, 276, 7, 568, 6667, 87, 11, 15, 13, 20, 11, 568, 1350, 306, 11, 15, 13, 20, 11, 15, 8, 220, 198, 220, 220, 220, 3613, 7203, 9600, 18, 62, 568, 6667, 13, 9479, 1600, 568, 6667, 5431, 8, 198, 220, 220, 220, 523, 6667, 87, 28, 33967, 13, 50, 672, 417, 7, 9600, 19, 11, 33967, 13, 33538, 62, 2414, 37, 11, 15, 11, 16, 11, 591, 1096, 28, 18, 8, 198, 220, 220, 220, 523, 6667, 87, 28, 33967, 13, 1102, 1851, 29990, 24849, 7, 568, 6667, 87, 8, 198, 220, 220, 220, 523, 1350, 306, 28, 33967, 13, 50, 672, 417, 7, 9600, 19, 11, 33967, 13, 33538, 62, 2414, 37, 11, 16, 11, 15, 11, 591, 1096, 28, 18, 8, 198, 220, 220, 220, 523, 1350, 306, 28, 33967, 13, 1102, 1851, 29990, 24849, 7, 568, 1350, 306, 8, 198, 220, 220, 220, 523, 6667, 5431, 28, 33967, 13, 2860, 25844, 276, 7, 568, 6667, 87, 11, 15, 13, 20, 11, 568, 1350, 306, 11, 15, 13, 20, 11, 15, 8, 198, 220, 220, 220, 3613, 7203, 9600, 19, 62, 568, 6667, 13, 9479, 1600, 568, 6667, 5431, 8, 198, 2, 5031, 5372, 5743, 13326, 198, 220, 220, 220, 8591, 489, 330, 666, 796, 269, 85, 13, 14772, 489, 330, 666, 7, 9600, 18, 11, 33967, 13, 33538, 62, 2414, 37, 8, 198, 220, 220, 220, 8591, 489, 330, 666, 796, 269, 85, 13, 1102, 1851, 29990, 24849, 7, 5031, 489, 330, 666, 8, 220, 198, 220, 220, 220, 3613, 7203, 9600, 18, 62, 37796, 13, 9479, 1600, 5031, 489, 330, 666, 8, 198, 220, 220, 220, 8591, 489, 330, 666, 796, 269, 85, 13, 14772, 489, 330, 666, 7, 9600, 19, 11, 33967, 13, 33538, 62, 2414, 37, 8, 198, 220, 220, 220, 8591, 489, 330, 666, 796, 269, 85, 13, 1102, 1851, 29990, 24849, 7, 5031, 489, 330, 666, 8, 220, 198, 220, 220, 220, 3613, 7203, 9600, 19, 62, 37796, 13, 9479, 1600, 5031, 489, 330, 666, 8, 198, 2, 66, 7737, 11862, 198, 220, 220, 220, 460, 3281, 28, 33967, 13, 34, 7737, 7, 9600, 18, 11, 1120, 11, 1795, 8, 198, 220, 220, 220, 3613, 7203, 9600, 18, 62, 66, 7737, 13, 9479, 1600, 66, 7737, 8, 198, 220, 220, 220, 460, 3281, 28, 33967, 13, 34, 7737, 7, 9600, 19, 11, 1120, 11, 1795, 8, 198, 220, 220, 220, 3613, 7203, 9600, 19, 62, 66, 7737, 13, 9479, 1600, 66, 7737, 8, 198 ]
1.716216
1,110
from pymongo import MongoClient if __name__ == '__main__': print(CustomerRepository().get_customers())
[ 6738, 279, 4948, 25162, 1330, 42591, 11792, 201, 198, 201, 198, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 201, 198, 220, 220, 220, 3601, 7, 44939, 6207, 13264, 22446, 1136, 62, 23144, 364, 28955, 201, 198 ]
2.697674
43
import os import json import logging import logging.config from telegram.ext import Updater from telegram.ext import CommandHandler from telegram.ext import Filters from config import config from jobs import JOBS_CALLBACKS import utils as u logger = logging.getLogger(__name__) load_logging_config() @u.restricted @u.restricted @u.restricted if __name__ == '__main__': main()
[ 11748, 28686, 201, 198, 11748, 33918, 201, 198, 11748, 18931, 201, 198, 11748, 18931, 13, 11250, 201, 198, 201, 198, 6738, 573, 30536, 13, 2302, 1330, 3205, 67, 729, 201, 198, 6738, 573, 30536, 13, 2302, 1330, 9455, 25060, 201, 198, 6738, 573, 30536, 13, 2302, 1330, 7066, 1010, 201, 198, 201, 198, 6738, 4566, 1330, 4566, 201, 198, 6738, 3946, 1330, 32357, 4462, 62, 34, 7036, 31098, 50, 201, 198, 11748, 3384, 4487, 355, 334, 201, 198, 201, 198, 201, 198, 201, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 201, 198, 2220, 62, 6404, 2667, 62, 11250, 3419, 201, 198, 201, 198, 201, 198, 31, 84, 13, 49343, 201, 198, 201, 198, 201, 198, 31, 84, 13, 49343, 201, 198, 201, 198, 201, 198, 31, 84, 13, 49343, 201, 198, 201, 198, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 201, 198, 220, 220, 220, 1388, 3419, 201, 198 ]
2.607362
163
import os import re import json import requests from datetime import datetime github_headers = {'Authorization': 'token %s' % os.environ.get("GITHUB_TOKEN")} repo_info_table = { "vouch-proxy": { "name": "vouch-proxy", "type": "github", "owner": "vouch", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "redis_exporter": { "name": "redis_exporter", "type": "github", "owner": "oliver006", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "mysqld_exporter": { "name": "mysqld_exporter", "type": "github", "owner": "prometheus", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "postgres_exporter": { "name": "postgres_exporter", "type": "github", "owner": "prometheus-community", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "caddy": { "name": "caddy", "type": "github", "owner": "caddyserver", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "envtpl": { "name": "envtpl", "type": "github", "owner": "subfuzion", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "erlang": { "name": "otp", "type": "github", "owner": "erlang", "match": "^OTP-[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "fluentd": { "name": "fluentd", "type": "github", "owner": "fluent", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "go": { "name": "go", "type": "github", "owner": "golang", "match": "^go[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "gosu": { "name": "gosu", "type": "github", "owner": "tianon", "match": "^[0-9]{1,}\.[0-9]{1,}$", }, "grafana": { "name": "grafana", "type": "github", "owner": "grafana", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "helm": { "name": "helm", "type": "github", "owner": "helm", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "influxdb": { "name": "influxdb", "type": "github", "owner": "influxdata", "match": "^v[2-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "ini-file": { "name": "ini-file", "type": "github", "owner": "bitnami", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "java": { "name": "jdk", "type": "github", "owner": "openjdk", "match": "^jdk-[0-9]{1,}\+[0-9]{1,}$", }, "jq": { "name": "jq", "type": "github", "owner": "stedolan", "match": "^jq-[0-9]{1,}\.[0-9]{1,}\.?[0-9]{0}$", }, "kubectl": { "name": "kubectl", "type": "github", "owner": "kubernetes", "match": "^kubernetes-[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "mariadb": { "name": "server", "type": "github", "owner": "MariaDB", "match": "^mariadb-[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "mc": { "name": "mc", "type": "github", "owner": "minio", "match": "^RELEASE\.[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}Z$", }, "minio": { "name": "minio", "type": "github", "owner": "minio", "match": "^RELEASE\.[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}Z$", }, "nginx": { "name": "nginx", "type": "github", "owner": "nginx", "match": "^release-[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "node": { "name": "node", "type": "github", "owner": "nodejs", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "pack": { "name": "pack", "type": "github", "owner": "buildpacks", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "php": { "name": "php-src", "type": "github", "owner": "php", "match": "^php-[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "podman": { "name": "podman", "type": "github", "owner": "containers", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "postgresql": { "name": "postgres", "type": "github", "owner": "postgres", "match": "^REL_[0-9]{1,}_[0-9]{1,}$", }, "python": { "name": "cpython", "type": "github", "owner": "python", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "rabbitmq": { "name": "rabbitmq-server", "type": "github", "owner": "rabbitmq", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "redis": { "name": "redis", "type": "github", "owner": "redis", "match": "^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "redis-sentinel": { "name": "redis", "type": "github", "owner": "redis", "match": "^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "registry": { "name": "distribution", "type": "github", "owner": "distribution", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "ruby": { "name": "ruby", "type": "github", "owner": "ruby", "match": "^v[0-9]{1,}_[0-9]{1,}_[0-9]{1,}$", }, "rust": { "name": "rust", "type": "github", "owner": "rust-lang", "match": "^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "telegraf": { "name": "telegraf", "type": "github", "owner": "influxdata", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "wait-for-port": { "name": "wait-for-port", "type": "github", "owner": "bitnami", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, "wal-g": { "name": "wal-g", "type": "github", "owner": "wal-g", "match": "^v[0-9]{1,}\.[0-9]{1,}\.?[0-9]{0}$", }, "yj": { "name": "yj", "type": "github", "owner": "sclevine", "match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$", }, } github_tags_graphql = """ query { repository(owner: "{owner}", name: "{name}") { refs(refPrefix: "refs/tags/", first: 10, orderBy: {field: TAG_COMMIT_DATE, direction: DESC}) { edges { node { name target { oid ... on Tag { commitUrl tagger { date } } } } } } } } """ if __name__ == "__main__": main()
[ 11748, 28686, 198, 11748, 302, 198, 11748, 33918, 198, 11748, 7007, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 12567, 62, 50145, 796, 1391, 6, 13838, 1634, 10354, 705, 30001, 4064, 82, 6, 4064, 28686, 13, 268, 2268, 13, 1136, 7203, 38, 10554, 10526, 62, 10468, 43959, 4943, 92, 198, 198, 260, 7501, 62, 10951, 62, 11487, 796, 1391, 198, 220, 220, 220, 366, 85, 7673, 12, 36436, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 85, 7673, 12, 36436, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 85, 7673, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 445, 271, 62, 1069, 26634, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 445, 271, 62, 1069, 26634, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 349, 1428, 28041, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 28744, 80, 335, 62, 1069, 26634, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 28744, 80, 335, 62, 1069, 26634, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 16963, 36916, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 7353, 34239, 62, 1069, 26634, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 7353, 34239, 62, 1069, 26634, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 16963, 36916, 12, 28158, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 66, 13218, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 66, 13218, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 66, 2860, 893, 18497, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 24330, 83, 489, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 24330, 83, 489, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 7266, 69, 10277, 295, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 263, 17204, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 313, 79, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 263, 17204, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 2394, 47, 49146, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 69, 28216, 67, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 69, 28216, 67, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 69, 28216, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 2188, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 2188, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 70, 349, 648, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 2188, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 70, 418, 84, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 70, 418, 84, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 83, 666, 261, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 70, 32188, 2271, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 70, 32188, 2271, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 70, 32188, 2271, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 33485, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 33485, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 33485, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 10745, 22564, 9945, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 10745, 22564, 9945, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 10745, 22564, 7890, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 17, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 5362, 12, 7753, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 5362, 12, 7753, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 2545, 77, 6277, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 12355, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 73, 34388, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 9654, 73, 34388, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 73, 34388, 49146, 15, 12, 24, 60, 90, 16, 11, 32239, 10, 58, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 73, 80, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 73, 80, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 30679, 16617, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 73, 80, 49146, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 17405, 30, 58, 15, 12, 24, 60, 90, 15, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 74, 549, 478, 75, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 74, 549, 478, 75, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 74, 18478, 3262, 274, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 74, 18478, 3262, 274, 49146, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 76, 2743, 324, 65, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 15388, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 46827, 11012, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 76, 2743, 324, 65, 49146, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 23209, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 23209, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 1084, 952, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 2200, 22781, 59, 3693, 15, 12, 24, 60, 90, 19, 92, 49146, 15, 12, 24, 60, 90, 17, 92, 49146, 15, 12, 24, 60, 90, 17, 92, 51, 58, 15, 12, 24, 60, 90, 17, 92, 49146, 15, 12, 24, 60, 90, 17, 92, 49146, 15, 12, 24, 60, 90, 17, 92, 57, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 1084, 952, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 1084, 952, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 1084, 952, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 2200, 22781, 59, 3693, 15, 12, 24, 60, 90, 19, 92, 49146, 15, 12, 24, 60, 90, 17, 92, 49146, 15, 12, 24, 60, 90, 17, 92, 51, 58, 15, 12, 24, 60, 90, 17, 92, 49146, 15, 12, 24, 60, 90, 17, 92, 49146, 15, 12, 24, 60, 90, 17, 92, 57, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 782, 28413, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 782, 28413, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 782, 28413, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 20979, 49146, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 17440, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 17440, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 17440, 8457, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 8002, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 8002, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 11249, 32377, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 10121, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 10121, 12, 10677, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 10121, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 10121, 49146, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 33320, 805, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 33320, 805, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 3642, 50221, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 7353, 34239, 13976, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 7353, 34239, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 7353, 34239, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 16448, 62, 58, 15, 12, 24, 60, 90, 16, 11, 92, 62, 58, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 29412, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 13155, 7535, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 29412, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 81, 14229, 76, 80, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 81, 14229, 76, 80, 12, 15388, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 81, 14229, 76, 80, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 445, 271, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 445, 271, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 445, 271, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 445, 271, 12, 34086, 20538, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 445, 271, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 445, 271, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 2301, 4592, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 17080, 3890, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 17080, 3890, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 49137, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 49137, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 49137, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 92, 62, 58, 15, 12, 24, 60, 90, 16, 11, 92, 62, 58, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 11469, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 11469, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 11469, 12, 17204, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 660, 1455, 32188, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 660, 1455, 32188, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 10745, 22564, 7890, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 17077, 12, 1640, 12, 634, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 17077, 12, 1640, 12, 634, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 2545, 77, 6277, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 16783, 12, 70, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 16783, 12, 70, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 16783, 12, 70, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 17405, 30, 58, 15, 12, 24, 60, 90, 15, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 88, 73, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1298, 366, 88, 73, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 12567, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 18403, 1298, 366, 1416, 2768, 500, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15699, 1298, 366, 61, 85, 58, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 32239, 3693, 15, 12, 24, 60, 90, 16, 11, 92, 3, 1600, 198, 220, 220, 220, 8964, 198, 92, 628, 628, 198, 12567, 62, 31499, 62, 34960, 13976, 796, 37227, 198, 22766, 1391, 198, 220, 16099, 7, 18403, 25, 45144, 18403, 92, 1600, 1438, 25, 45144, 3672, 92, 4943, 1391, 198, 220, 220, 220, 1006, 82, 7, 5420, 36698, 844, 25, 366, 5420, 82, 14, 31499, 14, 1600, 717, 25, 838, 11, 1502, 3886, 25, 1391, 3245, 25, 37801, 62, 9858, 36393, 62, 35, 6158, 11, 4571, 25, 22196, 34, 30072, 1391, 198, 220, 220, 220, 220, 220, 13015, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 10139, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1438, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2496, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 267, 312, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2644, 319, 17467, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4589, 28165, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7621, 1362, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3128, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 1782, 198, 220, 1782, 198, 92, 198, 37811, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 1388, 3419, 198 ]
1.589418
4,177
from .args import ArgsWrapper from .dataset import Dataset from .consts import DATA_PATH, TRAINING_DATASET
[ 6738, 764, 22046, 1330, 943, 14542, 36918, 2848, 198, 6738, 764, 19608, 292, 316, 1330, 16092, 292, 316, 198, 6738, 764, 1102, 6448, 1330, 42865, 62, 34219, 11, 29125, 1268, 2751, 62, 35, 1404, 1921, 2767 ]
2.944444
36
from Dataset import * from datetime import * import time dataset = Dataset('TestData/Dados.csv') begin_date = datetime.strptime('2021-08-2 12:00',"%Y-%m-%d %H:%M") end_date = datetime.strptime('2021-08-7 12:00',"%Y-%m-%d %H:%M") main_var = 'TU-11C:SS-HLS-Ax48NW5:Level-Mon' start = time.time() delays, corrs, names = dataset.correlate(main_var, begin_date, end_date, 0.2) end = time.time() print(end - start) print(delays) print(corrs)
[ 6738, 16092, 292, 316, 1330, 1635, 198, 6738, 4818, 8079, 1330, 1635, 198, 11748, 640, 198, 198, 19608, 292, 316, 796, 16092, 292, 316, 10786, 14402, 6601, 14, 35, 22484, 13, 40664, 11537, 198, 27471, 62, 4475, 796, 4818, 8079, 13, 2536, 457, 524, 10786, 1238, 2481, 12, 2919, 12, 17, 1105, 25, 405, 40264, 4, 56, 12, 4, 76, 12, 4, 67, 4064, 39, 25, 4, 44, 4943, 198, 437, 62, 4475, 796, 4818, 8079, 13, 2536, 457, 524, 10786, 1238, 2481, 12, 2919, 12, 22, 1105, 25, 405, 40264, 4, 56, 12, 4, 76, 12, 4, 67, 4064, 39, 25, 4, 44, 4943, 198, 12417, 62, 7785, 796, 705, 51, 52, 12, 1157, 34, 25, 5432, 12, 39, 6561, 12, 31554, 2780, 27605, 20, 25, 4971, 12, 9069, 6, 198, 198, 9688, 796, 640, 13, 2435, 3419, 198, 198, 12381, 592, 11, 1162, 3808, 11, 3891, 796, 27039, 13, 10215, 2411, 378, 7, 12417, 62, 7785, 11, 2221, 62, 4475, 11, 886, 62, 4475, 11, 657, 13, 17, 8, 198, 198, 437, 796, 640, 13, 2435, 3419, 198, 4798, 7, 437, 532, 923, 8, 198, 4798, 7, 12381, 592, 8, 198, 4798, 7, 10215, 3808, 8, 198 ]
2.211055
199
import pytest from textx_ls_core import utils @pytest.mark.parametrize("uri, expected_ext", [ (None, ''), ('', ''), ('/test/path/file.txt', 'txt'), ('Textxfile', 'Textxfile') ])
[ 11748, 12972, 9288, 198, 6738, 2420, 87, 62, 7278, 62, 7295, 1330, 3384, 4487, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 9900, 11, 2938, 62, 2302, 1600, 685, 198, 220, 220, 220, 357, 14202, 11, 10148, 828, 198, 220, 220, 220, 19203, 3256, 10148, 828, 198, 220, 220, 220, 19203, 14, 9288, 14, 6978, 14, 7753, 13, 14116, 3256, 705, 14116, 33809, 198, 220, 220, 220, 19203, 8206, 87, 7753, 3256, 705, 8206, 87, 7753, 11537, 198, 12962, 198 ]
2.305882
85
from setuptools import setup setup( name='openmrsapi', version='0.1', description='a library for interacting with openmrs api in python', url='https://github.com/isears/openmrsapi', author='Isaac Sears', author_email='[email protected]', license='MIT', packages=['openmrsapi'], zip_safe=False, install_requires=[ 'requests' ] )
[ 198, 6738, 900, 37623, 10141, 1330, 9058, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 11639, 9654, 76, 3808, 15042, 3256, 198, 220, 220, 220, 2196, 11639, 15, 13, 16, 3256, 198, 220, 220, 220, 6764, 11639, 64, 5888, 329, 24986, 351, 1280, 76, 3808, 40391, 287, 21015, 3256, 198, 220, 220, 220, 19016, 11639, 5450, 1378, 12567, 13, 785, 14, 271, 4127, 14, 9654, 76, 3808, 15042, 3256, 198, 220, 220, 220, 1772, 11639, 39443, 330, 36895, 3256, 198, 220, 220, 220, 1772, 62, 12888, 11639, 9160, 330, 13, 73, 13, 325, 945, 31, 14816, 13, 785, 3256, 198, 220, 220, 220, 5964, 11639, 36393, 3256, 198, 220, 220, 220, 10392, 28, 17816, 9654, 76, 3808, 15042, 6, 4357, 198, 220, 220, 220, 19974, 62, 21230, 28, 25101, 11, 198, 220, 220, 220, 2721, 62, 47911, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 705, 8897, 3558, 6, 198, 220, 220, 220, 2361, 198, 8 ]
2.449367
158
from blogposts import app if __name__ == '__main__': app.run(host='192.168.43.57',debug=True)
[ 6738, 4130, 24875, 1330, 598, 201, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 201, 198, 220, 220, 220, 598, 13, 5143, 7, 4774, 11639, 17477, 13, 14656, 13, 3559, 13, 3553, 3256, 24442, 28, 17821, 8, 201, 198 ]
2.404762
42
import asyncio import logging import random import time from datetime import datetime from typing import Any, Dict, Optional, Tuple import reddit_adapter import subscriptions_manager import telegram_adapter workers: Dict[Tuple[int, str], asyncio.Task[Any]] = {} async def check_exceptions(refresh_period: int = 24 * 60 * 60): """ Check whether private or banned subs are now available """ while True: unavailable_subs = subscriptions_manager.unavailable_subreddits() for sub in unavailable_subs: try: try: await reddit_adapter.new_posts(sub) except ( reddit_adapter.SubredditPrivate, reddit_adapter.SubredditBanned, ): continue old_subscribers = subscriptions_manager.get_old_subscribers(sub) for chat_id in old_subscribers: subscriptions_manager.subscribe(chat_id, sub, 31) await telegram_adapter.send_message( chat_id, f"{sub} is now available again" ) subscriptions_manager.delete_exception(sub) except Exception as e: await telegram_adapter.send_exception( e, f"Exception while checking unavailability of {sub}" ) await asyncio.sleep(refresh_period)
[ 11748, 30351, 952, 198, 11748, 18931, 198, 11748, 4738, 198, 11748, 640, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 19720, 1330, 4377, 11, 360, 713, 11, 32233, 11, 309, 29291, 198, 198, 11748, 18374, 62, 324, 3429, 198, 11748, 35675, 62, 37153, 198, 11748, 573, 30536, 62, 324, 3429, 628, 628, 198, 22896, 25, 360, 713, 58, 51, 29291, 58, 600, 11, 965, 4357, 30351, 952, 13, 25714, 58, 7149, 11907, 796, 23884, 628, 628, 198, 198, 292, 13361, 825, 2198, 62, 1069, 11755, 7, 5420, 3447, 62, 41007, 25, 493, 796, 1987, 1635, 3126, 1635, 3126, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6822, 1771, 2839, 393, 9301, 6352, 389, 783, 1695, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 981, 6407, 25, 198, 220, 220, 220, 220, 220, 220, 220, 23485, 62, 7266, 82, 796, 35675, 62, 37153, 13, 403, 15182, 62, 7266, 36581, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 329, 850, 287, 23485, 62, 7266, 82, 25, 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, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25507, 18374, 62, 324, 3429, 13, 3605, 62, 24875, 7, 7266, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2845, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 18374, 62, 324, 3429, 13, 7004, 10748, 29067, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 18374, 62, 324, 3429, 13, 7004, 10748, 33, 3577, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15179, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1468, 62, 7266, 40075, 364, 796, 35675, 62, 37153, 13, 1136, 62, 727, 62, 7266, 40075, 364, 7, 7266, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 8537, 62, 312, 287, 1468, 62, 7266, 40075, 364, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35675, 62, 37153, 13, 7266, 12522, 7, 17006, 62, 312, 11, 850, 11, 3261, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25507, 573, 30536, 62, 324, 3429, 13, 21280, 62, 20500, 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, 8537, 62, 312, 11, 277, 1, 90, 7266, 92, 318, 783, 1695, 757, 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, 35675, 62, 37153, 13, 33678, 62, 1069, 4516, 7, 7266, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2845, 35528, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25507, 573, 30536, 62, 324, 3429, 13, 21280, 62, 1069, 4516, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 304, 11, 277, 1, 16922, 981, 10627, 555, 47274, 286, 1391, 7266, 36786, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 25507, 30351, 952, 13, 42832, 7, 5420, 3447, 62, 41007, 8, 628 ]
2.125369
678
#!/usr/bin/env python # -*- coding: utf-8 -*- """Implementation of the Trigger Unit communication.""" import logging import re import socket _log = logging.getLogger(__name__) physical_names = { 'A2_Delay': r'Simmer_delay(1uS)', 'A4_Delay': r'Burst_delay(1uS)', 'A4_Number': r'Burst_number', 'A4_Period': r'Burst_period(1uS)', 'A5_Pulse': r'Trigger_Enable_pulse(1uS)', 'B1_Delay': r'ADC_Enable_delay(1uS)', 'B1_Pulse': r'ADC_Enable_pulse(1uS)', 'B2_Delay': r'CMOS_plasma_delay(1uS)', 'B2_Number': r'CMOS_Plasma_number', 'B2_Period': r'CMOS_Plasma_period(1uS)', 'B2_Pulse': r'CMOS_Plasma_pulse(1uS)', 'B4_Delay': r'CMOS_Laser_delay(0.1uS)', 'B4_Pulse': r'CMOS_Laser_pulse(0.1uS)', 'B5_Delay': r'II_Gate_Plasma_delay(0.1uS)', 'B5_Number': r'II_Gate_Plasma_number', 'B5_Period': r'II_Gate_Plasma_period(0.1uS)', 'B5_Pulse': r'II_Gate_Plasma_pulse(0.1uS)', 'B6_Delay': r'II_Plasma_Delay_delay(0.1uS)', 'B6_Pulse': r'II_Plasma_Delay_pulse(0.1uS)', 'B7_Delay': r'II_Gate_Laser_delay(0.1uS)', 'B7_Pulse': r'II_Gate_Laser_pulse(0.1uS)', 'B8_Delay': r'II_Flash_Bool_delay(1uS)', 'B8_Pulse': r'II_Flash_Bool_pulse(1uS)', 'B9_Delay': r'Flash_delay(1uS)', 'B9_Pulse': r'Flash_pulse(1uS)', 'B12_Delay': r'Pockels_delay(1uS)', 'B12_Number': r'Pockels_number', 'B12_Period': r'Pockels_period(1uS)', 'B12_Pulse': r'Pockels_pulse(1uS)', 'TS0_Delay': r'TS0_Delay(1uS)', 'TS0_Period': r'TS0_Period(1uS)', 'Enable_IOs': r'Enable_IOs', 'A1_SW_enable': r'A1_SW_enable', 'A2_SW_enable': r'A2_SW_enable', 'A4_SW_enable': r'A4_SW_enable', 'CMOSPOn': r'CMOSPOn', 'CMOSLOn': r'CMOSLOn' } try: # For Python 3 logical_names = {v: k for k, v in physical_names.items()} except: # For Python 2 logical_names = dict((v, k) for k, v in physical_names.iteritems()) regex = re.compile('(\S+)[\s*]=[\s*]"(\S+)"')
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 3546, 32851, 286, 262, 24593, 11801, 6946, 526, 15931, 198, 198, 11748, 18931, 198, 11748, 302, 198, 11748, 17802, 198, 198, 62, 6404, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 198, 198, 42854, 62, 14933, 796, 1391, 198, 220, 220, 220, 705, 32, 17, 62, 13856, 323, 10354, 374, 6, 8890, 647, 62, 40850, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 32, 19, 62, 13856, 323, 10354, 374, 6, 22991, 301, 62, 40850, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 32, 19, 62, 15057, 10354, 374, 6, 22991, 301, 62, 17618, 3256, 198, 220, 220, 220, 705, 32, 19, 62, 5990, 2101, 10354, 374, 6, 22991, 301, 62, 41007, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 32, 20, 62, 47, 9615, 10354, 374, 6, 48344, 62, 36695, 62, 79, 9615, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 16, 62, 13856, 323, 10354, 374, 6, 2885, 34, 62, 36695, 62, 40850, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 16, 62, 47, 9615, 10354, 374, 6, 2885, 34, 62, 36695, 62, 79, 9615, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 17, 62, 13856, 323, 10354, 374, 6, 24187, 2640, 62, 489, 11797, 62, 40850, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 17, 62, 15057, 10354, 374, 6, 24187, 2640, 62, 3646, 11797, 62, 17618, 3256, 198, 220, 220, 220, 705, 33, 17, 62, 5990, 2101, 10354, 374, 6, 24187, 2640, 62, 3646, 11797, 62, 41007, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 17, 62, 47, 9615, 10354, 374, 6, 24187, 2640, 62, 3646, 11797, 62, 79, 9615, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 19, 62, 13856, 323, 10354, 374, 6, 24187, 2640, 62, 43, 6005, 62, 40850, 7, 15, 13, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 19, 62, 47, 9615, 10354, 374, 6, 24187, 2640, 62, 43, 6005, 62, 79, 9615, 7, 15, 13, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 20, 62, 13856, 323, 10354, 374, 6, 3978, 62, 22628, 62, 3646, 11797, 62, 40850, 7, 15, 13, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 20, 62, 15057, 10354, 374, 6, 3978, 62, 22628, 62, 3646, 11797, 62, 17618, 3256, 198, 220, 220, 220, 705, 33, 20, 62, 5990, 2101, 10354, 374, 6, 3978, 62, 22628, 62, 3646, 11797, 62, 41007, 7, 15, 13, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 20, 62, 47, 9615, 10354, 374, 6, 3978, 62, 22628, 62, 3646, 11797, 62, 79, 9615, 7, 15, 13, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 21, 62, 13856, 323, 10354, 374, 6, 3978, 62, 3646, 11797, 62, 13856, 323, 62, 40850, 7, 15, 13, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 21, 62, 47, 9615, 10354, 374, 6, 3978, 62, 3646, 11797, 62, 13856, 323, 62, 79, 9615, 7, 15, 13, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 22, 62, 13856, 323, 10354, 374, 6, 3978, 62, 22628, 62, 43, 6005, 62, 40850, 7, 15, 13, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 22, 62, 47, 9615, 10354, 374, 6, 3978, 62, 22628, 62, 43, 6005, 62, 79, 9615, 7, 15, 13, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 23, 62, 13856, 323, 10354, 374, 6, 3978, 62, 30670, 62, 33, 970, 62, 40850, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 23, 62, 47, 9615, 10354, 374, 6, 3978, 62, 30670, 62, 33, 970, 62, 79, 9615, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 24, 62, 13856, 323, 10354, 374, 6, 30670, 62, 40850, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 24, 62, 47, 9615, 10354, 374, 6, 30670, 62, 79, 9615, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 1065, 62, 13856, 323, 10354, 374, 6, 47, 420, 365, 7278, 62, 40850, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 1065, 62, 15057, 10354, 374, 6, 47, 420, 365, 7278, 62, 17618, 3256, 198, 220, 220, 220, 705, 33, 1065, 62, 5990, 2101, 10354, 374, 6, 47, 420, 365, 7278, 62, 41007, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 33, 1065, 62, 47, 9615, 10354, 374, 6, 47, 420, 365, 7278, 62, 79, 9615, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 4694, 15, 62, 13856, 323, 10354, 374, 6, 4694, 15, 62, 13856, 323, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 4694, 15, 62, 5990, 2101, 10354, 374, 6, 4694, 15, 62, 5990, 2101, 7, 16, 84, 50, 8, 3256, 198, 220, 220, 220, 705, 36695, 62, 9399, 82, 10354, 374, 6, 36695, 62, 9399, 82, 3256, 198, 220, 220, 220, 705, 32, 16, 62, 17887, 62, 21633, 10354, 374, 6, 32, 16, 62, 17887, 62, 21633, 3256, 198, 220, 220, 220, 705, 32, 17, 62, 17887, 62, 21633, 10354, 374, 6, 32, 17, 62, 17887, 62, 21633, 3256, 198, 220, 220, 220, 705, 32, 19, 62, 17887, 62, 21633, 10354, 374, 6, 32, 19, 62, 17887, 62, 21633, 3256, 198, 220, 220, 220, 705, 24187, 47053, 2202, 10354, 374, 6, 24187, 47053, 2202, 3256, 198, 220, 220, 220, 705, 24187, 2640, 43, 2202, 10354, 374, 6, 24187, 2640, 43, 2202, 6, 198, 92, 198, 198, 28311, 25, 198, 220, 220, 220, 1303, 1114, 11361, 513, 198, 220, 220, 220, 12219, 62, 14933, 796, 1391, 85, 25, 479, 329, 479, 11, 410, 287, 3518, 62, 14933, 13, 23814, 3419, 92, 198, 16341, 25, 198, 220, 220, 220, 1303, 1114, 11361, 362, 198, 220, 220, 220, 12219, 62, 14933, 796, 8633, 19510, 85, 11, 479, 8, 329, 479, 11, 410, 287, 3518, 62, 14933, 13, 2676, 23814, 28955, 198, 198, 260, 25636, 796, 302, 13, 5589, 576, 10786, 38016, 50, 28988, 58, 59, 82, 9, 22241, 58, 59, 82, 9, 60, 18109, 59, 50, 10, 16725, 11537, 628 ]
1.815299
1,072
store.set_global_value('hotkey', '<ctrl>+e') engine.set_return_value('<end>') engine.run_script('chromium')
[ 8095, 13, 2617, 62, 20541, 62, 8367, 10786, 8940, 2539, 3256, 705, 27, 44755, 29, 10, 68, 11537, 198, 18392, 13, 2617, 62, 7783, 62, 8367, 10786, 27, 437, 29, 11537, 198, 18392, 13, 5143, 62, 12048, 10786, 28663, 1505, 11537, 198 ]
2.571429
42
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """Very weak testing of the basic functionality using unittest and QTest""" from __future__ import division __author__ = "Ivan Luchko ([email protected])" __version__ = "1.0a1" __date__ = "Apr 4, 2017" __copyright__ = "Copyright (c) 2017, Ivan Luchko and Project Contributors " import sys import os import subprocess import unittest # define pyQt version try: from PyQt4.QtGui import QApplication, QDialogButtonBox, QTextCursor from PyQt4.QtTest import QTest from PyQt4.QtCore import Qt except ImportError: try: from PyQt5.QtWidgets import QApplication, QDialogButtonBox from PyQt5.QtGui import QTextCursor from PyQt5.QtTest import QTest from PyQt5.QtCore import Qt except ImportError: raise ImportError("neither PyQt4 or PyQt5 is found") from latticegraph_designer.app.main import MainWindow from latticegraph_designer.app.dialogs import (DialogImportCryst, DialogDistSearch, MyDialogPreferences, DialogEditXML) from mpl_animationmanager import QDialogAnimManager app = QApplication(sys.argv) test_folder = "./latticegraph_designer/test/" from latticegraph_designer.app.core import Vertex, Edge, UnitCell, Lattice, CrystalCluster from latticegraph_designer.app.mpl_pane import GraphEdgesEditor from matplotlib.backend_bases import KeyEvent, MouseEvent import matplotlib.pyplot as plt import numpy as np class GeeMethodsTest(unittest.TestCase): '''Test the mpl_pane GraphEdgesEditor methods''' def test_USE_COLLECTIONS(self): '''testing the usage of lineCollection for depicting edges''' GraphEdgesEditor.USE_COLLECTIONS = True self.setUp() try: self.assertEqual(self.gee.UC.num_vertices, 2) self.assertEqual(self.gee.UC.num_edges, 6) self.assertEqual(len(self.ax.artists), 6+1) # arrows + new edge self.assertEqual(len(self.gee.edges_lines), 6) # collections: vertices, lattice, edges self.assertEqual(len(self.ax.collections), 1+1+6) # select edge _id = 3 self.gee.select_edge(_id) self.assertTrue(self.gee.e_active_ind == _id) # remove edge self.gee.delete_active_edge_callback() self.assertEqual(self.gee.UC.num_edges, 5) self.assertEqual(len(self.gee.edges_lines), 5) # collections: vertices, lattice, edges self.assertEqual(len(self.ax.collections), 1+1+5) # clear edges self.gee.clearEdges_callback() self.assertEqual(self.gee.UC.num_edges, 0) self.assertEqual(len(self.ax.artists), 6+1) # arrows + new edge self.assertEqual(len(self.gee.edges_lines), 0) # collections: vertices, lattice, edges self.assertEqual(len(self.ax.collections), 1+1+0) # add edge self.addEdge(0, 4) self.assertEqual(self.gee.UC.num_edges, 1) self.assertEqual(len(self.gee.edges_lines), 1) # collections: vertices, lattice, edges self.assertEqual(len(self.ax.collections), 1+1+1) except: # we have to set USE_COLLECTIONS=False for other tests GraphEdgesEditor.USE_COLLECTIONS = False raise finally: GraphEdgesEditor.USE_COLLECTIONS = False class GeeInteractionTest(unittest.TestCase): '''Test the mpl_pane keybounding and mouse manipulation''' class MainWindowTest(unittest.TestCase): '''Test the MainWindow GUI''' def setUp(self): '''Create the GUI''' self.mainWindow = MainWindow(TEXT_MODE=True) # def test_terminalLaunch(self): # # p = subprocess.Popen(['graphdesigner','&'], # stdout=subprocess.PIPE, stderr=subprocess.PIPE) # # output, error = p.communicate() # ## p = subprocess.call("graphdesigner", shell=True) # p.kill() # # if p.returncode == 0: # return output # else: # raise Exception(error) # return "Error" class PreferencesTest(unittest.TestCase): '''Test the Preferences manager''' def setUp(self): '''Create the GUI''' self.mainWindow = MainWindow(TEXT_MODE=False) class AnimaManagerTest(unittest.TestCase): '''Test the Animation manager''' def setUp(self): '''Create the GUI''' self.mainWindow = MainWindow(TEXT_MODE=False) class CodeEditorTest(unittest.TestCase): '''Test the Animation manager''' def setUp(self): '''Create the GUI''' self.mainWindow = MainWindow(TEXT_MODE=True) if __name__ == "__main__": unittest.main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 17, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 16371, 4939, 4856, 286, 262, 4096, 11244, 1262, 555, 715, 395, 290, 1195, 14402, 37811, 198, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 198, 834, 9800, 834, 796, 366, 40, 10438, 406, 794, 7204, 357, 75, 794, 7204, 13, 13809, 31, 14816, 13, 785, 16725, 198, 834, 9641, 834, 796, 366, 16, 13, 15, 64, 16, 1, 198, 834, 4475, 834, 796, 366, 13680, 604, 11, 2177, 1, 198, 834, 22163, 4766, 834, 796, 366, 15269, 357, 66, 8, 2177, 11, 21798, 406, 794, 7204, 290, 4935, 25767, 669, 366, 198, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 850, 14681, 198, 11748, 555, 715, 395, 198, 198, 2, 8160, 12972, 48, 83, 2196, 198, 28311, 25, 198, 220, 220, 220, 422, 9485, 48, 83, 19, 13, 48, 83, 8205, 72, 1330, 1195, 23416, 11, 1195, 44204, 21864, 14253, 11, 1195, 8206, 34, 21471, 198, 220, 220, 220, 422, 9485, 48, 83, 19, 13, 48, 83, 14402, 1330, 1195, 14402, 198, 220, 220, 220, 422, 9485, 48, 83, 19, 13, 48, 83, 14055, 1330, 33734, 198, 220, 220, 220, 220, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 422, 9485, 48, 83, 20, 13, 48, 83, 54, 312, 11407, 1330, 1195, 23416, 11, 1195, 44204, 21864, 14253, 198, 220, 220, 220, 220, 220, 220, 220, 422, 9485, 48, 83, 20, 13, 48, 83, 8205, 72, 1330, 1195, 8206, 34, 21471, 198, 220, 220, 220, 220, 220, 220, 220, 422, 9485, 48, 83, 20, 13, 48, 83, 14402, 1330, 1195, 14402, 198, 220, 220, 220, 220, 220, 220, 220, 422, 9485, 48, 83, 20, 13, 48, 83, 14055, 1330, 33734, 628, 220, 220, 220, 2845, 17267, 12331, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 17267, 12331, 7203, 710, 1555, 9485, 48, 83, 19, 393, 9485, 48, 83, 20, 318, 1043, 4943, 198, 198, 6738, 47240, 501, 34960, 62, 26124, 263, 13, 1324, 13, 12417, 1330, 8774, 27703, 198, 6738, 47240, 501, 34960, 62, 26124, 263, 13, 1324, 13, 38969, 18463, 1330, 357, 44204, 20939, 26677, 301, 11, 21269, 519, 20344, 18243, 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, 2011, 44204, 36698, 4972, 11, 21269, 519, 18378, 55, 5805, 8, 198, 6738, 285, 489, 62, 11227, 341, 37153, 1330, 1195, 44204, 35320, 13511, 198, 1324, 796, 1195, 23416, 7, 17597, 13, 853, 85, 8, 198, 198, 9288, 62, 43551, 796, 366, 19571, 75, 1078, 501, 34960, 62, 26124, 263, 14, 9288, 30487, 198, 198, 6738, 47240, 501, 34960, 62, 26124, 263, 13, 1324, 13, 7295, 1330, 4643, 16886, 11, 13113, 11, 11801, 28780, 11, 406, 1078, 501, 11, 12969, 2601, 5819, 198, 6738, 47240, 501, 34960, 62, 26124, 263, 13, 1324, 13, 76, 489, 62, 79, 1531, 1330, 29681, 7407, 3212, 17171, 198, 6738, 2603, 29487, 8019, 13, 1891, 437, 62, 65, 1386, 1330, 7383, 9237, 11, 21839, 9237, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 299, 32152, 355, 45941, 628, 198, 4871, 402, 1453, 46202, 14402, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 220, 220, 705, 7061, 14402, 262, 285, 489, 62, 79, 1531, 29681, 7407, 3212, 17171, 5050, 7061, 6, 628, 220, 220, 220, 825, 1332, 62, 19108, 62, 25154, 16779, 11053, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 33407, 262, 8748, 286, 1627, 36307, 329, 27561, 13015, 7061, 6, 628, 220, 220, 220, 220, 220, 220, 220, 29681, 7407, 3212, 17171, 13, 19108, 62, 25154, 16779, 11053, 796, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 2617, 4933, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 944, 13, 29622, 13, 9598, 13, 22510, 62, 1851, 1063, 11, 362, 8, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 944, 13, 29622, 13, 9598, 13, 22510, 62, 276, 3212, 11, 718, 8, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 897, 13, 433, 1023, 828, 718, 10, 16, 8, 1303, 20507, 1343, 649, 5743, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 29622, 13, 276, 3212, 62, 6615, 828, 718, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 17268, 25, 9421, 1063, 11, 47240, 501, 11, 13015, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 897, 13, 4033, 26448, 828, 352, 10, 16, 10, 21, 8, 220, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2922, 5743, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 312, 796, 513, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 29622, 13, 19738, 62, 14907, 28264, 312, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 17821, 7, 944, 13, 29622, 13, 68, 62, 5275, 62, 521, 6624, 4808, 312, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4781, 5743, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 29622, 13, 33678, 62, 5275, 62, 14907, 62, 47423, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 944, 13, 29622, 13, 9598, 13, 22510, 62, 276, 3212, 11, 642, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 29622, 13, 276, 3212, 62, 6615, 828, 642, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 17268, 25, 9421, 1063, 11, 47240, 501, 11, 13015, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 897, 13, 4033, 26448, 828, 352, 10, 16, 10, 20, 8, 220, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1598, 13015, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 29622, 13, 20063, 7407, 3212, 62, 47423, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 944, 13, 29622, 13, 9598, 13, 22510, 62, 276, 3212, 11, 657, 8, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 897, 13, 433, 1023, 828, 718, 10, 16, 8, 1303, 20507, 1343, 649, 5743, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 29622, 13, 276, 3212, 62, 6615, 828, 657, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 17268, 25, 9421, 1063, 11, 47240, 501, 11, 13015, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 897, 13, 4033, 26448, 828, 352, 10, 16, 10, 15, 8, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 751, 5743, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 2860, 37021, 7, 15, 11, 604, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 944, 13, 29622, 13, 9598, 13, 22510, 62, 276, 3212, 11, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 29622, 13, 276, 3212, 62, 6615, 828, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 17268, 25, 9421, 1063, 11, 47240, 501, 11, 13015, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11925, 7, 944, 13, 897, 13, 4033, 26448, 828, 352, 10, 16, 10, 16, 8, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 25, 220, 1303, 356, 423, 284, 220, 900, 23210, 62, 25154, 16779, 11053, 28, 25101, 329, 584, 5254, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 29681, 7407, 3212, 17171, 13, 19108, 62, 25154, 16779, 11053, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 3443, 25, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 29681, 7407, 3212, 17171, 13, 19108, 62, 25154, 16779, 11053, 796, 10352, 198, 198, 4871, 402, 1453, 9492, 2673, 14402, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 220, 220, 705, 7061, 14402, 262, 285, 489, 62, 79, 1531, 1994, 7784, 278, 290, 10211, 17512, 7061, 6, 198, 220, 220, 220, 220, 220, 198, 4871, 8774, 27703, 14402, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 220, 220, 705, 7061, 14402, 262, 8774, 27703, 25757, 7061, 6, 198, 220, 220, 220, 825, 900, 4933, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 16447, 262, 25757, 7061, 6, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12417, 27703, 796, 8774, 27703, 7, 32541, 62, 49058, 28, 17821, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 2, 220, 220, 220, 825, 1332, 62, 23705, 282, 38296, 7, 944, 2599, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 2, 220, 220, 220, 220, 220, 220, 220, 279, 796, 850, 14681, 13, 47, 9654, 7, 17816, 34960, 26124, 263, 41707, 5, 6, 4357, 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, 14367, 448, 28, 7266, 14681, 13, 47, 4061, 36, 11, 336, 1082, 81, 28, 7266, 14681, 13, 47, 4061, 36, 8, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 198, 2, 220, 220, 220, 220, 220, 220, 220, 5072, 11, 4049, 796, 279, 13, 10709, 5344, 3419, 198, 2, 198, 2235, 220, 220, 220, 220, 220, 220, 220, 279, 796, 850, 14681, 13, 13345, 7203, 34960, 26124, 263, 1600, 7582, 28, 17821, 8, 198, 2, 220, 220, 220, 220, 220, 220, 220, 279, 13, 12728, 3419, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 198, 2, 220, 220, 220, 220, 220, 220, 220, 611, 279, 13, 7783, 8189, 6624, 657, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 5072, 198, 2, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 35528, 7, 18224, 8, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 366, 12331, 1, 220, 220, 220, 220, 220, 220, 220, 628, 220, 198, 198, 4871, 49780, 14402, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 220, 220, 705, 7061, 14402, 262, 49780, 4706, 7061, 6, 198, 220, 220, 220, 825, 900, 4933, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 16447, 262, 25757, 7061, 6, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12417, 27703, 796, 8774, 27703, 7, 32541, 62, 49058, 28, 25101, 8, 628, 198, 4871, 1052, 8083, 13511, 14402, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 220, 220, 705, 7061, 14402, 262, 23535, 4706, 7061, 6, 198, 220, 220, 220, 825, 900, 4933, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 16447, 262, 25757, 7061, 6, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12417, 27703, 796, 8774, 27703, 7, 32541, 62, 49058, 28, 25101, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 628, 198, 4871, 6127, 17171, 14402, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 220, 220, 705, 7061, 14402, 262, 23535, 4706, 7061, 6, 198, 220, 220, 220, 825, 900, 4933, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 16447, 262, 25757, 7061, 6, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12417, 27703, 796, 8774, 27703, 7, 32541, 62, 49058, 28, 17821, 8, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198, 220, 220, 220, 220, 198 ]
2.152972
2,288
# file: config_gen/admin.py from django.contrib import admin # Register your models here.
[ 2, 2393, 25, 4566, 62, 5235, 14, 28482, 13, 9078, 198, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 198, 2, 17296, 534, 4981, 994, 13, 198 ]
3.172414
29
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2020 Confluent Inc. # # 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 pytest from confluent_kafka import TopicPartition from confluent_kafka.error import ConsumeError, ValueSerializationError from confluent_kafka.schema_registry.json_schema import (JSONSerializer, JSONDeserializer) def _testProduct_to_dict(product_obj, ctx): """ Returns testProduct instance in dict format. Args: product_obj (_TestProduct): testProduct instance. ctx (SerializationContext): Metadata pertaining to the serialization operation. Returns: dict: product_obj as a dictionary. """ return {"productId": product_obj.product_id, "productName": product_obj.name, "price": product_obj.price, "tags": product_obj.tags, "dimensions": product_obj.dimensions, "warehouseLocation": product_obj.location} def _testProduct_from_dict(product_dict, ctx): """ Returns testProduct instance from its dict format. Args: product_dict (dict): testProduct in dict format. ctx (SerializationContext): Metadata pertaining to the serialization operation. Returns: _TestProduct: product_obj instance. """ return _TestProduct(product_dict['productId'], product_dict['productName'], product_dict['price'], product_dict['tags'], product_dict['dimensions'], product_dict['warehouseLocation']) def test_json_record_serialization(kafka_cluster, load_file): """ Tests basic JsonSerializer and JsonDeserializer basic functionality. product.json from: https://json-schema.org/learn/getting-started-step-by-step.html Args: kafka_cluster (KafkaClusterFixture): cluster fixture load_file (callable(str)): JSON Schema file reader """ topic = kafka_cluster.create_topic("serialization-json") sr = kafka_cluster.schema_registry({'url': 'http://localhost:8081'}) schema_str = load_file("product.json") value_serializer = JSONSerializer(schema_str, sr) value_deserializer = JSONDeserializer(schema_str) producer = kafka_cluster.producer(value_serializer=value_serializer) record = {"productId": 1, "productName": "An ice sculpture", "price": 12.50, "tags": ["cold", "ice"], "dimensions": { "length": 7.0, "width": 12.0, "height": 9.5 }, "warehouseLocation": { "latitude": -78.75, "longitude": 20.4 }} producer.produce(topic, value=record, partition=0) producer.flush() consumer = kafka_cluster.consumer(value_deserializer=value_deserializer) consumer.assign([TopicPartition(topic, 0)]) msg = consumer.poll() actual = msg.value() assert all([actual[k] == v for k, v in record.items()]) def test_json_record_serialization_incompatible(kafka_cluster, load_file): """ Tests Serializer validation functionality. product.json from: https://json-schema.org/learn/getting-started-step-by-step.html Args: kafka_cluster (KafkaClusterFixture): cluster fixture load_file (callable(str)): JSON Schema file reader """ topic = kafka_cluster.create_topic("serialization-json") sr = kafka_cluster.schema_registry({'url': 'http://localhost:8081'}) schema_str = load_file("product.json") value_serializer = JSONSerializer(schema_str, sr) producer = kafka_cluster.producer(value_serializer=value_serializer) record = {"contractorId": 1, "contractorName": "David Davidson", "contractRate": 1250, "trades": ["mason"]} with pytest.raises(ValueSerializationError, match=r"(.*) is a required property"): producer.produce(topic, value=record, partition=0) def test_json_record_serialization_no_title(kafka_cluster, load_file): """ Ensures ValueError raise if JSON Schema definition lacks Title annotation. Args: kafka_cluster (KafkaClusterFixture): cluster fixture load_file (callable(str)): JSON Schema file reader """ sr = kafka_cluster.schema_registry({'url': 'http://localhost:8081'}) schema_str = load_file('not_title.json') with pytest.raises(ValueError, match="Missing required JSON schema annotation title"): JSONSerializer(schema_str, sr) def test_json_record_serialization_custom(kafka_cluster, load_file): """ Ensures to_dict and from_dict hooks are properly applied by the serializer. Args: kafka_cluster (KafkaClusterFixture): cluster fixture load_file (callable(str)): JSON Schema file reader """ topic = kafka_cluster.create_topic("serialization-json") sr = kafka_cluster.schema_registry({'url': 'http://localhost:8081'}) schema_str = load_file("product.json") value_serializer = JSONSerializer(schema_str, sr, to_dict=_testProduct_to_dict) value_deserializer = JSONDeserializer(schema_str, from_dict=_testProduct_from_dict) producer = kafka_cluster.producer(value_serializer=value_serializer) record = _TestProduct(product_id=1, name="The ice sculpture", price=12.50, tags=["cold", "ice"], dimensions={"length": 7.0, "width": 12.0, "height": 9.5}, location={"latitude": -78.75, "longitude": 20.4}) producer.produce(topic, value=record, partition=0) producer.flush() consumer = kafka_cluster.consumer(value_deserializer=value_deserializer) consumer.assign([TopicPartition(topic, 0)]) msg = consumer.poll() actual = msg.value() assert all([getattr(actual, attribute) == getattr(record, attribute) for attribute in vars(record)]) def test_json_record_deserialization_mismatch(kafka_cluster, load_file): """ Ensures to_dict and from_dict hooks are properly applied by the serializer. Args: kafka_cluster (KafkaClusterFixture): cluster fixture load_file (callable(str)): JSON Schema file reader """ topic = kafka_cluster.create_topic("serialization-json") sr = kafka_cluster.schema_registry({'url': 'http://localhost:8081'}) schema_str = load_file("contractor.json") schema_str2 = load_file("product.json") value_serializer = JSONSerializer(schema_str, sr) value_deserializer = JSONDeserializer(schema_str2) producer = kafka_cluster.producer(value_serializer=value_serializer) record = {"contractorId": 2, "contractorName": "Magnus Edenhill", "contractRate": 30, "trades": ["pickling"]} producer.produce(topic, value=record, partition=0) producer.flush() consumer = kafka_cluster.consumer(value_deserializer=value_deserializer) consumer.assign([TopicPartition(topic, 0)]) with pytest.raises( ConsumeError, match="'productId' is a required property"): consumer.poll()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 15069, 12131, 7326, 28216, 3457, 13, 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, 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, 2, 198, 11748, 12972, 9288, 198, 6738, 1013, 28216, 62, 74, 1878, 4914, 1330, 47373, 7841, 653, 198, 198, 6738, 1013, 28216, 62, 74, 1878, 4914, 13, 18224, 1330, 3515, 2454, 12331, 11, 11052, 32634, 1634, 12331, 198, 6738, 1013, 28216, 62, 74, 1878, 4914, 13, 15952, 2611, 62, 2301, 4592, 13, 17752, 62, 15952, 2611, 1330, 357, 40386, 32634, 7509, 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, 19449, 5960, 48499, 7509, 8, 628, 198, 198, 4299, 4808, 9288, 15667, 62, 1462, 62, 11600, 7, 11167, 62, 26801, 11, 269, 17602, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16409, 1332, 15667, 4554, 287, 8633, 5794, 13, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1720, 62, 26801, 44104, 14402, 15667, 2599, 1332, 15667, 4554, 13, 628, 220, 220, 220, 220, 220, 220, 220, 269, 17602, 357, 32634, 1634, 21947, 2599, 3395, 14706, 27113, 284, 262, 11389, 1634, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4905, 13, 628, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 8633, 25, 1720, 62, 26801, 355, 257, 22155, 13, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 19779, 11167, 7390, 1298, 1720, 62, 26801, 13, 11167, 62, 312, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 11167, 5376, 1298, 1720, 62, 26801, 13, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 20888, 1298, 1720, 62, 26801, 13, 20888, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 31499, 1298, 1720, 62, 26801, 13, 31499, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 27740, 5736, 1298, 1720, 62, 26801, 13, 27740, 5736, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 1574, 4803, 14749, 1298, 1720, 62, 26801, 13, 24886, 92, 628, 198, 4299, 4808, 9288, 15667, 62, 6738, 62, 11600, 7, 11167, 62, 11600, 11, 269, 17602, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16409, 1332, 15667, 4554, 422, 663, 8633, 5794, 13, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1720, 62, 11600, 357, 11600, 2599, 1332, 15667, 287, 8633, 5794, 13, 628, 220, 220, 220, 220, 220, 220, 220, 269, 17602, 357, 32634, 1634, 21947, 2599, 3395, 14706, 27113, 284, 262, 11389, 1634, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4905, 13, 628, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 14402, 15667, 25, 1720, 62, 26801, 4554, 13, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 4808, 14402, 15667, 7, 11167, 62, 11600, 17816, 11167, 7390, 6, 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, 1720, 62, 11600, 17816, 11167, 5376, 6, 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, 1720, 62, 11600, 17816, 20888, 6, 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, 1720, 62, 11600, 17816, 31499, 6, 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, 1720, 62, 11600, 17816, 27740, 5736, 6, 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, 1720, 62, 11600, 17816, 1574, 4803, 14749, 6, 12962, 628, 198, 4299, 1332, 62, 17752, 62, 22105, 62, 46911, 1634, 7, 74, 1878, 4914, 62, 565, 5819, 11, 3440, 62, 7753, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 30307, 4096, 449, 1559, 32634, 7509, 290, 449, 1559, 5960, 48499, 7509, 4096, 11244, 13, 628, 220, 220, 220, 1720, 13, 17752, 422, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3740, 1378, 17752, 12, 15952, 2611, 13, 2398, 14, 35720, 14, 37210, 12, 46981, 12, 9662, 12, 1525, 12, 9662, 13, 6494, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 479, 1878, 4914, 62, 565, 5819, 357, 42, 1878, 4914, 2601, 5819, 37, 9602, 2599, 13946, 29220, 628, 220, 220, 220, 220, 220, 220, 220, 3440, 62, 7753, 357, 13345, 540, 7, 2536, 8, 2599, 19449, 10011, 2611, 2393, 9173, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 7243, 796, 479, 1878, 4914, 62, 565, 5819, 13, 17953, 62, 26652, 7203, 46911, 1634, 12, 17752, 4943, 198, 220, 220, 220, 19677, 796, 479, 1878, 4914, 62, 565, 5819, 13, 15952, 2611, 62, 2301, 4592, 15090, 6, 6371, 10354, 705, 4023, 1378, 36750, 25, 1795, 6659, 6, 30072, 628, 220, 220, 220, 32815, 62, 2536, 796, 3440, 62, 7753, 7203, 11167, 13, 17752, 4943, 198, 220, 220, 220, 1988, 62, 46911, 7509, 796, 19449, 32634, 7509, 7, 15952, 2611, 62, 2536, 11, 19677, 8, 198, 220, 220, 220, 1988, 62, 8906, 48499, 7509, 796, 19449, 5960, 48499, 7509, 7, 15952, 2611, 62, 2536, 8, 628, 220, 220, 220, 9920, 796, 479, 1878, 4914, 62, 565, 5819, 13, 18230, 2189, 7, 8367, 62, 46911, 7509, 28, 8367, 62, 46911, 7509, 8, 628, 220, 220, 220, 1700, 796, 19779, 11167, 7390, 1298, 352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 11167, 5376, 1298, 366, 2025, 4771, 26924, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 20888, 1298, 1105, 13, 1120, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 31499, 1298, 14631, 36673, 1600, 366, 501, 33116, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 27740, 5736, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 13664, 1298, 767, 13, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 10394, 1298, 1105, 13, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 17015, 1298, 860, 13, 20, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 1574, 4803, 14749, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 15460, 3984, 1298, 532, 3695, 13, 2425, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 6511, 3984, 1298, 1160, 13, 19, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 34949, 628, 220, 220, 220, 9920, 13, 18230, 344, 7, 26652, 11, 1988, 28, 22105, 11, 18398, 28, 15, 8, 198, 220, 220, 220, 9920, 13, 25925, 3419, 628, 220, 220, 220, 7172, 796, 479, 1878, 4914, 62, 565, 5819, 13, 49827, 7, 8367, 62, 8906, 48499, 7509, 28, 8367, 62, 8906, 48499, 7509, 8, 198, 220, 220, 220, 7172, 13, 562, 570, 26933, 33221, 7841, 653, 7, 26652, 11, 657, 8, 12962, 628, 220, 220, 220, 31456, 796, 7172, 13, 30393, 3419, 198, 220, 220, 220, 4036, 796, 31456, 13, 8367, 3419, 628, 220, 220, 220, 6818, 477, 26933, 50039, 58, 74, 60, 6624, 410, 329, 479, 11, 410, 287, 1700, 13, 23814, 3419, 12962, 628, 198, 4299, 1332, 62, 17752, 62, 22105, 62, 46911, 1634, 62, 259, 38532, 7, 74, 1878, 4914, 62, 565, 5819, 11, 3440, 62, 7753, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 30307, 23283, 7509, 21201, 11244, 13, 628, 220, 220, 220, 1720, 13, 17752, 422, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3740, 1378, 17752, 12, 15952, 2611, 13, 2398, 14, 35720, 14, 37210, 12, 46981, 12, 9662, 12, 1525, 12, 9662, 13, 6494, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 479, 1878, 4914, 62, 565, 5819, 357, 42, 1878, 4914, 2601, 5819, 37, 9602, 2599, 13946, 29220, 628, 220, 220, 220, 220, 220, 220, 220, 3440, 62, 7753, 357, 13345, 540, 7, 2536, 8, 2599, 19449, 10011, 2611, 2393, 9173, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 7243, 796, 479, 1878, 4914, 62, 565, 5819, 13, 17953, 62, 26652, 7203, 46911, 1634, 12, 17752, 4943, 198, 220, 220, 220, 19677, 796, 479, 1878, 4914, 62, 565, 5819, 13, 15952, 2611, 62, 2301, 4592, 15090, 6, 6371, 10354, 705, 4023, 1378, 36750, 25, 1795, 6659, 6, 30072, 628, 220, 220, 220, 32815, 62, 2536, 796, 3440, 62, 7753, 7203, 11167, 13, 17752, 4943, 198, 220, 220, 220, 1988, 62, 46911, 7509, 796, 19449, 32634, 7509, 7, 15952, 2611, 62, 2536, 11, 19677, 8, 198, 220, 220, 220, 9920, 796, 479, 1878, 4914, 62, 565, 5819, 13, 18230, 2189, 7, 8367, 62, 46911, 7509, 28, 8367, 62, 46911, 7509, 8, 628, 220, 220, 220, 1700, 796, 19779, 28484, 273, 7390, 1298, 352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 28484, 273, 5376, 1298, 366, 11006, 27905, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 28484, 32184, 1298, 1105, 1120, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 2213, 2367, 1298, 14631, 76, 888, 8973, 92, 628, 220, 220, 220, 351, 12972, 9288, 13, 430, 2696, 7, 11395, 32634, 1634, 12331, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2872, 28, 81, 18109, 15885, 8, 318, 257, 2672, 3119, 1, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 9920, 13, 18230, 344, 7, 26652, 11, 1988, 28, 22105, 11, 18398, 28, 15, 8, 628, 198, 4299, 1332, 62, 17752, 62, 22105, 62, 46911, 1634, 62, 3919, 62, 7839, 7, 74, 1878, 4914, 62, 565, 5819, 11, 3440, 62, 7753, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 48221, 942, 11052, 12331, 5298, 611, 19449, 10011, 2611, 6770, 16523, 11851, 23025, 13, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 479, 1878, 4914, 62, 565, 5819, 357, 42, 1878, 4914, 2601, 5819, 37, 9602, 2599, 13946, 29220, 628, 220, 220, 220, 220, 220, 220, 220, 3440, 62, 7753, 357, 13345, 540, 7, 2536, 8, 2599, 19449, 10011, 2611, 2393, 9173, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 19677, 796, 479, 1878, 4914, 62, 565, 5819, 13, 15952, 2611, 62, 2301, 4592, 15090, 6, 6371, 10354, 705, 4023, 1378, 36750, 25, 1795, 6659, 6, 30072, 198, 220, 220, 220, 32815, 62, 2536, 796, 3440, 62, 7753, 10786, 1662, 62, 7839, 13, 17752, 11537, 628, 220, 220, 220, 351, 12972, 9288, 13, 430, 2696, 7, 11395, 12331, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2872, 2625, 43730, 2672, 19449, 32815, 23025, 3670, 1, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 19449, 32634, 7509, 7, 15952, 2611, 62, 2536, 11, 19677, 8, 628, 198, 4299, 1332, 62, 17752, 62, 22105, 62, 46911, 1634, 62, 23144, 7, 74, 1878, 4914, 62, 565, 5819, 11, 3440, 62, 7753, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 48221, 942, 284, 62, 11600, 290, 422, 62, 11600, 26569, 389, 6105, 5625, 416, 262, 11389, 7509, 13, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 479, 1878, 4914, 62, 565, 5819, 357, 42, 1878, 4914, 2601, 5819, 37, 9602, 2599, 13946, 29220, 628, 220, 220, 220, 220, 220, 220, 220, 3440, 62, 7753, 357, 13345, 540, 7, 2536, 8, 2599, 19449, 10011, 2611, 2393, 9173, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 7243, 796, 479, 1878, 4914, 62, 565, 5819, 13, 17953, 62, 26652, 7203, 46911, 1634, 12, 17752, 4943, 198, 220, 220, 220, 19677, 796, 479, 1878, 4914, 62, 565, 5819, 13, 15952, 2611, 62, 2301, 4592, 15090, 6, 6371, 10354, 705, 4023, 1378, 36750, 25, 1795, 6659, 6, 30072, 628, 220, 220, 220, 32815, 62, 2536, 796, 3440, 62, 7753, 7203, 11167, 13, 17752, 4943, 198, 220, 220, 220, 1988, 62, 46911, 7509, 796, 19449, 32634, 7509, 7, 15952, 2611, 62, 2536, 11, 19677, 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, 284, 62, 11600, 28, 62, 9288, 15667, 62, 1462, 62, 11600, 8, 198, 220, 220, 220, 1988, 62, 8906, 48499, 7509, 796, 19449, 5960, 48499, 7509, 7, 15952, 2611, 62, 2536, 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, 422, 62, 11600, 28, 62, 9288, 15667, 62, 6738, 62, 11600, 8, 628, 220, 220, 220, 9920, 796, 479, 1878, 4914, 62, 565, 5819, 13, 18230, 2189, 7, 8367, 62, 46911, 7509, 28, 8367, 62, 46911, 7509, 8, 628, 220, 220, 220, 1700, 796, 4808, 14402, 15667, 7, 11167, 62, 312, 28, 16, 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, 1438, 2625, 464, 4771, 26924, 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, 2756, 28, 1065, 13, 1120, 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, 15940, 28, 14692, 36673, 1600, 366, 501, 33116, 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, 15225, 28, 4895, 13664, 1298, 767, 13, 15, 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, 366, 10394, 1298, 1105, 13, 15, 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, 366, 17015, 1298, 860, 13, 20, 5512, 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, 4067, 28, 4895, 15460, 3984, 1298, 532, 3695, 13, 2425, 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, 366, 6511, 3984, 1298, 1160, 13, 19, 30072, 628, 220, 220, 220, 9920, 13, 18230, 344, 7, 26652, 11, 1988, 28, 22105, 11, 18398, 28, 15, 8, 198, 220, 220, 220, 9920, 13, 25925, 3419, 628, 220, 220, 220, 7172, 796, 479, 1878, 4914, 62, 565, 5819, 13, 49827, 7, 8367, 62, 8906, 48499, 7509, 28, 8367, 62, 8906, 48499, 7509, 8, 198, 220, 220, 220, 7172, 13, 562, 570, 26933, 33221, 7841, 653, 7, 26652, 11, 657, 8, 12962, 628, 220, 220, 220, 31456, 796, 7172, 13, 30393, 3419, 198, 220, 220, 220, 4036, 796, 31456, 13, 8367, 3419, 628, 220, 220, 220, 6818, 477, 26933, 1136, 35226, 7, 50039, 11, 11688, 8, 6624, 651, 35226, 7, 22105, 11, 11688, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 11688, 287, 410, 945, 7, 22105, 8, 12962, 628, 198, 4299, 1332, 62, 17752, 62, 22105, 62, 8906, 48499, 1634, 62, 76, 1042, 963, 7, 74, 1878, 4914, 62, 565, 5819, 11, 3440, 62, 7753, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 48221, 942, 284, 62, 11600, 290, 422, 62, 11600, 26569, 389, 6105, 5625, 416, 262, 11389, 7509, 13, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 479, 1878, 4914, 62, 565, 5819, 357, 42, 1878, 4914, 2601, 5819, 37, 9602, 2599, 13946, 29220, 628, 220, 220, 220, 220, 220, 220, 220, 3440, 62, 7753, 357, 13345, 540, 7, 2536, 8, 2599, 19449, 10011, 2611, 2393, 9173, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 7243, 796, 479, 1878, 4914, 62, 565, 5819, 13, 17953, 62, 26652, 7203, 46911, 1634, 12, 17752, 4943, 198, 220, 220, 220, 19677, 796, 479, 1878, 4914, 62, 565, 5819, 13, 15952, 2611, 62, 2301, 4592, 15090, 6, 6371, 10354, 705, 4023, 1378, 36750, 25, 1795, 6659, 6, 30072, 628, 220, 220, 220, 32815, 62, 2536, 796, 3440, 62, 7753, 7203, 28484, 273, 13, 17752, 4943, 198, 220, 220, 220, 32815, 62, 2536, 17, 796, 3440, 62, 7753, 7203, 11167, 13, 17752, 4943, 628, 220, 220, 220, 1988, 62, 46911, 7509, 796, 19449, 32634, 7509, 7, 15952, 2611, 62, 2536, 11, 19677, 8, 198, 220, 220, 220, 1988, 62, 8906, 48499, 7509, 796, 19449, 5960, 48499, 7509, 7, 15952, 2611, 62, 2536, 17, 8, 628, 220, 220, 220, 9920, 796, 479, 1878, 4914, 62, 565, 5819, 13, 18230, 2189, 7, 8367, 62, 46911, 7509, 28, 8367, 62, 46911, 7509, 8, 628, 220, 220, 220, 1700, 796, 19779, 28484, 273, 7390, 1298, 362, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 28484, 273, 5376, 1298, 366, 48017, 385, 23369, 12639, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 28484, 32184, 1298, 1542, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 2213, 2367, 1298, 14631, 27729, 1359, 8973, 92, 628, 220, 220, 220, 9920, 13, 18230, 344, 7, 26652, 11, 1988, 28, 22105, 11, 18398, 28, 15, 8, 198, 220, 220, 220, 9920, 13, 25925, 3419, 628, 220, 220, 220, 7172, 796, 479, 1878, 4914, 62, 565, 5819, 13, 49827, 7, 8367, 62, 8906, 48499, 7509, 28, 8367, 62, 8906, 48499, 7509, 8, 198, 220, 220, 220, 7172, 13, 562, 570, 26933, 33221, 7841, 653, 7, 26652, 11, 657, 8, 12962, 628, 220, 220, 220, 351, 12972, 9288, 13, 430, 2696, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3515, 2454, 12331, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2872, 2625, 6, 11167, 7390, 6, 318, 257, 2672, 3119, 1, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 7172, 13, 30393, 3419, 198 ]
2.333912
3,459
""" pyexcel_io.utils ~~~~~~~~~~~~~~~~~~~ utility functions :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import pyexcel_io.constants as constants XLS_PLUGIN = "pyexcel-xls" XLSX_PLUGIN = "pyexcel-xlsx" ODS_PLUGIN = "pyexcel-ods" ODS3_PLUGIN = "pyexcel-ods3" XLSXW_PLUGIN = "pyexcel-xlsxw" IO_ITSELF = "pyexcel-io" AVAILABLE_READERS = { constants.FILE_FORMAT_XLS: [XLS_PLUGIN], constants.FILE_FORMAT_XLSX: [XLS_PLUGIN, XLSX_PLUGIN], constants.FILE_FORMAT_XLSM: [XLS_PLUGIN, XLSX_PLUGIN], constants.FILE_FORMAT_ODS: [ODS_PLUGIN, ODS3_PLUGIN], constants.FILE_FORMAT_CSV: [IO_ITSELF], constants.FILE_FORMAT_TSV: [IO_ITSELF], constants.FILE_FORMAT_CSVZ: [IO_ITSELF], constants.FILE_FORMAT_TSVZ: [IO_ITSELF], } AVAILABLE_WRITERS = { constants.FILE_FORMAT_XLS: [XLS_PLUGIN], constants.FILE_FORMAT_XLSX: [XLSX_PLUGIN, XLSXW_PLUGIN], constants.FILE_FORMAT_XLSM: [XLSX_PLUGIN], constants.FILE_FORMAT_ODS: [ODS_PLUGIN, ODS3_PLUGIN], constants.FILE_FORMAT_CSV: [IO_ITSELF], constants.FILE_FORMAT_TSV: [IO_ITSELF], constants.FILE_FORMAT_CSVZ: [IO_ITSELF], constants.FILE_FORMAT_TSVZ: [IO_ITSELF], } def is_empty_array(array): """ Check if an array is an array of '' or not """ empty_array = [element for element in array if element != ""] return len(empty_array) == 0 def swap_empty_string_for_none(array): """ replace empty string fields with None """ def swap(value): """ change empty string to None """ if value == "": return None else: return value return [swap(x) for x in array]
[ 37811, 198, 220, 220, 220, 12972, 1069, 5276, 62, 952, 13, 26791, 198, 220, 220, 220, 220, 27156, 4907, 93, 628, 220, 220, 220, 10361, 5499, 628, 220, 220, 220, 1058, 22163, 4766, 25, 357, 66, 8, 1946, 12, 5539, 416, 1550, 8461, 10442, 12052, 13, 198, 220, 220, 220, 1058, 43085, 25, 968, 347, 10305, 13789, 11, 766, 38559, 24290, 329, 517, 3307, 198, 37811, 198, 11748, 12972, 1069, 5276, 62, 952, 13, 9979, 1187, 355, 38491, 198, 198, 55, 6561, 62, 6489, 7340, 1268, 796, 366, 9078, 1069, 5276, 12, 87, 7278, 1, 198, 55, 6561, 55, 62, 6489, 7340, 1268, 796, 366, 9078, 1069, 5276, 12, 87, 7278, 87, 1, 198, 3727, 50, 62, 6489, 7340, 1268, 796, 366, 9078, 1069, 5276, 12, 12978, 1, 198, 3727, 50, 18, 62, 6489, 7340, 1268, 796, 366, 9078, 1069, 5276, 12, 12978, 18, 1, 198, 55, 6561, 55, 54, 62, 6489, 7340, 1268, 796, 366, 9078, 1069, 5276, 12, 87, 7278, 87, 86, 1, 198, 9399, 62, 29722, 37738, 796, 366, 9078, 1069, 5276, 12, 952, 1, 628, 198, 10116, 32, 4146, 17534, 62, 15675, 4877, 796, 1391, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 55, 6561, 25, 685, 55, 6561, 62, 6489, 7340, 1268, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 55, 6561, 55, 25, 685, 55, 6561, 62, 6489, 7340, 1268, 11, 1395, 6561, 55, 62, 6489, 7340, 1268, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 55, 6561, 44, 25, 685, 55, 6561, 62, 6489, 7340, 1268, 11, 1395, 6561, 55, 62, 6489, 7340, 1268, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 3727, 50, 25, 685, 3727, 50, 62, 6489, 7340, 1268, 11, 440, 5258, 18, 62, 6489, 7340, 1268, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 7902, 53, 25, 685, 9399, 62, 29722, 37738, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 4694, 53, 25, 685, 9399, 62, 29722, 37738, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 7902, 53, 57, 25, 685, 9399, 62, 29722, 37738, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 4694, 53, 57, 25, 685, 9399, 62, 29722, 37738, 4357, 198, 92, 198, 198, 10116, 32, 4146, 17534, 62, 18564, 2043, 4877, 796, 1391, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 55, 6561, 25, 685, 55, 6561, 62, 6489, 7340, 1268, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 55, 6561, 55, 25, 685, 55, 6561, 55, 62, 6489, 7340, 1268, 11, 1395, 6561, 55, 54, 62, 6489, 7340, 1268, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 55, 6561, 44, 25, 685, 55, 6561, 55, 62, 6489, 7340, 1268, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 3727, 50, 25, 685, 3727, 50, 62, 6489, 7340, 1268, 11, 440, 5258, 18, 62, 6489, 7340, 1268, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 7902, 53, 25, 685, 9399, 62, 29722, 37738, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 4694, 53, 25, 685, 9399, 62, 29722, 37738, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 7902, 53, 57, 25, 685, 9399, 62, 29722, 37738, 4357, 198, 220, 220, 220, 38491, 13, 25664, 62, 21389, 1404, 62, 4694, 53, 57, 25, 685, 9399, 62, 29722, 37738, 4357, 198, 92, 628, 198, 198, 4299, 318, 62, 28920, 62, 18747, 7, 18747, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6822, 611, 281, 7177, 318, 281, 7177, 286, 10148, 393, 407, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6565, 62, 18747, 796, 685, 30854, 329, 5002, 287, 7177, 611, 5002, 14512, 366, 8973, 198, 220, 220, 220, 1441, 18896, 7, 28920, 62, 18747, 8, 6624, 657, 628, 198, 4299, 16075, 62, 28920, 62, 8841, 62, 1640, 62, 23108, 7, 18747, 2599, 198, 220, 220, 220, 37227, 6330, 6565, 4731, 7032, 351, 6045, 37227, 628, 220, 220, 220, 825, 16075, 7, 8367, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 1487, 6565, 4731, 284, 6045, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1988, 6624, 366, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 6045, 628, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 1988, 628, 220, 220, 220, 1441, 685, 2032, 499, 7, 87, 8, 329, 2124, 287, 7177, 60, 198 ]
2.194872
780
import unittest from cube import RubiksCube # rename that class # test solution funcs <- make sure the tests arent interfering with each other # def test_bottom_layer_robustness(self, n=50): # for _ in range(n): # self.cube.initialize_cube() # self.test_bottom_layer() # print("Success") # def test_middle_layer_robustness(self, n=50): # for _ in range(n): # self.cube.initialize_cube() # self.cube._solve_mid_layer() # def test_top_cross_robustness(self, n=50): # for _ in range(n): # self.cube.initialize_cube() # self.test_top_cross() # def test_top_face_robustness(self, n=50): # for _ in range(n): # self.cube.initialize_cube() # self.test_top_face() # def test_top_corners_robustness(self, n=50): # for _ in range(n): # self.cube.initialize_cube() # self.test_top_corners() if __name__ == '__main__': unittest.main()
[ 11748, 555, 715, 395, 198, 6738, 23441, 1330, 6256, 72, 591, 29071, 628, 198, 2, 36265, 326, 1398, 198, 198, 2, 1332, 4610, 1257, 6359, 24293, 787, 1654, 262, 5254, 389, 429, 32874, 351, 1123, 584, 628, 220, 220, 220, 1303, 825, 1332, 62, 22487, 62, 29289, 62, 22609, 436, 1108, 7, 944, 11, 299, 28, 1120, 2599, 628, 220, 220, 220, 1303, 220, 220, 220, 220, 329, 4808, 287, 2837, 7, 77, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 40296, 13, 36733, 1096, 62, 40296, 3419, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9288, 62, 22487, 62, 29289, 3419, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 33244, 4943, 628, 220, 220, 220, 220, 198, 220, 220, 220, 1303, 825, 1332, 62, 27171, 62, 29289, 62, 22609, 436, 1108, 7, 944, 11, 299, 28, 1120, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 329, 4808, 287, 2837, 7, 77, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 40296, 13, 36733, 1096, 62, 40296, 3419, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 40296, 13557, 82, 6442, 62, 13602, 62, 29289, 3419, 628, 220, 220, 220, 220, 198, 220, 220, 220, 1303, 825, 1332, 62, 4852, 62, 19692, 62, 22609, 436, 1108, 7, 944, 11, 299, 28, 1120, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 329, 4808, 287, 2837, 7, 77, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 40296, 13, 36733, 1096, 62, 40296, 3419, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9288, 62, 4852, 62, 19692, 3419, 628, 220, 220, 220, 220, 198, 220, 220, 220, 1303, 825, 1332, 62, 4852, 62, 2550, 62, 22609, 436, 1108, 7, 944, 11, 299, 28, 1120, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 329, 4808, 287, 2837, 7, 77, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 40296, 13, 36733, 1096, 62, 40296, 3419, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9288, 62, 4852, 62, 2550, 3419, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1303, 825, 1332, 62, 4852, 62, 20772, 364, 62, 22609, 436, 1108, 7, 944, 11, 299, 28, 1120, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 329, 4808, 287, 2837, 7, 77, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 40296, 13, 36733, 1096, 62, 40296, 3419, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9288, 62, 4852, 62, 20772, 364, 3419, 628, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419 ]
2.075099
506
#coding:utf-8 ''' filename:mysequence.py chap:6 subject:20 conditions:inherit collections.abc.Sequence 新容器内的对象必须按照一定顺序排列 solution:class MySequence ''' import collections import numbers class MySequence(collections.abc.Sequence): '''必要方法 __getitem__,__len__''' @staticmethod def order(seq): '''返回 按类别排序的序列''' # print('seq:',seq) source = list(seq) # print('source:',source) number_list = [] str_list = [] tuple_list = [] list_list = [] dict_list = [] set_list = [] other_list = [] d = {'numbers.Real':number_list, 'str':str_list, 'tuple':tuple_list, 'list':list_list, 'dict':dict_list, 'set':set_list} for item in source: for cls_string in d.keys(): if isinstance(item,eval(cls_string)): d[cls_string].append(item) break else: other_list.append(item) # print('other_list :',other_list) rst = [] lists = list(d.values()) for lst in lists: # print('before sort:',lst) lst.sort() # print('after sort:',lst) rst += lst return rst+other_list if __name__ == '__main__': l = [1,2,(3,4,55),{'a','b'},{(11,11):111,'name':'laoqi'},(33,5),62,'python',9,'age'] a = MySequence(l) print(l) print(a) print(len(a)) print(list(a))
[ 2, 66, 7656, 25, 40477, 12, 23, 198, 198, 7061, 6, 198, 220, 220, 220, 29472, 25, 1820, 43167, 13, 9078, 198, 220, 220, 220, 220, 220, 220, 220, 28022, 25, 21, 198, 220, 220, 220, 2426, 25, 1238, 198, 220, 220, 220, 3403, 25, 259, 372, 270, 17268, 13, 39305, 13, 44015, 594, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10545, 244, 108, 22522, 117, 161, 247, 101, 37863, 227, 21410, 43380, 117, 164, 109, 94, 33232, 227, 165, 94, 119, 162, 234, 231, 163, 227, 100, 31660, 22522, 21253, 94, 118, 41753, 237, 162, 236, 240, 26344, 245, 198, 220, 220, 220, 4610, 25, 4871, 2011, 44015, 594, 198, 7061, 6, 198, 198, 11748, 17268, 198, 11748, 3146, 198, 198, 4871, 2011, 44015, 594, 7, 4033, 26448, 13, 39305, 13, 44015, 594, 2599, 198, 220, 220, 220, 705, 7061, 33232, 227, 17358, 223, 43095, 37345, 243, 11593, 1136, 9186, 834, 11, 834, 11925, 834, 7061, 6, 628, 198, 220, 220, 220, 2488, 12708, 24396, 198, 220, 220, 220, 825, 1502, 7, 41068, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 32573, 242, 32368, 252, 10545, 234, 231, 163, 109, 119, 26344, 104, 162, 236, 240, 41753, 237, 21410, 41753, 237, 26344, 245, 7061, 6, 198, 2, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 41068, 25, 3256, 41068, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2723, 796, 1351, 7, 41068, 8, 198, 2, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 10459, 25, 3256, 10459, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1271, 62, 4868, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 965, 62, 4868, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 46545, 62, 4868, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 1351, 62, 4868, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 8633, 62, 4868, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 900, 62, 4868, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 584, 62, 4868, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 288, 796, 1391, 6, 77, 17024, 13, 15633, 10354, 17618, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2536, 10354, 2536, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 83, 29291, 10354, 83, 29291, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 4868, 10354, 4868, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 11600, 10354, 11600, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2617, 10354, 2617, 62, 4868, 92, 198, 220, 220, 220, 220, 220, 220, 220, 329, 2378, 287, 2723, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 537, 82, 62, 8841, 287, 288, 13, 13083, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 9186, 11, 18206, 7, 565, 82, 62, 8841, 8, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 288, 58, 565, 82, 62, 8841, 4083, 33295, 7, 9186, 8, 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, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 584, 62, 4868, 13, 33295, 7, 9186, 8, 198, 2, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 847, 62, 4868, 1058, 3256, 847, 62, 4868, 8, 198, 220, 220, 220, 220, 220, 220, 220, 374, 301, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 8341, 796, 1351, 7, 67, 13, 27160, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 329, 300, 301, 287, 8341, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 19052, 3297, 25, 3256, 75, 301, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 300, 301, 13, 30619, 3419, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 8499, 3297, 25, 3256, 75, 301, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 301, 15853, 300, 301, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 374, 301, 10, 847, 62, 4868, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 300, 796, 685, 16, 11, 17, 11, 7, 18, 11, 19, 11, 2816, 828, 90, 6, 64, 41707, 65, 6, 5512, 90, 7, 1157, 11, 1157, 2599, 16243, 4032, 3672, 10354, 6, 5031, 78, 40603, 6, 5512, 7, 2091, 11, 20, 828, 5237, 4032, 29412, 3256, 24, 4032, 496, 20520, 198, 220, 220, 220, 257, 796, 2011, 44015, 594, 7, 75, 8, 198, 220, 220, 220, 3601, 7, 75, 8, 198, 220, 220, 220, 3601, 7, 64, 8, 198, 220, 220, 220, 3601, 7, 11925, 7, 64, 4008, 198, 220, 220, 220, 3601, 7, 4868, 7, 64, 4008, 198 ]
1.700219
914
"""starts a sync remote server """ import os import getpass import pathlib import logging import click from . import cli import paramiko import paramiko.sftp_client import syncro.support as support import syncro.cli as cli logger = logging.getLogger(__name__) @click.command() @click.argument("host") @click.option('--password', hide_input=True) @click.option('--username', default=lambda: getpass.getuser()) @cli.standard(quiet=True) def main(host, username, password): "hello world" logger.debug("A") logger.info("B") logger.warning("C") port = 22 print("one", username, password) client = paramiko.client.SSHClient() client.load_system_host_keys() client.load_host_keys(pathlib.Path("~/.ssh/known_hosts").expanduser()) client.connect(host, port, username=username, password=password) transport = client.get_transport() transport.set_keepalive(2) print(support.remote(transport, ["ls", "-la",])[1]) # @cli.add_logging() # def two(*args, **kwargs): # print("two", args, kwargs) # # @cli.add_logging(1, b=2) # def three(*args, **kwargs): # print("three", args, kwargs) if __name__ == '__main__': main()
[ 37811, 301, 5889, 257, 17510, 6569, 4382, 198, 37811, 198, 11748, 28686, 198, 11748, 651, 6603, 198, 11748, 3108, 8019, 198, 11748, 18931, 198, 198, 11748, 3904, 198, 6738, 764, 1330, 537, 72, 198, 198, 11748, 5772, 12125, 198, 11748, 5772, 12125, 13, 82, 701, 79, 62, 16366, 198, 198, 11748, 17510, 305, 13, 11284, 355, 1104, 198, 11748, 17510, 305, 13, 44506, 355, 537, 72, 628, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 628, 198, 198, 31, 12976, 13, 21812, 3419, 198, 31, 12976, 13, 49140, 7203, 4774, 4943, 198, 31, 12976, 13, 18076, 10786, 438, 28712, 3256, 7808, 62, 15414, 28, 17821, 8, 198, 31, 12976, 13, 18076, 10786, 438, 29460, 3256, 4277, 28, 50033, 25, 651, 6603, 13, 1136, 7220, 28955, 198, 31, 44506, 13, 20307, 7, 39624, 28, 17821, 8, 198, 4299, 1388, 7, 4774, 11, 20579, 11, 9206, 2599, 198, 220, 220, 220, 366, 31373, 995, 1, 198, 220, 220, 220, 49706, 13, 24442, 7203, 32, 4943, 198, 220, 220, 220, 49706, 13, 10951, 7203, 33, 4943, 198, 220, 220, 220, 49706, 13, 43917, 7203, 34, 4943, 198, 220, 220, 220, 2493, 796, 2534, 198, 220, 220, 220, 3601, 7203, 505, 1600, 20579, 11, 9206, 8, 198, 220, 220, 220, 5456, 796, 5772, 12125, 13, 16366, 13, 5432, 39, 11792, 3419, 198, 220, 220, 220, 5456, 13, 2220, 62, 10057, 62, 4774, 62, 13083, 3419, 198, 220, 220, 220, 5456, 13, 2220, 62, 4774, 62, 13083, 7, 6978, 8019, 13, 15235, 7203, 93, 11757, 45824, 14, 4002, 62, 4774, 82, 11074, 11201, 392, 7220, 28955, 198, 220, 220, 220, 5456, 13, 8443, 7, 4774, 11, 2493, 11, 20579, 28, 29460, 11, 9206, 28, 28712, 8, 628, 220, 220, 220, 4839, 796, 5456, 13, 1136, 62, 7645, 634, 3419, 198, 220, 220, 220, 4839, 13, 2617, 62, 14894, 282, 425, 7, 17, 8, 628, 220, 220, 220, 3601, 7, 11284, 13, 47960, 7, 7645, 634, 11, 14631, 7278, 1600, 27444, 5031, 1600, 12962, 58, 16, 12962, 198, 198, 2, 2488, 44506, 13, 2860, 62, 6404, 2667, 3419, 198, 2, 825, 734, 46491, 22046, 11, 12429, 46265, 22046, 2599, 198, 2, 220, 220, 220, 220, 3601, 7203, 11545, 1600, 26498, 11, 479, 86, 22046, 8, 198, 2, 198, 2, 2488, 44506, 13, 2860, 62, 6404, 2667, 7, 16, 11, 275, 28, 17, 8, 198, 2, 825, 1115, 46491, 22046, 11, 12429, 46265, 22046, 2599, 198, 2, 220, 220, 220, 220, 3601, 7203, 15542, 1600, 26498, 11, 479, 86, 22046, 8, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419, 198 ]
2.684091
440
from typing import List, Tuple #fenzhi1xiugai def n31(a: int) -> Tuple[List[int], int]: """ Returns the Collatz sequence and its length of any positive integer. >>> n31(4) ([4, 2, 1], 3) """ if not isinstance(a, int): raise TypeError("Must be int, not {}".format(type(a).__name__)) if a < 1: raise ValueError(f"Given integer must be greater than 1, not {a}") path = [a] while a != 1: if a % 2 == 0: a = a // 2 else: a = 3 * a + 1 path += [a] return path, len(path) def test_n31(): """ >>> test_n31() """ assert n31(4) == ([4, 2, 1], 3) assert n31(11) == ([11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1], 15) assert n31(31) == ( [ 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1, ], 107, ) if __name__ == "__main__": num = 4 path, length = n31(num) print(f"The Collatz sequence of {num} took {length} steps. \nPath: {path}")
[ 6738, 19720, 1330, 7343, 11, 309, 29291, 198, 198, 2, 69, 19471, 5303, 16, 29992, 1018, 1872, 198, 4299, 299, 3132, 7, 64, 25, 493, 8, 4613, 309, 29291, 58, 8053, 58, 600, 4357, 493, 5974, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16409, 262, 7778, 27906, 8379, 290, 663, 4129, 286, 597, 3967, 18253, 13, 198, 220, 220, 220, 13163, 299, 3132, 7, 19, 8, 198, 220, 220, 220, 29565, 19, 11, 362, 11, 352, 4357, 513, 8, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 611, 407, 318, 39098, 7, 64, 11, 493, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 5994, 12331, 7203, 34320, 307, 493, 11, 407, 23884, 1911, 18982, 7, 4906, 7, 64, 737, 834, 3672, 834, 4008, 198, 220, 220, 220, 611, 257, 1279, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 11052, 12331, 7, 69, 1, 15056, 18253, 1276, 307, 3744, 621, 352, 11, 407, 1391, 64, 92, 4943, 628, 220, 220, 220, 3108, 796, 685, 64, 60, 198, 220, 220, 220, 981, 257, 14512, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 257, 4064, 362, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 257, 796, 257, 3373, 362, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 257, 796, 513, 1635, 257, 1343, 352, 198, 220, 220, 220, 220, 220, 220, 220, 3108, 15853, 685, 64, 60, 198, 220, 220, 220, 1441, 3108, 11, 18896, 7, 6978, 8, 628, 198, 4299, 1332, 62, 77, 3132, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 13163, 1332, 62, 77, 3132, 3419, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6818, 299, 3132, 7, 19, 8, 6624, 29565, 19, 11, 362, 11, 352, 4357, 513, 8, 198, 220, 220, 220, 6818, 299, 3132, 7, 1157, 8, 6624, 29565, 1157, 11, 4974, 11, 1596, 11, 6740, 11, 2608, 11, 1511, 11, 2319, 11, 1160, 11, 838, 11, 642, 11, 1467, 11, 807, 11, 604, 11, 362, 11, 352, 4357, 1315, 8, 198, 220, 220, 220, 6818, 299, 3132, 7, 3132, 8, 6624, 357, 198, 220, 220, 220, 220, 220, 220, 220, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3261, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10048, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6298, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25181, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 9166, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 28277, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16226, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 38831, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 27829, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4764, 19, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 34353, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20416, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 44969, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 28581, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10495, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 39768, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 21643, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 42215, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 27253, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15349, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 28947, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20708, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 604, 2791, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 30435, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13037, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13803, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19038, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 642, 2075, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 39135, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 767, 3829, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 42321, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1367, 4521, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 642, 6052, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1596, 1795, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 807, 3829, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 48655, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1511, 2623, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 718, 3104, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 42819, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26118, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 47233, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 34489, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 767, 4051, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 42163, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1367, 2624, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 642, 2791, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 42032, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 30607, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 36959, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1105, 4304, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 718, 2548, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 40385, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 860, 3365, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 604, 3720, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1478, 2548, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 767, 1129, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 362, 21273, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 838, 3720, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 513, 23721, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1467, 1129, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4764, 3365, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1987, 1959, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 767, 25270, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 513, 29173, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1248, 1828, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16679, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2681, 2682, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1511, 3134, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 604, 15377, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1160, 4349, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 718, 21526, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1542, 3324, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 860, 24339, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6337, 1433, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 18395, 23, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 12279, 19, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 642, 3324, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1596, 2624, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 807, 2791, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 47407, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 36058, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 22626, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 29524, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 860, 4304, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 604, 3459, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35264, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19409, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8454, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 28598, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10190, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6337, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2242, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4317, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3439, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15696, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7192, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13454, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4019, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2319, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1160, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 838, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 642, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1467, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 807, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 604, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 362, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 220, 220, 16226, 11, 198, 220, 220, 220, 1267, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 997, 796, 604, 198, 220, 220, 220, 3108, 11, 4129, 796, 299, 3132, 7, 22510, 8, 198, 220, 220, 220, 3601, 7, 69, 1, 464, 7778, 27906, 8379, 286, 1391, 22510, 92, 1718, 1391, 13664, 92, 4831, 13, 3467, 77, 15235, 25, 1391, 6978, 92, 4943, 198 ]
1.382968
2,008
from nltk import Tree import nltk import argparse import pandas as pandas import pandas as pd parser = argparse.ArgumentParser() parser.add_argument('--infile', default='./ptb-collins.merge.txt', help="preprocessing tree") #parser.add_argument('--seed', type=int, default=2004, help="random seed for initialization") parser.add_argument('--outfile', default='./processed_ptb-collins.merge1.txt', help="file containing logs") if (__name__ == "__main__"): args = parser.parse_args() trees_file = open(args.infile, 'r') lines = trees_file.readlines() list_lines = [line for line in lines] trees_file.close() processed_lines = [] for list_line in list_lines: ls=[] for tokens in list_line.split(): if tokens[0] == "(": try: if tokens[1] in string.ascii_letters: tokens = rmsym('-',tokens) tokens = rmsym('=', tokens) tokens = rmsym('|', tokens) tokens = rmsym('$', tokens) tokens = rmsym('#', tokens) tokens = rmsym('+', tokens) except: print("some bugs") ls.append(tokens) processed_line = " ".join(ls) processed_lines.append(processed_line) f=open(args.outfile,'w') for ele in processed_lines: f.write(ele+'\n') f.close() print("Pre-processing is done")
[ 6738, 299, 2528, 74, 1330, 12200, 198, 11748, 299, 2528, 74, 198, 11748, 1822, 29572, 198, 11748, 19798, 292, 355, 19798, 292, 198, 11748, 19798, 292, 355, 279, 67, 628, 220, 220, 220, 220, 198, 48610, 796, 1822, 29572, 13, 28100, 1713, 46677, 3419, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 259, 7753, 3256, 4277, 28, 4458, 14, 457, 65, 12, 26000, 1040, 13, 647, 469, 13, 14116, 3256, 1037, 2625, 3866, 36948, 5509, 4943, 198, 2, 48610, 13, 2860, 62, 49140, 10786, 438, 28826, 3256, 2099, 28, 600, 11, 4277, 28, 15724, 11, 1037, 2625, 25120, 9403, 329, 37588, 4943, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 448, 7753, 3256, 4277, 28, 4458, 14, 14681, 276, 62, 457, 65, 12, 26000, 1040, 13, 647, 469, 16, 13, 14116, 3256, 1037, 2625, 7753, 7268, 17259, 4943, 198, 198, 361, 357, 834, 3672, 834, 6624, 366, 834, 12417, 834, 1, 2599, 198, 220, 220, 220, 26498, 796, 30751, 13, 29572, 62, 22046, 3419, 198, 220, 220, 220, 7150, 62, 7753, 796, 1280, 7, 22046, 13, 259, 7753, 11, 705, 81, 11537, 198, 220, 220, 220, 3951, 796, 7150, 62, 7753, 13, 961, 6615, 3419, 198, 220, 220, 220, 1351, 62, 6615, 796, 685, 1370, 329, 1627, 287, 3951, 60, 198, 220, 220, 220, 7150, 62, 7753, 13, 19836, 3419, 198, 220, 220, 220, 13686, 62, 6615, 796, 17635, 198, 220, 220, 220, 329, 1351, 62, 1370, 287, 1351, 62, 6615, 25, 198, 220, 220, 220, 220, 220, 220, 220, 43979, 28, 21737, 198, 220, 220, 220, 220, 220, 220, 220, 329, 16326, 287, 1351, 62, 1370, 13, 35312, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 16326, 58, 15, 60, 6624, 30629, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 16326, 58, 16, 60, 287, 4731, 13, 292, 979, 72, 62, 15653, 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, 16326, 796, 374, 907, 4948, 10786, 12, 3256, 83, 482, 641, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16326, 796, 374, 907, 4948, 10786, 28, 3256, 16326, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16326, 796, 374, 907, 4948, 10786, 91, 3256, 16326, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16326, 796, 374, 907, 4948, 10786, 3, 3256, 16326, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16326, 796, 374, 907, 4948, 10786, 2, 3256, 16326, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16326, 796, 374, 907, 4948, 10786, 10, 3256, 16326, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2845, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 11246, 11316, 4943, 220, 220, 220, 220, 220, 220, 220, 220, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 43979, 13, 33295, 7, 83, 482, 641, 8, 198, 220, 220, 220, 220, 220, 220, 220, 13686, 62, 1370, 796, 366, 27071, 22179, 7, 7278, 8, 198, 220, 220, 220, 220, 220, 220, 220, 13686, 62, 6615, 13, 33295, 7, 14681, 276, 62, 1370, 8, 628, 220, 220, 220, 277, 28, 9654, 7, 22046, 13, 448, 7753, 4032, 86, 11537, 198, 220, 220, 220, 329, 9766, 287, 13686, 62, 6615, 25, 198, 220, 220, 220, 220, 220, 220, 220, 277, 13, 13564, 7, 11129, 10, 6, 59, 77, 11537, 628, 220, 220, 220, 277, 13, 19836, 3419, 198, 220, 220, 220, 3601, 7203, 6719, 12, 36948, 318, 1760, 4943 ]
2.069156
723
# Copyright 2021 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. """Efficient Walsh-Hadamard transform in JAX.""" import math from typing import Tuple, Union import jax import jax.numpy as jnp import scipy from fedjax.core.typing import PRNGKey, Params @jax.jit def walsh_hadamard_transform( x: jnp.ndarray, small_n: int = 2**7, precision: Union[jax.lax.Precision, str] = 'highest') -> jnp.ndarray: """Efficient Walsh-Hadamard transform in JAX. An accelerator friendly O(n log n) Walsh-Hadamard transform. Args: x: A vector. len(x) must be a power of 2. small_n: Size to break x into. The default value is tuned on TPUv3. Must be a power of 2 and > 1. precision: Precision for general dot products. Returns: Transformed vector. """ if small_n <= 1: raise ValueError(f'small_n must be > 1, got {small_n}') # Let # - A ⊗ B be the Kronecker product of A and B; # - flat(X) be the vector obtained by flattening the rows of X of shape # [M, N]. # # We can show the following: # # (A ⊗ B^T) flat(X) = flat(A X B) # # Note that the Hadamard matrix H_{2^M 2^N} = H_{2^M} ⊗ H_{2^N}, and # Hadamard matrices are symmetrical. Therefore, for a [2^M, 2^N] matrix X, # # H_{2^M 2^N} flat(X) = flat(H_{2^M} X H_{2^N}) # # The idea can be generalized by breaking a Hadamard matrix into the Kronecker # product of many small Hadamard matrices, and reshaping the vector input into # a many-dimensional array, and running einsum on each dimension. # # Let the input vector be of length D, because our "small" Hadamard matrices # are of size at most small_n x small_n, a constant, each einsum is O(D). We # need to run log D einsums, thus the overall time complexity is O(D log D), # same as the classical divide and conquer algorithm. # # However, thanks to efficient software & hardware implementations of einsum, # we can often achieve far better speed than the classical algorithm on # accelerators, at the same time producing a far simpler XLA HLO graph. n = len(x) # Find out the shape to reshape x into. shape = [] while n > 1: shape.append(min(n, small_n)) n //= small_n shape.reverse() num_dims = len(shape) if num_dims + 1 >= 10: # We will run out of dimension names in einsums. raise ValueError(f'small_n={small_n} is too small for input size {n}') y = x.reshape(shape) # Hadamard matrices we will need. hadamards = dict((d, hadamard_matrix(d, x.dtype)) for d in set(shape)) # einsum on each dimension. for i, d in enumerate(shape): y_dims = ''.join(str(j) for j in range(num_dims)) h_dims = f'{i}{num_dims + 1}' out_dims = y_dims.replace(str(i), str(num_dims + 1), 1) operands = f'{y_dims},{h_dims}->{out_dims}' y = jnp.einsum(operands, y, hadamards[d], precision=precision) return y.flatten() def hadamard_matrix(n: int, dtype: jnp.dtype) -> jnp.ndarray: """Generates the Hadamard matrix. Because there are JAX dtypes not supported in numpy, the equivalent function in scipy can't be used directly. Args: n: Number of rows/columns of the Hadamard matrix. Must be a power of 2. dtype: Output dtype. Returns: The Hadamard matrix of the given size and type. """ return jnp.array(scipy.linalg.hadamard(n), dtype) @jax.jit def structured_rotation(x: jnp.ndarray, rng: PRNGKey) -> Tuple[jnp.ndarray, jnp.ndarray]: """Computes HD(x)/sqrt(d). Here H is the walsh Hadamard matrix, d is the dimensionlity of x, and D is a random Rademacher matrix. Args: x: array to be rotated. rng: PRNGKey used for rotation. Returns: Rotated matrix and the original shape. """ x_flat = jnp.reshape(x, [-1]) d = 2**math.ceil(math.log2(x_flat.size)) w = jnp.pad(x_flat, (0, d - x.size)) rademacher = jax.random.rademacher(rng, w.shape) return walsh_hadamard_transform(w * rademacher) / jnp.sqrt(d), jnp.array( x.shape) def inverse_structured_rotation(x: jnp.ndarray, rng: PRNGKey, original_shape: jnp.ndarray) -> jnp.ndarray: """Computes (HD)^(-1)(x)/sqrt(d). Here where H is the walsh Hadamard matrix, d is the dimensionlity of x, and D is a random Rademacher matrix. Args: x: rotated array, which needs to be unrotated. rng: PRNGKey used for rotation. original_shape: desired shape of the output. Returns: Output of (HD)^(-1)(x)/sqrt(d) with appropriate shape. """ rademacher = jax.random.rademacher(rng, x.shape) w = walsh_hadamard_transform(x) * rademacher / jnp.sqrt(x.size) original_size = jnp.prod(original_shape) y_flat = w.take(jnp.arange(original_size)) return jnp.reshape(y_flat, original_shape) def structured_rotation_pytree(params: Params, rng: PRNGKey) -> Tuple[Params, Params]: """Applies strucuted rotation to all elements of the pytree. Args: params: pytree to be rotated. rng: jax random key. Returns: Pytrees of rotated arrays and shapes. """ leaves, tree_def = jax.tree_util.tree_flatten(params) rngs = jax.random.split(rng, len(leaves)) rotated_leaves = [] shapes = [] for l, r in zip(leaves, rngs): leaf, shape = structured_rotation(l, r) rotated_leaves.append(leaf) shapes.append(shape) rotated_pytree = jax.tree_util.tree_unflatten(tree_def, rotated_leaves) original_shapes_pytree = jax.tree_util.tree_unflatten(tree_def, shapes) return rotated_pytree, original_shapes_pytree def inverse_structured_rotation_pytree(params: Params, rng: PRNGKey, shapes: Params) -> Params: """Applies inverse structured rotation to all elements of the pytree. Args: params: pytree to be rotated. rng: jax random key. shapes: pytree of shapes to be rotated. Returns: Inversely rotated pytree whose arrays are specified by input shapes. """ leaves, tree_def = jax.tree_util.tree_flatten(params) leaves_shapes, _ = jax.tree_util.tree_flatten(shapes) rngs = jax.random.split(rng, len(leaves)) new_leaves = [] for l, r, shape in zip(leaves, rngs, leaves_shapes): new_leaves.append(inverse_structured_rotation(l, r, shape)) return jax.tree_util.tree_unflatten(tree_def, new_leaves)
[ 2, 15069, 33448, 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, 37811, 36, 5632, 24104, 12, 25383, 321, 446, 6121, 287, 449, 25922, 526, 15931, 198, 198, 11748, 10688, 198, 6738, 19720, 1330, 309, 29291, 11, 4479, 198, 198, 11748, 474, 897, 198, 11748, 474, 897, 13, 77, 32152, 355, 474, 37659, 198, 11748, 629, 541, 88, 198, 6738, 11672, 73, 897, 13, 7295, 13, 774, 13886, 1330, 4810, 10503, 9218, 11, 2547, 4105, 628, 198, 31, 73, 897, 13, 45051, 198, 4299, 266, 22114, 62, 18108, 321, 446, 62, 35636, 7, 198, 220, 220, 220, 2124, 25, 474, 37659, 13, 358, 18747, 11, 198, 220, 220, 220, 1402, 62, 77, 25, 493, 796, 362, 1174, 22, 11, 198, 220, 220, 220, 15440, 25, 4479, 58, 73, 897, 13, 75, 897, 13, 6719, 16005, 11, 965, 60, 796, 705, 35323, 11537, 4613, 474, 37659, 13, 358, 18747, 25, 198, 220, 37227, 36, 5632, 24104, 12, 25383, 321, 446, 6121, 287, 449, 25922, 13, 628, 220, 1052, 44219, 8030, 440, 7, 77, 2604, 299, 8, 24104, 12, 25383, 321, 446, 6121, 13, 628, 220, 943, 14542, 25, 198, 220, 220, 220, 2124, 25, 317, 15879, 13, 18896, 7, 87, 8, 1276, 307, 257, 1176, 286, 362, 13, 198, 220, 220, 220, 1402, 62, 77, 25, 12849, 284, 2270, 2124, 656, 13, 383, 4277, 1988, 318, 16524, 319, 309, 5105, 85, 18, 13, 12039, 307, 198, 220, 220, 220, 220, 220, 257, 1176, 286, 362, 290, 1875, 352, 13, 198, 220, 220, 220, 15440, 25, 39281, 329, 2276, 16605, 3186, 13, 628, 220, 16409, 25, 198, 220, 220, 220, 3602, 12214, 15879, 13, 198, 220, 37227, 198, 220, 611, 1402, 62, 77, 19841, 352, 25, 198, 220, 220, 220, 5298, 11052, 12331, 7, 69, 338, 76, 439, 62, 77, 1276, 307, 1875, 352, 11, 1392, 1391, 17470, 62, 77, 92, 11537, 628, 220, 1303, 3914, 198, 220, 1303, 532, 220, 220, 317, 2343, 232, 245, 347, 307, 262, 13685, 505, 15280, 1720, 286, 317, 290, 347, 26, 198, 220, 1303, 532, 220, 220, 6228, 7, 55, 8, 307, 262, 15879, 6492, 416, 27172, 3101, 262, 15274, 286, 1395, 286, 5485, 198, 220, 1303, 220, 220, 220, 220, 685, 44, 11, 399, 4083, 198, 220, 1303, 198, 220, 1303, 775, 460, 905, 262, 1708, 25, 198, 220, 1303, 198, 220, 1303, 220, 220, 220, 220, 357, 32, 2343, 232, 245, 347, 61, 51, 8, 6228, 7, 55, 8, 796, 6228, 7, 32, 1395, 347, 8, 198, 220, 1303, 198, 220, 1303, 5740, 326, 262, 11161, 321, 446, 17593, 367, 23330, 17, 61, 44, 362, 61, 45, 92, 796, 367, 23330, 17, 61, 44, 92, 2343, 232, 245, 367, 23330, 17, 61, 45, 5512, 290, 198, 220, 1303, 11161, 321, 446, 2603, 45977, 389, 23606, 34546, 13, 8447, 11, 329, 257, 685, 17, 61, 44, 11, 362, 61, 45, 60, 17593, 1395, 11, 198, 220, 1303, 198, 220, 1303, 220, 220, 220, 220, 367, 23330, 17, 61, 44, 362, 61, 45, 92, 6228, 7, 55, 8, 796, 6228, 7, 39, 23330, 17, 61, 44, 92, 1395, 367, 23330, 17, 61, 45, 30072, 198, 220, 1303, 198, 220, 1303, 383, 2126, 460, 307, 38284, 416, 7163, 257, 11161, 321, 446, 17593, 656, 262, 13685, 505, 15280, 198, 220, 1303, 1720, 286, 867, 1402, 11161, 321, 446, 2603, 45977, 11, 290, 27179, 9269, 262, 15879, 5128, 656, 198, 220, 1303, 257, 867, 12, 19577, 7177, 11, 290, 2491, 304, 1040, 388, 319, 1123, 15793, 13, 198, 220, 1303, 198, 220, 1303, 3914, 262, 5128, 15879, 307, 286, 4129, 360, 11, 780, 674, 366, 17470, 1, 11161, 321, 446, 2603, 45977, 198, 220, 1303, 389, 286, 2546, 379, 749, 1402, 62, 77, 2124, 1402, 62, 77, 11, 257, 6937, 11, 1123, 304, 1040, 388, 318, 440, 7, 35, 737, 775, 198, 220, 1303, 761, 284, 1057, 2604, 360, 304, 1040, 5700, 11, 4145, 262, 4045, 640, 13357, 318, 440, 7, 35, 2604, 360, 828, 198, 220, 1303, 976, 355, 262, 15993, 14083, 290, 23875, 11862, 13, 198, 220, 1303, 198, 220, 1303, 2102, 11, 5176, 284, 6942, 3788, 1222, 6890, 25504, 286, 304, 1040, 388, 11, 198, 220, 1303, 356, 460, 1690, 4620, 1290, 1365, 2866, 621, 262, 15993, 11862, 319, 198, 220, 1303, 8320, 2024, 11, 379, 262, 976, 640, 9194, 257, 1290, 18599, 1395, 13534, 367, 21982, 4823, 13, 628, 220, 299, 796, 18896, 7, 87, 8, 628, 220, 1303, 9938, 503, 262, 5485, 284, 27179, 1758, 2124, 656, 13, 198, 220, 5485, 796, 17635, 198, 220, 981, 299, 1875, 352, 25, 198, 220, 220, 220, 5485, 13, 33295, 7, 1084, 7, 77, 11, 1402, 62, 77, 4008, 198, 220, 220, 220, 299, 3373, 28, 1402, 62, 77, 198, 220, 5485, 13, 50188, 3419, 198, 220, 997, 62, 67, 12078, 796, 18896, 7, 43358, 8, 198, 220, 611, 997, 62, 67, 12078, 1343, 352, 18189, 838, 25, 198, 220, 220, 220, 1303, 775, 481, 1057, 503, 286, 15793, 3891, 287, 304, 1040, 5700, 13, 198, 220, 220, 220, 5298, 11052, 12331, 7, 69, 338, 76, 439, 62, 77, 34758, 17470, 62, 77, 92, 318, 1165, 1402, 329, 5128, 2546, 1391, 77, 92, 11537, 198, 220, 331, 796, 2124, 13, 3447, 1758, 7, 43358, 8, 628, 220, 1303, 11161, 321, 446, 2603, 45977, 356, 481, 761, 13, 198, 220, 550, 321, 1371, 796, 8633, 19510, 67, 11, 550, 321, 446, 62, 6759, 8609, 7, 67, 11, 2124, 13, 67, 4906, 4008, 329, 288, 287, 900, 7, 43358, 4008, 628, 220, 1303, 304, 1040, 388, 319, 1123, 15793, 13, 198, 220, 329, 1312, 11, 288, 287, 27056, 378, 7, 43358, 2599, 198, 220, 220, 220, 331, 62, 67, 12078, 796, 705, 4458, 22179, 7, 2536, 7, 73, 8, 329, 474, 287, 2837, 7, 22510, 62, 67, 12078, 4008, 198, 220, 220, 220, 289, 62, 67, 12078, 796, 277, 6, 90, 72, 18477, 22510, 62, 67, 12078, 1343, 352, 92, 6, 198, 220, 220, 220, 503, 62, 67, 12078, 796, 331, 62, 67, 12078, 13, 33491, 7, 2536, 7, 72, 828, 965, 7, 22510, 62, 67, 12078, 1343, 352, 828, 352, 8, 198, 220, 220, 220, 1515, 1746, 796, 277, 6, 90, 88, 62, 67, 12078, 5512, 90, 71, 62, 67, 12078, 92, 3784, 90, 448, 62, 67, 12078, 92, 6, 198, 220, 220, 220, 331, 796, 474, 37659, 13, 68, 1040, 388, 7, 3575, 1746, 11, 331, 11, 550, 321, 1371, 58, 67, 4357, 15440, 28, 3866, 16005, 8, 198, 220, 1441, 331, 13, 2704, 41769, 3419, 628, 198, 4299, 550, 321, 446, 62, 6759, 8609, 7, 77, 25, 493, 11, 288, 4906, 25, 474, 37659, 13, 67, 4906, 8, 4613, 474, 37659, 13, 358, 18747, 25, 198, 220, 37227, 8645, 689, 262, 11161, 321, 446, 17593, 13, 628, 220, 4362, 612, 389, 449, 25922, 288, 19199, 407, 4855, 287, 299, 32152, 11, 262, 7548, 2163, 198, 220, 287, 629, 541, 88, 460, 470, 307, 973, 3264, 13, 628, 220, 943, 14542, 25, 198, 220, 220, 220, 299, 25, 7913, 286, 15274, 14, 28665, 82, 286, 262, 11161, 321, 446, 17593, 13, 12039, 307, 257, 1176, 286, 362, 13, 198, 220, 220, 220, 288, 4906, 25, 25235, 288, 4906, 13, 628, 220, 16409, 25, 198, 220, 220, 220, 383, 11161, 321, 446, 17593, 286, 262, 1813, 2546, 290, 2099, 13, 198, 220, 37227, 198, 220, 1441, 474, 37659, 13, 18747, 7, 1416, 541, 88, 13, 75, 1292, 70, 13, 18108, 321, 446, 7, 77, 828, 288, 4906, 8, 628, 198, 31, 73, 897, 13, 45051, 198, 4299, 20793, 62, 10599, 341, 7, 87, 25, 474, 37659, 13, 358, 18747, 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, 374, 782, 25, 4810, 10503, 9218, 8, 4613, 309, 29291, 58, 73, 37659, 13, 358, 18747, 11, 474, 37659, 13, 358, 18747, 5974, 198, 220, 37227, 7293, 1769, 5572, 7, 87, 20679, 31166, 17034, 7, 67, 737, 628, 220, 3423, 367, 318, 262, 266, 22114, 11161, 321, 446, 17593, 11, 288, 318, 262, 15793, 75, 414, 286, 2124, 11, 290, 360, 198, 220, 318, 257, 4738, 5325, 368, 3493, 17593, 13, 628, 220, 943, 14542, 25, 198, 220, 220, 220, 2124, 25, 7177, 284, 307, 38375, 13, 198, 220, 220, 220, 374, 782, 25, 4810, 10503, 9218, 973, 329, 13179, 13, 628, 220, 16409, 25, 198, 220, 220, 220, 18481, 515, 17593, 290, 262, 2656, 5485, 13, 198, 220, 37227, 198, 220, 2124, 62, 38568, 796, 474, 37659, 13, 3447, 1758, 7, 87, 11, 25915, 16, 12962, 198, 220, 288, 796, 362, 1174, 11018, 13, 344, 346, 7, 11018, 13, 6404, 17, 7, 87, 62, 38568, 13, 7857, 4008, 198, 220, 266, 796, 474, 37659, 13, 15636, 7, 87, 62, 38568, 11, 357, 15, 11, 288, 532, 2124, 13, 7857, 4008, 198, 220, 2511, 368, 3493, 796, 474, 897, 13, 25120, 13, 6335, 368, 3493, 7, 81, 782, 11, 266, 13, 43358, 8, 198, 220, 1441, 266, 22114, 62, 18108, 321, 446, 62, 35636, 7, 86, 1635, 2511, 368, 3493, 8, 1220, 474, 37659, 13, 31166, 17034, 7, 67, 828, 474, 37659, 13, 18747, 7, 198, 220, 220, 220, 220, 220, 2124, 13, 43358, 8, 628, 198, 4299, 34062, 62, 7249, 1522, 62, 10599, 341, 7, 87, 25, 474, 37659, 13, 358, 18747, 11, 374, 782, 25, 4810, 10503, 9218, 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, 2656, 62, 43358, 25, 474, 37659, 13, 358, 18747, 8, 4613, 474, 37659, 13, 358, 18747, 25, 198, 220, 37227, 7293, 1769, 357, 10227, 8, 61, 32590, 16, 5769, 87, 20679, 31166, 17034, 7, 67, 737, 628, 220, 3423, 810, 367, 318, 262, 266, 22114, 11161, 321, 446, 17593, 11, 288, 318, 262, 15793, 75, 414, 286, 2124, 11, 290, 360, 198, 220, 318, 257, 4738, 5325, 368, 3493, 17593, 13, 628, 220, 943, 14542, 25, 198, 220, 220, 220, 2124, 25, 38375, 7177, 11, 543, 2476, 284, 307, 555, 10599, 515, 13, 198, 220, 220, 220, 374, 782, 25, 4810, 10503, 9218, 973, 329, 13179, 13, 198, 220, 220, 220, 2656, 62, 43358, 25, 10348, 5485, 286, 262, 5072, 13, 628, 220, 16409, 25, 198, 220, 220, 220, 25235, 286, 357, 10227, 8, 61, 32590, 16, 5769, 87, 20679, 31166, 17034, 7, 67, 8, 351, 5035, 5485, 13, 198, 220, 37227, 198, 220, 2511, 368, 3493, 796, 474, 897, 13, 25120, 13, 6335, 368, 3493, 7, 81, 782, 11, 2124, 13, 43358, 8, 198, 220, 266, 796, 266, 22114, 62, 18108, 321, 446, 62, 35636, 7, 87, 8, 1635, 2511, 368, 3493, 1220, 474, 37659, 13, 31166, 17034, 7, 87, 13, 7857, 8, 198, 220, 2656, 62, 7857, 796, 474, 37659, 13, 1676, 67, 7, 14986, 62, 43358, 8, 198, 220, 331, 62, 38568, 796, 266, 13, 20657, 7, 73, 37659, 13, 283, 858, 7, 14986, 62, 7857, 4008, 198, 220, 1441, 474, 37659, 13, 3447, 1758, 7, 88, 62, 38568, 11, 2656, 62, 43358, 8, 628, 198, 4299, 20793, 62, 10599, 341, 62, 9078, 21048, 7, 37266, 25, 2547, 4105, 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, 374, 782, 25, 4810, 10503, 9218, 8, 4613, 309, 29291, 58, 10044, 4105, 11, 2547, 4105, 5974, 198, 220, 37227, 4677, 13508, 2874, 66, 7241, 13179, 284, 477, 4847, 286, 262, 12972, 21048, 13, 628, 220, 943, 14542, 25, 198, 220, 220, 220, 42287, 25, 12972, 21048, 284, 307, 38375, 13, 198, 220, 220, 220, 374, 782, 25, 474, 897, 4738, 1994, 13, 628, 220, 16409, 25, 198, 220, 220, 220, 9485, 83, 6037, 286, 38375, 26515, 290, 15268, 13, 198, 220, 37227, 198, 220, 5667, 11, 5509, 62, 4299, 796, 474, 897, 13, 21048, 62, 22602, 13, 21048, 62, 2704, 41769, 7, 37266, 8, 198, 220, 374, 782, 82, 796, 474, 897, 13, 25120, 13, 35312, 7, 81, 782, 11, 18896, 7, 293, 3080, 4008, 198, 220, 38375, 62, 293, 3080, 796, 17635, 198, 220, 15268, 796, 17635, 198, 220, 329, 300, 11, 374, 287, 19974, 7, 293, 3080, 11, 374, 782, 82, 2599, 198, 220, 220, 220, 12835, 11, 5485, 796, 20793, 62, 10599, 341, 7, 75, 11, 374, 8, 198, 220, 220, 220, 38375, 62, 293, 3080, 13, 33295, 7, 33201, 8, 198, 220, 220, 220, 15268, 13, 33295, 7, 43358, 8, 198, 220, 38375, 62, 9078, 21048, 796, 474, 897, 13, 21048, 62, 22602, 13, 21048, 62, 403, 2704, 41769, 7, 21048, 62, 4299, 11, 38375, 62, 293, 3080, 8, 198, 220, 2656, 62, 1477, 7916, 62, 9078, 21048, 796, 474, 897, 13, 21048, 62, 22602, 13, 21048, 62, 403, 2704, 41769, 7, 21048, 62, 4299, 11, 15268, 8, 198, 220, 1441, 38375, 62, 9078, 21048, 11, 2656, 62, 1477, 7916, 62, 9078, 21048, 628, 198, 4299, 34062, 62, 7249, 1522, 62, 10599, 341, 62, 9078, 21048, 7, 37266, 25, 2547, 4105, 11, 374, 782, 25, 4810, 10503, 9218, 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, 15268, 25, 2547, 4105, 8, 4613, 2547, 4105, 25, 198, 220, 37227, 4677, 13508, 34062, 20793, 13179, 284, 477, 4847, 286, 262, 12972, 21048, 13, 628, 220, 943, 14542, 25, 198, 220, 220, 220, 42287, 25, 12972, 21048, 284, 307, 38375, 13, 198, 220, 220, 220, 374, 782, 25, 474, 897, 4738, 1994, 13, 198, 220, 220, 220, 15268, 25, 12972, 21048, 286, 15268, 284, 307, 38375, 13, 628, 220, 16409, 25, 198, 220, 220, 220, 554, 21243, 38375, 12972, 21048, 3025, 26515, 389, 7368, 416, 5128, 15268, 13, 198, 220, 37227, 198, 220, 5667, 11, 5509, 62, 4299, 796, 474, 897, 13, 21048, 62, 22602, 13, 21048, 62, 2704, 41769, 7, 37266, 8, 198, 220, 5667, 62, 1477, 7916, 11, 4808, 796, 474, 897, 13, 21048, 62, 22602, 13, 21048, 62, 2704, 41769, 7, 1477, 7916, 8, 198, 220, 374, 782, 82, 796, 474, 897, 13, 25120, 13, 35312, 7, 81, 782, 11, 18896, 7, 293, 3080, 4008, 198, 220, 649, 62, 293, 3080, 796, 17635, 198, 220, 329, 300, 11, 374, 11, 5485, 287, 19974, 7, 293, 3080, 11, 374, 782, 82, 11, 5667, 62, 1477, 7916, 2599, 198, 220, 220, 220, 649, 62, 293, 3080, 13, 33295, 7, 259, 4399, 62, 7249, 1522, 62, 10599, 341, 7, 75, 11, 374, 11, 5485, 4008, 198, 220, 1441, 474, 897, 13, 21048, 62, 22602, 13, 21048, 62, 403, 2704, 41769, 7, 21048, 62, 4299, 11, 649, 62, 293, 3080, 8, 198 ]
2.605293
2,607
import sweeper.utils as utils import unittest from pprint import PrettyPrinter from scheduler.manager import create_schedule_plan from sweeper import Workflow pp = PrettyPrinter(indent=1) if __name__ == '__main__': unittest.main()
[ 11748, 3490, 5723, 13, 26791, 355, 3384, 4487, 198, 11748, 555, 715, 395, 198, 198, 6738, 279, 4798, 1330, 20090, 6836, 3849, 198, 6738, 6038, 18173, 13, 37153, 1330, 2251, 62, 15952, 5950, 62, 11578, 198, 6738, 3490, 5723, 1330, 5521, 11125, 198, 198, 381, 796, 20090, 6836, 3849, 7, 521, 298, 28, 16, 8, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
3.037975
79
BATCH_SIZE = 128 NUM_CLASSES = 10 EPOCHS = 20 # input image dimensions IMG_ROWS, IMG_COLS = 28, 28 # set if false if you want to use trained weights TO_TRAIN = True
[ 33, 11417, 62, 33489, 796, 13108, 198, 41359, 62, 31631, 1546, 796, 838, 198, 8905, 46, 3398, 50, 796, 1160, 198, 198, 2, 5128, 2939, 15225, 198, 3955, 38, 62, 49, 22845, 11, 8959, 38, 62, 25154, 50, 796, 2579, 11, 2579, 198, 198, 2, 900, 611, 3991, 611, 345, 765, 284, 779, 8776, 19590, 198, 10468, 62, 51, 3861, 1268, 796, 6407, 198 ]
2.609375
64
''' Calculates the 13C(a,n) cross section "Free" parameters: * partial width BGP (1/2+, neutron) * level energy (3/2+) * partial width (3/2+, neutron) * partial width (3/2+, alpha) ''' import os import sys from multiprocessing import Pool import emcee import numpy as np from scipy import stats import model ######################################## # We'll set up the sampler and get it started. nw = 4*model.nd # number of walkers = 4 * number of sampled parameters # Pick a point (theta) in parameter space around which we'll start each walker. theta0 = [1.87, 2.3689, 35000, -0.61, 3.5002, 57500, -0.67, 3.5451, 45200, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] # Each walkers needs its own starting position. p0 = np.zeros((nw, model.nd)) for i in range(nw): mu = theta0 sig = np.abs(theta0) * 0.01 p0[i, :] = stats.norm(mu, sig).rvs() # We'll store the chain in test_mcmc.h5. (See emcee Backends documentation.) backend = emcee.backends.HDFBackend('test_mcmc.h5') backend.reset(nw, model.nd) nsteps = 1000 # How many steps should each walker take? nthin = 10 # How often should the walker save a step? nprocs = 4 # How many Python processes do you want to allocate? # AZURE2 and emcee are both parallelized. We'll restrict AZURE2 to 1 thread to # simplify things. os.environ['OMP_NUM_THREADS'] = '1' # emcee allows the user to specify the way the ensemble generates proposals. moves = [(emcee.moves.DESnookerMove(), 0.8), (emcee.moves.DEMove(), 0.2)] with Pool(processes=nprocs) as pool: sampler = emcee.EnsembleSampler(nw, model.nd, model.lnP, moves=moves, pool=pool, backend=backend) state = sampler.run_mcmc(p0, nsteps, thin_by=nthin, progress=True, tune=True)
[ 7061, 6, 198, 220, 220, 220, 27131, 689, 262, 1511, 34, 7, 64, 11, 77, 8, 3272, 2665, 198, 220, 220, 220, 366, 11146, 1, 10007, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 13027, 9647, 347, 16960, 357, 16, 14, 17, 28200, 49810, 8, 220, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 1241, 2568, 357, 18, 14, 17, 28988, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 13027, 9647, 357, 18, 14, 17, 28200, 49810, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 13027, 9647, 357, 18, 14, 17, 28200, 17130, 8, 198, 7061, 6, 198, 198, 11748, 28686, 198, 11748, 25064, 198, 6738, 18540, 305, 919, 278, 1330, 19850, 198, 198, 11748, 795, 344, 68, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 629, 541, 88, 1330, 9756, 198, 198, 11748, 2746, 198, 198, 29113, 7804, 198, 2, 775, 1183, 900, 510, 262, 6072, 20053, 290, 651, 340, 2067, 13, 198, 198, 47516, 796, 604, 9, 19849, 13, 358, 1303, 1271, 286, 2513, 364, 796, 604, 1635, 1271, 286, 35846, 10007, 198, 198, 2, 12346, 257, 966, 357, 1169, 8326, 8, 287, 11507, 2272, 1088, 543, 356, 1183, 923, 1123, 2513, 263, 13, 198, 1169, 8326, 15, 796, 685, 16, 13, 5774, 11, 362, 13, 2623, 4531, 11, 3439, 830, 11, 532, 15, 13, 5333, 11, 513, 13, 4059, 17, 11, 642, 2425, 405, 11, 532, 15, 13, 3134, 11, 513, 13, 20, 36330, 11, 4153, 2167, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 352, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 11, 16, 60, 198, 2, 5501, 2513, 364, 2476, 663, 898, 3599, 2292, 13, 198, 79, 15, 796, 45941, 13, 9107, 418, 19510, 47516, 11, 2746, 13, 358, 4008, 198, 1640, 1312, 287, 2837, 7, 47516, 2599, 198, 220, 220, 220, 38779, 796, 262, 8326, 15, 198, 220, 220, 220, 43237, 796, 45941, 13, 8937, 7, 1169, 8326, 15, 8, 1635, 657, 13, 486, 198, 220, 220, 220, 279, 15, 58, 72, 11, 1058, 60, 796, 9756, 13, 27237, 7, 30300, 11, 43237, 737, 81, 14259, 3419, 198, 198, 2, 775, 1183, 3650, 262, 6333, 287, 1332, 62, 76, 11215, 66, 13, 71, 20, 13, 357, 6214, 795, 344, 68, 5157, 2412, 10314, 2014, 198, 1891, 437, 796, 795, 344, 68, 13, 1891, 2412, 13, 39, 8068, 7282, 437, 10786, 9288, 62, 76, 11215, 66, 13, 71, 20, 11537, 198, 1891, 437, 13, 42503, 7, 47516, 11, 2746, 13, 358, 8, 198, 198, 77, 20214, 796, 8576, 1303, 1374, 867, 4831, 815, 1123, 2513, 263, 1011, 30, 198, 77, 40871, 796, 838, 1303, 1374, 1690, 815, 262, 2513, 263, 3613, 257, 2239, 30, 198, 77, 1676, 6359, 796, 604, 1303, 1374, 867, 11361, 7767, 466, 345, 765, 284, 31935, 30, 198, 2, 26253, 11335, 17, 290, 795, 344, 68, 389, 1111, 10730, 1143, 13, 775, 1183, 4239, 26253, 11335, 17, 284, 352, 4704, 284, 198, 2, 30276, 1243, 13, 198, 418, 13, 268, 2268, 17816, 2662, 47, 62, 41359, 62, 4221, 15675, 50, 20520, 796, 705, 16, 6, 198, 198, 2, 795, 344, 68, 3578, 262, 2836, 284, 11986, 262, 835, 262, 34549, 18616, 11628, 13, 198, 76, 5241, 796, 47527, 368, 344, 68, 13, 76, 5241, 13, 30910, 77, 566, 263, 21774, 22784, 657, 13, 23, 828, 357, 368, 344, 68, 13, 76, 5241, 13, 39429, 659, 22784, 657, 13, 17, 15437, 198, 198, 4480, 19850, 7, 14681, 274, 28, 77, 1676, 6359, 8, 355, 5933, 25, 198, 220, 220, 220, 6072, 20053, 796, 795, 344, 68, 13, 4834, 15140, 16305, 20053, 7, 47516, 11, 2746, 13, 358, 11, 2746, 13, 18755, 47, 11, 6100, 28, 76, 5241, 11, 5933, 28, 7742, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 30203, 28, 1891, 437, 8, 198, 220, 220, 220, 1181, 796, 6072, 20053, 13, 5143, 62, 76, 11215, 66, 7, 79, 15, 11, 299, 20214, 11, 7888, 62, 1525, 28, 77, 40871, 11, 4371, 28, 17821, 11, 14009, 28, 17821, 8, 198 ]
2.461326
724
import subprocess import os import time import re runPath = os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + '/../../')
[ 11748, 850, 14681, 198, 11748, 28686, 198, 11748, 640, 198, 11748, 302, 198, 198, 5143, 15235, 796, 28686, 13, 6978, 13, 5305, 6978, 7, 418, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 397, 2777, 776, 7, 834, 7753, 834, 4008, 1343, 31051, 40720, 40720, 11537, 628 ]
2.755102
49
from wasmer import engine, wat2wasm, Store, Module, Instance from wasmer_compiler_cranelift import Compiler TEST_BYTES = wat2wasm( """ (module (memory 16) (export "memory" (memory 0))) """ )
[ 6738, 373, 647, 1330, 3113, 11, 4383, 17, 86, 8597, 11, 9363, 11, 19937, 11, 2262, 590, 198, 6738, 373, 647, 62, 5589, 5329, 62, 66, 2596, 417, 2135, 1330, 3082, 5329, 198, 198, 51, 6465, 62, 17513, 51, 1546, 796, 4383, 17, 86, 8597, 7, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 357, 21412, 198, 220, 220, 220, 220, 220, 220, 220, 357, 31673, 1467, 8, 198, 220, 220, 220, 220, 220, 220, 220, 357, 39344, 366, 31673, 1, 357, 31673, 657, 22305, 198, 220, 220, 220, 37227, 198, 8, 198 ]
2.340426
94
A[p]= max( A[i]+ A[i:j]+ f(j,p) + f(i,p) ) +f(1,p) for p in range(N):
[ 198, 198, 32, 58, 79, 22241, 3509, 7, 317, 58, 72, 48688, 317, 58, 72, 25, 73, 48688, 277, 7, 73, 11, 79, 8, 1343, 277, 7, 72, 11, 79, 8, 220, 220, 1267, 1343, 69, 7, 16, 11, 79, 8, 628, 198, 1640, 279, 287, 2837, 7, 45, 2599, 628, 220, 220, 220, 220, 628, 198 ]
1.473684
57
if __name__ == '__main__': remove_lines() print ("done")
[ 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 4781, 62, 6615, 3419, 198, 220, 220, 220, 3601, 5855, 28060, 4943, 628 ]
2.392857
28
import numpy as np from .observation import PyBulletObservationType
[ 11748, 299, 32152, 355, 45941, 198, 198, 6738, 764, 672, 3168, 341, 1330, 9485, 33481, 1616, 31310, 13208, 6030, 628 ]
3.5
20
from typing import List from plenum.server.replica_freshness_checker import FreshnessChecker from crypto.bls.bls_bft_replica import BlsBftReplica from plenum.common.config_util import getConfig from plenum.common.event_bus import InternalBus, ExternalBus from plenum.common.messages.node_messages import Checkpoint from plenum.common.stashing_router import StashingRouter from plenum.common.timer import TimerService from plenum.server.consensus.checkpoint_service import CheckpointService from plenum.server.consensus.consensus_shared_data import ConsensusSharedData from plenum.server.consensus.ordering_service import OrderingService from plenum.server.consensus.view_change_service import ViewChangeService from plenum.server.request_managers.write_request_manager import WriteRequestManager from plenum.test.testing_utils import FakeSomething class ReplicaService: """ This is a wrapper consensus-related services. Now it is intended mostly for simulation tests, however in future it can replace actual Replica in plenum. """
[ 6738, 19720, 1330, 7343, 198, 198, 6738, 458, 44709, 13, 15388, 13, 35666, 3970, 62, 48797, 1108, 62, 9122, 263, 1330, 20138, 1108, 9787, 263, 198, 198, 6738, 21473, 13, 2436, 82, 13, 2436, 82, 62, 65, 701, 62, 35666, 3970, 1330, 1086, 82, 33, 701, 39232, 3970, 198, 6738, 458, 44709, 13, 11321, 13, 11250, 62, 22602, 1330, 651, 16934, 198, 6738, 458, 44709, 13, 11321, 13, 15596, 62, 10885, 1330, 18628, 16286, 11, 34579, 16286, 198, 6738, 458, 44709, 13, 11321, 13, 37348, 1095, 13, 17440, 62, 37348, 1095, 1330, 6822, 4122, 198, 6738, 458, 44709, 13, 11321, 13, 301, 2140, 62, 472, 353, 1330, 520, 2140, 49, 39605, 198, 6738, 458, 44709, 13, 11321, 13, 45016, 1330, 5045, 263, 16177, 198, 6738, 458, 44709, 13, 15388, 13, 5936, 7314, 13, 9122, 4122, 62, 15271, 1330, 6822, 4122, 16177, 198, 6738, 458, 44709, 13, 15388, 13, 5936, 7314, 13, 5936, 7314, 62, 28710, 62, 7890, 1330, 3515, 7314, 2484, 1144, 6601, 198, 6738, 458, 44709, 13, 15388, 13, 5936, 7314, 13, 34555, 62, 15271, 1330, 8284, 278, 16177, 198, 6738, 458, 44709, 13, 15388, 13, 5936, 7314, 13, 1177, 62, 3803, 62, 15271, 1330, 3582, 19400, 16177, 198, 6738, 458, 44709, 13, 15388, 13, 25927, 62, 805, 10321, 13, 13564, 62, 25927, 62, 37153, 1330, 19430, 18453, 13511, 198, 6738, 458, 44709, 13, 9288, 13, 33407, 62, 26791, 1330, 33482, 22210, 628, 198, 4871, 18407, 3970, 16177, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 318, 257, 29908, 11529, 12, 5363, 2594, 13, 2735, 340, 318, 5292, 4632, 329, 198, 220, 220, 220, 18640, 5254, 11, 2158, 287, 2003, 340, 460, 6330, 4036, 18407, 3970, 287, 458, 44709, 13, 198, 220, 220, 220, 37227, 198 ]
3.624138
290
if __name__ == '__main__': main()
[ 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419, 198 ]
2.105263
19
''' Utilities for training TM-Glow in parallel as well as calculating the loss in parallel on different GPUs for memory purposes. Original Implementation by Zhang, Rutgers University https://medium.com/huggingface/training-larger-batches-practical-tips-on-1-gpu-multi-gpu-distributed-setups-ec88c3e51255 ===== Distributed by: Notre Dame SCAI Lab (MIT Liscense) - Associated publication: url: http://aimsciences.org//article/id/3a9f3d14-3421-4947-a45f-a9cc74edd097 doi: https://dx.doi.org/10.3934/fods.2020019 github: https://github.com/zabaras/deep-turbulence ===== ''' import threading import functools from itertools import chain from typing import Optional import torch from torch.autograd import Variable, Function import torch.cuda.comm as comm from torch.nn.parallel import DistributedDataParallel from torch.nn.parallel.data_parallel import DataParallel from torch.nn.parallel.parallel_apply import get_a_var from torch.nn.parallel.scatter_gather import gather from torch.nn.parallel._functions import ReduceAddCoalesced, Broadcast from torch._utils import ExceptionWrapper from torch.cuda._utils import _get_device_index torch_ver = torch.__version__[:3] __all__ = ['allreduce', 'DataParallelCriterion'] def allreduce(*inputs): """Cross GPU all reduce autograd operation for calculate mean and variance in SyncBN. """ return AllReduce.apply(*inputs) class DataParallelINNModel(DataParallel): """Implements data parallelism at the module level. This container parallelizes the application of the given module by splitting the input across the specified devices by chunking in the batch dimension. In the forward pass, the module is replicated on each device, and each replica handles a portion of the input. During the backwards pass, gradients from each replica are summed into the original module. Note that the outputs are not gathered, please use compatible :class:`encoding.parallel.DataParallelCriterion`. The batch size should be larger than the number of GPUs used. It should also be an integer multiple of the number of GPUs so that each chunk is the same size (so that each GPU processes the same number of samples). Args: module: module to be parallelized device_ids: CUDA devices (default: all devices) Reference: Hang Zhang, Kristin Dana, Jianping Shi, Zhongyue Zhang, Xiaogang Wang, Ambrish Tyagi, Amit Agrawal. “Context Encoding for Semantic Segmentation. *The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2018* Example:: >>> net = encoding.nn.DataParallelModel(model, device_ids=[0, 1, 2]) >>> y = net(x) """ # def gather(self, outputs, output_device): # return outputs def inn_parallel_apply(modules, inputs, kwargs_tup=None, devices=None, forward=True): r"""Applies each `module` in parallel on arguments contained in :attr:`inputs` (positional) and :attr:`kwargs_tup` (keyword) on each of :attr:`devices`. Args: modules (Module): modules to be parallelized inputs (tensor): inputs to the modules devices (list of int or torch.device): CUDA devices :attr:`modules`, :attr:`inputs`, :attr:`kwargs_tup` (if given), and :attr:`devices` (if given) should all have same length. Moreover, each element of :attr:`inputs` can either be a single object as the only argument to a module, or a collection of positional arguments. """ assert len(modules) == len(inputs) if kwargs_tup is not None: assert len(modules) == len(kwargs_tup) else: kwargs_tup = ({},) * len(modules) if devices is not None: assert len(modules) == len(devices) else: devices = [None] * len(modules) devices = list(map(lambda x: _get_device_index(x, True), devices)) lock = threading.Lock() results = {} grad_enabled = torch.is_grad_enabled() # Start thread for each GPU worker # Distribute scattered inputs and arguements to each GPU if len(modules) > 1: threads = [threading.Thread(target=_worker, args=(i, module, input, kwargs, device)) for i, (module, input, kwargs, device) in enumerate(zip(modules, inputs, kwargs_tup, devices))] for thread in threads: thread.start() for thread in threads: thread.join() else: _worker(0, modules[0], inputs[0], kwargs_tup[0], devices[0]) outputs = [] for i in range(len(inputs)): output = results[i] if isinstance(output, ExceptionWrapper): output.reraise() outputs.append(output) return outputs class DataParallelCriterion(DataParallel): """ Calculate loss in multiple-GPUs, which balance the memory usage. The targets are splitted across the specified devices by chunking in the batch dimension. Reference: Hang Zhang, Kristin Dana, Jianping Shi, Zhongyue Zhang, Xiaogang Wang, Ambrish Tyagi, Amit Agrawal. “Context Encoding for Semantic Segmentation. *The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2018* Example:: >>> net = encoding.nn.DataParallelModel(model, device_ids=[0, 1, 2]) >>> criterion = encoding.nn.DataParallelCriterion(criterion, device_ids=[0, 1, 2]) >>> y = net(x) >>> loss = criterion(y, target) """ def execute_replication_callbacks(modules): """ Execute an replication callback `__data_parallel_replicate__` on each module created by original replication. The callback will be invoked with arguments `__data_parallel_replicate__(ctx, copy_id)` Note that, as all modules are isomorphism, we assign each sub-module with a context (shared among multiple copies of this module on different devices). Through this context, different copies can share some information. We guarantee that the callback on the master copy (the first copy) will be called ahead of calling the callback of any slave copies. """ master_copy = modules[0] nr_modules = len(list(master_copy.modules())) ctxs = [CallbackContext() for _ in range(nr_modules)] for i, module in enumerate(modules): for j, m in enumerate(module.modules()): if hasattr(m, '__data_parallel_replicate__'): m.__data_parallel_replicate__(ctxs[j], i)
[ 7061, 6, 198, 18274, 2410, 329, 3047, 21232, 12, 38, 9319, 287, 10730, 355, 880, 355, 26019, 198, 1169, 2994, 287, 10730, 319, 1180, 32516, 329, 4088, 4959, 13, 198, 198, 20556, 46333, 416, 19439, 11, 30595, 2059, 198, 5450, 1378, 24132, 13, 785, 14, 71, 1018, 2667, 2550, 14, 34409, 12, 15521, 263, 12, 8664, 2052, 12, 29152, 605, 12, 41315, 12, 261, 12, 16, 12, 46999, 12, 41684, 12, 46999, 12, 17080, 6169, 12, 2617, 4739, 12, 721, 3459, 66, 18, 68, 25836, 2816, 198, 1421, 28, 198, 20344, 6169, 416, 25, 23382, 20377, 6374, 20185, 3498, 357, 36393, 406, 2304, 1072, 8, 198, 12, 10575, 9207, 25, 198, 6371, 25, 2638, 1378, 1385, 36216, 3007, 13, 2398, 1003, 20205, 14, 312, 14, 18, 64, 24, 69, 18, 67, 1415, 12, 2682, 2481, 12, 2920, 2857, 12, 64, 2231, 69, 12, 64, 24, 535, 4524, 6048, 2931, 22, 198, 34023, 25, 3740, 1378, 34350, 13, 34023, 13, 2398, 14, 940, 13, 2670, 2682, 14, 69, 12978, 13, 1238, 2167, 1129, 198, 12567, 25, 3740, 1378, 12567, 13, 785, 14, 89, 397, 283, 292, 14, 22089, 12, 83, 5945, 32401, 198, 1421, 28, 198, 7061, 6, 198, 11748, 4704, 278, 198, 11748, 1257, 310, 10141, 198, 6738, 340, 861, 10141, 1330, 6333, 198, 6738, 19720, 1330, 32233, 198, 11748, 28034, 198, 6738, 28034, 13, 2306, 519, 6335, 1330, 35748, 11, 15553, 198, 11748, 28034, 13, 66, 15339, 13, 9503, 355, 725, 198, 6738, 28034, 13, 20471, 13, 1845, 29363, 1330, 4307, 6169, 6601, 10044, 29363, 198, 6738, 28034, 13, 20471, 13, 1845, 29363, 13, 7890, 62, 1845, 29363, 1330, 6060, 10044, 29363, 198, 6738, 28034, 13, 20471, 13, 1845, 29363, 13, 1845, 29363, 62, 39014, 1330, 651, 62, 64, 62, 7785, 198, 6738, 28034, 13, 20471, 13, 1845, 29363, 13, 1416, 1436, 62, 70, 1032, 1330, 6431, 198, 6738, 28034, 13, 20471, 13, 1845, 29363, 13557, 12543, 2733, 1330, 44048, 4550, 7222, 2040, 771, 11, 44244, 198, 6738, 28034, 13557, 26791, 1330, 35528, 36918, 2848, 198, 6738, 28034, 13, 66, 15339, 13557, 26791, 1330, 4808, 1136, 62, 25202, 62, 9630, 198, 198, 13165, 354, 62, 332, 796, 28034, 13, 834, 9641, 834, 58, 25, 18, 60, 198, 198, 834, 439, 834, 796, 37250, 439, 445, 7234, 3256, 705, 6601, 10044, 29363, 18559, 28019, 20520, 198, 198, 4299, 477, 445, 7234, 46491, 15414, 82, 2599, 198, 220, 220, 220, 37227, 21544, 11362, 477, 4646, 1960, 519, 6335, 4905, 329, 15284, 1612, 290, 198, 220, 220, 220, 24198, 287, 35908, 15766, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 1439, 7738, 7234, 13, 39014, 46491, 15414, 82, 8, 628, 198, 4871, 6060, 10044, 29363, 1268, 45, 17633, 7, 6601, 10044, 29363, 2599, 198, 220, 220, 220, 37227, 3546, 1154, 902, 1366, 10730, 1042, 379, 262, 8265, 1241, 13, 198, 220, 220, 220, 770, 9290, 10730, 4340, 262, 3586, 286, 262, 1813, 8265, 416, 198, 220, 220, 220, 26021, 262, 5128, 1973, 262, 7368, 4410, 416, 16058, 278, 287, 262, 198, 220, 220, 220, 15458, 15793, 13, 198, 220, 220, 220, 554, 262, 2651, 1208, 11, 262, 8265, 318, 35108, 319, 1123, 3335, 11, 198, 220, 220, 220, 290, 1123, 30069, 17105, 257, 6903, 286, 262, 5128, 13, 5856, 262, 16196, 1208, 11, 198, 220, 220, 220, 3915, 2334, 422, 1123, 30069, 389, 32794, 656, 262, 2656, 8265, 13, 198, 220, 220, 220, 5740, 326, 262, 23862, 389, 407, 9272, 11, 3387, 779, 11670, 198, 220, 220, 220, 1058, 4871, 25, 63, 12685, 7656, 13, 1845, 29363, 13, 6601, 10044, 29363, 18559, 28019, 44646, 198, 220, 220, 220, 383, 15458, 2546, 815, 307, 4025, 621, 262, 1271, 286, 32516, 973, 13, 632, 815, 198, 220, 220, 220, 635, 307, 281, 18253, 3294, 286, 262, 1271, 286, 32516, 523, 326, 1123, 16058, 318, 198, 220, 220, 220, 262, 976, 2546, 357, 568, 326, 1123, 11362, 7767, 262, 976, 1271, 286, 8405, 737, 198, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 8265, 25, 8265, 284, 307, 10730, 1143, 198, 220, 220, 220, 220, 220, 220, 220, 3335, 62, 2340, 25, 29369, 5631, 4410, 357, 12286, 25, 477, 4410, 8, 198, 220, 220, 220, 20984, 25, 198, 220, 220, 220, 220, 220, 220, 220, 24300, 19439, 11, 14912, 259, 22937, 11, 40922, 13886, 16380, 11, 10511, 506, 88, 518, 19439, 11, 22450, 519, 648, 15233, 11, 1703, 1671, 680, 7039, 18013, 11, 198, 220, 220, 220, 220, 220, 220, 220, 48148, 2449, 1831, 282, 13, 564, 250, 21947, 14711, 7656, 329, 12449, 5109, 1001, 5154, 341, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 464, 40552, 8785, 319, 13851, 19009, 290, 23939, 31517, 653, 357, 33538, 4805, 8, 2864, 9, 198, 220, 220, 220, 17934, 3712, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 2010, 796, 21004, 13, 20471, 13, 6601, 10044, 29363, 17633, 7, 19849, 11, 3335, 62, 2340, 41888, 15, 11, 352, 11, 362, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 331, 796, 2010, 7, 87, 8, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 1303, 825, 6431, 7, 944, 11, 23862, 11, 5072, 62, 25202, 2599, 198, 220, 220, 220, 1303, 220, 220, 220, 220, 1441, 23862, 198, 198, 4299, 3527, 62, 1845, 29363, 62, 39014, 7, 18170, 11, 17311, 11, 479, 86, 22046, 62, 83, 929, 28, 14202, 11, 4410, 28, 14202, 11, 2651, 28, 17821, 2599, 198, 220, 220, 220, 374, 37811, 4677, 13508, 1123, 4600, 21412, 63, 287, 10730, 319, 7159, 198, 220, 220, 220, 7763, 287, 1058, 35226, 25, 63, 15414, 82, 63, 357, 1930, 1859, 8, 290, 1058, 35226, 25, 63, 46265, 22046, 62, 83, 929, 63, 357, 2539, 4775, 8, 198, 220, 220, 220, 319, 1123, 286, 1058, 35226, 25, 63, 42034, 44646, 198, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 13103, 357, 26796, 2599, 13103, 284, 307, 10730, 1143, 198, 220, 220, 220, 220, 220, 220, 220, 17311, 357, 83, 22854, 2599, 17311, 284, 262, 13103, 198, 220, 220, 220, 220, 220, 220, 220, 4410, 357, 4868, 286, 493, 393, 28034, 13, 25202, 2599, 29369, 5631, 4410, 198, 220, 220, 220, 1058, 35226, 25, 63, 18170, 47671, 1058, 35226, 25, 63, 15414, 82, 47671, 1058, 35226, 25, 63, 46265, 22046, 62, 83, 929, 63, 357, 361, 1813, 828, 290, 198, 220, 220, 220, 1058, 35226, 25, 63, 42034, 63, 357, 361, 1813, 8, 815, 477, 423, 976, 4129, 13, 10968, 11, 1123, 198, 220, 220, 220, 5002, 286, 1058, 35226, 25, 63, 15414, 82, 63, 460, 2035, 307, 257, 2060, 2134, 355, 262, 691, 4578, 198, 220, 220, 220, 284, 257, 8265, 11, 393, 257, 4947, 286, 45203, 7159, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6818, 18896, 7, 18170, 8, 6624, 18896, 7, 15414, 82, 8, 198, 220, 220, 220, 611, 479, 86, 22046, 62, 83, 929, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 6818, 18896, 7, 18170, 8, 6624, 18896, 7, 46265, 22046, 62, 83, 929, 8, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 479, 86, 22046, 62, 83, 929, 796, 37913, 5512, 8, 1635, 18896, 7, 18170, 8, 198, 220, 220, 220, 611, 4410, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 6818, 18896, 7, 18170, 8, 6624, 18896, 7, 42034, 8, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4410, 796, 685, 14202, 60, 1635, 18896, 7, 18170, 8, 198, 220, 220, 220, 4410, 796, 1351, 7, 8899, 7, 50033, 2124, 25, 4808, 1136, 62, 25202, 62, 9630, 7, 87, 11, 6407, 828, 4410, 4008, 198, 220, 220, 220, 5793, 796, 4704, 278, 13, 25392, 3419, 198, 220, 220, 220, 2482, 796, 23884, 198, 220, 220, 220, 3915, 62, 25616, 796, 28034, 13, 271, 62, 9744, 62, 25616, 3419, 198, 220, 220, 220, 1303, 7253, 4704, 329, 1123, 11362, 8383, 198, 220, 220, 220, 1303, 4307, 4163, 16830, 17311, 290, 1822, 84, 3196, 284, 1123, 11362, 198, 220, 220, 220, 611, 18896, 7, 18170, 8, 1875, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 14390, 796, 685, 16663, 278, 13, 16818, 7, 16793, 28, 62, 28816, 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, 26498, 16193, 72, 11, 8265, 11, 5128, 11, 479, 86, 22046, 11, 3335, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 11, 357, 21412, 11, 5128, 11, 479, 86, 22046, 11, 3335, 8, 287, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 27056, 378, 7, 13344, 7, 18170, 11, 17311, 11, 479, 86, 22046, 62, 83, 929, 11, 4410, 4008, 60, 628, 220, 220, 220, 220, 220, 220, 220, 329, 4704, 287, 14390, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4704, 13, 9688, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 329, 4704, 287, 14390, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4704, 13, 22179, 3419, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 28816, 7, 15, 11, 13103, 58, 15, 4357, 17311, 58, 15, 4357, 479, 86, 22046, 62, 83, 929, 58, 15, 4357, 4410, 58, 15, 12962, 628, 220, 220, 220, 23862, 796, 17635, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 11925, 7, 15414, 82, 8, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 5072, 796, 2482, 58, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 22915, 11, 35528, 36918, 2848, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5072, 13, 24420, 786, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 23862, 13, 33295, 7, 22915, 8, 198, 220, 220, 220, 1441, 23862, 198, 198, 4871, 6060, 10044, 29363, 18559, 28019, 7, 6601, 10044, 29363, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 27131, 378, 2994, 287, 3294, 12, 33346, 82, 11, 543, 5236, 262, 4088, 8748, 13, 198, 220, 220, 220, 383, 6670, 389, 4328, 2175, 1973, 262, 7368, 4410, 416, 16058, 278, 287, 198, 220, 220, 220, 262, 15458, 15793, 13, 198, 220, 220, 220, 20984, 25, 198, 220, 220, 220, 220, 220, 220, 220, 24300, 19439, 11, 14912, 259, 22937, 11, 40922, 13886, 16380, 11, 10511, 506, 88, 518, 19439, 11, 22450, 519, 648, 15233, 11, 1703, 1671, 680, 7039, 18013, 11, 198, 220, 220, 220, 220, 220, 220, 220, 48148, 2449, 1831, 282, 13, 564, 250, 21947, 14711, 7656, 329, 12449, 5109, 1001, 5154, 341, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 464, 40552, 8785, 319, 13851, 19009, 290, 23939, 31517, 653, 357, 33538, 4805, 8, 2864, 9, 198, 220, 220, 220, 17934, 3712, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 2010, 796, 21004, 13, 20471, 13, 6601, 10044, 29363, 17633, 7, 19849, 11, 3335, 62, 2340, 41888, 15, 11, 352, 11, 362, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 34054, 796, 21004, 13, 20471, 13, 6601, 10044, 29363, 18559, 28019, 7, 22213, 28019, 11, 3335, 62, 2340, 41888, 15, 11, 352, 11, 362, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 331, 796, 2010, 7, 87, 8, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 2994, 796, 34054, 7, 88, 11, 2496, 8, 198, 220, 220, 220, 37227, 628, 198, 198, 4299, 12260, 62, 35666, 3299, 62, 13345, 10146, 7, 18170, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 8393, 1133, 281, 30330, 23838, 4600, 834, 7890, 62, 1845, 29363, 62, 35666, 5344, 834, 63, 319, 1123, 8265, 2727, 198, 220, 220, 220, 416, 2656, 30330, 13, 198, 220, 220, 220, 383, 23838, 481, 307, 24399, 351, 7159, 4600, 834, 7890, 62, 1845, 29363, 62, 35666, 5344, 834, 7, 49464, 11, 4866, 62, 312, 8, 63, 198, 220, 220, 220, 5740, 326, 11, 355, 477, 13103, 389, 318, 25831, 1042, 11, 356, 8333, 1123, 850, 12, 21412, 351, 257, 4732, 198, 220, 220, 220, 357, 28710, 1871, 3294, 9088, 286, 428, 8265, 319, 1180, 4410, 737, 198, 220, 220, 220, 9561, 428, 4732, 11, 1180, 9088, 460, 2648, 617, 1321, 13, 198, 220, 220, 220, 775, 9149, 326, 262, 23838, 319, 262, 4958, 4866, 357, 1169, 717, 4866, 8, 481, 307, 1444, 4058, 198, 220, 220, 220, 286, 4585, 262, 23838, 286, 597, 11778, 9088, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4958, 62, 30073, 796, 13103, 58, 15, 60, 198, 220, 220, 220, 299, 81, 62, 18170, 796, 18896, 7, 4868, 7, 9866, 62, 30073, 13, 18170, 3419, 4008, 198, 220, 220, 220, 269, 17602, 82, 796, 685, 47258, 21947, 3419, 329, 4808, 287, 2837, 7, 48624, 62, 18170, 15437, 628, 220, 220, 220, 329, 1312, 11, 8265, 287, 27056, 378, 7, 18170, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 329, 474, 11, 285, 287, 27056, 378, 7, 21412, 13, 18170, 3419, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 468, 35226, 7, 76, 11, 705, 834, 7890, 62, 1845, 29363, 62, 35666, 5344, 834, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 285, 13, 834, 7890, 62, 1845, 29363, 62, 35666, 5344, 834, 7, 310, 34223, 58, 73, 4357, 1312, 8 ]
2.828434
2,279
import requests #possible creds generated by level #one of them is valid for one of your web app from credentials import creds #url='http://YOUR_INTERNAL_IP/login' urls=['http://10.138.0.58/login', 'http://10.138.0.59/login','http://10.138.0.60/login'] for url in urls: for u in creds: #prepare data for post request payload={'username':u,'password':creds[u]} #send username and password through post method to web app url post=requests.Session().post(url, data=payload) #check if respond text contains invalid credentails if 'Invalid credentials' not in post.text: #print valid username and password print(u+' '+creds[u]+' ' + url )
[ 11748, 7007, 198, 2, 79, 4733, 2600, 82, 7560, 416, 1241, 198, 2, 505, 286, 606, 318, 4938, 329, 530, 286, 534, 3992, 598, 220, 220, 198, 6738, 18031, 1330, 2600, 82, 628, 628, 198, 198, 2, 6371, 11639, 4023, 1378, 56, 11698, 62, 1268, 31800, 1847, 62, 4061, 14, 38235, 6, 198, 6371, 82, 28, 17816, 4023, 1378, 940, 13, 20107, 13, 15, 13, 3365, 14, 38235, 3256, 705, 4023, 1378, 940, 13, 20107, 13, 15, 13, 3270, 14, 38235, 41707, 4023, 1378, 940, 13, 20107, 13, 15, 13, 1899, 14, 38235, 20520, 628, 198, 1640, 19016, 287, 2956, 7278, 25, 198, 197, 1640, 334, 287, 2600, 82, 25, 198, 197, 197, 2, 46012, 533, 1366, 329, 1281, 2581, 198, 197, 197, 15577, 2220, 34758, 6, 29460, 10354, 84, 4032, 28712, 10354, 66, 445, 82, 58, 84, 48999, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 21280, 20579, 290, 9206, 832, 1281, 2446, 284, 3992, 598, 19016, 198, 197, 197, 7353, 28, 8897, 3558, 13, 36044, 22446, 7353, 7, 6371, 11, 1366, 28, 15577, 2220, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 9122, 611, 3031, 2420, 4909, 12515, 2600, 298, 1768, 198, 197, 197, 361, 705, 44651, 18031, 6, 407, 287, 220, 1281, 13, 5239, 25, 198, 197, 197, 197, 2, 4798, 4938, 20579, 290, 9206, 198, 197, 197, 197, 4798, 7, 84, 10, 6, 705, 10, 66, 445, 82, 58, 84, 48688, 6, 705, 1343, 19016, 1267, 628 ]
2.661538
260
from collections import Counter text = "hubba bubba" # def get_char_count(text): # letters = {} # for letter in text: # letters[letter] = text.count(letter) # hidden loop in count # return letters print(get_char_count(text)) count = Counter(text) print(count) print(count.most_common())
[ 6738, 17268, 1330, 15034, 198, 5239, 796, 366, 40140, 7012, 10015, 7012, 1, 198, 2, 825, 651, 62, 10641, 62, 9127, 7, 5239, 2599, 198, 2, 220, 220, 220, 220, 7475, 796, 23884, 198, 220, 198, 2, 220, 220, 220, 220, 329, 3850, 287, 2420, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 7475, 58, 9291, 60, 796, 2420, 13, 9127, 7, 9291, 8, 220, 1303, 7104, 9052, 287, 954, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 2, 220, 220, 220, 220, 1441, 7475, 198, 220, 198, 4798, 7, 1136, 62, 10641, 62, 9127, 7, 5239, 4008, 198, 198, 9127, 796, 15034, 7, 5239, 8, 198, 4798, 7, 9127, 8, 198, 4798, 7, 9127, 13, 1712, 62, 11321, 28955, 198 ]
2.507692
130
# Copyright (c) 2018 Forschungszentrum Juelich GmbH # Author: Yann Leprince <[email protected]> # # This software is made available under the MIT licence, see LICENCE.txt. import pathlib import pytest from neuroglancer_scripts.file_accessor import FileAccessor from neuroglancer_scripts.accessor import ( DataAccessError, ) @pytest.mark.parametrize("flat", [False, True]) @pytest.mark.parametrize("gzip", [False, True])
[ 2, 15069, 357, 66, 8, 2864, 27325, 354, 2150, 82, 89, 298, 6582, 449, 2731, 488, 402, 2022, 39, 198, 2, 6434, 25, 575, 1236, 42957, 81, 924, 1279, 88, 13, 293, 1050, 924, 31, 69, 89, 12, 73, 2731, 488, 13, 2934, 29, 198, 2, 198, 2, 770, 3788, 318, 925, 1695, 739, 262, 17168, 17098, 11, 766, 38559, 18310, 13, 14116, 13, 198, 198, 11748, 3108, 8019, 198, 198, 11748, 12972, 9288, 198, 198, 6738, 7669, 4743, 8250, 62, 46521, 13, 7753, 62, 15526, 273, 1330, 9220, 15457, 273, 198, 6738, 7669, 4743, 8250, 62, 46521, 13, 15526, 273, 1330, 357, 198, 220, 220, 220, 6060, 15457, 12331, 11, 198, 8, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 38568, 1600, 685, 25101, 11, 6407, 12962, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 70, 13344, 1600, 685, 25101, 11, 6407, 12962, 628, 628 ]
2.832258
155
// シェーダー空手のやつ //# https://thebookofshaders.com/05/kynd.png #define BPM 90.0 const float PI = acos(-1.0); const float TAU = PI * 2.0; /* sound common */ float timeToBeat(float t) {return t / 60.0 * BPM;} float beatToTime(float b) {return b / BPM * 60.0;} float sine(float phase) { return sin(TAU * phase); } float pitch(float scale) { return 440.0 * pow(2.0, scale / 12.0); } vec2 mainSound(float time) { float bpm = timeToBeat(time); float tempo = sine((mod(bpm, 4.0) >= 1.0 ? 440.0 : 880.0) * time) * exp(-1e2 * fract(bpm)); float sound = 0.0; //#float tone = sin( 6.2831 * 440.0 * time ); //#float env = fract(-bpm); float f = fract(bpm); float s = sin(PI * bpm / 2.0); float tone = 0.0; float env = 0.0; //tone = sine(beatToTime(bpm) * pitch(0.0)); tone = sine(beatToTime(bpm) * 64.0); env = 1.0 - pow(abs(s), 0.5); //env = 1.0 - pow(abs(s), 1.0); //env = 1.0 - pow(abs(s), 3.5); //env = pow(cos(PI * s / 2.0), 0.5); //env = pow(cos(PI * s / 2.0), 1.0); //env = pow(cos(PI * s / 2.0), 3.5); //env = 1.0 - pow(abs(sin(PI * s / 2.0)), 0.5); //env = 1.0 - pow(abs(sin(PI * s / 2.0)), 1.0); //env = 1.0 - pow(abs(sin(PI * s / 2.0)), 3.5); //env = pow(min(cos(PI * s / 2.0), 1.0 - abs(s)), 0.5); //env = pow(min(cos(PI * s / 2.0), 1.0 - abs(s)), 1.0); //env = pow(min(cos(PI * s / 2.0), 1.0 - abs(s)), 3.5); //env = 1.0 - pow(max(0.0, abs(s) * 2.0 - 1.0), 0.5); //env = 1.0 - pow(max(0.0, abs(s) * 2.0 - 1.0), 1.0); //env = 1.0 - pow(max(0.0, abs(s) * 2.0 - 1.0), 3.5); float w = smoothstep(1.0, -1.0, tan(bpm * PI)); env = sin(w * TAU); sound += tone * env; sound += tempo; //#if (abs(sound) > 1.0) sound /= abs(sound); return vec2(sound); }
[ 1003, 220, 15661, 24806, 12045, 222, 6312, 163, 102, 118, 33699, 233, 5641, 1792, 226, 2515, 97, 198, 1003, 2, 3740, 1378, 1169, 2070, 1659, 1477, 9972, 13, 785, 14, 2713, 14, 2584, 358, 13, 11134, 198, 198, 2, 13086, 347, 5868, 4101, 13, 15, 198, 9979, 12178, 30434, 796, 936, 418, 32590, 16, 13, 15, 1776, 198, 9979, 12178, 21664, 52, 796, 30434, 1635, 362, 13, 15, 26, 198, 198, 15211, 2128, 2219, 9466, 198, 22468, 640, 2514, 34979, 7, 22468, 256, 8, 1391, 7783, 256, 1220, 3126, 13, 15, 1635, 347, 5868, 46956, 198, 22468, 4405, 2514, 7575, 7, 22468, 275, 8, 1391, 7783, 275, 1220, 347, 5868, 1635, 3126, 13, 15, 46956, 198, 198, 22468, 264, 500, 7, 22468, 7108, 8, 1391, 198, 220, 1441, 7813, 7, 5603, 52, 1635, 7108, 1776, 198, 92, 628, 198, 22468, 7078, 7, 22468, 5046, 8, 1391, 198, 220, 1441, 33879, 13, 15, 1635, 7182, 7, 17, 13, 15, 11, 5046, 1220, 1105, 13, 15, 1776, 198, 92, 628, 198, 198, 35138, 17, 1388, 21369, 7, 22468, 640, 8, 1391, 198, 220, 12178, 275, 4426, 796, 640, 2514, 34979, 7, 2435, 1776, 198, 220, 12178, 28691, 796, 264, 500, 19510, 4666, 7, 65, 4426, 11, 604, 13, 15, 8, 18189, 352, 13, 15, 5633, 33879, 13, 15, 1058, 807, 1795, 13, 15, 8, 1635, 640, 8, 1635, 1033, 32590, 16, 68, 17, 1635, 12999, 7, 65, 4426, 18125, 198, 220, 220, 198, 220, 12178, 2128, 796, 657, 13, 15, 26, 198, 220, 3373, 2, 22468, 8216, 796, 7813, 7, 718, 13, 2078, 3132, 1635, 33879, 13, 15, 1635, 640, 5619, 198, 220, 3373, 2, 22468, 17365, 796, 12999, 32590, 65, 4426, 1776, 198, 220, 12178, 277, 796, 12999, 7, 65, 4426, 1776, 198, 220, 12178, 264, 796, 7813, 7, 11901, 1635, 275, 4426, 1220, 362, 13, 15, 1776, 198, 220, 220, 198, 220, 12178, 8216, 796, 657, 13, 15, 26, 198, 220, 12178, 17365, 796, 657, 13, 15, 26, 198, 220, 220, 198, 220, 3373, 41527, 796, 264, 500, 7, 12945, 2514, 7575, 7, 65, 4426, 8, 1635, 7078, 7, 15, 13, 15, 18125, 198, 220, 8216, 796, 264, 500, 7, 12945, 2514, 7575, 7, 65, 4426, 8, 1635, 5598, 13, 15, 1776, 198, 220, 220, 198, 220, 220, 198, 220, 17365, 796, 352, 13, 15, 532, 7182, 7, 8937, 7, 82, 828, 657, 13, 20, 1776, 198, 220, 3373, 24330, 796, 352, 13, 15, 532, 7182, 7, 8937, 7, 82, 828, 352, 13, 15, 1776, 198, 220, 3373, 24330, 796, 352, 13, 15, 532, 7182, 7, 8937, 7, 82, 828, 513, 13, 20, 1776, 198, 220, 220, 198, 220, 3373, 24330, 796, 7182, 7, 6966, 7, 11901, 1635, 264, 1220, 362, 13, 15, 828, 657, 13, 20, 1776, 198, 220, 3373, 24330, 796, 7182, 7, 6966, 7, 11901, 1635, 264, 1220, 362, 13, 15, 828, 352, 13, 15, 1776, 198, 220, 3373, 24330, 796, 7182, 7, 6966, 7, 11901, 1635, 264, 1220, 362, 13, 15, 828, 513, 13, 20, 1776, 198, 220, 220, 198, 220, 3373, 24330, 796, 352, 13, 15, 532, 7182, 7, 8937, 7, 31369, 7, 11901, 1635, 264, 1220, 362, 13, 15, 36911, 657, 13, 20, 1776, 198, 220, 3373, 24330, 796, 352, 13, 15, 532, 7182, 7, 8937, 7, 31369, 7, 11901, 1635, 264, 1220, 362, 13, 15, 36911, 352, 13, 15, 1776, 198, 220, 3373, 24330, 796, 352, 13, 15, 532, 7182, 7, 8937, 7, 31369, 7, 11901, 1635, 264, 1220, 362, 13, 15, 36911, 513, 13, 20, 1776, 198, 220, 220, 198, 220, 3373, 24330, 796, 7182, 7, 1084, 7, 6966, 7, 11901, 1635, 264, 1220, 362, 13, 15, 828, 352, 13, 15, 532, 2352, 7, 82, 36911, 657, 13, 20, 1776, 198, 220, 3373, 24330, 796, 7182, 7, 1084, 7, 6966, 7, 11901, 1635, 264, 1220, 362, 13, 15, 828, 352, 13, 15, 532, 2352, 7, 82, 36911, 352, 13, 15, 1776, 198, 220, 3373, 24330, 796, 7182, 7, 1084, 7, 6966, 7, 11901, 1635, 264, 1220, 362, 13, 15, 828, 352, 13, 15, 532, 2352, 7, 82, 36911, 513, 13, 20, 1776, 198, 220, 220, 198, 220, 3373, 24330, 796, 352, 13, 15, 532, 7182, 7, 9806, 7, 15, 13, 15, 11, 2352, 7, 82, 8, 1635, 362, 13, 15, 532, 352, 13, 15, 828, 657, 13, 20, 1776, 198, 220, 3373, 24330, 796, 352, 13, 15, 532, 7182, 7, 9806, 7, 15, 13, 15, 11, 2352, 7, 82, 8, 1635, 362, 13, 15, 532, 352, 13, 15, 828, 352, 13, 15, 1776, 198, 220, 3373, 24330, 796, 352, 13, 15, 532, 7182, 7, 9806, 7, 15, 13, 15, 11, 2352, 7, 82, 8, 1635, 362, 13, 15, 532, 352, 13, 15, 828, 513, 13, 20, 1776, 198, 220, 220, 198, 220, 220, 198, 220, 12178, 266, 796, 7209, 9662, 7, 16, 13, 15, 11, 532, 16, 13, 15, 11, 25706, 7, 65, 4426, 1635, 30434, 18125, 198, 220, 17365, 796, 7813, 7, 86, 1635, 21664, 52, 1776, 198, 220, 220, 198, 220, 2128, 15853, 8216, 1635, 17365, 26, 198, 220, 2128, 15853, 28691, 26, 198, 220, 220, 198, 220, 220, 198, 220, 3373, 2, 361, 357, 8937, 7, 23661, 8, 1875, 352, 13, 15, 8, 2128, 1220, 28, 2352, 7, 23661, 1776, 198, 220, 1441, 43030, 17, 7, 23661, 1776, 198, 92, 628, 198 ]
1.994337
883
"""Handles incoming ebs requests, invokes methods, returns responses.""" import json from moto.core.responses import BaseResponse from .models import ebs_backends class EBSResponse(BaseResponse): """Handler for EBS requests and responses.""" @property def ebs_backend(self): """Return backend instance specific for this region.""" return ebs_backends[self.region] def start_snapshot(self): """ The following parameters are not yet implemented: ParentSnapshotId, ClientToken, Encrypted, KmsKeyArn, Timeout """ params = json.loads(self.body) volume_size = params.get("VolumeSize") tags = params.get("Tags") description = params.get("Description") snapshot = self.ebs_backend.start_snapshot( volume_size=volume_size, tags=tags, description=description, ) return 200, {}, json.dumps(snapshot.to_json()) def complete_snapshot(self, request, full_url, headers): """ The following parameters are not yet supported: ChangedBlocksCount, Checksum, ChecksumAlgorithm, ChecksumAggregationMethod """ self.setup_class(request, full_url, headers) snapshot_id = full_url.split("/")[-1] status = self.ebs_backend.complete_snapshot(snapshot_id=snapshot_id) return 200, {}, json.dumps(status) def put_snapshot_block(self, full_url, headers): """ The following parameters are currently not taken into account: DataLength, Progress. The Checksum and ChecksumAlgorithm are taken at face-value, but no validation takes place. """ snapshot_id = full_url.split("/")[-3] block_index = full_url.split("/")[-1] block_data = self.body headers = {k.lower(): v for k, v in headers.items()} checksum = headers.get("x-amz-checksum") checksum_algorithm = headers.get("x-amz-checksum-algorithm") data_length = headers.get("x-amz-data-length") checksum, checksum_algorithm = self.ebs_backend.put_snapshot_block( snapshot_id=snapshot_id, block_index=block_index, block_data=block_data, checksum=checksum, checksum_algorithm=checksum_algorithm, data_length=data_length, ) return ( 200, { "x-amz-Checksum": checksum, "x-amz-Checksum-Algorithm": checksum_algorithm, }, "{}", ) def list_snapshot_blocks(self): """ The following parameters are not yet implemented: NextToken, MaxResults, StartingBlockIndex """ snapshot_id = self.path.split("/")[-2] snapshot = self.ebs_backend.list_snapshot_blocks( snapshot_id=snapshot_id, ) blocks = [ {"BlockIndex": idx, "BlockToken": b.block_token} for idx, b in snapshot.blocks.items() ] return ( 200, {}, json.dumps( dict( Blocks=blocks, VolumeSize=snapshot.volume_size, BlockSize=snapshot.block_size, ) ), )
[ 37811, 12885, 829, 15619, 304, 1443, 7007, 11, 800, 3369, 5050, 11, 5860, 9109, 526, 15931, 198, 11748, 33918, 198, 198, 6738, 285, 2069, 13, 7295, 13, 16733, 274, 1330, 7308, 31077, 198, 6738, 764, 27530, 1330, 304, 1443, 62, 1891, 2412, 628, 198, 4871, 412, 4462, 31077, 7, 14881, 31077, 2599, 198, 220, 220, 220, 37227, 25060, 329, 412, 4462, 7007, 290, 9109, 526, 15931, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 304, 1443, 62, 1891, 437, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 30203, 4554, 2176, 329, 428, 3814, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 304, 1443, 62, 1891, 2412, 58, 944, 13, 36996, 60, 628, 220, 220, 220, 825, 923, 62, 45380, 9442, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 383, 1708, 10007, 389, 407, 1865, 9177, 25, 16774, 43826, 9442, 7390, 11, 20985, 30642, 11, 14711, 15109, 11, 509, 907, 9218, 3163, 77, 11, 3862, 448, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 42287, 796, 33918, 13, 46030, 7, 944, 13, 2618, 8, 198, 220, 220, 220, 220, 220, 220, 220, 6115, 62, 7857, 796, 42287, 13, 1136, 7203, 31715, 10699, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 15940, 796, 42287, 13, 1136, 7203, 36142, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 6764, 796, 42287, 13, 1136, 7203, 11828, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 27479, 796, 2116, 13, 68, 1443, 62, 1891, 437, 13, 9688, 62, 45380, 9442, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6115, 62, 7857, 28, 29048, 62, 7857, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15940, 28, 31499, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6764, 28, 11213, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 939, 11, 1391, 5512, 33918, 13, 67, 8142, 7, 45380, 9442, 13, 1462, 62, 17752, 28955, 628, 220, 220, 220, 825, 1844, 62, 45380, 9442, 7, 944, 11, 2581, 11, 1336, 62, 6371, 11, 24697, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 383, 1708, 10007, 389, 407, 1865, 4855, 25, 32068, 45356, 12332, 11, 47719, 388, 11, 47719, 388, 2348, 42289, 11, 47719, 388, 46384, 43068, 17410, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 40406, 62, 4871, 7, 25927, 11, 1336, 62, 6371, 11, 24697, 8, 198, 220, 220, 220, 220, 220, 220, 220, 27479, 62, 312, 796, 1336, 62, 6371, 13, 35312, 7203, 14, 4943, 58, 12, 16, 60, 198, 220, 220, 220, 220, 220, 220, 220, 3722, 796, 2116, 13, 68, 1443, 62, 1891, 437, 13, 20751, 62, 45380, 9442, 7, 45380, 9442, 62, 312, 28, 45380, 9442, 62, 312, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 939, 11, 1391, 5512, 33918, 13, 67, 8142, 7, 13376, 8, 628, 220, 220, 220, 825, 1234, 62, 45380, 9442, 62, 9967, 7, 944, 11, 1336, 62, 6371, 11, 24697, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 383, 1708, 10007, 389, 3058, 407, 2077, 656, 1848, 25, 6060, 24539, 11, 18387, 13, 198, 220, 220, 220, 220, 220, 220, 220, 383, 47719, 388, 290, 47719, 388, 2348, 42289, 389, 2077, 379, 1986, 12, 8367, 11, 475, 645, 21201, 2753, 1295, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 27479, 62, 312, 796, 1336, 62, 6371, 13, 35312, 7203, 14, 4943, 58, 12, 18, 60, 198, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 9630, 796, 1336, 62, 6371, 13, 35312, 7203, 14, 4943, 58, 12, 16, 60, 198, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 7890, 796, 2116, 13, 2618, 198, 220, 220, 220, 220, 220, 220, 220, 24697, 796, 1391, 74, 13, 21037, 33529, 410, 329, 479, 11, 410, 287, 24697, 13, 23814, 3419, 92, 198, 220, 220, 220, 220, 220, 220, 220, 8794, 388, 796, 24697, 13, 1136, 7203, 87, 12, 321, 89, 12, 42116, 388, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 8794, 388, 62, 282, 42289, 796, 24697, 13, 1136, 7203, 87, 12, 321, 89, 12, 42116, 388, 12, 282, 42289, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 62, 13664, 796, 24697, 13, 1136, 7203, 87, 12, 321, 89, 12, 7890, 12, 13664, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 8794, 388, 11, 8794, 388, 62, 282, 42289, 796, 2116, 13, 68, 1443, 62, 1891, 437, 13, 1996, 62, 45380, 9442, 62, 9967, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 27479, 62, 312, 28, 45380, 9442, 62, 312, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 9630, 28, 9967, 62, 9630, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 7890, 28, 9967, 62, 7890, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8794, 388, 28, 42116, 388, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8794, 388, 62, 282, 42289, 28, 42116, 388, 62, 282, 42289, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1366, 62, 13664, 28, 7890, 62, 13664, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 939, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 87, 12, 321, 89, 12, 7376, 4657, 388, 1298, 8794, 388, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 87, 12, 321, 89, 12, 7376, 4657, 388, 12, 2348, 42289, 1298, 8794, 388, 62, 282, 42289, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 45144, 92, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 825, 1351, 62, 45380, 9442, 62, 27372, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 383, 1708, 10007, 389, 407, 1865, 9177, 25, 7406, 30642, 11, 5436, 25468, 11, 17962, 12235, 15732, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 27479, 62, 312, 796, 2116, 13, 6978, 13, 35312, 7203, 14, 4943, 58, 12, 17, 60, 198, 220, 220, 220, 220, 220, 220, 220, 27479, 796, 2116, 13, 68, 1443, 62, 1891, 437, 13, 4868, 62, 45380, 9442, 62, 27372, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 27479, 62, 312, 28, 45380, 9442, 62, 312, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 7021, 796, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19779, 12235, 15732, 1298, 4686, 87, 11, 366, 12235, 30642, 1298, 275, 13, 9967, 62, 30001, 92, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 4686, 87, 11, 275, 287, 27479, 13, 27372, 13, 23814, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2361, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 939, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1391, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 33918, 13, 67, 8142, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8633, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35111, 28, 27372, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14701, 10699, 28, 45380, 9442, 13, 29048, 62, 7857, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 9726, 10699, 28, 45380, 9442, 13, 9967, 62, 7857, 11, 198, 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, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198 ]
2.174116
1,499
import unittest import torch.nn from rl_starterpack import AC, OpenAIGym, experiment
[ 11748, 555, 715, 395, 198, 198, 11748, 28034, 13, 20471, 198, 198, 6738, 374, 75, 62, 12339, 8002, 1330, 7125, 11, 4946, 32, 3528, 4948, 11, 6306, 628 ]
3.142857
28
"""Centec OS Support""" from netmiko.cisco_base_connection import CiscoBaseConnection import time
[ 37811, 19085, 721, 7294, 7929, 37811, 198, 6738, 2010, 76, 12125, 13, 66, 4861, 62, 8692, 62, 38659, 1330, 28289, 14881, 32048, 198, 11748, 640, 628, 628 ]
3.740741
27
#Challenge 3 #The program asks the user to inputtheir surname and then their first name. #The program then outputsthe user’s first name and then their surname separately. name2 = input("please enter your surname: ") name1 = input("please enter your first name: ") print(name2) print(name1)
[ 2, 41812, 3540, 513, 201, 198, 2, 464, 1430, 7893, 262, 2836, 284, 5128, 24571, 40358, 290, 788, 511, 717, 1438, 13, 201, 198, 2, 464, 1430, 788, 5072, 301, 258, 2836, 447, 247, 82, 717, 1438, 290, 788, 511, 40358, 13869, 13, 201, 198, 201, 198, 3672, 17, 796, 5128, 7203, 29688, 3802, 534, 40358, 25, 366, 8, 201, 198, 3672, 16, 796, 5128, 7203, 29688, 3802, 534, 717, 1438, 25, 366, 8, 201, 198, 4798, 7, 3672, 17, 8, 201, 198, 4798, 7, 3672, 16, 8, 201, 198, 201, 198 ]
3.271739
92
# pylint: disable=line-too-long from __future__ import print_function import json import re import traceback import zipfile import arrow import pytz from passive_data_kit.models import DataPoint from passive_data_kit_external_data.models import annotate_field from ..utils import hash_content, encrypt_content, create_engagement_event, queue_batch_insert, include_data # Older format?
[ 2, 279, 2645, 600, 25, 15560, 28, 1370, 12, 18820, 12, 6511, 198, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 11748, 33918, 198, 11748, 302, 198, 11748, 12854, 1891, 198, 11748, 19974, 7753, 198, 198, 11748, 15452, 198, 11748, 12972, 22877, 198, 198, 6738, 14513, 62, 7890, 62, 15813, 13, 27530, 1330, 6060, 12727, 198, 198, 6738, 14513, 62, 7890, 62, 15813, 62, 22615, 62, 7890, 13, 27530, 1330, 24708, 378, 62, 3245, 198, 198, 6738, 11485, 26791, 1330, 12234, 62, 11299, 11, 34117, 62, 11299, 11, 2251, 62, 1516, 5082, 62, 15596, 11, 16834, 62, 43501, 62, 28463, 11, 2291, 62, 7890, 198, 198, 2, 35527, 5794, 30, 198 ]
3.438596
114
from distutils.core import setup import os from setuptools import find_packages DIR = os.path.dirname(__file__) with open(os.path.join(DIR, "README.md")) as f: readme = f.read().splitlines() setup( name='use_logging', version='0.0.1', packages=find_packages(include='use_logging*'), url='https://github.com/GambitResearch/use_logging', author='Daniel Royde', author_email='[email protected]', description=readme[6], long_description='\n'.join(readme[3:]).lstrip(), keywords=['Python', 'Logging'], scripts=['bin/use_logging'], license='MIT', )
[ 6738, 1233, 26791, 13, 7295, 1330, 9058, 198, 198, 11748, 28686, 198, 6738, 900, 37623, 10141, 1330, 1064, 62, 43789, 198, 198, 34720, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 8, 198, 198, 4480, 1280, 7, 418, 13, 6978, 13, 22179, 7, 34720, 11, 366, 15675, 11682, 13, 9132, 48774, 355, 277, 25, 198, 197, 961, 1326, 796, 277, 13, 961, 22446, 35312, 6615, 3419, 198, 198, 40406, 7, 198, 197, 3672, 11639, 1904, 62, 6404, 2667, 3256, 198, 197, 9641, 11639, 15, 13, 15, 13, 16, 3256, 198, 197, 43789, 28, 19796, 62, 43789, 7, 17256, 11639, 1904, 62, 6404, 2667, 9, 33809, 198, 197, 6371, 11639, 5450, 1378, 12567, 13, 785, 14, 34777, 2545, 25104, 14, 1904, 62, 6404, 2667, 3256, 198, 197, 9800, 11639, 19962, 9817, 2934, 3256, 198, 197, 9800, 62, 12888, 11639, 67, 6321, 3287, 2934, 31, 14816, 13, 785, 3256, 198, 197, 11213, 28, 961, 1326, 58, 21, 4357, 198, 197, 6511, 62, 11213, 11639, 59, 77, 4458, 22179, 7, 961, 1326, 58, 18, 25, 35944, 75, 36311, 22784, 198, 197, 2539, 10879, 28, 17816, 37906, 3256, 705, 11187, 2667, 6, 4357, 198, 197, 46521, 28, 17816, 8800, 14, 1904, 62, 6404, 2667, 6, 4357, 198, 197, 43085, 11639, 36393, 3256, 198, 8, 198 ]
2.630841
214
from pathlib import Path
[ 6738, 3108, 8019, 1330, 10644, 628 ]
4.333333
6
import math import torch import torch.nn as nn import models import utils from .models import register @register('classifier') @register('linear-classifier') @register('nn-classifier') @register('moco') class MoCo(nn.Module): """ Build a MoCo model with: a query encoder, a key encoder, and a queue https://arxiv.org/abs/1911.05722 """ def __init__(self, encoder, encoder_args, K=65536, m=0.999, T=0.07, mlp=False): """ dim: feature dimension (default: 128) K: queue size; number of negative keys (default: 65536) m: moco momentum of updating key encoder (default: 0.999) T: softmax temperature (default: 0.07) """ super(MoCo, self).__init__() self.K = K self.m = m self.T = T # create the encoders # feature embedding size is the output fc dimension self.encoder_q = models.make(encoder, **encoder_args) self.encoder_k = models.make(encoder, **encoder_args) dim = self.encoder_q.out_dim self.encoder = self.encoder_q # use encoder_q for downstream tasks if mlp: # hack: brute-force replacement dim_mlp = self.encoder_q.fc.weight.shape[1] self.encoder_q.fc = nn.Sequential(nn.Linear(dim_mlp, dim_mlp), nn.ReLU(), self.encoder_q.fc) self.encoder_k.fc = nn.Sequential(nn.Linear(dim_mlp, dim_mlp), nn.ReLU(), self.encoder_k.fc) for param_q, param_k in zip(self.encoder_q.parameters(), self.encoder_k.parameters()): param_k.data.copy_(param_q.data) # initialize param_k.requires_grad = False # not update by gradient # create the queue self.register_buffer("queue", torch.randn(dim, K)) self.queue = nn.functional.normalize(self.queue, dim=0) self.register_buffer("queue_ptr", torch.zeros(1, dtype=torch.long)) @torch.no_grad() def _momentum_update_key_encoder(self): """ Momentum update of the key encoder """ for param_q, param_k in zip(self.encoder_q.parameters(), self.encoder_k.parameters()): param_k.data = param_k.data * self.m + param_q.data * (1. - self.m) @torch.no_grad() @torch.no_grad() def _batch_shuffle_ddp(self, x): """ Batch shuffle, for making use of BatchNorm. """ batch_size = x.shape[0] # random shuffle index idx_shuffle = torch.randperm(batch_size).long().cuda() # index for restoring idx_unshuffle = torch.argsort(idx_shuffle) return x[idx_shuffle], idx_unshuffle @torch.no_grad() def _batch_unshuffle_ddp(self, x, idx_unshuffle): """ Undo batch shuffle. """ return x[idx_unshuffle] def forward(self, im_q, im_k): """ Input: im_q: a batch of query images im_k: a batch of key images Output: logits, targets """ # compute query features q = self.encoder_q(im_q) # queries: NxC q = nn.functional.normalize(q, dim=1) # compute key features with torch.no_grad(): # no gradient to keys self._momentum_update_key_encoder() # update the key encoder # shuffle for making use of BN im_k, idx_unshuffle = self._batch_shuffle_ddp(im_k) k = self.encoder_k(im_k) # keys: NxC k = nn.functional.normalize(k, dim=1) # undo shuffle k = self._batch_unshuffle_ddp(k, idx_unshuffle) # compute logits # Einstein sum is more intuitive # positive logits: Nx1 l_pos = torch.einsum('nc,nc->n', [q, k]).unsqueeze(-1) # negative logits: NxK l_neg = torch.einsum('nc,ck->nk', [q, self.queue.clone().detach()]) # logits: Nx(1+K) logits = torch.cat([l_pos, l_neg], dim=1) # apply temperature logits /= self.T # labels: positive key indicators labels = torch.zeros(logits.shape[0], dtype=torch.long).cuda() # dequeue and enqueue self._dequeue_and_enqueue(k) return logits, labels
[ 11748, 10688, 198, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 198, 11748, 4981, 198, 11748, 3384, 4487, 198, 6738, 764, 27530, 1330, 7881, 628, 198, 31, 30238, 10786, 4871, 7483, 11537, 628, 198, 31, 30238, 10786, 29127, 12, 4871, 7483, 11537, 628, 198, 31, 30238, 10786, 20471, 12, 4871, 7483, 11537, 628, 198, 31, 30238, 10786, 76, 25634, 11537, 198, 4871, 4270, 7222, 7, 20471, 13, 26796, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 10934, 257, 4270, 7222, 2746, 351, 25, 257, 12405, 2207, 12342, 11, 257, 1994, 2207, 12342, 11, 290, 257, 16834, 198, 220, 220, 220, 220, 220, 220, 220, 3740, 1378, 283, 87, 452, 13, 2398, 14, 8937, 14, 1129, 1157, 13, 43526, 1828, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 2207, 12342, 11, 2207, 12342, 62, 22046, 11, 509, 28, 35916, 2623, 11, 285, 28, 15, 13, 17032, 11, 309, 28, 15, 13, 2998, 11, 25962, 79, 28, 25101, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 5391, 25, 3895, 15793, 357, 12286, 25, 13108, 8, 198, 220, 220, 220, 220, 220, 220, 220, 509, 25, 16834, 2546, 26, 1271, 286, 4633, 8251, 357, 12286, 25, 45021, 2623, 8, 198, 220, 220, 220, 220, 220, 220, 220, 285, 25, 285, 25634, 12858, 286, 19698, 1994, 2207, 12342, 357, 12286, 25, 657, 13, 17032, 8, 198, 220, 220, 220, 220, 220, 220, 220, 309, 25, 2705, 9806, 5951, 357, 12286, 25, 657, 13, 2998, 8, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2208, 7, 16632, 7222, 11, 2116, 737, 834, 15003, 834, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 42, 796, 509, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 76, 796, 285, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 51, 796, 309, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 2251, 262, 2207, 375, 364, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 3895, 11525, 12083, 2546, 318, 262, 5072, 277, 66, 15793, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12685, 12342, 62, 80, 796, 4981, 13, 15883, 7, 12685, 12342, 11, 12429, 12685, 12342, 62, 22046, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12685, 12342, 62, 74, 796, 4981, 13, 15883, 7, 12685, 12342, 11, 12429, 12685, 12342, 62, 22046, 8, 198, 220, 220, 220, 220, 220, 220, 220, 5391, 796, 2116, 13, 12685, 12342, 62, 80, 13, 448, 62, 27740, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12685, 12342, 796, 2116, 13, 12685, 12342, 62, 80, 220, 1303, 779, 2207, 12342, 62, 80, 329, 33218, 8861, 628, 220, 220, 220, 220, 220, 220, 220, 611, 25962, 79, 25, 220, 1303, 8156, 25, 33908, 12, 3174, 9014, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5391, 62, 4029, 79, 796, 2116, 13, 12685, 12342, 62, 80, 13, 16072, 13, 6551, 13, 43358, 58, 16, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12685, 12342, 62, 80, 13, 16072, 796, 299, 77, 13, 44015, 1843, 7, 20471, 13, 14993, 451, 7, 27740, 62, 4029, 79, 11, 5391, 62, 4029, 79, 828, 299, 77, 13, 3041, 41596, 22784, 2116, 13, 12685, 12342, 62, 80, 13, 16072, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12685, 12342, 62, 74, 13, 16072, 796, 299, 77, 13, 44015, 1843, 7, 20471, 13, 14993, 451, 7, 27740, 62, 4029, 79, 11, 5391, 62, 4029, 79, 828, 299, 77, 13, 3041, 41596, 22784, 2116, 13, 12685, 12342, 62, 74, 13, 16072, 8, 628, 220, 220, 220, 220, 220, 220, 220, 329, 5772, 62, 80, 11, 5772, 62, 74, 287, 19974, 7, 944, 13, 12685, 12342, 62, 80, 13, 17143, 7307, 22784, 2116, 13, 12685, 12342, 62, 74, 13, 17143, 7307, 3419, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 62, 74, 13, 7890, 13, 30073, 41052, 17143, 62, 80, 13, 7890, 8, 220, 1303, 41216, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 62, 74, 13, 47911, 62, 9744, 796, 10352, 220, 1303, 407, 4296, 416, 31312, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 2251, 262, 16834, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30238, 62, 22252, 7203, 36560, 1600, 28034, 13, 25192, 77, 7, 27740, 11, 509, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 36560, 796, 299, 77, 13, 45124, 13, 11265, 1096, 7, 944, 13, 36560, 11, 5391, 28, 15, 8, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30238, 62, 22252, 7203, 36560, 62, 20692, 1600, 28034, 13, 9107, 418, 7, 16, 11, 288, 4906, 28, 13165, 354, 13, 6511, 4008, 628, 220, 220, 220, 2488, 13165, 354, 13, 3919, 62, 9744, 3419, 198, 220, 220, 220, 825, 4808, 32542, 298, 388, 62, 19119, 62, 2539, 62, 12685, 12342, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 29278, 388, 4296, 286, 262, 1994, 2207, 12342, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 329, 5772, 62, 80, 11, 5772, 62, 74, 287, 19974, 7, 944, 13, 12685, 12342, 62, 80, 13, 17143, 7307, 22784, 2116, 13, 12685, 12342, 62, 74, 13, 17143, 7307, 3419, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 62, 74, 13, 7890, 796, 5772, 62, 74, 13, 7890, 1635, 2116, 13, 76, 1343, 5772, 62, 80, 13, 7890, 1635, 357, 16, 13, 532, 2116, 13, 76, 8, 628, 220, 220, 220, 2488, 13165, 354, 13, 3919, 62, 9744, 3419, 628, 220, 220, 220, 2488, 13165, 354, 13, 3919, 62, 9744, 3419, 198, 220, 220, 220, 825, 4808, 43501, 62, 1477, 18137, 62, 1860, 79, 7, 944, 11, 2124, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 347, 963, 36273, 11, 329, 1642, 779, 286, 347, 963, 35393, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 15458, 62, 7857, 796, 2124, 13, 43358, 58, 15, 60, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4738, 36273, 6376, 198, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 62, 1477, 18137, 796, 28034, 13, 25192, 16321, 7, 43501, 62, 7857, 737, 6511, 22446, 66, 15339, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 6376, 329, 25646, 198, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 62, 403, 1477, 18137, 796, 28034, 13, 22046, 419, 7, 312, 87, 62, 1477, 18137, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 2124, 58, 312, 87, 62, 1477, 18137, 4357, 4686, 87, 62, 403, 1477, 18137, 628, 220, 220, 220, 2488, 13165, 354, 13, 3919, 62, 9744, 3419, 198, 220, 220, 220, 825, 4808, 43501, 62, 403, 1477, 18137, 62, 1860, 79, 7, 944, 11, 2124, 11, 4686, 87, 62, 403, 1477, 18137, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 13794, 78, 15458, 36273, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2124, 58, 312, 87, 62, 403, 1477, 18137, 60, 628, 220, 220, 220, 825, 2651, 7, 944, 11, 545, 62, 80, 11, 545, 62, 74, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 23412, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 545, 62, 80, 25, 257, 15458, 286, 12405, 4263, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 545, 62, 74, 25, 257, 15458, 286, 1994, 4263, 198, 220, 220, 220, 220, 220, 220, 220, 25235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2604, 896, 11, 6670, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 24061, 12405, 3033, 198, 220, 220, 220, 220, 220, 220, 220, 10662, 796, 2116, 13, 12685, 12342, 62, 80, 7, 320, 62, 80, 8, 220, 1303, 20743, 25, 399, 87, 34, 198, 220, 220, 220, 220, 220, 220, 220, 10662, 796, 299, 77, 13, 45124, 13, 11265, 1096, 7, 80, 11, 5391, 28, 16, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 24061, 1994, 3033, 198, 220, 220, 220, 220, 220, 220, 220, 351, 28034, 13, 3919, 62, 9744, 33529, 220, 1303, 645, 31312, 284, 8251, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 32542, 298, 388, 62, 19119, 62, 2539, 62, 12685, 12342, 3419, 220, 1303, 4296, 262, 1994, 2207, 12342, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 36273, 329, 1642, 779, 286, 347, 45, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 545, 62, 74, 11, 4686, 87, 62, 403, 1477, 18137, 796, 2116, 13557, 43501, 62, 1477, 18137, 62, 1860, 79, 7, 320, 62, 74, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 796, 2116, 13, 12685, 12342, 62, 74, 7, 320, 62, 74, 8, 220, 1303, 8251, 25, 399, 87, 34, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 796, 299, 77, 13, 45124, 13, 11265, 1096, 7, 74, 11, 5391, 28, 16, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 23981, 36273, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 796, 2116, 13557, 43501, 62, 403, 1477, 18137, 62, 1860, 79, 7, 74, 11, 4686, 87, 62, 403, 1477, 18137, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 24061, 2604, 896, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 24572, 2160, 318, 517, 19933, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 3967, 2604, 896, 25, 399, 87, 16, 198, 220, 220, 220, 220, 220, 220, 220, 300, 62, 1930, 796, 28034, 13, 68, 1040, 388, 10786, 10782, 11, 10782, 3784, 77, 3256, 685, 80, 11, 479, 35944, 13271, 421, 1453, 2736, 32590, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4633, 2604, 896, 25, 399, 87, 42, 198, 220, 220, 220, 220, 220, 220, 220, 300, 62, 12480, 796, 28034, 13, 68, 1040, 388, 10786, 10782, 11, 694, 3784, 77, 74, 3256, 685, 80, 11, 2116, 13, 36560, 13, 21018, 22446, 15255, 620, 3419, 12962, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 2604, 896, 25, 399, 87, 7, 16, 10, 42, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2604, 896, 796, 28034, 13, 9246, 26933, 75, 62, 1930, 11, 300, 62, 12480, 4357, 5391, 28, 16, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4174, 5951, 198, 220, 220, 220, 220, 220, 220, 220, 2604, 896, 1220, 28, 2116, 13, 51, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 14722, 25, 3967, 1994, 21337, 198, 220, 220, 220, 220, 220, 220, 220, 14722, 796, 28034, 13, 9107, 418, 7, 6404, 896, 13, 43358, 58, 15, 4357, 288, 4906, 28, 13165, 354, 13, 6511, 737, 66, 15339, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 390, 36560, 290, 551, 36560, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 2934, 36560, 62, 392, 62, 268, 36560, 7, 74, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 2604, 896, 11, 14722, 628 ]
2.110212
1,978
#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You 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 amulet import re import unittest class TestDeploy(unittest.TestCase): """ Hadoop/Hive deployment and smoke test for the Apache Bigtop Hive service. """ @classmethod def test_hive(self): """ Validate Hive by running the smoke-test action. """ uuid = self.hive.run_action('smoke-test') result = self.d.action_fetch(uuid, full_output=True) # action status=completed on success if (result['status'] != "completed"): self.fail('Hive smoke-test failed: %s' % result) if __name__ == '__main__': unittest.main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 49962, 284, 262, 24843, 10442, 5693, 357, 1921, 37, 8, 739, 530, 393, 517, 198, 2, 18920, 5964, 11704, 13, 220, 4091, 262, 28536, 2393, 9387, 351, 198, 2, 428, 670, 329, 3224, 1321, 5115, 6634, 9238, 13, 198, 2, 383, 7054, 37, 16625, 428, 2393, 284, 921, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 198, 2, 357, 1169, 366, 34156, 15341, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 198, 2, 262, 13789, 13, 220, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 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, 11748, 38335, 198, 11748, 302, 198, 11748, 555, 715, 395, 628, 198, 4871, 6208, 49322, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 367, 4533, 404, 14, 39, 425, 14833, 290, 7523, 1332, 329, 262, 24843, 4403, 4852, 33235, 2139, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2488, 4871, 24396, 628, 220, 220, 220, 825, 1332, 62, 71, 425, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3254, 20540, 33235, 416, 2491, 262, 7523, 12, 9288, 2223, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 334, 27112, 796, 2116, 13, 71, 425, 13, 5143, 62, 2673, 10786, 5796, 2088, 12, 9288, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 2116, 13, 67, 13, 2673, 62, 69, 7569, 7, 12303, 312, 11, 1336, 62, 22915, 28, 17821, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 2223, 3722, 28, 785, 16838, 319, 1943, 198, 220, 220, 220, 220, 220, 220, 220, 611, 357, 20274, 17816, 13376, 20520, 14512, 366, 785, 16838, 1, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 32165, 10786, 39, 425, 7523, 12, 9288, 4054, 25, 4064, 82, 6, 4064, 1255, 8, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
3.128319
452
import pytest from BlueKumquatAutoDiff.autodiff import *
[ 11748, 12972, 9288, 198, 6738, 4518, 42, 388, 421, 265, 27722, 28813, 13, 2306, 375, 733, 1330, 1635, 628, 628, 628 ]
2.952381
21
# -*- coding: utf-8 -*- from aenum import Flag from .results import Results
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 257, 44709, 1330, 19762, 198, 6738, 764, 43420, 1330, 15691, 628, 198 ]
2.888889
27
from django.core.management.base import BaseCommand import time from core.services.update import Updater
[ 6738, 42625, 14208, 13, 7295, 13, 27604, 13, 8692, 1330, 7308, 21575, 198, 11748, 640, 198, 198, 6738, 4755, 13, 30416, 13, 19119, 1330, 3205, 67, 729, 628 ]
3.821429
28
import nltk import sys sentence = """At eight o'clock on Thursday morning Arthur didn't feel very good.""" tokens = nltk.word_tokenize(sentence) if tokens != ['At', 'eight', "o'clock", 'on', 'Thursday', 'morning', 'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']: sys.stderr.write("Error in tokenization") sys.exit(1)
[ 11748, 299, 2528, 74, 198, 11748, 25064, 198, 198, 34086, 594, 796, 37227, 2953, 3624, 267, 6, 15750, 319, 3635, 3329, 13514, 1422, 470, 1254, 845, 922, 526, 15931, 198, 83, 482, 641, 796, 299, 2528, 74, 13, 4775, 62, 30001, 1096, 7, 34086, 594, 8, 198, 361, 16326, 14512, 37250, 2953, 3256, 705, 26022, 3256, 366, 78, 6, 15750, 1600, 705, 261, 3256, 705, 25381, 3256, 705, 43911, 3256, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 29874, 3256, 705, 20839, 3256, 366, 77, 470, 1600, 705, 36410, 3256, 705, 548, 3256, 705, 11274, 3256, 705, 2637, 5974, 198, 220, 220, 220, 25064, 13, 301, 1082, 81, 13, 13564, 7203, 12331, 287, 11241, 1634, 4943, 198, 220, 220, 220, 25064, 13, 37023, 7, 16, 8, 628 ]
2.57037
135
import os _data_path_prefix = lambda name:os.sep.join(['www.VyperLogix.com',name])
[ 11748, 28686, 198, 198, 62, 7890, 62, 6978, 62, 40290, 796, 37456, 1438, 25, 418, 13, 325, 79, 13, 22179, 7, 17816, 2503, 13, 53, 88, 525, 11187, 844, 13, 785, 3256, 3672, 12962, 198 ]
2.4
35
import pathlib import pkg_resources from setuptools import setup, find_packages with pathlib.Path('requirements.txt').open() as requirements_txt: install_requires = [ str(requirement) for requirement in pkg_resources.parse_requirements(requirements_txt) ] version = '0.4.2' setup( name='sammy', version=version, description="Python library for generating AWS SAM " "(Serverless Application Model) templates with validation.", classifiers=[ "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Environment :: Web Environment", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only" ], keywords='serverless, cloudformation, sam', author='Brian Jinwright', author_email='[email protected]', maintainer='Brian Jinwright', packages=find_packages(), url='https://github.com/capless/sammy', license='GNU General Public License v3.0', install_requires=install_requires, include_package_data=True, zip_safe=False, )
[ 11748, 3108, 8019, 198, 11748, 279, 10025, 62, 37540, 198, 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 198, 4480, 3108, 8019, 13, 15235, 10786, 8897, 18883, 13, 14116, 27691, 9654, 3419, 355, 5359, 62, 14116, 25, 198, 220, 220, 220, 2721, 62, 47911, 796, 685, 198, 220, 220, 220, 220, 220, 220, 220, 965, 7, 8897, 24615, 8, 198, 220, 220, 220, 220, 220, 220, 220, 329, 9079, 198, 220, 220, 220, 220, 220, 220, 220, 287, 279, 10025, 62, 37540, 13, 29572, 62, 8897, 18883, 7, 8897, 18883, 62, 14116, 8, 198, 220, 220, 220, 2361, 198, 9641, 796, 705, 15, 13, 19, 13, 17, 6, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 11639, 37687, 1820, 3256, 198, 220, 220, 220, 2196, 28, 9641, 11, 198, 220, 220, 220, 6764, 2625, 37906, 5888, 329, 15453, 30865, 28844, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 30629, 10697, 1203, 15678, 9104, 8, 24019, 351, 21201, 33283, 198, 220, 220, 220, 1398, 13350, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15167, 2229, 15417, 7904, 11361, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 33221, 7904, 10442, 7712, 7904, 46267, 7904, 11361, 3401, 5028, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 31441, 7904, 5313, 9344, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15167, 2229, 15417, 7904, 11361, 7904, 513, 13, 21, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15167, 2229, 15417, 7904, 11361, 7904, 513, 7904, 5514, 1, 198, 220, 220, 220, 16589, 198, 220, 220, 220, 26286, 11639, 15388, 1203, 11, 6279, 1161, 11, 6072, 3256, 198, 220, 220, 220, 1772, 11639, 24761, 17297, 29995, 3256, 198, 220, 220, 220, 1772, 62, 12888, 11639, 44813, 1668, 31, 541, 13880, 13, 785, 3256, 198, 220, 220, 220, 5529, 263, 11639, 24761, 17297, 29995, 3256, 198, 220, 220, 220, 10392, 28, 19796, 62, 43789, 22784, 198, 220, 220, 220, 19016, 11639, 5450, 1378, 12567, 13, 785, 14, 6888, 14570, 14, 37687, 1820, 3256, 198, 220, 220, 220, 5964, 11639, 16630, 52, 3611, 5094, 13789, 410, 18, 13, 15, 3256, 198, 220, 220, 220, 2721, 62, 47911, 28, 17350, 62, 47911, 11, 198, 220, 220, 220, 2291, 62, 26495, 62, 7890, 28, 17821, 11, 198, 220, 220, 220, 19974, 62, 21230, 28, 25101, 11, 198, 8, 198 ]
2.833333
402
import numpy import sklearn.naive_bayes import sklearn.feature_extraction.text import sklearn.pipeline # New additions import mlflow.sklearn mlflow.set_tracking_uri("http://atrium.datmo.com") mlflow.set_experiment("training_module") ... train_and_evaluate_model()
[ 11748, 299, 32152, 198, 11748, 1341, 35720, 13, 2616, 425, 62, 24406, 274, 198, 11748, 1341, 35720, 13, 30053, 62, 2302, 7861, 13, 5239, 198, 11748, 1341, 35720, 13, 79, 541, 4470, 198, 198, 2, 968, 19885, 198, 11748, 285, 1652, 9319, 13, 8135, 35720, 198, 76, 1652, 9319, 13, 2617, 62, 36280, 62, 9900, 7203, 4023, 1378, 265, 19172, 13, 19608, 5908, 13, 785, 4943, 198, 76, 1652, 9319, 13, 2617, 62, 23100, 3681, 7203, 34409, 62, 21412, 4943, 198, 198, 986, 198, 198, 27432, 62, 392, 62, 49786, 62, 19849, 3419 ]
2.860215
93
''' Created on Jun 14, 2017 @author: xinguan ''' # import mysql.connector import mysql.connector create_dice_jobs = ( "CREATE TABLE IF NOT EXISTS `dice_jobs` (" " `job_unique_id` varchar(50) NOT NULL," " `job_title` text NOT NULL," " `job_url` text NOT NULL," " `company` text NOT NULL," " `post_date` date NOT NULL," " `job_description` text NOT NULL," " PRIMARY KEY (`job_unique_id`)" ") ENGINE=InnoDB") cnx = mysql.connector.connect(user='root', password='u6a3pwhe', host='127.0.0.1', database='dice_test') cursor = cnx.cursor() try: cursor.execute(create_dice_jobs) cnx.commit() except mysql.connector.Error as err: print err cnx.rollback() finally: cursor.close() cnx.close()
[ 7061, 6, 198, 41972, 319, 7653, 1478, 11, 2177, 198, 198, 31, 9800, 25, 2124, 6680, 272, 198, 7061, 6, 198, 2, 1330, 48761, 13, 8443, 273, 198, 11748, 48761, 13, 8443, 273, 198, 198, 17953, 62, 67, 501, 62, 43863, 796, 357, 198, 220, 220, 220, 366, 43387, 6158, 43679, 16876, 5626, 7788, 1797, 4694, 4600, 67, 501, 62, 43863, 63, 5855, 198, 220, 220, 220, 366, 220, 4600, 21858, 62, 34642, 62, 312, 63, 410, 998, 283, 7, 1120, 8, 5626, 15697, 553, 198, 220, 220, 220, 366, 220, 4600, 21858, 62, 7839, 63, 2420, 5626, 15697, 553, 198, 220, 220, 220, 366, 220, 4600, 21858, 62, 6371, 63, 2420, 5626, 15697, 553, 198, 220, 220, 220, 366, 220, 4600, 39722, 63, 2420, 5626, 15697, 553, 198, 220, 220, 220, 366, 220, 4600, 7353, 62, 4475, 63, 3128, 5626, 15697, 553, 198, 220, 220, 220, 366, 220, 4600, 21858, 62, 11213, 63, 2420, 5626, 15697, 553, 198, 220, 220, 220, 366, 220, 4810, 3955, 13153, 35374, 357, 63, 21858, 62, 34642, 62, 312, 63, 16725, 198, 220, 220, 220, 366, 8, 36924, 8881, 28, 818, 3919, 11012, 4943, 198, 198, 31522, 87, 796, 48761, 13, 8443, 273, 13, 8443, 7, 7220, 11639, 15763, 3256, 9206, 11639, 84, 21, 64, 18, 79, 12491, 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, 220, 220, 220, 220, 220, 220, 2583, 11639, 16799, 13, 15, 13, 15, 13, 16, 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, 220, 220, 220, 220, 220, 220, 6831, 11639, 67, 501, 62, 9288, 11537, 198, 66, 21471, 796, 269, 77, 87, 13, 66, 21471, 3419, 198, 28311, 25, 198, 220, 220, 220, 23493, 13, 41049, 7, 17953, 62, 67, 501, 62, 43863, 8, 198, 220, 220, 220, 269, 77, 87, 13, 41509, 3419, 198, 16341, 48761, 13, 8443, 273, 13, 12331, 355, 11454, 25, 198, 220, 220, 220, 3601, 11454, 198, 220, 220, 220, 269, 77, 87, 13, 2487, 1891, 3419, 198, 69, 3289, 25, 198, 220, 220, 220, 23493, 13, 19836, 3419, 198, 220, 220, 220, 269, 77, 87, 13, 19836, 3419, 198 ]
2.123037
382
# !/usr/bin/python # -*- coding: utf-8 -*- import os import sys import logging import asyncio as aio from multiprocessing import set_start_method def get_logger(print_format: str = '[%(asctime)s.%(msecs)03d: %(levelname).1s %(filename)s:%(lineno)s] %(message)s', date_format: str = '%Y-%m-%d %H:%M:%S', print: bool = True, save: bool = True, save_path: str = 'upbit-trader.log'): ''' Logger Configuration''' log = logging.getLogger() # Setup logger level log.setLevel(logging.INFO) # Setup logger format formatter = logging.Formatter(fmt=print_format, datefmt=date_format) # Setup logger handler if print: stream_handler = logging.StreamHandler() stream_handler.setFormatter(formatter) log.addHandler(stream_handler) if save: if save_path == 'upbit-trader.log' and not sys.platform.startswith('win'): file_handler = logging.FileHandler('upbit-trader.log') else: file_handler = logging.FileHandler(save_path) file_handler.setFormatter(formatter) log.addHandler(file_handler) return log
[ 2, 5145, 14, 14629, 14, 8800, 14, 29412, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 18931, 198, 11748, 30351, 952, 355, 257, 952, 198, 6738, 220, 18540, 305, 919, 278, 1330, 900, 62, 9688, 62, 24396, 198, 198, 4299, 651, 62, 6404, 1362, 7, 4798, 62, 18982, 25, 965, 796, 44438, 4, 7, 292, 310, 524, 8, 82, 13, 4, 7, 76, 2363, 82, 8, 3070, 67, 25, 4064, 7, 5715, 3672, 737, 16, 82, 4064, 7, 34345, 8, 82, 25, 4, 7, 2815, 23397, 8, 82, 60, 4064, 7, 20500, 8, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3128, 62, 18982, 25, 965, 796, 705, 4, 56, 12, 4, 76, 12, 4, 67, 4064, 39, 25, 4, 44, 25, 4, 50, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 25, 20512, 796, 6407, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3613, 25, 20512, 796, 6407, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3613, 62, 6978, 25, 965, 796, 705, 929, 2545, 12, 2213, 5067, 13, 6404, 6, 2599, 198, 220, 220, 220, 705, 7061, 5972, 1362, 28373, 7061, 6, 198, 220, 220, 220, 2604, 796, 18931, 13, 1136, 11187, 1362, 3419, 198, 220, 220, 220, 1303, 31122, 49706, 1241, 198, 220, 220, 220, 2604, 13, 2617, 4971, 7, 6404, 2667, 13, 10778, 8, 198, 220, 220, 220, 1303, 31122, 49706, 5794, 198, 220, 220, 220, 1296, 1436, 796, 18931, 13, 8479, 1436, 7, 69, 16762, 28, 4798, 62, 18982, 11, 3128, 69, 16762, 28, 4475, 62, 18982, 8, 198, 220, 220, 220, 1303, 31122, 49706, 21360, 198, 220, 220, 220, 611, 3601, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4269, 62, 30281, 796, 18931, 13, 12124, 25060, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 4269, 62, 30281, 13, 2617, 8479, 1436, 7, 687, 1436, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2604, 13, 2860, 25060, 7, 5532, 62, 30281, 8, 198, 220, 220, 220, 611, 3613, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 3613, 62, 6978, 6624, 705, 929, 2545, 12, 2213, 5067, 13, 6404, 6, 290, 407, 25064, 13, 24254, 13, 9688, 2032, 342, 10786, 5404, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2393, 62, 30281, 796, 18931, 13, 8979, 25060, 10786, 929, 2545, 12, 2213, 5067, 13, 6404, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2393, 62, 30281, 796, 18931, 13, 8979, 25060, 7, 21928, 62, 6978, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2393, 62, 30281, 13, 2617, 8479, 1436, 7, 687, 1436, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2604, 13, 2860, 25060, 7, 7753, 62, 30281, 8, 198, 220, 220, 220, 1441, 2604, 628, 628 ]
2.254335
519
import os def load_idmap(idmap_file): """Load tab-separated idmap file containing label index and label string Args: idmap_file (str): filepath to idmap Returns: dict: labelmap (key=index, value=string) """ if not os.path.exists(idmap_file): raise FileExistsError(idmap_file) labelmap = {} with open(idmap_file, "r") as rf: for row in rf: row = row.split("\t") labelmap[int(row[0])] = row[1].strip() return labelmap
[ 11748, 28686, 628, 198, 4299, 3440, 62, 312, 8899, 7, 312, 8899, 62, 7753, 2599, 198, 220, 220, 220, 37227, 8912, 7400, 12, 25512, 515, 4686, 8899, 2393, 7268, 6167, 6376, 290, 6167, 4731, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4686, 8899, 62, 7753, 357, 2536, 2599, 2393, 6978, 284, 4686, 8899, 628, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 8633, 25, 6167, 8899, 357, 2539, 28, 9630, 11, 1988, 28, 8841, 8, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 407, 28686, 13, 6978, 13, 1069, 1023, 7, 312, 8899, 62, 7753, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 9220, 3109, 1023, 12331, 7, 312, 8899, 62, 7753, 8, 628, 220, 220, 220, 6167, 8899, 796, 23884, 198, 220, 220, 220, 351, 1280, 7, 312, 8899, 62, 7753, 11, 366, 81, 4943, 355, 374, 69, 25, 198, 220, 220, 220, 220, 220, 220, 220, 329, 5752, 287, 374, 69, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5752, 796, 5752, 13, 35312, 7203, 59, 83, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6167, 8899, 58, 600, 7, 808, 58, 15, 12962, 60, 796, 5752, 58, 16, 4083, 36311, 3419, 198, 220, 220, 220, 1441, 6167, 8899, 628 ]
2.227074
229
from unittest import TestCase from unittest.mock import Mock, patch import pytest from pytest import approx from functions import mpc_to_mly from voevent import VOEventFromXml, VOEventFromEventId import tests.voevent_test_data as test_data import ligo from ligo.gracedb.exceptions import HTTPError @patch("ligo.gracedb.rest.GraceDb.voevents") @patch("ligo.gracedb.rest.GraceDb.get") @patch("ligo.gracedb.rest.GraceDb.get") @pytest.fixture(scope="class") @pytest.mark.usefixtures("event_id") @pytest.fixture(scope="class") @pytest.mark.usefixtures("mock_event_file") @pytest.fixture(scope="class") @pytest.mark.usefixtures("real_event_file")
[ 6738, 555, 715, 395, 1330, 6208, 20448, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 44123, 11, 8529, 198, 198, 11748, 12972, 9288, 198, 6738, 12972, 9288, 1330, 5561, 198, 198, 6738, 5499, 1330, 285, 14751, 62, 1462, 62, 76, 306, 198, 6738, 410, 2577, 1151, 1330, 30578, 9237, 4863, 55, 4029, 11, 30578, 9237, 4863, 9237, 7390, 198, 11748, 5254, 13, 85, 2577, 1151, 62, 9288, 62, 7890, 355, 1332, 62, 7890, 198, 11748, 300, 14031, 198, 6738, 300, 14031, 13, 2164, 2286, 65, 13, 1069, 11755, 1330, 14626, 12331, 628, 198, 31, 17147, 7203, 4604, 78, 13, 2164, 2286, 65, 13, 2118, 13, 8642, 558, 43832, 13, 13038, 31534, 4943, 628, 198, 198, 31, 17147, 7203, 4604, 78, 13, 2164, 2286, 65, 13, 2118, 13, 8642, 558, 43832, 13, 1136, 4943, 628, 198, 198, 31, 17147, 7203, 4604, 78, 13, 2164, 2286, 65, 13, 2118, 13, 8642, 558, 43832, 13, 1136, 4943, 628, 198, 31, 9078, 9288, 13, 69, 9602, 7, 29982, 2625, 4871, 4943, 628, 198, 31, 9078, 9288, 13, 4102, 13, 1904, 69, 25506, 7203, 15596, 62, 312, 4943, 628, 198, 31, 9078, 9288, 13, 69, 9602, 7, 29982, 2625, 4871, 4943, 628, 198, 31, 9078, 9288, 13, 4102, 13, 1904, 69, 25506, 7203, 76, 735, 62, 15596, 62, 7753, 4943, 628, 198, 31, 9078, 9288, 13, 69, 9602, 7, 29982, 2625, 4871, 4943, 628, 198, 31, 9078, 9288, 13, 4102, 13, 1904, 69, 25506, 7203, 5305, 62, 15596, 62, 7753, 4943, 198 ]
2.673387
248
__author__ = 'Justin McClure' from django.test import TestCase, Client from django.core.urlresolvers import reverse from random import choice from lib.api_calls import APIException # Note: Wait view will probably be removed in the future
[ 834, 9800, 834, 796, 705, 33229, 23780, 495, 6, 198, 198, 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 11, 20985, 198, 6738, 42625, 14208, 13, 7295, 13, 6371, 411, 349, 690, 1330, 9575, 198, 6738, 4738, 1330, 3572, 198, 6738, 9195, 13, 15042, 62, 66, 5691, 1330, 7824, 16922, 628, 628, 628, 628, 198, 220, 220, 220, 1303, 5740, 25, 16314, 1570, 481, 2192, 307, 4615, 287, 262, 2003, 628, 198 ]
3.513889
72
import requests import lxml.html import json # tutorial from An Intro to Web Scraping With lxml and Python – Python Tips # https://pythontips.com/2018/06/20/an-intro-to-web-scraping-with-lxml-and-python/ # html = requests.get("https://www.beatport.com/genre/psy-trance/13/top-100") html = requests.get("https://store.steampowered.com/explore/new/") doc = lxml.html.fromstring(html.content) new_releases = doc.xpath('//div[@id="tab_newreleases_content"]') doc = lxml.html.fromstring(html.content) print(new_releases) new_releases = doc.xpath('//div[@id="tab_newreleases_content"]')[0] titles = new_releases.xpath('.//div[@class="tab_item_name"]/text()') print(titles) prices = new_releases.xpath( './/div[@class="discount_final_price"]/text()') print(prices) # tags = new_releases.xpath('.//div[@class="tab_item_top_tags"]') # total_tags = [] # for tag in tags: # total_tags.append(tag.text_content()) # # print(total_tags) tags = [tag.text_content() for tag in new_releases.xpath( './/div[@class="tab_item_top_tags"]')] tags = [tag.split(', ') for tag in tags] print(tags) platforms_div = new_releases.xpath('.//div[@class="tab_item_details"]') total_platforms = [] for game in platforms_div: temp = game.xpath('.//span[contains(@class, "platform_img")]') platforms = [t.get('class').split(' ')[-1] for t in temp] if 'hmd_separator' in platforms: platforms.remove('hmd_separator') total_platforms.append(platforms) print(total_platforms) output = [] for info in zip(titles, prices, tags, total_platforms): resp = {} resp['title'] = info[0] resp['price'] = info[1] resp['tags'] = info[2] resp['platforms'] = info[3] output.append(resp) print(output) with open('output.json', 'w') as outfile: json.dump(output, outfile)
[ 11748, 7007, 198, 11748, 300, 19875, 13, 6494, 198, 11748, 33918, 198, 198, 2, 11808, 422, 1052, 37219, 284, 5313, 1446, 2416, 278, 2080, 300, 19875, 290, 11361, 784, 11361, 27558, 198, 2, 3740, 1378, 79, 5272, 756, 2419, 13, 785, 14, 7908, 14, 3312, 14, 1238, 14, 272, 12, 600, 305, 12, 1462, 12, 12384, 12, 1416, 2416, 278, 12, 4480, 12, 75, 19875, 12, 392, 12, 29412, 14, 198, 198, 2, 27711, 796, 7007, 13, 1136, 7203, 5450, 1378, 2503, 13, 12945, 634, 13, 785, 14, 35850, 14, 13764, 12, 2213, 590, 14, 1485, 14, 4852, 12, 3064, 4943, 198, 6494, 796, 7007, 13, 1136, 7203, 5450, 1378, 8095, 13, 4169, 696, 10387, 13, 785, 14, 20676, 382, 14, 3605, 14, 4943, 198, 15390, 796, 300, 19875, 13, 6494, 13, 6738, 8841, 7, 6494, 13, 11299, 8, 198, 198, 3605, 62, 260, 29329, 796, 2205, 13, 87, 6978, 10786, 1003, 7146, 58, 31, 312, 2625, 8658, 62, 3605, 260, 29329, 62, 11299, 8973, 11537, 198, 15390, 796, 300, 19875, 13, 6494, 13, 6738, 8841, 7, 6494, 13, 11299, 8, 198, 4798, 7, 3605, 62, 260, 29329, 8, 198, 198, 3605, 62, 260, 29329, 796, 2205, 13, 87, 6978, 10786, 1003, 7146, 58, 31, 312, 2625, 8658, 62, 3605, 260, 29329, 62, 11299, 8973, 11537, 58, 15, 60, 198, 83, 30540, 796, 649, 62, 260, 29329, 13, 87, 6978, 7, 4458, 1003, 7146, 58, 31, 4871, 2625, 8658, 62, 9186, 62, 3672, 8973, 14, 5239, 3419, 11537, 198, 4798, 7, 83, 30540, 8, 198, 198, 1050, 1063, 796, 649, 62, 260, 29329, 13, 87, 6978, 7, 198, 220, 220, 220, 45302, 1003, 7146, 58, 31, 4871, 2625, 15410, 608, 62, 20311, 62, 20888, 8973, 14, 5239, 3419, 11537, 198, 4798, 7, 1050, 1063, 8, 198, 198, 2, 15940, 796, 649, 62, 260, 29329, 13, 87, 6978, 7, 4458, 1003, 7146, 58, 31, 4871, 2625, 8658, 62, 9186, 62, 4852, 62, 31499, 8973, 11537, 198, 2, 2472, 62, 31499, 796, 17635, 198, 2, 329, 7621, 287, 15940, 25, 198, 2, 220, 220, 220, 220, 2472, 62, 31499, 13, 33295, 7, 12985, 13, 5239, 62, 11299, 28955, 198, 2, 198, 2, 3601, 7, 23350, 62, 31499, 8, 198, 198, 31499, 796, 685, 12985, 13, 5239, 62, 11299, 3419, 329, 7621, 287, 649, 62, 260, 29329, 13, 87, 6978, 7, 198, 220, 220, 220, 45302, 1003, 7146, 58, 31, 4871, 2625, 8658, 62, 9186, 62, 4852, 62, 31499, 8973, 11537, 60, 198, 31499, 796, 685, 12985, 13, 35312, 7, 3256, 705, 8, 329, 7621, 287, 15940, 60, 198, 4798, 7, 31499, 8, 198, 198, 24254, 82, 62, 7146, 796, 649, 62, 260, 29329, 13, 87, 6978, 7, 4458, 1003, 7146, 58, 31, 4871, 2625, 8658, 62, 9186, 62, 36604, 8973, 11537, 198, 23350, 62, 24254, 82, 796, 17635, 198, 198, 1640, 983, 287, 9554, 62, 7146, 25, 198, 220, 220, 220, 20218, 796, 983, 13, 87, 6978, 7, 4458, 1003, 12626, 58, 3642, 1299, 7, 31, 4871, 11, 366, 24254, 62, 9600, 4943, 60, 11537, 198, 220, 220, 220, 9554, 796, 685, 83, 13, 1136, 10786, 4871, 27691, 35312, 10786, 705, 38381, 12, 16, 60, 329, 256, 287, 20218, 60, 198, 220, 220, 220, 611, 705, 71, 9132, 62, 25512, 1352, 6, 287, 9554, 25, 198, 220, 220, 220, 220, 220, 220, 220, 9554, 13, 28956, 10786, 71, 9132, 62, 25512, 1352, 11537, 198, 220, 220, 220, 2472, 62, 24254, 82, 13, 33295, 7, 24254, 82, 8, 198, 198, 4798, 7, 23350, 62, 24254, 82, 8, 198, 198, 22915, 796, 17635, 198, 1640, 7508, 287, 19974, 7, 83, 30540, 11, 4536, 11, 15940, 11, 2472, 62, 24254, 82, 2599, 198, 220, 220, 220, 1217, 796, 23884, 198, 220, 220, 220, 1217, 17816, 7839, 20520, 796, 7508, 58, 15, 60, 198, 220, 220, 220, 1217, 17816, 20888, 20520, 796, 7508, 58, 16, 60, 198, 220, 220, 220, 1217, 17816, 31499, 20520, 796, 7508, 58, 17, 60, 198, 220, 220, 220, 1217, 17816, 24254, 82, 20520, 796, 7508, 58, 18, 60, 198, 220, 220, 220, 5072, 13, 33295, 7, 4363, 8, 198, 198, 4798, 7, 22915, 8, 198, 198, 4480, 1280, 10786, 22915, 13, 17752, 3256, 705, 86, 11537, 355, 503, 7753, 25, 198, 220, 220, 220, 33918, 13, 39455, 7, 22915, 11, 503, 7753, 8, 198 ]
2.517532
713
# flake8: noqa from .aen import AdaptiveElasticNet from .aencv import AdaptiveElasticNetCV
[ 2, 781, 539, 23, 25, 645, 20402, 198, 198, 6738, 764, 64, 268, 1330, 30019, 425, 9527, 3477, 7934, 198, 6738, 764, 64, 12685, 85, 1330, 30019, 425, 9527, 3477, 7934, 33538, 198 ]
2.787879
33
from ..misc import binary_digitize import numpy as np import pandas as pd
[ 6738, 11485, 44374, 1330, 13934, 62, 27003, 1096, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67 ]
3.363636
22
# This example requires the `message_content` privileged intent for access to message content. import discord intents = discord.Intents.default() intents.message_content = True client = MyClient(intents=intents) client.run("TOKEN")
[ 2, 770, 1672, 4433, 262, 4600, 20500, 62, 11299, 63, 21929, 6824, 329, 1895, 284, 3275, 2695, 13, 198, 198, 11748, 36446, 628, 198, 198, 600, 658, 796, 36446, 13, 5317, 658, 13, 12286, 3419, 198, 600, 658, 13, 20500, 62, 11299, 796, 6407, 198, 198, 16366, 796, 2011, 11792, 7, 600, 658, 28, 600, 658, 8, 198, 16366, 13, 5143, 7203, 10468, 43959, 4943, 198 ]
3.590909
66
import torch.nn as nn from PIL import Image from torch.utils.data import Dataset import numpy as np from transform_file import cut root='/home/wang/Dataset/Caltech256/' #root='/media/this/02ff0572-4aa8-47c6-975d-16c3b8062013/Caltech256/'
[ 11748, 28034, 13, 20471, 355, 299, 77, 198, 6738, 350, 4146, 1330, 7412, 198, 6738, 28034, 13, 26791, 13, 7890, 1330, 16092, 292, 316, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 6121, 62, 7753, 1330, 2005, 198, 198, 15763, 11639, 14, 11195, 14, 47562, 14, 27354, 292, 316, 14, 9771, 13670, 11645, 14, 6, 198, 2, 15763, 11639, 14, 11431, 14, 5661, 14, 2999, 487, 2713, 4761, 12, 19, 7252, 23, 12, 2857, 66, 21, 12, 42716, 67, 12, 1433, 66, 18, 65, 37988, 6390, 14, 9771, 13670, 11645, 14, 6, 628 ]
2.580645
93
"""Data type models""" # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import datetime import enum from typing import Any, Dict, List, Optional import deserialize def iso8601parse(date_string: Optional[str]) -> Optional[datetime.datetime]: """Parse an ISO8601 date string into a datetime. :param date_string: The date string to parse :returns: The parsed datetime """ if date_string is None: return None try: return datetime.datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%SZ") except ValueError: return datetime.datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%S.%fZ") # pylint: disable=missing-docstring @deserialize.parser("firstOccurrence", iso8601parse) @deserialize.parser("lastOccurrence", iso8601parse) @deserialize.parser("firstOccurrence", iso8601parse) @deserialize.parser("lastOccurrence", iso8601parse) @deserialize.parser("timestamp", iso8601parse) @deserialize.parser("timestamp", iso8601parse) @deserialize.parser("appLaunchTimestamp", iso8601parse) @deserialize.key("identifier", "id") @deserialize.key("store_type", "type") @deserialize.key("identifier", "id") @deserialize.parser("uploaded_at", iso8601parse) @deserialize.key("identifier", "id") @deserialize.parser("provisioning_profile_expiry_date", iso8601parse) @deserialize.parser("uploaded_at", iso8601parse) @deserialize.key("identifier", "id") @deserialize.key("identifier", "id") @deserialize.key("identifier", "id") @deserialize.key("identifier", "id") @deserialize.key("identifier", "id") @deserialize.key("identifier", "id") @deserialize.parser("expiration_date", iso8601parse) @deserialize.key("identifier", "id") @deserialize.key("identifier", "id") @deserialize.parser("created_at", iso8601parse)
[ 37811, 6601, 2099, 4981, 37811, 198, 198, 2, 15069, 357, 66, 8, 5413, 10501, 13, 198, 2, 49962, 739, 262, 17168, 5964, 13, 198, 198, 11748, 4818, 8079, 198, 11748, 33829, 198, 6738, 19720, 1330, 4377, 11, 360, 713, 11, 7343, 11, 32233, 198, 198, 11748, 748, 48499, 1096, 628, 198, 4299, 47279, 4521, 486, 29572, 7, 4475, 62, 8841, 25, 32233, 58, 2536, 12962, 4613, 32233, 58, 19608, 8079, 13, 19608, 8079, 5974, 198, 220, 220, 220, 37227, 10044, 325, 281, 19694, 4521, 486, 3128, 4731, 656, 257, 4818, 8079, 13, 628, 220, 220, 220, 1058, 17143, 3128, 62, 8841, 25, 383, 3128, 4731, 284, 21136, 628, 220, 220, 220, 1058, 7783, 82, 25, 383, 44267, 4818, 8079, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 611, 3128, 62, 8841, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 6045, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 4818, 8079, 13, 19608, 8079, 13, 2536, 457, 524, 7, 4475, 62, 8841, 11, 36521, 56, 12, 4, 76, 12, 4, 67, 51, 4, 39, 25, 4, 44, 25, 4, 50, 57, 4943, 198, 220, 220, 220, 2845, 11052, 12331, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 4818, 8079, 13, 19608, 8079, 13, 2536, 457, 524, 7, 4475, 62, 8841, 11, 36521, 56, 12, 4, 76, 12, 4, 67, 51, 4, 39, 25, 4, 44, 25, 4, 50, 13, 4, 69, 57, 4943, 628, 198, 2, 279, 2645, 600, 25, 15560, 28, 45688, 12, 15390, 8841, 628, 628, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 11085, 29223, 33928, 1600, 47279, 4521, 486, 29572, 8, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 12957, 29223, 33928, 1600, 47279, 4521, 486, 29572, 8, 628, 198, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 11085, 29223, 33928, 1600, 47279, 4521, 486, 29572, 8, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 12957, 29223, 33928, 1600, 47279, 4521, 486, 29572, 8, 628, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 16514, 27823, 1600, 47279, 4521, 486, 29572, 8, 628, 198, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 16514, 27823, 1600, 47279, 4521, 486, 29572, 8, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 1324, 38296, 14967, 27823, 1600, 47279, 4521, 486, 29572, 8, 628, 628, 628, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 8095, 62, 4906, 1600, 366, 4906, 4943, 628, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 25850, 276, 62, 265, 1600, 47279, 4521, 486, 29572, 8, 628, 198, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 1676, 10178, 278, 62, 13317, 62, 1069, 4063, 88, 62, 4475, 1600, 47279, 4521, 486, 29572, 8, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 25850, 276, 62, 265, 1600, 47279, 4521, 486, 29572, 8, 628, 628, 198, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 628, 198, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 628, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 628, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 628, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 628, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 628, 628, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 1069, 10514, 62, 4475, 1600, 47279, 4521, 486, 29572, 8, 628, 628, 628, 198, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 628, 198, 31, 8906, 48499, 1096, 13, 2539, 7203, 738, 7483, 1600, 366, 312, 4943, 198, 31, 8906, 48499, 1096, 13, 48610, 7203, 25598, 62, 265, 1600, 47279, 4521, 486, 29572, 8, 198 ]
2.705357
672
import os import pandas as pd import collections import re import pickle from basic_util.files import * import argparse if __name__ =='__main__': parser = get_parser() args = parser.parse_args() imap = IMap(args.dir_path, args.base_name) imap.learn_dic(args.count_names, args.check_names) imap.convert_and_save(args.convert_names)
[ 11748, 28686, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 17268, 198, 11748, 302, 198, 11748, 2298, 293, 198, 6738, 4096, 62, 22602, 13, 16624, 1330, 1635, 198, 11748, 1822, 29572, 628, 628, 628, 198, 361, 11593, 3672, 834, 6624, 6, 834, 12417, 834, 10354, 198, 220, 220, 220, 30751, 796, 651, 62, 48610, 3419, 198, 220, 220, 220, 26498, 796, 30751, 13, 29572, 62, 22046, 3419, 198, 220, 220, 220, 545, 499, 796, 8959, 499, 7, 22046, 13, 15908, 62, 6978, 11, 26498, 13, 8692, 62, 3672, 8, 198, 220, 220, 220, 545, 499, 13, 35720, 62, 67, 291, 7, 22046, 13, 9127, 62, 14933, 11, 26498, 13, 9122, 62, 14933, 8, 198, 220, 220, 220, 545, 499, 13, 1102, 1851, 62, 392, 62, 21928, 7, 22046, 13, 1102, 1851, 62, 14933, 8 ]
2.637037
135
# Generated by Django 3.0.3 on 2020-11-03 07:43 from django.db import migrations
[ 2, 2980, 515, 416, 37770, 513, 13, 15, 13, 18, 319, 12131, 12, 1157, 12, 3070, 8753, 25, 3559, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 628 ]
2.766667
30
import argparse import requests from os import getenv import sys from influxdb import InfluxDBClient from datetime import datetime, timedelta solaredge_api_url = "https://monitoringapi.solaredge.com" required_version = dict(release="1.0.0") if __name__ == "__main__": main()
[ 11748, 1822, 29572, 198, 11748, 7007, 198, 6738, 28686, 1330, 651, 24330, 198, 11748, 25064, 198, 198, 6738, 25065, 9945, 1330, 4806, 22564, 11012, 11792, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 628, 198, 34453, 1144, 469, 62, 15042, 62, 6371, 796, 366, 5450, 1378, 41143, 278, 15042, 13, 34453, 1144, 469, 13, 785, 1, 198, 35827, 62, 9641, 796, 8633, 7, 20979, 2625, 16, 13, 15, 13, 15, 4943, 628, 628, 628, 628, 628, 628, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ]
3.020408
98
import urllib3 print(main())
[ 11748, 2956, 297, 571, 18, 198, 198, 4798, 7, 12417, 28955, 198 ]
2.5
12
from lib.dynamo.client import DynamoClientManager async def table_exists(name: str) -> bool: """Check if table exists.""" async with DynamoClientManager() as dynamodb: try: await dynamodb.describe_table(TableName=name) except dynamodb.exceptions.ResourceNotFoundException: state = False else: state = True # allow the Context Manager to exit return state async def ensure_table(schema: dict): """Ensure the table exists.""" table_name = schema.get('TableName') if not table_name: return exists = await table_exists(table_name) if exists: return async with DynamoClientManager() as dynamodb: await dynamodb.create_table(**schema) waiter = dynamodb.get_waiter('table_exists') await waiter.wait(TableName=table_name) async def delete_table(schema: dict): """Deletes the table.""" table_name = schema.get('TableName') if not table_name: return exists = await table_exists(table_name) if not exists: return async with DynamoClientManager() as dynamodb: await dynamodb.delete_table(TableName=table_name) waiter = dynamodb.get_waiter('table_not_exists') await waiter.wait(TableName=table_name)
[ 6738, 9195, 13, 67, 4989, 78, 13, 16366, 1330, 41542, 11792, 13511, 628, 198, 292, 13361, 825, 3084, 62, 1069, 1023, 7, 3672, 25, 965, 8, 4613, 20512, 25, 198, 220, 220, 220, 37227, 9787, 611, 3084, 7160, 526, 15931, 198, 220, 220, 220, 30351, 351, 41542, 11792, 13511, 3419, 355, 6382, 375, 65, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25507, 6382, 375, 65, 13, 20147, 4892, 62, 11487, 7, 10962, 5376, 28, 3672, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 6382, 375, 65, 13, 1069, 11755, 13, 26198, 3673, 21077, 16922, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1181, 796, 6407, 198, 220, 220, 220, 1303, 1249, 262, 30532, 9142, 284, 8420, 198, 220, 220, 220, 1441, 1181, 628, 198, 292, 13361, 825, 4155, 62, 11487, 7, 15952, 2611, 25, 8633, 2599, 198, 220, 220, 220, 37227, 4834, 19532, 262, 3084, 7160, 526, 15931, 198, 220, 220, 220, 3084, 62, 3672, 796, 32815, 13, 1136, 10786, 10962, 5376, 11537, 198, 220, 220, 220, 611, 407, 3084, 62, 3672, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 628, 220, 220, 220, 7160, 796, 25507, 3084, 62, 1069, 1023, 7, 11487, 62, 3672, 8, 198, 220, 220, 220, 611, 7160, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 628, 220, 220, 220, 30351, 351, 41542, 11792, 13511, 3419, 355, 6382, 375, 65, 25, 198, 220, 220, 220, 220, 220, 220, 220, 25507, 6382, 375, 65, 13, 17953, 62, 11487, 7, 1174, 15952, 2611, 8, 198, 220, 220, 220, 220, 220, 220, 220, 46612, 796, 6382, 375, 65, 13, 1136, 62, 10247, 2676, 10786, 11487, 62, 1069, 1023, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 25507, 46612, 13, 17077, 7, 10962, 5376, 28, 11487, 62, 3672, 8, 628, 198, 292, 13361, 825, 12233, 62, 11487, 7, 15952, 2611, 25, 8633, 2599, 198, 220, 220, 220, 37227, 5005, 40676, 262, 3084, 526, 15931, 198, 220, 220, 220, 3084, 62, 3672, 796, 32815, 13, 1136, 10786, 10962, 5376, 11537, 198, 220, 220, 220, 611, 407, 3084, 62, 3672, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 628, 220, 220, 220, 7160, 796, 25507, 3084, 62, 1069, 1023, 7, 11487, 62, 3672, 8, 198, 220, 220, 220, 611, 407, 7160, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 628, 220, 220, 220, 30351, 351, 41542, 11792, 13511, 3419, 355, 6382, 375, 65, 25, 198, 220, 220, 220, 220, 220, 220, 220, 25507, 6382, 375, 65, 13, 33678, 62, 11487, 7, 10962, 5376, 28, 11487, 62, 3672, 8, 198, 220, 220, 220, 220, 220, 220, 220, 46612, 796, 6382, 375, 65, 13, 1136, 62, 10247, 2676, 10786, 11487, 62, 1662, 62, 1069, 1023, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 25507, 46612, 13, 17077, 7, 10962, 5376, 28, 11487, 62, 3672, 8, 198 ]
2.501923
520
import numpy as np import torch from lib.models.backbone.models.hypernet import _gen_supernet def build_supernet_DP(flops_maximum=600): """Backbone with Dynamic output position""" set_seed() model, sta_num, size_factor = _gen_supernet( flops_minimum=0, flops_maximum=flops_maximum, DP=True, num_classes=1000, drop_rate=0.0, global_pool='avg', resunit=False, dil_conv=False, slice=4) return model, sta_num if __name__ == '__main__': _, sta_num = build_supernet(flops_maximum=600) print(sta_num)
[ 11748, 299, 32152, 355, 45941, 198, 11748, 28034, 198, 6738, 9195, 13, 27530, 13, 1891, 15992, 13, 27530, 13, 49229, 3262, 1330, 4808, 5235, 62, 16668, 3262, 628, 628, 198, 4299, 1382, 62, 16668, 3262, 62, 6322, 7, 2704, 2840, 62, 47033, 28, 8054, 2599, 198, 220, 220, 220, 37227, 7282, 15992, 351, 26977, 5072, 2292, 37811, 198, 220, 220, 220, 900, 62, 28826, 3419, 198, 220, 220, 220, 2746, 11, 336, 64, 62, 22510, 11, 2546, 62, 31412, 796, 4808, 5235, 62, 16668, 3262, 7, 198, 220, 220, 220, 220, 220, 220, 220, 781, 2840, 62, 39504, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 781, 2840, 62, 47033, 28, 2704, 2840, 62, 47033, 11, 198, 220, 220, 220, 220, 220, 220, 220, 27704, 28, 17821, 11, 198, 220, 220, 220, 220, 220, 220, 220, 997, 62, 37724, 28, 12825, 11, 198, 220, 220, 220, 220, 220, 220, 220, 4268, 62, 4873, 28, 15, 13, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 3298, 62, 7742, 11639, 615, 70, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 581, 20850, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 11844, 62, 42946, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 16416, 28, 19, 8, 628, 220, 220, 220, 1441, 2746, 11, 336, 64, 62, 22510, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 4808, 11, 336, 64, 62, 22510, 796, 1382, 62, 16668, 3262, 7, 2704, 2840, 62, 47033, 28, 8054, 8, 198, 220, 220, 220, 3601, 7, 38031, 62, 22510, 8, 198 ]
2.194853
272
"Utilities for asking for and processing Morse Code signals." from typing import Final from ktane import ask __all__ = ["valid_morse", "decode", "ask_word"] MORSE_ALPHABET: Final = { "a": ".-", "b": "-...", "c": "-.-.", "d": "-..", "e": ".", "f": "..-.", "g": "--.", "h": "....", "i": "..", "j": ".---", "k": "-.-", "l": ".-..", "m": "--", "n": "-.", "o": "---", "p": ".--.", "q": "--.-", "r": ".-.", "s": "...", "t": "-", "u": "..-", "v": "...-", "w": ".--", "x": "-..-", "y": "-.--", "z": "--..", "0": "-----", "1": ".----", "2": "..---", "3": "...--", "4": "....-", "5": ".....", "6": "-....", "7": "--...", "8": "---..", "9": "----." } INVERSE_MORSE_ALPHABET: Final = {v: k for k, v in MORSE_ALPHABET.items()} def valid_morse(text: str) -> bool: "Determine whether a string is valid Morse code." chars = text.split() return all(c in INVERSE_MORSE_ALPHABET for c in chars) def decode(code: str) -> str: "Convert a Morse code string into regular text." chars = code.split() return "".join(INVERSE_MORSE_ALPHABET[char] for char in chars) def ask_word() -> str: "Get a Morse code string from the user and convert it to a word." code = ask.str_from_func(valid_morse) return decode(code)
[ 1, 18274, 2410, 329, 4737, 329, 290, 7587, 44049, 6127, 10425, 526, 198, 198, 6738, 19720, 1330, 8125, 198, 198, 6738, 479, 83, 1531, 1330, 1265, 198, 198, 834, 439, 834, 796, 14631, 12102, 62, 4491, 325, 1600, 366, 12501, 1098, 1600, 366, 2093, 62, 4775, 8973, 198, 198, 44, 1581, 5188, 62, 1847, 11909, 6242, 2767, 25, 8125, 796, 1391, 198, 220, 220, 220, 366, 64, 1298, 366, 7874, 1600, 198, 220, 220, 220, 366, 65, 1298, 27444, 9313, 11, 198, 220, 220, 220, 366, 66, 1298, 27444, 7874, 33283, 198, 220, 220, 220, 366, 67, 1298, 27444, 492, 1600, 198, 220, 220, 220, 366, 68, 1298, 366, 33283, 198, 220, 220, 220, 366, 69, 1298, 366, 492, 12, 33283, 198, 220, 220, 220, 366, 70, 1298, 366, 438, 33283, 198, 220, 220, 220, 366, 71, 1298, 366, 1106, 1600, 198, 220, 220, 220, 366, 72, 1298, 366, 492, 1600, 198, 220, 220, 220, 366, 73, 1298, 27071, 6329, 1600, 198, 220, 220, 220, 366, 74, 1298, 27444, 7874, 1600, 198, 220, 220, 220, 366, 75, 1298, 366, 7874, 492, 1600, 198, 220, 220, 220, 366, 76, 1298, 366, 438, 1600, 198, 220, 220, 220, 366, 77, 1298, 27444, 33283, 198, 220, 220, 220, 366, 78, 1298, 366, 6329, 1600, 198, 220, 220, 220, 366, 79, 1298, 366, 9816, 33283, 198, 220, 220, 220, 366, 80, 1298, 366, 438, 7874, 1600, 198, 220, 220, 220, 366, 81, 1298, 366, 7874, 33283, 198, 220, 220, 220, 366, 82, 1298, 366, 9313, 11, 198, 220, 220, 220, 366, 83, 1298, 27444, 1600, 198, 220, 220, 220, 366, 84, 1298, 366, 492, 12, 1600, 198, 220, 220, 220, 366, 85, 1298, 27896, 12, 1600, 198, 220, 220, 220, 366, 86, 1298, 366, 9816, 1600, 198, 220, 220, 220, 366, 87, 1298, 27444, 492, 12, 1600, 198, 220, 220, 220, 366, 88, 1298, 27444, 9816, 1600, 198, 220, 220, 220, 366, 89, 1298, 366, 438, 492, 1600, 198, 220, 220, 220, 366, 15, 1298, 366, 30934, 1600, 198, 220, 220, 220, 366, 16, 1298, 27071, 650, 1600, 198, 220, 220, 220, 366, 17, 1298, 366, 492, 6329, 1600, 198, 220, 220, 220, 366, 18, 1298, 27896, 438, 1600, 198, 220, 220, 220, 366, 19, 1298, 366, 1106, 12, 1600, 198, 220, 220, 220, 366, 20, 1298, 366, 1106, 33283, 198, 220, 220, 220, 366, 21, 1298, 27444, 1106, 1600, 198, 220, 220, 220, 366, 22, 1298, 366, 438, 9313, 11, 198, 220, 220, 220, 366, 23, 1298, 366, 6329, 492, 1600, 198, 220, 220, 220, 366, 24, 1298, 366, 650, 526, 198, 92, 198, 198, 1268, 28884, 36, 62, 44, 1581, 5188, 62, 1847, 11909, 6242, 2767, 25, 8125, 796, 1391, 85, 25, 479, 329, 479, 11, 410, 287, 35208, 5188, 62, 1847, 11909, 6242, 2767, 13, 23814, 3419, 92, 628, 198, 4299, 4938, 62, 4491, 325, 7, 5239, 25, 965, 8, 4613, 20512, 25, 198, 220, 220, 220, 366, 35, 2357, 3810, 1771, 257, 4731, 318, 4938, 44049, 2438, 526, 198, 220, 220, 220, 34534, 796, 2420, 13, 35312, 3419, 198, 220, 220, 220, 1441, 477, 7, 66, 287, 3268, 28884, 36, 62, 44, 1581, 5188, 62, 1847, 11909, 6242, 2767, 329, 269, 287, 34534, 8, 628, 198, 4299, 36899, 7, 8189, 25, 965, 8, 4613, 965, 25, 198, 220, 220, 220, 366, 3103, 1851, 257, 44049, 2438, 4731, 656, 3218, 2420, 526, 198, 220, 220, 220, 34534, 796, 2438, 13, 35312, 3419, 198, 220, 220, 220, 1441, 366, 1911, 22179, 7, 1268, 28884, 36, 62, 44, 1581, 5188, 62, 1847, 11909, 6242, 2767, 58, 10641, 60, 329, 1149, 287, 34534, 8, 628, 198, 4299, 1265, 62, 4775, 3419, 4613, 965, 25, 198, 220, 220, 220, 366, 3855, 257, 44049, 2438, 4731, 422, 262, 2836, 290, 10385, 340, 284, 257, 1573, 526, 198, 220, 220, 220, 2438, 796, 1265, 13, 2536, 62, 6738, 62, 20786, 7, 12102, 62, 4491, 325, 8, 198, 220, 220, 220, 1441, 36899, 7, 8189, 8, 198 ]
2.08953
659
import npyscreen import pyperclip import createVm import main import popup import selectableGrid import virtualMachine
[ 11748, 45941, 28349, 1361, 198, 11748, 12972, 525, 15036, 198, 198, 11748, 2251, 53, 76, 198, 11748, 1388, 198, 11748, 46207, 198, 11748, 2922, 540, 41339, 198, 11748, 7166, 37573, 198 ]
3.870968
31
import hashlib import socket import unittest from io import BytesIO from os import remove as rm from os.path import exists from time import sleep import tests.test_helpers as h if __name__ == '__main__': unittest.main()
[ 11748, 12234, 8019, 198, 11748, 17802, 198, 11748, 555, 715, 395, 198, 6738, 33245, 1330, 2750, 4879, 9399, 198, 6738, 28686, 1330, 4781, 355, 42721, 198, 6738, 28686, 13, 6978, 1330, 7160, 198, 6738, 640, 1330, 3993, 198, 198, 11748, 5254, 13, 9288, 62, 16794, 364, 355, 289, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
3.150685
73
#!/usr/bin/env python2.7 import sys import pymongo import os import click import datetime import rvo.utils as utils from rvo import __version__ import rvo.config command_folder = os.path.join(os.path.dirname(__file__), 'commands') CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) # rvo command class # base help message @click.command(cls=rvoCommands, context_settings=CONTEXT_SETTINGS, help=""" Manage text data on commandline \b 888,8, Y8b Y888P e88 88e 888 " Y8b Y8P d888 888b 888 Y8b " Y888 888P 888 Y8P "88 88" For the sake of your own data being managed by you and only you! """) @click.version_option(version=__version__, prog_name="rvo") @click.pass_context if __name__ == '__main__': cli()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 17, 13, 22, 198, 198, 11748, 25064, 198, 11748, 279, 4948, 25162, 198, 11748, 28686, 198, 11748, 3904, 198, 11748, 4818, 8079, 198, 11748, 374, 13038, 13, 26791, 355, 3384, 4487, 198, 6738, 374, 13038, 1330, 11593, 9641, 834, 198, 11748, 374, 13038, 13, 11250, 198, 198, 21812, 62, 43551, 796, 28686, 13, 6978, 13, 22179, 7, 418, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 828, 705, 9503, 1746, 11537, 198, 10943, 32541, 62, 28480, 51, 20754, 796, 8633, 7, 16794, 62, 18076, 62, 14933, 28, 17816, 12, 71, 3256, 705, 438, 16794, 6, 12962, 198, 198, 2, 374, 13038, 3141, 1398, 198, 198, 2, 2779, 1037, 3275, 198, 31, 12976, 13, 21812, 7, 565, 82, 28, 81, 13038, 6935, 1746, 11, 4732, 62, 33692, 28, 10943, 32541, 62, 28480, 51, 20754, 11, 198, 16794, 2625, 15931, 198, 5124, 496, 2420, 1366, 319, 3141, 1370, 198, 198, 59, 65, 198, 28011, 11, 23, 11, 575, 23, 65, 575, 28011, 47, 220, 304, 3459, 9193, 68, 198, 28011, 366, 220, 220, 575, 23, 65, 575, 23, 47, 220, 288, 28011, 807, 3459, 65, 198, 28011, 220, 220, 220, 220, 220, 575, 23, 65, 366, 220, 220, 575, 28011, 807, 3459, 47, 198, 28011, 220, 220, 220, 220, 220, 220, 575, 23, 47, 220, 220, 220, 220, 366, 3459, 9193, 1, 198, 198, 1890, 262, 11060, 286, 534, 898, 1366, 852, 5257, 198, 1525, 345, 290, 691, 345, 0, 198, 198, 15931, 4943, 198, 31, 12976, 13, 9641, 62, 18076, 7, 9641, 28, 834, 9641, 834, 11, 1172, 62, 3672, 2625, 81, 13038, 4943, 198, 31, 12976, 13, 6603, 62, 22866, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 537, 72, 3419, 628 ]
2.488294
299
# -*- coding: utf-8 -*- """ This module contains variables that can be changed, but are not exposed to non-expert users. """ import os import multiprocessing #============================================================================== #============================================================================== SCENARIOS = ['india_base'] SECTORS = ['res','com','ind'] SECTOR_NAMES = {'res':'Residential','com':'Commercial','ind':'Industrial'} TECHS = [['solar']] TECH_MODES = ['elec'] BA_COLUMN = 'state_id' #geo id column that data is available at such as control_reg_id, state_id, district_id etc. #============================================================================== # get the path of the current file #============================================================================== MODEL_PATH = os.path.dirname(os.path.abspath(__file__)) #============================================================================== # model start year #============================================================================== START_YEAR = 2016 #============================================================================== # local cores #============================================================================== LOCAL_CORES = int(multiprocessing.cpu_count() / 2) #============================================================================== # silence some output #============================================================================== VERBOSE = False #============================================================================== # run a smaller agent_df for debugging #============================================================================== SAMPLE_PCT = 1 #============================================================================== # Runtime Tests #============================================================================== NULL_COLUMN_EXCEPTIONS = ['state_incentives', 'pct_state_incentives', 'batt_dispatch_profile', 'export_tariff_results','carbon_price_cents_per_kwh'] # 'market_share_last_year', 'max_market_share_last_year', 'adopters_cum_last_year', 'market_value_last_year', 'initial_number_of_adopters', 'initial_pv_kw', 'initial_market_share', 'initial_market_value', 'system_kw_cum_last_year', 'new_system_kw', 'batt_kw_cum_last_year', 'batt_kwh_cum_last_year', CHANGED_DTYPES_EXCEPTIONS = [] MISSING_COLUMN_EXCEPTIONS = []
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 1212, 8265, 4909, 9633, 326, 460, 307, 3421, 11, 475, 389, 407, 7362, 284, 1729, 12, 1069, 11766, 2985, 13, 198, 37811, 198, 11748, 28686, 198, 11748, 18540, 305, 919, 278, 198, 198, 2, 23926, 25609, 855, 198, 198, 2, 23926, 25609, 855, 198, 6173, 1677, 33604, 2640, 796, 37250, 521, 544, 62, 8692, 20520, 198, 50, 9782, 20673, 796, 37250, 411, 41707, 785, 41707, 521, 20520, 198, 50, 9782, 1581, 62, 45, 29559, 796, 1391, 6, 411, 10354, 6, 4965, 35599, 41707, 785, 10354, 6, 48401, 41707, 521, 10354, 6, 35848, 4454, 6, 92, 198, 51, 2943, 7998, 796, 16410, 6, 82, 6192, 6, 11907, 198, 51, 25994, 62, 33365, 1546, 796, 37250, 11129, 66, 20520, 198, 4339, 62, 25154, 5883, 45, 796, 705, 5219, 62, 312, 6, 1303, 469, 78, 4686, 5721, 326, 1366, 318, 1695, 379, 884, 355, 1630, 62, 2301, 62, 312, 11, 1181, 62, 312, 11, 4783, 62, 312, 3503, 13, 220, 198, 198, 2, 23926, 25609, 855, 198, 2, 220, 220, 651, 262, 3108, 286, 262, 1459, 2393, 198, 2, 23926, 25609, 855, 198, 33365, 3698, 62, 34219, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 397, 2777, 776, 7, 834, 7753, 834, 4008, 198, 198, 2, 23926, 25609, 855, 198, 2, 220, 220, 2746, 923, 614, 220, 198, 2, 23926, 25609, 855, 198, 2257, 7227, 62, 56, 17133, 796, 1584, 198, 198, 2, 23926, 25609, 855, 198, 2, 220, 220, 1957, 21758, 198, 2, 23926, 25609, 855, 198, 29701, 1847, 62, 44879, 1546, 796, 493, 7, 16680, 541, 305, 919, 278, 13, 36166, 62, 9127, 3419, 1220, 362, 8, 198, 198, 2, 23926, 25609, 855, 198, 2, 220, 220, 9550, 617, 5072, 198, 2, 23926, 25609, 855, 198, 5959, 33, 14058, 796, 10352, 198, 198, 2, 23926, 25609, 855, 198, 2, 220, 220, 1057, 257, 4833, 5797, 62, 7568, 329, 28769, 198, 2, 23926, 25609, 855, 198, 49302, 16437, 62, 47, 4177, 796, 352, 198, 198, 2, 23926, 25609, 855, 198, 2, 220, 43160, 30307, 198, 2, 23926, 25609, 855, 198, 33991, 62, 25154, 5883, 45, 62, 6369, 42006, 11053, 796, 37250, 5219, 62, 42816, 1083, 3256, 705, 79, 310, 62, 5219, 62, 42816, 1083, 3256, 705, 65, 1078, 62, 6381, 17147, 62, 13317, 3256, 705, 39344, 62, 18870, 733, 62, 43420, 41707, 29255, 62, 20888, 62, 66, 658, 62, 525, 62, 74, 1929, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 705, 10728, 62, 20077, 62, 12957, 62, 1941, 3256, 705, 9806, 62, 10728, 62, 20077, 62, 12957, 62, 1941, 3256, 705, 324, 404, 1010, 62, 36340, 62, 12957, 62, 1941, 3256, 705, 10728, 62, 8367, 62, 12957, 62, 1941, 3256, 705, 36733, 62, 17618, 62, 1659, 62, 324, 404, 1010, 3256, 705, 36733, 62, 79, 85, 62, 46265, 3256, 705, 36733, 62, 10728, 62, 20077, 3256, 705, 36733, 62, 10728, 62, 8367, 3256, 705, 10057, 62, 46265, 62, 36340, 62, 12957, 62, 1941, 3256, 705, 3605, 62, 10057, 62, 46265, 3256, 705, 65, 1078, 62, 46265, 62, 36340, 62, 12957, 62, 1941, 3256, 705, 65, 1078, 62, 74, 1929, 62, 36340, 62, 12957, 62, 1941, 3256, 198, 3398, 15567, 1961, 62, 35, 9936, 47, 1546, 62, 6369, 42006, 11053, 796, 17635, 198, 44, 16744, 2751, 62, 25154, 5883, 45, 62, 6369, 42006, 11053, 796, 17635 ]
4.16323
582
from django.conf import settings from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models STATE_CHOICES = ((settings.NC_KEY, "North Carolina"),) STATUS_CHOICES = ( ("running", "Running"), ("error", "Error"), ("finished", "Finished"), ) GEOGRAPHY_CHOICES = ( ("county", "County"), ("place", "Place"), )
[ 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 7295, 13, 12102, 2024, 1330, 5436, 11395, 47139, 1352, 11, 1855, 11395, 47139, 1352, 198, 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 198, 44724, 62, 44899, 34444, 796, 14808, 33692, 13, 7792, 62, 20373, 11, 366, 14157, 5913, 12340, 8, 198, 198, 35744, 2937, 62, 44899, 34444, 796, 357, 198, 220, 220, 220, 5855, 20270, 1600, 366, 28768, 12340, 198, 220, 220, 220, 5855, 18224, 1600, 366, 12331, 12340, 198, 220, 220, 220, 5855, 43952, 1600, 366, 18467, 1348, 12340, 198, 8, 198, 198, 38, 4720, 10761, 31300, 56, 62, 44899, 34444, 796, 357, 198, 220, 220, 220, 5855, 9127, 88, 1600, 366, 12332, 88, 12340, 198, 220, 220, 220, 5855, 5372, 1600, 366, 27271, 12340, 198, 8, 628, 628, 628 ]
2.791045
134
from __future__ import absolute_import import cStringIO import types __name__ = 'pyrehol' __author__ = 'James Brown <[email protected]>' version_info = (0, 3) __version__ = '.'.join(map(str, version_info)) INDENT_CHAR = ' ' PREDEFINED_SERVICES = frozenset([ 'any', 'anystateless', 'all', 'AH', 'apcupsd', 'apcupsdnis', 'aptproxy', 'asterisk', 'cups', 'cvspserver', 'darkstat', 'daytime', 'dcc', 'dcpp', 'dhcprelay', 'dict', 'distcc', 'dns', 'echo', 'eserver', 'ESP', 'finger', 'gift', 'giftui', 'gkrellmd', 'GRE', 'h323', 'heartbeat', 'http', 'https', 'iax', 'iax2', 'icmp', 'ICMP', 'icp', 'ident', 'imap', 'imaps', 'irc', 'isakmp', 'jabber', 'jabberd', 'ldap', 'ldaps', 'lpd', 'mms', 'msn', 'msnp', 'mysql', 'netbackup', 'nfs', 'nntp', 'nntps', 'ntp', 'nut', 'nxserver', 'openvpn', 'oracle', 'OSPF', 'pop3', 'pop3s', 'portmap', 'postgres', 'privoxy', 'radius', 'radiusold', 'radiusoldproxy', 'radiusproxy', 'rdp', 'rndc', 'rsync', 'rtp', 'sip', 'smtp', 'smtps', 'snmp', 'snmptrap', 'socks', 'squid', 'ssh', 'stun', 'submission', 'sunrpc', 'swat', 'syslog', 'telnet', 'time', 'upnp', 'uucp', 'vmware', 'vmwareauth', 'vmwareweb', 'vnc', 'webcache', 'webmin', 'whois', 'xdmcp', ]) class Pyrehol(object): """Top-level wrapper for a Firehol config""" def emit(self, out_fo=None): """Write out to a file descriptor. If one isn't passed, prints to standard out. :param out_fo: A file-like object or None """ print_it = False if out_fo is None: out_fo = cStringIO.StringIO() print_it = True out_fo.write('version %d\n\n' % self.version) if self.leader_lines: out_fo.write('\n'.join(self.leader_lines)) out_fo.write('\n\n') for thing in sorted(self.service_defines.values()): thing.emit(out_fo) out_fo.write('\n') for thing in self.contents: thing.emit(out_fo) out_fo.write('\n') if self.trailer_lines: out_fo.write('\n'.join(self.trailer_lines)) out_fo.write('\n\n') if print_it: print out_fo.getvalue() def define_service(self, service_name, server_portspec, client_portspec='default'): """Add a new service to Firehol (for use in server/client blocks later). :param service_name: Name for the service, suitable for use as a bash variable name :param server_portspec: Port specification for the server side (example: "tcp/80 tcp/443") :param client_portspec: Port specification for the client side (example: "any") """ new_define = _PyreholService( service_name, server_portspec, client_portspec, root=self ) if service_name in self.services: assert new_define == self.service_defines[service_name],\ '%s != %s' % (new_define, self.service_defines[service_name]) else: self.service_defines[service_name] = new_define self.services.add(service_name)
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 198, 11748, 269, 10100, 9399, 198, 11748, 3858, 198, 198, 834, 3672, 834, 796, 705, 9078, 260, 3937, 6, 198, 834, 9800, 834, 796, 705, 14731, 4373, 1279, 73, 33282, 31, 18478, 13, 785, 29, 6, 198, 9641, 62, 10951, 796, 357, 15, 11, 513, 8, 198, 834, 9641, 834, 796, 705, 2637, 13, 22179, 7, 8899, 7, 2536, 11, 2196, 62, 10951, 4008, 198, 198, 12115, 3525, 62, 38019, 796, 705, 220, 705, 198, 198, 4805, 1961, 36, 20032, 1961, 62, 35009, 53, 34444, 796, 8400, 8247, 316, 26933, 198, 220, 220, 220, 705, 1092, 3256, 705, 1092, 5219, 1203, 3256, 705, 439, 3256, 198, 220, 220, 220, 705, 18429, 3256, 705, 499, 66, 4739, 67, 3256, 705, 499, 66, 4739, 67, 21361, 3256, 705, 2373, 36436, 3256, 705, 1603, 1984, 3256, 705, 66, 4739, 3256, 198, 220, 220, 220, 705, 66, 14259, 862, 18497, 3256, 705, 21953, 14269, 3256, 705, 820, 2435, 3256, 705, 67, 535, 3256, 705, 17896, 381, 3256, 705, 34985, 13155, 2411, 323, 3256, 705, 11600, 3256, 198, 220, 220, 220, 705, 17080, 535, 3256, 705, 67, 5907, 3256, 705, 30328, 3256, 705, 274, 18497, 3256, 705, 1546, 47, 3256, 705, 35461, 3256, 705, 70, 2135, 3256, 705, 70, 2135, 9019, 3256, 198, 220, 220, 220, 705, 70, 74, 11252, 9132, 3256, 705, 28934, 3256, 705, 71, 32637, 3256, 705, 11499, 12945, 3256, 705, 4023, 3256, 705, 5450, 3256, 705, 544, 87, 3256, 705, 544, 87, 17, 3256, 198, 220, 220, 220, 705, 291, 3149, 3256, 705, 2149, 7378, 3256, 705, 291, 79, 3256, 705, 738, 3256, 705, 320, 499, 3256, 705, 320, 1686, 3256, 705, 1980, 3256, 705, 271, 461, 3149, 3256, 198, 220, 220, 220, 705, 27935, 527, 3256, 705, 27935, 527, 67, 3256, 705, 335, 499, 3256, 705, 335, 1686, 3256, 705, 75, 30094, 3256, 705, 76, 907, 3256, 705, 907, 77, 3256, 705, 907, 37659, 3256, 198, 220, 220, 220, 705, 28744, 13976, 3256, 705, 3262, 1891, 929, 3256, 705, 77, 9501, 3256, 705, 77, 429, 79, 3256, 705, 77, 429, 862, 3256, 705, 429, 79, 3256, 705, 14930, 3256, 705, 77, 87, 15388, 3256, 705, 9654, 85, 21999, 3256, 198, 220, 220, 220, 705, 273, 6008, 3256, 705, 2640, 42668, 3256, 705, 12924, 18, 3256, 705, 12924, 18, 82, 3256, 705, 634, 8899, 3256, 705, 7353, 34239, 3256, 705, 13776, 23536, 3256, 198, 220, 220, 220, 705, 42172, 3256, 705, 42172, 727, 3256, 705, 42172, 727, 36436, 3256, 705, 42172, 36436, 3256, 705, 4372, 79, 3256, 705, 81, 358, 66, 3256, 198, 220, 220, 220, 705, 81, 27261, 3256, 705, 17034, 79, 3256, 705, 82, 541, 3256, 705, 5796, 34788, 3256, 705, 5796, 83, 862, 3256, 705, 16184, 3149, 3256, 705, 16184, 76, 457, 2416, 3256, 705, 82, 3320, 3256, 198, 220, 220, 220, 705, 16485, 312, 3256, 705, 45824, 3256, 705, 301, 403, 3256, 705, 7266, 3411, 3256, 705, 19155, 81, 14751, 3256, 705, 2032, 265, 3256, 705, 17597, 6404, 3256, 705, 37524, 3262, 3256, 198, 220, 220, 220, 705, 2435, 3256, 705, 929, 37659, 3256, 705, 84, 1229, 79, 3256, 705, 14761, 1574, 3256, 705, 14761, 1574, 18439, 3256, 705, 14761, 1574, 12384, 3256, 705, 85, 10782, 3256, 198, 220, 220, 220, 705, 12384, 23870, 3256, 705, 12384, 1084, 3256, 705, 8727, 271, 3256, 705, 24954, 76, 13155, 3256, 198, 12962, 628, 628, 198, 4871, 9485, 260, 3937, 7, 15252, 2599, 198, 220, 220, 220, 37227, 9126, 12, 5715, 29908, 329, 257, 3764, 3937, 4566, 37811, 628, 220, 220, 220, 825, 27588, 7, 944, 11, 503, 62, 6513, 28, 14202, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 16594, 503, 284, 257, 2393, 43087, 13, 1002, 530, 2125, 470, 3804, 11, 20842, 284, 3210, 503, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 503, 62, 6513, 25, 317, 2393, 12, 2339, 2134, 393, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 62, 270, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 611, 503, 62, 6513, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 6513, 796, 269, 10100, 9399, 13, 10100, 9399, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 62, 270, 796, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 6513, 13, 13564, 10786, 9641, 4064, 67, 59, 77, 59, 77, 6, 4064, 2116, 13, 9641, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 27940, 62, 6615, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 6513, 13, 13564, 10786, 59, 77, 4458, 22179, 7, 944, 13, 27940, 62, 6615, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 6513, 13, 13564, 10786, 59, 77, 59, 77, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1517, 287, 23243, 7, 944, 13, 15271, 62, 4299, 1127, 13, 27160, 3419, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1517, 13, 368, 270, 7, 448, 62, 6513, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 6513, 13, 13564, 10786, 59, 77, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1517, 287, 2116, 13, 3642, 658, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1517, 13, 368, 270, 7, 448, 62, 6513, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 6513, 13, 13564, 10786, 59, 77, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 9535, 5329, 62, 6615, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 6513, 13, 13564, 10786, 59, 77, 4458, 22179, 7, 944, 13, 9535, 5329, 62, 6615, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 6513, 13, 13564, 10786, 59, 77, 59, 77, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 611, 3601, 62, 270, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 503, 62, 6513, 13, 1136, 8367, 3419, 628, 220, 220, 220, 825, 8160, 62, 15271, 7, 944, 11, 2139, 62, 3672, 11, 4382, 62, 3742, 43106, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5456, 62, 3742, 43106, 11639, 12286, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 4550, 257, 649, 2139, 284, 3764, 3937, 357, 1640, 779, 287, 4382, 14, 16366, 7021, 1568, 737, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 2139, 62, 3672, 25, 6530, 329, 262, 2139, 11, 11080, 329, 779, 355, 257, 27334, 7885, 1438, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 4382, 62, 3742, 43106, 25, 4347, 20855, 329, 262, 4382, 1735, 357, 20688, 25, 366, 83, 13155, 14, 1795, 48265, 14, 34938, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 17143, 5456, 62, 3742, 43106, 25, 4347, 20855, 329, 262, 5456, 1735, 357, 20688, 25, 366, 1092, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 649, 62, 13086, 796, 4808, 20519, 260, 3937, 16177, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2139, 62, 3672, 11, 4382, 62, 3742, 43106, 11, 5456, 62, 3742, 43106, 11, 6808, 28, 944, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2139, 62, 3672, 287, 2116, 13, 30416, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6818, 649, 62, 13086, 6624, 2116, 13, 15271, 62, 4299, 1127, 58, 15271, 62, 3672, 4357, 59, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 4, 82, 14512, 4064, 82, 6, 4064, 357, 3605, 62, 13086, 11, 2116, 13, 15271, 62, 4299, 1127, 58, 15271, 62, 3672, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 15271, 62, 4299, 1127, 58, 15271, 62, 3672, 60, 796, 649, 62, 13086, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30416, 13, 2860, 7, 15271, 62, 3672, 8, 628, 628, 628, 628, 628, 628, 628 ]
2.185524
1,423
# Tests (scarce) for win32print module import os import unittest import win32print as wprn if __name__ == "__main__": unittest.main()
[ 2, 30307, 357, 13034, 344, 8, 329, 1592, 2624, 4798, 8265, 198, 198, 11748, 28686, 198, 11748, 555, 715, 395, 198, 198, 11748, 1592, 2624, 4798, 355, 266, 1050, 77, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
2.648148
54
#!/usr/bin/env python3 """ Create dataset and experiments. A dataset is a directory with subdirectories, one subdir per class. An experiment is a directory subdirectories, one subdir per participant. """ import os from os.path import join as pjoin from os import listdir as ld import numpy as np import shutil import sys from PIL import Image import numpy as np import math from torchvision import transforms from ..helper import human_categories as hc from .. import constants as consts def resize_crop_image(input_file, resize_size, crop_size): """Replace input_file with resized and cropped version (png).""" img = Image.open(input_file) t = transforms.Compose([transforms.Resize(resize_size), transforms.CenterCrop(crop_size)]) new_img = t(img) os.remove(input_file) new_img.save(input_file.replace(".JPEG", ".png"), 'png') def create_experiment(expt_name, expt_abbreviation, expt_source_dir, expt_target_dir, only_dnn=True, num_subjects=1, rng=None): """Create human / CNN experiment. parameters: - only_dnn: boolean indicating whether this is a DNN experiment or not (if not, a human experiment will be created.) """ if not only_dnn: assert rng is not None, "Please specify random number generator (rng)!" assert("_" not in expt_name), "no '_' in experiment name!" assert(os.path.exists(expt_source_dir)), "directory "+expt_source_dir+" does not exist." for i in range(0, num_subjects+1): if i==0: subject_abbreviation = "dnn" subject_name="dnn" else: subject_abbreviation = "s"+get_leading_zeros(i, 2) subject_name = "subject-"+get_leading_zeros(i, 2) print("Creating experiment for subject: '"+subject_name+"'") target_dir = pjoin(expt_target_dir, expt_name, subject_name, "session-1") if os.path.exists(target_dir): print("Error: target directory "+target_dir+" does already exist.") sys.exit(1) else: os.makedirs(target_dir) img_list = [] for c in sorted(hc.get_human_object_recognition_categories()): for x in sorted(ld(pjoin(expt_source_dir, c))): input_file = pjoin(expt_source_dir, c, x) img_list.append(input_file) order = np.arange(len(img_list)) if i != 0: rng.shuffle(order) for i, img_index in enumerate(order): input_file = img_list[img_index] imgname = input_file.split("/")[-1] correct_category = input_file.split("/")[-2] condition = "0" target_image_path = pjoin(target_dir, (get_leading_zeros(i+1)+"_"+ expt_abbreviation+"_"+ subject_abbreviation+"_"+ condition+"_"+ correct_category+"_"+ "00_"+ imgname)) shutil.copyfile(input_file, target_image_path)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 37811, 198, 16447, 27039, 290, 10256, 13, 198, 32, 27039, 318, 257, 8619, 351, 850, 12942, 1749, 11, 530, 850, 15908, 583, 1398, 13, 198, 2025, 6306, 318, 257, 8619, 850, 12942, 1749, 11, 530, 850, 15908, 583, 18399, 13, 198, 37811, 198, 198, 11748, 28686, 198, 6738, 28686, 13, 6978, 1330, 4654, 355, 279, 22179, 198, 6738, 28686, 1330, 1351, 15908, 355, 300, 67, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 4423, 346, 198, 11748, 25064, 198, 6738, 350, 4146, 1330, 7412, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 10688, 198, 6738, 28034, 10178, 1330, 31408, 198, 198, 6738, 11485, 2978, 525, 1330, 1692, 62, 66, 26129, 355, 289, 66, 198, 6738, 11485, 1330, 38491, 355, 1500, 82, 628, 198, 4299, 47558, 62, 31476, 62, 9060, 7, 15414, 62, 7753, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 47558, 62, 7857, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13833, 62, 7857, 2599, 198, 220, 220, 220, 37227, 3041, 5372, 5128, 62, 7753, 351, 581, 1143, 290, 48998, 2196, 357, 11134, 21387, 15931, 628, 220, 220, 220, 33705, 796, 7412, 13, 9654, 7, 15414, 62, 7753, 8, 198, 220, 220, 220, 256, 796, 31408, 13, 7293, 577, 26933, 7645, 23914, 13, 4965, 1096, 7, 411, 1096, 62, 7857, 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, 31408, 13, 23656, 34, 1773, 7, 31476, 62, 7857, 8, 12962, 198, 220, 220, 220, 649, 62, 9600, 796, 256, 7, 9600, 8, 198, 220, 220, 220, 28686, 13, 28956, 7, 15414, 62, 7753, 8, 198, 220, 220, 220, 649, 62, 9600, 13, 21928, 7, 15414, 62, 7753, 13, 33491, 7, 1911, 12889, 7156, 1600, 27071, 11134, 12340, 705, 11134, 11537, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 198, 4299, 2251, 62, 23100, 3681, 7, 1069, 457, 62, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 409, 457, 62, 397, 4679, 47625, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 409, 457, 62, 10459, 62, 15908, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 409, 457, 62, 16793, 62, 15908, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 691, 62, 67, 20471, 28, 17821, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 997, 62, 32796, 82, 28, 16, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 782, 28, 14202, 2599, 198, 220, 220, 220, 37227, 16447, 1692, 1220, 8100, 6306, 13, 628, 220, 220, 220, 10007, 25, 198, 220, 220, 220, 532, 691, 62, 67, 20471, 25, 25131, 12739, 1771, 428, 318, 257, 360, 6144, 6306, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 393, 407, 357, 361, 407, 11, 257, 1692, 6306, 481, 307, 2727, 2014, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 611, 407, 691, 62, 67, 20471, 25, 198, 220, 220, 220, 220, 220, 220, 220, 6818, 374, 782, 318, 407, 6045, 11, 366, 5492, 11986, 4738, 1271, 17301, 357, 81, 782, 8, 2474, 628, 220, 220, 220, 6818, 7203, 62, 1, 407, 287, 409, 457, 62, 3672, 828, 366, 3919, 705, 62, 6, 287, 6306, 1438, 2474, 198, 220, 220, 220, 6818, 7, 418, 13, 6978, 13, 1069, 1023, 7, 1069, 457, 62, 10459, 62, 15908, 36911, 366, 34945, 43825, 1069, 457, 62, 10459, 62, 15908, 10, 1, 857, 407, 2152, 526, 628, 220, 220, 220, 329, 1312, 287, 2837, 7, 15, 11, 997, 62, 32796, 82, 10, 16, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 611, 1312, 855, 15, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2426, 62, 397, 4679, 47625, 796, 366, 67, 20471, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2426, 62, 3672, 2625, 67, 20471, 1, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2426, 62, 397, 4679, 47625, 796, 366, 82, 1, 10, 1136, 62, 12294, 62, 9107, 418, 7, 72, 11, 362, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2426, 62, 3672, 796, 366, 32796, 21215, 10, 1136, 62, 12294, 62, 9107, 418, 7, 72, 11, 362, 8, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 32071, 6306, 329, 2426, 25, 705, 1, 10, 32796, 62, 3672, 10, 30543, 4943, 628, 220, 220, 220, 220, 220, 220, 220, 2496, 62, 15908, 796, 279, 22179, 7, 1069, 457, 62, 16793, 62, 15908, 11, 409, 457, 62, 3672, 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, 2426, 62, 3672, 11, 366, 29891, 12, 16, 4943, 628, 220, 220, 220, 220, 220, 220, 220, 611, 28686, 13, 6978, 13, 1069, 1023, 7, 16793, 62, 15908, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 12331, 25, 2496, 8619, 43825, 16793, 62, 15908, 10, 1, 857, 1541, 2152, 19570, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25064, 13, 37023, 7, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 28686, 13, 76, 4335, 17062, 7, 16793, 62, 15908, 8, 628, 220, 220, 220, 220, 220, 220, 220, 33705, 62, 4868, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 329, 269, 287, 23243, 7, 71, 66, 13, 1136, 62, 10734, 62, 15252, 62, 26243, 653, 62, 66, 26129, 3419, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 2124, 287, 23243, 7, 335, 7, 79, 22179, 7, 1069, 457, 62, 10459, 62, 15908, 11, 269, 4008, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5128, 62, 7753, 796, 279, 22179, 7, 1069, 457, 62, 10459, 62, 15908, 11, 269, 11, 2124, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 33705, 62, 4868, 13, 33295, 7, 15414, 62, 7753, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 1502, 796, 45941, 13, 283, 858, 7, 11925, 7, 9600, 62, 4868, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1312, 14512, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 782, 13, 1477, 18137, 7, 2875, 8, 628, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 11, 33705, 62, 9630, 287, 27056, 378, 7, 2875, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5128, 62, 7753, 796, 33705, 62, 4868, 58, 9600, 62, 9630, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 33705, 3672, 796, 5128, 62, 7753, 13, 35312, 7203, 14, 4943, 58, 12, 16, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3376, 62, 22872, 796, 5128, 62, 7753, 13, 35312, 7203, 14, 4943, 58, 12, 17, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4006, 796, 366, 15, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2496, 62, 9060, 62, 6978, 796, 279, 22179, 7, 16793, 62, 15908, 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, 357, 1136, 62, 12294, 62, 9107, 418, 7, 72, 10, 16, 47762, 1, 62, 1, 10, 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, 409, 457, 62, 397, 4679, 47625, 10, 1, 62, 1, 10, 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, 2426, 62, 397, 4679, 47625, 10, 1, 62, 1, 10, 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, 4006, 10, 1, 62, 1, 10, 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, 3376, 62, 22872, 10, 1, 62, 1, 10, 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, 366, 405, 62, 1, 10, 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, 33705, 3672, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4423, 346, 13, 30073, 7753, 7, 15414, 62, 7753, 11, 2496, 62, 9060, 62, 6978, 8, 628 ]
1.95807
1,741
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2017-2018 Roxanne Gibson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import asyncio import discord import datetime import youtube_dl from math import ceil from discord.ext import commands import roxbot from roxbot import guild_settings def _clear_cache(): """Clears the cache folder for the music bot. Ignores the ".gitignore" file to avoid deleting versioned files.""" for file in os.listdir("roxbot/cache"): if file != ".gitignore": os.remove("roxbot/cache/{}".format(file)) # Suppress noise about console usage from errors youtube_dl.utils.bug_reports_message = lambda: '' ytdl_format_options = { 'format': 'bestaudio/best', 'outtmpl': './roxbot/cache/%(extractor)s-%(id)s-%(title)s.%(ext)s', 'restrictfilenames': True, 'noplaylist': True, 'nocheckcertificate': True, 'ignoreerrors': False, 'logtostderr': False, 'quiet': True, 'no_warnings': True, 'default_search': 'auto', } ffmpeg_options = { 'before_options': '-nostdin', 'options': '-vn -loglevel panic --force-ipv4' } ytdl = youtube_dl.YoutubeDL(ytdl_format_options) class ModifiedFFmpegPMCAudio(discord.FFmpegPCMAudio): """Modifies the read function of FFmpegPCMAudio to add a timer. Thanks to eliza(nearlynon#3292) for teaching me how to do this"""
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 198, 36393, 13789, 198, 198, 15269, 357, 66, 8, 2177, 12, 7908, 34821, 21952, 20400, 198, 198, 5990, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 198, 1659, 428, 3788, 290, 3917, 10314, 3696, 357, 1169, 366, 25423, 12340, 284, 1730, 198, 259, 262, 10442, 1231, 17504, 11, 1390, 1231, 17385, 262, 2489, 198, 1462, 779, 11, 4866, 11, 13096, 11, 20121, 11, 7715, 11, 14983, 11, 850, 43085, 11, 290, 14, 273, 3677, 198, 22163, 444, 286, 262, 10442, 11, 290, 284, 8749, 6506, 284, 4150, 262, 10442, 318, 198, 69, 700, 1348, 284, 466, 523, 11, 2426, 284, 262, 1708, 3403, 25, 198, 198, 464, 2029, 6634, 4003, 290, 428, 7170, 4003, 2236, 307, 3017, 287, 477, 198, 22163, 444, 393, 8904, 16690, 286, 262, 10442, 13, 198, 198, 10970, 47466, 3180, 36592, 2389, 1961, 366, 1921, 3180, 1600, 42881, 34764, 56, 3963, 15529, 509, 12115, 11, 7788, 32761, 6375, 198, 3955, 49094, 11, 47783, 2751, 21728, 5626, 40880, 5390, 3336, 34764, 11015, 3963, 34482, 3398, 1565, 5603, 25382, 11, 198, 37, 46144, 7473, 317, 16652, 2149, 37232, 33079, 48933, 5357, 44521, 1268, 10913, 2751, 12529, 13, 3268, 8005, 49261, 50163, 3336, 198, 32, 24318, 20673, 6375, 27975, 38162, 9947, 367, 15173, 4877, 9348, 43031, 19146, 7473, 15529, 47666, 3955, 11, 29506, 25552, 6375, 25401, 198, 43, 3539, 25382, 11, 7655, 2767, 16879, 3268, 3537, 40282, 3963, 27342, 10659, 11, 309, 9863, 6375, 25401, 54, 24352, 11, 5923, 1797, 2751, 16034, 11, 198, 12425, 3963, 6375, 3268, 7102, 45, 24565, 13315, 3336, 47466, 6375, 3336, 23210, 6375, 25401, 5550, 1847, 20754, 3268, 3336, 198, 15821, 37485, 13, 198, 37811, 628, 198, 11748, 28686, 198, 11748, 30351, 952, 198, 11748, 36446, 198, 11748, 4818, 8079, 198, 11748, 35116, 62, 25404, 198, 6738, 10688, 1330, 2906, 346, 198, 6738, 36446, 13, 2302, 1330, 9729, 198, 198, 11748, 686, 87, 13645, 198, 6738, 686, 87, 13645, 1330, 19806, 62, 33692, 628, 198, 4299, 4808, 20063, 62, 23870, 33529, 198, 197, 37811, 34349, 945, 262, 12940, 9483, 329, 262, 2647, 10214, 13, 16583, 2850, 262, 27071, 18300, 46430, 1, 2393, 284, 3368, 34817, 2196, 276, 3696, 526, 15931, 198, 197, 1640, 2393, 287, 28686, 13, 4868, 15908, 7203, 13907, 13645, 14, 23870, 1, 2599, 198, 197, 197, 361, 2393, 14512, 27071, 18300, 46430, 1298, 198, 197, 197, 197, 418, 13, 28956, 7203, 13907, 13645, 14, 23870, 14, 90, 92, 1911, 18982, 7, 7753, 4008, 628, 198, 198, 2, 8105, 601, 7838, 546, 8624, 8748, 422, 8563, 198, 11604, 62, 25404, 13, 26791, 13, 25456, 62, 48922, 62, 20500, 796, 37456, 25, 10148, 628, 198, 88, 8671, 75, 62, 18982, 62, 25811, 796, 1391, 198, 197, 6, 18982, 10354, 705, 13466, 24051, 14, 13466, 3256, 198, 197, 6, 448, 17209, 489, 10354, 705, 19571, 13907, 13645, 14, 23870, 14, 4, 7, 2302, 40450, 8, 82, 12, 4, 7, 312, 8, 82, 12, 4, 7, 7839, 8, 82, 13, 4, 7, 2302, 8, 82, 3256, 198, 197, 821, 301, 2012, 10379, 268, 1047, 10354, 6407, 11, 198, 197, 6, 77, 404, 10724, 4868, 10354, 6407, 11, 198, 197, 6, 77, 30848, 694, 22583, 22460, 10354, 6407, 11, 198, 197, 6, 46430, 48277, 10354, 10352, 11, 198, 197, 6, 6404, 83, 455, 1082, 81, 10354, 10352, 11, 198, 197, 6, 39624, 10354, 6407, 11, 198, 197, 6, 3919, 62, 40539, 654, 10354, 6407, 11, 198, 197, 1549, 891, 1721, 62, 12947, 10354, 705, 23736, 3256, 198, 92, 198, 198, 487, 43913, 62, 25811, 796, 1391, 198, 197, 6, 19052, 62, 25811, 10354, 705, 12, 77, 455, 25194, 3256, 198, 197, 6, 25811, 10354, 705, 12, 85, 77, 532, 75, 2467, 626, 13619, 1377, 3174, 12, 541, 85, 19, 6, 198, 92, 198, 198, 88, 8671, 75, 796, 35116, 62, 25404, 13, 56, 9762, 19260, 7, 88, 8671, 75, 62, 18982, 62, 25811, 8, 628, 198, 4871, 40499, 5777, 43913, 5868, 8141, 463, 952, 7, 15410, 585, 13, 5777, 43913, 5662, 5673, 463, 952, 2599, 198, 197, 37811, 5841, 6945, 262, 1100, 2163, 286, 18402, 43913, 5662, 5673, 463, 952, 284, 751, 257, 19781, 13, 198, 197, 9690, 284, 1288, 23638, 7, 40093, 6213, 261, 2, 18, 32759, 8, 329, 7743, 502, 703, 284, 466, 428, 37811, 628, 628 ]
3.165289
726
""" Slack Bot Untrack Command """ import logging from ebr_trackerbot.bot import register_command, get_storage def untrack_command(text, result, payload, config, commands): """ Slack Bot Untrack Command """ logging.debug("Untrack command") test = result.group(1) get_storage()["delete_for_user"](payload["data"]["user"], test) payload["web_client"].chat_postMessage( channel=payload["data"]["channel"], text="Tracking was stopped for test *" + test + "*", thread_ts=payload["data"]["ts"], ) register_command( "untrack", "Stops test tracking. Command syntax: untrack full_testname", "^untrack ([^ ]+)$", untrack_command ) logging.info("Untrack command registered")
[ 37811, 198, 11122, 441, 18579, 26970, 39638, 9455, 198, 37811, 198, 11748, 18931, 198, 6738, 304, 1671, 62, 2213, 10735, 13645, 13, 13645, 1330, 7881, 62, 21812, 11, 651, 62, 35350, 628, 198, 4299, 1418, 39638, 62, 21812, 7, 5239, 11, 1255, 11, 21437, 11, 4566, 11, 9729, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 36256, 18579, 26970, 39638, 9455, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 18931, 13, 24442, 7203, 35792, 39638, 3141, 4943, 628, 220, 220, 220, 1332, 796, 1255, 13, 8094, 7, 16, 8, 198, 220, 220, 220, 651, 62, 35350, 3419, 14692, 33678, 62, 1640, 62, 7220, 8973, 7, 15577, 2220, 14692, 7890, 1, 7131, 1, 7220, 33116, 1332, 8, 628, 220, 220, 220, 21437, 14692, 12384, 62, 16366, 1, 4083, 17006, 62, 7353, 12837, 7, 198, 220, 220, 220, 220, 220, 220, 220, 6518, 28, 15577, 2220, 14692, 7890, 1, 7131, 1, 17620, 33116, 198, 220, 220, 220, 220, 220, 220, 220, 2420, 2625, 2898, 5430, 373, 5025, 329, 1332, 1635, 1, 1343, 1332, 1343, 366, 9, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 4704, 62, 912, 28, 15577, 2220, 14692, 7890, 1, 7131, 1, 912, 33116, 198, 220, 220, 220, 1267, 628, 198, 30238, 62, 21812, 7, 198, 220, 220, 220, 366, 403, 11659, 1600, 366, 1273, 2840, 1332, 9646, 13, 9455, 15582, 25, 1418, 39638, 1336, 62, 9288, 3672, 1600, 366, 61, 403, 11659, 29565, 61, 2361, 28988, 3, 1600, 1418, 39638, 62, 21812, 198, 8, 198, 6404, 2667, 13, 10951, 7203, 35792, 39638, 3141, 6823, 4943, 198 ]
2.782443
262
# EGM skimmer # Author: Rafael Lopes de Sa import FWCore.ParameterSet.Config as cms # Run with the 2017 detector from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 process = cms.Process('SKIM',Run2_2017) # Import the standard packages for reconstruction and digitization process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.Digi_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.RawToDigi_cff') process.load('Configuration.StandardSequences.L1Reco_cff') process.load('Configuration.StandardSequences.Reconstruction_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('RecoEgamma.EgammaMCTools.pfClusterMatchedToPhotonsSelector_cfi') # Global Tag configuration ... just using the same as in the RelVal from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, '81X_upgrade2017_realistic_v26', '') process.MessageLogger.cerr.threshold = 'ERROR' process.MessageLogger.cerr.FwkReport.reportEvery = 1000 process.options = cms.untracked.PSet( allowUnscheduled = cms.untracked.bool(True) ) # This is where users have some control. # Define which collections to save and which dataformat we are using savedCollections = cms.untracked.vstring('drop *', # The commented ones are large collections that can be kept for debug # 'keep EcalRecHitsSorted_*_*_*', # 'keep recoPFClusters_*_*_*', # 'keep recoCaloClusters_*_*_*', # 'keep recoSuperClusters_*_*_*', # 'keep recoGsfElectron*_*_*_*', # 'keep recoPhoton*_*_*_*', # 'keep *_mix_MergedTrackTruth_*', 'keep *_reducedEcalRecHits*_*_*', 'keep double_fixedGridRho*_*_*', 'keep recoGenParticles_*_*_*', 'keep GenEventInfoProduct_*_*_*', 'keep PileupSummaryInfos_*_*_*', 'keep *_ecalDigis_*_*', 'keep *_offlinePrimaryVertices_*_*', 'keep *_particleFlowCluster*_*_*') process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(15)) process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/AODSIM/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/005AB6CE-27ED-E611-98CA-E0071B7A8590.root' ), secondaryFileNames = cms.untracked.vstring( '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/0416D6B7-04ED-E611-B342-E0071B7A8550.root', '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/14829DD8-04ED-E611-8049-A0000420FE80.root', '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/54AFE9C4-04ED-E611-952D-A0000420FE80.root', '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/5A32C6B9-04ED-E611-B1EB-E0071B7A8550.root', '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/60E162B8-04ED-E611-898D-E0071B7A58F0.root', '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/6A47DD1A-FEEC-E611-81EB-A0000420FE80.root', '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/92B923B6-04ED-E611-9DC9-24BE05C48821.root', '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/B40E77B4-04ED-E611-9E30-E0071B7A45D0.root', '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/C48157B5-04ED-E611-BEC1-E0071B7A45D0.root', '/store/mc/PhaseIFall16DR/GluGluHToGG_M-125_13TeV_powheg_pythia8/GEN-SIM-RAW/FlatPU28to62HcalNZSRAW_81X_upgrade2017_realistic_v26-v1/100000/CAED3A16-FEEC-E611-8262-24BE05CEFB41.root' ) ) process.PFCLUSTERoutput = cms.OutputModule("PoolOutputModule", dataset = cms.untracked.PSet(dataTier = cms.untracked.string('RECO'), filterName = cms.untracked.string('') ), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), fileName = cms.untracked.string('skimEGMobjects_fromRAW.root'), outputCommands = savedCollections, splitLevel = cms.untracked.int32(0) ) # Run the digitizer to make the trackingparticles process.mix.digitizers = cms.PSet(process.theDigitizersValid) process.trackingtruth_step = cms.Path(process.pdigi_valid) # Remake the PFClusters process.pfclusters_step = cms.Path(process.bunchSpacingProducer * process.ecalDigis * process.ecalPreshowerDigis * process.ecalPreshowerRecHit * process.ecalMultiFitUncalibRecHit * process.ecalDetIdToBeRecovered * process.ecalRecHit * process.particleFlowRecHitPS * process.particleFlowRecHitECAL * process.particleFlowClusterECALUncorrected * process.particleFlowClusterPS * process.particleFlowClusterECAL) # Select the PFClusters we want to calibrate process.particleFlowClusterECALMatchedToPhotons = process.pfClusterMatchedToPhotonsSelector.clone() process.selection_step = cms.Path(process.particleFlowClusterECALMatchedToPhotons) # Ends job and writes our output process.endjob_step = cms.EndPath(process.endOfProcess) process.output_step = cms.EndPath(process.PFCLUSTERoutput) # Schedule definition, rebuilding rechits process.schedule = cms.Schedule(process.trackingtruth_step,process.pfclusters_step,process.selection_step,process.endjob_step,process.output_step)
[ 2, 412, 15548, 1341, 10957, 198, 2, 6434, 25, 31918, 406, 13920, 390, 10318, 198, 198, 11748, 48849, 14055, 13, 36301, 7248, 13, 16934, 355, 269, 907, 198, 198, 2, 5660, 351, 262, 2177, 31029, 198, 6738, 28373, 13, 36, 8847, 13, 36, 430, 62, 10987, 17, 62, 5539, 62, 66, 487, 1330, 5660, 17, 62, 5539, 198, 14681, 796, 269, 907, 13, 18709, 10786, 18831, 3955, 3256, 10987, 17, 62, 5539, 8, 198, 198, 2, 17267, 262, 3210, 10392, 329, 25056, 290, 16839, 1634, 198, 14681, 13, 2220, 10786, 38149, 13, 23615, 44015, 3007, 13, 31007, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 8890, 12218, 13, 39, 538, 5760, 51, 1546, 7416, 13, 79, 5272, 72, 499, 28664, 62, 66, 12463, 11537, 198, 14681, 13, 2220, 10786, 24160, 14055, 13, 12837, 16177, 13, 12837, 11187, 1362, 62, 66, 12463, 11537, 198, 14681, 13, 2220, 10786, 38149, 13, 9237, 19746, 13, 9237, 19746, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 8890, 12218, 13, 35608, 278, 26796, 13, 19816, 2949, 5105, 62, 66, 12463, 11537, 198, 14681, 13, 2220, 10786, 38149, 13, 23615, 44015, 3007, 13, 19511, 72, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 38149, 13, 23615, 44015, 3007, 13, 10082, 15748, 6690, 78, 11012, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 38149, 13, 23615, 44015, 3007, 13, 13436, 9833, 15878, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 38149, 13, 23615, 44015, 3007, 13, 27369, 2514, 19511, 72, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 38149, 13, 23615, 44015, 3007, 13, 43, 16, 6690, 78, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 38149, 13, 23615, 44015, 3007, 13, 6690, 261, 15019, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 38149, 13, 23615, 44015, 3007, 13, 12915, 5189, 18709, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 38149, 13, 23615, 44015, 3007, 13, 25886, 959, 25559, 1756, 62, 22289, 24835, 62, 66, 487, 11537, 198, 14681, 13, 2220, 10786, 6690, 78, 36, 28483, 2611, 13, 36, 28483, 2611, 44, 4177, 10141, 13, 79, 69, 2601, 5819, 44, 14265, 2514, 27248, 684, 17563, 273, 62, 66, 12463, 11537, 198, 198, 2, 8060, 17467, 8398, 2644, 655, 1262, 262, 976, 355, 287, 262, 4718, 7762, 198, 6738, 28373, 13, 2348, 24334, 13, 22289, 24835, 1330, 8060, 24835, 198, 14681, 13, 22289, 24835, 796, 8060, 24835, 7, 14681, 13, 22289, 24835, 11, 705, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 3256, 10148, 8, 198, 198, 14681, 13, 12837, 11187, 1362, 13, 2189, 81, 13, 400, 10126, 796, 705, 24908, 6, 198, 14681, 13, 12837, 11187, 1362, 13, 2189, 81, 13, 37, 43021, 19100, 13, 13116, 6109, 796, 8576, 198, 198, 14681, 13, 25811, 796, 269, 907, 13, 403, 2213, 6021, 13, 3705, 316, 7, 1249, 3118, 1416, 704, 6309, 796, 269, 907, 13, 403, 2213, 6021, 13, 30388, 7, 17821, 8, 1267, 198, 198, 2, 770, 318, 810, 2985, 423, 617, 1630, 13, 198, 2, 2896, 500, 543, 17268, 284, 3613, 290, 543, 1366, 18982, 356, 389, 1262, 198, 82, 9586, 5216, 26448, 796, 269, 907, 13, 403, 2213, 6021, 13, 85, 8841, 10786, 14781, 1635, 3256, 198, 2, 383, 16476, 3392, 389, 1588, 17268, 326, 460, 307, 4030, 329, 14257, 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, 705, 14894, 412, 9948, 6690, 39, 896, 50, 9741, 62, 9, 62, 9, 62, 9, 3256, 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, 705, 14894, 664, 78, 42668, 2601, 13654, 62, 9, 62, 9, 62, 9, 3256, 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, 705, 14894, 664, 78, 34, 7335, 2601, 13654, 62, 9, 62, 9, 62, 9, 3256, 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, 705, 14894, 664, 78, 12442, 2601, 13654, 62, 9, 62, 9, 62, 9, 3256, 220, 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, 705, 14894, 664, 78, 38, 28202, 19453, 1313, 9, 62, 9, 62, 9, 62, 9, 3256, 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, 705, 14894, 664, 78, 2725, 18970, 9, 62, 9, 62, 9, 62, 9, 3256, 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, 705, 14894, 1635, 62, 19816, 62, 13102, 2004, 24802, 38782, 62, 9, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 14894, 1635, 62, 445, 19513, 36, 9948, 6690, 39, 896, 9, 62, 9, 62, 9, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 14894, 4274, 62, 34021, 41339, 49, 8873, 9, 62, 9, 62, 9, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 14894, 664, 78, 13746, 7841, 2983, 62, 9, 62, 9, 62, 9, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 14894, 5215, 9237, 12360, 15667, 62, 9, 62, 9, 62, 9, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 14894, 350, 576, 929, 22093, 18943, 418, 62, 9, 62, 9, 62, 9, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 14894, 1635, 62, 721, 282, 19511, 271, 62, 9, 62, 9, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 14894, 1635, 62, 2364, 1370, 35170, 42369, 1063, 62, 9, 62, 9, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 14894, 1635, 62, 3911, 1548, 37535, 2601, 5819, 9, 62, 9, 62, 9, 11537, 198, 198, 14681, 13, 9806, 37103, 796, 269, 907, 13, 403, 2213, 6021, 13, 3705, 316, 7, 15414, 796, 269, 907, 13, 403, 2213, 6021, 13, 600, 2624, 7, 1314, 4008, 198, 198, 14681, 13, 10459, 796, 269, 907, 13, 7416, 7203, 27201, 7416, 1600, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 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, 2393, 36690, 796, 269, 907, 13, 403, 2213, 6021, 13, 85, 8841, 7, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 32, 3727, 48913, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 22544, 6242, 21, 5222, 12, 1983, 1961, 12, 36, 21, 1157, 12, 4089, 8141, 12, 36, 405, 4869, 33, 22, 32, 23, 36993, 13, 15763, 6, 198, 220, 220, 220, 220, 220, 220, 220, 10612, 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, 9233, 8979, 36690, 796, 269, 907, 13, 403, 2213, 6021, 13, 85, 8841, 7, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 3023, 1433, 35, 21, 33, 22, 12, 3023, 1961, 12, 36, 21, 1157, 12, 33, 31575, 12, 36, 405, 4869, 33, 22, 32, 5332, 1120, 13, 15763, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 18294, 1959, 16458, 23, 12, 3023, 1961, 12, 36, 21, 1157, 12, 1795, 2920, 12, 32, 2388, 27211, 15112, 1795, 13, 15763, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 4051, 8579, 36, 24, 34, 19, 12, 3023, 1961, 12, 36, 21, 1157, 12, 49234, 35, 12, 32, 2388, 27211, 15112, 1795, 13, 15763, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 20, 32, 2624, 34, 21, 33, 24, 12, 3023, 1961, 12, 36, 21, 1157, 12, 33, 16, 30195, 12, 36, 405, 4869, 33, 22, 32, 5332, 1120, 13, 15763, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 1899, 36, 25061, 33, 23, 12, 3023, 1961, 12, 36, 21, 1157, 12, 23, 4089, 35, 12, 36, 405, 4869, 33, 22, 32, 3365, 37, 15, 13, 15763, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 21, 32, 2857, 16458, 16, 32, 12, 15112, 2943, 12, 36, 21, 1157, 12, 6659, 30195, 12, 32, 2388, 27211, 15112, 1795, 13, 15763, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 5892, 33, 24, 1954, 33, 21, 12, 3023, 1961, 12, 36, 21, 1157, 12, 24, 9697, 24, 12, 1731, 12473, 2713, 34, 33646, 2481, 13, 15763, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 33, 1821, 36, 3324, 33, 19, 12, 3023, 1961, 12, 36, 21, 1157, 12, 24, 36, 1270, 12, 36, 405, 4869, 33, 22, 32, 2231, 35, 15, 13, 15763, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 34, 2780, 18458, 33, 20, 12, 3023, 1961, 12, 36, 21, 1157, 12, 33, 2943, 16, 12, 36, 405, 4869, 33, 22, 32, 2231, 35, 15, 13, 15763, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 31051, 8095, 14, 23209, 14, 35645, 5064, 439, 1433, 7707, 14, 38, 2290, 38, 2290, 39, 2514, 11190, 62, 44, 12, 11623, 62, 1485, 6767, 53, 62, 79, 322, 258, 70, 62, 79, 5272, 544, 23, 14, 35353, 12, 48913, 12, 20530, 14, 7414, 265, 5105, 2078, 1462, 5237, 39, 9948, 37371, 50, 20530, 62, 6659, 55, 62, 929, 9526, 5539, 62, 5305, 2569, 62, 85, 2075, 12, 85, 16, 14, 3064, 830, 14, 8141, 1961, 18, 32, 1433, 12, 15112, 2943, 12, 36, 21, 1157, 12, 23, 29119, 12, 1731, 12473, 2713, 5222, 26001, 3901, 13, 15763, 6, 198, 8, 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, 1267, 198, 14681, 13, 47, 4851, 43, 7759, 1137, 22915, 796, 269, 907, 13, 26410, 26796, 7203, 27201, 26410, 26796, 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, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 27039, 796, 269, 907, 13, 403, 2213, 6021, 13, 3705, 316, 7, 7890, 35252, 796, 269, 907, 13, 403, 2213, 6021, 13, 8841, 10786, 2200, 8220, 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, 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, 8106, 5376, 796, 269, 907, 13, 403, 2213, 6021, 13, 8841, 7, 7061, 8, 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, 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, 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, 27722, 7414, 1530, 7293, 2790, 10699, 796, 269, 907, 13, 403, 2213, 6021, 13, 600, 2624, 7, 48057, 2078, 1795, 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, 2393, 5376, 796, 269, 907, 13, 403, 2213, 6021, 13, 8841, 10786, 8135, 320, 7156, 44, 48205, 62, 6738, 20530, 13, 15763, 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, 5072, 6935, 1746, 796, 7448, 5216, 26448, 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, 6626, 4971, 796, 269, 907, 13, 403, 2213, 6021, 13, 600, 2624, 7, 15, 8, 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, 1267, 198, 198, 2, 5660, 262, 3100, 3029, 263, 284, 787, 262, 9646, 3911, 2983, 198, 14681, 13, 19816, 13, 12894, 3029, 364, 796, 269, 907, 13, 3705, 316, 7, 14681, 13, 1169, 19511, 3029, 364, 47139, 8, 198, 14681, 13, 36280, 35310, 62, 9662, 796, 269, 907, 13, 15235, 7, 14681, 13, 79, 12894, 72, 62, 12102, 8, 198, 198, 2, 3982, 539, 262, 28223, 2601, 13654, 198, 14681, 13, 79, 69, 565, 13654, 62, 9662, 796, 269, 907, 13, 15235, 7, 14681, 13, 65, 3316, 4561, 4092, 11547, 2189, 1635, 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, 1429, 13, 721, 282, 19511, 271, 1635, 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, 1429, 13, 721, 282, 47, 3447, 789, 19511, 271, 1635, 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, 1429, 13, 721, 282, 47, 3447, 789, 6690, 17889, 1635, 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, 1429, 13, 721, 282, 29800, 31805, 3118, 9948, 571, 6690, 17889, 1635, 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, 1429, 13, 721, 282, 11242, 7390, 2514, 3856, 6690, 2557, 1635, 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, 1429, 13, 721, 282, 6690, 17889, 1635, 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, 1429, 13, 3911, 1548, 37535, 6690, 17889, 3705, 1635, 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, 1429, 13, 3911, 1548, 37535, 6690, 17889, 2943, 1847, 1635, 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, 1429, 13, 3911, 1548, 37535, 2601, 5819, 2943, 1847, 3118, 30283, 276, 1635, 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, 1429, 13, 3911, 1548, 37535, 2601, 5819, 3705, 1635, 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, 1429, 13, 3911, 1548, 37535, 2601, 5819, 2943, 1847, 8, 198, 198, 2, 9683, 262, 28223, 2601, 13654, 356, 765, 284, 33801, 378, 198, 14681, 13, 3911, 1548, 37535, 2601, 5819, 2943, 1847, 44, 14265, 2514, 27248, 684, 796, 1429, 13, 79, 69, 2601, 5819, 44, 14265, 2514, 27248, 684, 17563, 273, 13, 21018, 3419, 198, 14681, 13, 49283, 62, 9662, 796, 269, 907, 13, 15235, 7, 14681, 13, 3911, 1548, 37535, 2601, 5819, 2943, 1847, 44, 14265, 2514, 27248, 684, 8, 198, 198, 2, 46756, 1693, 290, 6797, 674, 5072, 198, 14681, 13, 437, 21858, 62, 9662, 796, 269, 907, 13, 12915, 15235, 7, 14681, 13, 437, 5189, 18709, 8, 198, 14681, 13, 22915, 62, 9662, 796, 269, 907, 13, 12915, 15235, 7, 14681, 13, 47, 4851, 43, 7759, 1137, 22915, 8, 198, 198, 2, 19281, 6770, 11, 25448, 302, 354, 896, 198, 14681, 13, 15952, 5950, 796, 269, 907, 13, 27054, 5950, 7, 14681, 13, 36280, 35310, 62, 9662, 11, 14681, 13, 79, 69, 565, 13654, 62, 9662, 11, 14681, 13, 49283, 62, 9662, 11, 14681, 13, 437, 21858, 62, 9662, 11, 14681, 13, 22915, 62, 9662, 8, 628, 198 ]
1.878007
4,074
""" """ import unittest from runesanalyzer import data __author__ = ["Clément Besnier <[email protected]>", ]
[ 37811, 198, 198, 37811, 198, 198, 11748, 555, 715, 395, 198, 6738, 32326, 38200, 9107, 1330, 1366, 198, 198, 834, 9800, 834, 796, 14631, 2601, 2634, 434, 30837, 77, 959, 1279, 2375, 907, 979, 3007, 31, 64, 349, 13, 785, 29, 1600, 2361, 628 ]
2.659091
44
""" spec_uploader.py A tool for uploading apigee specs Usage: spec_uploader.py <apigee_org> <specs_dir> -u <username> -p <password> [-t <apigee_token>] spec_uploader.py (-h | --help) Options: -h --help Show this screen -u Which username to log in with -p Password for login -t Access Token from apigee """ import os from docopt import docopt from apigee_client import ApigeeClient ENV_NAMES = { 'nhsd-prod': ['sandbox', 'dev', 'int', 'prod'], 'nhsd-nonprod': ['internal-dev', 'internal-qa-sandbox', 'internal-qa', 'ref'] } FRIENDLY_ENV_NAMES = { 'prod': '(Production)', 'int': '(Integration Testing)', 'dev': '(Development)', 'ref': '(Reference)', 'internal-qa': '(Internal QA)', 'internal-dev': '(Internal Development)' } FRIENDLY_API_NAMES = { 'personal-demographics': 'Personal Demographics Service API' } if __name__ == "__main__": args = docopt(__doc__) client = ApigeeClient(args['<apigee_org>'], args['<username>'], args['<password>'], args['<apigee_token>']) upload_specs(ENV_NAMES[args['<apigee_org>']], args['<specs_dir>'], client)
[ 37811, 198, 16684, 62, 25850, 263, 13, 9078, 198, 198, 32, 2891, 329, 33794, 2471, 328, 1453, 25274, 198, 198, 28350, 25, 198, 220, 1020, 62, 25850, 263, 13, 9078, 1279, 499, 328, 1453, 62, 2398, 29, 1279, 4125, 6359, 62, 15908, 29, 532, 84, 1279, 29460, 29, 532, 79, 1279, 28712, 29, 25915, 83, 1279, 499, 328, 1453, 62, 30001, 37981, 198, 220, 1020, 62, 25850, 263, 13, 9078, 13841, 71, 930, 1377, 16794, 8, 198, 198, 29046, 25, 198, 220, 532, 71, 1377, 16794, 220, 5438, 428, 3159, 198, 220, 532, 84, 220, 220, 220, 220, 220, 220, 220, 220, 9022, 20579, 284, 2604, 287, 351, 198, 220, 532, 79, 220, 220, 220, 220, 220, 220, 220, 220, 30275, 329, 17594, 198, 220, 532, 83, 220, 220, 220, 220, 220, 220, 220, 220, 8798, 29130, 422, 2471, 328, 1453, 198, 37811, 198, 11748, 28686, 198, 6738, 2205, 8738, 1330, 2205, 8738, 198, 6738, 2471, 328, 1453, 62, 16366, 1330, 5949, 328, 1453, 11792, 628, 198, 1677, 53, 62, 45, 29559, 796, 1391, 198, 220, 220, 220, 705, 77, 11994, 67, 12, 1676, 67, 10354, 37250, 38142, 3524, 3256, 705, 7959, 3256, 705, 600, 3256, 705, 1676, 67, 6, 4357, 198, 220, 220, 220, 705, 77, 11994, 67, 12, 13159, 1676, 67, 10354, 37250, 32538, 12, 7959, 3256, 705, 32538, 12, 20402, 12, 38142, 3524, 3256, 705, 32538, 12, 20402, 3256, 705, 5420, 20520, 198, 92, 198, 198, 37, 7112, 10619, 11319, 62, 1677, 53, 62, 45, 29559, 796, 1391, 198, 220, 220, 220, 705, 1676, 67, 10354, 29513, 35027, 8, 3256, 198, 220, 220, 220, 705, 600, 10354, 29513, 34500, 1358, 23983, 8, 3256, 198, 220, 220, 220, 705, 7959, 10354, 29513, 41206, 8, 3256, 198, 220, 220, 220, 705, 5420, 10354, 29513, 26687, 8, 3256, 198, 220, 220, 220, 705, 32538, 12, 20402, 10354, 29513, 37693, 1195, 32, 8, 3256, 198, 220, 220, 220, 705, 32538, 12, 7959, 10354, 29513, 37693, 7712, 33047, 198, 92, 198, 198, 37, 7112, 10619, 11319, 62, 17614, 62, 45, 29559, 796, 1391, 198, 220, 220, 220, 705, 22682, 12, 9536, 24188, 10354, 705, 30228, 1897, 24188, 4809, 7824, 6, 198, 92, 628, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 26498, 796, 2205, 8738, 7, 834, 15390, 834, 8, 198, 220, 220, 220, 5456, 796, 5949, 328, 1453, 11792, 7, 22046, 17816, 27, 499, 328, 1453, 62, 2398, 29, 6, 4357, 26498, 17816, 27, 29460, 29, 6, 4357, 26498, 17816, 27, 28712, 29, 6, 4357, 26498, 17816, 27, 499, 328, 1453, 62, 30001, 29, 6, 12962, 198, 220, 220, 220, 9516, 62, 4125, 6359, 7, 1677, 53, 62, 45, 29559, 58, 22046, 17816, 27, 499, 328, 1453, 62, 2398, 29, 20520, 4357, 26498, 17816, 27, 4125, 6359, 62, 15908, 29, 6, 4357, 5456, 8, 198 ]
2.411017
472
from .simple import ( SimpleNER, SimpleMultiLabel, SimpleClassification, ) from .simple_t5 import SimpleT5
[ 6738, 764, 36439, 1330, 357, 198, 220, 220, 220, 17427, 21479, 11, 198, 220, 220, 220, 17427, 29800, 33986, 11, 198, 220, 220, 220, 17427, 9487, 2649, 11, 198, 8, 198, 6738, 764, 36439, 62, 83, 20, 1330, 17427, 51, 20, 198 ]
2.833333
42
import argparse from allennlp.common.params import Params from allennlp.data.dataset_readers.dataset_reader import DatasetReader from allennlp.models.archival import load_archive from summarus.readers import * if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--archive-file', type=str, required=True) parser.add_argument('--input-file', type=str, required=True) parser.add_argument('--output-file', type=str, required=True) args = parser.parse_args() target_to_lines(**vars(args))
[ 11748, 1822, 29572, 198, 198, 6738, 477, 1697, 34431, 13, 11321, 13, 37266, 1330, 2547, 4105, 198, 6738, 477, 1697, 34431, 13, 7890, 13, 19608, 292, 316, 62, 961, 364, 13, 19608, 292, 316, 62, 46862, 1330, 16092, 292, 316, 33634, 198, 6738, 477, 1697, 34431, 13, 27530, 13, 998, 2473, 1330, 3440, 62, 17474, 198, 198, 6738, 15676, 385, 13, 961, 364, 1330, 1635, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 30751, 796, 1822, 29572, 13, 28100, 1713, 46677, 3419, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 438, 17474, 12, 7753, 3256, 2099, 28, 2536, 11, 2672, 28, 17821, 8, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 438, 15414, 12, 7753, 3256, 2099, 28, 2536, 11, 2672, 28, 17821, 8, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 438, 22915, 12, 7753, 3256, 2099, 28, 2536, 11, 2672, 28, 17821, 8, 198, 220, 220, 220, 26498, 796, 30751, 13, 29572, 62, 22046, 3419, 198, 220, 220, 220, 2496, 62, 1462, 62, 6615, 7, 1174, 85, 945, 7, 22046, 4008, 198 ]
2.878307
189
__author__ = 'sabe6191' import json import datetime from tempest.common import rest_client
[ 834, 9800, 834, 796, 705, 82, 11231, 21, 26492, 6, 198, 198, 11748, 33918, 198, 11748, 4818, 8079, 198, 198, 6738, 20218, 395, 13, 11321, 1330, 1334, 62, 16366, 198 ]
3.1
30
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- """ Date: 2019/11/27 Author: Xiao-Le Deng Email: xiaoledeng at gmail.com Function: remove duplicates in a given list """ # List1 = [1,1,1] # List2 = ["John","John","John","Mark","David","David","Shalom","Shalom","Shalom"] # print(list_remove_duplicate(List1)) # print(list_remove_duplicate(List2))
[ 2, 48443, 14629, 14, 12001, 14, 8800, 14, 29412, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 220, 220, 198, 37811, 198, 10430, 25, 13130, 14, 1157, 14, 1983, 198, 13838, 25, 28249, 12, 3123, 41985, 198, 15333, 25, 2124, 544, 45342, 1516, 379, 308, 4529, 13, 785, 198, 22203, 25, 4781, 14184, 16856, 287, 257, 1813, 1351, 198, 37811, 198, 198, 2, 7343, 16, 796, 685, 16, 11, 16, 11, 16, 60, 198, 2, 7343, 17, 796, 14631, 7554, 2430, 7554, 2430, 7554, 2430, 9704, 2430, 11006, 2430, 11006, 2430, 2484, 282, 296, 2430, 2484, 282, 296, 2430, 2484, 282, 296, 8973, 198, 198, 2, 3601, 7, 4868, 62, 28956, 62, 646, 489, 5344, 7, 8053, 16, 4008, 198, 2, 3601, 7, 4868, 62, 28956, 62, 646, 489, 5344, 7, 8053, 17, 4008 ]
2.48227
141
from django.test import TestCase from django.contrib.auth.models import User from .models import healthservices,neighbourhood import datetime as dt # Create your tests here.
[ 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 11787, 198, 6738, 764, 27530, 1330, 1535, 30416, 11, 710, 394, 6084, 2894, 198, 198, 11748, 4818, 8079, 355, 288, 83, 198, 2, 13610, 534, 5254, 994, 13, 628 ]
3.591837
49
#!/usr/bin/env python from codecs import open from ez_setup import use_setuptools use_setuptools() from setuptools import setup import re main_py = open('morfessor/__init__.py', encoding='utf-8').read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py)) requires = [ # 'progressbar', ] setup(name='Morfessor', version=metadata['version'], author=metadata['author'], author_email='[email protected]', url='http://morpho.aalto.fi', description='Morfessor', packages=['morfessor', 'morfessor.test'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Scientific/Engineering', ], license="BSD", scripts=['scripts/morfessor', 'scripts/morfessor-train', 'scripts/morfessor-segment', 'scripts/morfessor-evaluate', ], install_requires=requires, extras_require={ 'docs': [l.strip() for l in open('docs/build_requirements.txt')] } )
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 6738, 40481, 82, 1330, 1280, 198, 6738, 304, 89, 62, 40406, 1330, 779, 62, 2617, 37623, 10141, 198, 1904, 62, 2617, 37623, 10141, 3419, 198, 198, 6738, 900, 37623, 10141, 1330, 9058, 198, 198, 11748, 302, 198, 12417, 62, 9078, 796, 1280, 10786, 4491, 69, 5987, 14, 834, 15003, 834, 13, 9078, 3256, 21004, 11639, 40477, 12, 23, 27691, 961, 3419, 198, 38993, 796, 8633, 7, 260, 13, 19796, 439, 7203, 834, 26933, 64, 12, 89, 60, 28988, 834, 796, 705, 26933, 61, 20520, 28988, 6, 1600, 1388, 62, 9078, 4008, 198, 198, 47911, 796, 685, 198, 220, 220, 220, 1303, 220, 220, 220, 705, 33723, 5657, 3256, 198, 60, 198, 198, 40406, 7, 3672, 11639, 20044, 69, 5987, 3256, 198, 220, 220, 220, 220, 220, 2196, 28, 38993, 17816, 9641, 6, 4357, 198, 220, 220, 220, 220, 220, 1772, 28, 38993, 17816, 9800, 6, 4357, 198, 220, 220, 220, 220, 220, 1772, 62, 12888, 11639, 24503, 78, 31, 64, 282, 1462, 13, 12463, 3256, 198, 220, 220, 220, 220, 220, 19016, 11639, 4023, 1378, 24503, 78, 13, 64, 282, 1462, 13, 12463, 3256, 198, 220, 220, 220, 220, 220, 6764, 11639, 20044, 69, 5987, 3256, 198, 220, 220, 220, 220, 220, 10392, 28, 17816, 4491, 69, 5987, 3256, 705, 4491, 69, 5987, 13, 9288, 6, 4357, 198, 220, 220, 220, 220, 220, 1398, 13350, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 41206, 12678, 7904, 604, 532, 17993, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 5317, 1631, 7591, 1240, 7904, 5800, 14, 25104, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 34156, 7904, 7294, 40, 20010, 1079, 7904, 347, 10305, 13789, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 18843, 803, 4482, 7904, 7294, 13362, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 15167, 2229, 15417, 7904, 11361, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 33221, 7904, 22060, 14, 13798, 1586, 3256, 198, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 5964, 2625, 21800, 1600, 198, 220, 220, 220, 220, 220, 14750, 28, 17816, 46521, 14, 4491, 69, 5987, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 46521, 14, 4491, 69, 5987, 12, 27432, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 46521, 14, 4491, 69, 5987, 12, 325, 5154, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 46521, 14, 4491, 69, 5987, 12, 49786, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 2721, 62, 47911, 28, 47911, 11, 198, 220, 220, 220, 220, 220, 33849, 62, 46115, 34758, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 31628, 10354, 685, 75, 13, 36311, 3419, 329, 300, 287, 1280, 10786, 31628, 14, 11249, 62, 8897, 18883, 13, 14116, 11537, 60, 198, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 220, 220, 1267, 198 ]
2.264815
540
# -*- coding: utf-8 -*- from yapconf.docs import build_markdown_table # flake8: noqa
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 331, 499, 10414, 13, 31628, 1330, 1382, 62, 4102, 2902, 62, 11487, 628, 198, 2, 781, 539, 23, 25, 645, 20402, 628 ]
2.342105
38
# --depends-on channel_access # --depends-on check_mode # --depends-on commands # --depends-on permissions import enum from src import ModuleManager, utils
[ 2, 1377, 10378, 2412, 12, 261, 6518, 62, 15526, 198, 2, 1377, 10378, 2412, 12, 261, 2198, 62, 14171, 198, 2, 1377, 10378, 2412, 12, 261, 9729, 198, 2, 1377, 10378, 2412, 12, 261, 21627, 198, 198, 11748, 33829, 198, 198, 6738, 12351, 1330, 19937, 13511, 11, 3384, 4487, 628, 628, 628, 198 ]
3.09434
53
import binascii import csv import gzip import io import sys from sqlalchemy import MetaData, Table from pytest_mock_resources.compat import boto3 def _parse_s3_command(statement): """Format, Parse and call patched 'COPY' command.""" statement = strip(statement) params = dict() # deleting copy tokens = statement.split()[1:] # Fetching table name params["schema_name"], params["table_name"] = _split_table_name(tokens.pop(0)) # Checking for columns if tokens[0][0] == "(": ending_index = 0 for index, arg in enumerate(tokens): if arg.endswith(")"): ending_index = index break ending_index += 1 columns = tokens[0:ending_index] columns[0] = columns[0].replace("(", "") columns[-1] = columns[-1].replace(")", "") columns = [x.replace(",", "") for x in columns] columns = [x for x in columns if x != ""] tokens = tokens[ending_index:] params["columns"] = columns # Fetching s3_uri if tokens.pop(0).lower() != "from": raise ValueError( ( "Possibly malformed S3 URI Format. " "Statement = {statement}" "Redshift fixture only supports S3 Copy statments with the following syntax: " "COPY <table_name> FROM [(column 1, [column2, [..]])] '<file path on S3 bucket>' " "credentials 'aws_access_key_id=<aws_access_key_id>;" "aws_secret_access_key=<aws_secret_access_key>'" ).format(statement=statement) ) params["s3_uri"] = strip(tokens.pop(0)) # Fetching credentials for token in tokens: if "aws_access_key_id" in token.lower() or "aws_secret_access_key" in token.lower(): # This is because of the following possibiliteis: # ... [with ]credentials[ AS] 'aws_access_key_id=x;aws_secret_access_key=y' # OR # ... [with ]credentials[ AS] 'aws_secret_access_key=y;aws_access_key_id=x' # OR # ... [with ]credentials[ AS] 'aws_secret_access_key=y;\naws_access_key_id=x' # OR # ... [with ]credentials[ AS] 'aws_secret_access_key=y; aws_access_key_id=x' # Supportred AWS credentials format: # [with ]credentials[ AS] 'aws_secret_access_key=y; aws_access_key_id=x' # No Support for additional credential formats, eg IAM roles, etc, yet. credentials_list = token.split(";") for credentials in credentials_list: if "aws_access_key_id" in credentials: params["aws_access_key_id"] = credentials.split("=")[-1] elif "aws_secret_access_key" in credentials: params["aws_secret_access_key"] = credentials.split("=")[-1] else: raise ValueError( ( "Possibly malformed AWS Credentials Format. " "Statement = {statement}" "Redshift fixture only supports S3 Copy statments with the following " "syntax: COPY <table_name> FROM [(column 1, [column2, [..]])] '" "<file path on S3 bucket>' " "credentials 'aws_access_key_id=<aws_access_key_id>;" "aws_secret_access_key=<aws_secret_access_key>' " "Supportred AWS credentials format: " "[with ]credentials[ AS] 'aws_secret_access_key=y; aws_access_key_id=x'" " No Support for additional credential formats, eg IAM roles, etc, yet." ).format(statement=statement) ) return params def _split_table_name(table_name): """Split 'schema_name.table_name' to (schema_name, table_name).""" table_name_items = table_name.split(".") if len(table_name_items) == 1: schema_name = None elif len(table_name_items) == 2: schema_name, table_name = table_name_items else: raise ValueError("Cannot determine schema/table name from input {}".format(table_name)) return schema_name, table_name def _mock_s3_copy( table_name, s3_uri, schema_name, aws_secret_access_key, aws_access_key_id, columns, engine ): """Execute patched 'copy' command.""" s3 = boto3.client( "s3", aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key ) ending_index = len(s3_uri) path_to_file = s3_uri[5:ending_index] bucket, key = path_to_file.split("/", 1) response = s3.get_object(Bucket=bucket, Key=key) # the following lins of code is used to check if the file is gzipped or not. # To do so we use magic numbers. # A mgic number is a constant numerical or text value used to identify a file format or protocol # The magic number for gzip compressed files is 1f 8b. is_gzipped = binascii.hexlify(response["Body"].read(2)) == b"1f8b" response = s3.get_object(Bucket=bucket, Key=key) data = read_data_csv(response["Body"].read(), is_gzipped, columns) meta = MetaData() table = Table(table_name, meta, autoload=True, schema=schema_name, autoload_with=engine) engine.execute(table.insert(data)) def strip(input_string): """Strip trailing whitespace, single/double quotes.""" return input_string.strip().rstrip(";").strip('"').strip("'")
[ 11748, 9874, 292, 979, 72, 198, 11748, 269, 21370, 198, 11748, 308, 13344, 198, 11748, 33245, 198, 11748, 25064, 198, 198, 6738, 44161, 282, 26599, 1330, 30277, 6601, 11, 8655, 198, 198, 6738, 12972, 9288, 62, 76, 735, 62, 37540, 13, 5589, 265, 1330, 275, 2069, 18, 628, 198, 198, 4299, 4808, 29572, 62, 82, 18, 62, 21812, 7, 26090, 2599, 198, 220, 220, 220, 37227, 26227, 11, 2547, 325, 290, 869, 39378, 705, 34, 3185, 56, 6, 3141, 526, 15931, 198, 220, 220, 220, 2643, 796, 10283, 7, 26090, 8, 198, 220, 220, 220, 42287, 796, 8633, 3419, 628, 220, 220, 220, 1303, 34817, 4866, 198, 220, 220, 220, 16326, 796, 2643, 13, 35312, 3419, 58, 16, 47715, 628, 220, 220, 220, 1303, 376, 7569, 278, 3084, 1438, 198, 220, 220, 220, 42287, 14692, 15952, 2611, 62, 3672, 33116, 42287, 14692, 11487, 62, 3672, 8973, 796, 4808, 35312, 62, 11487, 62, 3672, 7, 83, 482, 641, 13, 12924, 7, 15, 4008, 628, 220, 220, 220, 1303, 39432, 329, 15180, 198, 220, 220, 220, 611, 16326, 58, 15, 7131, 15, 60, 6624, 30629, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 7464, 62, 9630, 796, 657, 198, 220, 220, 220, 220, 220, 220, 220, 329, 6376, 11, 1822, 287, 27056, 378, 7, 83, 482, 641, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 1822, 13, 437, 2032, 342, 7, 4943, 1, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7464, 62, 9630, 796, 6376, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 220, 220, 220, 220, 220, 220, 220, 7464, 62, 9630, 15853, 352, 198, 220, 220, 220, 220, 220, 220, 220, 15180, 796, 16326, 58, 15, 25, 1571, 62, 9630, 60, 198, 220, 220, 220, 220, 220, 220, 220, 15180, 58, 15, 60, 796, 15180, 58, 15, 4083, 33491, 7203, 7, 1600, 366, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 15180, 58, 12, 16, 60, 796, 15180, 58, 12, 16, 4083, 33491, 7, 4943, 1600, 366, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 15180, 796, 685, 87, 13, 33491, 7, 2430, 11, 366, 4943, 329, 2124, 287, 15180, 60, 198, 220, 220, 220, 220, 220, 220, 220, 15180, 796, 685, 87, 329, 2124, 287, 15180, 611, 2124, 14512, 366, 8973, 198, 220, 220, 220, 220, 220, 220, 220, 16326, 796, 16326, 58, 1571, 62, 9630, 47715, 198, 220, 220, 220, 220, 220, 220, 220, 42287, 14692, 28665, 82, 8973, 796, 15180, 628, 220, 220, 220, 1303, 376, 7569, 278, 264, 18, 62, 9900, 198, 220, 220, 220, 611, 16326, 13, 12924, 7, 15, 737, 21037, 3419, 14512, 366, 6738, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 11052, 12331, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 47, 20846, 6428, 12214, 311, 18, 43975, 18980, 13, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 48682, 796, 1391, 26090, 36786, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 7738, 30846, 29220, 691, 6971, 311, 18, 17393, 1185, 902, 351, 262, 1708, 15582, 25, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 34, 3185, 56, 1279, 11487, 62, 3672, 29, 16034, 47527, 28665, 352, 11, 685, 28665, 17, 11, 685, 492, 11907, 15437, 705, 27, 7753, 3108, 319, 311, 18, 19236, 29, 6, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 66, 445, 14817, 705, 8356, 62, 15526, 62, 2539, 62, 312, 28, 27, 8356, 62, 15526, 62, 2539, 62, 312, 29, 26033, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 8356, 62, 21078, 62, 15526, 62, 2539, 28, 27, 8356, 62, 21078, 62, 15526, 62, 2539, 29, 29653, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6739, 18982, 7, 26090, 28, 26090, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 42287, 14692, 82, 18, 62, 9900, 8973, 796, 10283, 7, 83, 482, 641, 13, 12924, 7, 15, 4008, 628, 220, 220, 220, 1303, 376, 7569, 278, 18031, 198, 220, 220, 220, 329, 11241, 287, 16326, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 366, 8356, 62, 15526, 62, 2539, 62, 312, 1, 287, 11241, 13, 21037, 3419, 393, 366, 8356, 62, 21078, 62, 15526, 62, 2539, 1, 287, 11241, 13, 21037, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 770, 318, 780, 286, 262, 1708, 1184, 571, 346, 578, 271, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2644, 685, 4480, 2361, 66, 445, 14817, 58, 7054, 60, 705, 8356, 62, 15526, 62, 2539, 62, 312, 28, 87, 26, 8356, 62, 21078, 62, 15526, 62, 2539, 28, 88, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 6375, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2644, 685, 4480, 2361, 66, 445, 14817, 58, 7054, 60, 705, 8356, 62, 21078, 62, 15526, 62, 2539, 28, 88, 26, 8356, 62, 15526, 62, 2539, 62, 312, 28, 87, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 6375, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2644, 685, 4480, 2361, 66, 445, 14817, 58, 7054, 60, 705, 8356, 62, 21078, 62, 15526, 62, 2539, 28, 88, 26, 59, 77, 8356, 62, 15526, 62, 2539, 62, 312, 28, 87, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 6375, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2644, 685, 4480, 2361, 66, 445, 14817, 58, 7054, 60, 705, 8356, 62, 21078, 62, 15526, 62, 2539, 28, 88, 26, 3253, 82, 62, 15526, 62, 2539, 62, 312, 28, 87, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 7929, 445, 30865, 18031, 5794, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 685, 4480, 2361, 66, 445, 14817, 58, 7054, 60, 705, 8356, 62, 21078, 62, 15526, 62, 2539, 28, 88, 26, 3253, 82, 62, 15526, 62, 2539, 62, 312, 28, 87, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1400, 7929, 329, 3224, 49920, 17519, 11, 29206, 314, 2390, 9176, 11, 3503, 11, 1865, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 18031, 62, 4868, 796, 11241, 13, 35312, 7203, 26, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 18031, 287, 18031, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 366, 8356, 62, 15526, 62, 2539, 62, 312, 1, 287, 18031, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 42287, 14692, 8356, 62, 15526, 62, 2539, 62, 312, 8973, 796, 18031, 13, 35312, 7203, 2625, 38381, 12, 16, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 366, 8356, 62, 21078, 62, 15526, 62, 2539, 1, 287, 18031, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 42287, 14692, 8356, 62, 21078, 62, 15526, 62, 2539, 8973, 796, 18031, 13, 35312, 7203, 2625, 38381, 12, 16, 60, 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, 5298, 11052, 12331, 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, 357, 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, 366, 47, 20846, 6428, 12214, 30865, 327, 445, 14817, 18980, 13, 366, 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, 366, 48682, 796, 1391, 26090, 36786, 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, 366, 7738, 30846, 29220, 691, 6971, 311, 18, 17393, 1185, 902, 351, 262, 1708, 366, 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, 366, 1837, 41641, 25, 27975, 56, 1279, 11487, 62, 3672, 29, 16034, 47527, 28665, 352, 11, 685, 28665, 17, 11, 685, 492, 11907, 15437, 705, 1, 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, 33490, 7753, 3108, 319, 311, 18, 19236, 29, 6, 366, 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, 366, 66, 445, 14817, 705, 8356, 62, 15526, 62, 2539, 62, 312, 28, 27, 8356, 62, 15526, 62, 2539, 62, 312, 29, 26033, 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, 366, 8356, 62, 21078, 62, 15526, 62, 2539, 28, 27, 8356, 62, 21078, 62, 15526, 62, 2539, 29, 6, 366, 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, 366, 15514, 445, 30865, 18031, 5794, 25, 366, 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, 12878, 4480, 2361, 66, 445, 14817, 58, 7054, 60, 705, 8356, 62, 21078, 62, 15526, 62, 2539, 28, 88, 26, 3253, 82, 62, 15526, 62, 2539, 62, 312, 28, 87, 29653, 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, 366, 1400, 7929, 329, 3224, 49920, 17519, 11, 29206, 314, 2390, 9176, 11, 3503, 11, 1865, 526, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6739, 18982, 7, 26090, 28, 26090, 8, 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, 1441, 42287, 628, 198, 4299, 4808, 35312, 62, 11487, 62, 3672, 7, 11487, 62, 3672, 2599, 198, 220, 220, 220, 37227, 41205, 705, 15952, 2611, 62, 3672, 13, 11487, 62, 3672, 6, 284, 357, 15952, 2611, 62, 3672, 11, 3084, 62, 3672, 21387, 15931, 198, 220, 220, 220, 3084, 62, 3672, 62, 23814, 796, 3084, 62, 3672, 13, 35312, 7203, 19570, 198, 220, 220, 220, 611, 18896, 7, 11487, 62, 3672, 62, 23814, 8, 6624, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 32815, 62, 3672, 796, 6045, 198, 220, 220, 220, 1288, 361, 18896, 7, 11487, 62, 3672, 62, 23814, 8, 6624, 362, 25, 198, 220, 220, 220, 220, 220, 220, 220, 32815, 62, 3672, 11, 3084, 62, 3672, 796, 3084, 62, 3672, 62, 23814, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 11052, 12331, 7203, 34, 34574, 5004, 32815, 14, 11487, 1438, 422, 5128, 23884, 1911, 18982, 7, 11487, 62, 3672, 4008, 198, 220, 220, 220, 1441, 32815, 62, 3672, 11, 3084, 62, 3672, 628, 198, 4299, 4808, 76, 735, 62, 82, 18, 62, 30073, 7, 198, 220, 220, 220, 3084, 62, 3672, 11, 264, 18, 62, 9900, 11, 32815, 62, 3672, 11, 3253, 82, 62, 21078, 62, 15526, 62, 2539, 11, 3253, 82, 62, 15526, 62, 2539, 62, 312, 11, 15180, 11, 3113, 198, 2599, 198, 220, 220, 220, 37227, 23002, 1133, 39378, 705, 30073, 6, 3141, 526, 15931, 198, 220, 220, 220, 264, 18, 796, 275, 2069, 18, 13, 16366, 7, 198, 220, 220, 220, 220, 220, 220, 220, 366, 82, 18, 1600, 3253, 82, 62, 15526, 62, 2539, 62, 312, 28, 8356, 62, 15526, 62, 2539, 62, 312, 11, 3253, 82, 62, 21078, 62, 15526, 62, 2539, 28, 8356, 62, 21078, 62, 15526, 62, 2539, 198, 220, 220, 220, 1267, 198, 220, 220, 220, 7464, 62, 9630, 796, 18896, 7, 82, 18, 62, 9900, 8, 198, 220, 220, 220, 3108, 62, 1462, 62, 7753, 796, 264, 18, 62, 9900, 58, 20, 25, 1571, 62, 9630, 60, 198, 220, 220, 220, 19236, 11, 1994, 796, 3108, 62, 1462, 62, 7753, 13, 35312, 7203, 14, 1600, 352, 8, 198, 220, 220, 220, 2882, 796, 264, 18, 13, 1136, 62, 15252, 7, 33, 38811, 28, 27041, 316, 11, 7383, 28, 2539, 8, 628, 220, 220, 220, 1303, 262, 1708, 300, 1040, 286, 2438, 318, 973, 284, 2198, 611, 262, 2393, 318, 308, 89, 3949, 393, 407, 13, 198, 220, 220, 220, 1303, 1675, 466, 523, 356, 779, 5536, 3146, 13, 198, 220, 220, 220, 1303, 317, 10527, 291, 1271, 318, 257, 6937, 29052, 393, 2420, 1988, 973, 284, 5911, 257, 2393, 5794, 393, 8435, 198, 220, 220, 220, 1303, 383, 5536, 1271, 329, 308, 13344, 25388, 3696, 318, 352, 69, 807, 65, 13, 198, 220, 220, 220, 318, 62, 34586, 3949, 796, 9874, 292, 979, 72, 13, 33095, 75, 1958, 7, 26209, 14692, 25842, 1, 4083, 961, 7, 17, 4008, 6624, 275, 1, 16, 69, 23, 65, 1, 628, 220, 220, 220, 2882, 796, 264, 18, 13, 1136, 62, 15252, 7, 33, 38811, 28, 27041, 316, 11, 7383, 28, 2539, 8, 198, 220, 220, 220, 1366, 796, 1100, 62, 7890, 62, 40664, 7, 26209, 14692, 25842, 1, 4083, 961, 22784, 318, 62, 34586, 3949, 11, 15180, 8, 628, 220, 220, 220, 13634, 796, 30277, 6601, 3419, 198, 220, 220, 220, 3084, 796, 8655, 7, 11487, 62, 3672, 11, 13634, 11, 1960, 349, 1170, 28, 17821, 11, 32815, 28, 15952, 2611, 62, 3672, 11, 1960, 349, 1170, 62, 4480, 28, 18392, 8, 198, 220, 220, 220, 3113, 13, 41049, 7, 11487, 13, 28463, 7, 7890, 4008, 628, 198, 198, 4299, 10283, 7, 15414, 62, 8841, 2599, 198, 220, 220, 220, 37227, 1273, 5528, 25462, 13216, 10223, 11, 2060, 14, 23352, 13386, 526, 15931, 198, 220, 220, 220, 1441, 5128, 62, 8841, 13, 36311, 22446, 81, 36311, 7203, 26, 11074, 36311, 10786, 1, 27691, 36311, 7203, 6, 4943, 198 ]
2.170991
2,544
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager from flask_bcrypt import Bcrypt from iotools.config import Config db = SQLAlchemy() bcrypt = Bcrypt() login_manager = LoginManager() login_manager.login_view = 'sessions.login' login_manager.login_message_category = 'info'
[ 6738, 42903, 1330, 46947, 198, 6738, 42903, 62, 25410, 282, 26599, 1330, 16363, 2348, 26599, 198, 6738, 42903, 62, 38235, 1330, 23093, 13511, 198, 6738, 42903, 62, 15630, 6012, 1330, 347, 29609, 198, 6738, 1312, 313, 10141, 13, 11250, 1330, 17056, 628, 198, 9945, 796, 16363, 2348, 26599, 3419, 198, 15630, 6012, 796, 347, 29609, 3419, 198, 38235, 62, 37153, 796, 23093, 13511, 3419, 198, 38235, 62, 37153, 13, 38235, 62, 1177, 796, 705, 82, 6202, 13, 38235, 6, 198, 38235, 62, 37153, 13, 38235, 62, 20500, 62, 22872, 796, 705, 10951, 6, 628 ]
3.478723
94