max_stars_repo_path
stringlengths 4
237
| max_stars_repo_name
stringlengths 6
117
| max_stars_count
int64 0
95.2k
| id
stringlengths 1
7
| content
stringlengths 12
593k
| input_ids
listlengths 7
549k
|
---|---|---|---|---|---|
nbgrader/tests/preprocessors/test_deduplicateids.py
|
FrattisUC/nbgrader
| 1,116 |
1601132
|
<filename>nbgrader/tests/preprocessors/test_deduplicateids.py
import pytest
from nbformat.v4 import new_notebook
from ...preprocessors import DeduplicateIds
from .base import BaseTestPreprocessor
from .. import (
create_grade_cell, create_solution_cell, create_locked_cell)
@pytest.fixture
def preprocessor():
pp = DeduplicateIds()
return pp
class TestDeduplicateIds(BaseTestPreprocessor):
def test_duplicate_grade_cell(self, preprocessor):
cell1 = create_grade_cell("hello", "code", "foo", 2)
cell2 = create_grade_cell("goodbye", "code", "foo", 2)
nb = new_notebook()
nb.cells.append(cell1)
nb.cells.append(cell2)
nb, resources = preprocessor.preprocess(nb, {})
assert nb.cells[0].metadata.nbgrader == {}
assert nb.cells[1].metadata.nbgrader != {}
def test_duplicate_solution_cell(self, preprocessor):
cell1 = create_solution_cell("hello", "code", "foo")
cell2 = create_solution_cell("goodbye", "code", "foo")
nb = new_notebook()
nb.cells.append(cell1)
nb.cells.append(cell2)
nb, resources = preprocessor.preprocess(nb, {})
assert nb.cells[0].metadata.nbgrader == {}
assert nb.cells[1].metadata.nbgrader != {}
def test_duplicate_locked_cell(self, preprocessor):
cell1 = create_locked_cell("hello", "code", "foo")
cell2 = create_locked_cell("goodbye", "code", "foo")
nb = new_notebook()
nb.cells.append(cell1)
nb.cells.append(cell2)
nb, resources = preprocessor.preprocess(nb, {})
assert nb.cells[0].metadata.nbgrader == {}
assert nb.cells[1].metadata.nbgrader != {}
|
[
1,
529,
9507,
29958,
9877,
629,
1664,
29914,
21150,
29914,
1457,
5014,
943,
29914,
1688,
29918,
7176,
786,
5926,
4841,
29889,
2272,
13,
5215,
11451,
1688,
13,
13,
3166,
302,
29890,
4830,
29889,
29894,
29946,
1053,
716,
29918,
1333,
19273,
13,
13,
3166,
2023,
1457,
5014,
943,
1053,
360,
287,
786,
5926,
21943,
13,
3166,
869,
3188,
1053,
7399,
3057,
6572,
26482,
13,
3166,
6317,
1053,
313,
13,
1678,
1653,
29918,
8228,
29918,
3729,
29892,
1653,
29918,
2929,
918,
29918,
3729,
29892,
1653,
29918,
29113,
29918,
3729,
29897,
13,
13,
13,
29992,
2272,
1688,
29889,
7241,
15546,
13,
1753,
758,
26482,
7295,
13,
1678,
6499,
353,
360,
287,
786,
5926,
21943,
580,
13,
1678,
736,
6499,
13,
13,
13,
1990,
4321,
29928,
287,
786,
5926,
21943,
29898,
5160,
3057,
6572,
26482,
1125,
13,
13,
1678,
822,
1243,
29918,
20908,
5926,
29918,
8228,
29918,
3729,
29898,
1311,
29892,
758,
26482,
1125,
13,
4706,
3038,
29896,
353,
1653,
29918,
8228,
29918,
3729,
703,
12199,
613,
376,
401,
613,
376,
5431,
613,
29871,
29906,
29897,
13,
4706,
3038,
29906,
353,
1653,
29918,
8228,
29918,
3729,
703,
16773,
26966,
613,
376,
401,
613,
376,
5431,
613,
29871,
29906,
29897,
13,
4706,
302,
29890,
353,
716,
29918,
1333,
19273,
580,
13,
4706,
302,
29890,
29889,
3729,
29879,
29889,
4397,
29898,
3729,
29896,
29897,
13,
4706,
302,
29890,
29889,
3729,
29879,
29889,
4397,
29898,
3729,
29906,
29897,
13,
13,
4706,
302,
29890,
29892,
7788,
353,
758,
26482,
29889,
1457,
5014,
29898,
9877,
29892,
426,
1800,
13,
13,
4706,
4974,
302,
29890,
29889,
3729,
29879,
29961,
29900,
1822,
19635,
29889,
9877,
629,
1664,
1275,
6571,
13,
4706,
4974,
302,
29890,
29889,
3729,
29879,
29961,
29896,
1822,
19635,
29889,
9877,
629,
1664,
2804,
6571,
13,
13,
1678,
822,
1243,
29918,
20908,
5926,
29918,
2929,
918,
29918,
3729,
29898,
1311,
29892,
758,
26482,
1125,
13,
4706,
3038,
29896,
353,
1653,
29918,
2929,
918,
29918,
3729,
703,
12199,
613,
376,
401,
613,
376,
5431,
1159,
13,
4706,
3038,
29906,
353,
1653,
29918,
2929,
918,
29918,
3729,
703,
16773,
26966,
613,
376,
401,
613,
376,
5431,
1159,
13,
4706,
302,
29890,
353,
716,
29918,
1333,
19273,
580,
13,
4706,
302,
29890,
29889,
3729,
29879,
29889,
4397,
29898,
3729,
29896,
29897,
13,
4706,
302,
29890,
29889,
3729,
29879,
29889,
4397,
29898,
3729,
29906,
29897,
13,
13,
4706,
302,
29890,
29892,
7788,
353,
758,
26482,
29889,
1457,
5014,
29898,
9877,
29892,
426,
1800,
13,
13,
4706,
4974,
302,
29890,
29889,
3729,
29879,
29961,
29900,
1822,
19635,
29889,
9877,
629,
1664,
1275,
6571,
13,
4706,
4974,
302,
29890,
29889,
3729,
29879,
29961,
29896,
1822,
19635,
29889,
9877,
629,
1664,
2804,
6571,
13,
13,
1678,
822,
1243,
29918,
20908,
5926,
29918,
29113,
29918,
3729,
29898,
1311,
29892,
758,
26482,
1125,
13,
4706,
3038,
29896,
353,
1653,
29918,
29113,
29918,
3729,
703,
12199,
613,
376,
401,
613,
376,
5431,
1159,
13,
4706,
3038,
29906,
353,
1653,
29918,
29113,
29918,
3729,
703,
16773,
26966,
613,
376,
401,
613,
376,
5431,
1159,
13,
4706,
302,
29890,
353,
716,
29918,
1333,
19273,
580,
13,
4706,
302,
29890,
29889,
3729,
29879,
29889,
4397,
29898,
3729,
29896,
29897,
13,
4706,
302,
29890,
29889,
3729,
29879,
29889,
4397,
29898,
3729,
29906,
29897,
13,
13,
4706,
302,
29890,
29892,
7788,
353,
758,
26482,
29889,
1457,
5014,
29898,
9877,
29892,
426,
1800,
13,
13,
4706,
4974,
302,
29890,
29889,
3729,
29879,
29961,
29900,
1822,
19635,
29889,
9877,
629,
1664,
1275,
6571,
13,
4706,
4974,
302,
29890,
29889,
3729,
29879,
29961,
29896,
1822,
19635,
29889,
9877,
629,
1664,
2804,
6571,
13,
2
] |
groups/models.py
|
SJTU-Plus/GroupPlus
| 47 |
1600274
|
from django.db import models
# Create your models here.
class Category(models.Model):
name = models.CharField(max_length=255)
parent = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, blank=True)
last_modified = models.DateTimeField(auto_now=True)
def __str__(self):
if self.parent:
return f"{self.parent.name} / {self.name}"
else:
return f"ROOT / {self.name}"
class Group(models.Model):
name = models.CharField(max_length=255)
number = models.CharField(max_length=255, null=True, unique=True)
desc = models.CharField(max_length=1024, null=True, blank=True)
category = models.ForeignKey(Category, on_delete=models.SET_NULL, null=True)
last_modified = models.DateTimeField(auto_now=True)
bot_enabled = models.BooleanField(default=False)
vacancy = models.BooleanField(default=True)
flag = models.IntegerField(default=0, null=False)
def __str__(self):
return f"{self.category.name} / ({self.name}, {self.number})"
class Website(models.Model):
name = models.CharField(max_length=255)
url = models.CharField(max_length=255)
desc = models.CharField(max_length=1024, null=True, blank=True)
category = models.ForeignKey(Category, on_delete=models.SET_NULL, null=True)
last_modified = models.DateTimeField(auto_now=True)
def __str__(self):
return f"{self.category.name} / ({self.name}, {self.url})"
|
[
1,
515,
9557,
29889,
2585,
1053,
4733,
13,
13,
13,
29937,
6204,
596,
4733,
1244,
29889,
13,
1990,
17943,
29898,
9794,
29889,
3195,
1125,
13,
1678,
1024,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29945,
29897,
13,
1678,
3847,
353,
4733,
29889,
27755,
2558,
877,
1311,
742,
373,
29918,
8143,
29922,
9794,
29889,
10490,
29918,
10074,
29892,
1870,
29922,
5574,
29892,
9654,
29922,
5574,
29897,
13,
1678,
1833,
29918,
1545,
2164,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29922,
5574,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
565,
1583,
29889,
3560,
29901,
13,
9651,
736,
285,
29908,
29912,
1311,
29889,
3560,
29889,
978,
29913,
847,
426,
1311,
29889,
978,
5038,
13,
4706,
1683,
29901,
13,
9651,
736,
285,
29908,
21289,
847,
426,
1311,
29889,
978,
5038,
13,
13,
13,
1990,
6431,
29898,
9794,
29889,
3195,
1125,
13,
1678,
1024,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29945,
29897,
13,
1678,
1353,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29945,
29892,
1870,
29922,
5574,
29892,
5412,
29922,
5574,
29897,
13,
1678,
5153,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29896,
29900,
29906,
29946,
29892,
1870,
29922,
5574,
29892,
9654,
29922,
5574,
29897,
13,
1678,
7663,
353,
4733,
29889,
27755,
2558,
29898,
10900,
29892,
373,
29918,
8143,
29922,
9794,
29889,
10490,
29918,
10074,
29892,
1870,
29922,
5574,
29897,
13,
1678,
1833,
29918,
1545,
2164,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29922,
5574,
29897,
13,
1678,
9225,
29918,
17590,
353,
4733,
29889,
18146,
3073,
29898,
4381,
29922,
8824,
29897,
13,
1678,
11757,
6906,
353,
4733,
29889,
18146,
3073,
29898,
4381,
29922,
5574,
29897,
13,
1678,
7353,
353,
4733,
29889,
7798,
3073,
29898,
4381,
29922,
29900,
29892,
1870,
29922,
8824,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
285,
29908,
29912,
1311,
29889,
7320,
29889,
978,
29913,
847,
21313,
1311,
29889,
978,
1118,
426,
1311,
29889,
4537,
1800,
29908,
13,
13,
13,
1990,
13253,
29898,
9794,
29889,
3195,
1125,
13,
1678,
1024,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29945,
29897,
13,
1678,
3142,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29945,
29897,
13,
1678,
5153,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29896,
29900,
29906,
29946,
29892,
1870,
29922,
5574,
29892,
9654,
29922,
5574,
29897,
13,
1678,
7663,
353,
4733,
29889,
27755,
2558,
29898,
10900,
29892,
373,
29918,
8143,
29922,
9794,
29889,
10490,
29918,
10074,
29892,
1870,
29922,
5574,
29897,
13,
1678,
1833,
29918,
1545,
2164,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29922,
5574,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
285,
29908,
29912,
1311,
29889,
7320,
29889,
978,
29913,
847,
21313,
1311,
29889,
978,
1118,
426,
1311,
29889,
2271,
1800,
29908,
13,
2
] |
poker/poker_base/prob.py
|
chitty/poker_base
| 0 |
106016
|
<reponame>chitty/poker_base<gh_stars>0
from poker import hand_rank
from deal import deal
hand_names = ["High Card", "Pair", "Two Pair", "3 of a Kind", "Straight",
"Flush", "Full House", "4 of a Kind", "Straight Flush"]
def hand_percentage(n=700*1000):
"""Sample n random hands and print a table of percentages for each type
of hand.
Args:
n: int indicates total number of hands to be dealt.
"""
counts = [0]*9
for i in range(n/10):
for hand in deal(10):
ranking = hand_rank(hand)[0]
counts[ranking] += 1
for i in reversed(range(9)):
print "%14s: %6.3f %%" % (hand_names[i], 100.*counts[i]/n)
hand_percentage(700000)
|
[
1,
529,
276,
1112,
420,
29958,
305,
986,
29891,
29914,
29886,
17933,
29918,
3188,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
11293,
261,
1053,
1361,
29918,
10003,
13,
3166,
5376,
1053,
5376,
13,
13,
3179,
29918,
7039,
353,
6796,
16382,
9160,
613,
376,
20547,
613,
376,
13985,
349,
1466,
613,
376,
29941,
310,
263,
13187,
613,
376,
855,
336,
523,
613,
13,
795,
376,
8754,
1878,
613,
376,
13658,
5619,
613,
376,
29946,
310,
263,
13187,
613,
376,
855,
336,
523,
2379,
1878,
3108,
13,
13,
13,
1753,
1361,
29918,
25376,
482,
29898,
29876,
29922,
29955,
29900,
29900,
29930,
29896,
29900,
29900,
29900,
1125,
13,
1678,
9995,
17708,
302,
4036,
6567,
322,
1596,
263,
1591,
310,
10151,
1179,
363,
1269,
1134,
13,
539,
310,
1361,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
302,
29901,
938,
14088,
3001,
1353,
310,
6567,
304,
367,
316,
1997,
29889,
13,
1678,
9995,
13,
1678,
18139,
353,
518,
29900,
14178,
29929,
13,
1678,
363,
474,
297,
3464,
29898,
29876,
29914,
29896,
29900,
1125,
13,
4706,
363,
1361,
297,
5376,
29898,
29896,
29900,
1125,
13,
9651,
24034,
353,
1361,
29918,
10003,
29898,
3179,
9601,
29900,
29962,
13,
9651,
18139,
29961,
661,
9292,
29962,
4619,
29871,
29896,
13,
1678,
363,
474,
297,
18764,
287,
29898,
3881,
29898,
29929,
22164,
13,
4706,
1596,
11860,
29896,
29946,
29879,
29901,
1273,
29953,
29889,
29941,
29888,
17806,
29908,
1273,
313,
3179,
29918,
7039,
29961,
29875,
1402,
29871,
29896,
29900,
29900,
5575,
2798,
29879,
29961,
29875,
16261,
29876,
29897,
13,
13,
3179,
29918,
25376,
482,
29898,
29955,
29900,
29900,
29900,
29900,
29900,
29897,
13,
2
] |
advanced lane tracking pipeline.py
|
mrpalazz/CarND-Advanced-Lane-Lines
| 0 |
35664
|
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 22 21:44:55 2017
@author: Mike
"""
import numpy as np
import cv2
import glob
import pickle
import matplotlib.pyplot as plt
from matplotlib.pyplot import *
import os
from scipy import stats
from moviepy.editor import VideoFileClip
from IPython.display import HTML
from camera_calibration import calibrate_camera, distortion_correct
from sobel_library import abs_sobel_image, sobel_mag_thresh, sobel_dir_thresh
from collections import deque
run_camera_cal = 1
#HLS Color space threshold filter
def color_binary(img, colorspace, color_thresh):
if colorspace == 'HLS':
hls = cv2.cvtColor(img, cv2.COLOR_RGB2HLS)
H = hls[:,:,0]
L = hls[:,:,1]
S = hls[:,:,2]
binary_output = np.zeros_like(S)
binary_output[((S > color_thresh [0]) & (S < color_thresh [1]))] = 1
return binary_output
#combine the thresholds for the color map and the gradient threshold
# send in an image with binary color scheme and binary gradient scheme
def bin_color_gradient(binary_gradient , binary_color):
binary_output = np.zeros_like(binary_gradient)
binary_output[((binary_gradient == 1) | (binary_color == 1))] = 1
# polys = np.array([[(350,720),(580,500),(800,500),(1000,720)]], dtype = np.int32)
polys = np.array([[(350,720),(580,500),(800,500),(900,720)]], dtype = np.int32)
cv2.fillPoly(binary_output, polys, 0, lineType=8, shift=0)
return binary_output
#Function to warp images to birds eye view
def warp(img,source_points, destination_points):
img_shape = (img.shape[1], img.shape[0])
src = np.float32(source_points)
dst = np.float32(destination_points)
M = cv2.getPerspectiveTransform(src,dst)
Minv = cv2.getPerspectiveTransform(dst,src)
warped = cv2.warpPerspective(img,M,img_shape, flags = cv2.INTER_LINEAR)
return warped, M, Minv
global left_fit_deque
global right_fit_deque
deque_size = 3
left_fit_deque = []
left_fit_deque = deque(maxlen = deque_size)
right_fit_deque = []
right_fit_deque = deque(maxlen = deque_size)
class Lane():
def __init__(self):
self.llm = []
self.rlm = []
mylane = Lane()
coeffs = []
C0_L = np.zeros(deque_size)
C1_L = np.zeros(deque_size)
C2_L = np.zeros(deque_size)
C0_R = np.zeros(deque_size)
C1_R = np.zeros(deque_size)
C2_R = np.zeros(deque_size)
def polyfit(warped_image, orig_img, Minv):
#def polyfit(warped_image):
# print('Initiating line overlay onto binary warped image')
# Assuming you have created a warped binary image called "binary_warped"
# Take a histogram of the bottom half of the image
histogram = np.sum(warped_image[warped_image.shape[0]//2:,:], axis=0)
#histogram = np.sum(binary_warped[binary_warped.shape[0]/2:,:], axis=0)
# Create an output image to draw on and visualize the result
out_img = np.dstack((warped_image, warped_image, warped_image))*255
# Find the peak of the left and right halves of the histogram
# These will be the starting point for the left and right lines
midpoint = np.int(histogram.shape[0]/2)
leftx_base = np.argmax(histogram[:midpoint])
rightx_base = np.argmax(histogram[midpoint:]) + midpoint
# Choose the number of sliding windows
nwindows = 9
# Set height of windows
window_height = np.int(warped_image.shape[0]/nwindows)
# Identify the x and y positions of all nonzero pixels in the image
nonzero = warped_image.nonzero()
nonzeroy = np.array(nonzero[0])
nonzerox = np.array(nonzero[1])
# Current positions to be updated for each window
leftx_current = leftx_base
rightx_current = rightx_base
# Set the width of the windows +/- margin
margin = 100
# Set minimum number of pixels found to recenter window
minpix = 50
# Create empty lists to receive left and right lane pixel indices
left_lane_inds = []
right_lane_inds = []
# Step through the windows one by one
for window in range(nwindows):
# Identify window boundaries in x and y (and right and left)
win_y_low = warped_image.shape[0] - (window+1)*window_height
win_y_high = warped_image.shape[0] - window*window_height
win_xleft_low = leftx_current - margin
win_xleft_high = leftx_current + margin
win_xright_low = rightx_current - margin
win_xright_high = rightx_current + margin
# Draw the windows on the visualization image
cv2.rectangle(out_img,(win_xleft_low,win_y_low),(win_xleft_high,win_y_high),
(0,255,0), 2)
cv2.rectangle(out_img,(win_xright_low,win_y_low),(win_xright_high,win_y_high),
(0,255,0), 2)
# Identify the nonzero pixels in x and y within the window
good_left_inds = ((nonzeroy >= win_y_low) & (nonzeroy < win_y_high) &
(nonzerox >= win_xleft_low) & (nonzerox < win_xleft_high)).nonzero()[0]
good_right_inds = ((nonzeroy >= win_y_low) & (nonzeroy < win_y_high) &
(nonzerox >= win_xright_low) & (nonzerox < win_xright_high)).nonzero()[0]
# Append these indices to the lists
left_lane_inds.append(good_left_inds)
right_lane_inds.append(good_right_inds)
# If you found > minpix pixels, recenter next window on their mean position
if len(good_left_inds) > minpix:
leftx_current = np.int(np.mean(nonzerox[good_left_inds]))
if len(good_right_inds) > minpix:
rightx_current = np.int(np.mean(nonzerox[good_right_inds]))
# Concatenate the arrays of indices
left_lane_inds = np.concatenate(left_lane_inds)
right_lane_inds = np.concatenate(right_lane_inds)
# Extract left and right line pixel positions
leftx = nonzerox[left_lane_inds]
lefty = nonzeroy[left_lane_inds]
rightx = nonzerox[right_lane_inds]
righty = nonzeroy[right_lane_inds]
# Fit a second order polynomial to each
left_fit = np.polyfit(lefty, leftx, 2)
#Store the left poly coefficient in a deque for later use
left_fit_deque.append(left_fit)
# Take the deque of polynomial data and extract the three coefficients, avearge them for stability
for idx, coeffs in enumerate(left_fit_deque):
C0_L[idx] = coeffs[0]
C1_L[idx] = coeffs[1]
C2_L[idx] = coeffs[2]
average_C0_L = np.mean(C0_L)
average_C1_L = np.mean(C1_L)
average_C2_L = np.mean(C2_L)
left_fit[0] = average_C0_L
left_fit[1] = average_C1_L
left_fit[2] = average_C2_L
right_fit = np.polyfit(righty, rightx, 2)
#Store the left poly coefficient in a deque for later use
right_fit_deque.append(right_fit)
# Take the deque of polynomial data and extract the three coefficients, avearge them for stability
for idx, coeffs in enumerate(right_fit_deque):
C0_R[idx] = coeffs[0]
C1_R[idx] = coeffs[1]
C2_R[idx] = coeffs[2]
average_C0_R = np.mean(C0_R)
average_C1_R = np.mean(C1_R)
average_C2_R = np.mean(C2_R)
right_fit[0] = average_C0_R
right_fit[1] = average_C1_R
right_fit[2] = average_C2_R
# Generate x and y values for plotting
ploty = np.linspace(0, warped_image.shape[0]-1, warped_image.shape[0] )
left_fitx = left_fit[0]*ploty**2 + left_fit[1]*ploty + left_fit[2]
# left_fitx = left_fit_deque[0]*ploty**2 + left_fit_deque[1]*ploty + left_fit[2]
right_fitx = right_fit[0]*ploty**2 + right_fit[1]*ploty + right_fit[2]
out_img[nonzeroy[left_lane_inds], nonzerox[left_lane_inds]] = [255, 0, 0]
out_img[nonzeroy[right_lane_inds], nonzerox[right_lane_inds]] = [0, 0, 255]
# plt.figure(figsize = (20,10))
# plt.imshow(out_img)
# plt.plot(left_fitx, ploty, color='blue')
# plt.plot(right_fitx, ploty, color='red')
# plt.xlim(0, 1280)
# plt.ylim(720, 0)
# plt.show()
# Create an image to draw the lines on
warp_zero = np.zeros_like(warped_image).astype(np.uint8)
color_warp = np.dstack((warp_zero, warp_zero, warp_zero))
# Recast the x and y points into usable format for cv2.fillPoly()
pts_left = np.array([np.transpose(np.vstack([left_fitx, ploty]))])
pts_right = np.array([np.flipud(np.transpose(np.vstack([right_fitx, ploty])))])
pts = np.hstack((pts_left, pts_right))
# Draw the lane onto the warped blank image
cv2.fillPoly(color_warp, np.int_([pts]), (0,255, 0))
# =============================================================================
# In this section we calculate the radius of curvature for the warped lines
# =============================================================================
# Define y-value where we want radius of curvature
# I'll choose the maximum y-value, corresponding to the bottom of the image
y_eval = np.max(ploty)
left_curverad = ((1 + (2*left_fit[0]*y_eval + left_fit[1])**2)**1.5) / np.absolute(2*left_fit[0])
right_curverad = ((1 + (2*right_fit[0]*y_eval + right_fit[1])**2)**1.5) / np.absolute(2*right_fit[0])
# print(left_curverad, right_curverad)
# Example values: 1926.74 1908.48
# Define conversions in x and y from pixels space to meters
ym_per_pix = 30/720 # meters per pixel in y dimension
xm_per_pix = 3.7/700 # meters per pixel in x dimension
# Fit new polynomials to x,y in world space
left_fit_cr = np.polyfit(ploty*ym_per_pix, left_fitx*xm_per_pix, 2)
right_fit_cr = np.polyfit(ploty*ym_per_pix, right_fitx*xm_per_pix, 2)
# Calculate the new radii of curvature
left_curverad = ((1 + (2*left_fit_cr[0]*y_eval*ym_per_pix + left_fit_cr[1])**2)**1.5) / np.absolute(2*left_fit_cr[0])
right_curverad = ((1 + (2*right_fit_cr[0]*y_eval*ym_per_pix + right_fit_cr[1])**2)**1.5) / np.absolute(2*right_fit_cr[0])
# Now our radius of curvature is in meters
# print(left_curverad, 'm', right_curverad, 'm')
# Example values: 632.1 m 626.2 m
# =============================================================================
# Calculate the position from center for the vehicle relative to the left lane
# =============================================================================
# Warp the blank back to original image space using inverse perspective matrix (Minv)
newwarp = cv2.warpPerspective(color_warp, Minv, (orig_img.shape[1], orig_img.shape[0]))
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(newwarp,'Recording: project_video',(10,50), font, 1,(255,0,0),3,cv2.LINE_AA)
cv2.putText(newwarp,'Road Radius of curvature: {} km'.format(left_curverad/1000),(10,100), font, 1,(255,0,0),3,cv2.LINE_AA)
# =============================================================================
# Add the Section for fitting the radius of curvature to the image
# =============================================================================
vehicle_center = newwarp.shape[1]/2 #assuming that the video feed is from veh center
y_pixels = np.arange(newwarp.shape[0]-10, newwarp.shape[0]+1)
# y_pixels = 719
lx_loc = left_fit_cr[0]*y_pixels**2+left_fit_cr[1]*y_pixels+left_fit_cr[2]
rx_loc = right_fit_cr[0]*y_pixels**2+right_fit_cr[1]*y_pixels+right_fit_cr[2]
lane_center_pixel = (right_fitx[0] + left_fitx[0])/2
vehicle_offset = (vehicle_center - lane_center_pixel)*xm_per_pix
# pct_difference = vehicle_offset/
if vehicle_offset > 0:
cv2.putText(newwarp,'Ego Vehicle is {} meters right of lane center'.format(vehicle_offset),(10,150), font, 1,(255,0,0),3,cv2.LINE_AA)
if vehicle_offset < 0:
cv2.putText(newwarp,'Ego Vehicle is {} meters left of lane center'.format(vehicle_offset),(10,150), font, 1,(255,0,0),3,cv2.LINE_AA)
if vehicle_offset == 0:
cv2.putText(newwarp,'Ego Vehicle is directly on center!! Great job!',(10,150), font, 1,(255,0,0),3,cv2.LINE_AA)
# =============================================================================
# This plots the lane line data for debugging vehicle center
# =============================================================================
# plt.plot(lx_loc,y_pixels,'x')
# plt.title('Left Lane Line Pixel Locations')
# plt.show()
#
# plt.plot(rx_loc,y_pixels,'x')
# plt.title('Right Lane Line Pixel Locations')
# plt.show()
#
# plt.plot(left_fitx,'x')
# plt.plot(right_fitx,'o')
# plt.title('Left Lane and Right Lane overlay, horizontal dir i "y" in image space')
# plt.show()
#
# plt.figure(figsize = (15,15))
# plt.imshow(newwarp)
# plt.show()
#
# Combine the result with the original image
#img = cv2.imread(img)
img = cv2.cvtColor(orig_img,cv2.COLOR_BGR2RGB)
# result = cv2.addWeighted(orig_img, 1, newwarp, 0.3, 0)
result = cv2.addWeighted(img, 1, newwarp, 0.3, 0)
#This is the final overlaid image with the texxto n it
# plt.figure(figsize = (10,10))
# plt.title('final result')
# plt.imshow(result)
# plt.show()
return result, left_fitx, right_fitx, ploty
if run_camera_cal == 1:
#--------------------- CAll functions and initiate camera cal and distortion corrrect-----------------------
#This section calls the camera calibration function
# Call the function to parse through the calibration image array and return
#the base object point, corners and a grascale image for reference size
#***** TURN THIS ON LATER!!!!!! when you want to calibrate the camera
# Make a list of calibration images
image_dir = "C:\\Users\\mrpal\\Documents\\Projects\\CarND-Advanced-Lane-Lines\\camera_cal\\"
images = os.listdir('camera_cal')
corners, imgpoints, objpoints, gray = calibrate_camera(image_dir, images)
##Generate the distortion coefficients and camera matrix, trans vector and rot vector
print('Generating distortion coefficients and camera matrix parameters')
ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints,gray.shape[::-1], None, None)
#Undistort the images in the test_images folder
image_dir = "C:\\Users\\mrpal\\Documents\\Projects\\CarND-Advanced-Lane-Lines\\test_images\\"
images = os.listdir('test_images')
print('Selected image directory is: {} '.format(image_dir))
print('The images in the directory are: {}' .format(images))
distortion_corrected = distortion_correct(image_dir, images, mtx, dist)
cv2.destroyAllWindows()
#--------------------- CAll functions to initiate a pipeline for image processing----------------------
image_dir = "C:\\Users\\mrpal\\Documents\\Projects\\CarND-Advanced-Lane-Lines\\test_images\\"
images = os.listdir('test_images')
print('Selected image directory is: {} '.format(image_dir))
print('The images in the directory are: {} \n' .format(images))
#print('The images in the directory are: {} \n' .format(images_new))
sobel_kernel = 9
#mag_thresh = [30,255]
#keep it
grad_threshold = [50,150]
sobel_mag = [0,255]
#distortion correct
if len(glob.glob('./test_images/*Distortion*.jpg')) == 0:
print('there are no distortion corrected images in the directory, let us create them')
distortion_corrected = distortion_correct(image_dir, images, mtx, dist)
images = glob.glob('./test_images/*Distortion*.jpg')
def process_image(images):
# for idx, fname in enumerate(images):
img = cv2.cvtColor(images, cv2.COLOR_BGR2RGB)
# img = cv2.cvtColor(images, cv2.COLOR_RGB2BGR)
# orig_image = img
# img = cv2.imread(fname)
# plt.figure(figsize = (20,10))
# plt.imshow(img)
# plt.show()
#pull in the absolute binary gradient data in X and Y
gradx_binary = abs_sobel_image(img,'x',grad_threshold , sobel_kernel)
# plt.figure(figsize = (20,10))
# plt.title('Binary Gradient Thresholding in X direction')
# plt.imshow(gradx_binary, cmap='gray')
# plt.show()
grady_binary = abs_sobel_image(img,'y',grad_threshold , sobel_kernel)
# plt.figure(figsize = (20,10))
# plt.title('Binary Gradient Thresholding in Y direction')
# plt.imshow(grady_binary, cmap='gray')
# plt.show()
#Calculate the Sobel direction gradient binary threshold
dir_binary = sobel_dir_thresh(img, sobel_kernel=15, thresh=(0.6, np.pi/2))
# print(dir_binary.dtype)
# plt.figure(figsize = (20,10))
# plt.title('Binary Sobel (Absolute) Gradient Thresholding')
# plt.imshow(dir_binary, cmap = 'gray')
# mag_binary = sobel_mag_thresh(img, sobel_kernel, mag_thresh= (50, 150))
mag_binary = sobel_mag_thresh(img, sobel_kernel, mag_thresh= (80, 150))
# plt.figure(figsize = (20,10))
# plt.title('Binary Gradient Magnitude Thresholding')
# plt.imshow(mag_binary, cmap='gray')
# mag_binary
#Combine the gradient thresholds into a coherent image, there still may be gaps where color thresholding comes in
combined_binary = np.zeros_like(dir_binary)
# combined_binary[(gradx_binary == 1) | ((mag_binary == 1) | (dir_binary == 1))] = 1
combined_binary[(gradx_binary == 1) | ((mag_binary == 1) & (dir_binary == 1))] = 1
#combined_binary[((gradx_binary == 1) & (grady_binary == 1)) | ((mag_binary == 1) & (dir_binary == 1))] = 1
# plt.figure(figsize = (20,10))
# plt.title('Combined Binary Gradient Thresholding (X,Mag,Dir)')
# plt.imshow(combined_binary, cmap = 'gray')
# plt.show()
binary_color = color_binary(img, 'HLS', color_thresh = [80,255])
# binary_color = color_binary(img, 'HLS', color_thresh = [80,180])
# plt.figure(figsize = (20,10))
# plt.title('Binary Color Thresholding in HLS')
# plt.imshow(binary_color, cmap = 'gray')
# plt.show()
#Visualize the overall combined thresholding on the test images
color_grad_combined = bin_color_gradient(combined_binary , binary_color)
# plt.figure(figsize = (20,10))
# plt.title('Combined color and gradient mag thresholding')
# plt.imshow(color_grad_combined, cmap = 'gray')
# plt.show()
img_size = img.shape
offset = 100
src = np.float32([(200, 720), (580, 480), (720, 480), (1050, 720)])
dst = np.float32([(280, 720), (400, 190), (920, 190), (960, 720)])
destination_points = np.float32([[offset, img_size[1]-offset], [img_size[0]-offset, img_size[1]-offset],
[img_size[0]-offset, offset],
[offset, offset]])
source_points = np.float32(([450,780], [680, 1050], [680,250], [450, 500]))
binary_warped, M, Minv = warp(color_grad_combined,src, dst)
#warped_image_test = warp(img,source_points, destination_points)
# plt.figure(figsize = (20,10))
# plt.imshow(binary_warped, cmap='gray')
# plt.show()
#
#
# import numpy as np
# plt.figure(figsize = (20,10))
# histogram = np.sum(binary_warped[binary_warped.shape[0]//2:,:], axis=0)
# plt.plot(histogram)
# plt.show()
#
#Need the line data to be fed back out
out, left_fitx, right_fitx, ploty = polyfit(binary_warped,img, Minv)
# out = cv2.cvtColor(out, cv2.COLOR_BGR2RGB)
return out
#######--------------------------
##os.system("ffmpeg -i project_video.mp4 -vf fps=15/1 out_%03d.jpg'
Test_Video_dir = os.listdir("test_videos/")
video_output = 'project_video_output.mp4'
clip1 = VideoFileClip("test_videos/project_video.mp4").subclip(13,18)
#clip1 = VideoFileClip("test_videos/project_video.mp4")
clip = clip1.fl_image(process_image) #NOTE: this function expects color images!!
clip.write_videofile(video_output, audio=False)
#-------------------------------------------
|
[
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
30004,
13,
15945,
19451,
13,
20399,
373,
15050,
2864,
29871,
29906,
29906,
29871,
29906,
29896,
29901,
29946,
29946,
29901,
29945,
29945,
29871,
29906,
29900,
29896,
29955,
30004,
13,
30004,
13,
29992,
8921,
29901,
12828,
30004,
13,
15945,
19451,
13,
30004,
13,
30004,
13,
5215,
12655,
408,
7442,
30004,
13,
5215,
13850,
29906,
30004,
13,
5215,
13149,
30004,
13,
5215,
5839,
280,
30004,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
30004,
13,
3166,
22889,
29889,
2272,
5317,
1053,
334,
30004,
13,
5215,
2897,
30004,
13,
3166,
4560,
2272,
1053,
22663,
30004,
13,
3166,
14064,
2272,
29889,
15204,
1053,
13987,
2283,
29907,
3466,
30004,
13,
3166,
5641,
1656,
29889,
4990,
1053,
4544,
30004,
13,
3166,
10656,
29918,
1052,
26218,
1053,
1208,
4626,
403,
29918,
26065,
29892,
1320,
441,
291,
29918,
15728,
30004,
13,
3166,
577,
6596,
29918,
5258,
1053,
6425,
29918,
578,
6596,
29918,
3027,
29892,
577,
6596,
29918,
11082,
29918,
386,
3781,
29892,
577,
6596,
29918,
3972,
29918,
386,
3781,
30004,
13,
3166,
16250,
1053,
316,
802,
30004,
13,
30004,
13,
3389,
29918,
26065,
29918,
1052,
353,
29871,
29896,
30004,
13,
30004,
13,
29937,
29950,
8547,
9159,
2913,
16897,
4175,
30004,
13,
1753,
2927,
29918,
19541,
29898,
2492,
29892,
11955,
3535,
29892,
2927,
29918,
386,
3781,
1125,
30004,
13,
30004,
13,
1678,
565,
11955,
3535,
1275,
525,
29950,
8547,
2396,
1678,
6756,
13,
4706,
298,
3137,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
28212,
29906,
29950,
8547,
8443,
13,
4706,
379,
353,
298,
3137,
7503,
29892,
29901,
29892,
29900,
29962,
30004,
13,
4706,
365,
353,
298,
3137,
7503,
29892,
29901,
29892,
29896,
29962,
30004,
13,
4706,
317,
353,
298,
3137,
7503,
29892,
29901,
29892,
29906,
29962,
30004,
13,
1678,
6756,
13,
1678,
7581,
29918,
4905,
353,
7442,
29889,
3298,
359,
29918,
4561,
29898,
29903,
8443,
13,
1678,
7581,
29918,
4905,
29961,
3552,
29903,
1405,
2927,
29918,
386,
3781,
518,
29900,
2314,
669,
313,
29903,
529,
2927,
29918,
386,
3781,
518,
29896,
12622,
29962,
353,
29871,
29896,
30004,
13,
1678,
736,
7581,
29918,
4905,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
29937,
17743,
457,
278,
266,
3781,
3361,
363,
278,
2927,
2910,
322,
278,
16030,
16897,
30004,
13,
29937,
3638,
297,
385,
1967,
411,
7581,
2927,
11380,
322,
7581,
16030,
11380,
30004,
13,
1753,
9016,
29918,
2780,
29918,
24970,
29898,
19541,
29918,
24970,
1919,
7581,
29918,
2780,
1125,
30004,
13,
1678,
6756,
13,
1678,
7581,
29918,
4905,
353,
7442,
29889,
3298,
359,
29918,
4561,
29898,
19541,
29918,
24970,
8443,
13,
1678,
7581,
29918,
4905,
29961,
3552,
19541,
29918,
24970,
1275,
29871,
29896,
29897,
891,
313,
19541,
29918,
2780,
1275,
29871,
29896,
28166,
353,
29871,
29896,
30004,
13,
29937,
1678,
1248,
952,
353,
7442,
29889,
2378,
4197,
15625,
29941,
29945,
29900,
29892,
29955,
29906,
29900,
21336,
29945,
29947,
29900,
29892,
29945,
29900,
29900,
21336,
29947,
29900,
29900,
29892,
29945,
29900,
29900,
21336,
29896,
29900,
29900,
29900,
29892,
29955,
29906,
29900,
4638,
1402,
26688,
353,
7442,
29889,
524,
29941,
29906,
8443,
13,
1678,
1248,
952,
353,
7442,
29889,
2378,
4197,
15625,
29941,
29945,
29900,
29892,
29955,
29906,
29900,
21336,
29945,
29947,
29900,
29892,
29945,
29900,
29900,
21336,
29947,
29900,
29900,
29892,
29945,
29900,
29900,
21336,
29929,
29900,
29900,
29892,
29955,
29906,
29900,
4638,
1402,
26688,
353,
7442,
29889,
524,
29941,
29906,
8443,
13,
30004,
13,
1678,
13850,
29906,
29889,
5589,
7713,
29891,
29898,
19541,
29918,
4905,
29892,
1248,
952,
29892,
29871,
29900,
29892,
1196,
1542,
29922,
29947,
29892,
9500,
29922,
29900,
29897,
6756,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
736,
7581,
29918,
4905,
30004,
13,
30004,
13,
29937,
6678,
304,
1370,
29886,
4558,
304,
17952,
10977,
1776,
30004,
13,
1753,
1370,
29886,
29898,
2492,
29892,
4993,
29918,
9748,
29892,
12551,
29918,
9748,
1125,
30004,
13,
1678,
10153,
29918,
12181,
353,
313,
2492,
29889,
12181,
29961,
29896,
1402,
10153,
29889,
12181,
29961,
29900,
2314,
30004,
13,
1678,
4765,
353,
7442,
29889,
7411,
29941,
29906,
29898,
4993,
29918,
9748,
8443,
13,
1678,
29743,
353,
7442,
29889,
7411,
29941,
29906,
29898,
23848,
29918,
9748,
8443,
13,
1678,
341,
353,
13850,
29906,
29889,
657,
15136,
12645,
13372,
29898,
4351,
29892,
22992,
8443,
13,
1678,
3080,
29894,
353,
13850,
29906,
29889,
657,
15136,
12645,
13372,
29898,
22992,
29892,
4351,
8443,
13,
1678,
1370,
9795,
353,
13850,
29906,
29889,
4495,
29886,
15136,
12645,
29898,
2492,
29892,
29924,
29892,
2492,
29918,
12181,
29892,
13449,
353,
13850,
29906,
29889,
23845,
29918,
18521,
1718,
8443,
13,
1678,
736,
1370,
9795,
29892,
341,
29892,
3080,
29894,
30004,
13,
30004,
13,
30004,
13,
10945,
2175,
29918,
9202,
29918,
311,
802,
30004,
13,
10945,
1492,
29918,
9202,
29918,
311,
802,
30004,
13,
311,
802,
29918,
2311,
353,
29871,
29941,
30004,
13,
1563,
29918,
9202,
29918,
311,
802,
353,
5159,
30004,
13,
1563,
29918,
9202,
29918,
311,
802,
353,
316,
802,
29898,
3317,
2435,
353,
316,
802,
29918,
2311,
8443,
13,
1266,
29918,
9202,
29918,
311,
802,
353,
5159,
30004,
13,
1266,
29918,
9202,
29918,
311,
802,
353,
316,
802,
29898,
3317,
2435,
353,
316,
802,
29918,
2311,
8443,
13,
30004,
13,
1990,
23841,
7295,
30004,
13,
1678,
6756,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
30004,
13,
4706,
6756,
13,
4706,
1583,
29889,
645,
29885,
353,
5159,
30004,
13,
4706,
1583,
29889,
2096,
29885,
353,
5159,
30004,
13,
4706,
6756,
13,
1357,
25821,
353,
23841,
580,
259,
6756,
13,
1111,
12352,
29879,
353,
5159,
30004,
13,
29907,
29900,
29918,
29931,
353,
7442,
29889,
3298,
359,
29898,
311,
802,
29918,
2311,
8443,
13,
29907,
29896,
29918,
29931,
353,
7442,
29889,
3298,
359,
29898,
311,
802,
29918,
2311,
8443,
13,
29907,
29906,
29918,
29931,
353,
7442,
29889,
3298,
359,
29898,
311,
802,
29918,
2311,
8443,
13,
29907,
29900,
29918,
29934,
353,
7442,
29889,
3298,
359,
29898,
311,
802,
29918,
2311,
8443,
13,
29907,
29896,
29918,
29934,
353,
7442,
29889,
3298,
359,
29898,
311,
802,
29918,
2311,
8443,
13,
29907,
29906,
29918,
29934,
353,
7442,
29889,
3298,
359,
29898,
311,
802,
29918,
2311,
8443,
13,
30004,
13,
30004,
13,
1753,
15680,
9202,
29898,
4495,
9795,
29918,
3027,
29892,
1677,
29918,
2492,
29892,
3080,
29894,
1125,
30004,
13,
29937,
1753,
15680,
9202,
29898,
4495,
9795,
29918,
3027,
1125,
30004,
13,
29937,
1678,
1596,
877,
797,
4812,
1218,
1196,
27292,
11480,
7581,
1370,
9795,
1967,
1495,
30004,
13,
1678,
396,
17090,
366,
505,
2825,
263,
1370,
9795,
7581,
1967,
2000,
376,
19541,
29918,
4495,
9795,
19451,
13,
1678,
396,
11190,
263,
9825,
13342,
310,
278,
5970,
4203,
310,
278,
1967,
30004,
13,
1678,
9825,
13342,
353,
7442,
29889,
2083,
29898,
4495,
9795,
29918,
3027,
29961,
4495,
9795,
29918,
3027,
29889,
12181,
29961,
29900,
29962,
458,
29906,
29901,
29892,
29901,
1402,
9685,
29922,
29900,
8443,
13,
1678,
396,
29882,
391,
13342,
353,
7442,
29889,
2083,
29898,
19541,
29918,
4495,
9795,
29961,
19541,
29918,
4495,
9795,
29889,
12181,
29961,
29900,
16261,
29906,
29901,
29892,
29901,
1402,
9685,
29922,
29900,
8443,
13,
1678,
396,
6204,
385,
1962,
1967,
304,
4216,
373,
322,
29871,
7604,
675,
278,
1121,
30004,
13,
1678,
714,
29918,
2492,
353,
7442,
29889,
29881,
1429,
3552,
4495,
9795,
29918,
3027,
29892,
1370,
9795,
29918,
3027,
29892,
1370,
9795,
29918,
3027,
876,
29930,
29906,
29945,
29945,
30004,
13,
1678,
396,
10987,
278,
19224,
310,
278,
2175,
322,
1492,
8870,
1960,
310,
278,
9825,
13342,
30004,
13,
1678,
396,
4525,
674,
367,
278,
6257,
1298,
363,
278,
2175,
322,
1492,
3454,
30004,
13,
1678,
7145,
3149,
353,
7442,
29889,
524,
29898,
29882,
391,
13342,
29889,
12181,
29961,
29900,
16261,
29906,
8443,
13,
1678,
2175,
29916,
29918,
3188,
353,
7442,
29889,
1191,
3317,
29898,
29882,
391,
13342,
7503,
6563,
3149,
2314,
30004,
13,
1678,
1492,
29916,
29918,
3188,
353,
7442,
29889,
1191,
3317,
29898,
29882,
391,
13342,
29961,
6563,
3149,
29901,
2314,
718,
7145,
3149,
30004,
13,
1678,
6756,
13,
1678,
396,
14542,
852,
278,
1353,
310,
2243,
4821,
5417,
30004,
13,
1678,
302,
10499,
353,
29871,
29929,
30004,
13,
1678,
396,
3789,
3171,
310,
5417,
30004,
13,
1678,
3474,
29918,
3545,
353,
7442,
29889,
524,
29898,
4495,
9795,
29918,
3027,
29889,
12181,
29961,
29900,
16261,
29876,
10499,
8443,
13,
1678,
396,
13355,
1598,
278,
921,
322,
343,
11909,
310,
599,
1661,
9171,
17036,
297,
278,
1967,
30004,
13,
1678,
1661,
9171,
353,
1370,
9795,
29918,
3027,
29889,
5464,
9171,
26471,
13,
1678,
1661,
9171,
29891,
353,
7442,
29889,
2378,
29898,
5464,
9171,
29961,
29900,
2314,
30004,
13,
1678,
1661,
9171,
29916,
353,
7442,
29889,
2378,
29898,
5464,
9171,
29961,
29896,
2314,
30004,
13,
1678,
396,
9626,
11909,
304,
367,
4784,
363,
1269,
3474,
30004,
13,
1678,
2175,
29916,
29918,
3784,
353,
2175,
29916,
29918,
3188,
30004,
13,
1678,
1492,
29916,
29918,
3784,
353,
1492,
29916,
29918,
3188,
30004,
13,
1678,
396,
3789,
278,
2920,
310,
278,
5417,
718,
24028,
5906,
30004,
13,
1678,
5906,
353,
29871,
29896,
29900,
29900,
30004,
13,
1678,
396,
3789,
9212,
1353,
310,
17036,
1476,
304,
1162,
5893,
3474,
30004,
13,
1678,
1375,
29886,
861,
353,
29871,
29945,
29900,
30004,
13,
1678,
396,
6204,
4069,
8857,
304,
7150,
2175,
322,
1492,
301,
1662,
15526,
16285,
30004,
13,
1678,
2175,
29918,
25821,
29918,
12772,
353,
5159,
30004,
13,
1678,
1492,
29918,
25821,
29918,
12772,
353,
5159,
30004,
13,
30004,
13,
1678,
396,
16696,
1549,
278,
5417,
697,
491,
697,
30004,
13,
1678,
363,
3474,
297,
3464,
29898,
29876,
10499,
1125,
30004,
13,
4706,
396,
13355,
1598,
3474,
24371,
297,
921,
322,
343,
313,
392,
1492,
322,
2175,
8443,
13,
4706,
5401,
29918,
29891,
29918,
677,
353,
1370,
9795,
29918,
3027,
29889,
12181,
29961,
29900,
29962,
448,
313,
7165,
29974,
29896,
11877,
7165,
29918,
3545,
30004,
13,
4706,
5401,
29918,
29891,
29918,
9812,
353,
1370,
9795,
29918,
3027,
29889,
12181,
29961,
29900,
29962,
448,
3474,
29930,
7165,
29918,
3545,
30004,
13,
4706,
5401,
29918,
29916,
1563,
29918,
677,
353,
2175,
29916,
29918,
3784,
448,
5906,
30004,
13,
4706,
5401,
29918,
29916,
1563,
29918,
9812,
353,
2175,
29916,
29918,
3784,
718,
5906,
30004,
13,
4706,
5401,
29918,
29916,
1266,
29918,
677,
353,
1492,
29916,
29918,
3784,
448,
5906,
30004,
13,
4706,
5401,
29918,
29916,
1266,
29918,
9812,
353,
1492,
29916,
29918,
3784,
718,
5906,
30004,
13,
4706,
396,
18492,
278,
5417,
373,
278,
7604,
2133,
1967,
30004,
13,
4706,
13850,
29906,
29889,
1621,
2521,
29898,
449,
29918,
2492,
22657,
5080,
29918,
29916,
1563,
29918,
677,
29892,
5080,
29918,
29891,
29918,
677,
21336,
5080,
29918,
29916,
1563,
29918,
9812,
29892,
5080,
29918,
29891,
29918,
9812,
511,
30004,
13,
4706,
313,
29900,
29892,
29906,
29945,
29945,
29892,
29900,
511,
29871,
29906,
29897,
6756,
13,
4706,
13850,
29906,
29889,
1621,
2521,
29898,
449,
29918,
2492,
22657,
5080,
29918,
29916,
1266,
29918,
677,
29892,
5080,
29918,
29891,
29918,
677,
21336,
5080,
29918,
29916,
1266,
29918,
9812,
29892,
5080,
29918,
29891,
29918,
9812,
511,
30004,
13,
4706,
313,
29900,
29892,
29906,
29945,
29945,
29892,
29900,
511,
29871,
29906,
29897,
6756,
13,
4706,
396,
13355,
1598,
278,
1661,
9171,
17036,
297,
921,
322,
343,
2629,
278,
3474,
30004,
13,
4706,
1781,
29918,
1563,
29918,
12772,
353,
5135,
5464,
9171,
29891,
6736,
5401,
29918,
29891,
29918,
677,
29897,
669,
313,
5464,
9171,
29891,
529,
5401,
29918,
29891,
29918,
9812,
29897,
669,
6756,
13,
4706,
313,
5464,
9171,
29916,
6736,
5401,
29918,
29916,
1563,
29918,
677,
29897,
669,
29871,
313,
5464,
9171,
29916,
529,
5401,
29918,
29916,
1563,
29918,
9812,
8106,
5464,
9171,
580,
29961,
29900,
29962,
30004,
13,
4706,
1781,
29918,
1266,
29918,
12772,
353,
5135,
5464,
9171,
29891,
6736,
5401,
29918,
29891,
29918,
677,
29897,
669,
313,
5464,
9171,
29891,
529,
5401,
29918,
29891,
29918,
9812,
29897,
669,
6756,
13,
4706,
313,
5464,
9171,
29916,
6736,
5401,
29918,
29916,
1266,
29918,
677,
29897,
669,
29871,
313,
5464,
9171,
29916,
529,
5401,
29918,
29916,
1266,
29918,
9812,
8106,
5464,
9171,
580,
29961,
29900,
29962,
30004,
13,
4706,
396,
22871,
1438,
16285,
304,
278,
8857,
30004,
13,
4706,
2175,
29918,
25821,
29918,
12772,
29889,
4397,
29898,
16773,
29918,
1563,
29918,
12772,
8443,
13,
4706,
1492,
29918,
25821,
29918,
12772,
29889,
4397,
29898,
16773,
29918,
1266,
29918,
12772,
8443,
13,
4706,
396,
960,
366,
1476,
1405,
1375,
29886,
861,
17036,
29892,
1162,
5893,
2446,
3474,
373,
1009,
2099,
2602,
30004,
13,
4706,
565,
7431,
29898,
16773,
29918,
1563,
29918,
12772,
29897,
1405,
1375,
29886,
861,
29901,
30004,
13,
9651,
2175,
29916,
29918,
3784,
353,
7442,
29889,
524,
29898,
9302,
29889,
12676,
29898,
5464,
9171,
29916,
29961,
16773,
29918,
1563,
29918,
12772,
12622,
30004,
13,
4706,
565,
7431,
29898,
16773,
29918,
1266,
29918,
12772,
29897,
1405,
1375,
29886,
861,
29901,
4706,
6756,
13,
9651,
1492,
29916,
29918,
3784,
353,
7442,
29889,
524,
29898,
9302,
29889,
12676,
29898,
5464,
9171,
29916,
29961,
16773,
29918,
1266,
29918,
12772,
12622,
30004,
13,
1678,
6756,
13,
1678,
396,
23924,
2579,
403,
278,
7049,
310,
16285,
30004,
13,
1678,
2175,
29918,
25821,
29918,
12772,
353,
7442,
29889,
535,
29883,
2579,
403,
29898,
1563,
29918,
25821,
29918,
12772,
8443,
13,
1678,
1492,
29918,
25821,
29918,
12772,
353,
7442,
29889,
535,
29883,
2579,
403,
29898,
1266,
29918,
25821,
29918,
12772,
8443,
13,
30004,
13,
1678,
396,
7338,
1461,
2175,
322,
1492,
1196,
15526,
11909,
30004,
13,
1678,
2175,
29916,
353,
1661,
9171,
29916,
29961,
1563,
29918,
25821,
29918,
12772,
29962,
30004,
13,
1678,
2175,
29891,
353,
1661,
9171,
29891,
29961,
1563,
29918,
25821,
29918,
12772,
29962,
6756,
13,
1678,
1492,
29916,
353,
1661,
9171,
29916,
29961,
1266,
29918,
25821,
29918,
12772,
29962,
30004,
13,
1678,
1492,
29891,
353,
1661,
9171,
29891,
29961,
1266,
29918,
25821,
29918,
12772,
29962,
6756,
13,
30004,
13,
1678,
396,
383,
277,
263,
1473,
1797,
10159,
304,
1269,
30004,
13,
1678,
2175,
29918,
9202,
353,
7442,
29889,
22678,
9202,
29898,
1563,
29891,
29892,
2175,
29916,
29892,
29871,
29906,
8443,
13,
1678,
396,
9044,
278,
2175,
15680,
10825,
297,
263,
316,
802,
363,
2678,
671,
30004,
13,
1678,
2175,
29918,
9202,
29918,
311,
802,
29889,
4397,
29898,
1563,
29918,
9202,
8443,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
11190,
278,
316,
802,
310,
10159,
848,
322,
6597,
278,
2211,
16127,
29892,
8992,
279,
479,
963,
363,
25806,
30004,
13,
1678,
363,
22645,
29892,
1302,
12352,
29879,
297,
26985,
29898,
1563,
29918,
9202,
29918,
311,
802,
1125,
30004,
13,
4706,
315,
29900,
29918,
29931,
29961,
13140,
29962,
353,
1302,
12352,
29879,
29961,
29900,
29962,
30004,
13,
4706,
315,
29896,
29918,
29931,
29961,
13140,
29962,
353,
1302,
12352,
29879,
29961,
29896,
29962,
30004,
13,
4706,
315,
29906,
29918,
29931,
29961,
13140,
29962,
353,
1302,
12352,
29879,
29961,
29906,
29962,
30004,
13,
4706,
6756,
13,
4706,
6756,
13,
965,
6756,
13,
1678,
6588,
29918,
29907,
29900,
29918,
29931,
353,
7442,
29889,
12676,
29898,
29907,
29900,
29918,
29931,
8443,
13,
1678,
6588,
29918,
29907,
29896,
29918,
29931,
353,
7442,
29889,
12676,
29898,
29907,
29896,
29918,
29931,
8443,
13,
1678,
6588,
29918,
29907,
29906,
29918,
29931,
353,
7442,
29889,
12676,
29898,
29907,
29906,
29918,
29931,
8443,
13,
1678,
6756,
13,
1678,
2175,
29918,
9202,
29961,
29900,
29962,
353,
6588,
29918,
29907,
29900,
29918,
29931,
30004,
13,
1678,
2175,
29918,
9202,
29961,
29896,
29962,
353,
6588,
29918,
29907,
29896,
29918,
29931,
30004,
13,
1678,
2175,
29918,
9202,
29961,
29906,
29962,
353,
6588,
29918,
29907,
29906,
29918,
29931,
30004,
13,
30004,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
1492,
29918,
9202,
353,
7442,
29889,
22678,
9202,
29898,
1266,
29891,
29892,
1492,
29916,
29892,
29871,
29906,
8443,
13,
4706,
396,
9044,
278,
2175,
15680,
10825,
297,
263,
316,
802,
363,
2678,
671,
30004,
13,
1678,
1492,
29918,
9202,
29918,
311,
802,
29889,
4397,
29898,
1266,
29918,
9202,
8443,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
11190,
278,
316,
802,
310,
10159,
848,
322,
6597,
278,
2211,
16127,
29892,
8992,
279,
479,
963,
363,
25806,
30004,
13,
1678,
363,
22645,
29892,
1302,
12352,
29879,
297,
26985,
29898,
1266,
29918,
9202,
29918,
311,
802,
1125,
30004,
13,
4706,
315,
29900,
29918,
29934,
29961,
13140,
29962,
353,
1302,
12352,
29879,
29961,
29900,
29962,
30004,
13,
4706,
315,
29896,
29918,
29934,
29961,
13140,
29962,
353,
1302,
12352,
29879,
29961,
29896,
29962,
30004,
13,
4706,
315,
29906,
29918,
29934,
29961,
13140,
29962,
353,
1302,
12352,
29879,
29961,
29906,
29962,
30004,
13,
4706,
6756,
13,
4706,
6756,
13,
965,
6756,
13,
1678,
6588,
29918,
29907,
29900,
29918,
29934,
353,
7442,
29889,
12676,
29898,
29907,
29900,
29918,
29934,
8443,
13,
1678,
6588,
29918,
29907,
29896,
29918,
29934,
353,
7442,
29889,
12676,
29898,
29907,
29896,
29918,
29934,
8443,
13,
1678,
6588,
29918,
29907,
29906,
29918,
29934,
353,
7442,
29889,
12676,
29898,
29907,
29906,
29918,
29934,
8443,
13,
1678,
6756,
13,
1678,
1492,
29918,
9202,
29961,
29900,
29962,
353,
6588,
29918,
29907,
29900,
29918,
29934,
30004,
13,
1678,
1492,
29918,
9202,
29961,
29896,
29962,
353,
6588,
29918,
29907,
29896,
29918,
29934,
30004,
13,
1678,
1492,
29918,
9202,
29961,
29906,
29962,
353,
6588,
29918,
29907,
29906,
29918,
29934,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
1678,
396,
3251,
403,
921,
322,
343,
1819,
363,
6492,
1259,
30004,
13,
1678,
6492,
29891,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29892,
1370,
9795,
29918,
3027,
29889,
12181,
29961,
29900,
29962,
29899,
29896,
29892,
1370,
9795,
29918,
3027,
29889,
12181,
29961,
29900,
29962,
1723,
30004,
13,
1678,
2175,
29918,
9202,
29916,
353,
2175,
29918,
9202,
29961,
29900,
14178,
5317,
29891,
1068,
29906,
718,
2175,
29918,
9202,
29961,
29896,
14178,
5317,
29891,
718,
2175,
29918,
9202,
29961,
29906,
29962,
30004,
13,
29937,
1678,
2175,
29918,
9202,
29916,
353,
2175,
29918,
9202,
29918,
311,
802,
29961,
29900,
14178,
5317,
29891,
1068,
29906,
718,
2175,
29918,
9202,
29918,
311,
802,
29961,
29896,
14178,
5317,
29891,
718,
2175,
29918,
9202,
29961,
29906,
29962,
30004,
13,
1678,
1492,
29918,
9202,
29916,
353,
1492,
29918,
9202,
29961,
29900,
14178,
5317,
29891,
1068,
29906,
718,
1492,
29918,
9202,
29961,
29896,
14178,
5317,
29891,
718,
1492,
29918,
9202,
29961,
29906,
29962,
30004,
13,
30004,
13,
1678,
714,
29918,
2492,
29961,
5464,
9171,
29891,
29961,
1563,
29918,
25821,
29918,
12772,
1402,
1661,
9171,
29916,
29961,
1563,
29918,
25821,
29918,
12772,
5262,
353,
518,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
29962,
30004,
13,
1678,
714,
29918,
2492,
29961,
5464,
9171,
29891,
29961,
1266,
29918,
25821,
29918,
12772,
1402,
1661,
9171,
29916,
29961,
1266,
29918,
25821,
29918,
12772,
5262,
353,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29906,
29945,
29945,
29962,
30004,
13,
259,
6756,
13,
1678,
6756,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
449,
29918,
2492,
8443,
13,
29937,
1678,
14770,
29889,
5317,
29898,
1563,
29918,
9202,
29916,
29892,
6492,
29891,
29892,
2927,
2433,
9539,
1495,
30004,
13,
29937,
1678,
14770,
29889,
5317,
29898,
1266,
29918,
9202,
29916,
29892,
6492,
29891,
29892,
2927,
2433,
1127,
1495,
30004,
13,
29937,
1678,
14770,
29889,
29916,
2576,
29898,
29900,
29892,
29871,
29896,
29906,
29947,
29900,
8443,
13,
29937,
1678,
14770,
29889,
29891,
2576,
29898,
29955,
29906,
29900,
29892,
29871,
29900,
8443,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
1678,
6756,
13,
1678,
6756,
13,
4706,
396,
6204,
385,
1967,
304,
4216,
278,
3454,
373,
30004,
13,
1678,
1370,
29886,
29918,
9171,
353,
7442,
29889,
3298,
359,
29918,
4561,
29898,
4495,
9795,
29918,
3027,
467,
579,
668,
29898,
9302,
29889,
13470,
29947,
8443,
13,
1678,
2927,
29918,
4495,
29886,
353,
7442,
29889,
29881,
1429,
3552,
4495,
29886,
29918,
9171,
29892,
1370,
29886,
29918,
9171,
29892,
1370,
29886,
29918,
9171,
876,
30004,
13,
1678,
6756,
13,
1678,
396,
3599,
579,
278,
921,
322,
343,
3291,
964,
502,
519,
3402,
363,
13850,
29906,
29889,
5589,
7713,
29891,
26471,
13,
1678,
282,
1372,
29918,
1563,
353,
7442,
29889,
2378,
4197,
9302,
29889,
3286,
4220,
29898,
9302,
29889,
29894,
1429,
4197,
1563,
29918,
9202,
29916,
29892,
6492,
29891,
12622,
2314,
30004,
13,
1678,
282,
1372,
29918,
1266,
353,
7442,
29889,
2378,
4197,
9302,
29889,
29888,
3466,
566,
29898,
9302,
29889,
3286,
4220,
29898,
9302,
29889,
29894,
1429,
4197,
1266,
29918,
9202,
29916,
29892,
6492,
29891,
29962,
4961,
2314,
30004,
13,
1678,
282,
1372,
353,
7442,
29889,
29882,
1429,
3552,
16485,
29918,
1563,
29892,
282,
1372,
29918,
1266,
876,
30004,
13,
1678,
6756,
13,
1678,
396,
18492,
278,
301,
1662,
11480,
278,
1370,
9795,
9654,
1967,
30004,
13,
1678,
13850,
29906,
29889,
5589,
7713,
29891,
29898,
2780,
29918,
4495,
29886,
29892,
7442,
29889,
524,
29918,
4197,
16485,
11724,
313,
29900,
29892,
29906,
29945,
29945,
29892,
29871,
29900,
876,
30004,
13,
1678,
6756,
13,
1678,
6756,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
30004,
13,
29937,
268,
512,
445,
4004,
591,
8147,
278,
11855,
310,
27686,
1535,
363,
278,
1370,
9795,
3454,
30004,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
30004,
13,
1678,
6756,
13,
4706,
396,
22402,
343,
29899,
1767,
988,
591,
864,
11855,
310,
27686,
1535,
30004,
13,
1678,
396,
306,
29915,
645,
6755,
278,
7472,
343,
29899,
1767,
29892,
6590,
304,
278,
5970,
310,
278,
1967,
30004,
13,
1678,
343,
29918,
14513,
353,
7442,
29889,
3317,
29898,
5317,
29891,
8443,
13,
1678,
2175,
29918,
2764,
369,
328,
353,
5135,
29896,
718,
313,
29906,
29930,
1563,
29918,
9202,
29961,
29900,
14178,
29891,
29918,
14513,
718,
2175,
29918,
9202,
29961,
29896,
2314,
1068,
29906,
29897,
1068,
29896,
29889,
29945,
29897,
847,
7442,
29889,
23552,
29898,
29906,
29930,
1563,
29918,
9202,
29961,
29900,
2314,
30004,
13,
1678,
1492,
29918,
2764,
369,
328,
353,
5135,
29896,
718,
313,
29906,
29930,
1266,
29918,
9202,
29961,
29900,
14178,
29891,
29918,
14513,
718,
1492,
29918,
9202,
29961,
29896,
2314,
1068,
29906,
29897,
1068,
29896,
29889,
29945,
29897,
847,
7442,
29889,
23552,
29898,
29906,
29930,
1266,
29918,
9202,
29961,
29900,
2314,
30004,
13,
29937,
1678,
1596,
29898,
1563,
29918,
2764,
369,
328,
29892,
1492,
29918,
2764,
369,
328,
8443,
13,
1678,
396,
8741,
1819,
29901,
29871,
29896,
29929,
29906,
29953,
29889,
29955,
29946,
29871,
29896,
29929,
29900,
29947,
29889,
29946,
29947,
30004,
13,
30004,
13,
4706,
396,
22402,
9678,
1080,
297,
921,
322,
343,
515,
17036,
2913,
304,
27881,
30004,
13,
1678,
343,
29885,
29918,
546,
29918,
29886,
861,
353,
29871,
29941,
29900,
29914,
29955,
29906,
29900,
396,
27881,
639,
15526,
297,
343,
9927,
30004,
13,
1678,
921,
29885,
29918,
546,
29918,
29886,
861,
353,
29871,
29941,
29889,
29955,
29914,
29955,
29900,
29900,
396,
27881,
639,
15526,
297,
921,
9927,
30004,
13,
1678,
6756,
13,
1678,
396,
383,
277,
716,
24655,
304,
921,
29892,
29891,
297,
3186,
2913,
30004,
13,
1678,
2175,
29918,
9202,
29918,
7283,
353,
7442,
29889,
22678,
9202,
29898,
5317,
29891,
29930,
962,
29918,
546,
29918,
29886,
861,
29892,
2175,
29918,
9202,
29916,
29930,
29916,
29885,
29918,
546,
29918,
29886,
861,
29892,
29871,
29906,
8443,
13,
1678,
1492,
29918,
9202,
29918,
7283,
353,
7442,
29889,
22678,
9202,
29898,
5317,
29891,
29930,
962,
29918,
546,
29918,
29886,
861,
29892,
1492,
29918,
9202,
29916,
29930,
29916,
29885,
29918,
546,
29918,
29886,
861,
29892,
29871,
29906,
8443,
13,
1678,
396,
20535,
403,
278,
716,
2971,
2236,
310,
27686,
1535,
30004,
13,
1678,
2175,
29918,
2764,
369,
328,
353,
5135,
29896,
718,
313,
29906,
29930,
1563,
29918,
9202,
29918,
7283,
29961,
29900,
14178,
29891,
29918,
14513,
29930,
962,
29918,
546,
29918,
29886,
861,
718,
2175,
29918,
9202,
29918,
7283,
29961,
29896,
2314,
1068,
29906,
29897,
1068,
29896,
29889,
29945,
29897,
847,
7442,
29889,
23552,
29898,
29906,
29930,
1563,
29918,
9202,
29918,
7283,
29961,
29900,
2314,
30004,
13,
1678,
1492,
29918,
2764,
369,
328,
353,
5135,
29896,
718,
313,
29906,
29930,
1266,
29918,
9202,
29918,
7283,
29961,
29900,
14178,
29891,
29918,
14513,
29930,
962,
29918,
546,
29918,
29886,
861,
718,
1492,
29918,
9202,
29918,
7283,
29961,
29896,
2314,
1068,
29906,
29897,
1068,
29896,
29889,
29945,
29897,
847,
7442,
29889,
23552,
29898,
29906,
29930,
1266,
29918,
9202,
29918,
7283,
29961,
29900,
2314,
30004,
13,
1678,
396,
2567,
1749,
11855,
310,
27686,
1535,
338,
297,
27881,
30004,
13,
29937,
1678,
1596,
29898,
1563,
29918,
2764,
369,
328,
29892,
525,
29885,
742,
1492,
29918,
2764,
369,
328,
29892,
525,
29885,
1495,
30004,
13,
1678,
396,
8741,
1819,
29901,
29871,
29953,
29941,
29906,
29889,
29896,
286,
268,
29953,
29906,
29953,
29889,
29906,
286,
30004,
13,
1678,
6756,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
30004,
13,
29937,
259,
20535,
403,
278,
2602,
515,
4818,
363,
278,
19716,
6198,
304,
278,
2175,
301,
1662,
6756,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
30004,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
3362,
29886,
278,
9654,
1250,
304,
2441,
1967,
2913,
773,
16402,
18520,
4636,
313,
8140,
29894,
8443,
13,
1678,
716,
4495,
29886,
353,
13850,
29906,
29889,
4495,
29886,
15136,
12645,
29898,
2780,
29918,
4495,
29886,
29892,
3080,
29894,
29892,
313,
12683,
29918,
2492,
29889,
12181,
29961,
29896,
1402,
1677,
29918,
2492,
29889,
12181,
29961,
29900,
12622,
6756,
13,
1678,
6756,
13,
1678,
4079,
353,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
5425,
3580,
1307,
29990,
30004,
13,
1678,
13850,
29906,
29889,
649,
1626,
29898,
1482,
4495,
29886,
5501,
4789,
3278,
29901,
2060,
29918,
9641,
742,
29898,
29896,
29900,
29892,
29945,
29900,
511,
4079,
29892,
29871,
29896,
22657,
29906,
29945,
29945,
29892,
29900,
29892,
29900,
511,
29941,
29892,
11023,
29906,
29889,
18521,
29918,
6344,
8443,
13,
1678,
13850,
29906,
29889,
649,
1626,
29898,
1482,
4495,
29886,
5501,
9588,
328,
4957,
2482,
310,
27686,
1535,
29901,
6571,
2383,
4286,
4830,
29898,
1563,
29918,
2764,
369,
328,
29914,
29896,
29900,
29900,
29900,
21336,
29896,
29900,
29892,
29896,
29900,
29900,
511,
4079,
29892,
29871,
29896,
22657,
29906,
29945,
29945,
29892,
29900,
29892,
29900,
511,
29941,
29892,
11023,
29906,
29889,
18521,
29918,
6344,
8443,
13,
1678,
6756,
13,
30004,
13,
1678,
6756,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
30004,
13,
29937,
268,
3462,
278,
9779,
363,
28221,
278,
11855,
310,
27686,
1535,
304,
278,
1967,
30004,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
30004,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
19716,
29918,
5064,
353,
716,
4495,
29886,
29889,
12181,
29961,
29896,
16261,
29906,
396,
465,
9929,
393,
278,
4863,
8343,
338,
515,
10852,
4818,
30004,
13,
1678,
343,
29918,
29886,
861,
1379,
353,
7442,
29889,
279,
927,
29898,
1482,
4495,
29886,
29889,
12181,
29961,
29900,
29962,
29899,
29896,
29900,
29892,
716,
4495,
29886,
29889,
12181,
29961,
29900,
10062,
29896,
8443,
13,
29937,
1678,
343,
29918,
29886,
861,
1379,
353,
29871,
29955,
29896,
29929,
30004,
13,
1678,
301,
29916,
29918,
2029,
353,
2175,
29918,
9202,
29918,
7283,
29961,
29900,
14178,
29891,
29918,
29886,
861,
1379,
1068,
29906,
29974,
1563,
29918,
9202,
29918,
7283,
29961,
29896,
14178,
29891,
29918,
29886,
861,
1379,
29974,
1563,
29918,
9202,
29918,
7283,
29961,
29906,
29962,
30004,
13,
1678,
364,
29916,
29918,
2029,
353,
1492,
29918,
9202,
29918,
7283,
29961,
29900,
14178,
29891,
29918,
29886,
861,
1379,
1068,
29906,
29974,
1266,
29918,
9202,
29918,
7283,
29961,
29896,
14178,
29891,
29918,
29886,
861,
1379,
29974,
1266,
29918,
9202,
29918,
7283,
29961,
29906,
29962,
30004,
13,
1678,
6756,
13,
1678,
301,
1662,
29918,
5064,
29918,
29886,
15711,
353,
313,
1266,
29918,
9202,
29916,
29961,
29900,
29962,
718,
2175,
29918,
9202,
29916,
29961,
29900,
2314,
29914,
29906,
30004,
13,
1678,
19716,
29918,
10289,
353,
313,
345,
29882,
2512,
29918,
5064,
448,
301,
1662,
29918,
5064,
29918,
29886,
15711,
11877,
29916,
29885,
29918,
546,
29918,
29886,
861,
30004,
13,
29937,
1678,
282,
312,
29918,
29881,
17678,
353,
19716,
29918,
10289,
29914,
30004,
13,
30004,
13,
1678,
565,
19716,
29918,
10289,
1405,
29871,
29900,
29901,
30004,
13,
4706,
13850,
29906,
29889,
649,
1626,
29898,
1482,
4495,
29886,
5501,
29923,
1484,
8980,
29882,
2512,
338,
6571,
27881,
1492,
310,
301,
1662,
4818,
4286,
4830,
29898,
345,
29882,
2512,
29918,
10289,
21336,
29896,
29900,
29892,
29896,
29945,
29900,
511,
4079,
29892,
29871,
29896,
22657,
29906,
29945,
29945,
29892,
29900,
29892,
29900,
511,
29941,
29892,
11023,
29906,
29889,
18521,
29918,
6344,
8443,
13,
1678,
565,
19716,
29918,
10289,
529,
29871,
29900,
29901,
259,
6756,
13,
4706,
13850,
29906,
29889,
649,
1626,
29898,
1482,
4495,
29886,
5501,
29923,
1484,
8980,
29882,
2512,
338,
6571,
27881,
2175,
310,
301,
1662,
4818,
4286,
4830,
29898,
345,
29882,
2512,
29918,
10289,
21336,
29896,
29900,
29892,
29896,
29945,
29900,
511,
4079,
29892,
29871,
29896,
22657,
29906,
29945,
29945,
29892,
29900,
29892,
29900,
511,
29941,
29892,
11023,
29906,
29889,
18521,
29918,
6344,
8443,
13,
1678,
565,
19716,
29918,
10289,
1275,
29871,
29900,
29901,
30004,
13,
4706,
13850,
29906,
29889,
649,
1626,
29898,
1482,
4495,
29886,
5501,
29923,
1484,
8980,
29882,
2512,
338,
4153,
373,
4818,
6824,
7027,
4982,
29991,
742,
29898,
29896,
29900,
29892,
29896,
29945,
29900,
511,
4079,
29892,
29871,
29896,
22657,
29906,
29945,
29945,
29892,
29900,
29892,
29900,
511,
29941,
29892,
11023,
29906,
29889,
18521,
29918,
6344,
8443,
13,
4706,
6756,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
30004,
13,
29937,
268,
910,
24580,
278,
301,
1662,
1196,
848,
363,
13490,
19716,
4818,
30004,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
30004,
13,
29937,
1678,
14770,
29889,
5317,
29898,
29880,
29916,
29918,
2029,
29892,
29891,
29918,
29886,
861,
1379,
5501,
29916,
1495,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
8091,
23841,
7407,
349,
15711,
5976,
800,
1495,
30004,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
29937,
29871,
6756,
13,
29937,
1678,
14770,
29889,
5317,
29898,
17697,
29918,
2029,
29892,
29891,
29918,
29886,
861,
1379,
5501,
29916,
1495,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
7341,
23841,
7407,
349,
15711,
5976,
800,
1495,
30004,
13,
29937,
1678,
14770,
29889,
4294,
580,
29871,
6756,
13,
29937,
1678,
6756,
13,
29937,
1678,
14770,
29889,
5317,
29898,
1563,
29918,
9202,
29916,
5501,
29916,
1495,
30004,
13,
29937,
1678,
14770,
29889,
5317,
29898,
1266,
29918,
9202,
29916,
5501,
29877,
1495,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
8091,
23841,
322,
10428,
23841,
27292,
29892,
14698,
4516,
474,
376,
29891,
29908,
297,
1967,
2913,
1495,
30004,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
29937,
1678,
6756,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29896,
29945,
29892,
29896,
29945,
876,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
1482,
4495,
29886,
8443,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
29937,
1678,
6756,
13,
1678,
396,
422,
26062,
278,
1121,
411,
278,
2441,
1967,
30004,
13,
1678,
396,
2492,
353,
13850,
29906,
29889,
326,
949,
29898,
2492,
8443,
13,
1678,
10153,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
12683,
29918,
2492,
29892,
11023,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
8443,
13,
29937,
1678,
1121,
353,
13850,
29906,
29889,
1202,
22676,
287,
29898,
12683,
29918,
2492,
29892,
29871,
29896,
29892,
716,
4495,
29886,
29892,
29871,
29900,
29889,
29941,
29892,
29871,
29900,
29897,
29871,
6756,
13,
1678,
1121,
353,
13850,
29906,
29889,
1202,
22676,
287,
29898,
2492,
29892,
29871,
29896,
29892,
716,
4495,
29886,
29892,
29871,
29900,
29889,
29941,
29892,
29871,
29900,
29897,
29871,
6756,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
4013,
338,
278,
2186,
975,
433,
333,
1967,
411,
278,
19696,
486,
29877,
302,
372,
30004,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29896,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
8394,
1121,
1495,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
2914,
8443,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
1678,
6756,
13,
1678,
736,
1121,
29892,
2175,
29918,
9202,
29916,
29892,
1492,
29918,
9202,
29916,
29892,
6492,
29891,
30004,
13,
30004,
13,
1678,
6756,
13,
30004,
13,
361,
1065,
29918,
26065,
29918,
1052,
1275,
29871,
29896,
29901,
30004,
13,
1678,
6756,
13,
1678,
396,
2683,
23648,
315,
3596,
3168,
322,
14511,
403,
10656,
1208,
322,
1320,
441,
291,
27760,
1621,
2683,
26589,
30004,
13,
1678,
6756,
13,
1678,
396,
4013,
4004,
5717,
278,
10656,
1208,
26218,
740,
30004,
13,
1678,
6756,
13,
1678,
396,
8251,
278,
740,
304,
6088,
1549,
278,
1208,
26218,
1967,
1409,
322,
736,
30004,
13,
4706,
396,
1552,
2967,
1203,
1298,
29892,
26995,
322,
263,
867,
6151,
744,
1967,
363,
3407,
2159,
30004,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
2328,
29930,
323,
24015,
3446,
3235,
6732,
365,
1299,
1001,
6824,
6824,
6824,
746,
366,
864,
304,
1208,
4626,
403,
278,
10656,
30004,
13,
4706,
6756,
13,
1678,
396,
8561,
263,
1051,
310,
1208,
26218,
4558,
30004,
13,
1678,
1967,
29918,
3972,
353,
376,
29907,
22298,
5959,
1966,
29885,
29878,
7830,
1966,
20128,
1966,
25119,
1966,
8179,
2797,
29899,
3253,
16858,
29899,
29931,
1662,
29899,
20261,
1966,
26065,
29918,
1052,
1966,
19451,
13,
1678,
4558,
353,
2897,
29889,
1761,
3972,
877,
26065,
29918,
1052,
1495,
6756,
13,
539,
6756,
13,
1678,
26995,
29892,
10153,
9748,
29892,
5446,
9748,
29892,
16749,
353,
1208,
4626,
403,
29918,
26065,
29898,
3027,
29918,
3972,
29892,
4558,
8443,
13,
1678,
6756,
13,
1678,
444,
5631,
403,
278,
1320,
441,
291,
16127,
322,
10656,
4636,
29892,
1301,
4608,
322,
5731,
4608,
30004,
13,
1678,
1596,
877,
5631,
1218,
1320,
441,
291,
16127,
322,
10656,
4636,
4128,
1495,
30004,
13,
1678,
3240,
29892,
286,
7508,
29892,
1320,
29892,
364,
2003,
29879,
29892,
260,
2003,
29879,
353,
13850,
29906,
29889,
1052,
4626,
403,
20717,
29898,
5415,
9748,
29892,
10153,
9748,
29892,
21012,
29889,
12181,
29961,
1057,
29899,
29896,
1402,
6213,
29892,
6213,
8443,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
25263,
391,
441,
278,
4558,
297,
278,
1243,
29918,
8346,
4138,
30004,
13,
1678,
1967,
29918,
3972,
353,
376,
29907,
22298,
5959,
1966,
29885,
29878,
7830,
1966,
20128,
1966,
25119,
1966,
8179,
2797,
29899,
3253,
16858,
29899,
29931,
1662,
29899,
20261,
1966,
1688,
29918,
8346,
1966,
19451,
13,
1678,
4558,
353,
2897,
29889,
1761,
3972,
877,
1688,
29918,
8346,
1495,
30004,
13,
1678,
1596,
877,
8592,
1967,
3884,
338,
29901,
6571,
15300,
4830,
29898,
3027,
29918,
3972,
876,
30004,
13,
1678,
1596,
877,
1576,
4558,
297,
278,
3884,
526,
29901,
6571,
29915,
869,
4830,
29898,
8346,
876,
30004,
13,
1678,
1320,
441,
291,
29918,
15728,
287,
353,
1320,
441,
291,
29918,
15728,
29898,
3027,
29918,
3972,
29892,
4558,
29892,
286,
7508,
29892,
1320,
8443,
13,
1678,
13850,
29906,
29889,
20524,
3596,
7685,
26471,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
2683,
23648,
315,
3596,
3168,
304,
14511,
403,
263,
16439,
363,
1967,
9068,
2683,
22158,
30004,
13,
1678,
6756,
13,
1678,
1967,
29918,
3972,
353,
376,
29907,
22298,
5959,
1966,
29885,
29878,
7830,
1966,
20128,
1966,
25119,
1966,
8179,
2797,
29899,
3253,
16858,
29899,
29931,
1662,
29899,
20261,
1966,
1688,
29918,
8346,
1966,
19451,
13,
1678,
4558,
353,
2897,
29889,
1761,
3972,
877,
1688,
29918,
8346,
1495,
30004,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
1596,
877,
8592,
1967,
3884,
338,
29901,
6571,
15300,
4830,
29898,
3027,
29918,
3972,
876,
30004,
13,
1678,
1596,
877,
1576,
4558,
297,
278,
3884,
526,
29901,
6571,
320,
29876,
29915,
869,
4830,
29898,
8346,
876,
30004,
13,
1678,
396,
2158,
877,
1576,
4558,
297,
278,
3884,
526,
29901,
6571,
320,
29876,
29915,
869,
4830,
29898,
8346,
29918,
1482,
876,
30004,
13,
1678,
6756,
13,
1678,
577,
6596,
29918,
17460,
353,
29871,
29929,
30004,
13,
1678,
396,
11082,
29918,
386,
3781,
353,
518,
29941,
29900,
29892,
29906,
29945,
29945,
29962,
30004,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
17462,
372,
30004,
13,
1678,
4656,
29918,
386,
12268,
353,
518,
29945,
29900,
29892,
29896,
29945,
29900,
29962,
30004,
13,
1678,
577,
6596,
29918,
11082,
353,
518,
29900,
29892,
29906,
29945,
29945,
29962,
30004,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
5721,
441,
291,
1959,
30004,
13,
1678,
565,
7431,
29898,
23705,
29889,
23705,
877,
6904,
1688,
29918,
8346,
5515,
13398,
441,
291,
10521,
6173,
8785,
1275,
29871,
29900,
29901,
30004,
13,
4706,
1596,
877,
12711,
526,
694,
1320,
441,
291,
24114,
4558,
297,
278,
3884,
29892,
1235,
502,
1653,
963,
1495,
30004,
13,
4706,
1320,
441,
291,
29918,
15728,
287,
353,
1320,
441,
291,
29918,
15728,
29898,
3027,
29918,
3972,
29892,
4558,
29892,
286,
7508,
29892,
1320,
8443,
13,
1678,
6756,
13,
1678,
4558,
353,
13149,
29889,
23705,
877,
6904,
1688,
29918,
8346,
5515,
13398,
441,
291,
10521,
6173,
1495,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
1753,
1889,
29918,
3027,
29898,
8346,
1125,
30004,
13,
29937,
1678,
363,
22645,
29892,
285,
978,
297,
26985,
29898,
8346,
1125,
30004,
13,
4706,
6756,
13,
1678,
10153,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
8346,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
8443,
13,
29937,
1678,
10153,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
8346,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
28212,
29906,
29933,
14345,
8443,
13,
29937,
1678,
1677,
29918,
3027,
353,
10153,
30004,
13,
29937,
4706,
10153,
353,
13850,
29906,
29889,
326,
949,
29898,
29888,
978,
8443,
13,
1678,
6756,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
2492,
8443,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
1678,
6756,
13,
1678,
396,
26746,
297,
278,
8380,
7581,
16030,
848,
297,
1060,
322,
612,
30004,
13,
1678,
4656,
29916,
29918,
19541,
353,
6425,
29918,
578,
6596,
29918,
3027,
29898,
2492,
5501,
29916,
742,
5105,
29918,
386,
12268,
1919,
577,
6596,
29918,
17460,
8443,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
25196,
19295,
993,
498,
12268,
292,
297,
1060,
5305,
1495,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
5105,
29916,
29918,
19541,
29892,
274,
1958,
2433,
21012,
1495,
30004,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
30004,
13,
1678,
867,
3714,
29918,
19541,
353,
6425,
29918,
578,
6596,
29918,
3027,
29898,
2492,
5501,
29891,
742,
5105,
29918,
386,
12268,
1919,
577,
6596,
29918,
17460,
8443,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
25196,
19295,
993,
498,
12268,
292,
297,
612,
5305,
1495,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
629,
3714,
29918,
19541,
29892,
274,
1958,
2433,
21012,
1495,
30004,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
27065,
403,
278,
25147,
295,
5305,
16030,
7581,
16897,
30004,
13,
1678,
4516,
29918,
19541,
353,
577,
6596,
29918,
3972,
29918,
386,
3781,
29898,
2492,
29892,
577,
6596,
29918,
17460,
29922,
29896,
29945,
29892,
266,
3781,
7607,
29900,
29889,
29953,
29892,
7442,
29889,
1631,
29914,
29906,
876,
30004,
13,
29937,
1678,
1596,
29898,
3972,
29918,
19541,
29889,
29881,
1853,
8443,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
25196,
25147,
295,
313,
4920,
14977,
29897,
19295,
993,
498,
12268,
292,
1495,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
3972,
29918,
19541,
29892,
274,
1958,
353,
525,
21012,
1495,
30004,
13,
1678,
6756,
13,
29937,
1678,
2320,
29918,
19541,
353,
577,
6596,
29918,
11082,
29918,
386,
3781,
29898,
2492,
29892,
577,
6596,
29918,
17460,
29892,
2320,
29918,
386,
3781,
29922,
313,
29945,
29900,
29892,
29871,
29896,
29945,
29900,
876,
30004,
13,
1678,
2320,
29918,
19541,
353,
577,
6596,
29918,
11082,
29918,
386,
3781,
29898,
2492,
29892,
577,
6596,
29918,
17460,
29892,
2320,
29918,
386,
3781,
29922,
313,
29947,
29900,
29892,
29871,
29896,
29945,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
25196,
19295,
993,
19975,
4279,
498,
12268,
292,
1495,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
11082,
29918,
19541,
29892,
274,
1958,
2433,
21012,
1495,
30004,
13,
29937,
1678,
2320,
29918,
19541,
30004,
13,
1678,
6756,
13,
1678,
396,
1523,
26062,
278,
16030,
266,
3781,
3361,
964,
263,
16165,
261,
296,
1967,
29892,
727,
1603,
1122,
367,
330,
2547,
988,
2927,
16897,
292,
5304,
297,
30004,
13,
1678,
12420,
29918,
19541,
353,
7442,
29889,
3298,
359,
29918,
4561,
29898,
3972,
29918,
19541,
8443,
13,
29937,
1678,
12420,
29918,
19541,
15625,
5105,
29916,
29918,
19541,
1275,
29871,
29896,
29897,
891,
5135,
11082,
29918,
19541,
1275,
29871,
29896,
29897,
891,
313,
3972,
29918,
19541,
1275,
29871,
29896,
28166,
353,
29871,
29896,
30004,
13,
1678,
12420,
29918,
19541,
15625,
5105,
29916,
29918,
19541,
1275,
29871,
29896,
29897,
891,
5135,
11082,
29918,
19541,
1275,
29871,
29896,
29897,
669,
313,
3972,
29918,
19541,
1275,
29871,
29896,
28166,
353,
29871,
29896,
30004,
13,
1678,
396,
17743,
1312,
29918,
19541,
29961,
3552,
5105,
29916,
29918,
19541,
1275,
29871,
29896,
29897,
669,
313,
629,
3714,
29918,
19541,
1275,
29871,
29896,
876,
891,
5135,
11082,
29918,
19541,
1275,
29871,
29896,
29897,
669,
313,
3972,
29918,
19541,
1275,
29871,
29896,
28166,
353,
29871,
29896,
30004,
13,
30004,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
1523,
29890,
1312,
29479,
19295,
993,
498,
12268,
292,
313,
29990,
29892,
19095,
29892,
9170,
29897,
1495,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
17743,
1312,
29918,
19541,
29892,
274,
1958,
353,
525,
21012,
1495,
30004,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
30004,
13,
1678,
6756,
13,
1678,
7581,
29918,
2780,
353,
2927,
29918,
19541,
29898,
2492,
29892,
525,
29950,
8547,
742,
2927,
29918,
386,
3781,
353,
518,
29947,
29900,
29892,
29906,
29945,
29945,
2314,
30004,
13,
29937,
1678,
7581,
29918,
2780,
353,
2927,
29918,
19541,
29898,
2492,
29892,
525,
29950,
8547,
742,
2927,
29918,
386,
3781,
353,
518,
29947,
29900,
29892,
29896,
29947,
29900,
2314,
30004,
13,
1678,
6756,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
25196,
9159,
498,
12268,
292,
297,
379,
8547,
1495,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
19541,
29918,
2780,
29892,
274,
1958,
353,
525,
21012,
1495,
30004,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
30004,
13,
1678,
396,
16227,
675,
278,
12463,
12420,
16897,
292,
373,
278,
1243,
4558,
30004,
13,
1678,
2927,
29918,
5105,
29918,
17743,
1312,
353,
9016,
29918,
2780,
29918,
24970,
29898,
17743,
1312,
29918,
19541,
1919,
7581,
29918,
2780,
29897,
6756,
13,
1678,
6756,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
14770,
29889,
3257,
877,
1523,
29890,
1312,
2927,
322,
16030,
2320,
16897,
292,
1495,
30004,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
2780,
29918,
5105,
29918,
17743,
1312,
29892,
274,
1958,
353,
525,
21012,
1495,
30004,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
1678,
6756,
13,
1678,
10153,
29918,
2311,
353,
10153,
29889,
12181,
30004,
13,
1678,
9210,
353,
29871,
29896,
29900,
29900,
30004,
13,
1678,
6756,
13,
1678,
4765,
353,
7442,
29889,
7411,
29941,
29906,
4197,
29898,
29906,
29900,
29900,
29892,
29871,
29955,
29906,
29900,
511,
313,
29945,
29947,
29900,
29892,
29871,
29946,
29947,
29900,
511,
313,
29955,
29906,
29900,
29892,
29871,
29946,
29947,
29900,
511,
313,
29896,
29900,
29945,
29900,
29892,
29871,
29955,
29906,
29900,
29897,
2314,
30004,
13,
1678,
29743,
353,
7442,
29889,
7411,
29941,
29906,
4197,
29898,
29906,
29947,
29900,
29892,
29871,
29955,
29906,
29900,
511,
313,
29946,
29900,
29900,
29892,
29871,
29896,
29929,
29900,
511,
313,
29929,
29906,
29900,
29892,
29871,
29896,
29929,
29900,
511,
313,
29929,
29953,
29900,
29892,
29871,
29955,
29906,
29900,
29897,
2314,
30004,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
12551,
29918,
9748,
353,
7442,
29889,
7411,
29941,
29906,
4197,
29961,
10289,
29892,
10153,
29918,
2311,
29961,
29896,
29962,
29899,
10289,
1402,
518,
2492,
29918,
2311,
29961,
29900,
29962,
29899,
10289,
29892,
10153,
29918,
2311,
29961,
29896,
29962,
29899,
10289,
1402,
6756,
13,
462,
462,
268,
518,
2492,
29918,
2311,
29961,
29900,
29962,
29899,
10289,
29892,
9210,
1402,
6756,
13,
462,
462,
268,
518,
10289,
29892,
9210,
24960,
30004,
13,
1678,
6756,
13,
1678,
2752,
29918,
9748,
353,
7442,
29889,
7411,
29941,
29906,
3552,
29961,
29946,
29945,
29900,
29892,
29955,
29947,
29900,
1402,
518,
29953,
29947,
29900,
29892,
29871,
29896,
29900,
29945,
29900,
1402,
518,
29953,
29947,
29900,
29892,
29906,
29945,
29900,
1402,
518,
29946,
29945,
29900,
29892,
29871,
29945,
29900,
29900,
12622,
30004,
13,
30004,
13,
1678,
7581,
29918,
4495,
9795,
29892,
341,
29892,
3080,
29894,
353,
1370,
29886,
29898,
2780,
29918,
5105,
29918,
17743,
1312,
29892,
4351,
29892,
29743,
8443,
13,
1678,
396,
4495,
9795,
29918,
3027,
29918,
1688,
353,
1370,
29886,
29898,
2492,
29892,
4993,
29918,
9748,
29892,
12551,
29918,
9748,
8443,
13,
1678,
6756,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
6756,
13,
29937,
1678,
14770,
29889,
326,
4294,
29898,
19541,
29918,
4495,
9795,
29892,
274,
1958,
2433,
21012,
1495,
30004,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
29937,
1678,
6756,
13,
29937,
1678,
6756,
13,
29937,
1678,
1053,
12655,
408,
7442,
30004,
13,
29937,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29906,
29900,
29892,
29896,
29900,
876,
30004,
13,
29937,
1678,
9825,
13342,
353,
7442,
29889,
2083,
29898,
19541,
29918,
4495,
9795,
29961,
19541,
29918,
4495,
9795,
29889,
12181,
29961,
29900,
29962,
458,
29906,
29901,
29892,
29901,
1402,
9685,
29922,
29900,
8443,
13,
29937,
1678,
14770,
29889,
5317,
29898,
29882,
391,
13342,
8443,
13,
29937,
1678,
14770,
29889,
4294,
26471,
13,
29937,
1678,
6756,
13,
1678,
396,
8139,
287,
278,
1196,
848,
304,
367,
21242,
1250,
714,
30004,
13,
1678,
714,
29892,
2175,
29918,
9202,
29916,
29892,
1492,
29918,
9202,
29916,
29892,
6492,
29891,
353,
15680,
9202,
29898,
19541,
29918,
4495,
9795,
29892,
2492,
29892,
3080,
29894,
8443,
13,
29937,
1678,
714,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
449,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
8443,
13,
1678,
736,
714,
30004,
13,
6756,
13,
1678,
6756,
13,
1678,
6756,
13,
4136,
2277,
29937,
2683,
28400,
30004,
13,
2277,
359,
29889,
5205,
703,
600,
20856,
448,
29875,
2060,
29918,
9641,
29889,
1526,
29946,
448,
29894,
29888,
285,
567,
29922,
29896,
29945,
29914,
29896,
714,
29918,
29995,
29900,
29941,
29881,
29889,
6173,
29915,
30004,
13,
3057,
29918,
15167,
29918,
3972,
353,
2897,
29889,
1761,
3972,
703,
1688,
29918,
29894,
7958,
29914,
1159,
30004,
13,
9641,
29918,
4905,
353,
525,
4836,
29918,
9641,
29918,
4905,
29889,
1526,
29946,
29915,
30004,
13,
24049,
29896,
353,
13987,
2283,
29907,
3466,
703,
1688,
29918,
29894,
7958,
29914,
4836,
29918,
9641,
29889,
1526,
29946,
2564,
1491,
24049,
29898,
29896,
29941,
29892,
29896,
29947,
8443,
13,
29937,
24049,
29896,
353,
13987,
2283,
29907,
3466,
703,
1688,
29918,
29894,
7958,
29914,
4836,
29918,
9641,
29889,
1526,
29946,
1159,
29871,
6756,
13,
24049,
353,
20102,
29896,
29889,
1579,
29918,
3027,
29898,
5014,
29918,
3027,
29897,
396,
12256,
29923,
29901,
445,
740,
23347,
2927,
4558,
6824,
30004,
13,
24049,
29889,
3539,
29918,
29894,
680,
974,
488,
29898,
9641,
29918,
4905,
29892,
10348,
29922,
8824,
8443,
13,
29871,
396,
2683,
2683,
1378,
5634,
29871,
6756,
13,
268,
2
] |
src/sentry/web/debug_urls.py
|
uandco/sentry
| 2 |
193152
|
<filename>src/sentry/web/debug_urls.py
from __future__ import absolute_import
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
import sentry.web.frontend.debug.mail
from sentry.web.frontend.debug.debug_assigned_email import (
DebugAssignedEmailView, DebugSelfAssignedEmailView, DebugSelfAssignedTeamEmailView
)
from sentry.web.frontend.debug.debug_trigger_error import (DebugTriggerErrorView)
from sentry.web.frontend.debug.debug_error_embed import (DebugErrorPageEmbedView)
from sentry.web.frontend.debug.debug_incident_activity_email import DebugIncidentActivityEmailView
from sentry.web.frontend.debug.debug_invalid_identity_email import DebugInvalidIdentityEmailView
from sentry.web.frontend.debug.debug_mfa_added_email import (DebugMfaAddedEmailView)
from sentry.web.frontend.debug.debug_mfa_removed_email import (DebugMfaRemovedEmailView)
from sentry.web.frontend.debug.debug_new_release_email import (DebugNewReleaseEmailView)
from sentry.web.frontend.debug.debug_new_user_feedback_email import (DebugNewUserFeedbackEmailView)
from sentry.web.frontend.debug.debug_note_email import DebugNoteEmailView
from sentry.web.frontend.debug.debug_password_changed_email import (DebugPasswordChangedEmailView)
from sentry.web.frontend.debug.debug_recovery_codes_regenerated_email import (
DebugRecoveryCodesRegeneratedEmailView)
from sentry.web.frontend.debug.debug_regression_email import (
DebugRegressionEmailView, DebugRegressionReleaseEmailView
)
from sentry.web.frontend.debug.debug_resolved_email import (DebugResolvedEmailView)
from sentry.web.frontend.debug.debug_resolved_in_release_email import (
DebugResolvedInReleaseEmailView, DebugResolvedInReleaseUpcomingEmailView
)
from sentry.web.frontend.debug.debug_unable_to_delete_repository import DebugUnableToDeleteRepository
from sentry.web.frontend.debug.debug_unable_to_fetch_commits_email import DebugUnableToFetchCommitsEmailView
from sentry.web.frontend.debug.debug_unassigned_email import (DebugUnassignedEmailView)
from sentry.web.frontend.debug.debug_new_processing_issues_email import (
DebugNewProcessingIssuesEmailView,
DebugNewProcessingIssuesNoReprocessingEmailView,
)
from sentry.web.frontend.debug.debug_sso_link_email import (
DebugSsoLinkedEmailView,
DebugSsoUnlinkedEmailView,
DebugSsoUnlinkedNoPasswordEmailView,
)
from sentry.web.frontend.debug.debug_setup_2fa_email import DebugSetup2faEmailView
from sentry.web.frontend.debug import debug_auth_views
from sentry.web.frontend.debug.debug_oauth_authorize import (
DebugOAuthAuthorizeView,
DebugOAuthAuthorizeErrorView,
)
urlpatterns = patterns(
'',
url(r'^debug/mail/alert/$', sentry.web.frontend.debug.mail.alert),
url(r'^debug/mail/note/$', DebugNoteEmailView.as_view()),
url(r'^debug/mail/new-release/$', DebugNewReleaseEmailView.as_view()),
url(r'^debug/mail/new-user-feedback/$', DebugNewUserFeedbackEmailView.as_view()),
url(r'^debug/mail/assigned/$', DebugAssignedEmailView.as_view()),
url(r'^debug/mail/assigned/self/$', DebugSelfAssignedEmailView.as_view()),
url(r'^debug/mail/assigned/team/$', DebugSelfAssignedTeamEmailView.as_view()),
url(r'^debug/mail/digest/$', sentry.web.frontend.debug.mail.digest),
url(r'^debug/mail/report/$', sentry.web.frontend.debug.mail.report),
url(r'^debug/mail/regression/$', DebugRegressionEmailView.as_view()),
url(r'^debug/mail/regression/release/$', DebugRegressionReleaseEmailView.as_view()),
url(r'^debug/mail/resolved/$', DebugResolvedEmailView.as_view()),
url(r'^debug/mail/resolved-in-release/$', DebugResolvedInReleaseEmailView.as_view()),
url(
r'^debug/mail/resolved-in-release/upcoming/$',
DebugResolvedInReleaseUpcomingEmailView.as_view()
),
url(r'^debug/mail/request-access/$', sentry.web.frontend.debug.mail.request_access),
url(r'^debug/mail/access-approved/$', sentry.web.frontend.debug.mail.access_approved),
url(r'^debug/mail/invitation/$', sentry.web.frontend.debug.mail.invitation),
url(r'^debug/mail/invalid-identity/$', DebugInvalidIdentityEmailView.as_view()),
url(r'^debug/mail/confirm-email/$', sentry.web.frontend.debug.mail.confirm_email),
url(r'^debug/mail/recover-account/$', sentry.web.frontend.debug.mail.recover_account),
url(r'^debug/mail/unable-to-delete-repo/$', DebugUnableToDeleteRepository.as_view()),
url(r'^debug/mail/unable-to-fetch-commits/$', DebugUnableToFetchCommitsEmailView.as_view()),
url(r'^debug/mail/unassigned/$', DebugUnassignedEmailView.as_view()),
url(r'^debug/mail/org-delete-confirm/$', sentry.web.frontend.debug.mail.org_delete_confirm),
url(r'^debug/mail/mfa-removed/$', DebugMfaRemovedEmailView.as_view()),
url(r'^debug/mail/mfa-added/$', DebugMfaAddedEmailView.as_view()),
url(r'^debug/mail/recovery-codes-regenerated/$',
DebugRecoveryCodesRegeneratedEmailView.as_view()),
url(r'^debug/mail/password-changed/$', DebugPasswordChangedEmailView.as_view()),
url(r'^debug/mail/new-processing-issues/$', DebugNewProcessingIssuesEmailView.as_view()),
url(
r'^debug/mail/new-processing-issues-no-reprocessing/$',
DebugNewProcessingIssuesNoReprocessingEmailView.as_view()
),
url(r'^debug/mail/sso-linked/$', DebugSsoLinkedEmailView.as_view()),
url(r'^debug/mail/sso-unlinked/$', DebugSsoUnlinkedEmailView.as_view()),
url(r'^debug/mail/sso-unlinked/no-password$', DebugSsoUnlinkedNoPasswordEmailView.as_view()),
url(r'^debug/mail/incident-activity$', DebugIncidentActivityEmailView.as_view()),
url(r'^debug/mail/setup-2fa/$', DebugSetup2faEmailView.as_view()),
url(r'^debug/embed/error-page/$', DebugErrorPageEmbedView.as_view()),
url(r'^debug/trigger-error/$', DebugTriggerErrorView.as_view()),
url(r'^debug/auth-confirm-identity/$', debug_auth_views.DebugAuthConfirmIdentity.as_view()),
url(r'^debug/auth-confirm-link/$', debug_auth_views.DebugAuthConfirmLink.as_view()),
url(r'^debug/sudo/$', TemplateView.as_view(template_name='sentry/account/sudo.html')),
url(r'^debug/oauth/authorize/$', DebugOAuthAuthorizeView.as_view()),
url(r'^debug/oauth/authorize/error/$', DebugOAuthAuthorizeErrorView.as_view()),
url(r'^debug/icons/$', TemplateView.as_view(template_name='sentry/debug/icons.html')),
)
|
[
1,
529,
9507,
29958,
4351,
29914,
29879,
8269,
29914,
2676,
29914,
8382,
29918,
26045,
29889,
2272,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
13,
3166,
9557,
29889,
5527,
29889,
26045,
1053,
15038,
29892,
3142,
13,
3166,
9557,
29889,
7406,
29889,
19206,
1053,
25663,
1043,
13,
13,
5215,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
13,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
465,
12961,
29918,
5269,
1053,
313,
13,
1678,
16171,
7900,
12961,
9823,
1043,
29892,
16171,
24313,
7900,
12961,
9823,
1043,
29892,
16171,
24313,
7900,
12961,
19409,
9823,
1043,
13,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
21001,
29918,
2704,
1053,
313,
11862,
20211,
2392,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
2704,
29918,
17987,
1053,
313,
11862,
2392,
5074,
6026,
2580,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
3742,
1693,
29918,
10072,
29918,
5269,
1053,
16171,
797,
29883,
1693,
3886,
9823,
1043,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
20965,
29918,
22350,
29918,
5269,
1053,
16171,
13919,
18415,
9823,
1043,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
29885,
5444,
29918,
23959,
29918,
5269,
1053,
313,
11862,
29924,
5444,
2528,
287,
9823,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
29885,
5444,
29918,
1745,
8238,
29918,
5269,
1053,
313,
11862,
29924,
5444,
7301,
8238,
9823,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
1482,
29918,
14096,
29918,
5269,
1053,
313,
11862,
4373,
19729,
9823,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
1482,
29918,
1792,
29918,
18798,
1627,
29918,
5269,
1053,
313,
11862,
4373,
2659,
29737,
1627,
9823,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
6812,
29918,
5269,
1053,
16171,
9842,
9823,
1043,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
5630,
29918,
15033,
29918,
5269,
1053,
313,
11862,
10048,
7590,
9823,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
3757,
22205,
29918,
18137,
29918,
1727,
759,
630,
29918,
5269,
1053,
313,
13,
1678,
16171,
4789,
22205,
29907,
2631,
4597,
759,
630,
9823,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
276,
11476,
29918,
5269,
1053,
313,
13,
1678,
16171,
4597,
23881,
9823,
1043,
29892,
16171,
4597,
23881,
19729,
9823,
1043,
13,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
9778,
1490,
29918,
5269,
1053,
313,
11862,
12375,
1490,
9823,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
9778,
1490,
29918,
262,
29918,
14096,
29918,
5269,
1053,
313,
13,
1678,
16171,
12375,
1490,
797,
19729,
9823,
1043,
29892,
16171,
12375,
1490,
797,
19729,
3373,
11506,
9823,
1043,
13,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
348,
519,
29918,
517,
29918,
8143,
29918,
19033,
1053,
16171,
2525,
519,
1762,
12498,
11481,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
348,
519,
29918,
517,
29918,
9155,
29918,
2055,
1169,
29918,
5269,
1053,
16171,
2525,
519,
1762,
20927,
5261,
1169,
9823,
1043,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
348,
465,
12961,
29918,
5269,
1053,
313,
11862,
2525,
465,
12961,
9823,
1043,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
1482,
29918,
19170,
29918,
12175,
29918,
5269,
1053,
313,
13,
1678,
16171,
4373,
7032,
292,
29902,
893,
1041,
9823,
1043,
29892,
13,
1678,
16171,
4373,
7032,
292,
29902,
893,
1041,
3782,
1123,
19170,
9823,
1043,
29892,
13,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
29879,
578,
29918,
2324,
29918,
5269,
1053,
313,
13,
1678,
16171,
29903,
578,
6595,
287,
9823,
1043,
29892,
13,
1678,
16171,
29903,
578,
2525,
2324,
287,
9823,
1043,
29892,
13,
1678,
16171,
29903,
578,
2525,
2324,
287,
3782,
10048,
9823,
1043,
29892,
13,
29897,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
14669,
29918,
29906,
5444,
29918,
5269,
1053,
16171,
26947,
29906,
5444,
9823,
1043,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
1053,
4744,
29918,
5150,
29918,
7406,
13,
3166,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
8382,
29918,
23106,
29918,
8921,
675,
1053,
313,
13,
1678,
16171,
29949,
6444,
13720,
675,
1043,
29892,
13,
1678,
16171,
29949,
6444,
13720,
675,
2392,
1043,
29892,
13,
29897,
13,
13,
2271,
11037,
29879,
353,
15038,
29898,
13,
1678,
15516,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
12888,
13346,
742,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
29889,
12888,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
6812,
13346,
742,
16171,
9842,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
1482,
29899,
14096,
13346,
742,
16171,
4373,
19729,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
1482,
29899,
1792,
29899,
18798,
1627,
13346,
742,
16171,
4373,
2659,
29737,
1627,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
465,
12961,
13346,
742,
16171,
7900,
12961,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
465,
12961,
29914,
1311,
13346,
742,
16171,
24313,
7900,
12961,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
465,
12961,
29914,
14318,
13346,
742,
16171,
24313,
7900,
12961,
19409,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
7501,
342,
13346,
742,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
29889,
7501,
342,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
12276,
13346,
742,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
29889,
12276,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
276,
11476,
13346,
742,
16171,
4597,
23881,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
276,
11476,
29914,
14096,
13346,
742,
16171,
4597,
23881,
19729,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
9778,
1490,
13346,
742,
16171,
12375,
1490,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
9778,
1490,
29899,
262,
29899,
14096,
13346,
742,
16171,
12375,
1490,
797,
19729,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
13,
4706,
364,
29915,
29985,
8382,
29914,
2549,
29914,
9778,
1490,
29899,
262,
29899,
14096,
29914,
786,
11506,
13346,
742,
13,
4706,
16171,
12375,
1490,
797,
19729,
3373,
11506,
9823,
1043,
29889,
294,
29918,
1493,
580,
13,
1678,
10353,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
3827,
29899,
5943,
13346,
742,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
29889,
3827,
29918,
5943,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
5943,
29899,
9961,
1490,
13346,
742,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
29889,
5943,
29918,
9961,
1490,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
11569,
7018,
13346,
742,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
29889,
11569,
7018,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
20965,
29899,
22350,
13346,
742,
16171,
13919,
18415,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
26897,
29899,
5269,
13346,
742,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
29889,
26897,
29918,
5269,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
3757,
957,
29899,
10149,
13346,
742,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
29889,
3757,
957,
29918,
10149,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
348,
519,
29899,
517,
29899,
8143,
29899,
20095,
13346,
742,
16171,
2525,
519,
1762,
12498,
11481,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
348,
519,
29899,
517,
29899,
9155,
29899,
2055,
1169,
13346,
742,
16171,
2525,
519,
1762,
20927,
5261,
1169,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
348,
465,
12961,
13346,
742,
16171,
2525,
465,
12961,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
990,
29899,
8143,
29899,
26897,
13346,
742,
2665,
719,
29889,
2676,
29889,
8862,
355,
29889,
8382,
29889,
2549,
29889,
990,
29918,
8143,
29918,
26897,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
29885,
5444,
29899,
1745,
8238,
13346,
742,
16171,
29924,
5444,
7301,
8238,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
29885,
5444,
29899,
23959,
13346,
742,
16171,
29924,
5444,
2528,
287,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
3757,
22205,
29899,
18137,
29899,
1727,
759,
630,
13346,
742,
13,
4706,
16171,
4789,
22205,
29907,
2631,
4597,
759,
630,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
5630,
29899,
15033,
13346,
742,
16171,
10048,
7590,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
1482,
29899,
19170,
29899,
12175,
13346,
742,
16171,
4373,
7032,
292,
29902,
893,
1041,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
13,
4706,
364,
29915,
29985,
8382,
29914,
2549,
29914,
1482,
29899,
19170,
29899,
12175,
29899,
1217,
29899,
276,
19170,
13346,
742,
13,
4706,
16171,
4373,
7032,
292,
29902,
893,
1041,
3782,
1123,
19170,
9823,
1043,
29889,
294,
29918,
1493,
580,
13,
1678,
10353,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
29879,
578,
29899,
2324,
287,
13346,
742,
16171,
29903,
578,
6595,
287,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
29879,
578,
29899,
348,
2324,
287,
13346,
742,
16171,
29903,
578,
2525,
2324,
287,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
29879,
578,
29899,
348,
2324,
287,
29914,
1217,
29899,
5630,
29938,
742,
16171,
29903,
578,
2525,
2324,
287,
3782,
10048,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
3742,
1693,
29899,
10072,
29938,
742,
16171,
797,
29883,
1693,
3886,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
2549,
29914,
14669,
29899,
29906,
5444,
13346,
742,
16171,
26947,
29906,
5444,
9823,
1043,
29889,
294,
29918,
1493,
25739,
13,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
17987,
29914,
2704,
29899,
3488,
13346,
742,
16171,
2392,
5074,
6026,
2580,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
21001,
29899,
2704,
13346,
742,
16171,
20211,
2392,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
5150,
29899,
26897,
29899,
22350,
13346,
742,
4744,
29918,
5150,
29918,
7406,
29889,
11862,
6444,
16376,
3568,
18415,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
5150,
29899,
26897,
29899,
2324,
13346,
742,
4744,
29918,
5150,
29918,
7406,
29889,
11862,
6444,
16376,
3568,
6595,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
15360,
13346,
742,
25663,
1043,
29889,
294,
29918,
1493,
29898,
6886,
29918,
978,
2433,
29879,
8269,
29914,
10149,
29914,
15360,
29889,
1420,
1495,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
23106,
29914,
8921,
675,
13346,
742,
16171,
29949,
6444,
13720,
675,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
23106,
29914,
8921,
675,
29914,
2704,
13346,
742,
16171,
29949,
6444,
13720,
675,
2392,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
3142,
29898,
29878,
29915,
29985,
8382,
29914,
27078,
13346,
742,
25663,
1043,
29889,
294,
29918,
1493,
29898,
6886,
29918,
978,
2433,
29879,
8269,
29914,
8382,
29914,
27078,
29889,
1420,
1495,
511,
13,
29897,
13,
2
] |
geomapzw/toolbar.py
|
faraigit/geomapzw
| 0 |
92368
|
import os
import ipywidgets as widgets
from ipyleaflet import WidgetControl
from ipyfilechooser import FileChooser
from IPython.display import display
def main_toolbar(m):
padding = "0px 0px 0px 5px" # upper, right, bottom, left
toolbar_button = widgets.ToggleButton(
value=False,
tooltip="Toolbar",
icon="wrench",
layout=widgets.Layout(width="28px", height="28px", padding=padding),
)
close_button = widgets.ToggleButton(
value=False,
tooltip="Close the tool",
icon="times",
button_style="primary",
layout=widgets.Layout(height="28px", width="28px", padding=padding),
)
toolbar = widgets.HBox([toolbar_button])
def close_click(change):
if change["new"]:
toolbar_button.close()
close_button.close()
toolbar.close()
close_button.observe(close_click, "value")
rows = 2
cols = 2
grid = widgets.GridspecLayout(
rows, cols, grid_gap="0px", layout=widgets.Layout(width="62px")
)
icons = ["folder-open", "map", "gears", "map-marker"]
for i in range(rows):
for j in range(cols):
grid[i, j] = widgets.Button(
description="",
button_style="primary",
icon=icons[i * rows + j],
layout=widgets.Layout(width="28px", padding="0px"),
)
toolbar = widgets.VBox([toolbar_button])
def toolbar_click(change):
if change["new"]:
toolbar.children = [widgets.HBox([close_button, toolbar_button]), grid]
else:
toolbar.children = [toolbar_button]
toolbar_button.observe(toolbar_click, "value")
toolbar_ctrl = WidgetControl(widget=toolbar, position="topright")
m.add_control(toolbar_ctrl)
output = widgets.Output()
output_ctrl = WidgetControl(widget=output, position="topright")
buttons = widgets.ToggleButtons(
value=None,
options=["Apply", "Reset", "Close"],
tooltips=["Apply", "Reset", "Close"],
button_style="primary",
)
buttons.style.button_width = "80px"
data_dir = os.path.abspath("./data")
fc = FileChooser(data_dir)
fc.use_dir_icons = True
fc.filter_pattern = ["*.shp", "*.geojson"]
filechooser_widget = widgets.VBox([fc, buttons])
def button_click(change):
if change["new"] == "Apply" and fc.selected is not None:
if fc.selected.endswith(".shp"):
m.add_shapefile(fc.selected, layer_name="Shapefile")
elif fc.selected.endswith(".geojson"):
m.add_geojson(fc.selected, layer_name="GeoJSON")
elif change["new"] == "Reset":
fc.reset()
elif change["new"] == "Close":
fc.reset()
m.remove_control(output_ctrl)
buttons.value = None
buttons.observe(button_click, "value")
def tool_click(b):
with output:
output.clear_output()
if b.icon == "folder-open":
display(filechooser_widget)
m.add_control(output_ctrl)
elif b.icon == "gears":
import whiteboxgui.whiteboxgui as wbt
if hasattr(m, "whitebox") and m.whitebox is not None:
if m.whitebox in m.controls:
m.remove_control(m.whitebox)
tools_dict = wbt.get_wbt_dict()
wbt_toolbox = wbt.build_toolbox(
tools_dict, max_width="800px", max_height="500px"
)
wbt_control = WidgetControl(widget=wbt_toolbox, position="bottomright")
m.whitebox = wbt_control
m.add_control(wbt_control)
elif b.icon == "map-marker":
fc = FileChooser(data_dir)
fc.use_dir_icons = True
fc.filter_pattern = ["*.csv"]
x_widget = widgets.Dropdown(
description="X:",
layout=widgets.Layout(width="122px", padding="0px"),
style={"description_width": "initial"},
)
y_widget = widgets.Dropdown(
description="Y:",
layout=widgets.Layout(width="122px", padding="0px"),
style={"description_width": "initial"},
)
label_widget = widgets.Dropdown(
description="Label:",
layout=widgets.Layout(width="248px", padding="0px"),
style={"description_width": "initial"},
)
layer_widget = widgets.Text(
description="Layer name: ",
value="Marker cluster",
layout=widgets.Layout(width="248px", padding="0px"),
style={"description_width": "initial"},
)
btns = widgets.ToggleButtons(
value=None,
options=["Read data", "Display", "Close"],
tooltips=["Read data", "Display", "Close"],
button_style="primary",
)
btns.style.button_width = "80px"
def btn_click(change):
if change["new"] == "Read data" and fc.selected is not None:
import pandas as pd
df = pd.read_csv(fc.selected)
col_names = df.columns.values.tolist()
x_widget.options = col_names
y_widget.options = col_names
label_widget.options = col_names
if "longitude" in col_names:
x_widget.value = "longitude"
if "latitude" in col_names:
y_widget.value = "latitude"
if "name" in col_names:
label_widget.value = "name"
elif change["new"] == "Display":
if x_widget.value is not None and (y_widget.value is not None):
m.add_points_from_csv(
fc.selected,
x=x_widget.value,
y=y_widget.value,
label=label_widget.value,
layer_name=layer_widget.value,
)
elif change["new"] == "Close":
fc.reset()
m.remove_control(output_ctrl)
btns.observe(btn_click, "value")
csv_widget = widgets.VBox(
[
fc,
widgets.HBox([x_widget, y_widget]),
label_widget,
layer_widget,
btns,
]
)
display(csv_widget)
m.add_control(output_ctrl)
for i in range(rows):
for j in range(cols):
tool = grid[i, j]
tool.on_click(tool_click)
|
[
1,
1053,
2897,
13,
5215,
474,
2272,
8030,
29879,
408,
11109,
29879,
13,
3166,
10377,
1508,
2142,
1026,
1053,
27080,
4809,
13,
3166,
474,
2272,
1445,
1859,
22969,
1053,
3497,
15954,
22969,
13,
3166,
5641,
1656,
29889,
4990,
1053,
2479,
13,
13,
13,
1753,
1667,
29918,
10154,
1646,
29898,
29885,
1125,
13,
13,
1678,
7164,
353,
376,
29900,
1756,
29871,
29900,
1756,
29871,
29900,
1756,
29871,
29945,
1756,
29908,
29871,
396,
7568,
29892,
1492,
29892,
5970,
29892,
2175,
13,
13,
1678,
29840,
29918,
3092,
353,
11109,
29879,
29889,
27199,
3125,
29898,
13,
4706,
995,
29922,
8824,
29892,
13,
4706,
5780,
12632,
543,
12229,
1646,
613,
13,
4706,
9849,
543,
29893,
4615,
613,
13,
4706,
5912,
29922,
8030,
29879,
29889,
3453,
29898,
2103,
543,
29906,
29947,
1756,
613,
3171,
543,
29906,
29947,
1756,
613,
7164,
29922,
12791,
511,
13,
1678,
1723,
13,
13,
1678,
3802,
29918,
3092,
353,
11109,
29879,
29889,
27199,
3125,
29898,
13,
4706,
995,
29922,
8824,
29892,
13,
4706,
5780,
12632,
543,
11123,
278,
5780,
613,
13,
4706,
9849,
543,
3706,
613,
13,
4706,
2826,
29918,
3293,
543,
16072,
613,
13,
4706,
5912,
29922,
8030,
29879,
29889,
3453,
29898,
3545,
543,
29906,
29947,
1756,
613,
2920,
543,
29906,
29947,
1756,
613,
7164,
29922,
12791,
511,
13,
1678,
1723,
13,
13,
1678,
29840,
353,
11109,
29879,
29889,
29950,
3313,
4197,
10154,
1646,
29918,
3092,
2314,
13,
13,
1678,
822,
3802,
29918,
3808,
29898,
3167,
1125,
13,
4706,
565,
1735,
3366,
1482,
3108,
29901,
13,
9651,
29840,
29918,
3092,
29889,
5358,
580,
13,
9651,
3802,
29918,
3092,
29889,
5358,
580,
13,
9651,
29840,
29889,
5358,
580,
13,
13,
1678,
3802,
29918,
3092,
29889,
711,
16349,
29898,
5358,
29918,
3808,
29892,
376,
1767,
1159,
13,
13,
1678,
4206,
353,
29871,
29906,
13,
1678,
28730,
353,
29871,
29906,
13,
1678,
6856,
353,
11109,
29879,
29889,
5756,
6550,
3453,
29898,
13,
4706,
4206,
29892,
28730,
29892,
6856,
29918,
29887,
481,
543,
29900,
1756,
613,
5912,
29922,
8030,
29879,
29889,
3453,
29898,
2103,
543,
29953,
29906,
1756,
1159,
13,
1678,
1723,
13,
13,
1678,
27673,
353,
6796,
12083,
29899,
3150,
613,
376,
1958,
613,
376,
479,
1503,
613,
376,
1958,
29899,
22976,
3108,
13,
13,
1678,
363,
474,
297,
3464,
29898,
5727,
1125,
13,
4706,
363,
432,
297,
3464,
29898,
22724,
1125,
13,
9651,
6856,
29961,
29875,
29892,
432,
29962,
353,
11109,
29879,
29889,
3125,
29898,
13,
18884,
6139,
543,
613,
13,
18884,
2826,
29918,
3293,
543,
16072,
613,
13,
18884,
9849,
29922,
27078,
29961,
29875,
334,
4206,
718,
432,
1402,
13,
18884,
5912,
29922,
8030,
29879,
29889,
3453,
29898,
2103,
543,
29906,
29947,
1756,
613,
7164,
543,
29900,
1756,
4968,
13,
9651,
1723,
13,
13,
1678,
29840,
353,
11109,
29879,
29889,
29963,
3313,
4197,
10154,
1646,
29918,
3092,
2314,
13,
13,
1678,
822,
29840,
29918,
3808,
29898,
3167,
1125,
13,
4706,
565,
1735,
3366,
1482,
3108,
29901,
13,
9651,
29840,
29889,
11991,
353,
518,
8030,
29879,
29889,
29950,
3313,
4197,
5358,
29918,
3092,
29892,
29840,
29918,
3092,
11724,
6856,
29962,
13,
4706,
1683,
29901,
13,
9651,
29840,
29889,
11991,
353,
518,
10154,
1646,
29918,
3092,
29962,
13,
13,
1678,
29840,
29918,
3092,
29889,
711,
16349,
29898,
10154,
1646,
29918,
3808,
29892,
376,
1767,
1159,
13,
13,
1678,
29840,
29918,
24220,
353,
27080,
4809,
29898,
8030,
29922,
10154,
1646,
29892,
2602,
543,
3332,
1266,
1159,
13,
13,
1678,
286,
29889,
1202,
29918,
6451,
29898,
10154,
1646,
29918,
24220,
29897,
13,
13,
1678,
1962,
353,
11109,
29879,
29889,
6466,
580,
13,
1678,
1962,
29918,
24220,
353,
27080,
4809,
29898,
8030,
29922,
4905,
29892,
2602,
543,
3332,
1266,
1159,
13,
13,
1678,
9828,
353,
11109,
29879,
29889,
27199,
29819,
787,
29898,
13,
4706,
995,
29922,
8516,
29892,
13,
4706,
3987,
29922,
3366,
2052,
368,
613,
376,
27175,
613,
376,
11123,
12436,
13,
4706,
5780,
2034,
567,
29922,
3366,
2052,
368,
613,
376,
27175,
613,
376,
11123,
12436,
13,
4706,
2826,
29918,
3293,
543,
16072,
613,
13,
1678,
1723,
13,
1678,
9828,
29889,
3293,
29889,
3092,
29918,
2103,
353,
376,
29947,
29900,
1756,
29908,
13,
13,
1678,
848,
29918,
3972,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
703,
6904,
1272,
1159,
13,
13,
1678,
285,
29883,
353,
3497,
15954,
22969,
29898,
1272,
29918,
3972,
29897,
13,
1678,
285,
29883,
29889,
1509,
29918,
3972,
29918,
27078,
353,
5852,
13,
1678,
285,
29883,
29889,
4572,
29918,
11037,
353,
6796,
10521,
845,
29886,
613,
376,
10521,
24756,
3126,
3108,
13,
13,
1678,
934,
1859,
22969,
29918,
8030,
353,
11109,
29879,
29889,
29963,
3313,
4197,
13801,
29892,
9828,
2314,
13,
13,
1678,
822,
2826,
29918,
3808,
29898,
3167,
1125,
13,
4706,
565,
1735,
3366,
1482,
3108,
1275,
376,
2052,
368,
29908,
322,
285,
29883,
29889,
8391,
338,
451,
6213,
29901,
13,
9651,
565,
285,
29883,
29889,
8391,
29889,
1975,
2541,
17350,
845,
29886,
29908,
1125,
13,
18884,
286,
29889,
1202,
29918,
12181,
1445,
29898,
13801,
29889,
8391,
29892,
7546,
29918,
978,
543,
24111,
1445,
1159,
13,
9651,
25342,
285,
29883,
29889,
8391,
29889,
1975,
2541,
17350,
24756,
3126,
29908,
1125,
13,
18884,
286,
29889,
1202,
29918,
24756,
3126,
29898,
13801,
29889,
8391,
29892,
7546,
29918,
978,
543,
7999,
29877,
7249,
1159,
13,
4706,
25342,
1735,
3366,
1482,
3108,
1275,
376,
27175,
1115,
13,
9651,
285,
29883,
29889,
12071,
580,
13,
4706,
25342,
1735,
3366,
1482,
3108,
1275,
376,
11123,
1115,
13,
9651,
285,
29883,
29889,
12071,
580,
13,
9651,
286,
29889,
5992,
29918,
6451,
29898,
4905,
29918,
24220,
29897,
13,
9651,
9828,
29889,
1767,
353,
6213,
13,
13,
1678,
9828,
29889,
711,
16349,
29898,
3092,
29918,
3808,
29892,
376,
1767,
1159,
13,
13,
1678,
822,
5780,
29918,
3808,
29898,
29890,
1125,
13,
4706,
411,
1962,
29901,
13,
9651,
1962,
29889,
8551,
29918,
4905,
580,
13,
9651,
565,
289,
29889,
4144,
1275,
376,
12083,
29899,
3150,
1115,
13,
18884,
2479,
29898,
1445,
1859,
22969,
29918,
8030,
29897,
13,
18884,
286,
29889,
1202,
29918,
6451,
29898,
4905,
29918,
24220,
29897,
13,
9651,
25342,
289,
29889,
4144,
1275,
376,
479,
1503,
1115,
13,
18884,
1053,
4796,
1884,
23569,
29889,
10921,
1884,
23569,
408,
281,
3116,
13,
13,
18884,
565,
756,
5552,
29898,
29885,
29892,
376,
10921,
1884,
1159,
322,
286,
29889,
10921,
1884,
338,
451,
6213,
29901,
13,
462,
1678,
565,
286,
29889,
10921,
1884,
297,
286,
29889,
26255,
29901,
13,
462,
4706,
286,
29889,
5992,
29918,
6451,
29898,
29885,
29889,
10921,
1884,
29897,
13,
13,
18884,
8492,
29918,
8977,
353,
281,
3116,
29889,
657,
29918,
29893,
3116,
29918,
8977,
580,
13,
18884,
281,
3116,
29918,
10154,
1884,
353,
281,
3116,
29889,
4282,
29918,
10154,
1884,
29898,
13,
462,
1678,
8492,
29918,
8977,
29892,
4236,
29918,
2103,
543,
29947,
29900,
29900,
1756,
613,
4236,
29918,
3545,
543,
29945,
29900,
29900,
1756,
29908,
13,
18884,
1723,
13,
13,
18884,
281,
3116,
29918,
6451,
353,
27080,
4809,
29898,
8030,
29922,
29893,
3116,
29918,
10154,
1884,
29892,
2602,
543,
8968,
1266,
1159,
13,
13,
18884,
286,
29889,
10921,
1884,
353,
281,
3116,
29918,
6451,
13,
18884,
286,
29889,
1202,
29918,
6451,
29898,
29893,
3116,
29918,
6451,
29897,
13,
13,
9651,
25342,
289,
29889,
4144,
1275,
376,
1958,
29899,
22976,
1115,
13,
18884,
285,
29883,
353,
3497,
15954,
22969,
29898,
1272,
29918,
3972,
29897,
13,
18884,
285,
29883,
29889,
1509,
29918,
3972,
29918,
27078,
353,
5852,
13,
18884,
285,
29883,
29889,
4572,
29918,
11037,
353,
6796,
10521,
7638,
3108,
13,
13,
18884,
921,
29918,
8030,
353,
11109,
29879,
29889,
15063,
3204,
29898,
13,
462,
1678,
6139,
543,
29990,
29901,
613,
13,
462,
1678,
5912,
29922,
8030,
29879,
29889,
3453,
29898,
2103,
543,
29896,
29906,
29906,
1756,
613,
7164,
543,
29900,
1756,
4968,
13,
462,
1678,
3114,
3790,
29908,
8216,
29918,
2103,
1115,
376,
11228,
10758,
13,
18884,
1723,
13,
18884,
343,
29918,
8030,
353,
11109,
29879,
29889,
15063,
3204,
29898,
13,
462,
1678,
6139,
543,
29979,
29901,
613,
13,
462,
1678,
5912,
29922,
8030,
29879,
29889,
3453,
29898,
2103,
543,
29896,
29906,
29906,
1756,
613,
7164,
543,
29900,
1756,
4968,
13,
462,
1678,
3114,
3790,
29908,
8216,
29918,
2103,
1115,
376,
11228,
10758,
13,
18884,
1723,
13,
13,
18884,
3858,
29918,
8030,
353,
11109,
29879,
29889,
15063,
3204,
29898,
13,
462,
1678,
6139,
543,
4775,
29901,
613,
13,
462,
1678,
5912,
29922,
8030,
29879,
29889,
3453,
29898,
2103,
543,
29906,
29946,
29947,
1756,
613,
7164,
543,
29900,
1756,
4968,
13,
462,
1678,
3114,
3790,
29908,
8216,
29918,
2103,
1115,
376,
11228,
10758,
13,
18884,
1723,
13,
13,
18884,
7546,
29918,
8030,
353,
11109,
29879,
29889,
1626,
29898,
13,
462,
1678,
6139,
543,
14420,
1024,
29901,
9162,
13,
462,
1678,
995,
543,
24619,
9867,
613,
13,
462,
1678,
5912,
29922,
8030,
29879,
29889,
3453,
29898,
2103,
543,
29906,
29946,
29947,
1756,
613,
7164,
543,
29900,
1756,
4968,
13,
462,
1678,
3114,
3790,
29908,
8216,
29918,
2103,
1115,
376,
11228,
10758,
13,
18884,
1723,
13,
13,
18884,
289,
29873,
1983,
353,
11109,
29879,
29889,
27199,
29819,
787,
29898,
13,
462,
1678,
995,
29922,
8516,
29892,
13,
462,
1678,
3987,
29922,
3366,
6359,
848,
613,
376,
9323,
613,
376,
11123,
12436,
13,
462,
1678,
5780,
2034,
567,
29922,
3366,
6359,
848,
613,
376,
9323,
613,
376,
11123,
12436,
13,
462,
1678,
2826,
29918,
3293,
543,
16072,
613,
13,
18884,
1723,
13,
18884,
289,
29873,
1983,
29889,
3293,
29889,
3092,
29918,
2103,
353,
376,
29947,
29900,
1756,
29908,
13,
13,
18884,
822,
9503,
29918,
3808,
29898,
3167,
1125,
13,
462,
1678,
565,
1735,
3366,
1482,
3108,
1275,
376,
6359,
848,
29908,
322,
285,
29883,
29889,
8391,
338,
451,
6213,
29901,
13,
462,
4706,
1053,
11701,
408,
10518,
13,
13,
462,
4706,
4489,
353,
10518,
29889,
949,
29918,
7638,
29898,
13801,
29889,
8391,
29897,
13,
462,
4706,
784,
29918,
7039,
353,
4489,
29889,
13099,
29889,
5975,
29889,
25027,
391,
580,
13,
462,
4706,
921,
29918,
8030,
29889,
6768,
353,
784,
29918,
7039,
13,
462,
4706,
343,
29918,
8030,
29889,
6768,
353,
784,
29918,
7039,
13,
462,
4706,
3858,
29918,
8030,
29889,
6768,
353,
784,
29918,
7039,
13,
13,
462,
4706,
565,
376,
5426,
4279,
29908,
297,
784,
29918,
7039,
29901,
13,
462,
9651,
921,
29918,
8030,
29889,
1767,
353,
376,
5426,
4279,
29908,
13,
13,
462,
4706,
565,
376,
5066,
4279,
29908,
297,
784,
29918,
7039,
29901,
13,
462,
9651,
343,
29918,
8030,
29889,
1767,
353,
376,
5066,
4279,
29908,
13,
13,
462,
4706,
565,
376,
978,
29908,
297,
784,
29918,
7039,
29901,
13,
462,
9651,
3858,
29918,
8030,
29889,
1767,
353,
376,
978,
29908,
13,
13,
462,
1678,
25342,
1735,
3366,
1482,
3108,
1275,
376,
9323,
1115,
13,
13,
462,
4706,
565,
921,
29918,
8030,
29889,
1767,
338,
451,
6213,
322,
313,
29891,
29918,
8030,
29889,
1767,
338,
451,
6213,
1125,
13,
462,
9651,
286,
29889,
1202,
29918,
9748,
29918,
3166,
29918,
7638,
29898,
13,
462,
18884,
285,
29883,
29889,
8391,
29892,
13,
462,
18884,
921,
29922,
29916,
29918,
8030,
29889,
1767,
29892,
13,
462,
18884,
343,
29922,
29891,
29918,
8030,
29889,
1767,
29892,
13,
462,
18884,
3858,
29922,
1643,
29918,
8030,
29889,
1767,
29892,
13,
462,
18884,
7546,
29918,
978,
29922,
13148,
29918,
8030,
29889,
1767,
29892,
13,
462,
9651,
1723,
13,
13,
462,
1678,
25342,
1735,
3366,
1482,
3108,
1275,
376,
11123,
1115,
13,
462,
4706,
285,
29883,
29889,
12071,
580,
13,
462,
4706,
286,
29889,
5992,
29918,
6451,
29898,
4905,
29918,
24220,
29897,
13,
13,
18884,
289,
29873,
1983,
29889,
711,
16349,
29898,
7290,
29918,
3808,
29892,
376,
1767,
1159,
13,
13,
18884,
11799,
29918,
8030,
353,
11109,
29879,
29889,
29963,
3313,
29898,
13,
462,
1678,
518,
13,
462,
4706,
285,
29883,
29892,
13,
462,
4706,
11109,
29879,
29889,
29950,
3313,
4197,
29916,
29918,
8030,
29892,
343,
29918,
8030,
11724,
13,
462,
4706,
3858,
29918,
8030,
29892,
13,
462,
4706,
7546,
29918,
8030,
29892,
13,
462,
4706,
289,
29873,
1983,
29892,
13,
462,
1678,
4514,
13,
18884,
1723,
13,
13,
18884,
2479,
29898,
7638,
29918,
8030,
29897,
13,
18884,
286,
29889,
1202,
29918,
6451,
29898,
4905,
29918,
24220,
29897,
13,
13,
1678,
363,
474,
297,
3464,
29898,
5727,
1125,
13,
4706,
363,
432,
297,
3464,
29898,
22724,
1125,
13,
9651,
5780,
353,
6856,
29961,
29875,
29892,
432,
29962,
13,
9651,
5780,
29889,
265,
29918,
3808,
29898,
10154,
29918,
3808,
29897,
13,
2
] |
schemas/__init__.py
|
shaban00/flask_rest_api_structure
| 0 |
103282
|
__author__ = '<NAME> [shaban00]'
DRAFT_4_SCHEMA = "http://json-schema.org/draft-04/schema#"
NULL_SCHEMA = {
"type": "null"
}
STRING_SCHEMA = {
"type": "string"
}
STRING_ARRAY_SCHEMA = {
"type": "array",
"items": {
"type": "string"
}
}
INTEGER_SCHEMA = {
"type": "integer"
}
BOOLEAN_SCHEMA = {
"type": "boolean"
}
FLOAT_SCHEMA = {
"type": "number"
}
NULLABLE_STRING_SCHEMA = {
"anyOf": [STRING_SCHEMA, NULL_SCHEMA]
}
NULLABLE_INTEGER_SCHEMA = {
"anyOf": [INTEGER_SCHEMA, NULL_SCHEMA]
}
EMAIL_SCHEMA = {
"type": "string",
"pattern": r"^[a-zA-Z0-9.\-]+@[a-zA-Z0-9]+\.[a-zA-Z0-9.]+$"
}
NULLABLE_EMAIL_SCHEMA = {
"anyOf": [EMAIL_SCHEMA, NULL_SCHEMA]
}
from .college import ADD_COLLEGE_SCHEMA
from .department import ADD_DEPARTMENT_SCHEMA
from .student import ADD_STUDENT_SCHEMA
SCHEMAS = {
"add_college": ADD_COLLEGE_SCHEMA,
"add_department": ADD_DEPARTMENT_SCHEMA,
"add_student": ADD_STUDENT_SCHEMA
}
|
[
1,
4770,
8921,
1649,
353,
12801,
5813,
29958,
518,
845,
10910,
29900,
29900,
29962,
29915,
13,
13,
29928,
4717,
7818,
29918,
29946,
29918,
29903,
3210,
26862,
353,
376,
1124,
597,
3126,
29899,
11010,
29889,
990,
29914,
29881,
4154,
29899,
29900,
29946,
29914,
11010,
29937,
29908,
13,
10074,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1853,
1115,
376,
4304,
29908,
13,
29913,
13,
20785,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1853,
1115,
376,
1807,
29908,
13,
29913,
13,
20785,
29918,
1718,
22800,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1853,
1115,
376,
2378,
613,
29871,
13,
1678,
376,
7076,
1115,
426,
13,
4706,
376,
1853,
1115,
376,
1807,
29908,
13,
1678,
500,
13,
29913,
13,
1177,
4330,
17070,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1853,
1115,
376,
16031,
29908,
13,
29913,
13,
8456,
29949,
1307,
2190,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1853,
1115,
376,
20054,
29908,
13,
29913,
13,
29943,
3927,
1299,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1853,
1115,
376,
4537,
29908,
13,
29913,
13,
10074,
6181,
29918,
20785,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1384,
2776,
1115,
518,
20785,
29918,
29903,
3210,
26862,
29892,
4265,
29918,
29903,
3210,
26862,
29962,
13,
29913,
13,
10074,
6181,
29918,
1177,
4330,
17070,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1384,
2776,
1115,
518,
1177,
4330,
17070,
29918,
29903,
3210,
26862,
29892,
4265,
29918,
29903,
3210,
26862,
29962,
13,
29913,
13,
26862,
6227,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1853,
1115,
376,
1807,
613,
13,
1678,
376,
11037,
1115,
364,
29908,
29985,
29961,
29874,
29899,
25265,
29899,
29999,
29900,
29899,
29929,
7790,
29899,
10062,
29992,
29961,
29874,
29899,
25265,
29899,
29999,
29900,
29899,
29929,
29962,
3124,
7226,
29874,
29899,
25265,
29899,
29999,
29900,
29899,
29929,
5586,
24035,
29908,
13,
29913,
13,
10074,
6181,
29918,
26862,
6227,
29918,
29903,
3210,
26862,
353,
426,
13,
1678,
376,
1384,
2776,
1115,
518,
26862,
6227,
29918,
29903,
3210,
26862,
29892,
4265,
29918,
29903,
3210,
26862,
29962,
13,
29913,
13,
13,
13,
13,
3166,
869,
1054,
4424,
1053,
27827,
29918,
15032,
1307,
1692,
29918,
29903,
3210,
26862,
13,
3166,
869,
311,
8076,
1053,
27827,
29918,
2287,
26092,
13780,
29918,
29903,
3210,
26862,
13,
3166,
869,
18945,
1053,
27827,
29918,
1254,
15789,
3919,
29918,
29903,
3210,
26862,
13,
13,
13,
29903,
3210,
26862,
29903,
353,
426,
13,
1678,
376,
1202,
29918,
1054,
4424,
1115,
27827,
29918,
15032,
1307,
1692,
29918,
29903,
3210,
26862,
29892,
13,
1678,
376,
1202,
29918,
311,
8076,
1115,
27827,
29918,
2287,
26092,
13780,
29918,
29903,
3210,
26862,
29892,
13,
1678,
376,
1202,
29918,
18945,
1115,
27827,
29918,
1254,
15789,
3919,
29918,
29903,
3210,
26862,
13,
29913,
2
] |
setup.py
|
richarddwang/hugdatafast
| 19 |
8524
|
import setuptools
from hugdatafast.__init__ import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
REQUIRED_PKGS = [
'fastai>=2.0.8',
'fastscore>=1.0.1', # change of store_attr api
'datasets',
]
setuptools.setup(
name="hugdatafast",
version=__version__,
author="<NAME>",
author_email="<EMAIL>",
description="The elegant bridge between hugginface data and fastai",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/richarddwang/hugdatafast",
license='Apache 2.0',
packages=setuptools.find_packages(),
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
python_requires='>=3.6',
install_requires=REQUIRED_PKGS,
keywords='datasets machine learning datasets metrics fastai huggingface',
)
|
[
1,
1053,
731,
21245,
8789,
13,
3166,
298,
688,
1272,
11255,
17255,
2344,
1649,
1053,
4770,
3259,
1649,
13,
13,
2541,
1722,
703,
16310,
2303,
29889,
3487,
613,
376,
29878,
1159,
408,
285,
29882,
29901,
13,
1678,
1472,
29918,
8216,
353,
285,
29882,
29889,
949,
580,
13,
13,
1525,
29984,
3120,
19386,
29918,
21738,
10749,
353,
518,
13,
1678,
525,
11255,
1794,
18572,
29906,
29889,
29900,
29889,
29947,
742,
13,
1678,
525,
11255,
13628,
18572,
29896,
29889,
29900,
29889,
29896,
742,
396,
1735,
310,
3787,
29918,
5552,
7882,
13,
1678,
525,
14538,
1691,
742,
13,
29962,
13,
13,
842,
21245,
8789,
29889,
14669,
29898,
13,
1678,
1024,
543,
29882,
688,
1272,
11255,
613,
13,
1678,
1873,
29922,
1649,
3259,
1649,
29892,
13,
1678,
4148,
543,
29966,
5813,
28341,
13,
1678,
4148,
29918,
5269,
543,
29966,
26862,
6227,
28341,
13,
1678,
6139,
543,
1576,
19232,
12945,
1546,
298,
688,
5359,
2161,
848,
322,
5172,
1794,
613,
13,
1678,
1472,
29918,
8216,
29922,
5426,
29918,
8216,
29892,
13,
1678,
1472,
29918,
8216,
29918,
3051,
29918,
1853,
543,
726,
29914,
3502,
3204,
613,
13,
1678,
3142,
543,
991,
597,
3292,
29889,
510,
29914,
4018,
538,
28012,
574,
29914,
29882,
688,
1272,
11255,
613,
13,
1678,
19405,
2433,
17396,
1829,
29871,
29906,
29889,
29900,
742,
13,
1678,
9741,
29922,
842,
21245,
8789,
29889,
2886,
29918,
8318,
3285,
13,
1678,
770,
14903,
11759,
13,
4706,
376,
21956,
358,
16034,
4761,
29871,
29946,
448,
350,
1187,
613,
13,
4706,
376,
2928,
2760,
319,
4749,
663,
4761,
10682,
414,
613,
13,
4706,
376,
2928,
2760,
319,
4749,
663,
4761,
9327,
29914,
1666,
2842,
613,
13,
4706,
376,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
613,
13,
4706,
376,
29931,
293,
1947,
4761,
438,
5425,
28268,
1490,
4761,
13380,
18540,
19245,
613,
13,
4706,
376,
7094,
1218,
2184,
4761,
6570,
25266,
613,
13,
4706,
376,
7031,
293,
4761,
23753,
928,
29914,
12412,
3241,
4761,
3012,
928,
616,
3159,
28286,
613,
13,
1678,
21251,
13,
1678,
3017,
29918,
276,
339,
2658,
2433,
18572,
29941,
29889,
29953,
742,
13,
1678,
2601,
29918,
276,
339,
2658,
29922,
1525,
29984,
3120,
19386,
29918,
21738,
10749,
29892,
13,
1678,
29361,
2433,
14538,
1691,
4933,
6509,
20035,
21556,
5172,
1794,
298,
688,
3460,
2161,
742,
13,
29897,
2
] |
passage/preprocessing.py
|
vishalbelsare/Passage
| 597 |
32950
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import string
from collections import Counter
import numpy as np
import theano
import theano.tensor as T
punctuation = set(string.punctuation)
punctuation.add('\n')
punctuation.add('\t')
punctuation.add(u'’')
punctuation.add(u'‘')
punctuation.add(u'“')
punctuation.add(u'”')
punctuation.add(u'´')
punctuation.add('')
def one_hot(X, n=None, negative_class=0.):
X = np.asarray(X).flatten()
if n is None:
n = np.max(X) + 1
Xoh = np.ones((len(X), n)) * negative_class
Xoh[np.arange(len(X)), X] = 1.
return Xoh
def flatten(l):
return [item for sublist in l for item in sublist]
def lbf(l,b):
return [el for el, condition in zip(l, b) if condition]
def list_index(l, idxs):
return [l[idx] for idx in idxs]
def tokenize(text):
tokenized = []
w = ''
for t in text:
if t in punctuation:
tokenized.append(w)
tokenized.append(t)
w = ''
elif t == ' ':
tokenized.append(w)
w = ''
else:
w += t
if w != '':
tokenized.append(w)
tokenized = [token for token in tokenized if token]
return tokenized
def token_encoder(texts, max_features=9997, min_df=10):
df = {}
for text in texts:
tokens = set(text)
for token in tokens:
if token in df:
df[token] += 1
else:
df[token] = 1
k, v = df.keys(), np.asarray(df.values())
valid = v >= min_df
k = lbf(k, valid)
v = v[valid]
sort_mask = np.argsort(v)[::-1]
k = list_index(k, sort_mask)[:max_features]
v = v[sort_mask][:max_features]
xtoi = dict(zip(k, range(3, len(k)+3)))
return xtoi
def standardize_targets(Y, cost):
Y = np.asarray(Y)
ndim = len(Y.shape)
if ndim == 1:
Y = Y.reshape(-1, 1)
if Y.shape[1] == 1 and cost.__name__ == 'CategoricalCrossEntropy':
Y = one_hot(Y, negative_class=0.)
if Y.shape[1] == 1 and 'Hinge' in cost.__name__:
if len(np.unique(Y)) > 2:
Y = one_hot(Y, negative_class=-1.)
else:
Y[Y==0] -= 1
return Y
class Tokenizer(object):
"""
For converting lists of text into tokens used by Passage models.
max_features sets the maximum number of tokens (all others are mapped to UNK)
min_df sets the minimum number of documents a token must appear in to not get mapped to UNK
lowercase controls whether the text is lowercased or not
character sets whether the tokenizer works on a character or word level
Usage:
>>> from passage.preprocessing import Tokenizer
>>> example_text = ['This. is.', 'Example TEXT', 'is text']
>>> tokenizer = Tokenizer(min_df=1, lowercase=True, character=False)
>>> tokenized = tokenizer.fit_transform(example_text)
>>> tokenized
[[7, 5, 3, 5], [6, 4], [3, 4]]
>>> tokenizer.inverse_transform(tokenized)
['this . is .', 'example text', 'is text']
"""
def __init__(self, max_features=9997, min_df=10, lowercase=True, character=False):
self.max_features = max_features
self.min_df = min_df
self.lowercase = lowercase
self.character = character
def fit(self, texts):
if self.lowercase:
texts = [text.lower() for text in texts]
if self.character:
tokens = [list(text) for text in texts]
else:
tokens = [tokenize(text) for text in texts]
self.encoder = token_encoder(tokens, max_features=self.max_features-3, min_df=self.min_df)
self.encoder['PAD'] = 0
self.encoder['END'] = 1
self.encoder['UNK'] = 2
self.decoder = dict(zip(self.encoder.values(), self.encoder.keys()))
self.n_features = len(self.encoder)
return self
def transform(self, texts):
if self.lowercase:
texts = [text.lower() for text in texts]
if self.character:
texts = [list(text) for text in texts]
else:
texts = [tokenize(text) for text in texts]
tokens = [[self.encoder.get(token, 2) for token in text] for text in texts]
return tokens
def fit_transform(self, texts):
self.fit(texts)
tokens = self.transform(texts)
return tokens
def inverse_transform(self, codes):
if self.character:
joiner = ''
else:
joiner = ' '
return [joiner.join([self.decoder[token] for token in code]) for code in codes]
class LenFilter(object):
def __init__(self, max_len=1000, min_max_len=100, percentile=99):
self.max_len = max_len
self.percentile = percentile
self.min_max_len = min_max_len
def filter(self, *data):
lens = [len(seq) for seq in data[0]]
if self.percentile > 0:
max_len = np.percentile(lens, self.percentile)
max_len = np.clip(max_len, self.min_max_len, self.max_len)
else:
max_len = self.max_len
valid_idxs = [i for i, l in enumerate(lens) if l <= max_len]
if len(data) == 1:
return list_index(data[0], valid_idxs)
else:
return tuple([list_index(d, valid_idxs) for d in data])
|
[
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
5215,
1347,
13,
3166,
16250,
1053,
315,
5336,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
278,
1562,
13,
5215,
278,
1562,
29889,
20158,
408,
323,
13,
13,
29886,
18049,
29884,
362,
353,
731,
29898,
1807,
29889,
29886,
18049,
29884,
362,
29897,
13,
29886,
18049,
29884,
362,
29889,
1202,
28909,
29876,
1495,
13,
29886,
18049,
29884,
362,
29889,
1202,
28909,
29873,
1495,
13,
29886,
18049,
29884,
362,
29889,
1202,
29898,
29884,
29915,
30010,
1495,
13,
29886,
18049,
29884,
362,
29889,
1202,
29898,
29884,
29915,
30086,
1495,
13,
29886,
18049,
29884,
362,
29889,
1202,
29898,
29884,
29915,
30015,
1495,
13,
29886,
18049,
29884,
362,
29889,
1202,
29898,
29884,
29915,
30024,
1495,
13,
29886,
18049,
29884,
362,
29889,
1202,
29898,
29884,
29915,
30165,
1495,
13,
29886,
18049,
29884,
362,
29889,
1202,
877,
1495,
13,
13,
1753,
697,
29918,
8711,
29898,
29990,
29892,
302,
29922,
8516,
29892,
8178,
29918,
1990,
29922,
29900,
9575,
13,
1678,
1060,
353,
7442,
29889,
294,
2378,
29898,
29990,
467,
1579,
8606,
580,
13,
1678,
565,
302,
338,
6213,
29901,
13,
4706,
302,
353,
7442,
29889,
3317,
29898,
29990,
29897,
718,
29871,
29896,
13,
1678,
1060,
1148,
353,
7442,
29889,
2873,
3552,
2435,
29898,
29990,
511,
302,
876,
334,
8178,
29918,
1990,
13,
1678,
1060,
1148,
29961,
9302,
29889,
279,
927,
29898,
2435,
29898,
29990,
8243,
1060,
29962,
353,
29871,
29896,
29889,
13,
1678,
736,
1060,
1148,
13,
13,
1753,
1652,
8606,
29898,
29880,
1125,
13,
1678,
736,
518,
667,
363,
1014,
1761,
297,
301,
363,
2944,
297,
1014,
1761,
29962,
13,
13,
1753,
301,
1635,
29898,
29880,
29892,
29890,
1125,
13,
1678,
736,
518,
295,
363,
560,
29892,
4195,
297,
14319,
29898,
29880,
29892,
289,
29897,
565,
4195,
29962,
13,
13,
1753,
1051,
29918,
2248,
29898,
29880,
29892,
1178,
10351,
1125,
13,
1678,
736,
518,
29880,
29961,
13140,
29962,
363,
22645,
297,
1178,
10351,
29962,
13,
13,
1753,
5993,
675,
29898,
726,
1125,
13,
1678,
5993,
1891,
353,
5159,
13,
1678,
281,
353,
6629,
13,
1678,
363,
260,
297,
1426,
29901,
13,
4706,
565,
260,
297,
6035,
22999,
362,
29901,
13,
9651,
5993,
1891,
29889,
4397,
29898,
29893,
29897,
13,
9651,
5993,
1891,
29889,
4397,
29898,
29873,
29897,
13,
9651,
281,
353,
6629,
13,
4706,
25342,
260,
1275,
525,
525,
29901,
13,
9651,
5993,
1891,
29889,
4397,
29898,
29893,
29897,
13,
9651,
281,
353,
6629,
13,
4706,
1683,
29901,
13,
9651,
281,
4619,
260,
13,
1678,
565,
281,
2804,
525,
2396,
13,
4706,
5993,
1891,
29889,
4397,
29898,
29893,
29897,
13,
1678,
5993,
1891,
353,
518,
6979,
363,
5993,
297,
5993,
1891,
565,
5993,
29962,
13,
1678,
736,
5993,
1891,
13,
13,
1753,
5993,
29918,
3977,
6119,
29898,
726,
29879,
29892,
4236,
29918,
22100,
29922,
29929,
29929,
29929,
29955,
29892,
1375,
29918,
2176,
29922,
29896,
29900,
1125,
13,
1678,
4489,
353,
6571,
13,
1678,
363,
1426,
297,
26442,
29901,
13,
4706,
18897,
353,
731,
29898,
726,
29897,
13,
4706,
363,
5993,
297,
18897,
29901,
13,
9651,
565,
5993,
297,
4489,
29901,
13,
18884,
4489,
29961,
6979,
29962,
4619,
29871,
29896,
13,
9651,
1683,
29901,
13,
18884,
4489,
29961,
6979,
29962,
353,
29871,
29896,
13,
1678,
413,
29892,
325,
353,
4489,
29889,
8149,
3285,
7442,
29889,
294,
2378,
29898,
2176,
29889,
5975,
3101,
13,
1678,
2854,
353,
325,
6736,
1375,
29918,
2176,
13,
1678,
413,
353,
301,
1635,
29898,
29895,
29892,
2854,
29897,
13,
1678,
325,
353,
325,
29961,
3084,
29962,
13,
1678,
2656,
29918,
13168,
353,
7442,
29889,
5085,
441,
29898,
29894,
9601,
1057,
29899,
29896,
29962,
13,
1678,
413,
353,
1051,
29918,
2248,
29898,
29895,
29892,
2656,
29918,
13168,
29897,
7503,
3317,
29918,
22100,
29962,
13,
1678,
325,
353,
325,
29961,
6605,
29918,
13168,
3816,
29901,
3317,
29918,
22100,
29962,
13,
268,
486,
7768,
353,
9657,
29898,
7554,
29898,
29895,
29892,
3464,
29898,
29941,
29892,
7431,
29898,
29895,
7240,
29941,
4961,
13,
1678,
736,
29871,
486,
7768,
13,
13,
1753,
3918,
675,
29918,
5182,
29879,
29898,
29979,
29892,
3438,
1125,
13,
1678,
612,
353,
7442,
29889,
294,
2378,
29898,
29979,
29897,
13,
268,
299,
326,
353,
7431,
29898,
29979,
29889,
12181,
29897,
13,
1678,
565,
29871,
299,
326,
1275,
29871,
29896,
29901,
13,
4706,
612,
353,
612,
29889,
690,
14443,
6278,
29896,
29892,
29871,
29896,
29897,
13,
1678,
565,
612,
29889,
12181,
29961,
29896,
29962,
1275,
29871,
29896,
322,
3438,
17255,
978,
1649,
1275,
525,
29907,
20440,
936,
29907,
2124,
5292,
14441,
2396,
13,
4706,
612,
353,
697,
29918,
8711,
29898,
29979,
29892,
8178,
29918,
1990,
29922,
29900,
1846,
13,
1678,
565,
612,
29889,
12181,
29961,
29896,
29962,
1275,
29871,
29896,
322,
525,
29950,
19144,
29915,
297,
3438,
17255,
978,
1649,
29901,
13,
4706,
565,
7431,
29898,
9302,
29889,
13092,
29898,
29979,
876,
1405,
29871,
29906,
29901,
13,
9651,
612,
353,
697,
29918,
8711,
29898,
29979,
29892,
8178,
29918,
1990,
10457,
29896,
1846,
13,
4706,
1683,
29901,
13,
9651,
612,
29961,
29979,
1360,
29900,
29962,
22361,
29871,
29896,
13,
1678,
736,
612,
13,
13,
1990,
25159,
3950,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
1152,
17415,
8857,
310,
1426,
964,
18897,
1304,
491,
6978,
482,
4733,
29889,
13,
1678,
4236,
29918,
22100,
6166,
278,
7472,
1353,
310,
18897,
313,
497,
4045,
526,
20545,
304,
8291,
29968,
29897,
13,
1678,
1375,
29918,
2176,
6166,
278,
9212,
1353,
310,
10701,
263,
5993,
1818,
2615,
297,
304,
451,
679,
20545,
304,
8291,
29968,
13,
1678,
5224,
4878,
11761,
3692,
278,
1426,
338,
5224,
29883,
1463,
470,
451,
13,
1678,
2931,
6166,
3692,
278,
5993,
3950,
1736,
373,
263,
2931,
470,
1734,
3233,
13,
13,
1678,
10783,
482,
29901,
13,
1678,
8653,
515,
13382,
29889,
1457,
19170,
1053,
25159,
3950,
13,
1678,
8653,
1342,
29918,
726,
353,
6024,
4013,
29889,
338,
29889,
742,
525,
14023,
323,
12194,
742,
525,
275,
1426,
2033,
13,
1678,
8653,
5993,
3950,
353,
25159,
3950,
29898,
1195,
29918,
2176,
29922,
29896,
29892,
5224,
4878,
29922,
5574,
29892,
2931,
29922,
8824,
29897,
13,
1678,
8653,
5993,
1891,
353,
5993,
3950,
29889,
9202,
29918,
9067,
29898,
4773,
29918,
726,
29897,
13,
1678,
8653,
5993,
1891,
13,
1678,
5519,
29955,
29892,
29871,
29945,
29892,
29871,
29941,
29892,
29871,
29945,
1402,
518,
29953,
29892,
29871,
29946,
1402,
518,
29941,
29892,
29871,
29946,
5262,
13,
1678,
8653,
5993,
3950,
29889,
262,
3901,
29918,
9067,
29898,
6979,
1891,
29897,
13,
1678,
6024,
1366,
869,
338,
869,
742,
525,
4773,
1426,
742,
525,
275,
1426,
2033,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4236,
29918,
22100,
29922,
29929,
29929,
29929,
29955,
29892,
1375,
29918,
2176,
29922,
29896,
29900,
29892,
5224,
4878,
29922,
5574,
29892,
2931,
29922,
8824,
1125,
13,
4706,
1583,
29889,
3317,
29918,
22100,
353,
4236,
29918,
22100,
13,
4706,
1583,
29889,
1195,
29918,
2176,
353,
1375,
29918,
2176,
13,
4706,
1583,
29889,
13609,
4878,
353,
5224,
4878,
13,
4706,
1583,
29889,
18609,
353,
2931,
13,
13,
1678,
822,
6216,
29898,
1311,
29892,
26442,
1125,
13,
4706,
565,
1583,
29889,
13609,
4878,
29901,
13,
9651,
26442,
353,
518,
726,
29889,
13609,
580,
363,
1426,
297,
26442,
29962,
13,
4706,
565,
1583,
29889,
18609,
29901,
13,
9651,
18897,
353,
518,
1761,
29898,
726,
29897,
363,
1426,
297,
26442,
29962,
13,
4706,
1683,
29901,
13,
9651,
18897,
353,
518,
6979,
675,
29898,
726,
29897,
363,
1426,
297,
26442,
29962,
13,
4706,
1583,
29889,
3977,
6119,
353,
5993,
29918,
3977,
6119,
29898,
517,
12360,
29892,
4236,
29918,
22100,
29922,
1311,
29889,
3317,
29918,
22100,
29899,
29941,
29892,
1375,
29918,
2176,
29922,
1311,
29889,
1195,
29918,
2176,
29897,
13,
4706,
1583,
29889,
3977,
6119,
1839,
29925,
3035,
2033,
353,
29871,
29900,
13,
4706,
1583,
29889,
3977,
6119,
1839,
11794,
2033,
353,
29871,
29896,
13,
4706,
1583,
29889,
3977,
6119,
1839,
3904,
29968,
2033,
353,
29871,
29906,
13,
4706,
1583,
29889,
7099,
6119,
353,
9657,
29898,
7554,
29898,
1311,
29889,
3977,
6119,
29889,
5975,
3285,
1583,
29889,
3977,
6119,
29889,
8149,
22130,
13,
4706,
1583,
29889,
29876,
29918,
22100,
353,
7431,
29898,
1311,
29889,
3977,
6119,
29897,
13,
4706,
736,
1583,
13,
13,
1678,
822,
4327,
29898,
1311,
29892,
26442,
1125,
13,
4706,
565,
1583,
29889,
13609,
4878,
29901,
13,
9651,
26442,
353,
518,
726,
29889,
13609,
580,
363,
1426,
297,
26442,
29962,
13,
4706,
565,
1583,
29889,
18609,
29901,
13,
9651,
26442,
353,
518,
1761,
29898,
726,
29897,
363,
1426,
297,
26442,
29962,
13,
4706,
1683,
29901,
13,
9651,
26442,
353,
518,
6979,
675,
29898,
726,
29897,
363,
1426,
297,
26442,
29962,
13,
4706,
18897,
353,
5519,
1311,
29889,
3977,
6119,
29889,
657,
29898,
6979,
29892,
29871,
29906,
29897,
363,
5993,
297,
1426,
29962,
363,
1426,
297,
26442,
29962,
13,
4706,
736,
18897,
13,
13,
1678,
822,
6216,
29918,
9067,
29898,
1311,
29892,
26442,
1125,
13,
4706,
1583,
29889,
9202,
29898,
726,
29879,
29897,
13,
4706,
18897,
353,
1583,
29889,
9067,
29898,
726,
29879,
29897,
13,
4706,
736,
18897,
13,
13,
1678,
822,
16402,
29918,
9067,
29898,
1311,
29892,
11561,
1125,
13,
4706,
565,
1583,
29889,
18609,
29901,
13,
9651,
2958,
4983,
353,
6629,
13,
4706,
1683,
29901,
13,
9651,
2958,
4983,
353,
525,
525,
13,
4706,
736,
518,
2212,
4983,
29889,
7122,
4197,
1311,
29889,
7099,
6119,
29961,
6979,
29962,
363,
5993,
297,
775,
2314,
363,
775,
297,
11561,
29962,
13,
13,
1990,
16206,
5072,
29898,
3318,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4236,
29918,
2435,
29922,
29896,
29900,
29900,
29900,
29892,
1375,
29918,
3317,
29918,
2435,
29922,
29896,
29900,
29900,
29892,
10151,
488,
29922,
29929,
29929,
1125,
13,
4706,
1583,
29889,
3317,
29918,
2435,
353,
4236,
29918,
2435,
13,
4706,
1583,
29889,
25376,
488,
353,
10151,
488,
13,
4706,
1583,
29889,
1195,
29918,
3317,
29918,
2435,
353,
1375,
29918,
3317,
29918,
2435,
13,
13,
1678,
822,
4175,
29898,
1311,
29892,
334,
1272,
1125,
13,
4706,
301,
575,
353,
518,
2435,
29898,
11762,
29897,
363,
19359,
297,
848,
29961,
29900,
5262,
13,
4706,
565,
1583,
29889,
25376,
488,
1405,
29871,
29900,
29901,
13,
9651,
4236,
29918,
2435,
353,
7442,
29889,
25376,
488,
29898,
29880,
575,
29892,
1583,
29889,
25376,
488,
29897,
13,
9651,
4236,
29918,
2435,
353,
7442,
29889,
24049,
29898,
3317,
29918,
2435,
29892,
1583,
29889,
1195,
29918,
3317,
29918,
2435,
29892,
1583,
29889,
3317,
29918,
2435,
29897,
13,
4706,
1683,
29901,
13,
9651,
4236,
29918,
2435,
353,
1583,
29889,
3317,
29918,
2435,
13,
4706,
2854,
29918,
333,
10351,
353,
518,
29875,
363,
474,
29892,
301,
297,
26985,
29898,
29880,
575,
29897,
565,
301,
5277,
4236,
29918,
2435,
29962,
13,
4706,
565,
7431,
29898,
1272,
29897,
1275,
29871,
29896,
29901,
13,
9651,
736,
1051,
29918,
2248,
29898,
1272,
29961,
29900,
1402,
2854,
29918,
333,
10351,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
18761,
4197,
1761,
29918,
2248,
29898,
29881,
29892,
2854,
29918,
333,
10351,
29897,
363,
270,
297,
848,
2314,
13,
13,
2
] |
loop/forms.py
|
Brian569/neighbourhood
| 0 |
167974
|
<gh_stars>0
from django import forms
from .models import *
class ProfileupdateForm(forms.ModelForm):
class Meta:
model = profileUser
fields = ['profile_name', 'profile_pic', 'email', 'bio']
exclude = ['user', 'location']
class BussinessForm(forms.ModelForm):
class Meta:
model = Bussiness
fields = ['business_name', 'business_email', 'phone_number', 'neighborhood', 'business_photo', 'details']
exclude = ['owner']
class NeighborHoodForm(forms.ModelForm):
class Meta:
model = NeighborHood
fields = ['name', 'location', 'image']
exclude = ['resider']
class PostForm(forms.ModelForm):
class Meta:
model = Posts
fields = ['title', 'content', 'picture']
exclude = ['owner']
class HealthForm(forms.ModelForm):
class Meta:
model = Health
fields = ['name', 'email', 'picture', 'about', 'neighborhood', 'phone_number']
class PoliceForm(forms.ModelForm):
class Meta:
model = Police
fields = ['name', 'email', 'image', 'neigborhood', 'phone_number', 'about']
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
9557,
1053,
7190,
13,
3166,
869,
9794,
1053,
334,
13,
13,
1990,
20802,
5504,
2500,
29898,
9514,
29889,
3195,
2500,
1125,
13,
1678,
770,
20553,
29901,
13,
4706,
1904,
353,
8722,
2659,
13,
4706,
4235,
353,
6024,
10185,
29918,
978,
742,
525,
10185,
29918,
16447,
742,
525,
5269,
742,
525,
24840,
2033,
13,
4706,
19060,
353,
6024,
1792,
742,
525,
5479,
2033,
13,
13,
13,
1990,
350,
1558,
3335,
2500,
29898,
9514,
29889,
3195,
2500,
1125,
13,
1678,
770,
20553,
29901,
13,
4706,
1904,
353,
350,
1558,
3335,
13,
4706,
4235,
353,
6024,
8262,
3335,
29918,
978,
742,
525,
8262,
3335,
29918,
5269,
742,
525,
6710,
29918,
4537,
742,
525,
484,
1141,
4089,
6614,
742,
525,
8262,
3335,
29918,
21596,
742,
525,
14144,
2033,
13,
4706,
19060,
353,
6024,
20348,
2033,
13,
13,
1990,
2448,
1141,
4089,
29950,
2092,
2500,
29898,
9514,
29889,
3195,
2500,
1125,
13,
1678,
770,
20553,
29901,
13,
4706,
1904,
353,
2448,
1141,
4089,
29950,
2092,
13,
4706,
4235,
353,
6024,
978,
742,
525,
5479,
742,
525,
3027,
2033,
13,
4706,
19060,
353,
6024,
690,
1241,
2033,
13,
13,
1990,
4918,
2500,
29898,
9514,
29889,
3195,
2500,
1125,
13,
1678,
770,
20553,
29901,
13,
4706,
1904,
353,
4918,
29879,
13,
4706,
4235,
353,
6024,
3257,
742,
525,
3051,
742,
525,
12095,
2033,
13,
4706,
19060,
353,
6024,
20348,
2033,
13,
13,
1990,
15202,
2500,
29898,
9514,
29889,
3195,
2500,
1125,
13,
1678,
770,
20553,
29901,
13,
4706,
1904,
353,
15202,
13,
4706,
4235,
353,
6024,
978,
742,
525,
5269,
742,
525,
12095,
742,
525,
12717,
742,
525,
484,
1141,
4089,
6614,
742,
525,
6710,
29918,
4537,
2033,
13,
13,
13,
1990,
18923,
2500,
29898,
9514,
29889,
3195,
2500,
1125,
13,
1678,
770,
20553,
29901,
13,
4706,
1904,
353,
18923,
13,
4706,
4235,
353,
6024,
978,
742,
29871,
525,
5269,
742,
525,
3027,
742,
525,
484,
335,
4089,
6614,
742,
525,
6710,
29918,
4537,
742,
525,
12717,
2033,
2
] |
calvinextras/calvinsys/io/gpiopin/raspberry_pi/PIGPIOPin.py
|
gabrielcercel/calvin-base
| 334 |
102467
|
<reponame>gabrielcercel/calvin-base<filename>calvinextras/calvinsys/io/gpiopin/raspberry_pi/PIGPIOPin.py
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from calvinextras.calvinsys.io.gpiopin import BaseGPIOPin
from calvin.utilities.calvinlogger import get_logger
import pigpio
_log = get_logger(__name__)
class PIGPIOPin(BaseGPIOPin.BaseGPIOPin):
"""
Calvinsys object handling a general-purpose input/output pin using the RPi.GPIO package
"""
PULL = {"up": pigpio.PUD_UP, "down": pigpio.PUD_DOWN, "off": pigpio.PUD_OFF}
MODE = {"in": pigpio.INPUT, "out": pigpio.OUTPUT}
EDGE = {"rising": pigpio.RISING_EDGE, "falling": pigpio.FALLING_EDGE, "both": pigpio.EITHER_EDGE}
def init(self, pin, direction, pull=None, edge=None, bouncetime=None, **kwargs):
self._values = []
self._pin = pin
self._direction = direction
self._debounce = 1000*bouncetime if bouncetime else None # bouncetime is ms, pigpio uses us
self._edge = edge
self._gpio = pigpio.pi()
self._cb = None
try :
mode = self.MODE[direction.lower()]
except KeyError:
raise Exception("Unknown direction '{}', should be IN, OUT".format(direction))
if mode == pigpio.INPUT:
try:
pud = self.PULL[pull.lower()] if pull else pigpio.PUD_OFF
except KeyError:
raise Exception("Unknown pull '{}', should be UP, DOWN, OFF".format(pull))
self._gpio.set_pull_up_down(pin, pud)
if self._debounce:
self._gpio.set_glitch_filter(pin, self._debounce)
self._gpio.set_mode(pin, mode)
if edge is not None:
try:
detect = self.EDGE[edge.lower()]
except KeyError:
raise Exception("Unknown edge '{}', should be RISING, FALLING, BOTH")
self._cb = self._gpio.callback(pin, detect, self._edge_cb)
def _edge_cb(self, pin, edge, tick):
if edge != 2:
self._values.append(edge)
self.scheduler_wakeup()
def can_write(self):
return self._direction.lower() == "out"
def write(self, value):
self._gpio.write(self._pin, 1 if value else 0)
def can_read(self):
if self._direction.lower() == 'in':
return bool(self._values)
return False
def read(self):
if self._values:
return self._values.pop(0)
else:
return self._gpio.read(self._pin)
def close(self):
if self._cb:
self._cb.cancel()
del self._gpio
self._gpio = None
|
[
1,
529,
276,
1112,
420,
29958,
29887,
370,
12836,
2265,
2242,
29914,
1052,
3845,
29899,
3188,
29966,
9507,
29958,
1052,
29894,
457,
486,
3417,
29914,
1052,
29894,
1144,
952,
29914,
601,
29914,
29887,
1631,
459,
262,
29914,
3417,
29886,
16344,
29918,
1631,
29914,
2227,
29954,
2227,
4590,
262,
29889,
2272,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29945,
14713,
12371,
17571,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
3166,
1208,
29894,
457,
486,
3417,
29889,
1052,
29894,
1144,
952,
29889,
601,
29889,
29887,
1631,
459,
262,
1053,
7399,
29954,
2227,
4590,
262,
13,
3166,
1208,
3845,
29889,
4422,
1907,
29889,
1052,
3845,
21707,
1053,
679,
29918,
21707,
13,
5215,
282,
335,
16168,
13,
13,
29918,
1188,
353,
679,
29918,
21707,
22168,
978,
1649,
29897,
13,
13,
1990,
349,
6259,
2227,
4590,
262,
29898,
5160,
29954,
2227,
4590,
262,
29889,
5160,
29954,
2227,
4590,
262,
1125,
13,
1678,
9995,
13,
1678,
3037,
29894,
1144,
952,
1203,
11415,
263,
2498,
29899,
15503,
4220,
1881,
29914,
4905,
12534,
773,
278,
390,
12197,
29889,
29954,
2227,
29949,
3577,
13,
1678,
9995,
13,
268,
13,
1678,
349,
3299,
353,
8853,
786,
1115,
282,
335,
16168,
29889,
7056,
29928,
29918,
4897,
29892,
376,
3204,
1115,
282,
335,
16168,
29889,
7056,
29928,
29918,
3970,
16048,
29892,
376,
2696,
1115,
282,
335,
16168,
29889,
7056,
29928,
29918,
27681,
29913,
13,
1678,
16999,
2287,
353,
8853,
262,
1115,
282,
335,
16168,
29889,
1177,
12336,
29892,
376,
449,
1115,
282,
335,
16168,
29889,
12015,
12336,
29913,
13,
1678,
9408,
1692,
353,
8853,
3780,
292,
1115,
282,
335,
16168,
29889,
29934,
3235,
4214,
29918,
3352,
1692,
29892,
376,
11950,
292,
1115,
282,
335,
16168,
29889,
29943,
9818,
4214,
29918,
3352,
1692,
29892,
376,
20313,
1115,
282,
335,
16168,
29889,
29923,
1806,
4448,
29918,
3352,
1692,
29913,
13,
268,
13,
1678,
822,
2069,
29898,
1311,
29892,
12534,
29892,
5305,
29892,
8206,
29922,
8516,
29892,
7636,
29922,
8516,
29892,
289,
1309,
29883,
5410,
29922,
8516,
29892,
3579,
19290,
1125,
13,
4706,
1583,
3032,
5975,
353,
5159,
13,
4706,
1583,
3032,
12687,
353,
12534,
13,
4706,
1583,
3032,
20845,
353,
5305,
13,
4706,
1583,
3032,
16529,
21543,
353,
29871,
29896,
29900,
29900,
29900,
29930,
29890,
1309,
29883,
5410,
565,
289,
1309,
29883,
5410,
1683,
6213,
396,
289,
1309,
29883,
5410,
338,
10887,
29892,
282,
335,
16168,
3913,
502,
13,
4706,
1583,
3032,
12864,
353,
7636,
13,
4706,
1583,
3032,
29887,
16168,
353,
282,
335,
16168,
29889,
1631,
580,
13,
4706,
1583,
3032,
10702,
353,
6213,
13,
308,
13,
4706,
1018,
584,
13,
9651,
4464,
353,
1583,
29889,
20387,
29961,
20845,
29889,
13609,
580,
29962,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
12020,
8960,
703,
14148,
5305,
525,
8875,
742,
881,
367,
2672,
29892,
19474,
1642,
4830,
29898,
20845,
876,
13,
308,
13,
4706,
565,
4464,
1275,
282,
335,
16168,
29889,
1177,
12336,
29901,
13,
9651,
1018,
29901,
13,
18884,
282,
566,
353,
1583,
29889,
29925,
3299,
29961,
26746,
29889,
13609,
580,
29962,
565,
8206,
1683,
282,
335,
16168,
29889,
7056,
29928,
29918,
27681,
13,
9651,
5174,
7670,
2392,
29901,
13,
18884,
12020,
8960,
703,
14148,
8206,
525,
8875,
742,
881,
367,
11901,
29892,
360,
9806,
29940,
29892,
438,
4198,
1642,
4830,
29898,
26746,
876,
13,
9651,
1583,
3032,
29887,
16168,
29889,
842,
29918,
26746,
29918,
786,
29918,
3204,
29898,
12687,
29892,
282,
566,
29897,
13,
9651,
565,
1583,
3032,
16529,
21543,
29901,
13,
18884,
1583,
3032,
29887,
16168,
29889,
842,
29918,
3820,
2335,
29918,
4572,
29898,
12687,
29892,
1583,
3032,
16529,
21543,
29897,
13,
632,
13,
4706,
1583,
3032,
29887,
16168,
29889,
842,
29918,
8513,
29898,
12687,
29892,
4464,
29897,
13,
13,
13,
4706,
565,
7636,
338,
451,
6213,
29901,
13,
9651,
1018,
29901,
13,
18884,
6459,
353,
1583,
29889,
3352,
1692,
29961,
12864,
29889,
13609,
580,
29962,
13,
9651,
5174,
7670,
2392,
29901,
13,
18884,
12020,
8960,
703,
14148,
7636,
525,
8875,
742,
881,
367,
390,
3235,
4214,
29892,
383,
9818,
4214,
29892,
350,
2891,
29950,
1159,
13,
9651,
1583,
3032,
10702,
353,
1583,
3032,
29887,
16168,
29889,
14035,
29898,
12687,
29892,
6459,
29892,
1583,
3032,
12864,
29918,
10702,
29897,
13,
13,
1678,
822,
903,
12864,
29918,
10702,
29898,
1311,
29892,
12534,
29892,
7636,
29892,
16892,
1125,
13,
4706,
565,
7636,
2804,
29871,
29906,
29901,
13,
9651,
1583,
3032,
5975,
29889,
4397,
29898,
12864,
29897,
13,
9651,
1583,
29889,
816,
14952,
29918,
29893,
1296,
786,
580,
13,
13,
1678,
822,
508,
29918,
3539,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
20845,
29889,
13609,
580,
1275,
376,
449,
29908,
13,
13,
1678,
822,
2436,
29898,
1311,
29892,
995,
1125,
13,
4706,
1583,
3032,
29887,
16168,
29889,
3539,
29898,
1311,
3032,
12687,
29892,
29871,
29896,
565,
995,
1683,
29871,
29900,
29897,
13,
13,
1678,
822,
508,
29918,
949,
29898,
1311,
1125,
13,
4706,
565,
1583,
3032,
20845,
29889,
13609,
580,
1275,
525,
262,
2396,
13,
9651,
736,
6120,
29898,
1311,
3032,
5975,
29897,
13,
4706,
736,
7700,
13,
13,
1678,
822,
1303,
29898,
1311,
1125,
13,
4706,
565,
1583,
3032,
5975,
29901,
13,
9651,
736,
1583,
3032,
5975,
29889,
7323,
29898,
29900,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
1583,
3032,
29887,
16168,
29889,
949,
29898,
1311,
3032,
12687,
29897,
13,
13,
1678,
822,
3802,
29898,
1311,
1125,
13,
4706,
565,
1583,
3032,
10702,
29901,
13,
9651,
1583,
3032,
10702,
29889,
20713,
580,
13,
4706,
628,
1583,
3032,
29887,
16168,
13,
4706,
1583,
3032,
29887,
16168,
353,
6213,
13,
2
] |
app/recipe/tests/test_tags_api.py
|
deepan-py/recipe-app-api
| 0 |
1604740
|
<gh_stars>0
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
try:
from ...core.models import Tag, Recipe
except ImportError:
from core.models import Tag, Recipe
# The above try except block is not necessary both are same but
# from ...core.models import Tag raises ImportError in django tests
# from core.models import Tag causes import warning in vscode
# So for my convenience I used this try except block
from ..serializer import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class PublicTagsApiTests(TestCase):
"""Test publicly available tags API"""
def setUp(self):
self.client = APIClient()
def test_login_require(self):
"""Test that login is required for retrieving tags"""
res = self.client.get(TAGS_URL)
self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
class PrivateTagsApiTests(TestCase):
"""Test the authorized user tags API"""
def setUp(self):
self.user = get_user_model().objects.create_user(
'<EMAIL>',
'test123'
)
self.client = APIClient()
self.client.force_authenticate(self.user)
def test_retrieve_tags(self):
"""Test retrieving tags"""
Tag.objects.create(user=self.user, name='vegan')
Tag.objects.create(user=self.user, name='Desert')
res = self.client.get(TAGS_URL)
tags = Tag.objects.all().order_by('-name')
# return reverse by name
serializer = TagSerializer(tags, many=True)
self.assertEqual(res.status_code, status.HTTP_200_OK)
self.assertEqual(res.data, serializer.data)
def test_tags_limited_to_user(self):
"""Test that tags returened are for authenticated user"""
user2 = get_user_model().objects.create_user(
'<EMAIL>',
'test123'
)
Tag.objects.create(user=user2, name='fruity')
tag = Tag.objects.create(user=self.user, name='comfort food')
res = self.client.get(TAGS_URL)
self.assertEqual(res.status_code, status.HTTP_200_OK)
self.assertEqual(len(res.data), 1)
self.assertEqual(res.data[0]['name'], tag.name)
def test_create_tag_successful(self):
"""Test creating a new tag"""
payload = {
'name': 'test tag'
}
self.client.post(TAGS_URL, payload)
exists = Tag.objects.filter(
user=self.user,
name=payload['name']
).exists()
self.assertTrue(exists)
def test_create_tag_invalid(self):
"""Test creating a new tag with invalid payload"""
payload = {'name': ''}
res = self.client.post(TAGS_URL, payload)
self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)
def test_retrieve_tags_assigned_to_recipe(self):
"""Test filtering tags by those assigned to recipes"""
tag1 = Tag.objects.create(user=self.user, name='Breakfast')
tag2 = Tag.objects.create(user=self.user, name='another')
recipe = Recipe.objects.create(
title='corriander',
time_minutes=10,
price=5.00,
user=self.user
)
recipe.tags.add(tag1)
res = self.client.get(TAGS_URL, {'assigned_only': 1})
serializer1 = TagSerializer(tag1)
serializer2 = TagSerializer(tag2)
self.assertIn(serializer1.data, res.data)
self.assertNotIn(serializer2.data, res.data)
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
9557,
29889,
21570,
29889,
5150,
1053,
679,
29918,
1792,
29918,
4299,
13,
3166,
9557,
29889,
26045,
1053,
11837,
13,
3166,
9557,
29889,
1688,
1053,
4321,
8259,
13,
3166,
1791,
29918,
4468,
1053,
4660,
13,
3166,
1791,
29918,
4468,
29889,
1688,
1053,
3450,
4032,
13,
13,
13,
2202,
29901,
13,
1678,
515,
2023,
3221,
29889,
9794,
1053,
10522,
29892,
830,
24044,
13,
19499,
16032,
2392,
29901,
13,
1678,
515,
7136,
29889,
9794,
1053,
10522,
29892,
830,
24044,
13,
13,
29937,
450,
2038,
1018,
5174,
2908,
338,
451,
5181,
1716,
526,
1021,
541,
13,
29937,
515,
2023,
3221,
29889,
9794,
1053,
10522,
1153,
4637,
16032,
2392,
297,
9557,
6987,
13,
29937,
515,
7136,
29889,
9794,
1053,
10522,
9946,
1053,
9177,
297,
7186,
401,
13,
29937,
1105,
363,
590,
29703,
306,
1304,
445,
1018,
5174,
2908,
13,
3166,
6317,
15550,
3950,
1053,
10522,
17679,
13,
13,
13,
6040,
10749,
29918,
4219,
353,
11837,
877,
4361,
412,
29901,
4039,
29899,
1761,
1495,
13,
13,
13,
1990,
5236,
28089,
11713,
24376,
29898,
3057,
8259,
1125,
13,
1678,
9995,
3057,
970,
368,
3625,
8282,
3450,
15945,
29908,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
4645,
353,
3450,
4032,
580,
13,
13,
1678,
822,
1243,
29918,
7507,
29918,
12277,
29898,
1311,
1125,
13,
4706,
9995,
3057,
393,
6464,
338,
3734,
363,
5663,
15387,
8282,
15945,
29908,
13,
4706,
620,
353,
1583,
29889,
4645,
29889,
657,
29898,
6040,
10749,
29918,
4219,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
690,
29889,
4882,
29918,
401,
29892,
4660,
29889,
10493,
29918,
29946,
29900,
29896,
29918,
29965,
3521,
2692,
29950,
1955,
26664,
3352,
29897,
13,
13,
13,
1990,
12230,
28089,
11713,
24376,
29898,
3057,
8259,
1125,
13,
1678,
9995,
3057,
278,
4148,
1891,
1404,
8282,
3450,
15945,
29908,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1792,
353,
679,
29918,
1792,
29918,
4299,
2141,
12650,
29889,
3258,
29918,
1792,
29898,
13,
9651,
12801,
26862,
6227,
29958,
742,
13,
9651,
525,
1688,
29896,
29906,
29941,
29915,
13,
4706,
1723,
13,
4706,
1583,
29889,
4645,
353,
3450,
4032,
580,
13,
4706,
1583,
29889,
4645,
29889,
10118,
29918,
27218,
403,
29898,
1311,
29889,
1792,
29897,
13,
13,
1678,
822,
1243,
29918,
276,
509,
2418,
29918,
11338,
29898,
1311,
1125,
13,
4706,
9995,
3057,
5663,
15387,
8282,
15945,
29908,
13,
4706,
10522,
29889,
12650,
29889,
3258,
29898,
1792,
29922,
1311,
29889,
1792,
29892,
1024,
2433,
345,
6249,
1495,
13,
4706,
10522,
29889,
12650,
29889,
3258,
29898,
1792,
29922,
1311,
29889,
1792,
29892,
1024,
2433,
4002,
814,
1495,
13,
4706,
620,
353,
1583,
29889,
4645,
29889,
657,
29898,
6040,
10749,
29918,
4219,
29897,
13,
4706,
8282,
353,
10522,
29889,
12650,
29889,
497,
2141,
2098,
29918,
1609,
877,
29899,
978,
1495,
13,
4706,
396,
736,
11837,
491,
1024,
13,
4706,
7797,
3950,
353,
10522,
17679,
29898,
11338,
29892,
1784,
29922,
5574,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
690,
29889,
4882,
29918,
401,
29892,
4660,
29889,
10493,
29918,
29906,
29900,
29900,
29918,
8949,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
690,
29889,
1272,
29892,
7797,
3950,
29889,
1272,
29897,
13,
13,
1678,
822,
1243,
29918,
11338,
29918,
29044,
29918,
517,
29918,
1792,
29898,
1311,
1125,
13,
4706,
9995,
3057,
393,
8282,
3240,
332,
6419,
526,
363,
15585,
630,
1404,
15945,
29908,
13,
4706,
1404,
29906,
353,
679,
29918,
1792,
29918,
4299,
2141,
12650,
29889,
3258,
29918,
1792,
29898,
13,
9651,
12801,
26862,
6227,
29958,
742,
13,
9651,
525,
1688,
29896,
29906,
29941,
29915,
13,
4706,
1723,
13,
4706,
10522,
29889,
12650,
29889,
3258,
29898,
1792,
29922,
1792,
29906,
29892,
1024,
2433,
29888,
582,
537,
1495,
13,
4706,
4055,
353,
10522,
29889,
12650,
29889,
3258,
29898,
1792,
29922,
1311,
29889,
1792,
29892,
1024,
2433,
510,
3921,
9687,
1495,
13,
4706,
620,
353,
1583,
29889,
4645,
29889,
657,
29898,
6040,
10749,
29918,
4219,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
690,
29889,
4882,
29918,
401,
29892,
4660,
29889,
10493,
29918,
29906,
29900,
29900,
29918,
8949,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
690,
29889,
1272,
511,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
690,
29889,
1272,
29961,
29900,
22322,
978,
7464,
4055,
29889,
978,
29897,
13,
13,
1678,
822,
1243,
29918,
3258,
29918,
4039,
29918,
8698,
1319,
29898,
1311,
1125,
13,
4706,
9995,
3057,
4969,
263,
716,
4055,
15945,
29908,
13,
4706,
20092,
353,
426,
13,
9651,
525,
978,
2396,
525,
1688,
4055,
29915,
13,
4706,
500,
13,
4706,
1583,
29889,
4645,
29889,
2490,
29898,
6040,
10749,
29918,
4219,
29892,
20092,
29897,
13,
4706,
4864,
353,
10522,
29889,
12650,
29889,
4572,
29898,
13,
9651,
1404,
29922,
1311,
29889,
1792,
29892,
13,
9651,
1024,
29922,
23813,
1839,
978,
2033,
13,
4706,
13742,
9933,
580,
13,
4706,
1583,
29889,
9294,
5574,
29898,
9933,
29897,
13,
13,
1678,
822,
1243,
29918,
3258,
29918,
4039,
29918,
20965,
29898,
1311,
1125,
13,
4706,
9995,
3057,
4969,
263,
716,
4055,
411,
8340,
20092,
15945,
29908,
13,
4706,
20092,
353,
11117,
978,
2396,
6629,
29913,
13,
4706,
620,
353,
1583,
29889,
4645,
29889,
2490,
29898,
6040,
10749,
29918,
4219,
29892,
20092,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
690,
29889,
4882,
29918,
401,
29892,
4660,
29889,
10493,
29918,
29946,
29900,
29900,
29918,
29933,
3035,
29918,
16244,
29897,
13,
13,
1678,
822,
1243,
29918,
276,
509,
2418,
29918,
11338,
29918,
465,
12961,
29918,
517,
29918,
4361,
412,
29898,
1311,
1125,
13,
4706,
9995,
3057,
21166,
8282,
491,
1906,
9859,
304,
9522,
5547,
15945,
29908,
13,
4706,
4055,
29896,
353,
10522,
29889,
12650,
29889,
3258,
29898,
1792,
29922,
1311,
29889,
1792,
29892,
1024,
2433,
20130,
557,
11255,
1495,
13,
4706,
4055,
29906,
353,
10522,
29889,
12650,
29889,
3258,
29898,
1792,
29922,
1311,
29889,
1792,
29892,
1024,
2433,
23327,
1495,
13,
4706,
9522,
412,
353,
830,
24044,
29889,
12650,
29889,
3258,
29898,
13,
9651,
3611,
2433,
2616,
374,
3825,
742,
13,
9651,
931,
29918,
1195,
2667,
29922,
29896,
29900,
29892,
13,
9651,
8666,
29922,
29945,
29889,
29900,
29900,
29892,
13,
9651,
1404,
29922,
1311,
29889,
1792,
13,
4706,
1723,
13,
4706,
9522,
412,
29889,
11338,
29889,
1202,
29898,
4039,
29896,
29897,
13,
4706,
620,
353,
1583,
29889,
4645,
29889,
657,
29898,
6040,
10749,
29918,
4219,
29892,
11117,
465,
12961,
29918,
6194,
2396,
29871,
29896,
1800,
13,
4706,
7797,
3950,
29896,
353,
10522,
17679,
29898,
4039,
29896,
29897,
13,
4706,
7797,
3950,
29906,
353,
10522,
17679,
29898,
4039,
29906,
29897,
13,
4706,
1583,
29889,
9294,
797,
29898,
15550,
3950,
29896,
29889,
1272,
29892,
620,
29889,
1272,
29897,
13,
4706,
1583,
29889,
9294,
3664,
797,
29898,
15550,
3950,
29906,
29889,
1272,
29892,
620,
29889,
1272,
29897,
13,
2
] |
pi/camera/capture.py
|
gwsystems/scum
| 0 |
177938
|
# simple script for img capture
# takes 1 arg: filename (.jpg)
import sys
from picamera import PiCamera
from time import sleep
# create instance
camera = PiCamera()
# Takes a string, ie. 'img.jpg'
def capture(filename):
# camera needs time to adjust brightness
# this is the shortest delay
sleep(0.15)
# capture and save img as filename
camera.capture(filename)
filename = 'img.jpg'
if len(sys.argv) == 2:
filename = sys.argv[1]
capture(filename)
print('captured ' + filename)
|
[
1,
396,
2560,
2471,
363,
10153,
10446,
13,
29937,
4893,
29871,
29896,
1852,
29901,
10422,
14544,
6173,
29897,
13,
5215,
10876,
13,
3166,
11942,
314,
1572,
1053,
7362,
20717,
13,
3166,
931,
1053,
8709,
13,
13,
29937,
1653,
2777,
13,
26065,
353,
7362,
20717,
580,
13,
29871,
13,
29937,
323,
6926,
263,
1347,
29892,
19282,
29889,
525,
2492,
29889,
6173,
29915,
13,
1753,
10446,
29898,
9507,
1125,
13,
1678,
13,
1678,
396,
10656,
4225,
931,
304,
10365,
11785,
2264,
13,
1678,
396,
445,
338,
278,
3273,
342,
9055,
13,
1678,
8709,
29898,
29900,
29889,
29896,
29945,
29897,
13,
268,
13,
1678,
396,
10446,
322,
4078,
10153,
408,
10422,
13,
1678,
10656,
29889,
17885,
545,
29898,
9507,
29897,
13,
13,
9507,
353,
525,
2492,
29889,
6173,
29915,
13,
361,
7431,
29898,
9675,
29889,
19218,
29897,
1275,
29871,
29906,
29901,
13,
1678,
10422,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
17885,
545,
29898,
9507,
29897,
13,
2158,
877,
17885,
2955,
525,
718,
10422,
29897,
13,
13,
2
] |
barcode/charsets/ean.py
|
Azd325/python-barcode
| 0 |
12757
|
<reponame>Azd325/python-barcode<gh_stars>0
EDGE = '101'
MIDDLE = '01010'
CODES = {
'A': (
'0001101', '0011001', '0010011', '0111101', '0100011', '0110001',
'0101111', '0111011', '0110111', '0001011'
),
'B': (
'0100111', '0110011', '0011011', '0100001', '0011101', '0111001',
'0000101', '0010001', '0001001', '0010111'
),
'C': (
'1110010', '1100110', '1101100', '1000010', '1011100', '1001110',
'1010000', '1000100', '1001000', '1110100'
),
}
LEFT_PATTERN = (
'AAAAAA', 'AABABB', 'AABBAB', 'AABBBA', 'ABAABB', 'ABBAAB', 'ABBBAA',
'ABABAB', 'ABABBA', 'ABBABA'
)
|
[
1,
529,
276,
1112,
420,
29958,
29909,
8849,
29941,
29906,
29945,
29914,
4691,
29899,
1646,
401,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3352,
1692,
353,
525,
29896,
29900,
29896,
29915,
13,
29924,
1367,
29928,
1307,
353,
525,
29900,
29896,
29900,
29896,
29900,
29915,
13,
16524,
29903,
353,
426,
13,
1678,
525,
29909,
2396,
313,
13,
4706,
525,
29900,
29900,
29900,
29896,
29896,
29900,
29896,
742,
525,
29900,
29900,
29896,
29896,
29900,
29900,
29896,
742,
525,
29900,
29900,
29896,
29900,
29900,
29896,
29896,
742,
525,
29900,
29896,
29896,
29896,
29896,
29900,
29896,
742,
525,
29900,
29896,
29900,
29900,
29900,
29896,
29896,
742,
525,
29900,
29896,
29896,
29900,
29900,
29900,
29896,
742,
13,
4706,
525,
29900,
29896,
29900,
29896,
29896,
29896,
29896,
742,
525,
29900,
29896,
29896,
29896,
29900,
29896,
29896,
742,
525,
29900,
29896,
29896,
29900,
29896,
29896,
29896,
742,
525,
29900,
29900,
29900,
29896,
29900,
29896,
29896,
29915,
13,
1678,
10353,
13,
1678,
525,
29933,
2396,
313,
13,
4706,
525,
29900,
29896,
29900,
29900,
29896,
29896,
29896,
742,
525,
29900,
29896,
29896,
29900,
29900,
29896,
29896,
742,
525,
29900,
29900,
29896,
29896,
29900,
29896,
29896,
742,
525,
29900,
29896,
29900,
29900,
29900,
29900,
29896,
742,
525,
29900,
29900,
29896,
29896,
29896,
29900,
29896,
742,
525,
29900,
29896,
29896,
29896,
29900,
29900,
29896,
742,
13,
4706,
525,
29900,
29900,
29900,
29900,
29896,
29900,
29896,
742,
525,
29900,
29900,
29896,
29900,
29900,
29900,
29896,
742,
525,
29900,
29900,
29900,
29896,
29900,
29900,
29896,
742,
525,
29900,
29900,
29896,
29900,
29896,
29896,
29896,
29915,
13,
1678,
10353,
13,
1678,
525,
29907,
2396,
313,
13,
4706,
525,
29896,
29896,
29896,
29900,
29900,
29896,
29900,
742,
525,
29896,
29896,
29900,
29900,
29896,
29896,
29900,
742,
525,
29896,
29896,
29900,
29896,
29896,
29900,
29900,
742,
525,
29896,
29900,
29900,
29900,
29900,
29896,
29900,
742,
525,
29896,
29900,
29896,
29896,
29896,
29900,
29900,
742,
525,
29896,
29900,
29900,
29896,
29896,
29896,
29900,
742,
13,
4706,
525,
29896,
29900,
29896,
29900,
29900,
29900,
29900,
742,
525,
29896,
29900,
29900,
29900,
29896,
29900,
29900,
742,
525,
29896,
29900,
29900,
29896,
29900,
29900,
29900,
742,
525,
29896,
29896,
29896,
29900,
29896,
29900,
29900,
29915,
13,
1678,
10353,
13,
29913,
13,
28024,
29918,
29925,
1299,
4945,
29940,
353,
313,
13,
1678,
525,
23184,
6344,
742,
525,
29909,
2882,
2882,
29933,
742,
525,
29909,
2882,
29933,
2882,
742,
525,
29909,
2882,
29933,
5688,
742,
525,
2882,
29909,
2882,
29933,
742,
525,
2882,
5688,
2882,
742,
525,
2882,
29933,
5688,
29909,
742,
13,
1678,
525,
2882,
2882,
2882,
742,
525,
2882,
2882,
5688,
742,
525,
2882,
29933,
2882,
29909,
29915,
13,
29897,
13,
2
] |
gym/envs/yumi/yumi_constrained.py
|
carlo-/gym
| 1 |
102191
|
<reponame>carlo-/gym<filename>gym/envs/yumi/yumi_constrained.py<gh_stars>1-10
import copy
import numpy as np
import gym
from gym import spaces
from gym.envs.yumi.yumi_env import YumiEnv, YumiTask
from gym.utils import transformations as tf
from gym.envs.robotics.utils import reset_mocap2body_xpos
def _goal_distance(goal_a, goal_b):
assert goal_a.shape == goal_b.shape
assert goal_a.shape[-1] == 3
delta_pos = goal_a[..., :3] - goal_b[..., :3]
d_pos = np.linalg.norm(delta_pos, axis=-1)
return d_pos
def _mocap_set_action(sim, action):
# Originally from gym.envs.robotics.utils
if sim.model.nmocap > 0:
pos_delta = action[:, :3]
quat_delta = action[:, 3:]
reset_mocap2body_xpos(sim)
sim.data.mocap_pos[:] += pos_delta
sim.data.mocap_quat[:] += quat_delta
class YumiConstrainedEnv(gym.GoalEnv):
def __init__(self, *, reward_type='dense', rotation_ctrl=False, fingers_ctrl=False, distance_threshold=0.05,
randomize_initial_object_pos=True, mocap_ctrl=False, render_poses=True,
object_id='fetch_box', **kwargs):
super(YumiConstrainedEnv, self).__init__()
self.metadata = {
'render.modes': ['human'],
}
self.sim_env = YumiEnv(
arm='both', block_gripper=False, reward_type=reward_type, task=YumiTask.PICK_AND_PLACE_OBJECT,
object_id=object_id, randomize_initial_object_pos=randomize_initial_object_pos, **kwargs,
)
self.mocap_ctrl = mocap_ctrl
self.reward_type = reward_type
self.distance_threshold = distance_threshold
self.render_poses = render_poses
obs = self._get_obs()
n_actions = 4 # dist between grippers (1) + grasp center pos delta (3)
if rotation_ctrl:
n_actions += 4 # grasp center quat delta (4)
if fingers_ctrl:
n_actions += 2 # # dist between fingers, (left, right) grippers (2)
self.rotation_ctrl_enabled = rotation_ctrl
self.fingers_ctrl_enabled = fingers_ctrl
self.fingers_default_to_open = False
self.action_space = spaces.Box(-1., 1., shape=(n_actions,), dtype='float32')
self.observation_space = spaces.Dict(dict(
desired_goal=spaces.Box(-np.inf, np.inf, shape=obs['achieved_goal'].shape, dtype='float32'),
achieved_goal=spaces.Box(-np.inf, np.inf, shape=obs['achieved_goal'].shape, dtype='float32'),
observation=spaces.Box(-np.inf, np.inf, shape=obs['observation'].shape, dtype='float32'),
))
# Shortcuts
# ----------------------------
def sync_object_init_pos(self, pos: np.ndarray, wrt_table=False, now=False):
self.sim_env.sync_object_init_pos(pos, wrt_table=wrt_table, now=now)
@property
def viewer(self):
return self.sim_env.viewer
@property
def sim(self):
return self.sim_env.sim
@property
def np_random(self):
return self.sim_env.np_random
def _get_object_size(self):
geom = self.sim.model.geom_name2id('object0_base')
return self.sim.model.geom_size[geom].copy()
def get_object_pose(self):
return np.r_[
self.sim.data.get_body_xpos('object0'),
self.sim.data.get_body_xquat('object0'),
]
def get_object_pos(self):
return self.sim.data.get_body_xpos('object0').copy()
def get_object_rot(self):
return tf.rotations.mat2euler(self.sim.data.get_site_xmat('object0:center'))
def get_object_velp(self):
return self.sim.data.get_site_xvelp('object0:center') * self.sim_env.dt
def get_object_velr(self):
return self.sim.data.get_site_xvelr('object0:center') * self.sim_env.dt
def get_gripper_pose(self, arm):
assert arm in ('l', 'r')
return np.r_[
self.sim.data.get_site_xpos(f'gripper_{arm}_center'),
tf.rotations.mat2quat(self.sim.data.get_site_xmat(f'gripper_{arm}_center')),
]
def get_gripper_pos(self, arm):
assert arm in ('l', 'r')
return self.sim.data.get_site_xpos(f'gripper_{arm}_center').copy()
def get_gripper_velp(self, arm):
assert arm in ('l', 'r')
return self.sim.data.get_site_xvelp(f'gripper_{arm}_center') * self.sim_env.dt
def get_grasp_center_pos(self):
return (self.get_gripper_pos('l') + self.get_gripper_pos('r')) / 2.0
def get_grasp_center_velp(self):
return (self.get_gripper_velp('l') + self.get_gripper_velp('r')) / 2.0
def get_arm_config(self, arm):
if arm == 'l':
idx = self.sim_env._arm_l_joint_idx
else:
idx = self.sim_env._arm_r_joint_idx
return self.sim.data.qpos[idx].copy()
def get_task_space(self):
obj_radius = self._get_object_size()[0]
return np.r_[obj_radius*1.0, obj_radius*1.0, 0.03]
def is_object_on_ground(self):
obj_pose = self.get_object_pos()
return obj_pose[2] < 0.0
def is_object_unreachable(self):
obj_pose = self.get_object_pos()
return not (
(-0.15 < obj_pose[0] < 0.15)
and (-0.15 < obj_pose[1] < 0.15)
and (-0.01 < obj_pose[2] < 0.45)
)
def get_table_surface_pose(self):
return self.sim_env.get_table_surface_pose()
def _unpack_action(self, action):
dist_between_grippers = action[0]
grasp_center_pos_delta = action[1:4]
offset = 4
if self.rotation_ctrl_enabled:
grasp_center_quat_delta = action[offset:offset+4]
offset += 4
else:
grasp_center_quat_delta = np.r_[1., 0., 0., 0.]
if self.fingers_ctrl_enabled:
l_fingers_ctrl, r_fingers_ctrl = action[offset:offset+2]
else:
l_fingers_ctrl = r_fingers_ctrl = -1. if self.fingers_default_to_open else 1.
return (
dist_between_grippers, grasp_center_pos_delta,
grasp_center_quat_delta, l_fingers_ctrl, r_fingers_ctrl
)
def _reset(self):
qpos = np.r_[
0.5331, 0.046, 0.3148, -0.0206, -0.8999, 1.0898, -2.1024, 0.0, 0.0002, -0.0875, 0.0288, -0.6761,
0.0196, 0.841, 1.0012, -0.9585, -0.0, 0.0001, 0.025, 0.025, 0.03, 1.0, -0.0, 0.0, 0.0
]
if self.sim_env.has_rotating_platform:
qpos = np.r_[-0.75, qpos]
qvel = np.zeros_like(self.sim_env.init_qvel)
self.sim.data.ctrl[:] = 0.0
self.sim_env._set_sim_state(qpos, qvel)
object_qpos = self.sim.data.get_joint_qpos('object0:joint').copy()
self.sim_env._object_xy_pos_to_sync = self.np_random.uniform(*self.sim_env._obj_init_bounds)
if self.sim_env.has_rotating_platform:
object_qpos[2] += 0.020
object_qpos[:2] = self.sim.data.get_site_xpos('rotating_platform:far_end')[:2]
elif self.sim_env.has_button:
object_qpos[:2] = 0.375, -0.476
elif self.sim_env.randomize_initial_object_pos:
# Randomize initial position of object.
object_qpos[:2] = self.sim_env._object_xy_pos_to_sync.copy()
self.sim.data.set_joint_qpos('object0:joint', object_qpos)
self.sim_env._reset_button()
# Env methods
# ----------------------------
def seed(self, seed=None):
self.sim_env.seed(seed)
def step(self, action: np.ndarray):
action = np.clip(action, self.action_space.low, self.action_space.high)
(dist_between_grippers, grasp_center_pos_delta,
grasp_center_quat_delta, l_fingers_ctrl, r_fingers_ctrl) = self._unpack_action(action)
if self.mocap_ctrl:
pos_k = 0.1
dist_range = [0.05, 0.20]
else:
pos_k = 0.2
dist_range = [0.05, 0.30]
dist_between_grippers = np.interp(dist_between_grippers, [-1, 1], dist_range)
curr_grasp_center_pose = self.get_grasp_center_pos() # TODO: Use pose rather than position only
target_grasp_center_pose = np.r_[0., 0., 0., 1., 0., 0., 0.]
target_grasp_center_pose[:3] = curr_grasp_center_pose[:3] + grasp_center_pos_delta * pos_k
if self.rotation_ctrl_enabled:
# target_grasp_center_pose[3:] = curr_grasp_center_pose[3:] + grasp_center_quat_delta * 0.1
raise NotImplementedError
grippers_pos_targets = np.array([
tf.apply_tf(np.r_[0., dist_between_grippers/2.0, 0., 1., 0., 0., 0.], target_grasp_center_pose)[:3],
tf.apply_tf(np.r_[0., -dist_between_grippers/2.0, 0., 1., 0., 0., 0.], target_grasp_center_pose)[:3]
])
vec = grippers_pos_targets[0, :2] - grippers_pos_targets[1, :2]
right_yaw = np.arctan2(vec[1], vec[0]) + np.pi/2
left_yaw = np.arctan2(-vec[1], -vec[0]) + np.pi/2
grasp_radius = np.linalg.norm(vec, ord=2) / 2.0
assert np.allclose(grasp_radius, dist_between_grippers / 2.0)
if self.mocap_ctrl:
self._move_arms_mocap(
left_target=grippers_pos_targets[0], left_yaw=left_yaw,
right_target=grippers_pos_targets[1], right_yaw=right_yaw,
left_grp_config=l_fingers_ctrl, right_grp_config=r_fingers_ctrl, max_steps=1,
)
else:
self._move_arms(
left_target=grippers_pos_targets[0], left_yaw=left_yaw,
right_target=grippers_pos_targets[1], right_yaw=right_yaw,
left_grp_config=l_fingers_ctrl, right_grp_config=r_fingers_ctrl, max_steps=5,
)
obs = self._get_obs()
done = False # self.is_object_unreachable()
info = {'is_success': self._is_success(obs['achieved_goal'], self.goal)}
reward = self.compute_reward(obs['achieved_goal'], self.goal, info)
return obs, reward, done, info
def render(self, mode='human', keep_markers=False, rgb_options=None):
markers = []
if keep_markers:
markers = copy.deepcopy(self.viewer._markers)
res = self.sim_env.render(mode=mode, rgb_options=rgb_options)
for m in markers:
self.viewer.add_marker(**m)
return res
def reset(self):
self._reset()
self.sim_env.goal = self._sample_goal().copy()
self.sim.step()
return self._get_obs()
# GoalEnv methods
# ----------------------------
@property
def goal(self):
return self.sim_env.goal[:3]
def _sample_goal(self):
new_goal = self.sim_env._sample_goal()
return new_goal
def compute_reward(self, achieved_goal: np.ndarray, goal: np.ndarray, info: dict):
if self.reward_type == 'sparse':
success = self._is_success(achieved_goal, goal).astype(np.float32)
return success - 1.
else:
d = _goal_distance(achieved_goal, goal)
return -d
def _is_success(self, achieved_goal: np.ndarray, desired_goal: np.ndarray):
d = _goal_distance(achieved_goal, desired_goal)
return (d < self.distance_threshold).astype(np.float32)
def _get_obs(self):
if self.sim_env.is_pressing_button():
self.sim_env._did_press_button()
grippers_pos = np.r_[self.get_gripper_pos('l'), self.get_gripper_pos('r')]
grippers_velp = np.r_[self.get_gripper_velp('l'), self.get_gripper_velp('r')]
grasp_center_pos = self.get_grasp_center_pos()
grasp_center_velp = self.get_grasp_center_velp()
object_pos = self.get_object_pos()
object_rot = self.get_object_rot()
object_velp = self.get_object_velp()
object_velr = self.get_object_velr()
object_rel_pos = object_pos - grasp_center_pos
object_velp -= grasp_center_velp
achieved_goal = object_pos.copy()
obs = np.r_[
grasp_center_pos, grasp_center_velp, grippers_pos, grippers_velp,
object_pos, object_rot, object_rel_pos, object_velp, object_velr
]
return dict(
observation=obs,
achieved_goal=achieved_goal,
desired_goal=self.goal.copy(),
)
# Arm control
# ----------------------------
def _controller(self, error, prev_error, k):
if np.all(prev_error == 0.0):
d_err = 0.0
else:
d_err = (error - prev_error) / self.sim_env.dt
prev_error[:] = error
return -(1.0 * error + 0.05 * d_err) * k
def _move_arms(self, *, left_target: np.ndarray, right_target: np.ndarray, left_yaw=0.0, right_yaw=0.0,
pos_threshold=0.02, rot_threshold=0.1, k=2.0, max_steps=100, count_stable_steps=False,
targets_relative_to=None, left_grp_config=-1.0, right_grp_config=-1.0):
targets = {'l': left_target, 'r': right_target}
yaws = {'l': left_yaw, 'r': right_yaw}
stable_steps = 0
prev_rel_pos = np.zeros(3)
u = np.zeros(self.sim_env.action_space.shape)
prev_err_l = np.zeros(7)
prev_err_r = np.zeros(7)
max_pos_err = -np.inf
for i in range(max_steps):
grasp_center_pos = np.zeros(3)
max_rot_err = -np.inf
max_pos_err = -np.inf
d_above_table = self.get_object_pos()[2] - self.sim_env._object_z_offset
grp_xrot = 0.9 + d_above_table * 2.0
for arm_i, arm in enumerate(('l', 'r')):
curr_pose = self.get_gripper_pose(arm)
curr_q = self.get_arm_config(arm)
if arm == 'l':
pitch = np.pi - grp_xrot
u_masked = u[:7]
prev_err = prev_err_l
else:
pitch = np.pi - grp_xrot
u_masked = u[8:15]
prev_err = prev_err_r
if callable(targets_relative_to):
reference = targets_relative_to()
target_pos = tf.apply_tf(targets[arm], reference)[:3]
else:
target_pos = targets[arm]
target_pose = np.r_[target_pos, tf.rotations.euler2quat(np.r_[0., 0., yaws[arm]])]
target_pose = tf.apply_tf(np.r_[0., 0., 0., tf.rotations.euler2quat(np.r_[pitch, 0., 0.])], target_pose)
grasp_center_pos += curr_pose[:3]
max_pos_err = max(max_pos_err, np.abs(curr_pose[:3] - target_pose[:3]).max())
max_rot_err = max(max_rot_err, tf.quat_angle_diff(curr_pose[3:], target_pose[3:]))
target_q = self.sim_env.mocap_ik(target_pose - curr_pose, arm)
u_masked[:] = self._controller(curr_q - target_q, prev_err, k)
if self.viewer is not None and self.render_poses:
tf.render_pose(target_pos.copy(), self.viewer, label=f"{arm}_p", unique_label=True)
tf.render_pose(target_pose.copy(), self.viewer, label=f"{arm}_t", unique_label=True)
tf.render_pose(curr_pose.copy(), self.viewer, label=f"{arm}", unique_label=True)
grasp_center_pos /= 2.0
u[7] = left_grp_config
u[15] = right_grp_config
u = np.clip(u, self.sim_env.action_space.low, self.sim_env.action_space.high)
self.sim_env._set_action(u)
self.sim.step()
self.sim_env._step_callback()
if self.viewer is not None:
if self.render_poses:
tf.render_pose(grasp_center_pos, self.viewer, label="grasp_center", unique_id=5554)
self.render(keep_markers=True)
if max_pos_err < pos_threshold and max_rot_err < rot_threshold:
break
if count_stable_steps:
obj_pos = self.get_object_pos()
rel_pos = obj_pos - grasp_center_pos
still = prev_rel_pos is not None and np.all(np.abs(rel_pos - prev_rel_pos) < 0.002)
obj_above_table = len(self.sim_env.get_object_contact_points(other_body='table')) == 0
if still and obj_above_table:
stable_steps += 1
elif i > 10:
break
prev_rel_pos = rel_pos
if count_stable_steps:
return stable_steps
return max_pos_err
def _move_arms_mocap(self, *, left_target: np.ndarray, right_target: np.ndarray, left_yaw=0.0, right_yaw=0.0,
pos_threshold=0.02, rot_threshold=0.1, k=1.0, max_steps=1,
left_grp_config=-1.0, right_grp_config=-1.0):
targets = {'l': left_target, 'r': right_target}
yaws = {'l': left_yaw, 'r': right_yaw}
self.sim.model.eq_active[:] = 1
for i in range(max_steps):
grasp_center_pos = np.zeros(3)
max_rot_err = -np.inf
max_pos_err = -np.inf
d_above_table = self.get_object_pos()[2] - self.sim_env._object_z_offset
grp_xrot = 0.9 + d_above_table * 2.0
mocap_a = np.zeros((self.sim.model.nmocap, 7))
for arm_i, arm in enumerate(('l', 'r')):
curr_pose = self.get_gripper_pose(arm)
pitch = np.pi - grp_xrot
target_pos = targets[arm]
target_pose = np.r_[target_pos, tf.rotations.euler2quat(np.r_[0., 0., yaws[arm]])]
target_pose = tf.apply_tf(np.r_[0., 0., 0., tf.rotations.euler2quat(np.r_[pitch, 0., 0.])], target_pose)
grasp_center_pos += curr_pose[:3]
if max_steps > 1:
max_pos_err = max(max_pos_err, np.abs(curr_pose[:3] - target_pose[:3]).max())
max_rot_err = max(max_rot_err, tf.quat_angle_diff(curr_pose[3:], target_pose[3:]))
mocap_a[arm_i] = target_pose - curr_pose
if self.viewer is not None and self.render_poses:
tf.render_pose(target_pos.copy(), self.viewer, label=f"{arm}_p", unique_label=True)
tf.render_pose(target_pose.copy(), self.viewer, label=f"{arm}_t", unique_label=True)
tf.render_pose(curr_pose.copy(), self.viewer, label=f"{arm}", unique_label=True)
grasp_center_pos /= 2.0
# set config of grippers
u = np.zeros(self.sim_env.action_space.shape)
u[7] = left_grp_config
u[15] = right_grp_config
self.sim_env._set_action(u)
# set pose of grippers
_mocap_set_action(self.sim, mocap_a * k)
# take simulation step
self.sim.step()
self.sim_env._step_callback()
if self.viewer is not None:
if self.render_poses:
tf.render_pose(grasp_center_pos, self.viewer, label="grasp_center", unique_id=5554)
self.render(keep_markers=True)
if max_pos_err < pos_threshold and max_rot_err < rot_threshold:
break
|
[
1,
529,
276,
1112,
420,
29958,
4287,
417,
29899,
29914,
29887,
962,
29966,
9507,
29958,
29887,
962,
29914,
264,
4270,
29914,
29891,
15547,
29914,
29891,
15547,
29918,
3075,
22042,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
3509,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
330,
962,
13,
3166,
330,
962,
1053,
8162,
13,
3166,
330,
962,
29889,
264,
4270,
29889,
29891,
15547,
29889,
29891,
15547,
29918,
6272,
1053,
612,
15547,
21745,
29892,
612,
15547,
5398,
13,
3166,
330,
962,
29889,
13239,
1053,
29304,
408,
15886,
13,
3166,
330,
962,
29889,
264,
4270,
29889,
307,
7451,
1199,
29889,
13239,
1053,
10092,
29918,
29885,
542,
481,
29906,
2587,
29918,
29916,
1066,
13,
13,
13,
1753,
903,
28111,
29918,
19244,
29898,
28111,
29918,
29874,
29892,
7306,
29918,
29890,
1125,
13,
1678,
4974,
7306,
29918,
29874,
29889,
12181,
1275,
7306,
29918,
29890,
29889,
12181,
13,
1678,
4974,
7306,
29918,
29874,
29889,
12181,
14352,
29896,
29962,
1275,
29871,
29941,
13,
1678,
19471,
29918,
1066,
353,
7306,
29918,
29874,
29961,
16361,
584,
29941,
29962,
448,
7306,
29918,
29890,
29961,
16361,
584,
29941,
29962,
13,
1678,
270,
29918,
1066,
353,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
4181,
29918,
1066,
29892,
9685,
10457,
29896,
29897,
13,
1678,
736,
270,
29918,
1066,
13,
13,
13,
1753,
903,
29885,
542,
481,
29918,
842,
29918,
2467,
29898,
3601,
29892,
3158,
1125,
13,
1678,
396,
22118,
635,
515,
330,
962,
29889,
264,
4270,
29889,
307,
7451,
1199,
29889,
13239,
13,
1678,
565,
1027,
29889,
4299,
29889,
22882,
542,
481,
1405,
29871,
29900,
29901,
13,
4706,
926,
29918,
4181,
353,
3158,
7503,
29892,
584,
29941,
29962,
13,
4706,
439,
271,
29918,
4181,
353,
3158,
7503,
29892,
29871,
29941,
17531,
13,
4706,
10092,
29918,
29885,
542,
481,
29906,
2587,
29918,
29916,
1066,
29898,
3601,
29897,
13,
4706,
1027,
29889,
1272,
29889,
29885,
542,
481,
29918,
1066,
7503,
29962,
4619,
926,
29918,
4181,
13,
4706,
1027,
29889,
1272,
29889,
29885,
542,
481,
29918,
339,
271,
7503,
29962,
4619,
439,
271,
29918,
4181,
13,
13,
13,
1990,
612,
15547,
14131,
1312,
21745,
29898,
29887,
962,
29889,
8120,
284,
21745,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
29892,
20751,
29918,
1853,
2433,
1145,
344,
742,
13733,
29918,
24220,
29922,
8824,
29892,
23915,
29918,
24220,
29922,
8824,
29892,
5418,
29918,
386,
12268,
29922,
29900,
29889,
29900,
29945,
29892,
13,
462,
4036,
675,
29918,
11228,
29918,
3318,
29918,
1066,
29922,
5574,
29892,
286,
542,
481,
29918,
24220,
29922,
8824,
29892,
4050,
29918,
10590,
29922,
5574,
29892,
13,
462,
1203,
29918,
333,
2433,
9155,
29918,
1884,
742,
3579,
19290,
1125,
13,
4706,
2428,
29898,
29979,
15547,
14131,
1312,
21745,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
1583,
29889,
19635,
353,
426,
13,
9651,
525,
9482,
29889,
1545,
267,
2396,
6024,
26029,
7464,
13,
4706,
500,
13,
13,
4706,
1583,
29889,
3601,
29918,
6272,
353,
612,
15547,
21745,
29898,
13,
9651,
5075,
2433,
20313,
742,
2908,
29918,
29887,
374,
2496,
29922,
8824,
29892,
20751,
29918,
1853,
29922,
276,
1328,
29918,
1853,
29892,
3414,
29922,
29979,
15547,
5398,
29889,
2227,
7077,
29918,
9468,
29918,
7390,
11538,
29918,
14824,
17637,
29892,
13,
9651,
1203,
29918,
333,
29922,
3318,
29918,
333,
29892,
4036,
675,
29918,
11228,
29918,
3318,
29918,
1066,
29922,
8172,
675,
29918,
11228,
29918,
3318,
29918,
1066,
29892,
3579,
19290,
29892,
13,
4706,
1723,
13,
4706,
1583,
29889,
29885,
542,
481,
29918,
24220,
353,
286,
542,
481,
29918,
24220,
13,
4706,
1583,
29889,
276,
1328,
29918,
1853,
353,
20751,
29918,
1853,
13,
4706,
1583,
29889,
19244,
29918,
386,
12268,
353,
5418,
29918,
386,
12268,
13,
4706,
1583,
29889,
9482,
29918,
10590,
353,
4050,
29918,
10590,
13,
4706,
20881,
353,
1583,
3032,
657,
29918,
26290,
580,
13,
13,
4706,
302,
29918,
7387,
353,
29871,
29946,
396,
1320,
1546,
330,
374,
22437,
313,
29896,
29897,
718,
25274,
4818,
926,
19471,
313,
29941,
29897,
13,
4706,
565,
13733,
29918,
24220,
29901,
13,
9651,
302,
29918,
7387,
4619,
29871,
29946,
396,
25274,
4818,
439,
271,
19471,
313,
29946,
29897,
13,
4706,
565,
23915,
29918,
24220,
29901,
13,
9651,
302,
29918,
7387,
4619,
29871,
29906,
396,
396,
1320,
1546,
23915,
29892,
313,
1563,
29892,
1492,
29897,
330,
374,
22437,
313,
29906,
29897,
13,
4706,
1583,
29889,
5450,
362,
29918,
24220,
29918,
17590,
353,
13733,
29918,
24220,
13,
4706,
1583,
29889,
29888,
19936,
29918,
24220,
29918,
17590,
353,
23915,
29918,
24220,
13,
4706,
1583,
29889,
29888,
19936,
29918,
4381,
29918,
517,
29918,
3150,
353,
7700,
13,
13,
4706,
1583,
29889,
2467,
29918,
3493,
353,
8162,
29889,
3313,
6278,
29896,
1696,
29871,
29896,
1696,
8267,
7607,
29876,
29918,
7387,
29892,
511,
26688,
2433,
7411,
29941,
29906,
1495,
13,
4706,
1583,
29889,
26739,
362,
29918,
3493,
353,
8162,
29889,
21533,
29898,
8977,
29898,
13,
9651,
7429,
29918,
28111,
29922,
22854,
29889,
3313,
6278,
9302,
29889,
7192,
29892,
7442,
29889,
7192,
29892,
8267,
29922,
26290,
1839,
496,
6402,
29918,
28111,
13359,
12181,
29892,
26688,
2433,
7411,
29941,
29906,
5477,
13,
9651,
14363,
29918,
28111,
29922,
22854,
29889,
3313,
6278,
9302,
29889,
7192,
29892,
7442,
29889,
7192,
29892,
8267,
29922,
26290,
1839,
496,
6402,
29918,
28111,
13359,
12181,
29892,
26688,
2433,
7411,
29941,
29906,
5477,
13,
9651,
15500,
29922,
22854,
29889,
3313,
6278,
9302,
29889,
7192,
29892,
7442,
29889,
7192,
29892,
8267,
29922,
26290,
1839,
26739,
362,
13359,
12181,
29892,
26688,
2433,
7411,
29941,
29906,
5477,
13,
308,
876,
13,
13,
1678,
396,
13899,
7582,
29879,
13,
1678,
396,
448,
2683,
1378,
5634,
13,
13,
1678,
822,
16523,
29918,
3318,
29918,
2344,
29918,
1066,
29898,
1311,
29892,
926,
29901,
7442,
29889,
299,
2378,
29892,
281,
2273,
29918,
2371,
29922,
8824,
29892,
1286,
29922,
8824,
1125,
13,
4706,
1583,
29889,
3601,
29918,
6272,
29889,
16593,
29918,
3318,
29918,
2344,
29918,
1066,
29898,
1066,
29892,
281,
2273,
29918,
2371,
29922,
29893,
2273,
29918,
2371,
29892,
1286,
29922,
3707,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
6316,
556,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3601,
29918,
6272,
29889,
29894,
15580,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1027,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3601,
29918,
6272,
29889,
3601,
13,
13,
1678,
732,
6799,
13,
1678,
822,
7442,
29918,
8172,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3601,
29918,
6272,
29889,
9302,
29918,
8172,
13,
13,
1678,
822,
903,
657,
29918,
3318,
29918,
2311,
29898,
1311,
1125,
13,
4706,
23216,
353,
1583,
29889,
3601,
29889,
4299,
29889,
479,
290,
29918,
978,
29906,
333,
877,
3318,
29900,
29918,
3188,
1495,
13,
4706,
736,
1583,
29889,
3601,
29889,
4299,
29889,
479,
290,
29918,
2311,
29961,
479,
290,
1822,
8552,
580,
13,
13,
1678,
822,
679,
29918,
3318,
29918,
4220,
29898,
1311,
1125,
13,
4706,
736,
7442,
29889,
29878,
29918,
29961,
13,
9651,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2587,
29918,
29916,
1066,
877,
3318,
29900,
5477,
13,
9651,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2587,
29918,
29916,
339,
271,
877,
3318,
29900,
5477,
13,
4706,
4514,
13,
13,
1678,
822,
679,
29918,
3318,
29918,
1066,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2587,
29918,
29916,
1066,
877,
3318,
29900,
2824,
8552,
580,
13,
13,
1678,
822,
679,
29918,
3318,
29918,
5450,
29898,
1311,
1125,
13,
4706,
736,
15886,
29889,
5450,
800,
29889,
2922,
29906,
29872,
8584,
29898,
1311,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2746,
29918,
29916,
2922,
877,
3318,
29900,
29901,
5064,
8785,
13,
13,
1678,
822,
679,
29918,
3318,
29918,
955,
29886,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2746,
29918,
29916,
955,
29886,
877,
3318,
29900,
29901,
5064,
1495,
334,
1583,
29889,
3601,
29918,
6272,
29889,
6008,
13,
13,
1678,
822,
679,
29918,
3318,
29918,
955,
29878,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2746,
29918,
29916,
955,
29878,
877,
3318,
29900,
29901,
5064,
1495,
334,
1583,
29889,
3601,
29918,
6272,
29889,
6008,
13,
13,
1678,
822,
679,
29918,
29887,
374,
2496,
29918,
4220,
29898,
1311,
29892,
5075,
1125,
13,
4706,
4974,
5075,
297,
6702,
29880,
742,
525,
29878,
1495,
13,
4706,
736,
7442,
29889,
29878,
29918,
29961,
13,
9651,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2746,
29918,
29916,
1066,
29898,
29888,
29915,
29887,
374,
2496,
648,
2817,
2403,
5064,
5477,
13,
9651,
15886,
29889,
5450,
800,
29889,
2922,
29906,
339,
271,
29898,
1311,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2746,
29918,
29916,
2922,
29898,
29888,
29915,
29887,
374,
2496,
648,
2817,
2403,
5064,
1495,
511,
13,
4706,
4514,
13,
13,
1678,
822,
679,
29918,
29887,
374,
2496,
29918,
1066,
29898,
1311,
29892,
5075,
1125,
13,
4706,
4974,
5075,
297,
6702,
29880,
742,
525,
29878,
1495,
13,
4706,
736,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2746,
29918,
29916,
1066,
29898,
29888,
29915,
29887,
374,
2496,
648,
2817,
2403,
5064,
2824,
8552,
580,
13,
13,
1678,
822,
679,
29918,
29887,
374,
2496,
29918,
955,
29886,
29898,
1311,
29892,
5075,
1125,
13,
4706,
4974,
5075,
297,
6702,
29880,
742,
525,
29878,
1495,
13,
4706,
736,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2746,
29918,
29916,
955,
29886,
29898,
29888,
29915,
29887,
374,
2496,
648,
2817,
2403,
5064,
1495,
334,
1583,
29889,
3601,
29918,
6272,
29889,
6008,
13,
13,
1678,
822,
679,
29918,
629,
4692,
29918,
5064,
29918,
1066,
29898,
1311,
1125,
13,
4706,
736,
313,
1311,
29889,
657,
29918,
29887,
374,
2496,
29918,
1066,
877,
29880,
1495,
718,
1583,
29889,
657,
29918,
29887,
374,
2496,
29918,
1066,
877,
29878,
8785,
847,
29871,
29906,
29889,
29900,
13,
13,
1678,
822,
679,
29918,
629,
4692,
29918,
5064,
29918,
955,
29886,
29898,
1311,
1125,
13,
4706,
736,
313,
1311,
29889,
657,
29918,
29887,
374,
2496,
29918,
955,
29886,
877,
29880,
1495,
718,
1583,
29889,
657,
29918,
29887,
374,
2496,
29918,
955,
29886,
877,
29878,
8785,
847,
29871,
29906,
29889,
29900,
13,
13,
1678,
822,
679,
29918,
2817,
29918,
2917,
29898,
1311,
29892,
5075,
1125,
13,
4706,
565,
5075,
1275,
525,
29880,
2396,
13,
9651,
22645,
353,
1583,
29889,
3601,
29918,
6272,
3032,
2817,
29918,
29880,
29918,
12090,
29918,
13140,
13,
4706,
1683,
29901,
13,
9651,
22645,
353,
1583,
29889,
3601,
29918,
6272,
3032,
2817,
29918,
29878,
29918,
12090,
29918,
13140,
13,
4706,
736,
1583,
29889,
3601,
29889,
1272,
29889,
29939,
1066,
29961,
13140,
1822,
8552,
580,
13,
13,
1678,
822,
679,
29918,
7662,
29918,
3493,
29898,
1311,
1125,
13,
4706,
5446,
29918,
13471,
353,
1583,
3032,
657,
29918,
3318,
29918,
2311,
580,
29961,
29900,
29962,
13,
4706,
736,
7442,
29889,
29878,
29918,
29961,
5415,
29918,
13471,
29930,
29896,
29889,
29900,
29892,
5446,
29918,
13471,
29930,
29896,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29941,
29962,
13,
13,
1678,
822,
338,
29918,
3318,
29918,
265,
29918,
2057,
29898,
1311,
1125,
13,
4706,
5446,
29918,
4220,
353,
1583,
29889,
657,
29918,
3318,
29918,
1066,
580,
13,
4706,
736,
5446,
29918,
4220,
29961,
29906,
29962,
529,
29871,
29900,
29889,
29900,
13,
13,
1678,
822,
338,
29918,
3318,
29918,
348,
276,
496,
519,
29898,
1311,
1125,
13,
4706,
5446,
29918,
4220,
353,
1583,
29889,
657,
29918,
3318,
29918,
1066,
580,
13,
4706,
736,
451,
313,
13,
9651,
8521,
29900,
29889,
29896,
29945,
529,
5446,
29918,
4220,
29961,
29900,
29962,
529,
29871,
29900,
29889,
29896,
29945,
29897,
13,
9651,
322,
8521,
29900,
29889,
29896,
29945,
529,
5446,
29918,
4220,
29961,
29896,
29962,
529,
29871,
29900,
29889,
29896,
29945,
29897,
13,
9651,
322,
8521,
29900,
29889,
29900,
29896,
529,
5446,
29918,
4220,
29961,
29906,
29962,
529,
29871,
29900,
29889,
29946,
29945,
29897,
13,
4706,
1723,
13,
13,
1678,
822,
679,
29918,
2371,
29918,
7610,
2161,
29918,
4220,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3601,
29918,
6272,
29889,
657,
29918,
2371,
29918,
7610,
2161,
29918,
4220,
580,
13,
13,
1678,
822,
903,
348,
4058,
29918,
2467,
29898,
1311,
29892,
3158,
1125,
13,
4706,
1320,
29918,
14811,
29918,
29887,
374,
22437,
353,
3158,
29961,
29900,
29962,
13,
4706,
25274,
29918,
5064,
29918,
1066,
29918,
4181,
353,
3158,
29961,
29896,
29901,
29946,
29962,
13,
4706,
9210,
353,
29871,
29946,
13,
13,
4706,
565,
1583,
29889,
5450,
362,
29918,
24220,
29918,
17590,
29901,
13,
9651,
25274,
29918,
5064,
29918,
339,
271,
29918,
4181,
353,
3158,
29961,
10289,
29901,
10289,
29974,
29946,
29962,
13,
9651,
9210,
4619,
29871,
29946,
13,
4706,
1683,
29901,
13,
9651,
25274,
29918,
5064,
29918,
339,
271,
29918,
4181,
353,
7442,
29889,
29878,
29918,
29961,
29896,
1696,
29871,
29900,
1696,
29871,
29900,
1696,
29871,
29900,
5586,
13,
13,
4706,
565,
1583,
29889,
29888,
19936,
29918,
24220,
29918,
17590,
29901,
13,
9651,
301,
29918,
29888,
19936,
29918,
24220,
29892,
364,
29918,
29888,
19936,
29918,
24220,
353,
3158,
29961,
10289,
29901,
10289,
29974,
29906,
29962,
13,
4706,
1683,
29901,
13,
9651,
301,
29918,
29888,
19936,
29918,
24220,
353,
364,
29918,
29888,
19936,
29918,
24220,
353,
448,
29896,
29889,
565,
1583,
29889,
29888,
19936,
29918,
4381,
29918,
517,
29918,
3150,
1683,
29871,
29896,
29889,
13,
13,
4706,
736,
313,
13,
9651,
1320,
29918,
14811,
29918,
29887,
374,
22437,
29892,
25274,
29918,
5064,
29918,
1066,
29918,
4181,
29892,
13,
9651,
25274,
29918,
5064,
29918,
339,
271,
29918,
4181,
29892,
301,
29918,
29888,
19936,
29918,
24220,
29892,
364,
29918,
29888,
19936,
29918,
24220,
13,
4706,
1723,
13,
13,
1678,
822,
903,
12071,
29898,
1311,
1125,
13,
13,
4706,
3855,
1066,
353,
7442,
29889,
29878,
29918,
29961,
13,
632,
29900,
29889,
29945,
29941,
29941,
29896,
29892,
29871,
29900,
29889,
29900,
29946,
29953,
29892,
29871,
29900,
29889,
29941,
29896,
29946,
29947,
29892,
448,
29900,
29889,
29900,
29906,
29900,
29953,
29892,
448,
29900,
29889,
29947,
29929,
29929,
29929,
29892,
29871,
29896,
29889,
29900,
29947,
29929,
29947,
29892,
448,
29906,
29889,
29896,
29900,
29906,
29946,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29900,
29900,
29906,
29892,
448,
29900,
29889,
29900,
29947,
29955,
29945,
29892,
29871,
29900,
29889,
29900,
29906,
29947,
29947,
29892,
448,
29900,
29889,
29953,
29955,
29953,
29896,
29892,
13,
632,
29900,
29889,
29900,
29896,
29929,
29953,
29892,
29871,
29900,
29889,
29947,
29946,
29896,
29892,
29871,
29896,
29889,
29900,
29900,
29896,
29906,
29892,
448,
29900,
29889,
29929,
29945,
29947,
29945,
29892,
448,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29900,
29900,
29896,
29892,
29871,
29900,
29889,
29900,
29906,
29945,
29892,
29871,
29900,
29889,
29900,
29906,
29945,
29892,
29871,
29900,
29889,
29900,
29941,
29892,
29871,
29896,
29889,
29900,
29892,
448,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
13,
4706,
4514,
13,
13,
4706,
565,
1583,
29889,
3601,
29918,
6272,
29889,
5349,
29918,
5450,
1218,
29918,
12120,
29901,
13,
9651,
3855,
1066,
353,
7442,
29889,
29878,
29918,
14352,
29900,
29889,
29955,
29945,
29892,
3855,
1066,
29962,
13,
13,
4706,
3855,
955,
353,
7442,
29889,
3298,
359,
29918,
4561,
29898,
1311,
29889,
3601,
29918,
6272,
29889,
2344,
29918,
29939,
955,
29897,
13,
13,
4706,
1583,
29889,
3601,
29889,
1272,
29889,
24220,
7503,
29962,
353,
29871,
29900,
29889,
29900,
13,
4706,
1583,
29889,
3601,
29918,
6272,
3032,
842,
29918,
3601,
29918,
3859,
29898,
29939,
1066,
29892,
3855,
955,
29897,
13,
13,
4706,
1203,
29918,
29939,
1066,
353,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
12090,
29918,
29939,
1066,
877,
3318,
29900,
29901,
12090,
2824,
8552,
580,
13,
4706,
1583,
29889,
3601,
29918,
6272,
3032,
3318,
29918,
3594,
29918,
1066,
29918,
517,
29918,
16593,
353,
1583,
29889,
9302,
29918,
8172,
29889,
29590,
10456,
1311,
29889,
3601,
29918,
6272,
3032,
5415,
29918,
2344,
29918,
23687,
29897,
13,
4706,
565,
1583,
29889,
3601,
29918,
6272,
29889,
5349,
29918,
5450,
1218,
29918,
12120,
29901,
13,
9651,
1203,
29918,
29939,
1066,
29961,
29906,
29962,
4619,
29871,
29900,
29889,
29900,
29906,
29900,
13,
9651,
1203,
29918,
29939,
1066,
7503,
29906,
29962,
353,
1583,
29889,
3601,
29889,
1272,
29889,
657,
29918,
2746,
29918,
29916,
1066,
877,
5450,
1218,
29918,
12120,
29901,
15641,
29918,
355,
1495,
7503,
29906,
29962,
13,
4706,
25342,
1583,
29889,
3601,
29918,
6272,
29889,
5349,
29918,
3092,
29901,
13,
9651,
1203,
29918,
29939,
1066,
7503,
29906,
29962,
353,
29871,
29900,
29889,
29941,
29955,
29945,
29892,
448,
29900,
29889,
29946,
29955,
29953,
13,
4706,
25342,
1583,
29889,
3601,
29918,
6272,
29889,
8172,
675,
29918,
11228,
29918,
3318,
29918,
1066,
29901,
13,
9651,
396,
16968,
675,
2847,
2602,
310,
1203,
29889,
13,
9651,
1203,
29918,
29939,
1066,
7503,
29906,
29962,
353,
1583,
29889,
3601,
29918,
6272,
3032,
3318,
29918,
3594,
29918,
1066,
29918,
517,
29918,
16593,
29889,
8552,
580,
13,
4706,
1583,
29889,
3601,
29889,
1272,
29889,
842,
29918,
12090,
29918,
29939,
1066,
877,
3318,
29900,
29901,
12090,
742,
1203,
29918,
29939,
1066,
29897,
13,
13,
4706,
1583,
29889,
3601,
29918,
6272,
3032,
12071,
29918,
3092,
580,
13,
13,
1678,
396,
1174,
29894,
3519,
13,
1678,
396,
448,
2683,
1378,
5634,
13,
13,
1678,
822,
16717,
29898,
1311,
29892,
16717,
29922,
8516,
1125,
13,
4706,
1583,
29889,
3601,
29918,
6272,
29889,
26776,
29898,
26776,
29897,
13,
13,
1678,
822,
4331,
29898,
1311,
29892,
3158,
29901,
7442,
29889,
299,
2378,
1125,
13,
13,
4706,
3158,
353,
7442,
29889,
24049,
29898,
2467,
29892,
1583,
29889,
2467,
29918,
3493,
29889,
677,
29892,
1583,
29889,
2467,
29918,
3493,
29889,
9812,
29897,
13,
13,
4706,
313,
5721,
29918,
14811,
29918,
29887,
374,
22437,
29892,
25274,
29918,
5064,
29918,
1066,
29918,
4181,
29892,
13,
308,
25274,
29918,
5064,
29918,
339,
271,
29918,
4181,
29892,
301,
29918,
29888,
19936,
29918,
24220,
29892,
364,
29918,
29888,
19936,
29918,
24220,
29897,
353,
1583,
3032,
348,
4058,
29918,
2467,
29898,
2467,
29897,
13,
13,
4706,
565,
1583,
29889,
29885,
542,
481,
29918,
24220,
29901,
13,
9651,
926,
29918,
29895,
353,
29871,
29900,
29889,
29896,
13,
9651,
1320,
29918,
3881,
353,
518,
29900,
29889,
29900,
29945,
29892,
29871,
29900,
29889,
29906,
29900,
29962,
13,
4706,
1683,
29901,
13,
9651,
926,
29918,
29895,
353,
29871,
29900,
29889,
29906,
13,
9651,
1320,
29918,
3881,
353,
518,
29900,
29889,
29900,
29945,
29892,
29871,
29900,
29889,
29941,
29900,
29962,
13,
13,
4706,
1320,
29918,
14811,
29918,
29887,
374,
22437,
353,
7442,
29889,
1639,
29886,
29898,
5721,
29918,
14811,
29918,
29887,
374,
22437,
29892,
21069,
29896,
29892,
29871,
29896,
1402,
1320,
29918,
3881,
29897,
13,
13,
4706,
16256,
29918,
629,
4692,
29918,
5064,
29918,
4220,
353,
1583,
29889,
657,
29918,
629,
4692,
29918,
5064,
29918,
1066,
580,
396,
14402,
29901,
4803,
18593,
3265,
1135,
2602,
871,
13,
4706,
3646,
29918,
629,
4692,
29918,
5064,
29918,
4220,
353,
7442,
29889,
29878,
29918,
29961,
29900,
1696,
29871,
29900,
1696,
29871,
29900,
1696,
29871,
29896,
1696,
29871,
29900,
1696,
29871,
29900,
1696,
29871,
29900,
5586,
13,
13,
4706,
3646,
29918,
629,
4692,
29918,
5064,
29918,
4220,
7503,
29941,
29962,
353,
16256,
29918,
629,
4692,
29918,
5064,
29918,
4220,
7503,
29941,
29962,
718,
25274,
29918,
5064,
29918,
1066,
29918,
4181,
334,
926,
29918,
29895,
13,
4706,
565,
1583,
29889,
5450,
362,
29918,
24220,
29918,
17590,
29901,
13,
9651,
396,
3646,
29918,
629,
4692,
29918,
5064,
29918,
4220,
29961,
29941,
17531,
353,
16256,
29918,
629,
4692,
29918,
5064,
29918,
4220,
29961,
29941,
17531,
718,
25274,
29918,
5064,
29918,
339,
271,
29918,
4181,
334,
29871,
29900,
29889,
29896,
13,
9651,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
4706,
330,
374,
22437,
29918,
1066,
29918,
5182,
29879,
353,
7442,
29889,
2378,
4197,
13,
9651,
15886,
29889,
7302,
29918,
13264,
29898,
9302,
29889,
29878,
29918,
29961,
29900,
1696,
1320,
29918,
14811,
29918,
29887,
374,
22437,
29914,
29906,
29889,
29900,
29892,
29871,
29900,
1696,
29871,
29896,
1696,
29871,
29900,
1696,
29871,
29900,
1696,
29871,
29900,
29889,
1402,
3646,
29918,
629,
4692,
29918,
5064,
29918,
4220,
29897,
7503,
29941,
1402,
13,
9651,
15886,
29889,
7302,
29918,
13264,
29898,
9302,
29889,
29878,
29918,
29961,
29900,
1696,
448,
5721,
29918,
14811,
29918,
29887,
374,
22437,
29914,
29906,
29889,
29900,
29892,
29871,
29900,
1696,
29871,
29896,
1696,
29871,
29900,
1696,
29871,
29900,
1696,
29871,
29900,
29889,
1402,
3646,
29918,
629,
4692,
29918,
5064,
29918,
4220,
29897,
7503,
29941,
29962,
13,
308,
2314,
13,
13,
4706,
9649,
353,
330,
374,
22437,
29918,
1066,
29918,
5182,
29879,
29961,
29900,
29892,
584,
29906,
29962,
448,
330,
374,
22437,
29918,
1066,
29918,
5182,
29879,
29961,
29896,
29892,
584,
29906,
29962,
13,
4706,
1492,
29918,
29891,
1450,
353,
7442,
29889,
27014,
273,
29906,
29898,
2003,
29961,
29896,
1402,
9649,
29961,
29900,
2314,
718,
7442,
29889,
1631,
29914,
29906,
13,
4706,
2175,
29918,
29891,
1450,
353,
7442,
29889,
27014,
273,
29906,
6278,
2003,
29961,
29896,
1402,
448,
2003,
29961,
29900,
2314,
718,
7442,
29889,
1631,
29914,
29906,
13,
13,
4706,
25274,
29918,
13471,
353,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
2003,
29892,
4356,
29922,
29906,
29897,
847,
29871,
29906,
29889,
29900,
13,
4706,
4974,
7442,
29889,
497,
5358,
29898,
629,
4692,
29918,
13471,
29892,
1320,
29918,
14811,
29918,
29887,
374,
22437,
847,
29871,
29906,
29889,
29900,
29897,
13,
13,
4706,
565,
1583,
29889,
29885,
542,
481,
29918,
24220,
29901,
13,
9651,
1583,
3032,
11631,
29918,
279,
1516,
29918,
29885,
542,
481,
29898,
13,
18884,
2175,
29918,
5182,
29922,
29887,
374,
22437,
29918,
1066,
29918,
5182,
29879,
29961,
29900,
1402,
2175,
29918,
29891,
1450,
29922,
1563,
29918,
29891,
1450,
29892,
13,
18884,
1492,
29918,
5182,
29922,
29887,
374,
22437,
29918,
1066,
29918,
5182,
29879,
29961,
29896,
1402,
1492,
29918,
29891,
1450,
29922,
1266,
29918,
29891,
1450,
29892,
13,
18884,
2175,
29918,
629,
29886,
29918,
2917,
29922,
29880,
29918,
29888,
19936,
29918,
24220,
29892,
1492,
29918,
629,
29886,
29918,
2917,
29922,
29878,
29918,
29888,
19936,
29918,
24220,
29892,
4236,
29918,
24530,
29922,
29896,
29892,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
1583,
3032,
11631,
29918,
279,
1516,
29898,
13,
18884,
2175,
29918,
5182,
29922,
29887,
374,
22437,
29918,
1066,
29918,
5182,
29879,
29961,
29900,
1402,
2175,
29918,
29891,
1450,
29922,
1563,
29918,
29891,
1450,
29892,
13,
18884,
1492,
29918,
5182,
29922,
29887,
374,
22437,
29918,
1066,
29918,
5182,
29879,
29961,
29896,
1402,
1492,
29918,
29891,
1450,
29922,
1266,
29918,
29891,
1450,
29892,
13,
18884,
2175,
29918,
629,
29886,
29918,
2917,
29922,
29880,
29918,
29888,
19936,
29918,
24220,
29892,
1492,
29918,
629,
29886,
29918,
2917,
29922,
29878,
29918,
29888,
19936,
29918,
24220,
29892,
4236,
29918,
24530,
29922,
29945,
29892,
13,
9651,
1723,
13,
13,
4706,
20881,
353,
1583,
3032,
657,
29918,
26290,
580,
13,
4706,
2309,
353,
7700,
396,
1583,
29889,
275,
29918,
3318,
29918,
348,
276,
496,
519,
580,
13,
4706,
5235,
353,
11117,
275,
29918,
8698,
2396,
1583,
3032,
275,
29918,
8698,
29898,
26290,
1839,
496,
6402,
29918,
28111,
7464,
1583,
29889,
28111,
2915,
13,
4706,
20751,
353,
1583,
29889,
26017,
29918,
276,
1328,
29898,
26290,
1839,
496,
6402,
29918,
28111,
7464,
1583,
29889,
28111,
29892,
5235,
29897,
13,
4706,
736,
20881,
29892,
20751,
29892,
2309,
29892,
5235,
13,
13,
1678,
822,
4050,
29898,
1311,
29892,
4464,
2433,
26029,
742,
3013,
29918,
3502,
414,
29922,
8824,
29892,
15552,
29890,
29918,
6768,
29922,
8516,
1125,
13,
4706,
29320,
353,
5159,
13,
4706,
565,
3013,
29918,
3502,
414,
29901,
13,
9651,
29320,
353,
3509,
29889,
24535,
8552,
29898,
1311,
29889,
29894,
15580,
3032,
3502,
414,
29897,
13,
4706,
620,
353,
1583,
29889,
3601,
29918,
6272,
29889,
9482,
29898,
8513,
29922,
8513,
29892,
15552,
29890,
29918,
6768,
29922,
23973,
29918,
6768,
29897,
13,
4706,
363,
286,
297,
29320,
29901,
13,
9651,
1583,
29889,
29894,
15580,
29889,
1202,
29918,
22976,
29898,
1068,
29885,
29897,
13,
4706,
736,
620,
13,
13,
1678,
822,
10092,
29898,
1311,
1125,
13,
4706,
1583,
3032,
12071,
580,
13,
4706,
1583,
29889,
3601,
29918,
6272,
29889,
28111,
353,
1583,
3032,
11249,
29918,
28111,
2141,
8552,
580,
13,
4706,
1583,
29889,
3601,
29889,
10568,
580,
13,
4706,
736,
1583,
3032,
657,
29918,
26290,
580,
13,
13,
1678,
396,
2921,
284,
21745,
3519,
13,
1678,
396,
448,
2683,
1378,
5634,
13,
13,
1678,
732,
6799,
13,
1678,
822,
7306,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3601,
29918,
6272,
29889,
28111,
7503,
29941,
29962,
13,
13,
1678,
822,
903,
11249,
29918,
28111,
29898,
1311,
1125,
13,
4706,
716,
29918,
28111,
353,
1583,
29889,
3601,
29918,
6272,
3032,
11249,
29918,
28111,
580,
13,
4706,
736,
716,
29918,
28111,
13,
13,
1678,
822,
10272,
29918,
276,
1328,
29898,
1311,
29892,
14363,
29918,
28111,
29901,
7442,
29889,
299,
2378,
29892,
7306,
29901,
7442,
29889,
299,
2378,
29892,
5235,
29901,
9657,
1125,
13,
4706,
565,
1583,
29889,
276,
1328,
29918,
1853,
1275,
525,
29879,
5510,
2396,
13,
9651,
2551,
353,
1583,
3032,
275,
29918,
8698,
29898,
496,
6402,
29918,
28111,
29892,
7306,
467,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
9651,
736,
2551,
448,
29871,
29896,
29889,
13,
4706,
1683,
29901,
13,
9651,
270,
353,
903,
28111,
29918,
19244,
29898,
496,
6402,
29918,
28111,
29892,
7306,
29897,
13,
9651,
736,
448,
29881,
13,
13,
1678,
822,
903,
275,
29918,
8698,
29898,
1311,
29892,
14363,
29918,
28111,
29901,
7442,
29889,
299,
2378,
29892,
7429,
29918,
28111,
29901,
7442,
29889,
299,
2378,
1125,
13,
4706,
270,
353,
903,
28111,
29918,
19244,
29898,
496,
6402,
29918,
28111,
29892,
7429,
29918,
28111,
29897,
13,
4706,
736,
313,
29881,
529,
1583,
29889,
19244,
29918,
386,
12268,
467,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
13,
1678,
822,
903,
657,
29918,
26290,
29898,
1311,
1125,
13,
13,
4706,
565,
1583,
29889,
3601,
29918,
6272,
29889,
275,
29918,
2139,
292,
29918,
3092,
7295,
13,
9651,
1583,
29889,
3601,
29918,
6272,
3032,
18361,
29918,
2139,
29918,
3092,
580,
13,
13,
4706,
330,
374,
22437,
29918,
1066,
353,
7442,
29889,
29878,
29918,
29961,
1311,
29889,
657,
29918,
29887,
374,
2496,
29918,
1066,
877,
29880,
5477,
1583,
29889,
657,
29918,
29887,
374,
2496,
29918,
1066,
877,
29878,
1495,
29962,
13,
4706,
330,
374,
22437,
29918,
955,
29886,
353,
7442,
29889,
29878,
29918,
29961,
1311,
29889,
657,
29918,
29887,
374,
2496,
29918,
955,
29886,
877,
29880,
5477,
1583,
29889,
657,
29918,
29887,
374,
2496,
29918,
955,
29886,
877,
29878,
1495,
29962,
13,
13,
4706,
25274,
29918,
5064,
29918,
1066,
353,
1583,
29889,
657,
29918,
629,
4692,
29918,
5064,
29918,
1066,
580,
13,
4706,
25274,
29918,
5064,
29918,
955,
29886,
353,
1583,
29889,
657,
29918,
629,
4692,
29918,
5064,
29918,
955,
29886,
580,
13,
4706,
1203,
29918,
1066,
353,
1583,
29889,
657,
29918,
3318,
29918,
1066,
580,
13,
4706,
1203,
29918,
5450,
353,
1583,
29889,
657,
29918,
3318,
29918,
5450,
580,
13,
4706,
1203,
29918,
955,
29886,
353,
1583,
29889,
657,
29918,
3318,
29918,
955,
29886,
580,
13,
4706,
1203,
29918,
955,
29878,
353,
1583,
29889,
657,
29918,
3318,
29918,
955,
29878,
580,
13,
13,
4706,
1203,
29918,
2674,
29918,
1066,
353,
1203,
29918,
1066,
448,
25274,
29918,
5064,
29918,
1066,
13,
4706,
1203,
29918,
955,
29886,
22361,
25274,
29918,
5064,
29918,
955,
29886,
13,
13,
4706,
14363,
29918,
28111,
353,
1203,
29918,
1066,
29889,
8552,
580,
13,
13,
4706,
20881,
353,
7442,
29889,
29878,
29918,
29961,
13,
9651,
25274,
29918,
5064,
29918,
1066,
29892,
25274,
29918,
5064,
29918,
955,
29886,
29892,
330,
374,
22437,
29918,
1066,
29892,
330,
374,
22437,
29918,
955,
29886,
29892,
13,
9651,
1203,
29918,
1066,
29892,
1203,
29918,
5450,
29892,
1203,
29918,
2674,
29918,
1066,
29892,
1203,
29918,
955,
29886,
29892,
1203,
29918,
955,
29878,
13,
4706,
4514,
13,
13,
4706,
736,
9657,
29898,
13,
9651,
15500,
29922,
26290,
29892,
13,
9651,
14363,
29918,
28111,
29922,
496,
6402,
29918,
28111,
29892,
13,
9651,
7429,
29918,
28111,
29922,
1311,
29889,
28111,
29889,
8552,
3285,
13,
4706,
1723,
13,
13,
1678,
396,
8481,
2761,
13,
1678,
396,
448,
2683,
1378,
5634,
13,
13,
1678,
822,
903,
8299,
29898,
1311,
29892,
1059,
29892,
12379,
29918,
2704,
29892,
413,
1125,
13,
4706,
565,
7442,
29889,
497,
29898,
16304,
29918,
2704,
1275,
29871,
29900,
29889,
29900,
1125,
13,
9651,
270,
29918,
3127,
353,
29871,
29900,
29889,
29900,
13,
4706,
1683,
29901,
13,
9651,
270,
29918,
3127,
353,
313,
2704,
448,
12379,
29918,
2704,
29897,
847,
1583,
29889,
3601,
29918,
6272,
29889,
6008,
13,
4706,
12379,
29918,
2704,
7503,
29962,
353,
1059,
13,
4706,
736,
19691,
29896,
29889,
29900,
334,
1059,
718,
29871,
29900,
29889,
29900,
29945,
334,
270,
29918,
3127,
29897,
334,
413,
13,
13,
1678,
822,
903,
11631,
29918,
279,
1516,
29898,
1311,
29892,
334,
29892,
2175,
29918,
5182,
29901,
7442,
29889,
299,
2378,
29892,
1492,
29918,
5182,
29901,
7442,
29889,
299,
2378,
29892,
2175,
29918,
29891,
1450,
29922,
29900,
29889,
29900,
29892,
1492,
29918,
29891,
1450,
29922,
29900,
29889,
29900,
29892,
13,
462,
259,
926,
29918,
386,
12268,
29922,
29900,
29889,
29900,
29906,
29892,
5731,
29918,
386,
12268,
29922,
29900,
29889,
29896,
29892,
413,
29922,
29906,
29889,
29900,
29892,
4236,
29918,
24530,
29922,
29896,
29900,
29900,
29892,
2302,
29918,
13844,
29918,
24530,
29922,
8824,
29892,
13,
462,
259,
22525,
29918,
22925,
29918,
517,
29922,
8516,
29892,
2175,
29918,
629,
29886,
29918,
2917,
10457,
29896,
29889,
29900,
29892,
1492,
29918,
629,
29886,
29918,
2917,
10457,
29896,
29889,
29900,
1125,
13,
13,
4706,
22525,
353,
11117,
29880,
2396,
2175,
29918,
5182,
29892,
525,
29878,
2396,
1492,
29918,
5182,
29913,
13,
4706,
343,
10467,
353,
11117,
29880,
2396,
2175,
29918,
29891,
1450,
29892,
525,
29878,
2396,
1492,
29918,
29891,
1450,
29913,
13,
4706,
13714,
29918,
24530,
353,
29871,
29900,
13,
4706,
12379,
29918,
2674,
29918,
1066,
353,
7442,
29889,
3298,
359,
29898,
29941,
29897,
13,
4706,
318,
353,
7442,
29889,
3298,
359,
29898,
1311,
29889,
3601,
29918,
6272,
29889,
2467,
29918,
3493,
29889,
12181,
29897,
13,
4706,
12379,
29918,
3127,
29918,
29880,
353,
7442,
29889,
3298,
359,
29898,
29955,
29897,
13,
4706,
12379,
29918,
3127,
29918,
29878,
353,
7442,
29889,
3298,
359,
29898,
29955,
29897,
13,
4706,
4236,
29918,
1066,
29918,
3127,
353,
448,
9302,
29889,
7192,
13,
13,
4706,
363,
474,
297,
3464,
29898,
3317,
29918,
24530,
1125,
13,
13,
9651,
25274,
29918,
5064,
29918,
1066,
353,
7442,
29889,
3298,
359,
29898,
29941,
29897,
13,
9651,
4236,
29918,
5450,
29918,
3127,
353,
448,
9302,
29889,
7192,
13,
9651,
4236,
29918,
1066,
29918,
3127,
353,
448,
9302,
29889,
7192,
13,
13,
9651,
270,
29918,
27215,
29918,
2371,
353,
1583,
29889,
657,
29918,
3318,
29918,
1066,
580,
29961,
29906,
29962,
448,
1583,
29889,
3601,
29918,
6272,
3032,
3318,
29918,
29920,
29918,
10289,
13,
9651,
867,
29886,
29918,
29916,
5450,
353,
29871,
29900,
29889,
29929,
718,
270,
29918,
27215,
29918,
2371,
334,
29871,
29906,
29889,
29900,
13,
13,
9651,
363,
5075,
29918,
29875,
29892,
5075,
297,
26985,
29898,
877,
29880,
742,
525,
29878,
8785,
29901,
13,
13,
18884,
16256,
29918,
4220,
353,
1583,
29889,
657,
29918,
29887,
374,
2496,
29918,
4220,
29898,
2817,
29897,
13,
18884,
16256,
29918,
29939,
353,
1583,
29889,
657,
29918,
2817,
29918,
2917,
29898,
2817,
29897,
13,
13,
18884,
565,
5075,
1275,
525,
29880,
2396,
13,
462,
1678,
15905,
353,
7442,
29889,
1631,
448,
867,
29886,
29918,
29916,
5450,
13,
462,
1678,
318,
29918,
13168,
287,
353,
318,
7503,
29955,
29962,
13,
462,
1678,
12379,
29918,
3127,
353,
12379,
29918,
3127,
29918,
29880,
13,
18884,
1683,
29901,
13,
462,
1678,
15905,
353,
7442,
29889,
1631,
448,
867,
29886,
29918,
29916,
5450,
13,
462,
1678,
318,
29918,
13168,
287,
353,
318,
29961,
29947,
29901,
29896,
29945,
29962,
13,
462,
1678,
12379,
29918,
3127,
353,
12379,
29918,
3127,
29918,
29878,
13,
13,
18884,
565,
1246,
519,
29898,
5182,
29879,
29918,
22925,
29918,
517,
1125,
13,
462,
1678,
3407,
353,
22525,
29918,
22925,
29918,
517,
580,
13,
462,
1678,
3646,
29918,
1066,
353,
15886,
29889,
7302,
29918,
13264,
29898,
5182,
29879,
29961,
2817,
1402,
3407,
29897,
7503,
29941,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
3646,
29918,
1066,
353,
22525,
29961,
2817,
29962,
13,
13,
18884,
3646,
29918,
4220,
353,
7442,
29889,
29878,
29918,
29961,
5182,
29918,
1066,
29892,
15886,
29889,
5450,
800,
29889,
29872,
8584,
29906,
339,
271,
29898,
9302,
29889,
29878,
29918,
29961,
29900,
1696,
29871,
29900,
1696,
343,
10467,
29961,
2817,
24960,
29962,
13,
18884,
3646,
29918,
4220,
353,
15886,
29889,
7302,
29918,
13264,
29898,
9302,
29889,
29878,
29918,
29961,
29900,
1696,
29871,
29900,
1696,
29871,
29900,
1696,
15886,
29889,
5450,
800,
29889,
29872,
8584,
29906,
339,
271,
29898,
9302,
29889,
29878,
29918,
29961,
29886,
2335,
29892,
29871,
29900,
1696,
29871,
29900,
29889,
2314,
1402,
3646,
29918,
4220,
29897,
13,
13,
18884,
25274,
29918,
5064,
29918,
1066,
4619,
16256,
29918,
4220,
7503,
29941,
29962,
13,
18884,
4236,
29918,
1066,
29918,
3127,
353,
4236,
29898,
3317,
29918,
1066,
29918,
3127,
29892,
7442,
29889,
6897,
29898,
21962,
29918,
4220,
7503,
29941,
29962,
448,
3646,
29918,
4220,
7503,
29941,
14664,
3317,
3101,
13,
18884,
4236,
29918,
5450,
29918,
3127,
353,
4236,
29898,
3317,
29918,
5450,
29918,
3127,
29892,
15886,
29889,
339,
271,
29918,
2521,
29918,
12765,
29898,
21962,
29918,
4220,
29961,
29941,
29901,
1402,
3646,
29918,
4220,
29961,
29941,
29901,
12622,
13,
13,
18884,
3646,
29918,
29939,
353,
1583,
29889,
3601,
29918,
6272,
29889,
29885,
542,
481,
29918,
638,
29898,
5182,
29918,
4220,
448,
16256,
29918,
4220,
29892,
5075,
29897,
13,
18884,
318,
29918,
13168,
287,
7503,
29962,
353,
1583,
3032,
8299,
29898,
21962,
29918,
29939,
448,
3646,
29918,
29939,
29892,
12379,
29918,
3127,
29892,
413,
29897,
13,
13,
18884,
565,
1583,
29889,
29894,
15580,
338,
451,
6213,
322,
1583,
29889,
9482,
29918,
10590,
29901,
13,
462,
1678,
15886,
29889,
9482,
29918,
4220,
29898,
5182,
29918,
1066,
29889,
8552,
3285,
1583,
29889,
29894,
15580,
29892,
3858,
29922,
29888,
29908,
29912,
2817,
2403,
29886,
613,
5412,
29918,
1643,
29922,
5574,
29897,
13,
462,
1678,
15886,
29889,
9482,
29918,
4220,
29898,
5182,
29918,
4220,
29889,
8552,
3285,
1583,
29889,
29894,
15580,
29892,
3858,
29922,
29888,
29908,
29912,
2817,
2403,
29873,
613,
5412,
29918,
1643,
29922,
5574,
29897,
13,
462,
1678,
15886,
29889,
9482,
29918,
4220,
29898,
21962,
29918,
4220,
29889,
8552,
3285,
1583,
29889,
29894,
15580,
29892,
3858,
29922,
29888,
29908,
29912,
2817,
17671,
5412,
29918,
1643,
29922,
5574,
29897,
13,
13,
9651,
25274,
29918,
5064,
29918,
1066,
847,
29922,
29871,
29906,
29889,
29900,
13,
13,
9651,
318,
29961,
29955,
29962,
353,
2175,
29918,
629,
29886,
29918,
2917,
13,
9651,
318,
29961,
29896,
29945,
29962,
353,
1492,
29918,
629,
29886,
29918,
2917,
13,
9651,
318,
353,
7442,
29889,
24049,
29898,
29884,
29892,
1583,
29889,
3601,
29918,
6272,
29889,
2467,
29918,
3493,
29889,
677,
29892,
1583,
29889,
3601,
29918,
6272,
29889,
2467,
29918,
3493,
29889,
9812,
29897,
13,
13,
9651,
1583,
29889,
3601,
29918,
6272,
3032,
842,
29918,
2467,
29898,
29884,
29897,
13,
9651,
1583,
29889,
3601,
29889,
10568,
580,
13,
9651,
1583,
29889,
3601,
29918,
6272,
3032,
10568,
29918,
14035,
580,
13,
13,
9651,
565,
1583,
29889,
29894,
15580,
338,
451,
6213,
29901,
13,
18884,
565,
1583,
29889,
9482,
29918,
10590,
29901,
13,
462,
1678,
15886,
29889,
9482,
29918,
4220,
29898,
629,
4692,
29918,
5064,
29918,
1066,
29892,
1583,
29889,
29894,
15580,
29892,
3858,
543,
629,
4692,
29918,
5064,
613,
5412,
29918,
333,
29922,
29945,
29945,
29945,
29946,
29897,
13,
18884,
1583,
29889,
9482,
29898,
17462,
29918,
3502,
414,
29922,
5574,
29897,
13,
13,
9651,
565,
4236,
29918,
1066,
29918,
3127,
529,
926,
29918,
386,
12268,
322,
4236,
29918,
5450,
29918,
3127,
529,
5731,
29918,
386,
12268,
29901,
13,
18884,
2867,
13,
13,
9651,
565,
2302,
29918,
13844,
29918,
24530,
29901,
13,
18884,
5446,
29918,
1066,
353,
1583,
29889,
657,
29918,
3318,
29918,
1066,
580,
13,
18884,
1104,
29918,
1066,
353,
5446,
29918,
1066,
448,
25274,
29918,
5064,
29918,
1066,
13,
18884,
1603,
353,
12379,
29918,
2674,
29918,
1066,
338,
451,
6213,
322,
7442,
29889,
497,
29898,
9302,
29889,
6897,
29898,
2674,
29918,
1066,
448,
12379,
29918,
2674,
29918,
1066,
29897,
529,
29871,
29900,
29889,
29900,
29900,
29906,
29897,
13,
18884,
5446,
29918,
27215,
29918,
2371,
353,
7431,
29898,
1311,
29889,
3601,
29918,
6272,
29889,
657,
29918,
3318,
29918,
12346,
29918,
9748,
29898,
1228,
29918,
2587,
2433,
2371,
8785,
1275,
29871,
29900,
13,
18884,
565,
1603,
322,
5446,
29918,
27215,
29918,
2371,
29901,
13,
462,
1678,
13714,
29918,
24530,
4619,
29871,
29896,
13,
18884,
25342,
474,
1405,
29871,
29896,
29900,
29901,
13,
462,
1678,
2867,
13,
18884,
12379,
29918,
2674,
29918,
1066,
353,
1104,
29918,
1066,
13,
13,
4706,
565,
2302,
29918,
13844,
29918,
24530,
29901,
13,
9651,
736,
13714,
29918,
24530,
13,
13,
4706,
736,
4236,
29918,
1066,
29918,
3127,
13,
13,
1678,
822,
903,
11631,
29918,
279,
1516,
29918,
29885,
542,
481,
29898,
1311,
29892,
334,
29892,
2175,
29918,
5182,
29901,
7442,
29889,
299,
2378,
29892,
1492,
29918,
5182,
29901,
7442,
29889,
299,
2378,
29892,
2175,
29918,
29891,
1450,
29922,
29900,
29889,
29900,
29892,
1492,
29918,
29891,
1450,
29922,
29900,
29889,
29900,
29892,
13,
462,
308,
926,
29918,
386,
12268,
29922,
29900,
29889,
29900,
29906,
29892,
5731,
29918,
386,
12268,
29922,
29900,
29889,
29896,
29892,
413,
29922,
29896,
29889,
29900,
29892,
4236,
29918,
24530,
29922,
29896,
29892,
13,
462,
308,
2175,
29918,
629,
29886,
29918,
2917,
10457,
29896,
29889,
29900,
29892,
1492,
29918,
629,
29886,
29918,
2917,
10457,
29896,
29889,
29900,
1125,
13,
13,
4706,
22525,
353,
11117,
29880,
2396,
2175,
29918,
5182,
29892,
525,
29878,
2396,
1492,
29918,
5182,
29913,
13,
4706,
343,
10467,
353,
11117,
29880,
2396,
2175,
29918,
29891,
1450,
29892,
525,
29878,
2396,
1492,
29918,
29891,
1450,
29913,
13,
4706,
1583,
29889,
3601,
29889,
4299,
29889,
1837,
29918,
4925,
7503,
29962,
353,
29871,
29896,
13,
13,
4706,
363,
474,
297,
3464,
29898,
3317,
29918,
24530,
1125,
13,
13,
9651,
25274,
29918,
5064,
29918,
1066,
353,
7442,
29889,
3298,
359,
29898,
29941,
29897,
13,
9651,
4236,
29918,
5450,
29918,
3127,
353,
448,
9302,
29889,
7192,
13,
9651,
4236,
29918,
1066,
29918,
3127,
353,
448,
9302,
29889,
7192,
13,
13,
9651,
270,
29918,
27215,
29918,
2371,
353,
1583,
29889,
657,
29918,
3318,
29918,
1066,
580,
29961,
29906,
29962,
448,
1583,
29889,
3601,
29918,
6272,
3032,
3318,
29918,
29920,
29918,
10289,
13,
9651,
867,
29886,
29918,
29916,
5450,
353,
29871,
29900,
29889,
29929,
718,
270,
29918,
27215,
29918,
2371,
334,
29871,
29906,
29889,
29900,
13,
13,
9651,
286,
542,
481,
29918,
29874,
353,
7442,
29889,
3298,
359,
3552,
1311,
29889,
3601,
29889,
4299,
29889,
22882,
542,
481,
29892,
29871,
29955,
876,
13,
13,
9651,
363,
5075,
29918,
29875,
29892,
5075,
297,
26985,
29898,
877,
29880,
742,
525,
29878,
8785,
29901,
13,
13,
18884,
16256,
29918,
4220,
353,
1583,
29889,
657,
29918,
29887,
374,
2496,
29918,
4220,
29898,
2817,
29897,
13,
18884,
15905,
353,
7442,
29889,
1631,
448,
867,
29886,
29918,
29916,
5450,
13,
13,
18884,
3646,
29918,
1066,
353,
22525,
29961,
2817,
29962,
13,
18884,
3646,
29918,
4220,
353,
7442,
29889,
29878,
29918,
29961,
5182,
29918,
1066,
29892,
15886,
29889,
5450,
800,
29889,
29872,
8584,
29906,
339,
271,
29898,
9302,
29889,
29878,
29918,
29961,
29900,
1696,
29871,
29900,
1696,
343,
10467,
29961,
2817,
24960,
29962,
13,
18884,
3646,
29918,
4220,
353,
15886,
29889,
7302,
29918,
13264,
29898,
9302,
29889,
29878,
29918,
29961,
29900,
1696,
29871,
29900,
1696,
29871,
29900,
1696,
15886,
29889,
5450,
800,
29889,
29872,
8584,
29906,
339,
271,
29898,
9302,
29889,
29878,
29918,
29961,
29886,
2335,
29892,
29871,
29900,
1696,
29871,
29900,
29889,
2314,
1402,
3646,
29918,
4220,
29897,
13,
13,
18884,
25274,
29918,
5064,
29918,
1066,
4619,
16256,
29918,
4220,
7503,
29941,
29962,
13,
18884,
565,
4236,
29918,
24530,
1405,
29871,
29896,
29901,
13,
462,
1678,
4236,
29918,
1066,
29918,
3127,
353,
4236,
29898,
3317,
29918,
1066,
29918,
3127,
29892,
7442,
29889,
6897,
29898,
21962,
29918,
4220,
7503,
29941,
29962,
448,
3646,
29918,
4220,
7503,
29941,
14664,
3317,
3101,
13,
462,
1678,
4236,
29918,
5450,
29918,
3127,
353,
4236,
29898,
3317,
29918,
5450,
29918,
3127,
29892,
15886,
29889,
339,
271,
29918,
2521,
29918,
12765,
29898,
21962,
29918,
4220,
29961,
29941,
29901,
1402,
3646,
29918,
4220,
29961,
29941,
29901,
12622,
13,
13,
18884,
286,
542,
481,
29918,
29874,
29961,
2817,
29918,
29875,
29962,
353,
3646,
29918,
4220,
448,
16256,
29918,
4220,
13,
13,
18884,
565,
1583,
29889,
29894,
15580,
338,
451,
6213,
322,
1583,
29889,
9482,
29918,
10590,
29901,
13,
462,
1678,
15886,
29889,
9482,
29918,
4220,
29898,
5182,
29918,
1066,
29889,
8552,
3285,
1583,
29889,
29894,
15580,
29892,
3858,
29922,
29888,
29908,
29912,
2817,
2403,
29886,
613,
5412,
29918,
1643,
29922,
5574,
29897,
13,
462,
1678,
15886,
29889,
9482,
29918,
4220,
29898,
5182,
29918,
4220,
29889,
8552,
3285,
1583,
29889,
29894,
15580,
29892,
3858,
29922,
29888,
29908,
29912,
2817,
2403,
29873,
613,
5412,
29918,
1643,
29922,
5574,
29897,
13,
462,
1678,
15886,
29889,
9482,
29918,
4220,
29898,
21962,
29918,
4220,
29889,
8552,
3285,
1583,
29889,
29894,
15580,
29892,
3858,
29922,
29888,
29908,
29912,
2817,
17671,
5412,
29918,
1643,
29922,
5574,
29897,
13,
13,
9651,
25274,
29918,
5064,
29918,
1066,
847,
29922,
29871,
29906,
29889,
29900,
13,
13,
9651,
396,
731,
2295,
310,
330,
374,
22437,
13,
9651,
318,
353,
7442,
29889,
3298,
359,
29898,
1311,
29889,
3601,
29918,
6272,
29889,
2467,
29918,
3493,
29889,
12181,
29897,
13,
9651,
318,
29961,
29955,
29962,
353,
2175,
29918,
629,
29886,
29918,
2917,
13,
9651,
318,
29961,
29896,
29945,
29962,
353,
1492,
29918,
629,
29886,
29918,
2917,
13,
9651,
1583,
29889,
3601,
29918,
6272,
3032,
842,
29918,
2467,
29898,
29884,
29897,
13,
13,
9651,
396,
731,
18593,
310,
330,
374,
22437,
13,
9651,
903,
29885,
542,
481,
29918,
842,
29918,
2467,
29898,
1311,
29889,
3601,
29892,
286,
542,
481,
29918,
29874,
334,
413,
29897,
13,
13,
9651,
396,
2125,
17402,
4331,
13,
9651,
1583,
29889,
3601,
29889,
10568,
580,
13,
9651,
1583,
29889,
3601,
29918,
6272,
3032,
10568,
29918,
14035,
580,
13,
13,
9651,
565,
1583,
29889,
29894,
15580,
338,
451,
6213,
29901,
13,
18884,
565,
1583,
29889,
9482,
29918,
10590,
29901,
13,
462,
1678,
15886,
29889,
9482,
29918,
4220,
29898,
629,
4692,
29918,
5064,
29918,
1066,
29892,
1583,
29889,
29894,
15580,
29892,
3858,
543,
629,
4692,
29918,
5064,
613,
5412,
29918,
333,
29922,
29945,
29945,
29945,
29946,
29897,
13,
18884,
1583,
29889,
9482,
29898,
17462,
29918,
3502,
414,
29922,
5574,
29897,
13,
13,
9651,
565,
4236,
29918,
1066,
29918,
3127,
529,
926,
29918,
386,
12268,
322,
4236,
29918,
5450,
29918,
3127,
529,
5731,
29918,
386,
12268,
29901,
13,
18884,
2867,
13,
2
] |
mev/api/tests/test_public_data_views.py
|
hsph-qbrc/mev-backend
| 0 |
86500
|
import unittest.mock as mock
from urllib.parse import quote as param_encoder
from django.urls import reverse
from django.core.exceptions import ImproperlyConfigured
from rest_framework import status
from api.models import PublicDataset, Workspace, Resource
from api.tests.base import BaseAPITestCase
from api.tests import test_settings
class PublicDataListTests(BaseAPITestCase):
def setUp(self):
self.url = reverse('public-dataset-list')
self.establish_clients()
self.all_public_datasets = PublicDataset.objects.all()
if len(self.all_public_datasets) == 0:
raise ImproperlyConfigured('Need at least one active public dataset to'
' run this test properly.'
)
self.all_active_datasets = [x for x in self.all_public_datasets if x.active]
if len(self.all_active_datasets) == 0:
raise ImproperlyConfigured('Need at least one active public dataset to'
' run this test properly.'
)
def test_list_requires_auth(self):
"""
Test that general requests to the endpoint generate 401
"""
response = self.regular_client.get(self.url)
self.assertTrue((response.status_code == status.HTTP_401_UNAUTHORIZED)
| (response.status_code == status.HTTP_403_FORBIDDEN))
response = self.authenticated_regular_client.get(self.url)
self.assertTrue((response.status_code == status.HTTP_200_OK))
self.assertTrue(len(response.json()) == len(self.all_active_datasets))
class PublicDataDetailsTests(BaseAPITestCase):
'''
Tests focused around the ability to query a specific public dataset.
'''
def setUp(self):
self.all_public_datasets = PublicDataset.objects.all()
if len(self.all_public_datasets) == 0:
raise ImproperlyConfigured('Need at least one active public dataset to'
' run this test properly.'
)
self.all_active_datasets = [x for x in self.all_public_datasets if x.active]
if len(self.all_active_datasets) == 0:
raise ImproperlyConfigured('Need at least one active public dataset to'
' run this test properly.'
)
# grab the first active dataset to use in the tests below
self.test_active_dataset = self.all_active_datasets[0]
self.url = reverse('public-dataset-details',
kwargs={'dataset_id': self.test_active_dataset.index_name}
)
self.establish_clients()
def test_requires_auth(self):
"""
Test that general requests to the endpoint generate 401
"""
response = self.regular_client.get(self.url)
self.assertTrue((response.status_code == status.HTTP_401_UNAUTHORIZED)
| (response.status_code == status.HTTP_403_FORBIDDEN))
response = self.authenticated_regular_client.get(self.url)
self.assertTrue((response.status_code == status.HTTP_200_OK))
def test_returns_expected_details(self):
response = self.authenticated_regular_client.get(self.url)
self.assertTrue((response.status_code == status.HTTP_200_OK))
response_json = response.json()
self.assertTrue(response_json['index_name'] == self.test_active_dataset.index_name)
print(response_json)
def test_inactive_instance_returns_404(self):
'''
If the details are requested on an inactive dataset, return a 404
'''
# check that we have an inactive dataset first:
dataset_tag = 'public-baz'
pd = PublicDataset.objects.get(index_name = dataset_tag)
self.assertFalse(pd.active)
url = reverse('public-dataset-details',
kwargs={'dataset_id': dataset_tag}
)
response = self.authenticated_regular_client.get(url)
self.assertTrue((response.status_code == status.HTTP_404_NOT_FOUND))
class PublicDataQueryTests(BaseAPITestCase):
'''
Tests focused around the ability to query public datasets.
'''
def setUp(self):
self.all_public_datasets = PublicDataset.objects.all()
if len(self.all_public_datasets) == 0:
raise ImproperlyConfigured('Need at least one active public dataset to'
' run this test properly.'
)
self.all_active_datasets = [x for x in self.all_public_datasets if x.active]
if len(self.all_active_datasets) == 0:
raise ImproperlyConfigured('Need at least one active public dataset to'
' run this test properly.'
)
# grab the first active dataset to use in the tests below
self.test_active_dataset = self.all_active_datasets[0]
self.url = reverse('public-dataset-query',
kwargs={'dataset_id': self.test_active_dataset.index_name}
)
self.establish_clients()
@mock.patch('api.views.public_dataset.query_dataset')
def test_call_format(self, mock_query_dataset):
'''
Test that the proper request is made
'''
query_str = 'q=*:*&facet.field=foo&facet=on'
encoded_str = 'q=%2A%3A%2A&facet.field=foo&facet=on'
url = self.url + '?' + query_str
mock_response_json = {'a':1, 'b':2}
mock_query_dataset.return_value = mock_response_json
response = self.authenticated_admin_client.get(url)
mock_query_dataset.assert_called_with(self.test_active_dataset.index_name, encoded_str)
class PublicDataCreateTests(BaseAPITestCase):
'''
Tests focused around the ability to create public datasets.
'''
def setUp(self):
self.establish_clients()
self.all_public_datasets = PublicDataset.objects.all()
if len(self.all_public_datasets) == 0:
raise ImproperlyConfigured('Need at least one active public dataset to'
' run this test properly.'
)
self.all_active_datasets = [x for x in self.all_public_datasets if x.active]
if len(self.all_active_datasets) == 0:
raise ImproperlyConfigured('Need at least one active public dataset to'
' run this test properly.'
)
# grab the first active dataset to use in the tests below
self.test_active_dataset = self.all_active_datasets[0]
self.url = reverse('public-dataset-create',
kwargs={'dataset_id': self.test_active_dataset.index_name}
)
def test_requires_auth(self):
"""
Test that general requests to the endpoint generate 401
"""
response = self.regular_client.post(self.url)
self.assertTrue((response.status_code == status.HTTP_401_UNAUTHORIZED)
| (response.status_code == status.HTTP_403_FORBIDDEN))
@mock.patch('api.views.public_dataset.create_dataset_from_params')
def test_error_to_add_resource_reported(self, mock_create_dataset_from_params):
'''
If something goes wrong in the
api.views.public_dataset.create_dataset_from_params function,
we return a 400 and report it.
'''
# this is the payload we want passed to the function.
# the full request will have this AND the workspace
payload = {'samples': [1,2,3]}
# mock the failure:
mock_create_dataset_from_params.side_effect = Exception('something bad!')
response = self.authenticated_regular_client.post(
self.url, data=payload, format='json')
self.assertTrue(response.status_code == status.HTTP_400_BAD_REQUEST)
@mock.patch('api.views.public_dataset.create_dataset_from_params')
def test_missing_filter_creates_null_filter(self, mock_create_dataset_from_params):
'''
Assume that the request payload was valid so that the
api.views.public_dataset.create_dataset_from_params function
returns an api.models.Resource instance.
Here, test that we add that resource to the workspace and return a 201
'''
payload = {}
# this is the new resource that is mock-created
new_resource = Resource.objects.create(
owner = self.regular_user_1,
path = '/some/dummy_path/file.tsv',
name = 'foo.tsv'
)
mock_create_dataset_from_params.return_value = [new_resource,]
# finally, call the endpoint
response = self.authenticated_regular_client.post(
self.url, data=payload, format='json')
self.assertTrue(response.status_code == status.HTTP_201_CREATED)
mock_create_dataset_from_params.assert_called_with(
self.test_active_dataset.index_name,
self.regular_user_1,
None,
''
)
j = response.json()
self.assertTrue(j[0]['name'] == 'foo.tsv')
@mock.patch('api.views.public_dataset.create_dataset_from_params')
def test_adds_new_resource_to_workspace_case1(self, mock_create_dataset_from_params):
'''
Assume that the request payload was valid so that the
api.views.public_dataset.create_dataset_from_params function
returns a list of api.models.Resource instances.
Here, test that we add that resource to the workspace and return a 201.
No output name for the dataset is provided
'''
# this is the payload we want passed to the function.
# the full request will have this AND the workspace
payload = {'filters': {'a':1}}
# below, we check that the workspace key gets stripped
# from the call to the creation method
new_resource = Resource.objects.create(
owner = self.regular_user_1,
path = '/some/dummy_path/file.tsv',
name = 'foo.tsv'
)
mock_create_dataset_from_params.return_value = [new_resource,]
# finally, call the endpoint
response = self.authenticated_regular_client.post(
self.url, data=payload, format='json')
self.assertTrue(response.status_code == status.HTTP_201_CREATED)
# below, we check that the workspace key gets stripped
# from the call to the creation method
mock_create_dataset_from_params.assert_called_with(
self.test_active_dataset.index_name,
self.regular_user_1,
payload['filters'],
''
)
j = response.json()
# j is a list of resource instances. We expect only one:
self.assertTrue(j[0]['name'] == 'foo.tsv')
@mock.patch('api.views.public_dataset.create_dataset_from_params')
def test_adds_new_resource_to_workspace_case2(self, mock_create_dataset_from_params):
'''
Assume that the request payload was valid so that the
api.views.public_dataset.create_dataset_from_params function
returns a list of api.models.Resource instances.
Here, test that we add that resource to the workspace and return a 201.
Here, we pass a name for the dataset
'''
# this is the payload we want passed to the function.
# the full request will have this AND the workspace
output_name = 'foo'
payload = {'filters': {'a':1}, 'output_name': output_name}
# below, we check that the workspace key gets stripped
# from the call to the creation method
new_resource = Resource.objects.create(
owner = self.regular_user_1,
path = '/some/dummy_path/file.tsv',
name = 'foo.tsv'
)
mock_create_dataset_from_params.return_value = [new_resource,]
# finally, call the endpoint
response = self.authenticated_regular_client.post(
self.url, data=payload, format='json')
self.assertTrue(response.status_code == status.HTTP_201_CREATED)
# below, we check that the workspace key gets stripped
# from the call to the creation method
mock_create_dataset_from_params.assert_called_with(
self.test_active_dataset.index_name,
self.regular_user_1,
payload['filters'],
output_name
)
j = response.json()
# j is a list of resource instances. We expect only one:
self.assertTrue(j[0]['name'] == 'foo.tsv')
@mock.patch('api.views.public_dataset.create_dataset_from_params')
def test_rejects_malformatted_filter(self, mock_create_dataset_from_params):
'''
Test that if a 'filter' key is provided and it is not parsed
as a dict, then we reject
'''
payload = {
'filters': 'abc'
}
response = self.authenticated_regular_client.post(
self.url, data=payload, format='json')
self.assertTrue(response.status_code == status.HTTP_400_BAD_REQUEST)
|
[
1,
1053,
443,
27958,
29889,
17640,
408,
11187,
13,
3166,
3142,
1982,
29889,
5510,
1053,
14978,
408,
1828,
29918,
3977,
6119,
13,
3166,
9557,
29889,
26045,
1053,
11837,
13,
3166,
9557,
29889,
3221,
29889,
11739,
29879,
1053,
1954,
771,
546,
368,
3991,
2955,
13,
3166,
1791,
29918,
4468,
1053,
4660,
13,
13,
3166,
7882,
29889,
9794,
1053,
5236,
16390,
24541,
29892,
5244,
3493,
29892,
18981,
13,
3166,
7882,
29889,
21150,
29889,
3188,
1053,
7399,
3301,
1806,
342,
8259,
13,
3166,
7882,
29889,
21150,
1053,
1243,
29918,
11027,
13,
13,
13,
1990,
5236,
1469,
1293,
24376,
29898,
5160,
3301,
1806,
342,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
2271,
353,
11837,
877,
3597,
29899,
24713,
29899,
1761,
1495,
13,
4706,
1583,
29889,
342,
370,
1674,
29918,
11303,
1237,
580,
13,
4706,
1583,
29889,
497,
29918,
3597,
29918,
14538,
1691,
353,
5236,
16390,
24541,
29889,
12650,
29889,
497,
580,
13,
4706,
565,
7431,
29898,
1311,
29889,
497,
29918,
3597,
29918,
14538,
1691,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
1954,
771,
546,
368,
3991,
2955,
877,
8139,
287,
472,
3203,
697,
6136,
970,
8783,
304,
29915,
13,
18884,
525,
1065,
445,
1243,
6284,
6169,
13,
9651,
1723,
13,
4706,
1583,
29889,
497,
29918,
4925,
29918,
14538,
1691,
353,
518,
29916,
363,
921,
297,
1583,
29889,
497,
29918,
3597,
29918,
14538,
1691,
565,
921,
29889,
4925,
29962,
13,
4706,
565,
7431,
29898,
1311,
29889,
497,
29918,
4925,
29918,
14538,
1691,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
1954,
771,
546,
368,
3991,
2955,
877,
8139,
287,
472,
3203,
697,
6136,
970,
8783,
304,
29915,
13,
18884,
525,
1065,
445,
1243,
6284,
6169,
13,
9651,
1723,
13,
13,
1678,
822,
1243,
29918,
1761,
29918,
276,
339,
2658,
29918,
5150,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
393,
2498,
7274,
304,
278,
16248,
5706,
29871,
29946,
29900,
29896,
13,
4706,
9995,
13,
4706,
2933,
353,
1583,
29889,
15227,
29918,
4645,
29889,
657,
29898,
1311,
29889,
2271,
29897,
13,
4706,
1583,
29889,
9294,
5574,
3552,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29946,
29900,
29896,
29918,
29965,
3521,
2692,
29950,
1955,
26664,
3352,
29897,
29871,
13,
4706,
891,
313,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29946,
29900,
29941,
29918,
22051,
29933,
1367,
29928,
1430,
876,
13,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
15227,
29918,
4645,
29889,
657,
29898,
1311,
29889,
2271,
29897,
13,
4706,
1583,
29889,
9294,
5574,
3552,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29906,
29900,
29900,
29918,
8949,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
2435,
29898,
5327,
29889,
3126,
3101,
1275,
7431,
29898,
1311,
29889,
497,
29918,
4925,
29918,
14538,
1691,
876,
13,
13,
13,
1990,
5236,
1469,
10602,
24376,
29898,
5160,
3301,
1806,
342,
8259,
1125,
13,
1678,
14550,
13,
1678,
4321,
29879,
21309,
2820,
278,
11509,
304,
2346,
263,
2702,
970,
8783,
29889,
13,
1678,
14550,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
497,
29918,
3597,
29918,
14538,
1691,
353,
5236,
16390,
24541,
29889,
12650,
29889,
497,
580,
13,
4706,
565,
7431,
29898,
1311,
29889,
497,
29918,
3597,
29918,
14538,
1691,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
1954,
771,
546,
368,
3991,
2955,
877,
8139,
287,
472,
3203,
697,
6136,
970,
8783,
304,
29915,
13,
18884,
525,
1065,
445,
1243,
6284,
6169,
13,
9651,
1723,
13,
4706,
1583,
29889,
497,
29918,
4925,
29918,
14538,
1691,
353,
518,
29916,
363,
921,
297,
1583,
29889,
497,
29918,
3597,
29918,
14538,
1691,
565,
921,
29889,
4925,
29962,
13,
4706,
565,
7431,
29898,
1311,
29889,
497,
29918,
4925,
29918,
14538,
1691,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
1954,
771,
546,
368,
3991,
2955,
877,
8139,
287,
472,
3203,
697,
6136,
970,
8783,
304,
29915,
13,
18884,
525,
1065,
445,
1243,
6284,
6169,
13,
9651,
1723,
13,
4706,
396,
17229,
278,
937,
6136,
8783,
304,
671,
297,
278,
6987,
2400,
13,
4706,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
353,
1583,
29889,
497,
29918,
4925,
29918,
14538,
1691,
29961,
29900,
29962,
13,
4706,
1583,
29889,
2271,
353,
11837,
877,
3597,
29899,
24713,
29899,
14144,
742,
29871,
13,
9651,
9049,
5085,
3790,
29915,
24713,
29918,
333,
2396,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
29889,
2248,
29918,
978,
29913,
13,
4706,
1723,
13,
4706,
1583,
29889,
342,
370,
1674,
29918,
11303,
1237,
580,
13,
13,
1678,
822,
1243,
29918,
276,
339,
2658,
29918,
5150,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
393,
2498,
7274,
304,
278,
16248,
5706,
29871,
29946,
29900,
29896,
13,
4706,
9995,
13,
4706,
2933,
353,
1583,
29889,
15227,
29918,
4645,
29889,
657,
29898,
1311,
29889,
2271,
29897,
13,
4706,
1583,
29889,
9294,
5574,
3552,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29946,
29900,
29896,
29918,
29965,
3521,
2692,
29950,
1955,
26664,
3352,
29897,
29871,
13,
4706,
891,
313,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29946,
29900,
29941,
29918,
22051,
29933,
1367,
29928,
1430,
876,
13,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
15227,
29918,
4645,
29889,
657,
29898,
1311,
29889,
2271,
29897,
13,
4706,
1583,
29889,
9294,
5574,
3552,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29906,
29900,
29900,
29918,
8949,
876,
13,
13,
1678,
822,
1243,
29918,
18280,
29918,
9684,
29918,
14144,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
15227,
29918,
4645,
29889,
657,
29898,
1311,
29889,
2271,
29897,
13,
4706,
1583,
29889,
9294,
5574,
3552,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29906,
29900,
29900,
29918,
8949,
876,
13,
4706,
2933,
29918,
3126,
353,
2933,
29889,
3126,
580,
13,
4706,
1583,
29889,
9294,
5574,
29898,
5327,
29918,
3126,
1839,
2248,
29918,
978,
2033,
1275,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
29889,
2248,
29918,
978,
29897,
13,
4706,
1596,
29898,
5327,
29918,
3126,
29897,
13,
13,
1678,
822,
1243,
29918,
262,
4925,
29918,
8758,
29918,
18280,
29918,
29946,
29900,
29946,
29898,
1311,
1125,
13,
4706,
14550,
13,
4706,
960,
278,
4902,
526,
13877,
373,
385,
297,
4925,
8783,
29892,
736,
263,
29871,
29946,
29900,
29946,
13,
4706,
14550,
13,
4706,
396,
1423,
393,
591,
505,
385,
297,
4925,
8783,
937,
29901,
13,
4706,
8783,
29918,
4039,
353,
525,
3597,
29899,
27975,
29915,
13,
4706,
10518,
353,
5236,
16390,
24541,
29889,
12650,
29889,
657,
29898,
2248,
29918,
978,
353,
8783,
29918,
4039,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
15926,
29889,
4925,
29897,
13,
4706,
3142,
353,
11837,
877,
3597,
29899,
24713,
29899,
14144,
742,
29871,
13,
9651,
9049,
5085,
3790,
29915,
24713,
29918,
333,
2396,
8783,
29918,
4039,
29913,
13,
4706,
1723,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
15227,
29918,
4645,
29889,
657,
29898,
2271,
29897,
13,
4706,
1583,
29889,
9294,
5574,
3552,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29946,
29900,
29946,
29918,
12256,
29918,
5800,
18783,
876,
13,
13,
1990,
5236,
1469,
3010,
24376,
29898,
5160,
3301,
1806,
342,
8259,
1125,
13,
1678,
14550,
13,
1678,
4321,
29879,
21309,
2820,
278,
11509,
304,
2346,
970,
20035,
29889,
13,
1678,
14550,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
497,
29918,
3597,
29918,
14538,
1691,
353,
5236,
16390,
24541,
29889,
12650,
29889,
497,
580,
13,
4706,
565,
7431,
29898,
1311,
29889,
497,
29918,
3597,
29918,
14538,
1691,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
1954,
771,
546,
368,
3991,
2955,
877,
8139,
287,
472,
3203,
697,
6136,
970,
8783,
304,
29915,
13,
18884,
525,
1065,
445,
1243,
6284,
6169,
13,
9651,
1723,
13,
4706,
1583,
29889,
497,
29918,
4925,
29918,
14538,
1691,
353,
518,
29916,
363,
921,
297,
1583,
29889,
497,
29918,
3597,
29918,
14538,
1691,
565,
921,
29889,
4925,
29962,
13,
4706,
565,
7431,
29898,
1311,
29889,
497,
29918,
4925,
29918,
14538,
1691,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
1954,
771,
546,
368,
3991,
2955,
877,
8139,
287,
472,
3203,
697,
6136,
970,
8783,
304,
29915,
13,
18884,
525,
1065,
445,
1243,
6284,
6169,
13,
9651,
1723,
13,
4706,
396,
17229,
278,
937,
6136,
8783,
304,
671,
297,
278,
6987,
2400,
13,
4706,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
353,
1583,
29889,
497,
29918,
4925,
29918,
14538,
1691,
29961,
29900,
29962,
13,
4706,
1583,
29889,
2271,
353,
11837,
877,
3597,
29899,
24713,
29899,
1972,
742,
29871,
13,
9651,
9049,
5085,
3790,
29915,
24713,
29918,
333,
2396,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
29889,
2248,
29918,
978,
29913,
13,
4706,
1723,
13,
4706,
1583,
29889,
342,
370,
1674,
29918,
11303,
1237,
580,
13,
13,
1678,
732,
17640,
29889,
5041,
877,
2754,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
1972,
29918,
24713,
1495,
13,
1678,
822,
1243,
29918,
4804,
29918,
4830,
29898,
1311,
29892,
11187,
29918,
1972,
29918,
24713,
1125,
13,
4706,
14550,
13,
4706,
4321,
393,
278,
1571,
2009,
338,
1754,
29871,
13,
4706,
14550,
13,
4706,
2346,
29918,
710,
353,
525,
29939,
29922,
29930,
29901,
29930,
29987,
17470,
300,
29889,
2671,
29922,
5431,
29987,
17470,
300,
29922,
265,
29915,
13,
4706,
18511,
29918,
710,
353,
525,
29939,
16328,
29906,
29909,
29995,
29941,
29909,
29995,
29906,
29909,
29987,
17470,
300,
29889,
2671,
29922,
5431,
29987,
17470,
300,
29922,
265,
29915,
13,
4706,
3142,
353,
1583,
29889,
2271,
718,
525,
17901,
718,
2346,
29918,
710,
13,
4706,
11187,
29918,
5327,
29918,
3126,
353,
11117,
29874,
2396,
29896,
29892,
525,
29890,
2396,
29906,
29913,
13,
4706,
11187,
29918,
1972,
29918,
24713,
29889,
2457,
29918,
1767,
353,
11187,
29918,
5327,
29918,
3126,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
6406,
29918,
4645,
29889,
657,
29898,
2271,
29897,
13,
4706,
11187,
29918,
1972,
29918,
24713,
29889,
9294,
29918,
13998,
29918,
2541,
29898,
1311,
29889,
1688,
29918,
4925,
29918,
24713,
29889,
2248,
29918,
978,
29892,
18511,
29918,
710,
29897,
13,
13,
13,
1990,
5236,
1469,
4391,
24376,
29898,
5160,
3301,
1806,
342,
8259,
1125,
13,
1678,
14550,
13,
1678,
4321,
29879,
21309,
2820,
278,
11509,
304,
1653,
970,
20035,
29889,
13,
1678,
14550,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
13,
4706,
1583,
29889,
342,
370,
1674,
29918,
11303,
1237,
580,
13,
13,
4706,
1583,
29889,
497,
29918,
3597,
29918,
14538,
1691,
353,
5236,
16390,
24541,
29889,
12650,
29889,
497,
580,
13,
4706,
565,
7431,
29898,
1311,
29889,
497,
29918,
3597,
29918,
14538,
1691,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
1954,
771,
546,
368,
3991,
2955,
877,
8139,
287,
472,
3203,
697,
6136,
970,
8783,
304,
29915,
13,
18884,
525,
1065,
445,
1243,
6284,
6169,
13,
9651,
1723,
13,
4706,
1583,
29889,
497,
29918,
4925,
29918,
14538,
1691,
353,
518,
29916,
363,
921,
297,
1583,
29889,
497,
29918,
3597,
29918,
14538,
1691,
565,
921,
29889,
4925,
29962,
13,
4706,
565,
7431,
29898,
1311,
29889,
497,
29918,
4925,
29918,
14538,
1691,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
1954,
771,
546,
368,
3991,
2955,
877,
8139,
287,
472,
3203,
697,
6136,
970,
8783,
304,
29915,
13,
18884,
525,
1065,
445,
1243,
6284,
6169,
13,
9651,
1723,
13,
4706,
396,
17229,
278,
937,
6136,
8783,
304,
671,
297,
278,
6987,
2400,
13,
4706,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
353,
1583,
29889,
497,
29918,
4925,
29918,
14538,
1691,
29961,
29900,
29962,
13,
4706,
1583,
29889,
2271,
353,
11837,
877,
3597,
29899,
24713,
29899,
3258,
742,
29871,
13,
9651,
9049,
5085,
3790,
29915,
24713,
29918,
333,
2396,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
29889,
2248,
29918,
978,
29913,
13,
4706,
1723,
13,
13,
13,
1678,
822,
1243,
29918,
276,
339,
2658,
29918,
5150,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
393,
2498,
7274,
304,
278,
16248,
5706,
29871,
29946,
29900,
29896,
13,
4706,
9995,
13,
4706,
2933,
353,
1583,
29889,
15227,
29918,
4645,
29889,
2490,
29898,
1311,
29889,
2271,
29897,
13,
4706,
1583,
29889,
9294,
5574,
3552,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29946,
29900,
29896,
29918,
29965,
3521,
2692,
29950,
1955,
26664,
3352,
29897,
29871,
13,
4706,
891,
313,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29946,
29900,
29941,
29918,
22051,
29933,
1367,
29928,
1430,
876,
13,
13,
13,
1678,
732,
17640,
29889,
5041,
877,
2754,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1495,
13,
1678,
822,
1243,
29918,
2704,
29918,
517,
29918,
1202,
29918,
10314,
29918,
12276,
287,
29898,
1311,
29892,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1125,
13,
4706,
14550,
13,
4706,
960,
1554,
5771,
2743,
297,
278,
29871,
13,
4706,
7882,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
740,
29892,
13,
4706,
591,
736,
263,
29871,
29946,
29900,
29900,
322,
3461,
372,
29889,
13,
4706,
14550,
13,
4706,
396,
445,
338,
278,
20092,
591,
864,
4502,
304,
278,
740,
29889,
13,
4706,
396,
278,
2989,
2009,
674,
505,
445,
5300,
278,
664,
3493,
13,
4706,
20092,
353,
11117,
27736,
2396,
518,
29896,
29892,
29906,
29892,
29941,
12258,
13,
13,
4706,
396,
11187,
278,
10672,
29901,
13,
4706,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
29889,
2975,
29918,
15987,
353,
8960,
877,
14481,
4319,
29991,
1495,
13,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
15227,
29918,
4645,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2271,
29892,
848,
29922,
23813,
29892,
3402,
2433,
3126,
1495,
13,
4706,
1583,
29889,
9294,
5574,
29898,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29946,
29900,
29900,
29918,
29933,
3035,
29918,
16244,
29897,
13,
13,
1678,
732,
17640,
29889,
5041,
877,
2754,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1495,
13,
1678,
822,
1243,
29918,
27259,
29918,
4572,
29918,
1037,
1078,
29918,
4304,
29918,
4572,
29898,
1311,
29892,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1125,
13,
4706,
14550,
13,
4706,
22680,
393,
278,
2009,
20092,
471,
2854,
577,
393,
278,
29871,
13,
4706,
7882,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
740,
13,
4706,
3639,
385,
7882,
29889,
9794,
29889,
6848,
2777,
29889,
29871,
13,
13,
4706,
2266,
29892,
1243,
393,
591,
788,
393,
6503,
304,
278,
664,
3493,
322,
736,
263,
29871,
29906,
29900,
29896,
13,
4706,
14550,
13,
4706,
20092,
353,
6571,
13,
13,
4706,
396,
445,
338,
278,
716,
6503,
393,
338,
11187,
29899,
11600,
13,
4706,
716,
29918,
10314,
353,
18981,
29889,
12650,
29889,
3258,
29898,
13,
9651,
12271,
353,
1583,
29889,
15227,
29918,
1792,
29918,
29896,
29892,
13,
9651,
2224,
353,
8207,
5372,
29914,
29881,
11770,
29918,
2084,
29914,
1445,
29889,
1372,
29894,
742,
13,
9651,
1024,
353,
525,
5431,
29889,
1372,
29894,
29915,
13,
4706,
1723,
13,
4706,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
29889,
2457,
29918,
1767,
353,
518,
1482,
29918,
10314,
26073,
13,
13,
4706,
396,
7146,
29892,
1246,
278,
16248,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
15227,
29918,
4645,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2271,
29892,
848,
29922,
23813,
29892,
3402,
2433,
3126,
1495,
13,
4706,
1583,
29889,
9294,
5574,
29898,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29906,
29900,
29896,
29918,
27045,
29928,
29897,
13,
13,
4706,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
29889,
9294,
29918,
13998,
29918,
2541,
29898,
13,
9651,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
29889,
2248,
29918,
978,
29892,
13,
9651,
1583,
29889,
15227,
29918,
1792,
29918,
29896,
29892,
13,
9651,
6213,
29892,
29871,
13,
9651,
6629,
13,
4706,
1723,
13,
4706,
432,
353,
2933,
29889,
3126,
580,
13,
4706,
1583,
29889,
9294,
5574,
29898,
29926,
29961,
29900,
22322,
978,
2033,
1275,
525,
5431,
29889,
1372,
29894,
1495,
13,
13,
1678,
732,
17640,
29889,
5041,
877,
2754,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1495,
13,
1678,
822,
1243,
29918,
1202,
29879,
29918,
1482,
29918,
10314,
29918,
517,
29918,
1287,
3493,
29918,
4878,
29896,
29898,
1311,
29892,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1125,
13,
4706,
14550,
13,
4706,
22680,
393,
278,
2009,
20092,
471,
2854,
577,
393,
278,
29871,
13,
4706,
7882,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
740,
13,
4706,
3639,
263,
1051,
310,
7882,
29889,
9794,
29889,
6848,
8871,
29889,
29871,
13,
13,
4706,
2266,
29892,
1243,
393,
591,
788,
393,
6503,
304,
278,
664,
3493,
322,
736,
263,
29871,
29906,
29900,
29896,
29889,
13,
4706,
1939,
1962,
1024,
363,
278,
8783,
338,
4944,
13,
4706,
14550,
13,
4706,
396,
445,
338,
278,
20092,
591,
864,
4502,
304,
278,
740,
29889,
13,
4706,
396,
278,
2989,
2009,
674,
505,
445,
5300,
278,
664,
3493,
13,
4706,
20092,
353,
11117,
26705,
2396,
11117,
29874,
2396,
29896,
930,
13,
13,
4706,
396,
2400,
29892,
591,
1423,
393,
278,
664,
3493,
1820,
4947,
10076,
2986,
13,
4706,
396,
515,
278,
1246,
304,
278,
11265,
1158,
13,
4706,
716,
29918,
10314,
353,
18981,
29889,
12650,
29889,
3258,
29898,
13,
9651,
12271,
353,
1583,
29889,
15227,
29918,
1792,
29918,
29896,
29892,
13,
9651,
2224,
353,
8207,
5372,
29914,
29881,
11770,
29918,
2084,
29914,
1445,
29889,
1372,
29894,
742,
13,
9651,
1024,
353,
525,
5431,
29889,
1372,
29894,
29915,
13,
4706,
1723,
13,
4706,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
29889,
2457,
29918,
1767,
353,
518,
1482,
29918,
10314,
26073,
13,
13,
4706,
396,
7146,
29892,
1246,
278,
16248,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
15227,
29918,
4645,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2271,
29892,
848,
29922,
23813,
29892,
3402,
2433,
3126,
1495,
13,
4706,
1583,
29889,
9294,
5574,
29898,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29906,
29900,
29896,
29918,
27045,
29928,
29897,
13,
13,
4706,
396,
2400,
29892,
591,
1423,
393,
278,
664,
3493,
1820,
4947,
10076,
2986,
13,
4706,
396,
515,
278,
1246,
304,
278,
11265,
1158,
13,
4706,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
29889,
9294,
29918,
13998,
29918,
2541,
29898,
13,
9651,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
29889,
2248,
29918,
978,
29892,
13,
9651,
1583,
29889,
15227,
29918,
1792,
29918,
29896,
29892,
13,
9651,
20092,
1839,
26705,
7464,
13,
9651,
6629,
13,
4706,
1723,
13,
13,
4706,
432,
353,
2933,
29889,
3126,
580,
13,
4706,
396,
432,
338,
263,
1051,
310,
6503,
8871,
29889,
1334,
2149,
871,
697,
29901,
13,
4706,
1583,
29889,
9294,
5574,
29898,
29926,
29961,
29900,
22322,
978,
2033,
1275,
525,
5431,
29889,
1372,
29894,
1495,
13,
13,
13,
1678,
732,
17640,
29889,
5041,
877,
2754,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1495,
13,
1678,
822,
1243,
29918,
1202,
29879,
29918,
1482,
29918,
10314,
29918,
517,
29918,
1287,
3493,
29918,
4878,
29906,
29898,
1311,
29892,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1125,
13,
4706,
14550,
13,
4706,
22680,
393,
278,
2009,
20092,
471,
2854,
577,
393,
278,
29871,
13,
4706,
7882,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
740,
13,
4706,
3639,
263,
1051,
310,
7882,
29889,
9794,
29889,
6848,
8871,
29889,
29871,
13,
13,
4706,
2266,
29892,
1243,
393,
591,
788,
393,
6503,
304,
278,
664,
3493,
322,
736,
263,
29871,
29906,
29900,
29896,
29889,
13,
4706,
2266,
29892,
591,
1209,
263,
1024,
363,
278,
8783,
13,
4706,
14550,
13,
4706,
396,
445,
338,
278,
20092,
591,
864,
4502,
304,
278,
740,
29889,
13,
4706,
396,
278,
2989,
2009,
674,
505,
445,
5300,
278,
664,
3493,
13,
4706,
1962,
29918,
978,
353,
525,
5431,
29915,
13,
4706,
20092,
353,
11117,
26705,
2396,
11117,
29874,
2396,
29896,
1118,
525,
4905,
29918,
978,
2396,
1962,
29918,
978,
29913,
13,
13,
4706,
396,
2400,
29892,
591,
1423,
393,
278,
664,
3493,
1820,
4947,
10076,
2986,
13,
4706,
396,
515,
278,
1246,
304,
278,
11265,
1158,
13,
4706,
716,
29918,
10314,
353,
18981,
29889,
12650,
29889,
3258,
29898,
13,
9651,
12271,
353,
1583,
29889,
15227,
29918,
1792,
29918,
29896,
29892,
13,
9651,
2224,
353,
8207,
5372,
29914,
29881,
11770,
29918,
2084,
29914,
1445,
29889,
1372,
29894,
742,
13,
9651,
1024,
353,
525,
5431,
29889,
1372,
29894,
29915,
13,
4706,
1723,
13,
4706,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
29889,
2457,
29918,
1767,
353,
518,
1482,
29918,
10314,
26073,
13,
13,
4706,
396,
7146,
29892,
1246,
278,
16248,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
15227,
29918,
4645,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2271,
29892,
848,
29922,
23813,
29892,
3402,
2433,
3126,
1495,
13,
4706,
1583,
29889,
9294,
5574,
29898,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29906,
29900,
29896,
29918,
27045,
29928,
29897,
13,
13,
4706,
396,
2400,
29892,
591,
1423,
393,
278,
664,
3493,
1820,
4947,
10076,
2986,
13,
4706,
396,
515,
278,
1246,
304,
278,
11265,
1158,
13,
4706,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
29889,
9294,
29918,
13998,
29918,
2541,
29898,
13,
9651,
1583,
29889,
1688,
29918,
4925,
29918,
24713,
29889,
2248,
29918,
978,
29892,
13,
9651,
1583,
29889,
15227,
29918,
1792,
29918,
29896,
29892,
13,
9651,
20092,
1839,
26705,
7464,
13,
9651,
1962,
29918,
978,
13,
4706,
1723,
13,
13,
4706,
432,
353,
2933,
29889,
3126,
580,
13,
4706,
396,
432,
338,
263,
1051,
310,
6503,
8871,
29889,
1334,
2149,
871,
697,
29901,
13,
4706,
1583,
29889,
9294,
5574,
29898,
29926,
29961,
29900,
22322,
978,
2033,
1275,
525,
5431,
29889,
1372,
29894,
1495,
13,
13,
13,
1678,
732,
17640,
29889,
5041,
877,
2754,
29889,
7406,
29889,
3597,
29918,
24713,
29889,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1495,
13,
1678,
822,
1243,
29918,
276,
622,
29879,
29918,
5156,
689,
19667,
29918,
4572,
29898,
1311,
29892,
11187,
29918,
3258,
29918,
24713,
29918,
3166,
29918,
7529,
1125,
13,
4706,
14550,
13,
4706,
4321,
393,
565,
263,
525,
4572,
29915,
1820,
338,
4944,
322,
372,
338,
451,
21213,
29871,
13,
4706,
408,
263,
9657,
29892,
769,
591,
12560,
13,
4706,
14550,
13,
4706,
20092,
353,
426,
13,
9651,
525,
26705,
2396,
525,
10736,
29915,
13,
4706,
500,
13,
4706,
2933,
353,
1583,
29889,
27218,
630,
29918,
15227,
29918,
4645,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2271,
29892,
848,
29922,
23813,
29892,
3402,
2433,
3126,
1495,
13,
4706,
1583,
29889,
9294,
5574,
29898,
5327,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29946,
29900,
29900,
29918,
29933,
3035,
29918,
16244,
29897,
13,
2
] |
feedbacks/migrations/0001_initial.py
|
caputomarcos/pythondotorg
| 1 |
166092
|
<gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Feedback',
fields=[
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200, blank=True, null=True)),
('email', models.EmailField(max_length=75, blank=True, null=True)),
('country', models.CharField(max_length=100, blank=True, null=True)),
('referral_url', models.URLField(blank=True, null=True)),
('is_beta_tester', models.BooleanField(default=False)),
('comment', models.TextField()),
('created', models.DateTimeField(default=django.utils.timezone.now, blank=True)),
],
options={
'verbose_name': 'feedback',
'verbose_name_plural': 'feedbacks',
'ordering': ['created'],
},
bases=(models.Model,),
),
migrations.CreateModel(
name='FeedbackCategory',
fields=[
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('slug', models.SlugField(unique=True)),
],
options={
'verbose_name': 'feedback category',
'verbose_name_plural': 'feedback categories',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='IssueType',
fields=[
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('slug', models.SlugField(unique=True)),
],
options={
'verbose_name': 'issue type',
'verbose_name_plural': 'issue types',
},
bases=(models.Model,),
),
migrations.AddField(
model_name='feedback',
name='feedback_categories',
field=models.ManyToManyField(null=True, to='feedbacks.FeedbackCategory', related_name='feedbacks', blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='feedback',
name='issue_type',
field=models.ForeignKey(null=True, to='feedbacks.IssueType', related_name='feedbacks', blank=True),
preserve_default=True,
),
]
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
9557,
29889,
2585,
1053,
4733,
29892,
9725,
800,
13,
5215,
9557,
29889,
13239,
29889,
2230,
8028,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
29737,
1627,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
16072,
29918,
1989,
29922,
5574,
29892,
4469,
29918,
11600,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
978,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29900,
29900,
29892,
9654,
29922,
5574,
29892,
1870,
29922,
5574,
8243,
13,
18884,
6702,
5269,
742,
4733,
29889,
9823,
3073,
29898,
3317,
29918,
2848,
29922,
29955,
29945,
29892,
9654,
29922,
5574,
29892,
1870,
29922,
5574,
8243,
13,
18884,
6702,
13509,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29896,
29900,
29900,
29892,
9654,
29922,
5574,
29892,
1870,
29922,
5574,
8243,
13,
18884,
6702,
20275,
1705,
29918,
2271,
742,
4733,
29889,
4219,
3073,
29898,
19465,
29922,
5574,
29892,
1870,
29922,
5574,
8243,
13,
18884,
6702,
275,
29918,
3571,
29918,
1688,
261,
742,
4733,
29889,
18146,
3073,
29898,
4381,
29922,
8824,
8243,
13,
18884,
6702,
9342,
742,
4733,
29889,
15778,
25739,
13,
18884,
6702,
11600,
742,
4733,
29889,
11384,
3073,
29898,
4381,
29922,
14095,
29889,
13239,
29889,
2230,
8028,
29889,
3707,
29892,
9654,
29922,
5574,
8243,
13,
9651,
21251,
13,
9651,
3987,
3790,
13,
18884,
525,
369,
15828,
29918,
978,
2396,
525,
18798,
1627,
742,
13,
18884,
525,
369,
15828,
29918,
978,
29918,
572,
3631,
2396,
525,
18798,
1627,
29879,
742,
13,
18884,
525,
2098,
292,
2396,
6024,
11600,
7464,
13,
9651,
2981,
13,
9651,
22561,
7607,
9794,
29889,
3195,
29892,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
29737,
1627,
10900,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
16072,
29918,
1989,
29922,
5574,
29892,
4469,
29918,
11600,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
978,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29900,
29900,
8243,
13,
18884,
6702,
29517,
742,
4733,
29889,
16973,
688,
3073,
29898,
13092,
29922,
5574,
8243,
13,
9651,
21251,
13,
9651,
3987,
3790,
13,
18884,
525,
369,
15828,
29918,
978,
2396,
525,
18798,
1627,
7663,
742,
13,
18884,
525,
369,
15828,
29918,
978,
29918,
572,
3631,
2396,
525,
18798,
1627,
13997,
742,
13,
9651,
2981,
13,
9651,
22561,
7607,
9794,
29889,
3195,
29892,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
29902,
893,
434,
1542,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
16072,
29918,
1989,
29922,
5574,
29892,
4469,
29918,
11600,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
978,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29900,
29900,
8243,
13,
18884,
6702,
29517,
742,
4733,
29889,
16973,
688,
3073,
29898,
13092,
29922,
5574,
8243,
13,
9651,
21251,
13,
9651,
3987,
3790,
13,
18884,
525,
369,
15828,
29918,
978,
2396,
525,
15118,
1134,
742,
13,
18884,
525,
369,
15828,
29918,
978,
29918,
572,
3631,
2396,
525,
15118,
4072,
742,
13,
9651,
2981,
13,
9651,
22561,
7607,
9794,
29889,
3195,
29892,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
18798,
1627,
742,
13,
9651,
1024,
2433,
18798,
1627,
29918,
20683,
742,
13,
9651,
1746,
29922,
9794,
29889,
14804,
1762,
14804,
3073,
29898,
4304,
29922,
5574,
29892,
304,
2433,
18798,
1627,
29879,
29889,
29737,
1627,
10900,
742,
4475,
29918,
978,
2433,
18798,
1627,
29879,
742,
9654,
29922,
5574,
511,
13,
9651,
19905,
29918,
4381,
29922,
5574,
29892,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
18798,
1627,
742,
13,
9651,
1024,
2433,
15118,
29918,
1853,
742,
13,
9651,
1746,
29922,
9794,
29889,
27755,
2558,
29898,
4304,
29922,
5574,
29892,
304,
2433,
18798,
1627,
29879,
29889,
29902,
893,
434,
1542,
742,
4475,
29918,
978,
2433,
18798,
1627,
29879,
742,
9654,
29922,
5574,
511,
13,
9651,
19905,
29918,
4381,
29922,
5574,
29892,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
CGATReport/warnings_directive.py
|
IanSudbery/sphinx-report
| 0 |
151076
|
<reponame>IanSudbery/sphinx-report<filename>CGATReport/warnings_directive.py
# -*- coding: utf-8 -*-
"""
sphinx.ext.warnings
~~~~~~~~~~~~~~~~~~~
Collect all warnings
:copyright: Copyright 2007-2009 by the <NAME>, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import logging
from docutils import nodes
import shelve
from sphinx.locale import _
from sphinx.environment import NoUri
from sphinx.util.compat import Directive
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
CGATREPORT_WARNINGS_CACHE = "cgatreport_warnings.cache"
class cgatreportwarning_node(nodes.warning, nodes.Element):
pass
class cgatreportwarninglist(nodes.General, nodes.Element):
pass
class CGATReportWarning(BaseAdmonition):
node_class = cgatreportwarning_node
# accept error as an optional argument
optional_arguments = 1
def run(self):
r = BaseAdmonition.run(self)
if len(self.arguments) > 0:
warningclass = self.arguments[0]
else:
warningclass = "generic"
env = self.state.document.settings.env
if not hasattr(env, 'cgatreportwarning_all_cgatreportwarnings'):
env.cgatreportwarning_all_cgatreportwarnings = []
error_cache = shelve.open(CGATREPORT_WARNINGS_CACHE)
error_cache["{}:{:06}".format(env.docname, self.lineno)] = (
r[0].deepcopy(), warningclass)
logging.warning("CGATReport-Warning: %s" % warningclass)
return r
class CGATReportWarningList(Directive):
"""
A list of all cgatreportwarning entries.
"""
has_content = False
required_arguments = 0
optional_arguments = 0
final_argument_whitespace = False
option_spec = {}
def run(self):
# Simply insert an empty cgatreportwarninglist node which will
# be replaced later when process_cgatreportwarning_nodes is
# called
return [cgatreportwarninglist('')]
def process_cgatreportwarning_nodes(app, doctree, fromdocname):
if not app.config['cgatreport_show_warnings']:
for node in doctree.traverse(cgatreportwarning_node):
node.parent.remove(node)
# Replace all cgatreportwarninglist nodes with a list of the
# collected cgatreportwarnings. Augment each cgatreportwarning
# with a backlink to the original location.
env = app.builder.env
error_cache = shelve.open(CGATREPORT_WARNINGS_CACHE)
for node in doctree.traverse(cgatreportwarninglist):
if not app.config['cgatreport_show_warnings']:
node.replace_self([])
continue
content = []
nwarnings = 0
para = nodes.paragraph()
sorted_items = sorted(error_cache.items())
para += nodes.Text("There are {} warnings".format(len(sorted_items)))
content.append(para)
for key, value in sorted_items:
docname, lineno = key.split(":")
lineno = int(lineno)
cgatreportwarning, warningclass = value
para = nodes.paragraph()
filename = env.doc2path(docname, base=None)
nwarnings += 1
location_str = '%s:%d ' % (filename, lineno)
try:
description_str = warningclass
except KeyError:
description_str = "unknown"
# Create a reference
newnode = nodes.reference('', '')
innernode = nodes.emphasis(_(location_str), _(location_str))
newnode['refdocname'] = docname
try:
newnode['refuri'] = app.builder.get_relative_uri(
fromdocname, docname)
except NoUri:
# ignore if no URI can be determined, e.g. for LaTeX output
pass
newnode.append(innernode)
para += newnode
para += nodes.Text(description_str, description_str)
para += nodes.Text("\n", "\n")
# (Recursively) resolve references in the cgatreportwarning content
env.resolve_references(cgatreportwarning,
docname,
app.builder)
content.append(para)
node.replace_self(content)
def purge_cgatreportwarnings(app, env, docname):
if not hasattr(env, 'cgatreportwarning_all_cgatreportwarnings'):
return
env.cgatreportwarning_all_cgatreportwarnings = \
[cgatreportwarning for cgatreportwarning in
env.cgatreportwarning_all_cgatreportwarnings
if cgatreportwarning['docname'] != docname]
def visit_cgatreportwarning_node(self, node):
self.visit_admonition(node)
def depart_cgatreportwarning_node(self, node):
self.depart_admonition(node)
def setup(app):
app.add_config_value('cgatreport_show_warnings', True, False)
app.add_node(cgatreportwarninglist)
app.add_node(cgatreportwarning_node,
html=(visit_cgatreportwarning_node,
depart_cgatreportwarning_node),
latex=(
visit_cgatreportwarning_node,
depart_cgatreportwarning_node),
text=(visit_cgatreportwarning_node,
depart_cgatreportwarning_node))
app.add_directive('warning', CGATReportWarning)
app.add_directive('warninglist', CGATReportWarningList)
app.connect('doctree-resolved', process_cgatreportwarning_nodes)
app.connect('env-purge-doc', purge_cgatreportwarnings)
return {'parallel_read_safe': True}
|
[
1,
529,
276,
1112,
420,
29958,
29902,
273,
29903,
566,
495,
29891,
29914,
29879,
561,
14668,
29899,
12276,
29966,
9507,
29958,
11135,
1299,
13020,
29914,
25442,
886,
29918,
11851,
573,
29889,
2272,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
1678,
269,
561,
14668,
29889,
1062,
29889,
25442,
886,
13,
1678,
3695,
26594,
26594,
7377,
13,
13,
1678,
24930,
599,
18116,
13,
13,
29901,
8552,
1266,
29901,
14187,
1266,
29871,
29906,
29900,
29900,
29955,
29899,
29906,
29900,
29900,
29929,
491,
278,
529,
5813,
10202,
1074,
26524,
29950,
24125,
29889,
13,
29901,
506,
1947,
29901,
350,
7230,
29892,
1074,
365,
2965,
1430,
1660,
363,
4902,
29889,
13,
15945,
29908,
13,
13,
5215,
12183,
13,
3166,
1574,
13239,
1053,
7573,
13,
5215,
528,
13841,
13,
13,
3166,
269,
561,
14668,
29889,
23337,
1053,
903,
13,
3166,
269,
561,
14668,
29889,
20944,
1053,
1939,
14702,
13,
3166,
269,
561,
14668,
29889,
4422,
29889,
12667,
1053,
8797,
573,
13,
3166,
1574,
13239,
29889,
862,
4253,
29889,
29878,
303,
29889,
11851,
3145,
29889,
328,
3712,
2187,
1053,
7399,
3253,
3712,
654,
13,
13,
11135,
1299,
1525,
15082,
29918,
29956,
25614,
29903,
29918,
29907,
2477,
9606,
353,
376,
29883,
29887,
6064,
637,
29918,
25442,
886,
29889,
8173,
29908,
13,
13,
13,
1990,
274,
29887,
6064,
637,
27392,
29918,
3177,
29898,
18010,
29889,
27392,
29892,
7573,
29889,
2642,
1125,
13,
1678,
1209,
13,
13,
13,
1990,
274,
29887,
6064,
637,
27392,
1761,
29898,
18010,
29889,
15263,
29892,
7573,
29889,
2642,
1125,
13,
1678,
1209,
13,
13,
13,
1990,
8446,
1299,
13020,
22709,
29898,
5160,
3253,
3712,
654,
1125,
13,
13,
1678,
2943,
29918,
1990,
353,
274,
29887,
6064,
637,
27392,
29918,
3177,
13,
13,
1678,
396,
3544,
1059,
408,
385,
13136,
2980,
13,
1678,
13136,
29918,
25699,
353,
29871,
29896,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
13,
4706,
364,
353,
7399,
3253,
3712,
654,
29889,
3389,
29898,
1311,
29897,
13,
13,
4706,
565,
7431,
29898,
1311,
29889,
25699,
29897,
1405,
29871,
29900,
29901,
13,
9651,
9177,
1990,
353,
1583,
29889,
25699,
29961,
29900,
29962,
13,
4706,
1683,
29901,
13,
9651,
9177,
1990,
353,
376,
19206,
29908,
13,
13,
4706,
8829,
353,
1583,
29889,
3859,
29889,
3225,
29889,
11027,
29889,
6272,
13,
4706,
565,
451,
756,
5552,
29898,
6272,
29892,
525,
29883,
29887,
6064,
637,
27392,
29918,
497,
29918,
29883,
29887,
6064,
637,
25442,
886,
29374,
13,
9651,
8829,
29889,
29883,
29887,
6064,
637,
27392,
29918,
497,
29918,
29883,
29887,
6064,
637,
25442,
886,
353,
5159,
13,
13,
4706,
1059,
29918,
8173,
353,
528,
13841,
29889,
3150,
29898,
11135,
1299,
1525,
15082,
29918,
29956,
25614,
29903,
29918,
29907,
2477,
9606,
29897,
13,
13,
4706,
1059,
29918,
8173,
3366,
29912,
6177,
25641,
29900,
29953,
29913,
1642,
4830,
29898,
6272,
29889,
1514,
978,
29892,
1583,
29889,
1915,
8154,
4638,
353,
313,
13,
9651,
364,
29961,
29900,
1822,
24535,
8552,
3285,
9177,
1990,
29897,
13,
13,
4706,
12183,
29889,
27392,
703,
11135,
1299,
13020,
29899,
22709,
29901,
1273,
29879,
29908,
1273,
9177,
1990,
29897,
13,
13,
4706,
736,
364,
13,
13,
13,
1990,
8446,
1299,
13020,
22709,
1293,
29898,
17392,
573,
1125,
13,
13,
1678,
9995,
13,
1678,
319,
1051,
310,
599,
274,
29887,
6064,
637,
27392,
9976,
29889,
13,
1678,
9995,
13,
13,
1678,
756,
29918,
3051,
353,
7700,
13,
1678,
3734,
29918,
25699,
353,
29871,
29900,
13,
1678,
13136,
29918,
25699,
353,
29871,
29900,
13,
1678,
2186,
29918,
23516,
29918,
1332,
3246,
3535,
353,
7700,
13,
1678,
2984,
29918,
6550,
353,
6571,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
396,
3439,
17632,
4635,
385,
4069,
274,
29887,
6064,
637,
27392,
1761,
2943,
607,
674,
13,
4706,
396,
367,
8611,
2678,
746,
1889,
29918,
29883,
29887,
6064,
637,
27392,
29918,
18010,
338,
13,
4706,
396,
2000,
13,
4706,
736,
518,
29883,
29887,
6064,
637,
27392,
1761,
877,
1495,
29962,
13,
13,
13,
1753,
1889,
29918,
29883,
29887,
6064,
637,
27392,
29918,
18010,
29898,
932,
29892,
437,
312,
929,
29892,
515,
1514,
978,
1125,
13,
1678,
565,
451,
623,
29889,
2917,
1839,
29883,
29887,
6064,
637,
29918,
4294,
29918,
25442,
886,
2033,
29901,
13,
4706,
363,
2943,
297,
437,
312,
929,
29889,
3018,
3901,
29898,
29883,
29887,
6064,
637,
27392,
29918,
3177,
1125,
13,
9651,
2943,
29889,
3560,
29889,
5992,
29898,
3177,
29897,
13,
13,
1678,
396,
22108,
599,
274,
29887,
6064,
637,
27392,
1761,
7573,
411,
263,
1051,
310,
278,
13,
1678,
396,
16531,
274,
29887,
6064,
637,
25442,
886,
29889,
29871,
22333,
358,
1269,
274,
29887,
6064,
637,
27392,
13,
1678,
396,
411,
263,
1250,
2324,
304,
278,
2441,
4423,
29889,
13,
1678,
8829,
353,
623,
29889,
16409,
29889,
6272,
13,
13,
1678,
1059,
29918,
8173,
353,
528,
13841,
29889,
3150,
29898,
11135,
1299,
1525,
15082,
29918,
29956,
25614,
29903,
29918,
29907,
2477,
9606,
29897,
13,
13,
1678,
363,
2943,
297,
437,
312,
929,
29889,
3018,
3901,
29898,
29883,
29887,
6064,
637,
27392,
1761,
1125,
13,
4706,
565,
451,
623,
29889,
2917,
1839,
29883,
29887,
6064,
637,
29918,
4294,
29918,
25442,
886,
2033,
29901,
13,
9651,
2943,
29889,
6506,
29918,
1311,
4197,
2314,
13,
9651,
6773,
13,
13,
4706,
2793,
353,
5159,
13,
4706,
302,
25442,
886,
353,
29871,
29900,
13,
13,
4706,
1702,
353,
7573,
29889,
26956,
580,
13,
4706,
12705,
29918,
7076,
353,
12705,
29898,
2704,
29918,
8173,
29889,
7076,
3101,
13,
4706,
1702,
4619,
7573,
29889,
1626,
703,
8439,
526,
6571,
18116,
1642,
4830,
29898,
2435,
29898,
24582,
29918,
7076,
4961,
13,
4706,
2793,
29889,
4397,
29898,
22752,
29897,
13,
13,
4706,
363,
1820,
29892,
995,
297,
12705,
29918,
7076,
29901,
13,
13,
9651,
1574,
978,
29892,
6276,
8154,
353,
1820,
29889,
5451,
703,
29901,
1159,
13,
9651,
6276,
8154,
353,
938,
29898,
1915,
8154,
29897,
13,
9651,
274,
29887,
6064,
637,
27392,
29892,
9177,
1990,
353,
995,
13,
13,
9651,
1702,
353,
7573,
29889,
26956,
580,
13,
13,
9651,
10422,
353,
8829,
29889,
1514,
29906,
2084,
29898,
1514,
978,
29892,
2967,
29922,
8516,
29897,
13,
13,
9651,
302,
25442,
886,
4619,
29871,
29896,
13,
9651,
4423,
29918,
710,
353,
14210,
29879,
16664,
29881,
525,
1273,
313,
9507,
29892,
6276,
8154,
29897,
13,
13,
9651,
1018,
29901,
13,
18884,
6139,
29918,
710,
353,
9177,
1990,
13,
9651,
5174,
7670,
2392,
29901,
13,
18884,
6139,
29918,
710,
353,
376,
26690,
29908,
13,
13,
9651,
396,
6204,
263,
3407,
13,
9651,
716,
3177,
353,
7573,
29889,
5679,
877,
742,
27255,
13,
9651,
7622,
824,
356,
353,
7573,
29889,
7278,
25101,
7373,
29898,
5479,
29918,
710,
511,
903,
29898,
5479,
29918,
710,
876,
13,
9651,
716,
3177,
1839,
999,
1514,
978,
2033,
353,
1574,
978,
13,
13,
9651,
1018,
29901,
13,
18884,
716,
3177,
1839,
999,
5338,
2033,
353,
623,
29889,
16409,
29889,
657,
29918,
22925,
29918,
5338,
29898,
13,
462,
1678,
515,
1514,
978,
29892,
1574,
978,
29897,
13,
9651,
5174,
1939,
14702,
29901,
13,
18884,
396,
11455,
565,
694,
23539,
508,
367,
10087,
29892,
321,
29889,
29887,
29889,
363,
29186,
1962,
13,
18884,
1209,
13,
9651,
716,
3177,
29889,
4397,
29898,
2559,
824,
356,
29897,
13,
13,
9651,
1702,
4619,
716,
3177,
13,
9651,
1702,
4619,
7573,
29889,
1626,
29898,
8216,
29918,
710,
29892,
6139,
29918,
710,
29897,
13,
9651,
1702,
4619,
7573,
29889,
1626,
14182,
29876,
613,
6634,
29876,
1159,
13,
13,
9651,
396,
313,
4789,
1295,
3598,
29897,
8814,
9282,
297,
278,
274,
29887,
6064,
637,
27392,
2793,
13,
9651,
8829,
29889,
17863,
29918,
276,
10662,
29898,
29883,
29887,
6064,
637,
27392,
29892,
13,
462,
462,
259,
1574,
978,
29892,
13,
462,
462,
259,
623,
29889,
16409,
29897,
13,
13,
9651,
2793,
29889,
4397,
29898,
22752,
29897,
13,
13,
4706,
2943,
29889,
6506,
29918,
1311,
29898,
3051,
29897,
13,
13,
13,
1753,
3708,
479,
29918,
29883,
29887,
6064,
637,
25442,
886,
29898,
932,
29892,
8829,
29892,
1574,
978,
1125,
13,
1678,
565,
451,
756,
5552,
29898,
6272,
29892,
525,
29883,
29887,
6064,
637,
27392,
29918,
497,
29918,
29883,
29887,
6064,
637,
25442,
886,
29374,
13,
4706,
736,
13,
1678,
8829,
29889,
29883,
29887,
6064,
637,
27392,
29918,
497,
29918,
29883,
29887,
6064,
637,
25442,
886,
353,
320,
13,
4706,
518,
29883,
29887,
6064,
637,
27392,
363,
274,
29887,
6064,
637,
27392,
297,
13,
308,
8829,
29889,
29883,
29887,
6064,
637,
27392,
29918,
497,
29918,
29883,
29887,
6064,
637,
25442,
886,
13,
308,
565,
274,
29887,
6064,
637,
27392,
1839,
1514,
978,
2033,
2804,
1574,
978,
29962,
13,
13,
13,
1753,
6493,
29918,
29883,
29887,
6064,
637,
27392,
29918,
3177,
29898,
1311,
29892,
2943,
1125,
13,
1678,
1583,
29889,
1730,
277,
29918,
328,
3712,
654,
29898,
3177,
29897,
13,
13,
13,
1753,
5840,
29918,
29883,
29887,
6064,
637,
27392,
29918,
3177,
29898,
1311,
29892,
2943,
1125,
13,
1678,
1583,
29889,
311,
1595,
29918,
328,
3712,
654,
29898,
3177,
29897,
13,
13,
13,
1753,
6230,
29898,
932,
1125,
13,
1678,
623,
29889,
1202,
29918,
2917,
29918,
1767,
877,
29883,
29887,
6064,
637,
29918,
4294,
29918,
25442,
886,
742,
5852,
29892,
7700,
29897,
13,
13,
1678,
623,
29889,
1202,
29918,
3177,
29898,
29883,
29887,
6064,
637,
27392,
1761,
29897,
13,
1678,
623,
29889,
1202,
29918,
3177,
29898,
29883,
29887,
6064,
637,
27392,
29918,
3177,
29892,
13,
462,
3472,
7607,
1730,
277,
29918,
29883,
29887,
6064,
637,
27392,
29918,
3177,
29892,
13,
462,
539,
5840,
29918,
29883,
29887,
6064,
637,
27392,
29918,
3177,
511,
13,
462,
5683,
29916,
7607,
13,
462,
268,
6493,
29918,
29883,
29887,
6064,
637,
27392,
29918,
3177,
29892,
13,
462,
268,
5840,
29918,
29883,
29887,
6064,
637,
27392,
29918,
3177,
511,
13,
462,
1426,
7607,
1730,
277,
29918,
29883,
29887,
6064,
637,
27392,
29918,
3177,
29892,
13,
462,
539,
5840,
29918,
29883,
29887,
6064,
637,
27392,
29918,
3177,
876,
13,
13,
1678,
623,
29889,
1202,
29918,
11851,
573,
877,
27392,
742,
8446,
1299,
13020,
22709,
29897,
13,
1678,
623,
29889,
1202,
29918,
11851,
573,
877,
27392,
1761,
742,
8446,
1299,
13020,
22709,
1293,
29897,
13,
1678,
623,
29889,
6915,
877,
1867,
312,
929,
29899,
9778,
1490,
742,
1889,
29918,
29883,
29887,
6064,
637,
27392,
29918,
18010,
29897,
13,
1678,
623,
29889,
6915,
877,
6272,
29899,
15503,
479,
29899,
1514,
742,
3708,
479,
29918,
29883,
29887,
6064,
637,
25442,
886,
29897,
13,
13,
1678,
736,
11117,
23482,
29918,
949,
29918,
11177,
2396,
5852,
29913,
13,
2
] |
spinoffs/inference_gym/inference_gym/targets/eight_schools_test.py
|
PavanKishore21/probability
| 3,670 |
30679
|
# Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""Tests for inference_gym.targets.eight_schools."""
import tensorflow.compat.v2 as tf
from inference_gym.internal import test_util
from inference_gym.targets import eight_schools
@test_util.multi_backend_test(globals(), 'targets.eight_schools_test')
class EightSchoolsTest(test_util.InferenceGymTestCase):
def testEightSchools(self):
"""Checks that unconstrained parameters yield finite joint densities."""
model = eight_schools.EightSchools()
self.validate_log_prob_and_transforms(
model,
sample_transformation_shapes=dict(identity={
'avg_effect': [],
'log_stddev': [],
'school_effects': [8],
}),
check_ground_truth_mean_standard_error=True,
check_ground_truth_mean=True,
check_ground_truth_standard_deviation=True)
@test_util.numpy_disable_gradient_test
def testEightSchoolsHMC(self):
"""Checks approximate samples from the model against the ground truth."""
model = eight_schools.EightSchools()
self.validate_ground_truth_using_hmc(
model,
num_chains=4,
num_steps=4000,
num_leapfrog_steps=10,
step_size=0.4,
)
if __name__ == '__main__':
tf.test.main()
|
[
1,
396,
14187,
1266,
29871,
29906,
29900,
29906,
29900,
450,
323,
6073,
17907,
1019,
29890,
3097,
13189,
943,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
15945,
29908,
24376,
363,
27262,
29918,
29887,
962,
29889,
5182,
29879,
29889,
29872,
523,
29918,
816,
8789,
1213,
15945,
13,
13,
5215,
26110,
29889,
12667,
29889,
29894,
29906,
408,
15886,
13,
13,
3166,
27262,
29918,
29887,
962,
29889,
7564,
1053,
1243,
29918,
4422,
13,
3166,
27262,
29918,
29887,
962,
29889,
5182,
29879,
1053,
9475,
29918,
816,
8789,
13,
13,
13,
29992,
1688,
29918,
4422,
29889,
9910,
29918,
27852,
29918,
1688,
29898,
23705,
1338,
3285,
525,
5182,
29879,
29889,
29872,
523,
29918,
816,
8789,
29918,
1688,
1495,
13,
1990,
382,
523,
4504,
8789,
3057,
29898,
1688,
29918,
4422,
29889,
797,
1659,
29954,
962,
3057,
8259,
1125,
13,
13,
29871,
822,
1243,
29923,
523,
4504,
8789,
29898,
1311,
1125,
13,
1678,
9995,
5596,
29879,
393,
443,
3075,
22042,
4128,
7709,
8093,
14002,
6245,
1907,
1213,
15945,
13,
1678,
1904,
353,
9475,
29918,
816,
8789,
29889,
29923,
523,
4504,
8789,
580,
13,
1678,
1583,
29889,
15480,
29918,
1188,
29918,
22795,
29918,
392,
29918,
9067,
29879,
29898,
13,
4706,
1904,
29892,
13,
4706,
4559,
29918,
3286,
5404,
29918,
845,
11603,
29922,
8977,
29898,
22350,
3790,
13,
9651,
525,
485,
29887,
29918,
15987,
2396,
19997,
13,
9651,
525,
1188,
29918,
4172,
3359,
2396,
19997,
13,
9651,
525,
27041,
29918,
15987,
29879,
2396,
518,
29947,
1402,
13,
4706,
500,
511,
13,
4706,
1423,
29918,
2057,
29918,
509,
2806,
29918,
12676,
29918,
15770,
29918,
2704,
29922,
5574,
29892,
13,
4706,
1423,
29918,
2057,
29918,
509,
2806,
29918,
12676,
29922,
5574,
29892,
13,
4706,
1423,
29918,
2057,
29918,
509,
2806,
29918,
15770,
29918,
311,
14641,
29922,
5574,
29897,
13,
13,
29871,
732,
1688,
29918,
4422,
29889,
23749,
29918,
20472,
29918,
24970,
29918,
1688,
13,
29871,
822,
1243,
29923,
523,
4504,
8789,
29950,
12513,
29898,
1311,
1125,
13,
1678,
9995,
5596,
29879,
26368,
11916,
515,
278,
1904,
2750,
278,
5962,
8760,
1213,
15945,
13,
1678,
1904,
353,
9475,
29918,
816,
8789,
29889,
29923,
523,
4504,
8789,
580,
13,
13,
1678,
1583,
29889,
15480,
29918,
2057,
29918,
509,
2806,
29918,
4746,
29918,
7184,
29883,
29898,
13,
4706,
1904,
29892,
13,
4706,
954,
29918,
305,
2708,
29922,
29946,
29892,
13,
4706,
954,
29918,
24530,
29922,
29946,
29900,
29900,
29900,
29892,
13,
4706,
954,
29918,
280,
481,
29888,
9102,
29918,
24530,
29922,
29896,
29900,
29892,
13,
4706,
4331,
29918,
2311,
29922,
29900,
29889,
29946,
29892,
13,
1678,
1723,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
29871,
15886,
29889,
1688,
29889,
3396,
580,
13,
2
] |
tests/codegen/unroller_test.py
|
tobiasholenstein/dace
| 0 |
85418
|
<reponame>tobiasholenstein/dace
# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.
import dace
import numpy as np
import unittest
@dace.program
def Copy(output: dace.int32[5], input: dace.int32[5]):
@dace.map
def mytasklet(i: _[0:5]):
inp << input[i]
out >> output[i]
out = inp
class UnrollerTest(unittest.TestCase):
def test_unroller(self):
sdfg = Copy.to_sdfg()
# Transform map to unrolled
for state in sdfg.nodes():
for node in state.nodes():
if isinstance(node, dace.sdfg.nodes.MapEntry):
node.schedule = dace.ScheduleType.Unrolled
input = np.ones([5], dtype=np.int32)
output = np.zeros([5], dtype=np.int32)
sdfg(output=output, input=input)
self.assertTrue((output == input).all())
if __name__ == '__main__':
unittest.main()
|
[
1,
529,
276,
1112,
420,
29958,
517,
5365,
1161,
18975,
5465,
29914,
29881,
815,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29929,
29899,
29906,
29900,
29906,
29900,
382,
4690,
16318,
436,
322,
278,
7266,
29907,
29872,
15717,
29889,
2178,
10462,
21676,
29889,
13,
5215,
270,
815,
13,
5215,
12655,
408,
7442,
13,
5215,
443,
27958,
13,
13,
29992,
29881,
815,
29889,
8860,
13,
1753,
14187,
29898,
4905,
29901,
270,
815,
29889,
524,
29941,
29906,
29961,
29945,
1402,
1881,
29901,
270,
815,
29889,
524,
29941,
29906,
29961,
29945,
29962,
1125,
13,
1678,
732,
29881,
815,
29889,
1958,
13,
1678,
822,
590,
7662,
1026,
29898,
29875,
29901,
903,
29961,
29900,
29901,
29945,
29962,
1125,
13,
4706,
297,
29886,
3532,
1881,
29961,
29875,
29962,
13,
4706,
714,
5099,
1962,
29961,
29875,
29962,
13,
308,
13,
4706,
714,
353,
297,
29886,
13,
13,
1990,
853,
1825,
3057,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
348,
1825,
29898,
1311,
1125,
13,
4706,
269,
2176,
29887,
353,
14187,
29889,
517,
29918,
29879,
2176,
29887,
580,
13,
13,
4706,
396,
4103,
689,
2910,
304,
443,
24476,
13,
4706,
363,
2106,
297,
269,
2176,
29887,
29889,
18010,
7295,
13,
9651,
363,
2943,
297,
2106,
29889,
18010,
7295,
13,
18884,
565,
338,
8758,
29898,
3177,
29892,
270,
815,
29889,
29879,
2176,
29887,
29889,
18010,
29889,
3388,
9634,
1125,
13,
462,
1678,
2943,
29889,
816,
11272,
353,
270,
815,
29889,
4504,
11272,
1542,
29889,
2525,
24476,
13,
13,
4706,
1881,
353,
7442,
29889,
2873,
4197,
29945,
1402,
26688,
29922,
9302,
29889,
524,
29941,
29906,
29897,
13,
4706,
1962,
353,
7442,
29889,
3298,
359,
4197,
29945,
1402,
26688,
29922,
9302,
29889,
524,
29941,
29906,
29897,
13,
4706,
269,
2176,
29887,
29898,
4905,
29922,
4905,
29892,
1881,
29922,
2080,
29897,
13,
13,
4706,
1583,
29889,
9294,
5574,
3552,
4905,
1275,
1881,
467,
497,
3101,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
cppod.py
|
siqil/CPPOD
| 4 |
138167
|
<gh_stars>1-10
import numpy as np
import torch
import torch.nn as nn
import os
import time
import random
import pickle
import logging
import math
import torch.optim as optim
import pandas as pd
from collections import OrderedDict
import util
class NSMMPP(nn.Module):
def __init__(self, label_size, hidden_size, args, prior=None):
super(NSMMPP, self).__init__()
self.args = args
self.target = args.target
self.device = args.device
self.sigmoid = nn.Sigmoid()
self.tanh = nn.Tanh()
self.softplus = nn.Softplus()
self.label_size = label_size
self.hidden_size = hidden_size
self.num_eq = 7
# add a special event label for initialization
self.Emb = nn.Parameter(self.init_weight(torch.empty(hidden_size, label_size + 1, device=self.device)))
self.W = nn.Parameter(self.init_weight(torch.empty(self.num_eq, hidden_size, hidden_size, device=self.device)))
self.U = nn.Parameter(self.init_weight(torch.empty(self.num_eq, hidden_size, hidden_size, device=self.device)))
self.d = nn.Parameter(torch.zeros(self.num_eq, hidden_size, device=self.device))
self.w = nn.Parameter(self.init_weight(torch.empty(label_size, hidden_size, device=self.device)))
self.log_s = nn.Parameter(torch.zeros(label_size, device=self.device))
self.debug = False
def init_weight(self, w):
stdv = 1. / math.sqrt(w.size()[-1])
w.uniform_(-stdv, stdv)
return w
def scaled_softplus(self, x):
s = torch.exp(self.log_s)
return s * self.softplus(x / s)
# all zeros
def init_hidden(self):
c_t = torch.zeros(self.hidden_size, device=self.device)
c_ = torch.zeros_like(c_t)
h_t = torch.zeros_like(c_t)
hidden = (c_t, h_t, c_, None, None, None)
return hidden
# only compute hidden variables
def forward_one_step(self, label_prev, label, t_prev, t, hidden):
c_t, h_t, c_, _, _, _ = hidden
temp = self.W.matmul(label_prev) + self.U.matmul(h_t) + self.d
i = self.sigmoid(temp[0, :])
f = self.sigmoid(temp[1, :])
z = self.tanh(temp[2, :])
o = self.sigmoid(temp[3, :])
i_ = self.sigmoid(temp[4, :])
f_ = self.sigmoid(temp[5, :])
delta = self.softplus(temp[6, :])
c = f * c_t + i * z
c_ = f_ * c_ + i_ * z
c_t = c_ + (c - c_) * torch.exp(-delta * (t - t_prev))
h_t = o * self.tanh(c_t)
hidden = (c_t, h_t, c_, c, delta, o)
return hidden
def h_to_lambd(self, h):
lambd_tilda = h.matmul(self.w.t())
lambd = self.scaled_softplus(lambd_tilda)
return lambd + 1e-9
# compute NLL loss given a label_seq and a time_seq
# sim_time_seq is simlulated times for computing integral
def loglik(self, label_seq, time_seq, sim_time_seq, sim_time_idx, ignore_first):
n = len(time_seq)
# collect states right after each event
# last event is EOS marker
all_c = torch.zeros(n-1, self.hidden_size, device=self.device)
all_c_ = torch.zeros_like(all_c)
all_delta = torch.zeros_like(all_c)
all_o = torch.zeros_like(all_c)
all_h_t = torch.zeros_like(all_c)
hidden = self.init_hidden()
# BOS event is 0 at time 0
label_prev = self.Emb[:, label_seq[0]].squeeze()
t_prev = time_seq[0]
for i in range(1,n):
label = self.Emb[:, label_seq[i]].squeeze()
t = time_seq[i]
hidden = self.forward_one_step(label_prev, label, t_prev, t, hidden)
_, all_h_t[i-1, :], all_c_[i-1, :], all_c[i-1, :], all_delta[i-1, :], all_o[i-1, :] = hidden
label_prev = label
t_prev = t
if ignore_first:
beg = 1
else:
beg = 0
target = self.target
h_t = all_h_t[beg:-1, :]
if h_t.shape[0] > 0:
lambd = self.h_to_lambd(h_t)
term1 = (lambd[label_seq[(1+beg):-1] == target, target-1]).log().sum()
else:
term1 = 0
c_sim = all_c_[sim_time_idx, :] + \
(all_c[sim_time_idx, :] - all_c_[sim_time_idx, :]) * \
torch.exp(-all_delta[sim_time_idx, :] * (sim_time_seq - time_seq[sim_time_idx])[:, None])
h_sim = all_o[sim_time_idx, :] * self.tanh(c_sim)
lambd_sim = self.h_to_lambd(h_sim)
term2 = lambd_sim[:, target-1].mean() * (time_seq[-1] - time_seq[0])
loglik = term1 - term2
return -loglik, all_c, all_c_, all_delta, all_o, all_h_t, h_sim
def forward(self, label_seq, time_seq, sim_time_seq, sim_time_idx, ignore_first):
result = self.loglik(label_seq, time_seq, sim_time_seq, sim_time_idx, ignore_first)
return result[0].sum()
def detect_outlier(self, label_seq, time_seq, sim_time_seq, sim_time_idx, sim_time_diffs, time_test, n_sample):
with torch.no_grad():
loglik, all_c, all_c_, all_delta, all_o, all_h_t, h_sim = self.loglik(
label_seq, time_seq, sim_time_seq, sim_time_idx, False)
n = len(time_test)
m = len(time_seq)
score = torch.zeros(n-1, device=self.device)
target = self.target
j = 0
ts = torch.zeros(n_sample, device=self.device)
for i in range(n-1):
t_beg = time_test[i]
t_end = time_test[i+1]
ts.uniform_(t_beg, t_end)
# find the first event after t_beg
while j < m and time_seq[j] <= t_beg:
j += 1
assert(time_seq[j] > t_beg)
assert(time_seq[j-1] <= t_beg)
Lambd = 0
k = j
# calculate Lambda piecewise segmented by events
while k < m and time_seq[k-1] <= t_end:
ts_in_range = ts[(ts > time_seq[k-1]) & (ts <= time_seq[k])]
if len(ts_in_range) > 0:
c = all_c[k-1,:]
c_ = all_c_[k-1,:]
delta = all_delta[k-1,:]
o = all_o[k-1,:]
c_ts = c_ + (c - c_) * torch.exp(-delta[None, :] * (ts_in_range[:, None] - time_seq[k-1]))
h_ts = o * self.tanh(c_ts)
lambd_all = self.h_to_lambd(h_ts)
lambd = lambd_all[:,target-1]
Lambd += lambd.sum() / n_sample
k += 1
Lambd *= (t_end - t_beg)
score[i] = Lambd
lambd = self.h_to_lambd(all_h_t)[:-1]
lambd_sim = self.h_to_lambd(h_sim)
return score, -score, lambd, lambd_sim
def detect_outlier_instant(self, label_seq, time_seq, sim_time_seq, sim_time_idx, sim_time_diffs, time_test):
with torch.no_grad():
loglik, all_c, all_c_, all_delta, all_o, all_h_t, h_sim = self.loglik(
label_seq, time_seq, sim_time_seq, sim_time_idx, False)
n = len(time_test)
m = len(time_seq)
score = torch.zeros(n-1, device=self.device)
target = self.target
j = 0
for i in range(n-1):
t_end = time_test[i+1]
if t_end == 0:
j = 1
else:
# find the first event at/after t_end
while j < m and time_seq[j] < t_end:
j += 1
assert(time_seq[j] >= t_end)
# last event before t_end
assert(time_seq[j-1] < t_end)
c = all_c[j-1,:]
c_ = all_c_[j-1,:]
delta = all_delta[j-1,:]
o = all_o[j-1,:]
c_ts = c_ + (c - c_) * torch.exp(-delta * (t_end - time_seq[j-1]))
h_ts = o * self.tanh(c_ts)
lambd_all = self.h_to_lambd(h_ts)
lambd = lambd_all[target-1]
score[i] = lambd
lambd = self.h_to_lambd(all_h_t)[:-1]
lambd_sim = self.h_to_lambd(h_sim)
return score, -score, lambd, lambd_sim
class ModelManager:
def __init__(self, train_set, val_set, test_set, save_path, args):
self.args = args
self.device = args.device
self.target = args.target
self.sim_time_diffs = None
self.train_set, time_train, count_train = self.prepare(train_set, args.sample_multiplier)
self.val_set, time_val, count_val = self.prepare(val_set, args.sample_multiplier)
self.test_set, _, _ = self.prepare(test_set, args.sample_multiplier)
self.horizon = (time_train+time_val)/(count_train+count_val)
self.dt = 1
self.model_path = save_path
self.ignore_first = args.ignore_first
def prepare(self, data_set, multiple, diff_sample_size=100, regular=False, step=None):
if data_set is None:
return None, None, None
output = []
total_time = 0
total_count = 0
for seq in data_set:
label_seq = torch.tensor(
np.concatenate(([0], seq['mark'], [0])),
dtype=torch.long,
device=self.device
)
time_seq = torch.tensor(
np.concatenate(([seq['start']], seq['time'], [seq['stop']])),
dtype=torch.float,
device=self.device
)
n = len(time_seq)
t0 = seq['start']
tn = seq['stop']
total_time += tn - t0
total_count += (label_seq == 1).sum()
if regular:
sim_time_seq = torch.arange(t0, tn, step, device=self.device)
sim_time_idx = torch.zeros_like(sim_time_seq, dtype=torch.long)
else:
sim_time_seq = time_seq.new_empty(n * multiple)
sim_time_seq.uniform_(t0, tn)
sim_time_idx = label_seq.new_zeros(n * multiple)
for j in range(n - 1):
sim_time_idx[(sim_time_seq > time_seq[j]) &
(sim_time_seq <= time_seq[j + 1])
] = j
if self.sim_time_diffs is None:
temp = sim_time_seq.new_empty(diff_sample_size)
temp.exponential_(1)
self.sim_time_diffs, _ = torch.sort(temp)
if seq['time_test'] is None:
time_test = None
else:
time_test = torch.tensor(
seq['time_test'],
dtype=torch.float,
device=self.device)
if seq['label_test'] is None:
label_test = None
else:
label_test = torch.tensor(
seq['label_test'],
device=self.device,
)
item = {
'id': seq['id'],
'label_seq': label_seq,
'time_seq': time_seq,
'sim_time_seq': sim_time_seq,
'sim_time_idx': sim_time_idx,
'sim_time_diffs' : self.sim_time_diffs,
'time_test': time_test,
'label_test': label_test,
'lambda_x': seq['lambda_x'],
't_x': seq['t_x'],
}
output.append(item)
return output, total_time, total_count
def train_one_epoch(self, model, train_set, optimizer):
log_interval = self.args.log_interval
total_loss = 0
total_num_seq = len(train_set)
start_time = time.time()
for seq_idx, item in enumerate(train_set):
optimizer.zero_grad()
loss = model(item['label_seq'],
item['time_seq'],
item['sim_time_seq'],
item['sim_time_idx'],
False)
loss.backward()
optimizer.step()
total_loss += loss.item()
if seq_idx % log_interval == 0 and seq_idx > 0:
cur_loss = total_loss / log_interval
elapsed = time.time() - start_time
logging.info('| {:5d}/{:5d} seqs | '
'ms/seq {:5.2f} | '
'loss {:5.2f} |'.format(
seq_idx, total_num_seq,
elapsed * 1000 / log_interval, cur_loss))
total_loss = 0
start_time = time.time()
def train(self, model, epochs=None, use_all_data=False, name="model.pt"):
best_val_loss = None
optimizer = optim.Adam(model.parameters(),
lr=self.args.lr)
if epochs is None:
early_stop = True
epochs = self.args.epochs
else:
early_stop = False
for epoch in range(1, epochs+1):
epoch_start_time = time.time()
if use_all_data:
train_set = self.train_set + self.val_set
else:
train_set = self.train_set
self.train_one_epoch(model, train_set, optimizer)
val_loss = self.evaluate(model)
logging.info('-' * 89)
logging.info('| end of epoch {:3d} | time: {:5.2f}s | '
'valid loss {:f} |'.format(
epoch, (time.time() - epoch_start_time),
val_loss))
logging.info('-' * 89)
if best_val_loss is None or val_loss < best_val_loss:
self.save_model(model, name)
best_val_loss = val_loss
elif early_stop:
epochs = epoch - 1
break
if best_val_loss:
self.load_model(model, name)
return best_val_loss, epochs
def evaluate(self, model):
total_loss = 0
for seq_idx, item in enumerate(self.val_set):
loss = model(
item['label_seq'],
item['time_seq'],
item['sim_time_seq'],
item['sim_time_idx'],
self.ignore_first
)
total_loss += loss.item()
return total_loss
def likelihood(self, model, dataset):
total_loss = 0
for seq_idx, item in enumerate(dataset):
loss = model(
item['label_seq'],
item['time_seq'],
item['sim_time_seq'],
item['sim_time_idx'],
self.ignore_first
)
total_loss += loss.item()
return total_loss
def detect_outlier(self, model, debug=False, instant=False):
log_interval = self.args.log_interval
results = []
n = len(self.test_set)
start_time = time.time()
for seq_idx, item in enumerate(self.test_set):
if instant:
score_omiss, score_commiss, lambd, lambd_sim = model.detect_outlier_instant(
item['label_seq'],
item['time_seq'],
item['sim_time_seq'],
item['sim_time_idx'],
item['sim_time_diffs'],
item['time_test'],
)
else:
score_omiss, score_commiss, lambd, lambd_sim = model.detect_outlier(
item['label_seq'],
item['time_seq'],
item['sim_time_seq'],
item['sim_time_idx'],
item['sim_time_diffs'],
item['time_test'],
n_sample=1000
)
df = pd.DataFrame(OrderedDict({
'seq': seq_idx,
'time': item['time_test'].numpy()[1:],
'score_omiss': score_omiss.numpy(),
'score_commiss': score_commiss.numpy(),
'label': item['label_test'].numpy(),
}))
if item['id'] is None:
df.insert(0, 'id', seq_idx+1)
else:
df.insert(0, 'id', item['id'])
results.append(df)
if (seq_idx+1) % log_interval == 0:
logging.info(f'Finished detecting outliers in seq {seq_idx+1}/{n} in {(time.time()-start_time):.2f}s')
start_time = time.time()
results = pd.concat(results)
return results
def save_model(self, model, name):
with open(os.path.join(self.model_path, name), 'wb') as f:
torch.save(model.state_dict(), f)
def load_model(self, model, name):
with open(os.path.join(self.model_path, name), 'rb') as f:
model.load_state_dict(torch.load(f))
class ContextDataLoader:
def __init__(self, train_set, test_set, label_size, target=1):
self.label_size = label_size
self.target = target
n = len(train_set)
n_train = int(n*0.8)
n_train_val = n
self.train_set = self.convert(train_set[:n_train])
self.val_set = self.convert(train_set[n_train:n_train_val])
self.test_set = self.convert(test_set)
def convert(self, seqs):
if seqs is None:
return None
m_t = self.target + 1
def _convert(seq):
seq_id = seq.get('id')
time_c = seq['time_context']
mark_c = seq['mark_context']
start = seq['start']
stop = seq['stop']
time_t = seq['time_target']
mark_t = seq['mark_target']
assert(util.is_sorted(time_c))
assert(util.is_sorted(time_t))
time = []
mark = []
i_c = 0
i_t = 0
n_c = len(time_c)
n_t = len(time_t)
assert(n_c == len(mark_c))
assert(n_t == len(mark_t))
while i_c < n_c and i_t < n_t:
if time_t[i_t] <= time_c[i_c]:
time.append(time_t[i_t])
mark.append(mark_t[i_t])
i_t += 1
else:
time.append(time_c[i_c])
mark.append(m_t + mark_c[i_c])
i_c += 1
if i_t < n_t:
time.extend(time_t[i_t:])
mark.extend(mark_t[i_t:])
if i_c < n_c:
time.extend(time_c[i_c:])
mark.extend(m_t + mark_c[i_c:])
return {
'id': seq_id,
'time': time,
'mark': mark,
'start': start,
'stop': stop,
'time_test': seq.get('time_test'),
'label_test': seq.get('label_test'),
'lambda_x': seq.get('lambda_x'),
't_x': seq.get('t_x'),
}
return [_convert(seq) for seq in seqs]
class NonContextDataLoader(ContextDataLoader):
def convert(self, seqs):
if seqs is None:
return None
def _convert(seq):
seq_id = seq.get('id')
start = seq['start']
stop = seq['stop']
time_t = seq['time_target']
mark_t = seq['mark_target']
assert(util.is_sorted(time_t))
assert(len(time_t) == len(mark_t))
return {
'id': seq_id,
'time': time_t,
'mark': mark_t,
'start': start,
'stop': stop,
'time_test': seq.get('time_test'),
'label_test': seq.get('label_test'),
'lambda_x': seq.get('lambda_x'),
't_x': seq.get('t_x'),
}
return [_convert(seq) for seq in seqs]
class UnlabelContextDataLoader(ContextDataLoader):
def convert(self, seqs):
if seqs is None:
return None
m_t = self.target + 1
def _convert(seq):
seq_id = seq.get('id')
time_c = seq['time_context']
mark_c = seq['mark_context']
start = seq['start']
stop = seq['stop']
time_t = seq['time_target']
mark_t = seq['mark_target']
assert(util.is_sorted(time_c))
assert(util.is_sorted(time_t))
time = []
mark = []
i_c = 0
i_t = 0
n_c = len(time_c)
n_t = len(time_t)
assert(n_c == len(mark_c))
assert(n_t == len(mark_t))
while i_c < n_c and i_t < n_t:
if time_t[i_t] <= time_c[i_c]:
time.append(time_t[i_t])
mark.append(mark_t[i_t])
i_t += 1
else:
time.append(time_c[i_c])
mark.append(m_t + mark_c[i_c])
i_c += 1
if i_t < n_t:
time.extend(time_t[i_t:])
mark.extend(mark_t[i_t:])
if i_c < n_c:
time.extend(time_c[i_c:])
mark.extend(m_t + mark_c[i_c:])
assert(seq.get('time_test') is None)
assert(seq.get('label_test') is None)
if start == time_t[0]:
# if starts with a target event
# just use it as the start
time_test = np.array(time_t)
else:
# otherwise add a start
time_test = np.array(np.concatenate(([start], time_t)))
# first event marks the start and is not tested
label_test = np.zeros_like(time_test[1:])
return {
'id': seq_id,
'time': time,
'mark': mark,
'start': start,
'stop': stop,
'time_test': time_test,
'label_test': label_test,
'lambda_x': None,
't_x': None,
}
return [_convert(seq) for seq in seqs]
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
12655,
408,
7442,
13,
5215,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
5215,
2897,
13,
5215,
931,
13,
5215,
4036,
13,
5215,
5839,
280,
13,
5215,
12183,
13,
5215,
5844,
13,
5215,
4842,
305,
29889,
20640,
408,
5994,
13,
5215,
11701,
408,
10518,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
5215,
3667,
13,
13,
1990,
3865,
29924,
3580,
29925,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3858,
29918,
2311,
29892,
7934,
29918,
2311,
29892,
6389,
29892,
7536,
29922,
8516,
1125,
13,
4706,
2428,
29898,
3059,
29924,
3580,
29925,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
5085,
353,
6389,
13,
4706,
1583,
29889,
5182,
353,
6389,
29889,
5182,
13,
4706,
1583,
29889,
10141,
353,
6389,
29889,
10141,
13,
4706,
1583,
29889,
18816,
29885,
3398,
353,
302,
29876,
29889,
29903,
335,
29885,
3398,
580,
13,
4706,
1583,
29889,
13161,
29882,
353,
302,
29876,
29889,
29911,
27731,
580,
13,
4706,
1583,
29889,
2695,
11242,
353,
302,
29876,
29889,
6295,
615,
11242,
580,
13,
4706,
1583,
29889,
1643,
29918,
2311,
353,
3858,
29918,
2311,
13,
4706,
1583,
29889,
10892,
29918,
2311,
353,
7934,
29918,
2311,
13,
4706,
1583,
29889,
1949,
29918,
1837,
353,
29871,
29955,
13,
4706,
396,
788,
263,
4266,
1741,
3858,
363,
17865,
13,
4706,
1583,
29889,
6026,
29890,
353,
302,
29876,
29889,
9329,
29898,
1311,
29889,
2344,
29918,
7915,
29898,
7345,
305,
29889,
6310,
29898,
10892,
29918,
2311,
29892,
3858,
29918,
2311,
718,
29871,
29896,
29892,
4742,
29922,
1311,
29889,
10141,
4961,
13,
4706,
1583,
29889,
29956,
353,
302,
29876,
29889,
9329,
29898,
1311,
29889,
2344,
29918,
7915,
29898,
7345,
305,
29889,
6310,
29898,
1311,
29889,
1949,
29918,
1837,
29892,
7934,
29918,
2311,
29892,
7934,
29918,
2311,
29892,
4742,
29922,
1311,
29889,
10141,
4961,
13,
4706,
1583,
29889,
29965,
353,
302,
29876,
29889,
9329,
29898,
1311,
29889,
2344,
29918,
7915,
29898,
7345,
305,
29889,
6310,
29898,
1311,
29889,
1949,
29918,
1837,
29892,
7934,
29918,
2311,
29892,
7934,
29918,
2311,
29892,
4742,
29922,
1311,
29889,
10141,
4961,
13,
4706,
1583,
29889,
29881,
353,
302,
29876,
29889,
9329,
29898,
7345,
305,
29889,
3298,
359,
29898,
1311,
29889,
1949,
29918,
1837,
29892,
7934,
29918,
2311,
29892,
4742,
29922,
1311,
29889,
10141,
876,
13,
4706,
1583,
29889,
29893,
353,
302,
29876,
29889,
9329,
29898,
1311,
29889,
2344,
29918,
7915,
29898,
7345,
305,
29889,
6310,
29898,
1643,
29918,
2311,
29892,
7934,
29918,
2311,
29892,
4742,
29922,
1311,
29889,
10141,
4961,
13,
4706,
1583,
29889,
1188,
29918,
29879,
353,
302,
29876,
29889,
9329,
29898,
7345,
305,
29889,
3298,
359,
29898,
1643,
29918,
2311,
29892,
4742,
29922,
1311,
29889,
10141,
876,
13,
4706,
1583,
29889,
8382,
353,
7700,
13,
13,
1678,
822,
2069,
29918,
7915,
29898,
1311,
29892,
281,
1125,
13,
4706,
3659,
29894,
353,
29871,
29896,
29889,
847,
5844,
29889,
3676,
29898,
29893,
29889,
2311,
580,
14352,
29896,
2314,
13,
4706,
281,
29889,
29590,
29918,
6278,
4172,
29894,
29892,
3659,
29894,
29897,
13,
4706,
736,
281,
13,
13,
1678,
822,
6287,
29881,
29918,
2695,
11242,
29898,
1311,
29892,
921,
1125,
13,
4706,
269,
353,
4842,
305,
29889,
4548,
29898,
1311,
29889,
1188,
29918,
29879,
29897,
13,
4706,
736,
269,
334,
1583,
29889,
2695,
11242,
29898,
29916,
847,
269,
29897,
13,
13,
1678,
396,
599,
24786,
13,
1678,
822,
2069,
29918,
10892,
29898,
1311,
1125,
13,
4706,
274,
29918,
29873,
353,
4842,
305,
29889,
3298,
359,
29898,
1311,
29889,
10892,
29918,
2311,
29892,
4742,
29922,
1311,
29889,
10141,
29897,
13,
4706,
274,
29918,
353,
4842,
305,
29889,
3298,
359,
29918,
4561,
29898,
29883,
29918,
29873,
29897,
13,
4706,
298,
29918,
29873,
353,
4842,
305,
29889,
3298,
359,
29918,
4561,
29898,
29883,
29918,
29873,
29897,
13,
4706,
7934,
353,
313,
29883,
29918,
29873,
29892,
298,
29918,
29873,
29892,
274,
3383,
6213,
29892,
6213,
29892,
6213,
29897,
13,
4706,
736,
7934,
13,
13,
1678,
396,
871,
10272,
7934,
3651,
13,
1678,
822,
6375,
29918,
650,
29918,
10568,
29898,
1311,
29892,
3858,
29918,
16304,
29892,
3858,
29892,
260,
29918,
16304,
29892,
260,
29892,
7934,
1125,
13,
4706,
274,
29918,
29873,
29892,
298,
29918,
29873,
29892,
274,
3383,
17117,
17117,
903,
353,
7934,
13,
4706,
5694,
353,
1583,
29889,
29956,
29889,
2922,
16109,
29898,
1643,
29918,
16304,
29897,
718,
1583,
29889,
29965,
29889,
2922,
16109,
29898,
29882,
29918,
29873,
29897,
718,
1583,
29889,
29881,
13,
4706,
474,
353,
1583,
29889,
18816,
29885,
3398,
29898,
7382,
29961,
29900,
29892,
584,
2314,
13,
4706,
285,
353,
1583,
29889,
18816,
29885,
3398,
29898,
7382,
29961,
29896,
29892,
584,
2314,
13,
4706,
503,
353,
1583,
29889,
13161,
29882,
29898,
7382,
29961,
29906,
29892,
584,
2314,
13,
4706,
288,
353,
1583,
29889,
18816,
29885,
3398,
29898,
7382,
29961,
29941,
29892,
584,
2314,
13,
4706,
474,
29918,
353,
1583,
29889,
18816,
29885,
3398,
29898,
7382,
29961,
29946,
29892,
584,
2314,
13,
4706,
285,
29918,
353,
1583,
29889,
18816,
29885,
3398,
29898,
7382,
29961,
29945,
29892,
584,
2314,
13,
4706,
19471,
353,
1583,
29889,
2695,
11242,
29898,
7382,
29961,
29953,
29892,
584,
2314,
13,
4706,
274,
353,
285,
334,
274,
29918,
29873,
718,
474,
334,
503,
13,
4706,
274,
29918,
353,
285,
29918,
334,
274,
29918,
718,
474,
29918,
334,
503,
13,
4706,
274,
29918,
29873,
353,
274,
29918,
718,
313,
29883,
448,
274,
19925,
334,
4842,
305,
29889,
4548,
6278,
4181,
334,
313,
29873,
448,
260,
29918,
16304,
876,
13,
4706,
298,
29918,
29873,
353,
288,
334,
1583,
29889,
13161,
29882,
29898,
29883,
29918,
29873,
29897,
13,
4706,
7934,
353,
313,
29883,
29918,
29873,
29892,
298,
29918,
29873,
29892,
274,
3383,
274,
29892,
19471,
29892,
288,
29897,
13,
4706,
736,
7934,
13,
13,
1678,
822,
298,
29918,
517,
29918,
29880,
1117,
29881,
29898,
1311,
29892,
298,
1125,
13,
4706,
301,
1117,
29881,
29918,
29873,
25949,
353,
298,
29889,
2922,
16109,
29898,
1311,
29889,
29893,
29889,
29873,
3101,
13,
4706,
301,
1117,
29881,
353,
1583,
29889,
7052,
29881,
29918,
2695,
11242,
29898,
29880,
1117,
29881,
29918,
29873,
25949,
29897,
13,
4706,
736,
301,
1117,
29881,
718,
29871,
29896,
29872,
29899,
29929,
13,
13,
1678,
396,
10272,
405,
2208,
6410,
2183,
263,
3858,
29918,
11762,
322,
263,
931,
29918,
11762,
13,
1678,
396,
1027,
29918,
2230,
29918,
11762,
338,
1027,
29880,
7964,
3064,
363,
20602,
10160,
13,
1678,
822,
1480,
5081,
29898,
1311,
29892,
3858,
29918,
11762,
29892,
931,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
13140,
29892,
11455,
29918,
4102,
1125,
13,
4706,
302,
353,
7431,
29898,
2230,
29918,
11762,
29897,
13,
4706,
396,
6314,
5922,
1492,
1156,
1269,
1741,
13,
4706,
396,
1833,
1741,
338,
382,
3267,
17456,
13,
4706,
599,
29918,
29883,
353,
4842,
305,
29889,
3298,
359,
29898,
29876,
29899,
29896,
29892,
1583,
29889,
10892,
29918,
2311,
29892,
4742,
29922,
1311,
29889,
10141,
29897,
13,
4706,
599,
29918,
29883,
29918,
353,
4842,
305,
29889,
3298,
359,
29918,
4561,
29898,
497,
29918,
29883,
29897,
13,
4706,
599,
29918,
4181,
353,
4842,
305,
29889,
3298,
359,
29918,
4561,
29898,
497,
29918,
29883,
29897,
13,
4706,
599,
29918,
29877,
353,
4842,
305,
29889,
3298,
359,
29918,
4561,
29898,
497,
29918,
29883,
29897,
13,
4706,
599,
29918,
29882,
29918,
29873,
353,
4842,
305,
29889,
3298,
359,
29918,
4561,
29898,
497,
29918,
29883,
29897,
13,
4706,
7934,
353,
1583,
29889,
2344,
29918,
10892,
580,
13,
4706,
396,
350,
3267,
1741,
338,
29871,
29900,
472,
931,
29871,
29900,
13,
4706,
3858,
29918,
16304,
353,
1583,
29889,
6026,
29890,
7503,
29892,
3858,
29918,
11762,
29961,
29900,
29962,
1822,
29879,
802,
29872,
911,
580,
13,
4706,
260,
29918,
16304,
353,
931,
29918,
11762,
29961,
29900,
29962,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29892,
29876,
1125,
13,
9651,
3858,
353,
1583,
29889,
6026,
29890,
7503,
29892,
3858,
29918,
11762,
29961,
29875,
29962,
1822,
29879,
802,
29872,
911,
580,
13,
9651,
260,
353,
931,
29918,
11762,
29961,
29875,
29962,
13,
9651,
7934,
353,
1583,
29889,
11333,
29918,
650,
29918,
10568,
29898,
1643,
29918,
16304,
29892,
3858,
29892,
260,
29918,
16304,
29892,
260,
29892,
7934,
29897,
13,
9651,
17117,
599,
29918,
29882,
29918,
29873,
29961,
29875,
29899,
29896,
29892,
584,
1402,
599,
29918,
29883,
29918,
29961,
29875,
29899,
29896,
29892,
584,
1402,
599,
29918,
29883,
29961,
29875,
29899,
29896,
29892,
584,
1402,
599,
29918,
4181,
29961,
29875,
29899,
29896,
29892,
584,
1402,
599,
29918,
29877,
29961,
29875,
29899,
29896,
29892,
584,
29962,
353,
7934,
13,
9651,
3858,
29918,
16304,
353,
3858,
13,
9651,
260,
29918,
16304,
353,
260,
13,
4706,
565,
11455,
29918,
4102,
29901,
13,
9651,
1812,
353,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
1812,
353,
29871,
29900,
13,
4706,
3646,
353,
1583,
29889,
5182,
13,
4706,
298,
29918,
29873,
353,
599,
29918,
29882,
29918,
29873,
29961,
28060,
13018,
29896,
29892,
584,
29962,
13,
4706,
565,
298,
29918,
29873,
29889,
12181,
29961,
29900,
29962,
1405,
29871,
29900,
29901,
13,
9651,
301,
1117,
29881,
353,
1583,
29889,
29882,
29918,
517,
29918,
29880,
1117,
29881,
29898,
29882,
29918,
29873,
29897,
13,
9651,
1840,
29896,
353,
313,
29880,
1117,
29881,
29961,
1643,
29918,
11762,
15625,
29896,
29974,
28060,
1125,
29899,
29896,
29962,
1275,
3646,
29892,
3646,
29899,
29896,
14664,
1188,
2141,
2083,
580,
13,
4706,
1683,
29901,
13,
9651,
1840,
29896,
353,
29871,
29900,
13,
4706,
274,
29918,
3601,
353,
599,
29918,
29883,
29918,
29961,
3601,
29918,
2230,
29918,
13140,
29892,
584,
29962,
718,
320,
13,
18884,
313,
497,
29918,
29883,
29961,
3601,
29918,
2230,
29918,
13140,
29892,
584,
29962,
448,
599,
29918,
29883,
29918,
29961,
3601,
29918,
2230,
29918,
13140,
29892,
584,
2314,
334,
320,
13,
18884,
4842,
305,
29889,
4548,
6278,
497,
29918,
4181,
29961,
3601,
29918,
2230,
29918,
13140,
29892,
584,
29962,
334,
313,
3601,
29918,
2230,
29918,
11762,
448,
931,
29918,
11762,
29961,
3601,
29918,
2230,
29918,
13140,
2314,
7503,
29892,
6213,
2314,
13,
4706,
298,
29918,
3601,
353,
599,
29918,
29877,
29961,
3601,
29918,
2230,
29918,
13140,
29892,
584,
29962,
334,
1583,
29889,
13161,
29882,
29898,
29883,
29918,
3601,
29897,
13,
4706,
301,
1117,
29881,
29918,
3601,
353,
1583,
29889,
29882,
29918,
517,
29918,
29880,
1117,
29881,
29898,
29882,
29918,
3601,
29897,
13,
4706,
1840,
29906,
353,
301,
1117,
29881,
29918,
3601,
7503,
29892,
3646,
29899,
29896,
1822,
12676,
580,
334,
313,
2230,
29918,
11762,
14352,
29896,
29962,
448,
931,
29918,
11762,
29961,
29900,
2314,
13,
4706,
1480,
5081,
353,
1840,
29896,
448,
1840,
29906,
13,
13,
4706,
736,
448,
1188,
5081,
29892,
599,
29918,
29883,
29892,
599,
29918,
29883,
3383,
599,
29918,
4181,
29892,
599,
29918,
29877,
29892,
599,
29918,
29882,
29918,
29873,
29892,
298,
29918,
3601,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
3858,
29918,
11762,
29892,
931,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
13140,
29892,
11455,
29918,
4102,
1125,
13,
4706,
1121,
353,
1583,
29889,
1188,
5081,
29898,
1643,
29918,
11762,
29892,
931,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
13140,
29892,
11455,
29918,
4102,
29897,
13,
4706,
736,
1121,
29961,
29900,
1822,
2083,
580,
13,
13,
1678,
822,
6459,
29918,
449,
4926,
29898,
1311,
29892,
3858,
29918,
11762,
29892,
931,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
13140,
29892,
1027,
29918,
2230,
29918,
12765,
29879,
29892,
931,
29918,
1688,
29892,
302,
29918,
11249,
1125,
13,
4706,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
9651,
1480,
5081,
29892,
599,
29918,
29883,
29892,
599,
29918,
29883,
3383,
599,
29918,
4181,
29892,
599,
29918,
29877,
29892,
599,
29918,
29882,
29918,
29873,
29892,
298,
29918,
3601,
353,
1583,
29889,
1188,
5081,
29898,
13,
462,
1678,
3858,
29918,
11762,
29892,
931,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
13140,
29892,
7700,
29897,
13,
9651,
302,
353,
7431,
29898,
2230,
29918,
1688,
29897,
13,
9651,
286,
353,
7431,
29898,
2230,
29918,
11762,
29897,
13,
9651,
8158,
353,
4842,
305,
29889,
3298,
359,
29898,
29876,
29899,
29896,
29892,
4742,
29922,
1311,
29889,
10141,
29897,
13,
9651,
3646,
353,
1583,
29889,
5182,
13,
9651,
432,
353,
29871,
29900,
13,
9651,
18696,
353,
4842,
305,
29889,
3298,
359,
29898,
29876,
29918,
11249,
29892,
4742,
29922,
1311,
29889,
10141,
29897,
13,
9651,
363,
474,
297,
3464,
29898,
29876,
29899,
29896,
1125,
13,
18884,
260,
29918,
28060,
353,
931,
29918,
1688,
29961,
29875,
29962,
13,
18884,
260,
29918,
355,
353,
931,
29918,
1688,
29961,
29875,
29974,
29896,
29962,
13,
18884,
18696,
29889,
29590,
23538,
29873,
29918,
28060,
29892,
260,
29918,
355,
29897,
13,
18884,
396,
1284,
278,
937,
1741,
1156,
260,
29918,
28060,
13,
18884,
1550,
432,
529,
286,
322,
931,
29918,
11762,
29961,
29926,
29962,
5277,
260,
29918,
28060,
29901,
13,
462,
1678,
432,
4619,
29871,
29896,
13,
18884,
4974,
29898,
2230,
29918,
11762,
29961,
29926,
29962,
1405,
260,
29918,
28060,
29897,
13,
18884,
4974,
29898,
2230,
29918,
11762,
29961,
29926,
29899,
29896,
29962,
5277,
260,
29918,
28060,
29897,
13,
18884,
26832,
29881,
353,
29871,
29900,
13,
18884,
413,
353,
432,
13,
18884,
396,
8147,
365,
2269,
8424,
3538,
10768,
287,
491,
4959,
13,
18884,
1550,
413,
529,
286,
322,
931,
29918,
11762,
29961,
29895,
29899,
29896,
29962,
5277,
260,
29918,
355,
29901,
13,
462,
1678,
18696,
29918,
262,
29918,
3881,
353,
18696,
15625,
1372,
1405,
931,
29918,
11762,
29961,
29895,
29899,
29896,
2314,
669,
313,
1372,
5277,
931,
29918,
11762,
29961,
29895,
2314,
29962,
13,
462,
1678,
565,
7431,
29898,
1372,
29918,
262,
29918,
3881,
29897,
1405,
29871,
29900,
29901,
13,
462,
4706,
274,
353,
599,
29918,
29883,
29961,
29895,
29899,
29896,
29892,
17531,
13,
462,
4706,
274,
29918,
353,
599,
29918,
29883,
29918,
29961,
29895,
29899,
29896,
29892,
17531,
13,
462,
4706,
19471,
353,
599,
29918,
4181,
29961,
29895,
29899,
29896,
29892,
17531,
13,
462,
4706,
288,
353,
599,
29918,
29877,
29961,
29895,
29899,
29896,
29892,
17531,
13,
462,
4706,
274,
29918,
1372,
353,
274,
29918,
718,
313,
29883,
448,
274,
19925,
334,
4842,
305,
29889,
4548,
6278,
4181,
29961,
8516,
29892,
584,
29962,
334,
313,
1372,
29918,
262,
29918,
3881,
7503,
29892,
6213,
29962,
448,
931,
29918,
11762,
29961,
29895,
29899,
29896,
12622,
13,
462,
4706,
298,
29918,
1372,
353,
288,
334,
1583,
29889,
13161,
29882,
29898,
29883,
29918,
1372,
29897,
13,
462,
4706,
301,
1117,
29881,
29918,
497,
353,
1583,
29889,
29882,
29918,
517,
29918,
29880,
1117,
29881,
29898,
29882,
29918,
1372,
29897,
13,
462,
4706,
301,
1117,
29881,
353,
301,
1117,
29881,
29918,
497,
7503,
29892,
5182,
29899,
29896,
29962,
13,
462,
4706,
26832,
29881,
4619,
301,
1117,
29881,
29889,
2083,
580,
847,
302,
29918,
11249,
13,
462,
1678,
413,
4619,
29871,
29896,
13,
18884,
26832,
29881,
334,
29922,
313,
29873,
29918,
355,
448,
260,
29918,
28060,
29897,
13,
18884,
8158,
29961,
29875,
29962,
353,
26832,
29881,
13,
9651,
301,
1117,
29881,
353,
1583,
29889,
29882,
29918,
517,
29918,
29880,
1117,
29881,
29898,
497,
29918,
29882,
29918,
29873,
29897,
7503,
29899,
29896,
29962,
13,
9651,
301,
1117,
29881,
29918,
3601,
353,
1583,
29889,
29882,
29918,
517,
29918,
29880,
1117,
29881,
29898,
29882,
29918,
3601,
29897,
13,
9651,
736,
8158,
29892,
448,
13628,
29892,
301,
1117,
29881,
29892,
301,
1117,
29881,
29918,
3601,
13,
13,
1678,
822,
6459,
29918,
449,
4926,
29918,
2611,
424,
29898,
1311,
29892,
3858,
29918,
11762,
29892,
931,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
13140,
29892,
1027,
29918,
2230,
29918,
12765,
29879,
29892,
931,
29918,
1688,
1125,
13,
4706,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
9651,
1480,
5081,
29892,
599,
29918,
29883,
29892,
599,
29918,
29883,
3383,
599,
29918,
4181,
29892,
599,
29918,
29877,
29892,
599,
29918,
29882,
29918,
29873,
29892,
298,
29918,
3601,
353,
1583,
29889,
1188,
5081,
29898,
13,
462,
1678,
3858,
29918,
11762,
29892,
931,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
11762,
29892,
1027,
29918,
2230,
29918,
13140,
29892,
7700,
29897,
13,
9651,
302,
353,
7431,
29898,
2230,
29918,
1688,
29897,
13,
9651,
286,
353,
7431,
29898,
2230,
29918,
11762,
29897,
13,
9651,
8158,
353,
4842,
305,
29889,
3298,
359,
29898,
29876,
29899,
29896,
29892,
4742,
29922,
1311,
29889,
10141,
29897,
13,
9651,
3646,
353,
1583,
29889,
5182,
13,
9651,
432,
353,
29871,
29900,
13,
9651,
363,
474,
297,
3464,
29898,
29876,
29899,
29896,
1125,
13,
18884,
260,
29918,
355,
353,
931,
29918,
1688,
29961,
29875,
29974,
29896,
29962,
13,
18884,
565,
260,
29918,
355,
1275,
29871,
29900,
29901,
13,
462,
1678,
432,
353,
29871,
29896,
13,
18884,
1683,
29901,
13,
462,
1678,
396,
1284,
278,
937,
1741,
472,
29914,
7045,
260,
29918,
355,
13,
462,
1678,
1550,
432,
529,
286,
322,
931,
29918,
11762,
29961,
29926,
29962,
529,
260,
29918,
355,
29901,
13,
462,
4706,
432,
4619,
29871,
29896,
13,
462,
1678,
4974,
29898,
2230,
29918,
11762,
29961,
29926,
29962,
6736,
260,
29918,
355,
29897,
13,
462,
1678,
396,
1833,
1741,
1434,
260,
29918,
355,
13,
462,
1678,
4974,
29898,
2230,
29918,
11762,
29961,
29926,
29899,
29896,
29962,
529,
260,
29918,
355,
29897,
13,
18884,
274,
353,
599,
29918,
29883,
29961,
29926,
29899,
29896,
29892,
17531,
13,
18884,
274,
29918,
353,
599,
29918,
29883,
29918,
29961,
29926,
29899,
29896,
29892,
17531,
13,
18884,
19471,
353,
599,
29918,
4181,
29961,
29926,
29899,
29896,
29892,
17531,
13,
18884,
288,
353,
599,
29918,
29877,
29961,
29926,
29899,
29896,
29892,
17531,
13,
18884,
274,
29918,
1372,
353,
274,
29918,
718,
313,
29883,
448,
274,
19925,
334,
4842,
305,
29889,
4548,
6278,
4181,
334,
313,
29873,
29918,
355,
448,
931,
29918,
11762,
29961,
29926,
29899,
29896,
12622,
13,
18884,
298,
29918,
1372,
353,
288,
334,
1583,
29889,
13161,
29882,
29898,
29883,
29918,
1372,
29897,
13,
18884,
301,
1117,
29881,
29918,
497,
353,
1583,
29889,
29882,
29918,
517,
29918,
29880,
1117,
29881,
29898,
29882,
29918,
1372,
29897,
13,
18884,
301,
1117,
29881,
353,
301,
1117,
29881,
29918,
497,
29961,
5182,
29899,
29896,
29962,
13,
18884,
8158,
29961,
29875,
29962,
353,
301,
1117,
29881,
13,
9651,
301,
1117,
29881,
353,
1583,
29889,
29882,
29918,
517,
29918,
29880,
1117,
29881,
29898,
497,
29918,
29882,
29918,
29873,
29897,
7503,
29899,
29896,
29962,
13,
9651,
301,
1117,
29881,
29918,
3601,
353,
1583,
29889,
29882,
29918,
517,
29918,
29880,
1117,
29881,
29898,
29882,
29918,
3601,
29897,
13,
9651,
736,
8158,
29892,
448,
13628,
29892,
301,
1117,
29881,
29892,
301,
1117,
29881,
29918,
3601,
13,
13,
1990,
8125,
3260,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
7945,
29918,
842,
29892,
659,
29918,
842,
29892,
1243,
29918,
842,
29892,
4078,
29918,
2084,
29892,
6389,
1125,
13,
4706,
1583,
29889,
5085,
353,
6389,
13,
4706,
1583,
29889,
10141,
353,
6389,
29889,
10141,
13,
4706,
1583,
29889,
5182,
353,
6389,
29889,
5182,
13,
4706,
1583,
29889,
3601,
29918,
2230,
29918,
12765,
29879,
353,
6213,
13,
4706,
1583,
29889,
14968,
29918,
842,
29892,
931,
29918,
14968,
29892,
2302,
29918,
14968,
353,
1583,
29889,
19125,
29898,
14968,
29918,
842,
29892,
6389,
29889,
11249,
29918,
18056,
4926,
29897,
13,
4706,
1583,
29889,
791,
29918,
842,
29892,
931,
29918,
791,
29892,
2302,
29918,
791,
353,
1583,
29889,
19125,
29898,
791,
29918,
842,
29892,
6389,
29889,
11249,
29918,
18056,
4926,
29897,
13,
4706,
1583,
29889,
1688,
29918,
842,
29892,
17117,
903,
353,
1583,
29889,
19125,
29898,
1688,
29918,
842,
29892,
6389,
29889,
11249,
29918,
18056,
4926,
29897,
13,
4706,
1583,
29889,
2015,
18162,
353,
313,
2230,
29918,
14968,
29974,
2230,
29918,
791,
6802,
29898,
2798,
29918,
14968,
29974,
2798,
29918,
791,
29897,
13,
4706,
1583,
29889,
6008,
353,
29871,
29896,
13,
4706,
1583,
29889,
4299,
29918,
2084,
353,
4078,
29918,
2084,
13,
4706,
1583,
29889,
17281,
29918,
4102,
353,
6389,
29889,
17281,
29918,
4102,
13,
13,
1678,
822,
19012,
29898,
1311,
29892,
848,
29918,
842,
29892,
2999,
29892,
2923,
29918,
11249,
29918,
2311,
29922,
29896,
29900,
29900,
29892,
4943,
29922,
8824,
29892,
4331,
29922,
8516,
1125,
13,
4706,
565,
848,
29918,
842,
338,
6213,
29901,
13,
9651,
736,
6213,
29892,
6213,
29892,
6213,
13,
4706,
1962,
353,
5159,
13,
4706,
3001,
29918,
2230,
353,
29871,
29900,
13,
4706,
3001,
29918,
2798,
353,
29871,
29900,
13,
4706,
363,
19359,
297,
848,
29918,
842,
29901,
13,
9651,
3858,
29918,
11762,
353,
4842,
305,
29889,
20158,
29898,
13,
18884,
7442,
29889,
535,
29883,
2579,
403,
3552,
29961,
29900,
1402,
19359,
1839,
3502,
7464,
518,
29900,
2314,
511,
13,
18884,
26688,
29922,
7345,
305,
29889,
5426,
29892,
13,
18884,
4742,
29922,
1311,
29889,
10141,
13,
9651,
1723,
13,
9651,
931,
29918,
11762,
353,
4842,
305,
29889,
20158,
29898,
13,
18884,
7442,
29889,
535,
29883,
2579,
403,
3552,
29961,
11762,
1839,
2962,
2033,
1402,
19359,
1839,
2230,
7464,
518,
11762,
1839,
9847,
2033,
2314,
511,
13,
18884,
26688,
29922,
7345,
305,
29889,
7411,
29892,
13,
18884,
4742,
29922,
1311,
29889,
10141,
13,
9651,
1723,
13,
9651,
302,
353,
7431,
29898,
2230,
29918,
11762,
29897,
13,
9651,
260,
29900,
353,
19359,
1839,
2962,
2033,
13,
9651,
260,
29876,
353,
19359,
1839,
9847,
2033,
13,
9651,
3001,
29918,
2230,
4619,
260,
29876,
448,
260,
29900,
13,
9651,
3001,
29918,
2798,
4619,
313,
1643,
29918,
11762,
1275,
29871,
29896,
467,
2083,
580,
13,
9651,
565,
4943,
29901,
13,
18884,
1027,
29918,
2230,
29918,
11762,
353,
4842,
305,
29889,
279,
927,
29898,
29873,
29900,
29892,
260,
29876,
29892,
4331,
29892,
4742,
29922,
1311,
29889,
10141,
29897,
13,
18884,
1027,
29918,
2230,
29918,
13140,
353,
4842,
305,
29889,
3298,
359,
29918,
4561,
29898,
3601,
29918,
2230,
29918,
11762,
29892,
26688,
29922,
7345,
305,
29889,
5426,
29897,
13,
9651,
1683,
29901,
13,
18884,
1027,
29918,
2230,
29918,
11762,
353,
931,
29918,
11762,
29889,
1482,
29918,
6310,
29898,
29876,
334,
2999,
29897,
13,
18884,
1027,
29918,
2230,
29918,
11762,
29889,
29590,
23538,
29873,
29900,
29892,
260,
29876,
29897,
13,
18884,
1027,
29918,
2230,
29918,
13140,
353,
3858,
29918,
11762,
29889,
1482,
29918,
3298,
359,
29898,
29876,
334,
2999,
29897,
13,
9651,
363,
432,
297,
3464,
29898,
29876,
448,
29871,
29896,
1125,
13,
18884,
1027,
29918,
2230,
29918,
13140,
15625,
3601,
29918,
2230,
29918,
11762,
1405,
931,
29918,
11762,
29961,
29926,
2314,
669,
13,
462,
632,
313,
3601,
29918,
2230,
29918,
11762,
5277,
931,
29918,
11762,
29961,
29926,
718,
29871,
29896,
2314,
13,
462,
632,
4514,
353,
432,
13,
9651,
565,
1583,
29889,
3601,
29918,
2230,
29918,
12765,
29879,
338,
6213,
29901,
13,
18884,
5694,
353,
1027,
29918,
2230,
29918,
11762,
29889,
1482,
29918,
6310,
29898,
12765,
29918,
11249,
29918,
2311,
29897,
13,
18884,
5694,
29889,
735,
1112,
2556,
23538,
29896,
29897,
13,
18884,
1583,
29889,
3601,
29918,
2230,
29918,
12765,
29879,
29892,
903,
353,
4842,
305,
29889,
6605,
29898,
7382,
29897,
13,
9651,
565,
19359,
1839,
2230,
29918,
1688,
2033,
338,
6213,
29901,
13,
18884,
931,
29918,
1688,
353,
6213,
13,
9651,
1683,
29901,
13,
18884,
931,
29918,
1688,
353,
4842,
305,
29889,
20158,
29898,
13,
462,
1678,
19359,
1839,
2230,
29918,
1688,
7464,
13,
462,
1678,
26688,
29922,
7345,
305,
29889,
7411,
29892,
13,
462,
1678,
4742,
29922,
1311,
29889,
10141,
29897,
13,
9651,
565,
19359,
1839,
1643,
29918,
1688,
2033,
338,
6213,
29901,
13,
18884,
3858,
29918,
1688,
353,
6213,
13,
9651,
1683,
29901,
13,
18884,
3858,
29918,
1688,
353,
4842,
305,
29889,
20158,
29898,
13,
462,
1678,
19359,
1839,
1643,
29918,
1688,
7464,
13,
462,
1678,
4742,
29922,
1311,
29889,
10141,
29892,
13,
18884,
1723,
13,
9651,
2944,
353,
426,
13,
18884,
525,
333,
2396,
19359,
1839,
333,
7464,
13,
18884,
525,
1643,
29918,
11762,
2396,
3858,
29918,
11762,
29892,
13,
18884,
525,
2230,
29918,
11762,
2396,
931,
29918,
11762,
29892,
13,
18884,
525,
3601,
29918,
2230,
29918,
11762,
2396,
1027,
29918,
2230,
29918,
11762,
29892,
13,
18884,
525,
3601,
29918,
2230,
29918,
13140,
2396,
1027,
29918,
2230,
29918,
13140,
29892,
13,
18884,
525,
3601,
29918,
2230,
29918,
12765,
29879,
29915,
584,
1583,
29889,
3601,
29918,
2230,
29918,
12765,
29879,
29892,
13,
18884,
525,
2230,
29918,
1688,
2396,
931,
29918,
1688,
29892,
13,
18884,
525,
1643,
29918,
1688,
2396,
3858,
29918,
1688,
29892,
13,
18884,
525,
2892,
29918,
29916,
2396,
19359,
1839,
2892,
29918,
29916,
7464,
13,
18884,
525,
29873,
29918,
29916,
2396,
19359,
1839,
29873,
29918,
29916,
7464,
13,
9651,
500,
13,
9651,
1962,
29889,
4397,
29898,
667,
29897,
13,
4706,
736,
1962,
29892,
3001,
29918,
2230,
29892,
3001,
29918,
2798,
13,
13,
1678,
822,
7945,
29918,
650,
29918,
1022,
2878,
29898,
1311,
29892,
1904,
29892,
7945,
29918,
842,
29892,
5994,
3950,
1125,
13,
4706,
1480,
29918,
19207,
353,
1583,
29889,
5085,
29889,
1188,
29918,
19207,
13,
4706,
3001,
29918,
6758,
353,
29871,
29900,
13,
4706,
3001,
29918,
1949,
29918,
11762,
353,
7431,
29898,
14968,
29918,
842,
29897,
13,
4706,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
4706,
363,
19359,
29918,
13140,
29892,
2944,
297,
26985,
29898,
14968,
29918,
842,
1125,
13,
9651,
5994,
3950,
29889,
9171,
29918,
5105,
580,
13,
9651,
6410,
353,
1904,
29898,
667,
1839,
1643,
29918,
11762,
7464,
13,
462,
308,
2944,
1839,
2230,
29918,
11762,
7464,
13,
462,
308,
2944,
1839,
3601,
29918,
2230,
29918,
11762,
7464,
13,
462,
308,
2944,
1839,
3601,
29918,
2230,
29918,
13140,
7464,
13,
462,
308,
7700,
29897,
13,
9651,
6410,
29889,
1627,
1328,
580,
13,
9651,
5994,
3950,
29889,
10568,
580,
13,
9651,
3001,
29918,
6758,
4619,
6410,
29889,
667,
580,
13,
9651,
565,
19359,
29918,
13140,
1273,
1480,
29918,
19207,
1275,
29871,
29900,
322,
19359,
29918,
13140,
1405,
29871,
29900,
29901,
13,
18884,
3151,
29918,
6758,
353,
3001,
29918,
6758,
847,
1480,
29918,
19207,
13,
18884,
560,
28170,
353,
931,
29889,
2230,
580,
448,
1369,
29918,
2230,
13,
18884,
12183,
29889,
3888,
877,
29989,
12365,
29945,
29881,
6822,
25641,
29945,
29881,
29913,
19359,
29879,
891,
525,
13,
462,
632,
525,
1516,
29914,
11762,
12365,
29945,
29889,
29906,
29888,
29913,
891,
525,
13,
462,
632,
525,
6758,
12365,
29945,
29889,
29906,
29888,
29913,
891,
4286,
4830,
29898,
13,
462,
462,
19359,
29918,
13140,
29892,
3001,
29918,
1949,
29918,
11762,
29892,
13,
462,
462,
560,
28170,
334,
29871,
29896,
29900,
29900,
29900,
847,
1480,
29918,
19207,
29892,
3151,
29918,
6758,
876,
13,
18884,
3001,
29918,
6758,
353,
29871,
29900,
13,
18884,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
13,
1678,
822,
7945,
29898,
1311,
29892,
1904,
29892,
21502,
12168,
29922,
8516,
29892,
671,
29918,
497,
29918,
1272,
29922,
8824,
29892,
1024,
543,
4299,
29889,
415,
29908,
1125,
13,
4706,
1900,
29918,
791,
29918,
6758,
353,
6213,
13,
4706,
5994,
3950,
353,
5994,
29889,
3253,
314,
29898,
4299,
29889,
16744,
3285,
13,
462,
1669,
301,
29878,
29922,
1311,
29889,
5085,
29889,
29212,
29897,
13,
4706,
565,
21502,
12168,
338,
6213,
29901,
13,
9651,
4688,
29918,
9847,
353,
5852,
13,
9651,
21502,
12168,
353,
1583,
29889,
5085,
29889,
1022,
2878,
29879,
13,
4706,
1683,
29901,
13,
9651,
4688,
29918,
9847,
353,
7700,
13,
4706,
363,
21502,
305,
297,
3464,
29898,
29896,
29892,
21502,
12168,
29974,
29896,
1125,
13,
9651,
21502,
305,
29918,
2962,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
9651,
565,
671,
29918,
497,
29918,
1272,
29901,
13,
18884,
7945,
29918,
842,
353,
1583,
29889,
14968,
29918,
842,
718,
1583,
29889,
791,
29918,
842,
13,
9651,
1683,
29901,
13,
18884,
7945,
29918,
842,
353,
1583,
29889,
14968,
29918,
842,
13,
9651,
1583,
29889,
14968,
29918,
650,
29918,
1022,
2878,
29898,
4299,
29892,
7945,
29918,
842,
29892,
5994,
3950,
29897,
13,
9651,
659,
29918,
6758,
353,
1583,
29889,
24219,
403,
29898,
4299,
29897,
13,
9651,
12183,
29889,
3888,
877,
29899,
29915,
334,
29871,
29947,
29929,
29897,
13,
9651,
12183,
29889,
3888,
877,
29989,
1095,
310,
21502,
305,
12365,
29941,
29881,
29913,
891,
931,
29901,
12365,
29945,
29889,
29906,
29888,
29913,
29879,
891,
525,
13,
462,
308,
525,
3084,
6410,
12365,
29888,
29913,
891,
4286,
4830,
29898,
13,
462,
632,
21502,
305,
29892,
313,
2230,
29889,
2230,
580,
448,
21502,
305,
29918,
2962,
29918,
2230,
511,
13,
462,
632,
659,
29918,
6758,
876,
13,
9651,
12183,
29889,
3888,
877,
29899,
29915,
334,
29871,
29947,
29929,
29897,
13,
9651,
565,
1900,
29918,
791,
29918,
6758,
338,
6213,
470,
659,
29918,
6758,
529,
1900,
29918,
791,
29918,
6758,
29901,
13,
18884,
1583,
29889,
7620,
29918,
4299,
29898,
4299,
29892,
1024,
29897,
13,
18884,
1900,
29918,
791,
29918,
6758,
353,
659,
29918,
6758,
13,
9651,
25342,
4688,
29918,
9847,
29901,
13,
18884,
21502,
12168,
353,
21502,
305,
448,
29871,
29896,
13,
18884,
2867,
13,
4706,
565,
1900,
29918,
791,
29918,
6758,
29901,
13,
9651,
1583,
29889,
1359,
29918,
4299,
29898,
4299,
29892,
1024,
29897,
13,
4706,
736,
1900,
29918,
791,
29918,
6758,
29892,
21502,
12168,
13,
13,
1678,
822,
14707,
29898,
1311,
29892,
1904,
1125,
13,
4706,
3001,
29918,
6758,
353,
29871,
29900,
13,
4706,
363,
19359,
29918,
13140,
29892,
2944,
297,
26985,
29898,
1311,
29889,
791,
29918,
842,
1125,
13,
9651,
6410,
353,
1904,
29898,
13,
18884,
2944,
1839,
1643,
29918,
11762,
7464,
13,
18884,
2944,
1839,
2230,
29918,
11762,
7464,
13,
18884,
2944,
1839,
3601,
29918,
2230,
29918,
11762,
7464,
13,
18884,
2944,
1839,
3601,
29918,
2230,
29918,
13140,
7464,
13,
18884,
1583,
29889,
17281,
29918,
4102,
13,
9651,
1723,
13,
9651,
3001,
29918,
6758,
4619,
6410,
29889,
667,
580,
13,
4706,
736,
3001,
29918,
6758,
13,
13,
1678,
822,
4188,
22342,
29898,
1311,
29892,
1904,
29892,
8783,
1125,
13,
4706,
3001,
29918,
6758,
353,
29871,
29900,
13,
4706,
363,
19359,
29918,
13140,
29892,
2944,
297,
26985,
29898,
24713,
1125,
13,
9651,
6410,
353,
1904,
29898,
13,
18884,
2944,
1839,
1643,
29918,
11762,
7464,
13,
18884,
2944,
1839,
2230,
29918,
11762,
7464,
13,
18884,
2944,
1839,
3601,
29918,
2230,
29918,
11762,
7464,
13,
18884,
2944,
1839,
3601,
29918,
2230,
29918,
13140,
7464,
13,
18884,
1583,
29889,
17281,
29918,
4102,
13,
9651,
1723,
13,
9651,
3001,
29918,
6758,
4619,
6410,
29889,
667,
580,
13,
4706,
736,
3001,
29918,
6758,
13,
13,
1678,
822,
6459,
29918,
449,
4926,
29898,
1311,
29892,
1904,
29892,
4744,
29922,
8824,
29892,
14426,
29922,
8824,
1125,
13,
4706,
1480,
29918,
19207,
353,
1583,
29889,
5085,
29889,
1188,
29918,
19207,
13,
4706,
2582,
353,
5159,
13,
4706,
302,
353,
7431,
29898,
1311,
29889,
1688,
29918,
842,
29897,
13,
4706,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
4706,
363,
19359,
29918,
13140,
29892,
2944,
297,
26985,
29898,
1311,
29889,
1688,
29918,
842,
1125,
13,
9651,
565,
14426,
29901,
13,
18884,
8158,
29918,
290,
790,
29892,
8158,
29918,
2055,
790,
29892,
301,
1117,
29881,
29892,
301,
1117,
29881,
29918,
3601,
353,
1904,
29889,
4801,
522,
29918,
449,
4926,
29918,
2611,
424,
29898,
13,
462,
1678,
2944,
1839,
1643,
29918,
11762,
7464,
13,
462,
1678,
2944,
1839,
2230,
29918,
11762,
7464,
13,
462,
1678,
2944,
1839,
3601,
29918,
2230,
29918,
11762,
7464,
13,
462,
1678,
2944,
1839,
3601,
29918,
2230,
29918,
13140,
7464,
13,
462,
1678,
2944,
1839,
3601,
29918,
2230,
29918,
12765,
29879,
7464,
13,
462,
1678,
2944,
1839,
2230,
29918,
1688,
7464,
13,
18884,
1723,
13,
9651,
1683,
29901,
13,
18884,
8158,
29918,
290,
790,
29892,
8158,
29918,
2055,
790,
29892,
301,
1117,
29881,
29892,
301,
1117,
29881,
29918,
3601,
353,
1904,
29889,
4801,
522,
29918,
449,
4926,
29898,
13,
462,
1678,
2944,
1839,
1643,
29918,
11762,
7464,
13,
462,
1678,
2944,
1839,
2230,
29918,
11762,
7464,
13,
462,
1678,
2944,
1839,
3601,
29918,
2230,
29918,
11762,
7464,
13,
462,
1678,
2944,
1839,
3601,
29918,
2230,
29918,
13140,
7464,
13,
462,
1678,
2944,
1839,
3601,
29918,
2230,
29918,
12765,
29879,
7464,
13,
462,
1678,
2944,
1839,
2230,
29918,
1688,
7464,
13,
462,
1678,
302,
29918,
11249,
29922,
29896,
29900,
29900,
29900,
13,
18884,
1723,
13,
9651,
4489,
353,
10518,
29889,
17271,
29898,
7514,
287,
21533,
3319,
13,
18884,
525,
11762,
2396,
19359,
29918,
13140,
29892,
13,
18884,
525,
2230,
2396,
2944,
1839,
2230,
29918,
1688,
13359,
23749,
580,
29961,
29896,
29901,
1402,
13,
18884,
525,
13628,
29918,
290,
790,
2396,
8158,
29918,
290,
790,
29889,
23749,
3285,
13,
18884,
525,
13628,
29918,
2055,
790,
2396,
8158,
29918,
2055,
790,
29889,
23749,
3285,
13,
18884,
525,
1643,
2396,
2944,
1839,
1643,
29918,
1688,
13359,
23749,
3285,
13,
9651,
500,
876,
13,
9651,
565,
2944,
1839,
333,
2033,
338,
6213,
29901,
13,
18884,
4489,
29889,
7851,
29898,
29900,
29892,
525,
333,
742,
19359,
29918,
13140,
29974,
29896,
29897,
13,
9651,
1683,
29901,
13,
18884,
4489,
29889,
7851,
29898,
29900,
29892,
525,
333,
742,
2944,
1839,
333,
11287,
13,
9651,
2582,
29889,
4397,
29898,
2176,
29897,
13,
9651,
565,
313,
11762,
29918,
13140,
29974,
29896,
29897,
1273,
1480,
29918,
19207,
1275,
29871,
29900,
29901,
13,
18884,
12183,
29889,
3888,
29898,
29888,
29915,
12881,
3276,
6459,
292,
714,
27801,
297,
19359,
426,
11762,
29918,
13140,
29974,
29896,
6822,
29912,
29876,
29913,
297,
426,
29898,
2230,
29889,
2230,
580,
29899,
2962,
29918,
2230,
1125,
29889,
29906,
29888,
29913,
29879,
1495,
13,
18884,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
4706,
2582,
353,
10518,
29889,
17685,
29898,
9902,
29897,
13,
4706,
736,
2582,
13,
13,
1678,
822,
4078,
29918,
4299,
29898,
1311,
29892,
1904,
29892,
1024,
1125,
13,
4706,
411,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
4299,
29918,
2084,
29892,
1024,
511,
525,
29893,
29890,
1495,
408,
285,
29901,
13,
9651,
4842,
305,
29889,
7620,
29898,
4299,
29889,
3859,
29918,
8977,
3285,
285,
29897,
13,
13,
1678,
822,
2254,
29918,
4299,
29898,
1311,
29892,
1904,
29892,
1024,
1125,
13,
4706,
411,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
4299,
29918,
2084,
29892,
1024,
511,
525,
6050,
1495,
408,
285,
29901,
13,
9651,
1904,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
7345,
305,
29889,
1359,
29898,
29888,
876,
13,
13,
1990,
15228,
1469,
10036,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
7945,
29918,
842,
29892,
1243,
29918,
842,
29892,
3858,
29918,
2311,
29892,
3646,
29922,
29896,
1125,
13,
4706,
1583,
29889,
1643,
29918,
2311,
353,
3858,
29918,
2311,
13,
4706,
1583,
29889,
5182,
353,
3646,
13,
4706,
302,
353,
7431,
29898,
14968,
29918,
842,
29897,
13,
4706,
302,
29918,
14968,
353,
938,
29898,
29876,
29930,
29900,
29889,
29947,
29897,
13,
4706,
302,
29918,
14968,
29918,
791,
353,
302,
13,
4706,
1583,
29889,
14968,
29918,
842,
353,
1583,
29889,
13441,
29898,
14968,
29918,
842,
7503,
29876,
29918,
14968,
2314,
13,
4706,
1583,
29889,
791,
29918,
842,
353,
1583,
29889,
13441,
29898,
14968,
29918,
842,
29961,
29876,
29918,
14968,
29901,
29876,
29918,
14968,
29918,
791,
2314,
13,
4706,
1583,
29889,
1688,
29918,
842,
353,
1583,
29889,
13441,
29898,
1688,
29918,
842,
29897,
13,
13,
1678,
822,
3588,
29898,
1311,
29892,
19359,
29879,
1125,
13,
4706,
565,
19359,
29879,
338,
6213,
29901,
13,
9651,
736,
6213,
13,
4706,
286,
29918,
29873,
353,
1583,
29889,
5182,
718,
29871,
29896,
13,
4706,
822,
903,
13441,
29898,
11762,
1125,
13,
9651,
19359,
29918,
333,
353,
19359,
29889,
657,
877,
333,
1495,
13,
9651,
931,
29918,
29883,
353,
19359,
1839,
2230,
29918,
4703,
2033,
13,
9651,
2791,
29918,
29883,
353,
19359,
1839,
3502,
29918,
4703,
2033,
13,
9651,
1369,
353,
19359,
1839,
2962,
2033,
13,
9651,
5040,
353,
19359,
1839,
9847,
2033,
13,
9651,
931,
29918,
29873,
353,
19359,
1839,
2230,
29918,
5182,
2033,
13,
9651,
2791,
29918,
29873,
353,
19359,
1839,
3502,
29918,
5182,
2033,
13,
9651,
4974,
29898,
4422,
29889,
275,
29918,
24582,
29898,
2230,
29918,
29883,
876,
13,
9651,
4974,
29898,
4422,
29889,
275,
29918,
24582,
29898,
2230,
29918,
29873,
876,
13,
9651,
931,
353,
5159,
13,
9651,
2791,
353,
5159,
13,
9651,
474,
29918,
29883,
353,
29871,
29900,
13,
9651,
474,
29918,
29873,
353,
29871,
29900,
13,
9651,
302,
29918,
29883,
353,
7431,
29898,
2230,
29918,
29883,
29897,
13,
9651,
302,
29918,
29873,
353,
7431,
29898,
2230,
29918,
29873,
29897,
13,
9651,
4974,
29898,
29876,
29918,
29883,
1275,
7431,
29898,
3502,
29918,
29883,
876,
13,
9651,
4974,
29898,
29876,
29918,
29873,
1275,
7431,
29898,
3502,
29918,
29873,
876,
13,
9651,
1550,
474,
29918,
29883,
529,
302,
29918,
29883,
322,
474,
29918,
29873,
529,
302,
29918,
29873,
29901,
13,
18884,
565,
931,
29918,
29873,
29961,
29875,
29918,
29873,
29962,
5277,
931,
29918,
29883,
29961,
29875,
29918,
29883,
5387,
13,
462,
1678,
931,
29889,
4397,
29898,
2230,
29918,
29873,
29961,
29875,
29918,
29873,
2314,
13,
462,
1678,
2791,
29889,
4397,
29898,
3502,
29918,
29873,
29961,
29875,
29918,
29873,
2314,
13,
462,
1678,
474,
29918,
29873,
4619,
29871,
29896,
13,
18884,
1683,
29901,
13,
462,
1678,
931,
29889,
4397,
29898,
2230,
29918,
29883,
29961,
29875,
29918,
29883,
2314,
13,
462,
1678,
2791,
29889,
4397,
29898,
29885,
29918,
29873,
718,
2791,
29918,
29883,
29961,
29875,
29918,
29883,
2314,
13,
462,
1678,
474,
29918,
29883,
4619,
29871,
29896,
13,
9651,
565,
474,
29918,
29873,
529,
302,
29918,
29873,
29901,
13,
18884,
931,
29889,
21843,
29898,
2230,
29918,
29873,
29961,
29875,
29918,
29873,
29901,
2314,
13,
18884,
2791,
29889,
21843,
29898,
3502,
29918,
29873,
29961,
29875,
29918,
29873,
29901,
2314,
13,
9651,
565,
474,
29918,
29883,
529,
302,
29918,
29883,
29901,
13,
18884,
931,
29889,
21843,
29898,
2230,
29918,
29883,
29961,
29875,
29918,
29883,
29901,
2314,
13,
18884,
2791,
29889,
21843,
29898,
29885,
29918,
29873,
718,
2791,
29918,
29883,
29961,
29875,
29918,
29883,
29901,
2314,
13,
9651,
736,
426,
13,
18884,
525,
333,
2396,
19359,
29918,
333,
29892,
13,
18884,
525,
2230,
2396,
931,
29892,
13,
18884,
525,
3502,
2396,
2791,
29892,
13,
18884,
525,
2962,
2396,
1369,
29892,
13,
18884,
525,
9847,
2396,
5040,
29892,
13,
18884,
525,
2230,
29918,
1688,
2396,
19359,
29889,
657,
877,
2230,
29918,
1688,
5477,
13,
18884,
525,
1643,
29918,
1688,
2396,
19359,
29889,
657,
877,
1643,
29918,
1688,
5477,
13,
18884,
525,
2892,
29918,
29916,
2396,
19359,
29889,
657,
877,
2892,
29918,
29916,
5477,
13,
18884,
525,
29873,
29918,
29916,
2396,
19359,
29889,
657,
877,
29873,
29918,
29916,
5477,
13,
9651,
500,
13,
4706,
736,
23160,
13441,
29898,
11762,
29897,
363,
19359,
297,
19359,
29879,
29962,
13,
13,
1990,
10050,
2677,
1469,
10036,
29898,
2677,
1469,
10036,
1125,
13,
1678,
822,
3588,
29898,
1311,
29892,
19359,
29879,
1125,
13,
4706,
565,
19359,
29879,
338,
6213,
29901,
13,
9651,
736,
6213,
13,
4706,
822,
903,
13441,
29898,
11762,
1125,
13,
9651,
19359,
29918,
333,
353,
19359,
29889,
657,
877,
333,
1495,
13,
9651,
1369,
353,
19359,
1839,
2962,
2033,
13,
9651,
5040,
353,
19359,
1839,
9847,
2033,
13,
9651,
931,
29918,
29873,
353,
19359,
1839,
2230,
29918,
5182,
2033,
13,
9651,
2791,
29918,
29873,
353,
19359,
1839,
3502,
29918,
5182,
2033,
13,
9651,
4974,
29898,
4422,
29889,
275,
29918,
24582,
29898,
2230,
29918,
29873,
876,
13,
9651,
4974,
29898,
2435,
29898,
2230,
29918,
29873,
29897,
1275,
7431,
29898,
3502,
29918,
29873,
876,
13,
9651,
736,
426,
13,
18884,
525,
333,
2396,
19359,
29918,
333,
29892,
13,
18884,
525,
2230,
2396,
931,
29918,
29873,
29892,
13,
18884,
525,
3502,
2396,
2791,
29918,
29873,
29892,
13,
18884,
525,
2962,
2396,
1369,
29892,
13,
18884,
525,
9847,
2396,
5040,
29892,
13,
18884,
525,
2230,
29918,
1688,
2396,
19359,
29889,
657,
877,
2230,
29918,
1688,
5477,
13,
18884,
525,
1643,
29918,
1688,
2396,
19359,
29889,
657,
877,
1643,
29918,
1688,
5477,
13,
18884,
525,
2892,
29918,
29916,
2396,
19359,
29889,
657,
877,
2892,
29918,
29916,
5477,
13,
18884,
525,
29873,
29918,
29916,
2396,
19359,
29889,
657,
877,
29873,
29918,
29916,
5477,
13,
9651,
500,
13,
4706,
736,
23160,
13441,
29898,
11762,
29897,
363,
19359,
297,
19359,
29879,
29962,
13,
13,
1990,
853,
1643,
2677,
1469,
10036,
29898,
2677,
1469,
10036,
1125,
13,
1678,
822,
3588,
29898,
1311,
29892,
19359,
29879,
1125,
13,
4706,
565,
19359,
29879,
338,
6213,
29901,
13,
9651,
736,
6213,
13,
4706,
286,
29918,
29873,
353,
1583,
29889,
5182,
718,
29871,
29896,
13,
4706,
822,
903,
13441,
29898,
11762,
1125,
13,
9651,
19359,
29918,
333,
353,
19359,
29889,
657,
877,
333,
1495,
13,
9651,
931,
29918,
29883,
353,
19359,
1839,
2230,
29918,
4703,
2033,
13,
9651,
2791,
29918,
29883,
353,
19359,
1839,
3502,
29918,
4703,
2033,
13,
9651,
1369,
353,
19359,
1839,
2962,
2033,
13,
9651,
5040,
353,
19359,
1839,
9847,
2033,
13,
9651,
931,
29918,
29873,
353,
19359,
1839,
2230,
29918,
5182,
2033,
13,
9651,
2791,
29918,
29873,
353,
19359,
1839,
3502,
29918,
5182,
2033,
13,
9651,
4974,
29898,
4422,
29889,
275,
29918,
24582,
29898,
2230,
29918,
29883,
876,
13,
9651,
4974,
29898,
4422,
29889,
275,
29918,
24582,
29898,
2230,
29918,
29873,
876,
13,
9651,
931,
353,
5159,
13,
9651,
2791,
353,
5159,
13,
9651,
474,
29918,
29883,
353,
29871,
29900,
13,
9651,
474,
29918,
29873,
353,
29871,
29900,
13,
9651,
302,
29918,
29883,
353,
7431,
29898,
2230,
29918,
29883,
29897,
13,
9651,
302,
29918,
29873,
353,
7431,
29898,
2230,
29918,
29873,
29897,
13,
9651,
4974,
29898,
29876,
29918,
29883,
1275,
7431,
29898,
3502,
29918,
29883,
876,
13,
9651,
4974,
29898,
29876,
29918,
29873,
1275,
7431,
29898,
3502,
29918,
29873,
876,
13,
9651,
1550,
474,
29918,
29883,
529,
302,
29918,
29883,
322,
474,
29918,
29873,
529,
302,
29918,
29873,
29901,
13,
18884,
565,
931,
29918,
29873,
29961,
29875,
29918,
29873,
29962,
5277,
931,
29918,
29883,
29961,
29875,
29918,
29883,
5387,
13,
462,
1678,
931,
29889,
4397,
29898,
2230,
29918,
29873,
29961,
29875,
29918,
29873,
2314,
13,
462,
1678,
2791,
29889,
4397,
29898,
3502,
29918,
29873,
29961,
29875,
29918,
29873,
2314,
13,
462,
1678,
474,
29918,
29873,
4619,
29871,
29896,
13,
18884,
1683,
29901,
13,
462,
1678,
931,
29889,
4397,
29898,
2230,
29918,
29883,
29961,
29875,
29918,
29883,
2314,
13,
462,
1678,
2791,
29889,
4397,
29898,
29885,
29918,
29873,
718,
2791,
29918,
29883,
29961,
29875,
29918,
29883,
2314,
13,
462,
1678,
474,
29918,
29883,
4619,
29871,
29896,
13,
9651,
565,
474,
29918,
29873,
529,
302,
29918,
29873,
29901,
13,
18884,
931,
29889,
21843,
29898,
2230,
29918,
29873,
29961,
29875,
29918,
29873,
29901,
2314,
13,
18884,
2791,
29889,
21843,
29898,
3502,
29918,
29873,
29961,
29875,
29918,
29873,
29901,
2314,
13,
9651,
565,
474,
29918,
29883,
529,
302,
29918,
29883,
29901,
13,
18884,
931,
29889,
21843,
29898,
2230,
29918,
29883,
29961,
29875,
29918,
29883,
29901,
2314,
13,
18884,
2791,
29889,
21843,
29898,
29885,
29918,
29873,
718,
2791,
29918,
29883,
29961,
29875,
29918,
29883,
29901,
2314,
13,
9651,
4974,
29898,
11762,
29889,
657,
877,
2230,
29918,
1688,
1495,
338,
6213,
29897,
13,
9651,
4974,
29898,
11762,
29889,
657,
877,
1643,
29918,
1688,
1495,
338,
6213,
29897,
13,
9651,
565,
1369,
1275,
931,
29918,
29873,
29961,
29900,
5387,
13,
18884,
396,
565,
8665,
411,
263,
3646,
1741,
13,
18884,
396,
925,
671,
372,
408,
278,
1369,
13,
18884,
931,
29918,
1688,
353,
7442,
29889,
2378,
29898,
2230,
29918,
29873,
29897,
13,
9651,
1683,
29901,
13,
18884,
396,
6467,
788,
263,
1369,
13,
18884,
931,
29918,
1688,
353,
7442,
29889,
2378,
29898,
9302,
29889,
535,
29883,
2579,
403,
3552,
29961,
2962,
1402,
931,
29918,
29873,
4961,
13,
9651,
396,
937,
1741,
17997,
278,
1369,
322,
338,
451,
9528,
13,
9651,
3858,
29918,
1688,
353,
7442,
29889,
3298,
359,
29918,
4561,
29898,
2230,
29918,
1688,
29961,
29896,
29901,
2314,
13,
9651,
736,
426,
13,
18884,
525,
333,
2396,
19359,
29918,
333,
29892,
13,
18884,
525,
2230,
2396,
931,
29892,
13,
18884,
525,
3502,
2396,
2791,
29892,
13,
18884,
525,
2962,
2396,
1369,
29892,
13,
18884,
525,
9847,
2396,
5040,
29892,
13,
18884,
525,
2230,
29918,
1688,
2396,
931,
29918,
1688,
29892,
13,
18884,
525,
1643,
29918,
1688,
2396,
3858,
29918,
1688,
29892,
13,
18884,
525,
2892,
29918,
29916,
2396,
6213,
29892,
13,
18884,
525,
29873,
29918,
29916,
2396,
6213,
29892,
13,
9651,
500,
13,
4706,
736,
23160,
13441,
29898,
11762,
29897,
363,
19359,
297,
19359,
29879,
29962,
13,
2
] |
pages/product_page.py
|
edwlad/stepik-test-final
| 0 |
168240
|
from pages.base_page import BasePage
from pages.locators import ProductPageLocators
class ProductPage(BasePage):
pass
# alert = self.browser.switch_to.alert
# alert.accept()
|
[
1,
515,
6515,
29889,
3188,
29918,
3488,
1053,
7399,
5074,
13,
3166,
6515,
29889,
2029,
4097,
1053,
10969,
5074,
3524,
4097,
13,
13,
13,
1990,
10969,
5074,
29898,
5160,
5074,
1125,
13,
1678,
1209,
13,
1678,
396,
6655,
353,
1583,
29889,
15965,
29889,
15123,
29918,
517,
29889,
12888,
13,
1678,
396,
6655,
29889,
16044,
580,
13,
2
] |
txml.py
|
jdelgit/txml
| 0 |
29478
|
<reponame>jdelgit/txml<filename>txml.py
from xml.etree.ElementTree import iterparse, ParseError
from io import StringIO
from os.path import isfile
from re import findall
class XmlParser:
def __init__(self, source=""):
self.source = source
self.proces_file = False
self.use_io = False
self.encoding = 'UTF-8'
self.namespaces = {}
self.namespace_present = False
self._source_check()
# see also _get_encoding, _get_namespaces
def _source_check(self):
"""
[Function checkes whether the source input is a existing xml file
or a xml syle formatted string]
"""
_extension = self.source[-3:]
if _extension == "xml" or _extension == "xsd":
if isfile(self.source):
self.proces_file = True
self._get_encoding()
self._get_namespaces()
else:
print("File not found {}".format(self.source))
else:
context_test = iterparse(StringIO("""{}""".format(self.source)))
try:
context_test.__next__()
del context_test
self.proces_file = True
self.use_io = True
self._get_encoding()
self._get_namespaces()
except ParseError:
del context_test
print("Input is not in supported Xml format")
def _get_encoding(self):
if self.proces_file and not self.use_io:
with open(self.source, 'r') as f:
l = f.readline()
if 'encoding' in l:
match = findall('(encoding=.*\?)', l)
encoding = match[0].split('=')[1].replace(
'?', '').replace('\"', '')
self.encoding = encoding
# see also get_all_tags
def _get_namespaces(self):
"""[Creates a dictionary of the namespaces with their associated tags ]
Returns:
[dict] -- [Dictionary with namespaces as keys
and the corresponding tags in a list as value ]
"""
tags = self.get_all_tags()
namespaces = {}
for tag in tags:
namespace = findall('({.{1,}})', tag)
if len(namespace) > 0:
namespace = namespace[0]
formatted_tag = tag.replace(namespace, '')
try:
namespaces[namespace].append(formatted_tag)
except KeyError:
namespaces[namespace] = [formatted_tag]
if namespaces:
self.namespace_present = True
self.namespaces = namespaces
# return namespaces
def get_all_tags(self):
"""[All the unique tags available in the Xml
No hierachy is mainted for the xml structure]
Returns:
[list] -- [A list of all the unique tags available in the Xml]
"""
if self.source and self.proces_file:
if self.use_io:
context = iterparse(StringIO("""{}""".format(self.source)),
events=("start",))
else:
data = open(self.source, 'r', encoding=self.encoding)
context = iterparse(data, events=("start",))
else:
print("No source XML-file provided")
return
tag_set = []
for event, elem in context:
tag_set.append(elem.tag)
elem.clear()
if self.source and self.proces_file and not self.use_io:
data.close() # close filestream
del context
tag_set = list(set(tag_set))
return tag_set
# see also search_nodes
def search_namespace_node(self, namespace="", tag=""):
ntag = "{}{}".format(namespace, tag)
for node in self.search_nodes(tag=ntag):
yield node
# see also search_node_attr
def search_namespace_attr(self, namespace="", tag="", **kwargs):
ntag = "{}{}".format(namespace, tag)
for node in self.search_node_attr(tag=ntag, kwargs=kwargs):
yield node
# see also seach_nodes
def search_node_attr(self, tag="", get_children=True, **kwargs):
"""[This function filters results from the <search_node> function
based on given attributes,values]
Keyword Arguments:
tag {str} -- [tag of Xml node element] (default: {""})
get_children {bool} -- [Choice for whether subnodes
should be returned] (default: {True})
Returns / yields:
[dict] -- [Dictionary containing all matching nodes]
"""
if 'kwargs' in kwargs:
kwargs = kwargs['kwargs']
for node in self.search_nodes(tag=tag, get_children=get_children):
if len(kwargs) > 0:
for key in kwargs:
arg = kwargs[key]
try:
node_val = node['element']['attr'][key]
except KeyError:
# print("Key '{}' not found in element {}".format(key,
# tag))
# exit function if non-existing key is requested
node_val = ''
if node_val == arg:
give_node = True
else:
# attribute not matching
# move on to next node
give_node = False
break
else:
give_node = True
if give_node:
yield node
# see also _node_to_dict and _stack_state_controller
def search_nodes(self, tag="", get_children=True):
"""[If a tag is specified the function returns an generator
with all Xml elements which have a matching tag.
If tag is not specified, the root node is returned
When get_children is set, the function returns the subnodes
nested in a list of dictionaries]
Keyword Arguments:
tag {str} -- [tag of Xml node element] (default: {""})
get_children {bool} -- [Choice for whether subnodes
should be returned] (default: {True})
"""
if self.source and self.proces_file:
if self.use_io:
context = iterparse(StringIO("""{}""".format(self.source)),
events=('start', 'end'))
else:
data = open(self.source, 'r', encoding=self.encoding)
context = iterparse(data, events=('start', 'end'))
else:
print("Unable to process input")
return
if get_children:
children = []
p_stack = []
tag_stack = []
p_tag = ""
c_tag = ""
npd = False
append_children = False
for event, elem in context:
if not tag:
# if no tag is given then get data for entire document
tag = elem.tag
if get_children:
if elem.tag != tag and append_children:
event, elem, p_tag, c_tag, p_stack, \
tag_stack, children, npd = \
self._stack_state_controller(event=event,
elem=elem,
p_tag=p_tag,
c_tag=c_tag,
p_stack=p_stack,
tag_stack=tag_stack,
children=children,
npd=npd)
if elem.tag == tag and event == 'start':
append_children = True
if elem.tag == tag and event == 'end':
node_dict = self._node_to_dict(elem)
output_dict = {'element': node_dict, 'children': []}
elem.clear()
if get_children:
output_dict['children'] = children
children = []
append_children = False
yield output_dict
del context
if self.source and self.proces_file and not self.use_io:
data.close() # close filestream
del data
# see also node_to_dict
def _stack_state_controller(self, event, elem, p_tag="", c_tag="",
p_stack=[], tag_stack=[], children=[],
npd=False):
"""[Keeps track of a dictionary stack and a tag stack, and updates them as required.
This is done based on the start/end triggers from the elements in the Xml format]
Arguments:
event {[str]} -- [start/end points of element]
elem {[et.etree.ElementTree.Element]} -- [description]
Keyword Arguments:
p_tag {str} -- [Current parent tag (top of dict stack). (not used actively) ] (default: {""})
c_tag {str} -- [Current child tag (top of tag stack)] (default: {""})
p_stack {list} -- [Stack for holding the parent dictionaries ] (default: {[]})
tag_stack {list} -- [Stack for holding all the tags] (default: {[]})
children {list} -- [List for holding all subnodes found] (default: {[]})
npd {bool} -- [When set new dictionary is appended to stack] (default: {False})
Returns:
All arguments passed to it are returned after being updated
"""
# ndp controls the creation of new dicts in the p_stack
if (elem.tag != c_tag) and (event == "start"):
tag_stack.append(elem.tag)
if npd:
# add new dictionary when children are confiremed to exist
_p_dict = {'children': [], 'element': ""}
p_stack.append(_p_dict)
p_tag = c_tag
c_tag = elem.tag
npd = True
elif (elem.tag == c_tag) and (event == "end"):
if len(tag_stack) == 1:
# last child on stack
if len(p_stack) > 0:
# child has children
_child = p_stack.pop()
_child['element'] = self._node_to_dict(elem)
else:
_child = {'children': [],
'element': self._node_to_dict(elem)}
children.append(_child)
c_tag = ""
tag_stack.pop()
elif len(tag_stack) == len(p_stack):
_child = p_stack.pop()
_parent = p_stack.pop()
_child['element'] = self._node_to_dict(elem)
_parent['children'].append(_child)
p_stack.append(_parent)
tag_stack.pop()
c_tag = tag_stack[-1]
if len(tag_stack) > 1:
p_tag = tag_stack[-2]
else:
p_tag = ""
else:
_parent = p_stack.pop()
_child = self._node_to_dict(elem)
_parent['children'].append(_child)
p_stack.append(_parent)
tag_stack.pop()
c_tag = tag_stack[-1]
if len(tag_stack) > 1:
p_tag = tag_stack[-2]
else:
p_tag = ""
npd = False
elem.clear()
return [event, elem, p_tag, c_tag, p_stack,
tag_stack, children, npd]
def _node_to_dict(self, node=""):
"""[Convert node element attributes to dictionary]
Keyword Arguments:
node {et.etree.ElementTree.Element} -- [] (default: {""})
Returns:
[dict] -- [Dictionary containing all the attribute,value pairs
contained in the node]
"""
data = {}
data['attr'] = {n[0]: n[1] for n in node.items()}
data['text'] = node.text
data['tag'] = node.tag
return data
class XsdtoDict:
def __init__(self, source=''):
self.source = source
def convert_to_dict(self):
parser = XmlParser(source=self.source)
xsd_tags = self.get_export_type_data(parser)
data = {}
for tag in xsd_tags:
data[tag['name']] = self.parse_xml_entry(tag, parser)
return data
def get_export_type_data(self, validation_parser):
all_nodes = validation_parser.search_nodes()
output_types = []
for nodes in all_nodes:
if nodes:
output_types = [{'name': entry['element']['attr']['name'],
'tag': entry['element']['tag']}
for entry in nodes['children']]
return output_types
def parse_xml_entry(self, tag_data, xml_iterator):
parent_tag = tag_data['tag']
parent_name = tag_data['name']
sub_elements = xml_iterator.search_node_attr(tag=parent_tag,
name=parent_name)
if 'complexType' in parent_tag:
output = self.parse_complextypes(sub_elements)
elif 'simpleType' in parent_tag:
output = self.parse_simpletypes(sub_elements)
else:
output = list(sub_elements)
return output
def parse_complextypes(self, complex_iterator):
output = {}
for element_data in complex_iterator:
output['attr'] = element_data['element']['attr']
output['sequence'] = []
if element_data['children']:
for sub_element in element_data['children']:
if 'sequence' in sub_element['element']['tag']:
sequence_data = self.parse_sequence(sub_element['children'])
output['sequence'].append(sequence_data)
else:
pass
return output
def parse_sequence(self, sequence_elements):
sequence_output = []
for element in sequence_elements:
element_data = self.parse_element(element)
sequence_output.append(element_data)
return sequence_output
def parse_element(self, element):
output = {}
if 'children' in element:
output['tag'] = element['element']['tag']
output['attr'] = element['element']['attr']
element_children = element['children']
output['children_data'] = []
for child in element_children:
if 'simpleType' in child['element']['tag']:
child_data = self.parse_simpletypes(child)
output['children_data'].append(child_data)
else:
output['tag'] = element['tag']
output['attr'] = element['attr']
return output
def parse_simpletypes(self, simple_element):
output = {}
try:
element_children = simple_element['children']
for child_element in element_children:
if 'restriction' in child_element['element']['tag']:
output['restrictions'] = {'attr': child_element['element']['attr']}
restriction_data = self.parse_restrictions(child_element['children'])
output['restrictions']['restrictions'] = restriction_data
except TypeError:
element_data = list(simple_element)
element_data = element_data[0]
element_children = element_data['children']
element_children = element_children[0]['children']
output['restrictions'] = []
for data in element_children:
if 'element' in data:
output['restrictions'].append(data['element']['attr'])
else:
if 'minLength' in data['tag']:
output['restrictions'].append({'minlength':data['attr']})
if 'maxLength' in data['tag']:
output['restrictions'].append({'maxlength':data['attr']})
return output
def parse_restrictions(self, restriction_iterator):
output = []
for restriction in restriction_iterator:
restriction_data = {}
restriction_data['enumarations'] = []
restriction_data['length_data'] = []
if 'element' in restriction:
if 'enumeration' in restriction['element']['tag']:
enumaration_data = self.parse_enumarations(restriction['children'])
restriction_data['enumarations'].append(enumaration_data)
restriction_data['attr'] = restriction['element']['attr']
elif 'Length' in restriction['element']['tag']:
restriction_data['attr'] = restriction['element']['attr']
restriction_data['length_data'].append(restriction['element']['attr'])
else:
restriction_data['attr'] = restriction['attr']
output.append(restriction_data)
return output
def parse_enumarations(self, enumeration_iterator):
output = {'annotations': ""}
for enumaration in enumeration_iterator:
if 'annotation' in enumaration['element']['tag']:
annotations = enumaration['children']
annot = {'documentation': []}
for annotation in annotations:
annot['documentation'].append({'attr': annotation['attr'],
'text': ['text']})
output['annotations'] = annot
return output
|
[
1,
529,
276,
1112,
420,
29958,
29926,
6144,
5559,
29914,
29873,
3134,
29966,
9507,
29958,
29873,
3134,
29889,
2272,
13,
3166,
4903,
29889,
300,
929,
29889,
2642,
9643,
1053,
4256,
5510,
29892,
20969,
2392,
13,
3166,
12013,
1053,
1714,
5971,
13,
3166,
2897,
29889,
2084,
1053,
338,
1445,
13,
3166,
337,
1053,
1284,
497,
13,
13,
13,
1990,
24409,
11726,
29901,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2752,
13776,
1125,
13,
4706,
1583,
29889,
4993,
353,
2752,
13,
4706,
1583,
29889,
771,
778,
29918,
1445,
353,
7700,
13,
4706,
1583,
29889,
1509,
29918,
601,
353,
7700,
13,
4706,
1583,
29889,
22331,
353,
525,
10496,
29899,
29947,
29915,
13,
4706,
1583,
29889,
7039,
22459,
353,
6571,
13,
4706,
1583,
29889,
22377,
29918,
6338,
353,
7700,
13,
4706,
1583,
3032,
4993,
29918,
3198,
580,
13,
13,
1678,
396,
1074,
884,
903,
657,
29918,
22331,
29892,
903,
657,
29918,
7039,
22459,
13,
1678,
822,
903,
4993,
29918,
3198,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
518,
6678,
1423,
267,
3692,
278,
2752,
1881,
338,
263,
5923,
4903,
934,
13,
308,
470,
263,
4903,
269,
1508,
20917,
1347,
29962,
13,
4706,
9995,
13,
13,
4706,
903,
17588,
353,
1583,
29889,
4993,
14352,
29941,
17531,
13,
4706,
565,
903,
17588,
1275,
376,
3134,
29908,
470,
903,
17588,
1275,
376,
19168,
1115,
13,
9651,
565,
338,
1445,
29898,
1311,
29889,
4993,
1125,
13,
18884,
1583,
29889,
771,
778,
29918,
1445,
353,
5852,
13,
18884,
1583,
3032,
657,
29918,
22331,
580,
13,
18884,
1583,
3032,
657,
29918,
7039,
22459,
580,
13,
9651,
1683,
29901,
13,
18884,
1596,
703,
2283,
451,
1476,
6571,
1642,
4830,
29898,
1311,
29889,
4993,
876,
13,
4706,
1683,
29901,
13,
9651,
3030,
29918,
1688,
353,
4256,
5510,
29898,
1231,
5971,
703,
15945,
29912,
5038,
29908,
1642,
4830,
29898,
1311,
29889,
4993,
4961,
13,
9651,
1018,
29901,
13,
18884,
3030,
29918,
1688,
17255,
4622,
1649,
580,
13,
18884,
628,
3030,
29918,
1688,
13,
18884,
1583,
29889,
771,
778,
29918,
1445,
353,
5852,
13,
18884,
1583,
29889,
1509,
29918,
601,
353,
5852,
13,
18884,
1583,
3032,
657,
29918,
22331,
580,
13,
18884,
1583,
3032,
657,
29918,
7039,
22459,
580,
13,
9651,
5174,
20969,
2392,
29901,
13,
18884,
628,
3030,
29918,
1688,
13,
18884,
1596,
703,
4290,
338,
451,
297,
6969,
24409,
3402,
1159,
13,
13,
1678,
822,
903,
657,
29918,
22331,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
771,
778,
29918,
1445,
322,
451,
1583,
29889,
1509,
29918,
601,
29901,
13,
9651,
411,
1722,
29898,
1311,
29889,
4993,
29892,
525,
29878,
1495,
408,
285,
29901,
13,
18884,
301,
353,
285,
29889,
949,
1220,
580,
13,
9651,
565,
525,
22331,
29915,
297,
301,
29901,
13,
18884,
1993,
353,
1284,
497,
877,
29898,
22331,
29922,
5575,
29905,
7897,
742,
301,
29897,
13,
18884,
8025,
353,
1993,
29961,
29900,
1822,
5451,
877,
29922,
29861,
29896,
1822,
6506,
29898,
13,
462,
1678,
525,
29973,
742,
525,
2824,
6506,
877,
5931,
742,
27255,
13,
18884,
1583,
29889,
22331,
353,
8025,
13,
13,
1678,
396,
1074,
884,
679,
29918,
497,
29918,
11338,
13,
1678,
822,
903,
657,
29918,
7039,
22459,
29898,
1311,
1125,
13,
4706,
9995,
29961,
9832,
1078,
263,
8600,
310,
278,
2983,
22459,
411,
1009,
6942,
8282,
4514,
13,
13,
4706,
16969,
29901,
13,
9651,
518,
8977,
29962,
1192,
518,
11513,
411,
2983,
22459,
408,
6611,
13,
462,
539,
322,
278,
6590,
8282,
297,
263,
1051,
408,
995,
4514,
13,
4706,
9995,
13,
13,
4706,
8282,
353,
1583,
29889,
657,
29918,
497,
29918,
11338,
580,
13,
4706,
2983,
22459,
353,
6571,
13,
4706,
363,
4055,
297,
8282,
29901,
13,
9651,
7397,
353,
1284,
497,
877,
3319,
29889,
29912,
29896,
29892,
24289,
742,
4055,
29897,
13,
9651,
565,
7431,
29898,
22377,
29897,
1405,
29871,
29900,
29901,
13,
18884,
7397,
353,
7397,
29961,
29900,
29962,
13,
18884,
20917,
29918,
4039,
353,
4055,
29889,
6506,
29898,
22377,
29892,
27255,
13,
18884,
1018,
29901,
13,
462,
1678,
2983,
22459,
29961,
22377,
1822,
4397,
29898,
689,
19667,
29918,
4039,
29897,
13,
18884,
5174,
7670,
2392,
29901,
13,
462,
1678,
2983,
22459,
29961,
22377,
29962,
353,
518,
689,
19667,
29918,
4039,
29962,
13,
4706,
565,
2983,
22459,
29901,
13,
9651,
1583,
29889,
22377,
29918,
6338,
353,
5852,
13,
4706,
1583,
29889,
7039,
22459,
353,
2983,
22459,
13,
4706,
396,
736,
2983,
22459,
13,
13,
1678,
822,
679,
29918,
497,
29918,
11338,
29898,
1311,
1125,
13,
4706,
9995,
29961,
3596,
278,
5412,
8282,
3625,
297,
278,
24409,
13,
9651,
1939,
6128,
496,
29891,
338,
1667,
9446,
363,
278,
4903,
3829,
29962,
13,
13,
4706,
16969,
29901,
13,
9651,
518,
1761,
29962,
1192,
518,
29909,
1051,
310,
599,
278,
5412,
8282,
3625,
297,
278,
24409,
29962,
13,
4706,
9995,
13,
13,
4706,
565,
1583,
29889,
4993,
322,
1583,
29889,
771,
778,
29918,
1445,
29901,
13,
13,
9651,
565,
1583,
29889,
1509,
29918,
601,
29901,
13,
18884,
3030,
353,
4256,
5510,
29898,
1231,
5971,
703,
15945,
29912,
5038,
29908,
1642,
4830,
29898,
1311,
29889,
4993,
8243,
13,
462,
462,
1678,
4959,
29922,
703,
2962,
613,
876,
13,
9651,
1683,
29901,
13,
18884,
848,
353,
1722,
29898,
1311,
29889,
4993,
29892,
525,
29878,
742,
8025,
29922,
1311,
29889,
22331,
29897,
13,
18884,
3030,
353,
4256,
5510,
29898,
1272,
29892,
4959,
29922,
703,
2962,
613,
876,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
3782,
2752,
6560,
29899,
1445,
4944,
1159,
13,
9651,
736,
13,
4706,
4055,
29918,
842,
353,
5159,
13,
4706,
363,
1741,
29892,
21268,
297,
3030,
29901,
13,
9651,
4055,
29918,
842,
29889,
4397,
29898,
20461,
29889,
4039,
29897,
13,
9651,
21268,
29889,
8551,
580,
13,
4706,
565,
1583,
29889,
4993,
322,
1583,
29889,
771,
778,
29918,
1445,
322,
451,
1583,
29889,
1509,
29918,
601,
29901,
13,
9651,
848,
29889,
5358,
580,
29871,
396,
3802,
977,
342,
1633,
13,
4706,
628,
3030,
13,
4706,
4055,
29918,
842,
353,
1051,
29898,
842,
29898,
4039,
29918,
842,
876,
13,
4706,
736,
4055,
29918,
842,
13,
13,
1678,
396,
1074,
884,
2740,
29918,
18010,
13,
1678,
822,
2740,
29918,
22377,
29918,
3177,
29898,
1311,
29892,
7397,
543,
613,
4055,
13776,
1125,
13,
4706,
302,
4039,
353,
29850,
1157,
29913,
1642,
4830,
29898,
22377,
29892,
4055,
29897,
13,
4706,
363,
2943,
297,
1583,
29889,
4478,
29918,
18010,
29898,
4039,
29922,
593,
351,
1125,
13,
9651,
7709,
2943,
13,
13,
1678,
396,
1074,
884,
2740,
29918,
3177,
29918,
5552,
13,
1678,
822,
2740,
29918,
22377,
29918,
5552,
29898,
1311,
29892,
7397,
543,
613,
4055,
543,
613,
3579,
19290,
1125,
13,
4706,
302,
4039,
353,
29850,
1157,
29913,
1642,
4830,
29898,
22377,
29892,
4055,
29897,
13,
4706,
363,
2943,
297,
1583,
29889,
4478,
29918,
3177,
29918,
5552,
29898,
4039,
29922,
593,
351,
29892,
9049,
5085,
29922,
19290,
1125,
13,
9651,
7709,
2943,
13,
13,
1678,
396,
1074,
884,
409,
496,
29918,
18010,
13,
1678,
822,
2740,
29918,
3177,
29918,
5552,
29898,
1311,
29892,
4055,
543,
613,
679,
29918,
11991,
29922,
5574,
29892,
3579,
19290,
1125,
13,
4706,
9995,
29961,
4013,
740,
18094,
2582,
515,
278,
529,
4478,
29918,
3177,
29958,
740,
13,
9651,
2729,
373,
2183,
8393,
29892,
5975,
29962,
13,
13,
4706,
7670,
1742,
11842,
9331,
29901,
13,
9651,
4055,
426,
710,
29913,
1192,
518,
4039,
310,
24409,
2943,
1543,
29962,
313,
4381,
29901,
8853,
29908,
1800,
13,
9651,
679,
29918,
11991,
426,
11227,
29913,
1192,
518,
29620,
363,
3692,
1014,
18010,
13,
462,
462,
1678,
881,
367,
4133,
29962,
313,
4381,
29901,
426,
5574,
1800,
13,
13,
4706,
16969,
847,
17498,
29901,
13,
9651,
518,
8977,
29962,
1192,
518,
11513,
6943,
599,
9686,
7573,
29962,
13,
4706,
9995,
13,
13,
4706,
565,
525,
19290,
29915,
297,
9049,
5085,
29901,
13,
9651,
9049,
5085,
353,
9049,
5085,
1839,
19290,
2033,
13,
4706,
363,
2943,
297,
1583,
29889,
4478,
29918,
18010,
29898,
4039,
29922,
4039,
29892,
679,
29918,
11991,
29922,
657,
29918,
11991,
1125,
13,
9651,
565,
7431,
29898,
19290,
29897,
1405,
29871,
29900,
29901,
13,
18884,
363,
1820,
297,
9049,
5085,
29901,
13,
462,
1678,
1852,
353,
9049,
5085,
29961,
1989,
29962,
13,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
2943,
29918,
791,
353,
2943,
1839,
5029,
16215,
5552,
2033,
29961,
1989,
29962,
13,
462,
1678,
5174,
7670,
2392,
29901,
13,
462,
4706,
396,
1596,
703,
2558,
525,
8875,
29915,
451,
1476,
297,
1543,
6571,
1642,
4830,
29898,
1989,
29892,
13,
462,
4706,
396,
462,
462,
462,
4055,
876,
13,
462,
4706,
396,
6876,
740,
565,
1661,
29899,
735,
15423,
1820,
338,
13877,
13,
462,
4706,
2943,
29918,
791,
353,
6629,
13,
13,
462,
1678,
565,
2943,
29918,
791,
1275,
1852,
29901,
13,
462,
4706,
2367,
29918,
3177,
353,
5852,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
396,
5352,
451,
9686,
13,
462,
4706,
396,
4337,
373,
304,
2446,
2943,
13,
462,
4706,
2367,
29918,
3177,
353,
7700,
13,
462,
4706,
2867,
13,
9651,
1683,
29901,
13,
18884,
2367,
29918,
3177,
353,
5852,
13,
9651,
565,
2367,
29918,
3177,
29901,
13,
18884,
7709,
2943,
13,
13,
1678,
396,
1074,
884,
903,
3177,
29918,
517,
29918,
8977,
322,
903,
1429,
29918,
3859,
29918,
8299,
13,
1678,
822,
2740,
29918,
18010,
29898,
1311,
29892,
4055,
543,
613,
679,
29918,
11991,
29922,
5574,
1125,
13,
4706,
9995,
29961,
3644,
263,
4055,
338,
6790,
278,
740,
3639,
385,
15299,
13,
9651,
411,
599,
24409,
3161,
607,
505,
263,
9686,
4055,
29889,
13,
9651,
960,
4055,
338,
451,
6790,
29892,
278,
3876,
2943,
338,
4133,
13,
9651,
1932,
679,
29918,
11991,
338,
731,
29892,
278,
740,
3639,
278,
1014,
18010,
13,
9651,
9322,
297,
263,
1051,
310,
21503,
4314,
29962,
13,
13,
4706,
7670,
1742,
11842,
9331,
29901,
13,
9651,
4055,
426,
710,
29913,
1192,
518,
4039,
310,
24409,
2943,
1543,
29962,
313,
4381,
29901,
8853,
29908,
1800,
13,
9651,
679,
29918,
11991,
426,
11227,
29913,
1192,
518,
29620,
363,
3692,
1014,
18010,
13,
462,
462,
1678,
881,
367,
4133,
29962,
313,
4381,
29901,
426,
5574,
1800,
13,
4706,
9995,
13,
13,
4706,
565,
1583,
29889,
4993,
322,
1583,
29889,
771,
778,
29918,
1445,
29901,
13,
9651,
565,
1583,
29889,
1509,
29918,
601,
29901,
13,
18884,
3030,
353,
4256,
5510,
29898,
1231,
5971,
703,
15945,
29912,
5038,
29908,
1642,
4830,
29898,
1311,
29889,
4993,
8243,
13,
462,
462,
1678,
4959,
29922,
877,
2962,
742,
525,
355,
8785,
13,
9651,
1683,
29901,
13,
18884,
848,
353,
1722,
29898,
1311,
29889,
4993,
29892,
525,
29878,
742,
8025,
29922,
1311,
29889,
22331,
29897,
13,
18884,
3030,
353,
4256,
5510,
29898,
1272,
29892,
4959,
29922,
877,
2962,
742,
525,
355,
8785,
13,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
2525,
519,
304,
1889,
1881,
1159,
13,
9651,
736,
13,
4706,
565,
679,
29918,
11991,
29901,
13,
9651,
4344,
353,
5159,
13,
9651,
282,
29918,
1429,
353,
5159,
13,
9651,
4055,
29918,
1429,
353,
5159,
13,
9651,
282,
29918,
4039,
353,
5124,
13,
9651,
274,
29918,
4039,
353,
5124,
13,
9651,
7442,
29881,
353,
7700,
13,
4706,
9773,
29918,
11991,
353,
7700,
13,
4706,
363,
1741,
29892,
21268,
297,
3030,
29901,
13,
9651,
565,
451,
4055,
29901,
13,
18884,
396,
565,
694,
4055,
338,
2183,
769,
679,
848,
363,
4152,
1842,
13,
18884,
4055,
353,
21268,
29889,
4039,
13,
13,
9651,
565,
679,
29918,
11991,
29901,
13,
18884,
565,
21268,
29889,
4039,
2804,
4055,
322,
9773,
29918,
11991,
29901,
13,
462,
1678,
1741,
29892,
21268,
29892,
282,
29918,
4039,
29892,
274,
29918,
4039,
29892,
282,
29918,
1429,
29892,
320,
13,
462,
4706,
4055,
29918,
1429,
29892,
4344,
29892,
7442,
29881,
353,
320,
13,
462,
4706,
1583,
3032,
1429,
29918,
3859,
29918,
8299,
29898,
3696,
29922,
3696,
29892,
13,
462,
462,
462,
268,
21268,
29922,
20461,
29892,
13,
462,
462,
462,
268,
282,
29918,
4039,
29922,
29886,
29918,
4039,
29892,
13,
462,
462,
462,
268,
274,
29918,
4039,
29922,
29883,
29918,
4039,
29892,
13,
462,
462,
462,
268,
282,
29918,
1429,
29922,
29886,
29918,
1429,
29892,
13,
462,
462,
462,
268,
4055,
29918,
1429,
29922,
4039,
29918,
1429,
29892,
13,
462,
462,
462,
268,
4344,
29922,
11991,
29892,
13,
462,
462,
462,
268,
7442,
29881,
29922,
9302,
29881,
29897,
13,
13,
18884,
565,
21268,
29889,
4039,
1275,
4055,
322,
1741,
1275,
525,
2962,
2396,
13,
462,
1678,
9773,
29918,
11991,
353,
5852,
13,
13,
9651,
565,
21268,
29889,
4039,
1275,
4055,
322,
1741,
1275,
525,
355,
2396,
13,
13,
18884,
2943,
29918,
8977,
353,
1583,
3032,
3177,
29918,
517,
29918,
8977,
29898,
20461,
29897,
13,
18884,
1962,
29918,
8977,
353,
11117,
5029,
2396,
2943,
29918,
8977,
29892,
525,
11991,
2396,
5159,
29913,
13,
18884,
21268,
29889,
8551,
580,
13,
13,
18884,
565,
679,
29918,
11991,
29901,
13,
462,
1678,
1962,
29918,
8977,
1839,
11991,
2033,
353,
4344,
13,
462,
1678,
4344,
353,
5159,
13,
462,
1678,
9773,
29918,
11991,
353,
7700,
13,
13,
18884,
7709,
1962,
29918,
8977,
13,
13,
4706,
628,
3030,
13,
4706,
565,
1583,
29889,
4993,
322,
1583,
29889,
771,
778,
29918,
1445,
322,
451,
1583,
29889,
1509,
29918,
601,
29901,
13,
9651,
848,
29889,
5358,
580,
29871,
396,
3802,
977,
342,
1633,
13,
4706,
628,
848,
13,
13,
1678,
396,
1074,
884,
2943,
29918,
517,
29918,
8977,
13,
1678,
822,
903,
1429,
29918,
3859,
29918,
8299,
29898,
1311,
29892,
1741,
29892,
21268,
29892,
282,
29918,
4039,
543,
613,
274,
29918,
4039,
543,
613,
13,
462,
18884,
282,
29918,
1429,
11759,
1402,
4055,
29918,
1429,
11759,
1402,
4344,
11759,
1402,
13,
462,
18884,
7442,
29881,
29922,
8824,
1125,
13,
4706,
9995,
29961,
29968,
3905,
567,
5702,
310,
263,
8600,
5096,
322,
263,
4055,
5096,
29892,
322,
11217,
963,
408,
3734,
29889,
13,
9651,
910,
338,
2309,
2729,
373,
278,
1369,
29914,
355,
23660,
515,
278,
3161,
297,
278,
24409,
3402,
29962,
13,
13,
4706,
11842,
9331,
29901,
13,
9651,
1741,
426,
29961,
710,
12258,
1192,
518,
2962,
29914,
355,
3291,
310,
1543,
29962,
13,
9651,
21268,
426,
29961,
300,
29889,
300,
929,
29889,
2642,
9643,
29889,
2642,
12258,
1192,
518,
8216,
29962,
13,
13,
4706,
7670,
1742,
11842,
9331,
29901,
13,
9651,
282,
29918,
4039,
426,
710,
29913,
1192,
518,
7583,
3847,
4055,
313,
3332,
310,
9657,
5096,
467,
313,
1333,
1304,
1044,
3598,
29897,
4514,
313,
4381,
29901,
8853,
29908,
1800,
13,
9651,
274,
29918,
4039,
426,
710,
29913,
1192,
518,
7583,
2278,
4055,
313,
3332,
310,
4055,
5096,
4638,
313,
4381,
29901,
8853,
29908,
1800,
13,
9651,
282,
29918,
1429,
426,
1761,
29913,
1192,
518,
7264,
363,
13587,
278,
3847,
21503,
4314,
4514,
313,
4381,
29901,
426,
2636,
1800,
13,
9651,
4055,
29918,
1429,
426,
1761,
29913,
1192,
518,
7264,
363,
13587,
599,
278,
8282,
29962,
313,
4381,
29901,
426,
2636,
1800,
13,
9651,
4344,
426,
1761,
29913,
1192,
518,
1293,
363,
13587,
599,
1014,
18010,
1476,
29962,
313,
4381,
29901,
426,
2636,
1800,
13,
9651,
7442,
29881,
426,
11227,
29913,
1192,
518,
10401,
731,
716,
8600,
338,
623,
2760,
304,
5096,
29962,
313,
4381,
29901,
426,
8824,
1800,
13,
13,
4706,
16969,
29901,
13,
9651,
2178,
6273,
4502,
304,
372,
526,
4133,
1156,
1641,
4784,
13,
4706,
9995,
13,
13,
4706,
396,
29871,
299,
29886,
11761,
278,
11265,
310,
716,
9657,
29879,
297,
278,
282,
29918,
1429,
13,
4706,
565,
313,
20461,
29889,
4039,
2804,
274,
29918,
4039,
29897,
322,
313,
3696,
1275,
376,
2962,
29908,
1125,
13,
9651,
4055,
29918,
1429,
29889,
4397,
29898,
20461,
29889,
4039,
29897,
13,
9651,
565,
7442,
29881,
29901,
13,
18884,
396,
788,
716,
8600,
746,
4344,
526,
1970,
533,
2168,
304,
1863,
13,
18884,
903,
29886,
29918,
8977,
353,
11117,
11991,
2396,
19997,
525,
5029,
2396,
5124,
29913,
13,
18884,
282,
29918,
1429,
29889,
4397,
7373,
29886,
29918,
8977,
29897,
13,
9651,
282,
29918,
4039,
353,
274,
29918,
4039,
13,
9651,
274,
29918,
4039,
353,
21268,
29889,
4039,
13,
9651,
7442,
29881,
353,
5852,
13,
13,
4706,
25342,
313,
20461,
29889,
4039,
1275,
274,
29918,
4039,
29897,
322,
313,
3696,
1275,
376,
355,
29908,
1125,
13,
13,
9651,
565,
7431,
29898,
4039,
29918,
1429,
29897,
1275,
29871,
29896,
29901,
13,
18884,
396,
1833,
2278,
373,
5096,
13,
18884,
565,
7431,
29898,
29886,
29918,
1429,
29897,
1405,
29871,
29900,
29901,
13,
462,
1678,
396,
2278,
756,
4344,
13,
462,
1678,
903,
5145,
353,
282,
29918,
1429,
29889,
7323,
580,
13,
462,
1678,
903,
5145,
1839,
5029,
2033,
353,
1583,
3032,
3177,
29918,
517,
29918,
8977,
29898,
20461,
29897,
13,
13,
18884,
1683,
29901,
13,
462,
1678,
903,
5145,
353,
11117,
11991,
2396,
19997,
13,
462,
795,
525,
5029,
2396,
1583,
3032,
3177,
29918,
517,
29918,
8977,
29898,
20461,
2915,
13,
18884,
4344,
29889,
4397,
7373,
5145,
29897,
13,
18884,
274,
29918,
4039,
353,
5124,
13,
18884,
4055,
29918,
1429,
29889,
7323,
580,
13,
13,
9651,
25342,
7431,
29898,
4039,
29918,
1429,
29897,
1275,
7431,
29898,
29886,
29918,
1429,
1125,
13,
13,
18884,
903,
5145,
353,
282,
29918,
1429,
29889,
7323,
580,
13,
18884,
903,
3560,
353,
282,
29918,
1429,
29889,
7323,
580,
13,
18884,
903,
5145,
1839,
5029,
2033,
353,
1583,
3032,
3177,
29918,
517,
29918,
8977,
29898,
20461,
29897,
13,
18884,
903,
3560,
1839,
11991,
13359,
4397,
7373,
5145,
29897,
13,
18884,
282,
29918,
1429,
29889,
4397,
7373,
3560,
29897,
13,
13,
18884,
4055,
29918,
1429,
29889,
7323,
580,
13,
18884,
274,
29918,
4039,
353,
4055,
29918,
1429,
14352,
29896,
29962,
13,
18884,
565,
7431,
29898,
4039,
29918,
1429,
29897,
1405,
29871,
29896,
29901,
13,
462,
1678,
282,
29918,
4039,
353,
4055,
29918,
1429,
14352,
29906,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
282,
29918,
4039,
353,
5124,
13,
13,
9651,
1683,
29901,
13,
18884,
903,
3560,
353,
282,
29918,
1429,
29889,
7323,
580,
13,
18884,
903,
5145,
353,
1583,
3032,
3177,
29918,
517,
29918,
8977,
29898,
20461,
29897,
13,
18884,
903,
3560,
1839,
11991,
13359,
4397,
7373,
5145,
29897,
13,
18884,
282,
29918,
1429,
29889,
4397,
7373,
3560,
29897,
13,
13,
18884,
4055,
29918,
1429,
29889,
7323,
580,
13,
18884,
274,
29918,
4039,
353,
4055,
29918,
1429,
14352,
29896,
29962,
13,
18884,
565,
7431,
29898,
4039,
29918,
1429,
29897,
1405,
29871,
29896,
29901,
13,
462,
1678,
282,
29918,
4039,
353,
4055,
29918,
1429,
14352,
29906,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
282,
29918,
4039,
353,
5124,
13,
13,
9651,
7442,
29881,
353,
7700,
13,
9651,
21268,
29889,
8551,
580,
13,
13,
4706,
736,
518,
3696,
29892,
21268,
29892,
282,
29918,
4039,
29892,
274,
29918,
4039,
29892,
282,
29918,
1429,
29892,
13,
18884,
4055,
29918,
1429,
29892,
4344,
29892,
7442,
29881,
29962,
13,
13,
1678,
822,
903,
3177,
29918,
517,
29918,
8977,
29898,
1311,
29892,
2943,
13776,
1125,
13,
4706,
9995,
29961,
18455,
2943,
1543,
8393,
304,
8600,
29962,
13,
13,
4706,
7670,
1742,
11842,
9331,
29901,
13,
9651,
2943,
426,
300,
29889,
300,
929,
29889,
2642,
9643,
29889,
2642,
29913,
1192,
5159,
313,
4381,
29901,
8853,
29908,
1800,
13,
13,
4706,
16969,
29901,
13,
9651,
518,
8977,
29962,
1192,
518,
11513,
6943,
599,
278,
5352,
29892,
1767,
11000,
13,
462,
539,
11122,
297,
278,
2943,
29962,
13,
4706,
9995,
13,
4706,
848,
353,
6571,
13,
4706,
848,
1839,
5552,
2033,
353,
426,
29876,
29961,
29900,
5387,
302,
29961,
29896,
29962,
363,
302,
297,
2943,
29889,
7076,
28296,
13,
4706,
848,
1839,
726,
2033,
353,
2943,
29889,
726,
13,
4706,
848,
1839,
4039,
2033,
353,
2943,
29889,
4039,
13,
4706,
736,
848,
13,
13,
13,
1990,
1060,
4928,
517,
21533,
29901,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2752,
2433,
29374,
13,
4706,
1583,
29889,
4993,
353,
2752,
13,
13,
1678,
822,
3588,
29918,
517,
29918,
8977,
29898,
1311,
1125,
13,
4706,
13812,
353,
24409,
11726,
29898,
4993,
29922,
1311,
29889,
4993,
29897,
13,
4706,
921,
4928,
29918,
11338,
353,
1583,
29889,
657,
29918,
15843,
29918,
1853,
29918,
1272,
29898,
16680,
29897,
13,
4706,
848,
353,
6571,
13,
4706,
363,
4055,
297,
921,
4928,
29918,
11338,
29901,
13,
9651,
848,
29961,
4039,
1839,
978,
2033,
29962,
353,
1583,
29889,
5510,
29918,
3134,
29918,
8269,
29898,
4039,
29892,
13812,
29897,
13,
4706,
736,
848,
13,
13,
1678,
822,
679,
29918,
15843,
29918,
1853,
29918,
1272,
29898,
1311,
29892,
8845,
29918,
16680,
1125,
13,
13,
4706,
599,
29918,
18010,
353,
8845,
29918,
16680,
29889,
4478,
29918,
18010,
580,
13,
4706,
1962,
29918,
8768,
353,
5159,
13,
4706,
363,
7573,
297,
599,
29918,
18010,
29901,
13,
9651,
565,
7573,
29901,
13,
18884,
1962,
29918,
8768,
353,
518,
10998,
978,
2396,
6251,
1839,
5029,
16215,
5552,
16215,
978,
7464,
13,
462,
18884,
525,
4039,
2396,
6251,
1839,
5029,
16215,
4039,
2033,
29913,
13,
462,
18884,
363,
6251,
297,
7573,
1839,
11991,
2033,
29962,
13,
4706,
736,
1962,
29918,
8768,
13,
13,
1678,
822,
6088,
29918,
3134,
29918,
8269,
29898,
1311,
29892,
4055,
29918,
1272,
29892,
4903,
29918,
17609,
1125,
13,
4706,
3847,
29918,
4039,
353,
4055,
29918,
1272,
1839,
4039,
2033,
13,
4706,
3847,
29918,
978,
353,
4055,
29918,
1272,
1839,
978,
2033,
13,
13,
4706,
1014,
29918,
17664,
353,
4903,
29918,
17609,
29889,
4478,
29918,
3177,
29918,
5552,
29898,
4039,
29922,
3560,
29918,
4039,
29892,
13,
462,
462,
462,
268,
1024,
29922,
3560,
29918,
978,
29897,
13,
4706,
565,
525,
19676,
1542,
29915,
297,
3847,
29918,
4039,
29901,
13,
9651,
1962,
353,
1583,
29889,
5510,
29918,
5729,
486,
7384,
29898,
1491,
29918,
17664,
29897,
13,
4706,
25342,
525,
12857,
1542,
29915,
297,
3847,
29918,
4039,
29901,
13,
9651,
1962,
353,
1583,
29889,
5510,
29918,
12857,
8768,
29898,
1491,
29918,
17664,
29897,
13,
4706,
1683,
29901,
13,
9651,
1962,
353,
1051,
29898,
1491,
29918,
17664,
29897,
13,
4706,
736,
1962,
13,
13,
1678,
822,
6088,
29918,
5729,
486,
7384,
29898,
1311,
29892,
4280,
29918,
17609,
1125,
13,
13,
4706,
1962,
353,
6571,
13,
4706,
363,
1543,
29918,
1272,
297,
4280,
29918,
17609,
29901,
13,
9651,
1962,
1839,
5552,
2033,
353,
1543,
29918,
1272,
1839,
5029,
16215,
5552,
2033,
13,
9651,
1962,
1839,
16506,
2033,
353,
5159,
13,
9651,
565,
1543,
29918,
1272,
1839,
11991,
2033,
29901,
13,
18884,
363,
1014,
29918,
5029,
297,
1543,
29918,
1272,
1839,
11991,
2033,
29901,
13,
462,
1678,
565,
525,
16506,
29915,
297,
1014,
29918,
5029,
1839,
5029,
16215,
4039,
2033,
29901,
13,
462,
4706,
5665,
29918,
1272,
353,
1583,
29889,
5510,
29918,
16506,
29898,
1491,
29918,
5029,
1839,
11991,
11287,
13,
462,
4706,
1962,
1839,
16506,
13359,
4397,
29898,
16506,
29918,
1272,
29897,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
1209,
13,
13,
4706,
736,
1962,
13,
13,
1678,
822,
6088,
29918,
16506,
29898,
1311,
29892,
5665,
29918,
17664,
1125,
13,
13,
4706,
5665,
29918,
4905,
353,
5159,
13,
4706,
363,
1543,
297,
5665,
29918,
17664,
29901,
13,
9651,
1543,
29918,
1272,
353,
1583,
29889,
5510,
29918,
5029,
29898,
5029,
29897,
13,
9651,
5665,
29918,
4905,
29889,
4397,
29898,
5029,
29918,
1272,
29897,
13,
4706,
736,
5665,
29918,
4905,
13,
13,
1678,
822,
6088,
29918,
5029,
29898,
1311,
29892,
1543,
1125,
13,
4706,
1962,
353,
6571,
13,
13,
4706,
565,
525,
11991,
29915,
297,
1543,
29901,
13,
9651,
1962,
1839,
4039,
2033,
353,
1543,
1839,
5029,
16215,
4039,
2033,
13,
9651,
1962,
1839,
5552,
2033,
353,
1543,
1839,
5029,
16215,
5552,
2033,
13,
9651,
1543,
29918,
11991,
353,
1543,
1839,
11991,
2033,
13,
9651,
1962,
1839,
11991,
29918,
1272,
2033,
353,
5159,
13,
9651,
363,
2278,
297,
1543,
29918,
11991,
29901,
13,
18884,
565,
525,
12857,
1542,
29915,
297,
2278,
1839,
5029,
16215,
4039,
2033,
29901,
13,
462,
1678,
2278,
29918,
1272,
353,
1583,
29889,
5510,
29918,
12857,
8768,
29898,
5145,
29897,
13,
462,
1678,
1962,
1839,
11991,
29918,
1272,
13359,
4397,
29898,
5145,
29918,
1272,
29897,
13,
4706,
1683,
29901,
13,
9651,
1962,
1839,
4039,
2033,
353,
1543,
1839,
4039,
2033,
13,
9651,
1962,
1839,
5552,
2033,
353,
1543,
1839,
5552,
2033,
13,
4706,
736,
1962,
13,
13,
1678,
822,
6088,
29918,
12857,
8768,
29898,
1311,
29892,
2560,
29918,
5029,
1125,
13,
13,
4706,
1962,
353,
6571,
13,
4706,
1018,
29901,
13,
9651,
1543,
29918,
11991,
353,
2560,
29918,
5029,
1839,
11991,
2033,
13,
9651,
363,
2278,
29918,
5029,
297,
1543,
29918,
11991,
29901,
13,
18884,
565,
525,
5060,
19902,
29915,
297,
2278,
29918,
5029,
1839,
5029,
16215,
4039,
2033,
29901,
13,
462,
1678,
1962,
1839,
5060,
4146,
1080,
2033,
353,
11117,
5552,
2396,
2278,
29918,
5029,
1839,
5029,
16215,
5552,
2033,
29913,
13,
462,
1678,
24345,
29918,
1272,
353,
1583,
29889,
5510,
29918,
5060,
4146,
1080,
29898,
5145,
29918,
5029,
1839,
11991,
11287,
13,
462,
1678,
1962,
1839,
5060,
4146,
1080,
16215,
5060,
4146,
1080,
2033,
353,
24345,
29918,
1272,
13,
4706,
5174,
20948,
29901,
13,
9651,
1543,
29918,
1272,
353,
1051,
29898,
12857,
29918,
5029,
29897,
13,
9651,
1543,
29918,
1272,
353,
1543,
29918,
1272,
29961,
29900,
29962,
13,
9651,
1543,
29918,
11991,
353,
1543,
29918,
1272,
1839,
11991,
2033,
13,
9651,
1543,
29918,
11991,
353,
1543,
29918,
11991,
29961,
29900,
22322,
11991,
2033,
13,
13,
9651,
1962,
1839,
5060,
4146,
1080,
2033,
353,
5159,
13,
9651,
363,
848,
297,
1543,
29918,
11991,
29901,
13,
18884,
565,
525,
5029,
29915,
297,
848,
29901,
13,
462,
1678,
1962,
1839,
5060,
4146,
1080,
13359,
4397,
29898,
1272,
1839,
5029,
16215,
5552,
11287,
29871,
13,
18884,
1683,
29901,
13,
462,
268,
565,
525,
1195,
6513,
29915,
297,
848,
1839,
4039,
2033,
29901,
13,
462,
308,
1962,
1839,
5060,
4146,
1080,
13359,
4397,
3319,
29915,
1195,
2848,
2396,
1272,
1839,
5552,
2033,
1800,
13,
462,
268,
565,
525,
3317,
6513,
29915,
297,
848,
1839,
4039,
2033,
29901,
13,
462,
308,
1962,
1839,
5060,
4146,
1080,
13359,
4397,
3319,
29915,
3317,
2848,
2396,
1272,
1839,
5552,
2033,
1800,
13,
4706,
736,
1962,
13,
13,
1678,
822,
6088,
29918,
5060,
4146,
1080,
29898,
1311,
29892,
24345,
29918,
17609,
1125,
13,
13,
4706,
1962,
353,
5159,
13,
4706,
363,
24345,
297,
24345,
29918,
17609,
29901,
13,
9651,
24345,
29918,
1272,
353,
6571,
13,
9651,
24345,
29918,
1272,
1839,
18605,
279,
800,
2033,
353,
5159,
13,
9651,
24345,
29918,
1272,
1839,
2848,
29918,
1272,
2033,
353,
5159,
13,
9651,
565,
525,
5029,
29915,
297,
24345,
29901,
13,
18884,
565,
525,
264,
4680,
362,
29915,
297,
24345,
1839,
5029,
16215,
4039,
2033,
29901,
13,
462,
1678,
14115,
279,
362,
29918,
1272,
353,
1583,
29889,
5510,
29918,
18605,
279,
800,
29898,
5060,
19902,
1839,
11991,
11287,
13,
462,
1678,
24345,
29918,
1272,
1839,
18605,
279,
800,
13359,
4397,
29898,
18605,
279,
362,
29918,
1272,
29897,
13,
462,
1678,
24345,
29918,
1272,
1839,
5552,
2033,
353,
24345,
1839,
5029,
16215,
5552,
2033,
13,
18884,
25342,
525,
6513,
29915,
297,
24345,
1839,
5029,
16215,
4039,
2033,
29901,
13,
462,
1678,
24345,
29918,
1272,
1839,
5552,
2033,
353,
24345,
1839,
5029,
16215,
5552,
2033,
13,
462,
1678,
24345,
29918,
1272,
1839,
2848,
29918,
1272,
13359,
4397,
29898,
5060,
19902,
1839,
5029,
16215,
5552,
11287,
13,
9651,
1683,
29901,
13,
18884,
24345,
29918,
1272,
1839,
5552,
2033,
353,
24345,
1839,
5552,
2033,
13,
13,
9651,
1962,
29889,
4397,
29898,
5060,
19902,
29918,
1272,
29897,
13,
13,
4706,
736,
1962,
13,
13,
1678,
822,
6088,
29918,
18605,
279,
800,
29898,
1311,
29892,
22447,
362,
29918,
17609,
1125,
13,
13,
4706,
1962,
353,
11117,
6735,
800,
2396,
5124,
29913,
13,
4706,
363,
14115,
279,
362,
297,
22447,
362,
29918,
17609,
29901,
13,
9651,
565,
525,
18317,
29915,
297,
14115,
279,
362,
1839,
5029,
16215,
4039,
2033,
29901,
13,
18884,
25495,
353,
14115,
279,
362,
1839,
11991,
2033,
13,
18884,
9732,
353,
11117,
12663,
2396,
5159,
29913,
13,
18884,
363,
17195,
297,
25495,
29901,
13,
462,
1678,
9732,
1839,
12663,
13359,
4397,
3319,
29915,
5552,
2396,
17195,
1839,
5552,
7464,
13,
462,
462,
462,
259,
525,
726,
2396,
6024,
726,
2033,
1800,
13,
13,
18884,
1962,
1839,
6735,
800,
2033,
353,
9732,
13,
4706,
736,
1962,
13,
2
] |
pnacl/driver/tests/filetype_test.py
|
kapkic/native_client
| 1 |
88349
|
<reponame>kapkic/native_client<filename>pnacl/driver/tests/filetype_test.py
#!/usr/bin/python2
# Copyright (c) 2013 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from driver_env import env
import driver_test_utils
import driver_tools
import filetype
class TestFiletypeCache(driver_test_utils.DriverTesterCommon):
def setUp(self):
super(TestFiletypeCache, self).setUp()
driver_test_utils.ApplyTestEnvOverrides(env)
def getFakeLLAndBitcodeFile(self):
with self.getTemp(suffix='.ll') as t:
with self.getTemp(suffix='.bc') as b:
t.write('''
define i32 @main() {
ret i32 0
}
''')
t.close()
b.close()
driver_tools.RunDriver('as', [t.name, '-o', b.name])
return t, b
def test_ll_bc_filetypes(self):
if not driver_test_utils.CanRunHost():
return
ll, bc = self.getFakeLLAndBitcodeFile()
self.assertTrue(filetype.FileType(ll.name) == 'll')
self.assertTrue(filetype.FileType(bc.name) == 'po')
self.assertFalse(filetype.IsLLVMBitcode(ll.name))
self.assertTrue(filetype.IsLLVMBitcode(bc.name))
def test_inplace_finalize(self):
if not driver_test_utils.CanRunHost():
return
ll, bc = self.getFakeLLAndBitcodeFile()
self.assertTrue(filetype.FileType(bc.name) == 'po')
self.assertTrue(filetype.IsLLVMBitcode(bc.name))
self.assertFalse(filetype.IsPNaClBitcode(bc.name))
driver_tools.RunDriver('finalize', [bc.name])
self.assertFalse(filetype.IsLLVMBitcode(bc.name))
self.assertTrue(filetype.IsPNaClBitcode(bc.name))
self.assertTrue(filetype.FileType(bc.name) == 'pexe')
|
[
1,
529,
276,
1112,
420,
29958,
29895,
16681,
293,
29914,
11487,
29918,
4645,
29966,
9507,
29958,
21257,
562,
29880,
29914,
9465,
29914,
21150,
29914,
1445,
1853,
29918,
1688,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
29906,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29941,
450,
19042,
12477,
13189,
943,
29889,
2178,
10462,
21676,
29889,
13,
29937,
4803,
310,
445,
2752,
775,
338,
4095,
287,
491,
263,
350,
7230,
29899,
3293,
19405,
393,
508,
367,
13,
29937,
1476,
297,
278,
365,
2965,
1430,
1660,
934,
29889,
13,
13,
5215,
443,
27958,
13,
13,
3166,
7156,
29918,
6272,
1053,
8829,
13,
5215,
7156,
29918,
1688,
29918,
13239,
13,
5215,
7156,
29918,
8504,
13,
5215,
934,
1853,
13,
13,
13,
1990,
4321,
2283,
1853,
10408,
29898,
9465,
29918,
1688,
29918,
13239,
29889,
12376,
3057,
261,
18877,
1125,
13,
29871,
822,
731,
3373,
29898,
1311,
1125,
13,
1678,
2428,
29898,
3057,
2283,
1853,
10408,
29892,
1583,
467,
842,
3373,
580,
13,
1678,
7156,
29918,
1688,
29918,
13239,
29889,
2052,
368,
3057,
21745,
3563,
24040,
29898,
6272,
29897,
13,
13,
29871,
822,
679,
29943,
1296,
2208,
2855,
21591,
401,
2283,
29898,
1311,
1125,
13,
1678,
411,
1583,
29889,
657,
15637,
29898,
2146,
600,
861,
2433,
29889,
645,
1495,
408,
260,
29901,
13,
418,
411,
1583,
29889,
657,
15637,
29898,
2146,
600,
861,
2433,
29889,
12328,
1495,
408,
289,
29901,
13,
4706,
260,
29889,
3539,
877,
4907,
13,
7922,
474,
29941,
29906,
732,
3396,
580,
426,
13,
29871,
3240,
474,
29941,
29906,
29871,
29900,
13,
29913,
13,
4907,
1495,
13,
4706,
260,
29889,
5358,
580,
13,
4706,
289,
29889,
5358,
580,
13,
4706,
7156,
29918,
8504,
29889,
6558,
12376,
877,
294,
742,
518,
29873,
29889,
978,
29892,
17411,
29877,
742,
289,
29889,
978,
2314,
13,
4706,
736,
260,
29892,
289,
13,
13,
29871,
822,
1243,
29918,
645,
29918,
12328,
29918,
1445,
8768,
29898,
1311,
1125,
13,
1678,
565,
451,
7156,
29918,
1688,
29918,
13239,
29889,
6028,
6558,
8514,
7295,
13,
418,
736,
13,
1678,
11148,
29892,
289,
29883,
353,
1583,
29889,
657,
29943,
1296,
2208,
2855,
21591,
401,
2283,
580,
13,
1678,
1583,
29889,
9294,
5574,
29898,
1445,
1853,
29889,
2283,
1542,
29898,
645,
29889,
978,
29897,
1275,
525,
645,
1495,
13,
1678,
1583,
29889,
9294,
5574,
29898,
1445,
1853,
29889,
2283,
1542,
29898,
12328,
29889,
978,
29897,
1275,
525,
1129,
1495,
13,
1678,
1583,
29889,
9294,
8824,
29898,
1445,
1853,
29889,
3624,
2208,
9219,
21591,
401,
29898,
645,
29889,
978,
876,
13,
1678,
1583,
29889,
9294,
5574,
29898,
1445,
1853,
29889,
3624,
2208,
9219,
21591,
401,
29898,
12328,
29889,
978,
876,
13,
13,
29871,
822,
1243,
29918,
262,
6689,
29918,
8394,
675,
29898,
1311,
1125,
13,
1678,
565,
451,
7156,
29918,
1688,
29918,
13239,
29889,
6028,
6558,
8514,
7295,
13,
418,
736,
13,
1678,
11148,
29892,
289,
29883,
353,
1583,
29889,
657,
29943,
1296,
2208,
2855,
21591,
401,
2283,
580,
13,
1678,
1583,
29889,
9294,
5574,
29898,
1445,
1853,
29889,
2283,
1542,
29898,
12328,
29889,
978,
29897,
1275,
525,
1129,
1495,
13,
1678,
1583,
29889,
9294,
5574,
29898,
1445,
1853,
29889,
3624,
2208,
9219,
21591,
401,
29898,
12328,
29889,
978,
876,
13,
1678,
1583,
29889,
9294,
8824,
29898,
1445,
1853,
29889,
3624,
29925,
13695,
6821,
21591,
401,
29898,
12328,
29889,
978,
876,
13,
1678,
7156,
29918,
8504,
29889,
6558,
12376,
877,
8394,
675,
742,
518,
12328,
29889,
978,
2314,
13,
1678,
1583,
29889,
9294,
8824,
29898,
1445,
1853,
29889,
3624,
2208,
9219,
21591,
401,
29898,
12328,
29889,
978,
876,
13,
1678,
1583,
29889,
9294,
5574,
29898,
1445,
1853,
29889,
3624,
29925,
13695,
6821,
21591,
401,
29898,
12328,
29889,
978,
876,
13,
1678,
1583,
29889,
9294,
5574,
29898,
1445,
1853,
29889,
2283,
1542,
29898,
12328,
29889,
978,
29897,
1275,
525,
412,
17115,
1495,
13,
2
] |
iwant/core/messagebaker.py
|
nirvik/iWant
| 323 |
107514
|
<gh_stars>100-1000
import json
from functools import wraps
import time_uuid
from constants import INDEXED, LEADER_NOT_READY,\
ERROR_LIST_ALL_FILES, LEADER,\
HASH_DUMP, FILE_SYS_EVENT, SEARCH_REQ, SEARCH_RES, \
LOOKUP, IWANT_PEER_FILE, PEER_LOOKUP_RESPONSE,\
SEND_PEER_DETAILS, FILE_DETAILS_RESP, INIT_FILE_REQ, \
FILE_TO_BE_DOWNLOADED, DEAD,\
NEW_PEER, BCAST_LEDGER, NEW_LEADER, REMOVE_LEADER, \
SECRET_VAL, HANDLE_PONG, FACE_OFF,\
RE_ELECTION, ALIVE, HANDLE_ALIVE,\
HANDLE_PING, REQ_CHUNK, END_GAME, FILE_CONFIRMATION_MESSAGE,\
INTERESTED, UNCHOKE, PEER_DEAD, CHANGE, SHARE, NEW_DOWNLOAD_FOLDER_RES,\
NEW_SHARED_FOLDER_RES, HASH_IDENTITY_RESPONSE, GET_HASH_IDENTITY, HASH_NOT_PRESENT
def finishing(func):
@wraps(func)
def jsonify(key, **kwargs):
_EOL = '\r'
return json.dumps(func(key, **kwargs)) + _EOL
return jsonify
@finishing
def bake(key, **kwargs):
'''
This utility is for crafting `action messages` to be sent across the network.
The `action_msg` contains `type` and `payload`
'''
action_msg = {}
action_msg['type'] = key
action_msg['payload'] = None
payload = {}
def _craft_new_peer_msg():
# print NEW_PEER, kwargs
try:
payload['identity'] = kwargs['identity'].hex
except:
payload['identity'] = None
try:
payload['leader_id'] = kwargs['leader_id'].hex
except:
payload['leader_id'] = None
action_msg['payload'] = payload
return action_msg
def _craft_remove_leader_msg():
# print REMOVE_LEADER
payload['leader_id'] = kwargs['leader_id'].hex
action_msg['payload'] = payload
return action_msg
def _craft_re_election_msg():
# print RE_ELECTION
payload['election_id'] = kwargs['election_id']
action_msg['payload'] = payload
return action_msg
def _craft_handle_pong_msg():
# print HANDLE_PONG
payload['secret_value'] = kwargs['secret_value']
action_msg['payload'] = payload
return action_msg
def _craft_new_leader_msg():
# print NEW_LEADER
payload['leader_id'] = kwargs['leader_id'].hex
payload['election_id'] = kwargs['election_id']
payload['secret_value'] = kwargs['secret_value']
action_msg['payload'] = payload
return action_msg
def _craft_alive_msg():
# print ALIVE
payload['election_id'] = kwargs['election_id']
action_msg['payload'] = payload
return action_msg
def _craft_handle_alive_msg():
# print HANDLE_ALIVE
payload['election_id'] = kwargs['election_id']
action_msg['payload'] = payload
return action_msg
def _craft_handle_ping_msg():
payload['ping'] = kwargs['ping']
action_msg['payload'] = payload
return action_msg
def _craft_bcast_ledger_msg():
try:
payload['leader_id'] = kwargs['leader_id'].hex
except AttributeError:
payload['leader_id'] = None
ledger = {}
for uuid, value in kwargs['ledger'].iteritems():
ledger[uuid.hex] = value
payload['ledger'] = ledger
payload['secret_value'] = kwargs['secret_value']
action_msg['payload'] = payload
return action_msg
def _craft_secret_val_msg():
# print SECRET_VAL
payload['secret_value'] = kwargs['secret_value']
action_msg['payload'] = payload
return action_msg
def _craft_face_off_msg():
# print FACE_OFF
payload['with_leader'] = kwargs['with_leader']
action_msg['payload'] = payload
return action_msg
def _craft_dead_msg():
try:
payload['dead_uuid'] = kwargs['dead_uuid'].hex
except AttributeError:
payload['dead_uuid'] = None
payload['secret_value'] = kwargs['secret_value']
action_msg['payload'] = payload
return action_msg
# SERVER MESSAGES
def _craft_unchoke_msg():
payload['unchoke'] = kwargs['unchoke']
action_msg['payload'] = payload
return action_msg
def _craft_error_list_all_files_msg():
payload['reason'] = kwargs['reason']
action_msg['payload'] = payload
return action_msg
def _craft_leader_not_ready_msg():
payload['reason'] = kwargs['reason']
action_msg['payload'] = payload
return action_msg
def _craft_search_response_msg():
payload['search_query_response'] = kwargs['search_query_response']
action_msg['payload'] = payload
return action_msg
def _craft_peer_lookup_response_msg():
payload['peer_lookup_response'] = kwargs['peer_lookup_response']
action_msg['payload'] = payload
return action_msg
def _craft_hash_dump_msg():
payload['identity'] = kwargs['identity'].hex
payload['operation'] = kwargs['operation']
action_msg['payload'] = payload
return action_msg
def _craft_init_file_req_msg():
payload['filehash'] = kwargs['filehash']
action_msg['payload'] = payload
return action_msg
def _craft_leader_msg():
payload['leader'] = kwargs['leader']
action_msg['payload'] = payload
return action_msg
def _craft_peer_dead_msg():
try:
payload['dead_uuid'] = kwargs['dead_uuid'].hex
except AttributeError:
payload['dead_uuid'] = None
action_msg['payload'] = payload
return action_msg
def _craft_file_sys_event_msg():
payload['ADD'] = kwargs['ADD']
payload['DEL'] = kwargs['DEL']
payload['shared_folder'] = kwargs['shared_folder']
action_msg['payload'] = payload
return action_msg
def _craft_search_req_msg():
payload['search_query'] = kwargs['search_query']
action_msg['payload'] = payload
return action_msg
def _craft_lookup_msg():
payload['search_query'] = kwargs['search_query']
action_msg['payload'] = payload
return action_msg
def _craft_iwant_peer_file_msg():
payload['filehash'] = kwargs['filehash']
action_msg['payload'] = payload
return action_msg
def _craft_send_peer_details_msg():
payload['filehash'] = kwargs['filehash']
action_msg['payload'] = payload
return action_msg
def _craft_indexed_msg():
payload['ADD'] = kwargs['ADD']
payload['DEL'] = kwargs['DEL']
payload['shared_folder'] = kwargs['shared_folder']
action_msg['payload'] = payload
return action_msg
def _craft_req_chunk_msg():
payload['piece_data'] = kwargs['piece_data']
action_msg['payload'] = payload
# print action_msg
return action_msg
def _craft_end_game_msg():
payload['end_game'] = kwargs['end_game']
action_msg['payload'] = payload
return action_msg
def _craft_file_details_resp():
pass
def _craft_file_to_be_downloaded_msg():
# payload['filesize'] = kwargs['filesize']
# payload['filename'] = kwargs['filename']
payload['message'] = kwargs['message']
action_msg['payload'] = payload
return action_msg
def _craft_interested_msg():
payload['filehash'] = kwargs['filehash']
action_msg['payload'] = payload
return action_msg
def _craft_file_confirmation_message():
payload['piecehashes'] = kwargs['piecehashes']
action_msg['payload'] = payload
return action_msg
def _craft_change_download_path_msg():
payload['download_folder'] = kwargs['download_folder']
action_msg['payload'] = payload
return action_msg
def _craft_share_new_folder_msg():
payload['shared_folder'] = kwargs['shared_folder']
action_msg['payload'] = payload
return action_msg
def _craft_new_download_folder_response_msg():
payload['download_folder_response'] = kwargs[
'download_folder_response']
action_msg['payload'] = payload
return action_msg
def _craft_new_shared_folder_response_msg():
payload['shared_folder_response'] = kwargs['shared_folder_response']
action_msg['payload'] = payload
return action_msg
def _craft_get_hash_identity_msg():
payload['checksum'] = kwargs['checksum']
action_msg['payload'] = payload
return action_msg
def _craft_hash_identity_response_msg():
payload['file_structure_response'] = kwargs['file_structure_response']
action_msg['payload'] = payload
return action_msg
def _craft_hash_not_present_msg():
payload['reason'] = kwargs['reason']
action_msg['payload'] = payload
return action_msg
dispatcher = {
NEW_PEER: _craft_new_peer_msg,
REMOVE_LEADER: _craft_remove_leader_msg,
RE_ELECTION: _craft_re_election_msg,
HANDLE_PONG: _craft_handle_pong_msg,
NEW_LEADER: _craft_new_leader_msg,
ALIVE: _craft_alive_msg,
HANDLE_PING: _craft_handle_ping_msg,
HANDLE_ALIVE: _craft_handle_alive_msg,
BCAST_LEDGER: _craft_bcast_ledger_msg,
SECRET_VAL: _craft_secret_val_msg,
FACE_OFF: _craft_face_off_msg,
DEAD: _craft_dead_msg,
UNCHOKE: _craft_unchoke_msg,
ERROR_LIST_ALL_FILES: _craft_error_list_all_files_msg,
LEADER_NOT_READY: _craft_leader_not_ready_msg,
SEARCH_RES: _craft_search_response_msg,
HASH_DUMP: _craft_hash_dump_msg,
INIT_FILE_REQ: _craft_init_file_req_msg,
LEADER: _craft_leader_msg,
PEER_DEAD: _craft_peer_dead_msg,
FILE_SYS_EVENT: _craft_file_sys_event_msg,
SEARCH_REQ: _craft_search_req_msg,
LOOKUP: _craft_lookup_msg,
IWANT_PEER_FILE: _craft_iwant_peer_file_msg,
SEND_PEER_DETAILS: _craft_send_peer_details_msg,
PEER_LOOKUP_RESPONSE: _craft_peer_lookup_response_msg,
INDEXED: _craft_indexed_msg,
REQ_CHUNK: _craft_req_chunk_msg,
END_GAME: _craft_end_game_msg,
INTERESTED: _craft_interested_msg,
FILE_DETAILS_RESP: _craft_file_details_resp,
FILE_CONFIRMATION_MESSAGE: _craft_file_confirmation_message,
FILE_TO_BE_DOWNLOADED: _craft_file_to_be_downloaded_msg,
CHANGE: _craft_change_download_path_msg,
SHARE: _craft_share_new_folder_msg,
NEW_DOWNLOAD_FOLDER_RES: _craft_new_download_folder_response_msg,
NEW_SHARED_FOLDER_RES: _craft_new_shared_folder_response_msg,
GET_HASH_IDENTITY: _craft_get_hash_identity_msg,
HASH_IDENTITY_RESPONSE: _craft_hash_identity_response_msg,
HASH_NOT_PRESENT: _craft_hash_not_present_msg
}
return dispatcher[key]()
def unbake(message=None):
json_msg = json.loads(message)
if 'leader_id' in json_msg['payload']:
leader_uuid = json_msg['payload']['leader_id']
if leader_uuid is not None:
json_msg['payload']['leader_id'] = time_uuid.TimeUUID(leader_uuid)
if 'identity' in json_msg['payload']:
identity_uuid = json_msg['payload']['identity']
if identity_uuid is not None:
json_msg['payload']['identity'] = time_uuid.TimeUUID(identity_uuid)
if 'dead_uuid' in json_msg['payload']:
dead_uuid = json_msg['payload']['dead_uuid']
if dead_uuid is not None:
json_msg['payload']['dead_uuid'] = time_uuid.TimeUUID(dead_uuid)
if 'ledger' in json_msg['payload']:
ledger = {}
ledger_response = json_msg['payload']['ledger']
if ledger_response:
for uuid, values in ledger_response.iteritems():
ledger[time_uuid.TimeUUID(uuid)] = values
json_msg['payload']['ledger'] = ledger
action_dispatcher, action_payload = json_msg['type'], json_msg['payload']
return action_dispatcher, action_payload
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
5215,
4390,
13,
3166,
2090,
312,
8789,
1053,
11463,
567,
13,
5215,
931,
29918,
25118,
13,
3166,
17727,
1053,
2672,
19577,
3352,
29892,
11060,
3035,
1001,
29918,
12256,
29918,
16310,
29979,
2053,
13,
1678,
14431,
29918,
24360,
29918,
9818,
29918,
24483,
29892,
11060,
3035,
1001,
2053,
13,
1678,
379,
24943,
29918,
14849,
3580,
29892,
24080,
29918,
14816,
29903,
29918,
22240,
3919,
29892,
3725,
1718,
3210,
29918,
1525,
29984,
29892,
3725,
1718,
3210,
29918,
15989,
29892,
320,
13,
1678,
11247,
8949,
4897,
29892,
306,
29956,
13566,
29918,
4162,
1001,
29918,
7724,
29892,
349,
29923,
1001,
29918,
3927,
8949,
4897,
29918,
1525,
5550,
1164,
1660,
2053,
13,
1678,
317,
11794,
29918,
4162,
1001,
29918,
2287,
6040,
6227,
29903,
29892,
24080,
29918,
2287,
6040,
6227,
29903,
29918,
1525,
5550,
29892,
2672,
1806,
29918,
7724,
29918,
1525,
29984,
29892,
320,
13,
1678,
24080,
29918,
4986,
29918,
15349,
29918,
3970,
16048,
3927,
29909,
2287,
29928,
29892,
5012,
3035,
2053,
13,
1678,
29091,
29918,
4162,
1001,
29892,
350,
5454,
1254,
29918,
20566,
17070,
29892,
29091,
29918,
1307,
3035,
1001,
29892,
5195,
6720,
12064,
29918,
1307,
3035,
1001,
29892,
320,
13,
1678,
3725,
22245,
29911,
29918,
8932,
29892,
379,
9468,
1307,
29918,
29925,
20614,
29892,
383,
11538,
29918,
27681,
2053,
13,
1678,
5195,
29918,
29923,
3281,
2725,
29892,
319,
5265,
12064,
29892,
379,
9468,
1307,
29918,
1964,
18474,
2053,
13,
1678,
379,
9468,
1307,
29918,
29925,
4214,
29892,
5195,
29984,
29918,
3210,
3904,
29968,
29892,
11056,
29918,
12739,
2303,
29892,
24080,
29918,
6007,
3738,
29934,
29924,
8098,
29918,
2303,
1799,
10461,
2053,
13,
1678,
2672,
4945,
29923,
1254,
3352,
29892,
8291,
3210,
29949,
6059,
29892,
349,
29923,
1001,
29918,
2287,
3035,
29892,
5868,
24336,
29892,
317,
15715,
1525,
29892,
29091,
29918,
3970,
16048,
29428,
29918,
29943,
5607,
8032,
29918,
15989,
2053,
13,
1678,
29091,
29918,
23498,
19386,
29918,
29943,
5607,
8032,
29918,
15989,
29892,
379,
24943,
29918,
1367,
3919,
11937,
29918,
1525,
5550,
1164,
1660,
29892,
12354,
29918,
29950,
24943,
29918,
1367,
3919,
11937,
29892,
379,
24943,
29918,
12256,
29918,
15094,
29903,
3919,
13,
13,
13,
1753,
28321,
29898,
9891,
1125,
13,
1678,
732,
29893,
336,
567,
29898,
9891,
29897,
13,
1678,
822,
4390,
1598,
29898,
1989,
29892,
3579,
19290,
1125,
13,
4706,
903,
29923,
5607,
353,
11297,
29878,
29915,
13,
4706,
736,
4390,
29889,
29881,
17204,
29898,
9891,
29898,
1989,
29892,
3579,
19290,
876,
718,
903,
29923,
5607,
13,
1678,
736,
4390,
1598,
13,
13,
13,
29992,
4951,
14424,
13,
1753,
289,
1296,
29898,
1989,
29892,
3579,
19290,
1125,
13,
1678,
14550,
13,
4706,
910,
19725,
338,
363,
25554,
292,
421,
2467,
7191,
29952,
304,
367,
2665,
4822,
278,
3564,
29889,
13,
4706,
450,
421,
2467,
29918,
7645,
29952,
3743,
421,
1853,
29952,
322,
421,
23813,
29952,
13,
1678,
14550,
13,
1678,
3158,
29918,
7645,
353,
6571,
13,
1678,
3158,
29918,
7645,
1839,
1853,
2033,
353,
1820,
13,
1678,
3158,
29918,
7645,
1839,
23813,
2033,
353,
6213,
13,
1678,
20092,
353,
6571,
13,
13,
1678,
822,
903,
17293,
29918,
1482,
29918,
412,
261,
29918,
7645,
7295,
13,
4706,
396,
1596,
29091,
29918,
4162,
1001,
29892,
9049,
5085,
13,
4706,
1018,
29901,
13,
9651,
20092,
1839,
22350,
2033,
353,
9049,
5085,
1839,
22350,
13359,
20970,
13,
4706,
5174,
29901,
13,
9651,
20092,
1839,
22350,
2033,
353,
6213,
13,
4706,
1018,
29901,
13,
9651,
20092,
1839,
280,
1664,
29918,
333,
2033,
353,
9049,
5085,
1839,
280,
1664,
29918,
333,
13359,
20970,
13,
4706,
5174,
29901,
13,
9651,
20092,
1839,
280,
1664,
29918,
333,
2033,
353,
6213,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
5992,
29918,
280,
1664,
29918,
7645,
7295,
13,
4706,
396,
1596,
5195,
6720,
12064,
29918,
1307,
3035,
1001,
13,
4706,
20092,
1839,
280,
1664,
29918,
333,
2033,
353,
9049,
5085,
1839,
280,
1664,
29918,
333,
13359,
20970,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
276,
29918,
29872,
1464,
29918,
7645,
7295,
13,
4706,
396,
1596,
5195,
29918,
29923,
3281,
2725,
13,
4706,
20092,
1839,
29872,
1464,
29918,
333,
2033,
353,
9049,
5085,
1839,
29872,
1464,
29918,
333,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
8411,
29918,
29886,
549,
29918,
7645,
7295,
13,
4706,
396,
1596,
379,
9468,
1307,
29918,
29925,
20614,
13,
4706,
20092,
1839,
19024,
29918,
1767,
2033,
353,
9049,
5085,
1839,
19024,
29918,
1767,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
1482,
29918,
280,
1664,
29918,
7645,
7295,
13,
4706,
396,
1596,
29091,
29918,
1307,
3035,
1001,
13,
4706,
20092,
1839,
280,
1664,
29918,
333,
2033,
353,
9049,
5085,
1839,
280,
1664,
29918,
333,
13359,
20970,
13,
4706,
20092,
1839,
29872,
1464,
29918,
333,
2033,
353,
9049,
5085,
1839,
29872,
1464,
29918,
333,
2033,
13,
4706,
20092,
1839,
19024,
29918,
1767,
2033,
353,
9049,
5085,
1839,
19024,
29918,
1767,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
284,
573,
29918,
7645,
7295,
13,
4706,
396,
1596,
319,
5265,
12064,
13,
4706,
20092,
1839,
29872,
1464,
29918,
333,
2033,
353,
9049,
5085,
1839,
29872,
1464,
29918,
333,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
8411,
29918,
284,
573,
29918,
7645,
7295,
13,
4706,
396,
1596,
379,
9468,
1307,
29918,
1964,
18474,
13,
4706,
20092,
1839,
29872,
1464,
29918,
333,
2033,
353,
9049,
5085,
1839,
29872,
1464,
29918,
333,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
8411,
29918,
15702,
29918,
7645,
7295,
13,
4706,
20092,
1839,
15702,
2033,
353,
9049,
5085,
1839,
15702,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
29890,
4384,
29918,
839,
914,
29918,
7645,
7295,
13,
4706,
1018,
29901,
13,
9651,
20092,
1839,
280,
1664,
29918,
333,
2033,
353,
9049,
5085,
1839,
280,
1664,
29918,
333,
13359,
20970,
13,
4706,
5174,
23833,
2392,
29901,
13,
9651,
20092,
1839,
280,
1664,
29918,
333,
2033,
353,
6213,
13,
4706,
5331,
914,
353,
6571,
13,
4706,
363,
318,
5416,
29892,
995,
297,
9049,
5085,
1839,
839,
914,
13359,
1524,
7076,
7295,
13,
9651,
5331,
914,
29961,
25118,
29889,
20970,
29962,
353,
995,
13,
4706,
20092,
1839,
839,
914,
2033,
353,
5331,
914,
13,
4706,
20092,
1839,
19024,
29918,
1767,
2033,
353,
9049,
5085,
1839,
19024,
29918,
1767,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
19024,
29918,
791,
29918,
7645,
7295,
13,
4706,
396,
1596,
3725,
22245,
29911,
29918,
8932,
13,
4706,
20092,
1839,
19024,
29918,
1767,
2033,
353,
9049,
5085,
1839,
19024,
29918,
1767,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
2161,
29918,
2696,
29918,
7645,
7295,
13,
4706,
396,
1596,
383,
11538,
29918,
27681,
13,
4706,
20092,
1839,
2541,
29918,
280,
1664,
2033,
353,
9049,
5085,
1839,
2541,
29918,
280,
1664,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
311,
328,
29918,
7645,
7295,
13,
4706,
1018,
29901,
13,
9651,
20092,
1839,
311,
328,
29918,
25118,
2033,
353,
9049,
5085,
1839,
311,
328,
29918,
25118,
13359,
20970,
13,
4706,
5174,
23833,
2392,
29901,
13,
9651,
20092,
1839,
311,
328,
29918,
25118,
2033,
353,
6213,
13,
4706,
20092,
1839,
19024,
29918,
1767,
2033,
353,
9049,
5085,
1839,
19024,
29918,
1767,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
396,
26996,
5348,
22986,
1799,
10461,
29903,
13,
1678,
822,
903,
17293,
29918,
348,
1859,
446,
29918,
7645,
7295,
13,
4706,
20092,
1839,
348,
1859,
446,
2033,
353,
9049,
5085,
1839,
348,
1859,
446,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
2704,
29918,
1761,
29918,
497,
29918,
5325,
29918,
7645,
7295,
13,
4706,
20092,
1839,
23147,
2033,
353,
9049,
5085,
1839,
23147,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
280,
1664,
29918,
1333,
29918,
2040,
29918,
7645,
7295,
13,
4706,
20092,
1839,
23147,
2033,
353,
9049,
5085,
1839,
23147,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
4478,
29918,
5327,
29918,
7645,
7295,
13,
4706,
20092,
1839,
4478,
29918,
1972,
29918,
5327,
2033,
353,
9049,
5085,
1839,
4478,
29918,
1972,
29918,
5327,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
412,
261,
29918,
20401,
29918,
5327,
29918,
7645,
7295,
13,
4706,
20092,
1839,
412,
261,
29918,
20401,
29918,
5327,
2033,
353,
9049,
5085,
1839,
412,
261,
29918,
20401,
29918,
5327,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
8568,
29918,
15070,
29918,
7645,
7295,
13,
4706,
20092,
1839,
22350,
2033,
353,
9049,
5085,
1839,
22350,
13359,
20970,
13,
4706,
20092,
1839,
16453,
2033,
353,
9049,
5085,
1839,
16453,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
2344,
29918,
1445,
29918,
7971,
29918,
7645,
7295,
13,
4706,
20092,
1839,
1445,
8568,
2033,
353,
9049,
5085,
1839,
1445,
8568,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
280,
1664,
29918,
7645,
7295,
13,
4706,
20092,
1839,
280,
1664,
2033,
353,
9049,
5085,
1839,
280,
1664,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
412,
261,
29918,
311,
328,
29918,
7645,
7295,
13,
4706,
1018,
29901,
13,
9651,
20092,
1839,
311,
328,
29918,
25118,
2033,
353,
9049,
5085,
1839,
311,
328,
29918,
25118,
13359,
20970,
13,
4706,
5174,
23833,
2392,
29901,
13,
9651,
20092,
1839,
311,
328,
29918,
25118,
2033,
353,
6213,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
1445,
29918,
9675,
29918,
3696,
29918,
7645,
7295,
13,
4706,
20092,
1839,
17744,
2033,
353,
9049,
5085,
1839,
17744,
2033,
13,
4706,
20092,
1839,
2287,
29931,
2033,
353,
9049,
5085,
1839,
2287,
29931,
2033,
13,
4706,
20092,
1839,
12366,
29918,
12083,
2033,
353,
9049,
5085,
1839,
12366,
29918,
12083,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
4478,
29918,
7971,
29918,
7645,
7295,
13,
4706,
20092,
1839,
4478,
29918,
1972,
2033,
353,
9049,
5085,
1839,
4478,
29918,
1972,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
20401,
29918,
7645,
7295,
13,
4706,
20092,
1839,
4478,
29918,
1972,
2033,
353,
9049,
5085,
1839,
4478,
29918,
1972,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
9429,
424,
29918,
412,
261,
29918,
1445,
29918,
7645,
7295,
13,
4706,
20092,
1839,
1445,
8568,
2033,
353,
9049,
5085,
1839,
1445,
8568,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
6717,
29918,
412,
261,
29918,
14144,
29918,
7645,
7295,
13,
4706,
20092,
1839,
1445,
8568,
2033,
353,
9049,
5085,
1839,
1445,
8568,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
2248,
287,
29918,
7645,
7295,
13,
4706,
20092,
1839,
17744,
2033,
353,
9049,
5085,
1839,
17744,
2033,
13,
4706,
20092,
1839,
2287,
29931,
2033,
353,
9049,
5085,
1839,
2287,
29931,
2033,
13,
4706,
20092,
1839,
12366,
29918,
12083,
2033,
353,
9049,
5085,
1839,
12366,
29918,
12083,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
7971,
29918,
29812,
29918,
7645,
7295,
13,
4706,
20092,
1839,
12343,
346,
29918,
1272,
2033,
353,
9049,
5085,
1839,
12343,
346,
29918,
1272,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
396,
1596,
3158,
29918,
7645,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
355,
29918,
11802,
29918,
7645,
7295,
13,
4706,
20092,
1839,
355,
29918,
11802,
2033,
353,
9049,
5085,
1839,
355,
29918,
11802,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
1445,
29918,
14144,
29918,
13713,
7295,
13,
4706,
1209,
13,
13,
1678,
822,
903,
17293,
29918,
1445,
29918,
517,
29918,
915,
29918,
10382,
287,
29918,
7645,
7295,
13,
4706,
396,
20092,
1839,
5325,
675,
2033,
353,
9049,
5085,
1839,
5325,
675,
2033,
13,
4706,
396,
20092,
1839,
9507,
2033,
353,
9049,
5085,
1839,
9507,
2033,
13,
4706,
20092,
1839,
4906,
2033,
353,
9049,
5085,
1839,
4906,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
1639,
2868,
29918,
7645,
7295,
13,
4706,
20092,
1839,
1445,
8568,
2033,
353,
9049,
5085,
1839,
1445,
8568,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
1445,
29918,
26897,
362,
29918,
4906,
7295,
13,
4706,
20092,
1839,
12343,
346,
8568,
267,
2033,
353,
9049,
5085,
1839,
12343,
346,
8568,
267,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
3167,
29918,
10382,
29918,
2084,
29918,
7645,
7295,
13,
4706,
20092,
1839,
10382,
29918,
12083,
2033,
353,
9049,
5085,
1839,
10382,
29918,
12083,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
13653,
29918,
1482,
29918,
12083,
29918,
7645,
7295,
13,
4706,
20092,
1839,
12366,
29918,
12083,
2033,
353,
9049,
5085,
1839,
12366,
29918,
12083,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
1482,
29918,
10382,
29918,
12083,
29918,
5327,
29918,
7645,
7295,
13,
4706,
20092,
1839,
10382,
29918,
12083,
29918,
5327,
2033,
353,
9049,
5085,
29961,
13,
9651,
525,
10382,
29918,
12083,
29918,
5327,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
1482,
29918,
12366,
29918,
12083,
29918,
5327,
29918,
7645,
7295,
13,
4706,
20092,
1839,
12366,
29918,
12083,
29918,
5327,
2033,
353,
9049,
5085,
1839,
12366,
29918,
12083,
29918,
5327,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
657,
29918,
8568,
29918,
22350,
29918,
7645,
7295,
13,
4706,
20092,
1839,
3198,
2083,
2033,
353,
9049,
5085,
1839,
3198,
2083,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
8568,
29918,
22350,
29918,
5327,
29918,
7645,
7295,
13,
4706,
20092,
1839,
1445,
29918,
23905,
29918,
5327,
2033,
353,
9049,
5085,
1839,
1445,
29918,
23905,
29918,
5327,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
822,
903,
17293,
29918,
8568,
29918,
1333,
29918,
6338,
29918,
7645,
7295,
13,
4706,
20092,
1839,
23147,
2033,
353,
9049,
5085,
1839,
23147,
2033,
13,
4706,
3158,
29918,
7645,
1839,
23813,
2033,
353,
20092,
13,
4706,
736,
3158,
29918,
7645,
13,
13,
1678,
13916,
261,
353,
426,
13,
4706,
29091,
29918,
4162,
1001,
29901,
903,
17293,
29918,
1482,
29918,
412,
261,
29918,
7645,
29892,
13,
4706,
5195,
6720,
12064,
29918,
1307,
3035,
1001,
29901,
903,
17293,
29918,
5992,
29918,
280,
1664,
29918,
7645,
29892,
13,
4706,
5195,
29918,
29923,
3281,
2725,
29901,
903,
17293,
29918,
276,
29918,
29872,
1464,
29918,
7645,
29892,
13,
4706,
379,
9468,
1307,
29918,
29925,
20614,
29901,
903,
17293,
29918,
8411,
29918,
29886,
549,
29918,
7645,
29892,
13,
4706,
29091,
29918,
1307,
3035,
1001,
29901,
903,
17293,
29918,
1482,
29918,
280,
1664,
29918,
7645,
29892,
13,
4706,
319,
5265,
12064,
29901,
903,
17293,
29918,
284,
573,
29918,
7645,
29892,
13,
4706,
379,
9468,
1307,
29918,
29925,
4214,
29901,
903,
17293,
29918,
8411,
29918,
15702,
29918,
7645,
29892,
13,
4706,
379,
9468,
1307,
29918,
1964,
18474,
29901,
903,
17293,
29918,
8411,
29918,
284,
573,
29918,
7645,
29892,
13,
4706,
350,
5454,
1254,
29918,
20566,
17070,
29901,
903,
17293,
29918,
29890,
4384,
29918,
839,
914,
29918,
7645,
29892,
13,
4706,
3725,
22245,
29911,
29918,
8932,
29901,
903,
17293,
29918,
19024,
29918,
791,
29918,
7645,
29892,
13,
4706,
383,
11538,
29918,
27681,
29901,
903,
17293,
29918,
2161,
29918,
2696,
29918,
7645,
29892,
13,
4706,
5012,
3035,
29901,
903,
17293,
29918,
311,
328,
29918,
7645,
29892,
13,
13,
4706,
8291,
3210,
29949,
6059,
29901,
903,
17293,
29918,
348,
1859,
446,
29918,
7645,
29892,
13,
4706,
14431,
29918,
24360,
29918,
9818,
29918,
24483,
29901,
903,
17293,
29918,
2704,
29918,
1761,
29918,
497,
29918,
5325,
29918,
7645,
29892,
13,
4706,
11060,
3035,
1001,
29918,
12256,
29918,
16310,
29979,
29901,
903,
17293,
29918,
280,
1664,
29918,
1333,
29918,
2040,
29918,
7645,
29892,
13,
4706,
3725,
1718,
3210,
29918,
15989,
29901,
903,
17293,
29918,
4478,
29918,
5327,
29918,
7645,
29892,
13,
4706,
379,
24943,
29918,
14849,
3580,
29901,
903,
17293,
29918,
8568,
29918,
15070,
29918,
7645,
29892,
13,
4706,
2672,
1806,
29918,
7724,
29918,
1525,
29984,
29901,
903,
17293,
29918,
2344,
29918,
1445,
29918,
7971,
29918,
7645,
29892,
13,
4706,
11060,
3035,
1001,
29901,
903,
17293,
29918,
280,
1664,
29918,
7645,
29892,
13,
4706,
349,
29923,
1001,
29918,
2287,
3035,
29901,
903,
17293,
29918,
412,
261,
29918,
311,
328,
29918,
7645,
29892,
13,
4706,
24080,
29918,
14816,
29903,
29918,
22240,
3919,
29901,
903,
17293,
29918,
1445,
29918,
9675,
29918,
3696,
29918,
7645,
29892,
13,
4706,
3725,
1718,
3210,
29918,
1525,
29984,
29901,
903,
17293,
29918,
4478,
29918,
7971,
29918,
7645,
29892,
13,
4706,
11247,
8949,
4897,
29901,
903,
17293,
29918,
20401,
29918,
7645,
29892,
13,
4706,
306,
29956,
13566,
29918,
4162,
1001,
29918,
7724,
29901,
903,
17293,
29918,
9429,
424,
29918,
412,
261,
29918,
1445,
29918,
7645,
29892,
13,
4706,
317,
11794,
29918,
4162,
1001,
29918,
2287,
6040,
6227,
29903,
29901,
903,
17293,
29918,
6717,
29918,
412,
261,
29918,
14144,
29918,
7645,
29892,
13,
4706,
349,
29923,
1001,
29918,
3927,
8949,
4897,
29918,
1525,
5550,
1164,
1660,
29901,
903,
17293,
29918,
412,
261,
29918,
20401,
29918,
5327,
29918,
7645,
29892,
13,
4706,
2672,
19577,
3352,
29901,
903,
17293,
29918,
2248,
287,
29918,
7645,
29892,
13,
4706,
5195,
29984,
29918,
3210,
3904,
29968,
29901,
903,
17293,
29918,
7971,
29918,
29812,
29918,
7645,
29892,
13,
4706,
11056,
29918,
12739,
2303,
29901,
903,
17293,
29918,
355,
29918,
11802,
29918,
7645,
29892,
13,
4706,
2672,
4945,
29923,
1254,
3352,
29901,
903,
17293,
29918,
1639,
2868,
29918,
7645,
29892,
13,
4706,
24080,
29918,
2287,
6040,
6227,
29903,
29918,
1525,
5550,
29901,
903,
17293,
29918,
1445,
29918,
14144,
29918,
13713,
29892,
13,
4706,
24080,
29918,
6007,
3738,
29934,
29924,
8098,
29918,
2303,
1799,
10461,
29901,
903,
17293,
29918,
1445,
29918,
26897,
362,
29918,
4906,
29892,
13,
4706,
24080,
29918,
4986,
29918,
15349,
29918,
3970,
16048,
3927,
29909,
2287,
29928,
29901,
903,
17293,
29918,
1445,
29918,
517,
29918,
915,
29918,
10382,
287,
29918,
7645,
29892,
13,
13,
4706,
5868,
24336,
29901,
903,
17293,
29918,
3167,
29918,
10382,
29918,
2084,
29918,
7645,
29892,
13,
4706,
317,
15715,
1525,
29901,
903,
17293,
29918,
13653,
29918,
1482,
29918,
12083,
29918,
7645,
29892,
13,
4706,
29091,
29918,
3970,
16048,
29428,
29918,
29943,
5607,
8032,
29918,
15989,
29901,
903,
17293,
29918,
1482,
29918,
10382,
29918,
12083,
29918,
5327,
29918,
7645,
29892,
13,
4706,
29091,
29918,
23498,
19386,
29918,
29943,
5607,
8032,
29918,
15989,
29901,
903,
17293,
29918,
1482,
29918,
12366,
29918,
12083,
29918,
5327,
29918,
7645,
29892,
13,
13,
4706,
12354,
29918,
29950,
24943,
29918,
1367,
3919,
11937,
29901,
903,
17293,
29918,
657,
29918,
8568,
29918,
22350,
29918,
7645,
29892,
13,
4706,
379,
24943,
29918,
1367,
3919,
11937,
29918,
1525,
5550,
1164,
1660,
29901,
903,
17293,
29918,
8568,
29918,
22350,
29918,
5327,
29918,
7645,
29892,
13,
4706,
379,
24943,
29918,
12256,
29918,
15094,
29903,
3919,
29901,
903,
17293,
29918,
8568,
29918,
1333,
29918,
6338,
29918,
7645,
13,
1678,
500,
13,
1678,
736,
13916,
261,
29961,
1989,
29962,
580,
13,
13,
13,
1753,
443,
29890,
1296,
29898,
4906,
29922,
8516,
1125,
13,
1678,
4390,
29918,
7645,
353,
4390,
29889,
18132,
29898,
4906,
29897,
13,
1678,
565,
525,
280,
1664,
29918,
333,
29915,
297,
4390,
29918,
7645,
1839,
23813,
2033,
29901,
13,
4706,
11822,
29918,
25118,
353,
4390,
29918,
7645,
1839,
23813,
16215,
280,
1664,
29918,
333,
2033,
13,
4706,
565,
11822,
29918,
25118,
338,
451,
6213,
29901,
13,
9651,
4390,
29918,
7645,
1839,
23813,
16215,
280,
1664,
29918,
333,
2033,
353,
931,
29918,
25118,
29889,
2481,
29965,
11150,
29898,
280,
1664,
29918,
25118,
29897,
13,
13,
1678,
565,
525,
22350,
29915,
297,
4390,
29918,
7645,
1839,
23813,
2033,
29901,
13,
4706,
10110,
29918,
25118,
353,
4390,
29918,
7645,
1839,
23813,
16215,
22350,
2033,
13,
4706,
565,
10110,
29918,
25118,
338,
451,
6213,
29901,
13,
9651,
4390,
29918,
7645,
1839,
23813,
16215,
22350,
2033,
353,
931,
29918,
25118,
29889,
2481,
29965,
11150,
29898,
22350,
29918,
25118,
29897,
13,
13,
1678,
565,
525,
311,
328,
29918,
25118,
29915,
297,
4390,
29918,
7645,
1839,
23813,
2033,
29901,
13,
4706,
7123,
29918,
25118,
353,
4390,
29918,
7645,
1839,
23813,
16215,
311,
328,
29918,
25118,
2033,
13,
4706,
565,
7123,
29918,
25118,
338,
451,
6213,
29901,
13,
9651,
4390,
29918,
7645,
1839,
23813,
16215,
311,
328,
29918,
25118,
2033,
353,
931,
29918,
25118,
29889,
2481,
29965,
11150,
29898,
311,
328,
29918,
25118,
29897,
13,
13,
1678,
565,
525,
839,
914,
29915,
297,
4390,
29918,
7645,
1839,
23813,
2033,
29901,
13,
4706,
5331,
914,
353,
6571,
13,
4706,
5331,
914,
29918,
5327,
353,
4390,
29918,
7645,
1839,
23813,
16215,
839,
914,
2033,
13,
4706,
565,
5331,
914,
29918,
5327,
29901,
13,
9651,
363,
318,
5416,
29892,
1819,
297,
5331,
914,
29918,
5327,
29889,
1524,
7076,
7295,
13,
18884,
5331,
914,
29961,
2230,
29918,
25118,
29889,
2481,
29965,
11150,
29898,
25118,
4638,
353,
1819,
13,
4706,
4390,
29918,
7645,
1839,
23813,
16215,
839,
914,
2033,
353,
5331,
914,
13,
13,
1678,
3158,
29918,
13369,
261,
29892,
3158,
29918,
23813,
353,
4390,
29918,
7645,
1839,
1853,
7464,
4390,
29918,
7645,
1839,
23813,
2033,
13,
1678,
736,
3158,
29918,
13369,
261,
29892,
3158,
29918,
23813,
13,
2
] |
commands/cmd_twitterflw.py
|
robinstechprojects/RobinsDiscordAssistant
| 1 |
117612
|
import socket
import time
import langfile
def ex(args, message, client, invoke):
args_out = ""
if len(args) > 0:
args_out = "\n\n*Attatched arguments %s*" % args.__str__()[1:-1].replace("'", "")
argstr = args.__str__()[1:-1].replace("'", "")
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #create InternetSocket for ipV4
#SOCK_STREAM - TCP SOCK_DGRAM - UDP
server_addr = ('172.16.58.3', 1338)
client_socket.connect(server_addr) #connect the socket | UDP does not need connect
client_socket.send(bytes("tweetrequest", "utf8")) #send message (byte stream)
time.sleep(4)
print(argstr)
client_socket.send(bytes(argstr, "utf8")) #send message (byte stream)
song = client_socket.recv(1024)
print(str(song, "utf8"))
yield from client.send_message(message.channel, langfile.lang_twitterflw + str(song, "utf8"))
client_socket.close()
|
[
1,
1053,
9909,
13,
5215,
931,
13,
5215,
6361,
1445,
13,
13,
1753,
429,
29898,
5085,
29892,
2643,
29892,
3132,
29892,
15928,
1125,
13,
13,
1678,
6389,
29918,
449,
353,
5124,
13,
1678,
565,
7431,
29898,
5085,
29897,
1405,
29871,
29900,
29901,
13,
4706,
6389,
29918,
449,
353,
6634,
29876,
29905,
29876,
29930,
4165,
905,
287,
6273,
1273,
29879,
20605,
1273,
6389,
17255,
710,
1649,
580,
29961,
29896,
13018,
29896,
1822,
6506,
703,
29915,
613,
20569,
13,
4706,
1852,
710,
353,
6389,
17255,
710,
1649,
580,
29961,
29896,
13018,
29896,
1822,
6506,
703,
29915,
613,
20569,
13,
4706,
3132,
29918,
11514,
353,
9909,
29889,
11514,
29898,
11514,
29889,
5098,
29918,
1177,
2544,
29892,
9909,
29889,
6156,
7077,
29918,
1254,
1525,
5194,
29897,
396,
3258,
4685,
11373,
363,
10377,
29963,
29946,
13,
29937,
6156,
7077,
29918,
1254,
1525,
5194,
448,
19374,
7791,
7077,
29918,
29928,
29954,
25058,
448,
501,
11191,
13,
4706,
1923,
29918,
10030,
353,
6702,
29896,
29955,
29906,
29889,
29896,
29953,
29889,
29945,
29947,
29889,
29941,
742,
29871,
29896,
29941,
29941,
29947,
29897,
13,
4706,
3132,
29918,
11514,
29889,
6915,
29898,
2974,
29918,
10030,
29897,
396,
6915,
278,
9909,
891,
501,
11191,
947,
451,
817,
4511,
13,
4706,
3132,
29918,
11514,
29889,
6717,
29898,
13193,
703,
29873,
16668,
3827,
613,
376,
9420,
29947,
5783,
396,
6717,
2643,
313,
10389,
4840,
29897,
13,
4706,
931,
29889,
17059,
29898,
29946,
29897,
13,
4706,
1596,
29898,
1191,
710,
29897,
13,
4706,
3132,
29918,
11514,
29889,
6717,
29898,
13193,
29898,
1191,
710,
29892,
376,
9420,
29947,
5783,
396,
6717,
2643,
313,
10389,
4840,
29897,
13,
4706,
4823,
353,
3132,
29918,
11514,
29889,
3757,
29894,
29898,
29896,
29900,
29906,
29946,
29897,
13,
4706,
1596,
29898,
710,
29898,
21453,
29892,
376,
9420,
29947,
5783,
13,
4706,
7709,
515,
3132,
29889,
6717,
29918,
4906,
29898,
4906,
29889,
12719,
29892,
6361,
1445,
29889,
3893,
29918,
24946,
1579,
29893,
718,
851,
29898,
21453,
29892,
376,
9420,
29947,
5783,
13,
13,
4706,
3132,
29918,
11514,
29889,
5358,
580,
13,
2
] |
tools/opt.py
|
hmtrii/tirg
| 0 |
17120
|
<gh_stars>0
class Opt:
def __init__(self):
self.dataset = "fashion200k"
self.dataset_path = "./dataset/Fashion200k"
self.batch_size = 32
self.embed_dim = 512
self.hashing = False
self.retrieve_by_random = True
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
1990,
20693,
29901,
13,
12,
1753,
4770,
2344,
12035,
1311,
1125,
13,
12,
12,
1311,
29889,
24713,
353,
376,
29888,
10904,
29906,
29900,
29900,
29895,
29908,
13,
12,
12,
1311,
29889,
24713,
29918,
2084,
353,
376,
6904,
24713,
29914,
29943,
10904,
29906,
29900,
29900,
29895,
29908,
13,
12,
12,
1311,
29889,
16175,
29918,
2311,
353,
29871,
29941,
29906,
13,
12,
12,
1311,
29889,
17987,
29918,
6229,
353,
29871,
29945,
29896,
29906,
13,
12,
12,
1311,
29889,
8568,
292,
353,
7700,
13,
12,
12,
1311,
29889,
276,
509,
2418,
29918,
1609,
29918,
8172,
353,
5852,
2
] |
twistedcaldav/config.py
|
backwardn/ccs-calendarserver
| 462 |
67991
|
<filename>twistedcaldav/config.py<gh_stars>100-1000
##
# Copyright (c) 2005-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
__all__ = [
"Config",
"ConfigDict",
"ConfigProvider",
"ConfigurationError",
"config",
]
import copy
import hashlib
import os
class ConfigurationError(RuntimeError):
"""
Invalid server configuration.
"""
class ConfigDict(dict):
"""
Dictionary which can be accessed using attribute syntax, because
that reads and writes nicer in code. For example:
C{config.Thingo.Tiny.Tweak}
instead of:
C{config["Thingo"]["Tiny"]["Tweak"]}
"""
def __init__(self, mapping=None):
if mapping is not None:
for key, value in mapping.iteritems():
self[key] = value
def __repr__(self):
return "*" + dict.__repr__(self)
def __setitem__(self, key, value):
if key.startswith("_"):
# Names beginning with "_" are reserved for real attributes
raise KeyError("Keys may not begin with '_': %s" % (key,))
if isinstance(value, dict) and not isinstance(value, self.__class__):
dict.__setitem__(self, key, self.__class__(value))
else:
dict.__setitem__(self, key, value)
def __setattr__(self, attr, value):
if attr.startswith("_"):
dict.__setattr__(self, attr, value)
else:
self[attr] = value
def __getattr__(self, attr):
if not attr.startswith("_") and attr in self:
return self[attr]
else:
return dict.__getattribute__(self, attr)
def __delattr__(self, attr):
if not attr.startswith("_") and attr in self:
del self[attr]
else:
dict.__delattr__(self, attr)
class ConfigProvider(object):
"""
Configuration provider, abstraction for config storage/format/defaults.
"""
def __init__(self, defaults=None):
"""
Create configuration provider with given defaults.
"""
self._configFileName = None
if defaults is None:
self._defaults = ConfigDict()
else:
self._defaults = ConfigDict(copy.deepcopy(defaults))
self.importedFiles = []
self.includedFiles = []
self.missingFiles = []
def getDefaults(self):
"""
Return defaults.
"""
return self._defaults
def setDefaults(self, defaults):
"""
Change defaults.
"""
self._defaults = ConfigDict(copy.deepcopy(defaults))
def getConfigFileName(self):
"""
Return current configuration file path and name.
"""
return self._configFileName
def setConfigFileName(self, configFileName):
"""
Change configuration file path and name for next load operations.
"""
self._configFileName = configFileName
if self._configFileName:
self._configFileName = os.path.abspath(configFileName)
def hasErrors(self):
"""
Return true if last load operation encountered any errors.
"""
return False
def loadConfig(self):
"""
Load the configuration, return a dictionary of settings.
"""
return self._defaults
class Config(object):
def __init__(self, provider=None):
if not provider:
self._provider = ConfigProvider()
else:
self._provider = provider
self._updating = False
self._beforeResetHook = None
self._afterResetHook = None
self._preUpdateHooks = []
self._postUpdateHooks = []
self.reset()
def __setattr__(self, attr, value):
if "_data" in self.__dict__ and attr in self.__dict__["_data"]:
self._data[attr] = value
else:
self.__dict__[attr] = value
# So as not to cause a flurry of updates, don't mark ourselves
# dirty when the attribute begins with an underscore
if not attr.startswith("_"):
self.__dict__["_dirty"] = True
_dirty = False
_data = ()
def __getattr__(self, attr):
if self._dirty:
self.update()
if attr in self._data:
return self._data[attr]
raise AttributeError(attr)
def __hasattr__(self, attr):
return attr in self._data
def __str__(self):
return str(self._data)
def get(self, attr, defaultValue):
parts = attr.split(".")
lastDict = self._data
for part in parts[:-1]:
if part not in lastDict:
lastDict[attr] = ConfigDict()
lastDict = lastDict.__getattr__(part)
configItem = parts[-1]
if configItem in lastDict:
return lastDict[configItem]
else:
lastDict[configItem] = defaultValue
return defaultValue
def addResetHooks(self, before, after):
"""
Hooks for preserving config across reload( ) + reset( )
Each hook will be passed the config data; whatever the before hook
returns will be passed as the second arg to the after hook.
"""
self._beforeResetHook = before
self._afterResetHook = after
def addPreUpdateHooks(self, hooks):
self._preUpdateHooks.extend(hooks)
def addPostUpdateHooks(self, hooks):
self._postUpdateHooks.extend(hooks)
def getProvider(self):
return self._provider
def setProvider(self, provider):
self._provider = provider
self.reset()
def setDefaults(self, defaults):
self._provider.setDefaults(defaults)
self.reset()
def updateDefaults(self, items):
mergeData(self._provider.getDefaults(), items)
self.update(items)
def update(self, items=None, reloading=False):
if self._updating:
return
self._updating = True
if not isinstance(items, ConfigDict):
items = ConfigDict(items)
# Call hooks
for hook in self._preUpdateHooks:
hook(self._data, items, reloading=reloading)
mergeData(self._data, items)
for hook in self._postUpdateHooks:
hook(self._data, reloading=reloading)
self._updating = False
self._dirty = False
self._cachedSyncToken = None
def load(self, configFile):
self._provider.setConfigFileName(configFile)
configDict = self._provider.loadConfig()
if not self._provider.hasErrors():
self.update(configDict)
else:
raise ConfigurationError("Invalid configuration in %s"
% (self._provider.getConfigFileName(),))
def reload(self):
configDict = self._provider.loadConfig()
if not self._provider.hasErrors():
if self._beforeResetHook:
# Give the beforeResetHook a chance to stash away values we want
# to preserve across the reload( )
preserved = self._beforeResetHook(self._data)
else:
preserved = None
self.reset()
if preserved and self._afterResetHook:
# Pass the preserved data back to the afterResetHook
self._afterResetHook(self._data, preserved)
self.update(configDict, reloading=True)
else:
raise ConfigurationError(
"Invalid configuration in %s"
% (self._provider.getConfigFileName(), ))
def reset(self):
self._data = ConfigDict(copy.deepcopy(self._provider.getDefaults()))
self._dirty = True
self._syncTokenKeys = []
self._cachedSyncToken = None
def getKeyPath(self, keyPath):
"""
Allows the getting of arbitrary nested dictionary keys via a single
dot-separated string. For example, getKeyPath(self, "foo.bar.baz")
would fetch parent["foo"]["bar"]["baz"]. If any of the keys don't
exist, None is returned instead.
@param keyPath: a dot-delimited string specifying the path of keys to
traverse
@type keyPath: C{str}
@return: the value at keyPath
"""
parent = self
parts = keyPath.split(".")
for part in parts[:-1]:
child = parent.get(part, None)
if child is None:
return None
parent = child
return parent.get(parts[-1], None)
def addSyncTokenKey(self, keyPath):
"""
Indicates the specified key should be taken into account when generating
the sync token. Also invalidates the (possibly) cached syncToken.
@param keyPath: a dot-delimited string specifying the path of keys to
traverse
@type keyPath: C{str}
"""
if keyPath not in self._syncTokenKeys:
self._syncTokenKeys.append(keyPath)
self._cachedSyncToken = None
def syncToken(self):
"""
Iterates the previously registered keys (sorted, so the order in which
the keys were registered doesn't affect the hash) and generates an MD5
hash of the combined values. The hash is cached, and is invalidated
during a reload or if invalidateSyncToken is called.
@return: the sync token
@rtype: C{str}
"""
if self._cachedSyncToken is None:
pieces = []
self._syncTokenKeys.sort()
for key in self._syncTokenKeys:
value = self.getKeyPath(key)
if value is None:
value = ""
pieces.append(key + ":" + str(value))
whole = "|".join(pieces)
self._cachedSyncToken = hashlib.md5(whole).hexdigest()
return self._cachedSyncToken
def invalidateSyncToken(self):
"""
Invalidates the cached copy of the sync token.
"""
self._cachedSyncToken = None
def joinToken(self, dataToken):
"""
Joins the config sync token with the dataToken. If EnableConfigSyncToken
is False, the original dataToken is just returned
"""
if self.EnableConfigSyncToken:
configToken = self.syncToken()
return "{}/{}".format(dataToken, configToken)
else:
return dataToken
def mergeData(oldData, newData):
"""
Merge two ConfigDict objects; oldData will be updated with all the keys
and values from newData
@param oldData: the object to modify
@type oldData: ConfigDict
@param newData: the object to copy data from
@type newData: ConfigDict
"""
for key, value in newData.iteritems():
if isinstance(value, (dict,)):
if key in oldData:
assert isinstance(oldData[key], ConfigDict), \
"%r in %r is not a ConfigDict" % (oldData[key], oldData)
else:
oldData[key] = {}
mergeData(oldData[key], value)
else:
oldData[key] = value
def fullServerPath(base, path):
if type(path) is str:
return os.path.join(base, path) if path and path[0] not in ('/', '.',) else path
else:
return path
config = Config()
|
[
1,
529,
9507,
29958,
7516,
12652,
1052,
29881,
485,
29914,
2917,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
2277,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29900,
29945,
29899,
29906,
29900,
29896,
29955,
12113,
9266,
29889,
2178,
10462,
21676,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
2277,
13,
13,
1649,
497,
1649,
353,
518,
13,
1678,
376,
3991,
613,
13,
1678,
376,
3991,
21533,
613,
13,
1678,
376,
3991,
6980,
613,
13,
1678,
376,
8614,
2392,
613,
13,
1678,
376,
2917,
613,
13,
29962,
13,
13,
5215,
3509,
13,
5215,
6608,
1982,
13,
5215,
2897,
13,
13,
13,
1990,
20999,
2392,
29898,
7944,
2392,
1125,
13,
1678,
9995,
13,
1678,
21403,
1923,
5285,
29889,
13,
1678,
9995,
13,
13,
13,
1990,
12782,
21533,
29898,
8977,
1125,
13,
1678,
9995,
13,
1678,
13343,
607,
508,
367,
20592,
773,
5352,
5877,
29892,
1363,
13,
1678,
393,
13623,
322,
15873,
16588,
261,
297,
775,
29889,
29871,
1152,
1342,
29901,
13,
418,
315,
29912,
2917,
29889,
1349,
20191,
29889,
29911,
4901,
29889,
29911,
25129,
29913,
13,
1678,
2012,
310,
29901,
13,
418,
315,
29912,
2917,
3366,
1349,
20191,
3108,
3366,
29911,
4901,
3108,
3366,
29911,
25129,
3108,
29913,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10417,
29922,
8516,
1125,
13,
4706,
565,
10417,
338,
451,
6213,
29901,
13,
9651,
363,
1820,
29892,
995,
297,
10417,
29889,
1524,
7076,
7295,
13,
18884,
1583,
29961,
1989,
29962,
353,
995,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
376,
20605,
718,
9657,
17255,
276,
558,
12035,
1311,
29897,
13,
13,
1678,
822,
4770,
842,
667,
12035,
1311,
29892,
1820,
29892,
995,
1125,
13,
4706,
565,
1820,
29889,
27382,
2541,
703,
27508,
1125,
13,
9651,
396,
14706,
6763,
411,
11119,
29908,
526,
21676,
363,
1855,
8393,
13,
9651,
12020,
7670,
2392,
703,
15506,
1122,
451,
3380,
411,
22868,
2396,
1273,
29879,
29908,
1273,
313,
1989,
29892,
876,
13,
13,
4706,
565,
338,
8758,
29898,
1767,
29892,
9657,
29897,
322,
451,
338,
8758,
29898,
1767,
29892,
1583,
17255,
1990,
1649,
1125,
13,
9651,
9657,
17255,
842,
667,
12035,
1311,
29892,
1820,
29892,
1583,
17255,
1990,
12035,
1767,
876,
13,
4706,
1683,
29901,
13,
9651,
9657,
17255,
842,
667,
12035,
1311,
29892,
1820,
29892,
995,
29897,
13,
13,
1678,
822,
4770,
842,
5552,
12035,
1311,
29892,
12421,
29892,
995,
1125,
13,
4706,
565,
12421,
29889,
27382,
2541,
703,
27508,
1125,
13,
9651,
9657,
17255,
842,
5552,
12035,
1311,
29892,
12421,
29892,
995,
29897,
13,
4706,
1683,
29901,
13,
9651,
1583,
29961,
5552,
29962,
353,
995,
13,
13,
1678,
822,
4770,
657,
5552,
12035,
1311,
29892,
12421,
1125,
13,
4706,
565,
451,
12421,
29889,
27382,
2541,
703,
29918,
1159,
322,
12421,
297,
1583,
29901,
13,
9651,
736,
1583,
29961,
5552,
29962,
13,
4706,
1683,
29901,
13,
9651,
736,
9657,
17255,
657,
12715,
12035,
1311,
29892,
12421,
29897,
13,
13,
1678,
822,
4770,
6144,
5552,
12035,
1311,
29892,
12421,
1125,
13,
4706,
565,
451,
12421,
29889,
27382,
2541,
703,
29918,
1159,
322,
12421,
297,
1583,
29901,
13,
9651,
628,
1583,
29961,
5552,
29962,
13,
4706,
1683,
29901,
13,
9651,
9657,
17255,
6144,
5552,
12035,
1311,
29892,
12421,
29897,
13,
13,
13,
1990,
12782,
6980,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
20999,
13113,
29892,
27086,
428,
363,
2295,
8635,
29914,
4830,
29914,
4381,
29879,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
21274,
29922,
8516,
1125,
13,
4706,
9995,
13,
4706,
6204,
5285,
13113,
411,
2183,
21274,
29889,
13,
4706,
9995,
13,
4706,
1583,
3032,
2917,
17020,
353,
6213,
13,
4706,
565,
21274,
338,
6213,
29901,
13,
9651,
1583,
3032,
4381,
29879,
353,
12782,
21533,
580,
13,
4706,
1683,
29901,
13,
9651,
1583,
3032,
4381,
29879,
353,
12782,
21533,
29898,
8552,
29889,
24535,
8552,
29898,
4381,
29879,
876,
13,
4706,
1583,
29889,
5215,
287,
10547,
353,
5159,
13,
4706,
1583,
29889,
11707,
287,
10547,
353,
5159,
13,
4706,
1583,
29889,
27259,
10547,
353,
5159,
13,
13,
1678,
822,
679,
24863,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
7106,
21274,
29889,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
4381,
29879,
13,
13,
1678,
822,
731,
24863,
29898,
1311,
29892,
21274,
1125,
13,
4706,
9995,
13,
4706,
10726,
21274,
29889,
13,
4706,
9995,
13,
4706,
1583,
3032,
4381,
29879,
353,
12782,
21533,
29898,
8552,
29889,
24535,
8552,
29898,
4381,
29879,
876,
13,
13,
1678,
822,
679,
3991,
17020,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
7106,
1857,
5285,
934,
2224,
322,
1024,
29889,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
2917,
17020,
13,
13,
1678,
822,
731,
3991,
17020,
29898,
1311,
29892,
2295,
17020,
1125,
13,
4706,
9995,
13,
4706,
10726,
5285,
934,
2224,
322,
1024,
363,
2446,
2254,
6931,
29889,
13,
4706,
9995,
13,
4706,
1583,
3032,
2917,
17020,
353,
2295,
17020,
13,
4706,
565,
1583,
3032,
2917,
17020,
29901,
13,
9651,
1583,
3032,
2917,
17020,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
2917,
17020,
29897,
13,
13,
1678,
822,
756,
22463,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
7106,
1565,
565,
1833,
2254,
5858,
18169,
738,
4436,
29889,
13,
4706,
9995,
13,
4706,
736,
7700,
13,
13,
1678,
822,
2254,
3991,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
16012,
278,
5285,
29892,
736,
263,
8600,
310,
6055,
29889,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
4381,
29879,
13,
13,
13,
1990,
12782,
29898,
3318,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13113,
29922,
8516,
1125,
13,
4706,
565,
451,
13113,
29901,
13,
9651,
1583,
3032,
18121,
353,
12782,
6980,
580,
13,
4706,
1683,
29901,
13,
9651,
1583,
3032,
18121,
353,
13113,
13,
4706,
1583,
3032,
786,
26747,
353,
7700,
13,
4706,
1583,
3032,
11083,
27175,
29950,
2550,
353,
6213,
13,
4706,
1583,
3032,
7045,
27175,
29950,
2550,
353,
6213,
13,
4706,
1583,
3032,
1457,
6422,
29950,
2550,
29879,
353,
5159,
13,
4706,
1583,
3032,
2490,
6422,
29950,
2550,
29879,
353,
5159,
13,
4706,
1583,
29889,
12071,
580,
13,
13,
1678,
822,
4770,
842,
5552,
12035,
1311,
29892,
12421,
29892,
995,
1125,
13,
4706,
565,
11119,
1272,
29908,
297,
1583,
17255,
8977,
1649,
322,
12421,
297,
1583,
17255,
8977,
1649,
3366,
29918,
1272,
3108,
29901,
13,
9651,
1583,
3032,
1272,
29961,
5552,
29962,
353,
995,
13,
4706,
1683,
29901,
13,
9651,
1583,
17255,
8977,
1649,
29961,
5552,
29962,
353,
995,
13,
13,
4706,
396,
1105,
408,
451,
304,
4556,
263,
1652,
332,
719,
310,
11217,
29892,
1016,
29915,
29873,
2791,
20278,
13,
4706,
396,
26616,
746,
278,
5352,
16410,
411,
385,
23400,
3221,
13,
4706,
565,
451,
12421,
29889,
27382,
2541,
703,
27508,
1125,
13,
9651,
1583,
17255,
8977,
1649,
3366,
29918,
3972,
1017,
3108,
353,
5852,
13,
13,
1678,
903,
3972,
1017,
353,
7700,
13,
1678,
903,
1272,
353,
3861,
13,
13,
1678,
822,
4770,
657,
5552,
12035,
1311,
29892,
12421,
1125,
13,
4706,
565,
1583,
3032,
3972,
1017,
29901,
13,
9651,
1583,
29889,
5504,
580,
13,
13,
4706,
565,
12421,
297,
1583,
3032,
1272,
29901,
13,
9651,
736,
1583,
3032,
1272,
29961,
5552,
29962,
13,
4706,
12020,
23833,
2392,
29898,
5552,
29897,
13,
13,
1678,
822,
4770,
5349,
5552,
12035,
1311,
29892,
12421,
1125,
13,
4706,
736,
12421,
297,
1583,
3032,
1272,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
851,
29898,
1311,
3032,
1272,
29897,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
12421,
29892,
2322,
1917,
1125,
13,
4706,
5633,
353,
12421,
29889,
5451,
17350,
1159,
13,
4706,
1833,
21533,
353,
1583,
3032,
1272,
13,
4706,
363,
760,
297,
5633,
7503,
29899,
29896,
5387,
13,
9651,
565,
760,
451,
297,
1833,
21533,
29901,
13,
18884,
1833,
21533,
29961,
5552,
29962,
353,
12782,
21533,
580,
13,
9651,
1833,
21533,
353,
1833,
21533,
17255,
657,
5552,
12035,
1595,
29897,
13,
4706,
2295,
2001,
353,
5633,
14352,
29896,
29962,
13,
13,
4706,
565,
2295,
2001,
297,
1833,
21533,
29901,
13,
9651,
736,
1833,
21533,
29961,
2917,
2001,
29962,
13,
4706,
1683,
29901,
13,
9651,
1833,
21533,
29961,
2917,
2001,
29962,
353,
2322,
1917,
13,
9651,
736,
2322,
1917,
13,
13,
1678,
822,
788,
27175,
29950,
2550,
29879,
29898,
1311,
29892,
1434,
29892,
1156,
1125,
13,
4706,
9995,
13,
4706,
29612,
29879,
363,
2225,
29530,
2295,
4822,
19763,
29898,
1723,
718,
10092,
29898,
1723,
13,
13,
4706,
7806,
12422,
674,
367,
4502,
278,
2295,
848,
29936,
6514,
278,
1434,
12422,
13,
4706,
3639,
674,
367,
4502,
408,
278,
1473,
1852,
304,
278,
1156,
12422,
29889,
13,
4706,
9995,
13,
4706,
1583,
3032,
11083,
27175,
29950,
2550,
353,
1434,
13,
4706,
1583,
3032,
7045,
27175,
29950,
2550,
353,
1156,
13,
13,
1678,
822,
788,
6572,
6422,
29950,
2550,
29879,
29898,
1311,
29892,
12422,
29879,
1125,
13,
4706,
1583,
3032,
1457,
6422,
29950,
2550,
29879,
29889,
21843,
29898,
1251,
12117,
29897,
13,
13,
1678,
822,
788,
6747,
6422,
29950,
2550,
29879,
29898,
1311,
29892,
12422,
29879,
1125,
13,
4706,
1583,
3032,
2490,
6422,
29950,
2550,
29879,
29889,
21843,
29898,
1251,
12117,
29897,
13,
13,
1678,
822,
679,
6980,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
18121,
13,
13,
1678,
822,
731,
6980,
29898,
1311,
29892,
13113,
1125,
13,
4706,
1583,
3032,
18121,
353,
13113,
13,
4706,
1583,
29889,
12071,
580,
13,
13,
1678,
822,
731,
24863,
29898,
1311,
29892,
21274,
1125,
13,
4706,
1583,
3032,
18121,
29889,
842,
24863,
29898,
4381,
29879,
29897,
13,
4706,
1583,
29889,
12071,
580,
13,
13,
1678,
822,
2767,
24863,
29898,
1311,
29892,
4452,
1125,
13,
4706,
10366,
1469,
29898,
1311,
3032,
18121,
29889,
657,
24863,
3285,
4452,
29897,
13,
4706,
1583,
29889,
5504,
29898,
7076,
29897,
13,
13,
1678,
822,
2767,
29898,
1311,
29892,
4452,
29922,
8516,
29892,
337,
13234,
29922,
8824,
1125,
13,
4706,
565,
1583,
3032,
786,
26747,
29901,
13,
9651,
736,
13,
4706,
1583,
3032,
786,
26747,
353,
5852,
13,
13,
4706,
565,
451,
338,
8758,
29898,
7076,
29892,
12782,
21533,
1125,
13,
9651,
4452,
353,
12782,
21533,
29898,
7076,
29897,
13,
13,
4706,
396,
8251,
12422,
29879,
13,
4706,
363,
12422,
297,
1583,
3032,
1457,
6422,
29950,
2550,
29879,
29901,
13,
9651,
12422,
29898,
1311,
3032,
1272,
29892,
4452,
29892,
337,
13234,
29922,
276,
13234,
29897,
13,
4706,
10366,
1469,
29898,
1311,
3032,
1272,
29892,
4452,
29897,
13,
4706,
363,
12422,
297,
1583,
3032,
2490,
6422,
29950,
2550,
29879,
29901,
13,
9651,
12422,
29898,
1311,
3032,
1272,
29892,
337,
13234,
29922,
276,
13234,
29897,
13,
13,
4706,
1583,
3032,
786,
26747,
353,
7700,
13,
4706,
1583,
3032,
3972,
1017,
353,
7700,
13,
4706,
1583,
3032,
29883,
3791,
21077,
6066,
353,
6213,
13,
13,
1678,
822,
2254,
29898,
1311,
29892,
2295,
2283,
1125,
13,
4706,
1583,
3032,
18121,
29889,
842,
3991,
17020,
29898,
2917,
2283,
29897,
13,
4706,
2295,
21533,
353,
1583,
3032,
18121,
29889,
1359,
3991,
580,
13,
4706,
565,
451,
1583,
3032,
18121,
29889,
5349,
22463,
7295,
13,
9651,
1583,
29889,
5504,
29898,
2917,
21533,
29897,
13,
4706,
1683,
29901,
13,
9651,
12020,
20999,
2392,
703,
13919,
5285,
297,
1273,
29879,
29908,
13,
462,
462,
268,
1273,
313,
1311,
3032,
18121,
29889,
657,
3991,
17020,
3285,
876,
13,
13,
1678,
822,
19763,
29898,
1311,
1125,
13,
4706,
2295,
21533,
353,
1583,
3032,
18121,
29889,
1359,
3991,
580,
13,
4706,
565,
451,
1583,
3032,
18121,
29889,
5349,
22463,
7295,
13,
9651,
565,
1583,
3032,
11083,
27175,
29950,
2550,
29901,
13,
18884,
396,
25538,
278,
1434,
27175,
29950,
2550,
263,
8825,
304,
380,
1161,
3448,
1819,
591,
864,
13,
18884,
396,
304,
19905,
4822,
278,
19763,
29898,
1723,
13,
18884,
21634,
353,
1583,
3032,
11083,
27175,
29950,
2550,
29898,
1311,
3032,
1272,
29897,
13,
9651,
1683,
29901,
13,
18884,
21634,
353,
6213,
13,
9651,
1583,
29889,
12071,
580,
13,
9651,
565,
21634,
322,
1583,
3032,
7045,
27175,
29950,
2550,
29901,
13,
18884,
396,
6978,
278,
21634,
848,
1250,
304,
278,
1156,
27175,
29950,
2550,
13,
18884,
1583,
3032,
7045,
27175,
29950,
2550,
29898,
1311,
3032,
1272,
29892,
21634,
29897,
13,
9651,
1583,
29889,
5504,
29898,
2917,
21533,
29892,
337,
13234,
29922,
5574,
29897,
13,
4706,
1683,
29901,
13,
9651,
12020,
20999,
2392,
29898,
13,
18884,
376,
13919,
5285,
297,
1273,
29879,
29908,
13,
18884,
1273,
313,
1311,
3032,
18121,
29889,
657,
3991,
17020,
3285,
29871,
876,
13,
13,
1678,
822,
10092,
29898,
1311,
1125,
13,
4706,
1583,
3032,
1272,
353,
12782,
21533,
29898,
8552,
29889,
24535,
8552,
29898,
1311,
3032,
18121,
29889,
657,
24863,
22130,
13,
4706,
1583,
3032,
3972,
1017,
353,
5852,
13,
4706,
1583,
3032,
16593,
6066,
15506,
353,
5159,
13,
4706,
1583,
3032,
29883,
3791,
21077,
6066,
353,
6213,
13,
13,
1678,
822,
679,
2558,
2605,
29898,
1311,
29892,
1820,
2605,
1125,
13,
4706,
9995,
13,
4706,
2178,
1242,
278,
2805,
310,
11472,
9322,
8600,
6611,
3025,
263,
2323,
13,
4706,
8329,
29899,
25048,
630,
1347,
29889,
29871,
1152,
1342,
29892,
679,
2558,
2605,
29898,
1311,
29892,
376,
5431,
29889,
1646,
29889,
27975,
1159,
13,
4706,
723,
6699,
3847,
3366,
5431,
3108,
3366,
1646,
3108,
3366,
27975,
16862,
29871,
960,
738,
310,
278,
6611,
1016,
29915,
29873,
13,
4706,
1863,
29892,
6213,
338,
4133,
2012,
29889,
13,
13,
4706,
732,
3207,
1820,
2605,
29901,
263,
8329,
29899,
6144,
326,
1573,
1347,
22146,
278,
2224,
310,
6611,
304,
13,
9651,
29370,
13,
4706,
732,
1853,
1820,
2605,
29901,
315,
29912,
710,
29913,
13,
4706,
732,
2457,
29901,
278,
995,
472,
1820,
2605,
13,
4706,
9995,
13,
4706,
3847,
353,
1583,
13,
4706,
5633,
353,
1820,
2605,
29889,
5451,
17350,
1159,
13,
4706,
363,
760,
297,
5633,
7503,
29899,
29896,
5387,
13,
9651,
2278,
353,
3847,
29889,
657,
29898,
1595,
29892,
6213,
29897,
13,
9651,
565,
2278,
338,
6213,
29901,
13,
18884,
736,
6213,
13,
9651,
3847,
353,
2278,
13,
4706,
736,
3847,
29889,
657,
29898,
20895,
14352,
29896,
1402,
6213,
29897,
13,
13,
1678,
822,
788,
21077,
6066,
2558,
29898,
1311,
29892,
1820,
2605,
1125,
13,
4706,
9995,
13,
4706,
1894,
293,
1078,
278,
6790,
1820,
881,
367,
4586,
964,
3633,
746,
14655,
13,
4706,
278,
16523,
5993,
29889,
29871,
3115,
8340,
1078,
278,
313,
28802,
14981,
29897,
22152,
16523,
6066,
29889,
13,
13,
4706,
732,
3207,
1820,
2605,
29901,
263,
8329,
29899,
6144,
326,
1573,
1347,
22146,
278,
2224,
310,
6611,
304,
13,
9651,
29370,
13,
4706,
732,
1853,
1820,
2605,
29901,
315,
29912,
710,
29913,
13,
4706,
9995,
13,
4706,
565,
1820,
2605,
451,
297,
1583,
3032,
16593,
6066,
15506,
29901,
13,
9651,
1583,
3032,
16593,
6066,
15506,
29889,
4397,
29898,
1989,
2605,
29897,
13,
4706,
1583,
3032,
29883,
3791,
21077,
6066,
353,
6213,
13,
13,
1678,
822,
16523,
6066,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
20504,
1078,
278,
9251,
15443,
6611,
313,
24582,
29892,
577,
278,
1797,
297,
607,
13,
4706,
278,
6611,
892,
15443,
1838,
29915,
29873,
6602,
278,
6608,
29897,
322,
16785,
385,
20672,
29945,
13,
4706,
6608,
310,
278,
12420,
1819,
29889,
29871,
450,
6608,
338,
22152,
29892,
322,
338,
8340,
630,
13,
4706,
2645,
263,
19763,
470,
565,
8340,
403,
21077,
6066,
338,
2000,
29889,
13,
13,
4706,
732,
2457,
29901,
278,
16523,
5993,
13,
4706,
732,
29878,
1853,
29901,
315,
29912,
710,
29913,
13,
4706,
9995,
13,
4706,
565,
1583,
3032,
29883,
3791,
21077,
6066,
338,
6213,
29901,
13,
9651,
12785,
353,
5159,
13,
9651,
1583,
3032,
16593,
6066,
15506,
29889,
6605,
580,
13,
9651,
363,
1820,
297,
1583,
3032,
16593,
6066,
15506,
29901,
13,
18884,
995,
353,
1583,
29889,
657,
2558,
2605,
29898,
1989,
29897,
13,
18884,
565,
995,
338,
6213,
29901,
13,
462,
1678,
995,
353,
5124,
13,
18884,
12785,
29889,
4397,
29898,
1989,
718,
376,
6160,
718,
851,
29898,
1767,
876,
13,
9651,
3353,
353,
376,
29989,
1642,
7122,
29898,
12343,
778,
29897,
13,
9651,
1583,
3032,
29883,
3791,
21077,
6066,
353,
6608,
1982,
29889,
3487,
29945,
29898,
15970,
280,
467,
20970,
7501,
342,
580,
13,
4706,
736,
1583,
3032,
29883,
3791,
21077,
6066,
13,
13,
1678,
822,
8340,
403,
21077,
6066,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
21403,
1078,
278,
22152,
3509,
310,
278,
16523,
5993,
29889,
13,
4706,
9995,
13,
4706,
1583,
3032,
29883,
3791,
21077,
6066,
353,
6213,
13,
13,
1678,
822,
5988,
6066,
29898,
1311,
29892,
848,
6066,
1125,
13,
4706,
9995,
13,
4706,
3650,
1144,
278,
2295,
16523,
5993,
411,
278,
848,
6066,
29889,
29871,
960,
1174,
519,
3991,
21077,
6066,
13,
4706,
338,
7700,
29892,
278,
2441,
848,
6066,
338,
925,
4133,
13,
4706,
9995,
13,
4706,
565,
1583,
29889,
20701,
3991,
21077,
6066,
29901,
13,
9651,
2295,
6066,
353,
1583,
29889,
16593,
6066,
580,
13,
9651,
736,
29850,
6822,
8875,
1642,
4830,
29898,
1272,
6066,
29892,
2295,
6066,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
848,
6066,
13,
13,
13,
1753,
10366,
1469,
29898,
1025,
1469,
29892,
716,
1469,
1125,
13,
1678,
9995,
13,
1678,
4702,
479,
1023,
12782,
21533,
3618,
29936,
2030,
1469,
674,
367,
4784,
411,
599,
278,
6611,
13,
1678,
322,
1819,
515,
716,
1469,
13,
1678,
732,
3207,
2030,
1469,
29901,
278,
1203,
304,
6623,
13,
1678,
732,
1853,
2030,
1469,
29901,
12782,
21533,
13,
1678,
732,
3207,
716,
1469,
29901,
278,
1203,
304,
3509,
848,
515,
13,
1678,
732,
1853,
716,
1469,
29901,
12782,
21533,
13,
1678,
9995,
13,
1678,
363,
1820,
29892,
995,
297,
716,
1469,
29889,
1524,
7076,
7295,
13,
4706,
565,
338,
8758,
29898,
1767,
29892,
313,
8977,
29892,
22164,
13,
9651,
565,
1820,
297,
2030,
1469,
29901,
13,
18884,
4974,
338,
8758,
29898,
1025,
1469,
29961,
1989,
1402,
12782,
21533,
511,
320,
13,
462,
1678,
11860,
29878,
297,
1273,
29878,
338,
451,
263,
12782,
21533,
29908,
1273,
313,
1025,
1469,
29961,
1989,
1402,
2030,
1469,
29897,
13,
9651,
1683,
29901,
13,
18884,
2030,
1469,
29961,
1989,
29962,
353,
6571,
13,
9651,
10366,
1469,
29898,
1025,
1469,
29961,
1989,
1402,
995,
29897,
13,
4706,
1683,
29901,
13,
9651,
2030,
1469,
29961,
1989,
29962,
353,
995,
13,
13,
13,
1753,
2989,
6004,
2605,
29898,
3188,
29892,
2224,
1125,
13,
1678,
565,
1134,
29898,
2084,
29897,
338,
851,
29901,
13,
4706,
736,
2897,
29889,
2084,
29889,
7122,
29898,
3188,
29892,
2224,
29897,
565,
2224,
322,
2224,
29961,
29900,
29962,
451,
297,
6702,
29914,
742,
15300,
742,
29897,
1683,
2224,
13,
1678,
1683,
29901,
13,
4706,
736,
2224,
13,
13,
2917,
353,
12782,
580,
13,
2
] |
gaphor/services/helpservice/__init__.py
|
sitedata/gaphor
| 0 |
77798
|
<gh_stars>0
"""About and help services.
(help browser anyone?)
"""
from gi.repository import Gtk
from gaphor.abc import ActionProvider, Service
from gaphor.application import distribution
from gaphor.core import action
from gaphor.i18n import translated_ui_string
class HelpService(Service, ActionProvider):
def __init__(self, main_window):
self.main_window = main_window
def shutdown(self):
pass
@property
def window(self):
return self.main_window.window
@action(name="about")
def about(self):
builder = Gtk.Builder()
builder.add_from_string(
translated_ui_string("gaphor.services.helpservice", "about.ui")
)
about = builder.get_object("about")
about.set_version(distribution().version)
about.set_transient_for(self.window)
about.run()
about.destroy()
@action(name="win.shortcuts")
def shortcuts(self):
builder = Gtk.Builder()
builder.add_from_string(
translated_ui_string("gaphor.services.helpservice", "shortcuts.ui")
)
shortcuts = builder.get_object("shortcuts-gaphor")
shortcuts.set_modal(True)
shortcuts.set_transient_for(self.window)
shortcuts.show()
return shortcuts
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
28173,
322,
1371,
5786,
29889,
13,
13,
29898,
8477,
4714,
5019,
7897,
13,
15945,
29908,
13,
13,
3166,
4005,
29889,
19033,
1053,
402,
11178,
13,
13,
3166,
17261,
2015,
29889,
10736,
1053,
9123,
6980,
29892,
6692,
13,
3166,
17261,
2015,
29889,
6214,
1053,
4978,
13,
3166,
17261,
2015,
29889,
3221,
1053,
3158,
13,
3166,
17261,
2015,
29889,
29875,
29896,
29947,
29876,
1053,
20512,
29918,
1481,
29918,
1807,
13,
13,
13,
1990,
22305,
3170,
29898,
3170,
29892,
9123,
6980,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1667,
29918,
7165,
1125,
13,
4706,
1583,
29889,
3396,
29918,
7165,
353,
1667,
29918,
7165,
13,
13,
1678,
822,
12522,
3204,
29898,
1311,
1125,
13,
4706,
1209,
13,
13,
1678,
732,
6799,
13,
1678,
822,
3474,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3396,
29918,
7165,
29889,
7165,
13,
13,
1678,
732,
2467,
29898,
978,
543,
12717,
1159,
13,
1678,
822,
1048,
29898,
1311,
1125,
13,
4706,
12856,
353,
402,
11178,
29889,
5627,
580,
13,
4706,
12856,
29889,
1202,
29918,
3166,
29918,
1807,
29898,
13,
9651,
20512,
29918,
1481,
29918,
1807,
703,
29887,
481,
2015,
29889,
9916,
29889,
3952,
567,
261,
1087,
613,
376,
12717,
29889,
1481,
1159,
13,
4706,
1723,
13,
13,
4706,
1048,
353,
12856,
29889,
657,
29918,
3318,
703,
12717,
1159,
13,
13,
4706,
1048,
29889,
842,
29918,
3259,
29898,
27691,
2141,
3259,
29897,
13,
4706,
1048,
29889,
842,
29918,
3286,
993,
29918,
1454,
29898,
1311,
29889,
7165,
29897,
13,
13,
4706,
1048,
29889,
3389,
580,
13,
4706,
1048,
29889,
20524,
580,
13,
13,
1678,
732,
2467,
29898,
978,
543,
5080,
29889,
12759,
7582,
29879,
1159,
13,
1678,
822,
21697,
29879,
29898,
1311,
1125,
13,
4706,
12856,
353,
402,
11178,
29889,
5627,
580,
13,
4706,
12856,
29889,
1202,
29918,
3166,
29918,
1807,
29898,
13,
9651,
20512,
29918,
1481,
29918,
1807,
703,
29887,
481,
2015,
29889,
9916,
29889,
3952,
567,
261,
1087,
613,
376,
12759,
7582,
29879,
29889,
1481,
1159,
13,
4706,
1723,
13,
13,
4706,
21697,
29879,
353,
12856,
29889,
657,
29918,
3318,
703,
12759,
7582,
29879,
29899,
29887,
481,
2015,
1159,
13,
4706,
21697,
29879,
29889,
842,
29918,
15601,
29898,
5574,
29897,
13,
4706,
21697,
29879,
29889,
842,
29918,
3286,
993,
29918,
1454,
29898,
1311,
29889,
7165,
29897,
13,
13,
4706,
21697,
29879,
29889,
4294,
580,
13,
4706,
736,
21697,
29879,
13,
2
] |
tf_agents/agents/sac/sac_agent.py
|
Francis777/agents
| 0 |
197102
|
# coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://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.
# Lint as: python2, python3
"""A Soft Actor-Critic Agent.
Implements the Soft Actor-Critic (SAC) algorithm from
"Soft Actor-Critic Algorithms and Applications" by Haarnoja et al (2019).
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from typing import Callable, Optional, Text
import gin
import numpy as np
from six.moves import zip
import tensorflow as tf # pylint: disable=g-explicit-tensorflow-version-import
import tensorflow_probability as tfp
from tf_agents.agents import data_converter
from tf_agents.agents import tf_agent
from tf_agents.networks import network
from tf_agents.policies import actor_policy
from tf_agents.policies import tf_policy
from tf_agents.trajectories import time_step as ts
from tf_agents.typing import types
from tf_agents.utils import common
from tf_agents.utils import eager_utils
from tf_agents.utils import nest_utils
from tf_agents.utils import object_identity
SacLossInfo = collections.namedtuple(
'SacLossInfo', ('critic_loss', 'actor_loss', 'alpha_loss'))
# TODO(b/148889463): deprecate std_clip_transform
@gin.configurable
def std_clip_transform(stddevs: types.NestedTensor) -> types.NestedTensor:
stddevs = tf.nest.map_structure(lambda t: tf.clip_by_value(t, -20, 2),
stddevs)
return tf.exp(stddevs)
@gin.configurable
class SacAgent(tf_agent.TFAgent):
"""A SAC Agent."""
def __init__(self,
time_step_spec: ts.TimeStep,
action_spec: types.NestedTensorSpec,
critic_network: network.Network,
actor_network: network.Network,
actor_optimizer: types.Optimizer,
critic_optimizer: types.Optimizer,
alpha_optimizer: types.Optimizer,
actor_loss_weight: types.Float = 1.0,
critic_loss_weight: types.Float = 0.5,
alpha_loss_weight: types.Float = 1.0,
actor_policy_ctor: Callable[
..., tf_policy.TFPolicy] = actor_policy.ActorPolicy,
critic_network_2: Optional[network.Network] = None,
target_critic_network: Optional[network.Network] = None,
target_critic_network_2: Optional[network.Network] = None,
target_update_tau: types.Float = 1.0,
target_update_period: types.Int = 1,
td_errors_loss_fn: types.LossFn = tf.math.squared_difference,
gamma: types.Float = 1.0,
reward_scale_factor: types.Float = 1.0,
initial_log_alpha: types.Float = 0.0,
use_log_alpha_in_alpha_loss: bool = True,
target_entropy: Optional[types.Float] = None,
gradient_clipping: Optional[types.Float] = None,
debug_summaries: bool = False,
summarize_grads_and_vars: bool = False,
train_step_counter: Optional[tf.Variable] = None,
name: Optional[Text] = None):
"""Creates a SAC Agent.
Args:
time_step_spec: A `TimeStep` spec of the expected time_steps.
action_spec: A nest of BoundedTensorSpec representing the actions.
critic_network: A function critic_network((observations, actions)) that
returns the q_values for each observation and action.
actor_network: A function actor_network(observation, action_spec) that
returns action distribution.
actor_optimizer: The optimizer to use for the actor network.
critic_optimizer: The default optimizer to use for the critic network.
alpha_optimizer: The default optimizer to use for the alpha variable.
actor_loss_weight: The weight on actor loss.
critic_loss_weight: The weight on critic loss.
alpha_loss_weight: The weight on alpha loss.
actor_policy_ctor: The policy class to use.
critic_network_2: (Optional.) A `tf_agents.network.Network` to be used as
the second critic network during Q learning. The weights from
`critic_network` are copied if this is not provided.
target_critic_network: (Optional.) A `tf_agents.network.Network` to be
used as the target critic network during Q learning. Every
`target_update_period` train steps, the weights from `critic_network`
are copied (possibly withsmoothing via `target_update_tau`) to `
target_critic_network`. If `target_critic_network` is not provided, it
is created by making a copy of `critic_network`, which initializes a new
network with the same structure and its own layers and weights.
Performing a `Network.copy` does not work when the network instance
already has trainable parameters (e.g., has already been built, or when
the network is sharing layers with another). In these cases, it is up
to you to build a copy having weights that are not shared with the
original `critic_network`, so that this can be used as a target network.
If you provide a `target_critic_network` that shares any weights with
`critic_network`, a warning will be logged but no exception is thrown.
target_critic_network_2: (Optional.) Similar network as
target_critic_network but for the critic_network_2. See documentation
for target_critic_network. Will only be used if 'critic_network_2' is
also specified.
target_update_tau: Factor for soft update of the target networks.
target_update_period: Period for soft update of the target networks.
td_errors_loss_fn: A function for computing the elementwise TD errors
loss.
gamma: A discount factor for future rewards.
reward_scale_factor: Multiplicative scale for the reward.
initial_log_alpha: Initial value for log_alpha.
use_log_alpha_in_alpha_loss: A boolean, whether using log_alpha or alpha
in alpha loss. Certain implementations of SAC use log_alpha as log
values are generally nicer to work with.
target_entropy: The target average policy entropy, for updating alpha. The
default value is negative of the total number of actions.
gradient_clipping: Norm length to clip gradients.
debug_summaries: A bool to gather debug summaries.
summarize_grads_and_vars: If True, gradient and network variable summaries
will be written during training.
train_step_counter: An optional counter to increment every time the train
op is run. Defaults to the global_step.
name: The name of this agent. All variables in this module will fall under
that name. Defaults to the class name.
"""
tf.Module.__init__(self, name=name)
self._check_action_spec(action_spec)
net_observation_spec = time_step_spec.observation
critic_spec = (net_observation_spec, action_spec)
self._critic_network_1 = critic_network
if critic_network_2 is not None:
self._critic_network_2 = critic_network_2
else:
self._critic_network_2 = critic_network.copy(name='CriticNetwork2')
# Do not use target_critic_network_2 if critic_network_2 is None.
target_critic_network_2 = None
# Wait until critic_network_2 has been copied from critic_network_1 before
# creating variables on both.
self._critic_network_1.create_variables(critic_spec)
self._critic_network_2.create_variables(critic_spec)
if target_critic_network:
target_critic_network.create_variables(critic_spec)
self._target_critic_network_1 = (
common.maybe_copy_target_network_with_checks(
self._critic_network_1,
target_critic_network,
input_spec=critic_spec,
name='TargetCriticNetwork1'))
if target_critic_network_2:
target_critic_network_2.create_variables(critic_spec)
self._target_critic_network_2 = (
common.maybe_copy_target_network_with_checks(
self._critic_network_2,
target_critic_network_2,
input_spec=critic_spec,
name='TargetCriticNetwork2'))
if actor_network:
actor_network.create_variables(net_observation_spec)
self._actor_network = actor_network
policy = actor_policy_ctor(
time_step_spec=time_step_spec,
action_spec=action_spec,
actor_network=self._actor_network,
training=False)
self._train_policy = actor_policy_ctor(
time_step_spec=time_step_spec,
action_spec=action_spec,
actor_network=self._actor_network,
training=True)
self._log_alpha = common.create_variable(
'initial_log_alpha',
initial_value=initial_log_alpha,
dtype=tf.float32,
trainable=True)
if target_entropy is None:
target_entropy = self._get_default_target_entropy(action_spec)
self._use_log_alpha_in_alpha_loss = use_log_alpha_in_alpha_loss
self._target_update_tau = target_update_tau
self._target_update_period = target_update_period
self._actor_optimizer = actor_optimizer
self._critic_optimizer = critic_optimizer
self._alpha_optimizer = alpha_optimizer
self._actor_loss_weight = actor_loss_weight
self._critic_loss_weight = critic_loss_weight
self._alpha_loss_weight = alpha_loss_weight
self._td_errors_loss_fn = td_errors_loss_fn
self._gamma = gamma
self._reward_scale_factor = reward_scale_factor
self._target_entropy = target_entropy
self._gradient_clipping = gradient_clipping
self._debug_summaries = debug_summaries
self._summarize_grads_and_vars = summarize_grads_and_vars
self._update_target = self._get_target_updater(
tau=self._target_update_tau, period=self._target_update_period)
train_sequence_length = 2 if not critic_network.state_spec else None
super(SacAgent, self).__init__(
time_step_spec,
action_spec,
policy=policy,
collect_policy=policy,
train_sequence_length=train_sequence_length,
debug_summaries=debug_summaries,
summarize_grads_and_vars=summarize_grads_and_vars,
train_step_counter=train_step_counter,
)
self._as_transition = data_converter.AsTransition(
self.data_context, squeeze_time_dim=(train_sequence_length == 2))
def _check_action_spec(self, action_spec):
flat_action_spec = tf.nest.flatten(action_spec)
for spec in flat_action_spec:
if spec.dtype.is_integer:
raise NotImplementedError(
'SacAgent does not currently support discrete actions. '
'Action spec: {}'.format(action_spec))
def _get_default_target_entropy(self, action_spec):
# If target_entropy was not passed, set it to -dim(A)/2.0
# Note that the original default entropy target is -dim(A) in the SAC paper.
# However this formulation has also been used in practice by the original
# authors and has in our experience been more stable for gym/mujoco.
flat_action_spec = tf.nest.flatten(action_spec)
target_entropy = -np.sum([
np.product(single_spec.shape.as_list())
for single_spec in flat_action_spec
]) / 2.0
return target_entropy
def _initialize(self):
"""Returns an op to initialize the agent.
Copies weights from the Q networks to the target Q network.
"""
common.soft_variables_update(
self._critic_network_1.variables,
self._target_critic_network_1.variables,
tau=1.0)
common.soft_variables_update(
self._critic_network_2.variables,
self._target_critic_network_2.variables,
tau=1.0)
def _train(self, experience, weights):
"""Returns a train op to update the agent's networks.
This method trains with the provided batched experience.
Args:
experience: A time-stacked trajectory object.
weights: Optional scalar or elementwise (per-batch-entry) importance
weights.
Returns:
A train_op.
Raises:
ValueError: If optimizers are None and no default value was provided to
the constructor.
"""
transition = self._as_transition(experience)
time_steps, policy_steps, next_time_steps = transition
actions = policy_steps.action
trainable_critic_variables = list(object_identity.ObjectIdentitySet(
self._critic_network_1.trainable_variables +
self._critic_network_2.trainable_variables))
with tf.GradientTape(watch_accessed_variables=False) as tape:
assert trainable_critic_variables, ('No trainable critic variables to '
'optimize.')
tape.watch(trainable_critic_variables)
critic_loss = self._critic_loss_weight*self.critic_loss(
time_steps,
actions,
next_time_steps,
td_errors_loss_fn=self._td_errors_loss_fn,
gamma=self._gamma,
reward_scale_factor=self._reward_scale_factor,
weights=weights,
training=True)
tf.debugging.check_numerics(critic_loss, 'Critic loss is inf or nan.')
critic_grads = tape.gradient(critic_loss, trainable_critic_variables)
self._apply_gradients(critic_grads, trainable_critic_variables,
self._critic_optimizer)
trainable_actor_variables = self._actor_network.trainable_variables
with tf.GradientTape(watch_accessed_variables=False) as tape:
assert trainable_actor_variables, ('No trainable actor variables to '
'optimize.')
tape.watch(trainable_actor_variables)
actor_loss = self._actor_loss_weight*self.actor_loss(
time_steps, weights=weights, training=True)
tf.debugging.check_numerics(actor_loss, 'Actor loss is inf or nan.')
actor_grads = tape.gradient(actor_loss, trainable_actor_variables)
self._apply_gradients(actor_grads, trainable_actor_variables,
self._actor_optimizer)
alpha_variable = [self._log_alpha]
with tf.GradientTape(watch_accessed_variables=False) as tape:
assert alpha_variable, 'No alpha variable to optimize.'
tape.watch(alpha_variable)
alpha_loss = self._alpha_loss_weight * self.alpha_loss(
time_steps, weights=weights, training=True)
tf.debugging.check_numerics(alpha_loss, 'Alpha loss is inf or nan.')
alpha_grads = tape.gradient(alpha_loss, alpha_variable)
self._apply_gradients(alpha_grads, alpha_variable, self._alpha_optimizer)
with tf.name_scope('Losses'):
tf.compat.v2.summary.scalar(
name='critic_loss', data=critic_loss, step=self.train_step_counter)
tf.compat.v2.summary.scalar(
name='actor_loss', data=actor_loss, step=self.train_step_counter)
tf.compat.v2.summary.scalar(
name='alpha_loss', data=alpha_loss, step=self.train_step_counter)
self.train_step_counter.assign_add(1)
self._update_target()
total_loss = critic_loss + actor_loss + alpha_loss
extra = SacLossInfo(
critic_loss=critic_loss, actor_loss=actor_loss, alpha_loss=alpha_loss)
return tf_agent.LossInfo(loss=total_loss, extra=extra)
def _loss(self,
experience: types.NestedTensor,
weights: Optional[types.Tensor] = None,
training: bool = False):
"""Returns the loss of the provided experience.
This method is only used at test time!
Args:
experience: A time-stacked trajectory object.
weights: Optional scalar or elementwise (per-batch-entry) importance
weights.
training: Whether this loss is being calculated as part of training.
Returns:
A `LossInfo` containing the loss for the experience.
"""
transition = self._as_transition(experience)
time_steps, policy_steps, next_time_steps = transition
actions = policy_steps.action
critic_loss = self._critic_loss_weight * self.critic_loss(
time_steps,
actions,
next_time_steps,
td_errors_loss_fn=self._td_errors_loss_fn,
gamma=self._gamma,
reward_scale_factor=self._reward_scale_factor,
weights=weights,
training=training)
tf.debugging.check_numerics(critic_loss, 'Critic loss is inf or nan.')
actor_loss = self._actor_loss_weight * self.actor_loss(
time_steps, weights=weights, training=training)
tf.debugging.check_numerics(actor_loss, 'Actor loss is inf or nan.')
alpha_loss = self._alpha_loss_weight * self.alpha_loss(
time_steps, weights=weights, training=training)
tf.debugging.check_numerics(alpha_loss, 'Alpha loss is inf or nan.')
with tf.name_scope('Losses'):
tf.compat.v2.summary.scalar(
name='critic_loss', data=critic_loss, step=self.train_step_counter)
tf.compat.v2.summary.scalar(
name='actor_loss', data=actor_loss, step=self.train_step_counter)
tf.compat.v2.summary.scalar(
name='alpha_loss', data=alpha_loss, step=self.train_step_counter)
total_loss = critic_loss + actor_loss + alpha_loss
extra = SacLossInfo(
critic_loss=critic_loss, actor_loss=actor_loss, alpha_loss=alpha_loss)
return tf_agent.LossInfo(loss=total_loss, extra=extra)
def _apply_gradients(self, gradients, variables, optimizer):
# list(...) is required for Python3.
grads_and_vars = list(zip(gradients, variables))
if self._gradient_clipping is not None:
grads_and_vars = eager_utils.clip_gradient_norms(grads_and_vars,
self._gradient_clipping)
if self._summarize_grads_and_vars:
eager_utils.add_variables_summaries(grads_and_vars,
self.train_step_counter)
eager_utils.add_gradients_summaries(grads_and_vars,
self.train_step_counter)
optimizer.apply_gradients(grads_and_vars)
def _get_target_updater(self, tau=1.0, period=1):
"""Performs a soft update of the target network parameters.
For each weight w_s in the original network, and its corresponding
weight w_t in the target network, a soft update is:
w_t = (1- tau) x w_t + tau x ws
Args:
tau: A float scalar in [0, 1]. Default `tau=1.0` means hard update.
period: Step interval at which the target network is updated.
Returns:
A callable that performs a soft update of the target network parameters.
"""
with tf.name_scope('update_target'):
def update():
"""Update target network."""
critic_update_1 = common.soft_variables_update(
self._critic_network_1.variables,
self._target_critic_network_1.variables,
tau,
tau_non_trainable=1.0)
critic_2_update_vars = common.deduped_network_variables(
self._critic_network_2, self._critic_network_1)
target_critic_2_update_vars = common.deduped_network_variables(
self._target_critic_network_2, self._target_critic_network_1)
critic_update_2 = common.soft_variables_update(
critic_2_update_vars,
target_critic_2_update_vars,
tau,
tau_non_trainable=1.0)
return tf.group(critic_update_1, critic_update_2)
return common.Periodically(update, period, 'update_targets')
def _actions_and_log_probs(self, time_steps, training=False):
"""Get actions and corresponding log probabilities from policy."""
# Get raw action distribution from policy, and initialize bijectors list.
batch_size = nest_utils.get_outer_shape(time_steps, self._time_step_spec)[0]
policy_state = self._train_policy.get_initial_state(batch_size)
if training:
action_distribution = self._train_policy.distribution(
time_steps, policy_state=policy_state).action
else:
action_distribution = self._policy.distribution(
time_steps, policy_state=policy_state).action
# Sample actions and log_pis from transformed distribution.
actions = tf.nest.map_structure(lambda d: d.sample(), action_distribution)
log_pi = common.log_probability(action_distribution, actions,
self.action_spec)
return actions, log_pi
def critic_loss(self,
time_steps: ts.TimeStep,
actions: types.Tensor,
next_time_steps: ts.TimeStep,
td_errors_loss_fn: types.LossFn,
gamma: types.Float = 1.0,
reward_scale_factor: types.Float = 1.0,
weights: Optional[types.Tensor] = None,
training: bool = False) -> types.Tensor:
"""Computes the critic loss for SAC training.
Args:
time_steps: A batch of timesteps.
actions: A batch of actions.
next_time_steps: A batch of next timesteps.
td_errors_loss_fn: A function(td_targets, predictions) to compute
elementwise (per-batch-entry) loss.
gamma: Discount for future rewards.
reward_scale_factor: Multiplicative factor to scale rewards.
weights: Optional scalar or elementwise (per-batch-entry) importance
weights.
training: Whether this loss is being used for training.
Returns:
critic_loss: A scalar critic loss.
"""
with tf.name_scope('critic_loss'):
nest_utils.assert_same_structure(actions, self.action_spec)
nest_utils.assert_same_structure(time_steps, self.time_step_spec)
nest_utils.assert_same_structure(next_time_steps, self.time_step_spec)
# We do not update actor or target networks in critic loss.
next_actions, next_log_pis = self._actions_and_log_probs(next_time_steps,
training=False)
target_input = (next_time_steps.observation, next_actions)
target_q_values1, unused_network_state1 = self._target_critic_network_1(
target_input, step_type=next_time_steps.step_type, training=False)
target_q_values2, unused_network_state2 = self._target_critic_network_2(
target_input, step_type=next_time_steps.step_type, training=False)
target_q_values = (
tf.minimum(target_q_values1, target_q_values2) -
tf.exp(self._log_alpha) * next_log_pis)
td_targets = tf.stop_gradient(
reward_scale_factor * next_time_steps.reward +
gamma * next_time_steps.discount * target_q_values)
pred_input = (time_steps.observation, actions)
pred_td_targets1, _ = self._critic_network_1(
pred_input, step_type=time_steps.step_type, training=training)
pred_td_targets2, _ = self._critic_network_2(
pred_input, step_type=time_steps.step_type, training=training)
critic_loss1 = td_errors_loss_fn(td_targets, pred_td_targets1)
critic_loss2 = td_errors_loss_fn(td_targets, pred_td_targets2)
critic_loss = critic_loss1 + critic_loss2
if critic_loss.shape.rank > 1:
# Sum over the time dimension.
critic_loss = tf.reduce_sum(
critic_loss, axis=range(1, critic_loss.shape.rank))
agg_loss = common.aggregate_losses(
per_example_loss=critic_loss,
sample_weight=weights,
regularization_loss=(self._critic_network_1.losses +
self._critic_network_2.losses))
critic_loss = agg_loss.total_loss
self._critic_loss_debug_summaries(td_targets, pred_td_targets1,
pred_td_targets2)
return critic_loss
def actor_loss(self,
time_steps: ts.TimeStep,
weights: Optional[types.Tensor] = None,
training: Optional[bool] = True) -> types.Tensor:
"""Computes the actor_loss for SAC training.
Args:
time_steps: A batch of timesteps.
weights: Optional scalar or elementwise (per-batch-entry) importance
weights.
training: Whether training should be applied.
Returns:
actor_loss: A scalar actor loss.
"""
with tf.name_scope('actor_loss'):
nest_utils.assert_same_structure(time_steps, self.time_step_spec)
actions, log_pi = self._actions_and_log_probs(time_steps,
training=training)
target_input = (time_steps.observation, actions)
# We do not update critic during actor loss.
target_q_values1, _ = self._critic_network_1(
target_input, step_type=time_steps.step_type, training=False)
target_q_values2, _ = self._critic_network_2(
target_input, step_type=time_steps.step_type, training=False)
target_q_values = tf.minimum(target_q_values1, target_q_values2)
actor_loss = tf.exp(self._log_alpha) * log_pi - target_q_values
if actor_loss.shape.rank > 1:
# Sum over the time dimension.
actor_loss = tf.reduce_sum(
actor_loss, axis=range(1, actor_loss.shape.rank))
reg_loss = self._actor_network.losses if self._actor_network else None
agg_loss = common.aggregate_losses(
per_example_loss=actor_loss,
sample_weight=weights,
regularization_loss=reg_loss)
actor_loss = agg_loss.total_loss
self._actor_loss_debug_summaries(actor_loss, actions, log_pi,
target_q_values, time_steps)
return actor_loss
def alpha_loss(self,
time_steps: ts.TimeStep,
weights: Optional[types.Tensor] = None,
training: bool = False) -> types.Tensor:
"""Computes the alpha_loss for EC-SAC training.
Args:
time_steps: A batch of timesteps.
weights: Optional scalar or elementwise (per-batch-entry) importance
weights.
training: Whether this loss is being used during training.
Returns:
alpha_loss: A scalar alpha loss.
"""
with tf.name_scope('alpha_loss'):
nest_utils.assert_same_structure(time_steps, self.time_step_spec)
# We do not update actor during alpha loss.
unused_actions, log_pi = self._actions_and_log_probs(
time_steps, training=False)
entropy_diff = tf.stop_gradient(-log_pi - self._target_entropy)
if self._use_log_alpha_in_alpha_loss:
alpha_loss = (self._log_alpha * entropy_diff)
else:
alpha_loss = (tf.exp(self._log_alpha) * entropy_diff)
if alpha_loss.shape.rank > 1:
# Sum over the time dimension.
alpha_loss = tf.reduce_sum(
alpha_loss, axis=range(1, alpha_loss.shape.rank))
agg_loss = common.aggregate_losses(
per_example_loss=alpha_loss, sample_weight=weights)
alpha_loss = agg_loss.total_loss
self._alpha_loss_debug_summaries(alpha_loss, entropy_diff)
return alpha_loss
def _critic_loss_debug_summaries(self, td_targets, pred_td_targets1,
pred_td_targets2):
if self._debug_summaries:
td_errors1 = td_targets - pred_td_targets1
td_errors2 = td_targets - pred_td_targets2
td_errors = tf.concat([td_errors1, td_errors2], axis=0)
common.generate_tensor_summaries('td_errors', td_errors,
self.train_step_counter)
common.generate_tensor_summaries('td_targets', td_targets,
self.train_step_counter)
common.generate_tensor_summaries('pred_td_targets1', pred_td_targets1,
self.train_step_counter)
common.generate_tensor_summaries('pred_td_targets2', pred_td_targets2,
self.train_step_counter)
def _actor_loss_debug_summaries(self, actor_loss, actions, log_pi,
target_q_values, time_steps):
if self._debug_summaries:
common.generate_tensor_summaries('actor_loss', actor_loss,
self.train_step_counter)
try:
for name, action in nest_utils.flatten_with_joined_paths(actions):
common.generate_tensor_summaries(name, action,
self.train_step_counter)
except ValueError:
pass # Guard against internal SAC variants that do not directly
# generate actions.
common.generate_tensor_summaries('log_pi', log_pi,
self.train_step_counter)
tf.compat.v2.summary.scalar(
name='entropy_avg',
data=-tf.reduce_mean(input_tensor=log_pi),
step=self.train_step_counter)
common.generate_tensor_summaries('target_q_values', target_q_values,
self.train_step_counter)
batch_size = nest_utils.get_outer_shape(time_steps,
self._time_step_spec)[0]
policy_state = self._train_policy.get_initial_state(batch_size)
action_distribution = self._train_policy.distribution(
time_steps, policy_state).action
if isinstance(action_distribution, tfp.distributions.Normal):
common.generate_tensor_summaries('act_mean', action_distribution.loc,
self.train_step_counter)
common.generate_tensor_summaries('act_stddev',
action_distribution.scale,
self.train_step_counter)
elif isinstance(action_distribution, tfp.distributions.Categorical):
common.generate_tensor_summaries('act_mode', action_distribution.mode(),
self.train_step_counter)
try:
for name, action_dist in nest_utils.flatten_with_joined_paths(
action_distribution):
common.generate_tensor_summaries('entropy_' + name,
action_dist.entropy(),
self.train_step_counter)
except NotImplementedError:
pass # Some distributions do not have an analytic entropy.
def _alpha_loss_debug_summaries(self, alpha_loss, entropy_diff):
if self._debug_summaries:
common.generate_tensor_summaries('alpha_loss', alpha_loss,
self.train_step_counter)
common.generate_tensor_summaries('entropy_diff', entropy_diff,
self.train_step_counter)
tf.compat.v2.summary.scalar(
name='log_alpha', data=self._log_alpha, step=self.train_step_counter)
|
[
1,
396,
14137,
29922,
9420,
29899,
29947,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29900,
450,
323,
29943,
29899,
14769,
1237,
13189,
943,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
2045,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
29937,
365,
524,
408,
29901,
3017,
29906,
29892,
3017,
29941,
13,
15945,
29908,
29909,
1105,
615,
319,
2801,
29899,
29907,
768,
293,
28330,
29889,
13,
13,
1888,
9711,
278,
1105,
615,
319,
2801,
29899,
29907,
768,
293,
313,
29903,
2477,
29897,
5687,
515,
13,
29908,
6295,
615,
319,
2801,
29899,
29907,
768,
293,
11545,
12404,
322,
2401,
5795,
29908,
491,
379,
4025,
1217,
1764,
634,
394,
313,
29906,
29900,
29896,
29929,
467,
13,
15945,
29908,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
5215,
16250,
13,
3166,
19229,
1053,
8251,
519,
29892,
28379,
29892,
3992,
13,
13,
5215,
330,
262,
13,
5215,
12655,
408,
7442,
13,
3166,
4832,
29889,
13529,
267,
1053,
14319,
13,
5215,
26110,
408,
15886,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
29887,
29899,
4548,
4019,
29899,
29056,
29899,
3259,
29899,
5215,
13,
5215,
26110,
29918,
22795,
3097,
408,
15886,
29886,
13,
13,
3166,
15886,
29918,
351,
1237,
29889,
351,
1237,
1053,
848,
29918,
535,
13549,
13,
3166,
15886,
29918,
351,
1237,
29889,
351,
1237,
1053,
15886,
29918,
14748,
13,
3166,
15886,
29918,
351,
1237,
29889,
11618,
29879,
1053,
3564,
13,
3166,
15886,
29918,
351,
1237,
29889,
3733,
293,
583,
1053,
11339,
29918,
22197,
13,
3166,
15886,
29918,
351,
1237,
29889,
3733,
293,
583,
1053,
15886,
29918,
22197,
13,
3166,
15886,
29918,
351,
1237,
29889,
3018,
622,
3842,
1053,
931,
29918,
10568,
408,
18696,
13,
3166,
15886,
29918,
351,
1237,
29889,
1017,
15702,
1053,
4072,
13,
3166,
15886,
29918,
351,
1237,
29889,
13239,
1053,
3619,
13,
3166,
15886,
29918,
351,
1237,
29889,
13239,
1053,
19888,
29918,
13239,
13,
3166,
15886,
29918,
351,
1237,
29889,
13239,
1053,
17763,
29918,
13239,
13,
3166,
15886,
29918,
351,
1237,
29889,
13239,
1053,
1203,
29918,
22350,
13,
13,
13,
29903,
562,
29931,
2209,
3401,
353,
16250,
29889,
17514,
23583,
29898,
13,
1678,
525,
29903,
562,
29931,
2209,
3401,
742,
6702,
9695,
293,
29918,
6758,
742,
525,
7168,
29918,
6758,
742,
525,
2312,
29918,
6758,
8785,
13,
13,
13,
29937,
14402,
29898,
29890,
29914,
29896,
29946,
29947,
29947,
29947,
29929,
29946,
29953,
29941,
1125,
16460,
403,
3659,
29918,
24049,
29918,
9067,
13,
29992,
5359,
29889,
2917,
21115,
13,
1753,
3659,
29918,
24049,
29918,
9067,
29898,
4172,
3359,
29879,
29901,
4072,
29889,
29940,
2868,
29911,
6073,
29897,
1599,
4072,
29889,
29940,
2868,
29911,
6073,
29901,
13,
29871,
3659,
3359,
29879,
353,
15886,
29889,
17510,
29889,
1958,
29918,
23905,
29898,
2892,
260,
29901,
15886,
29889,
24049,
29918,
1609,
29918,
1767,
29898,
29873,
29892,
448,
29906,
29900,
29892,
29871,
29906,
511,
13,
462,
462,
29871,
3659,
3359,
29879,
29897,
13,
29871,
736,
15886,
29889,
4548,
29898,
4172,
3359,
29879,
29897,
13,
13,
13,
29992,
5359,
29889,
2917,
21115,
13,
1990,
15573,
19661,
29898,
13264,
29918,
14748,
29889,
29911,
4519,
5362,
1125,
13,
29871,
9995,
29909,
317,
2477,
28330,
1213,
15945,
13,
13,
29871,
822,
4770,
2344,
12035,
1311,
29892,
13,
1669,
931,
29918,
10568,
29918,
6550,
29901,
18696,
29889,
2481,
14448,
29892,
13,
1669,
3158,
29918,
6550,
29901,
4072,
29889,
29940,
2868,
29911,
6073,
10299,
29892,
13,
1669,
11164,
29918,
11618,
29901,
3564,
29889,
13724,
29892,
13,
1669,
11339,
29918,
11618,
29901,
3564,
29889,
13724,
29892,
13,
1669,
11339,
29918,
20640,
3950,
29901,
4072,
29889,
20624,
326,
3950,
29892,
13,
1669,
11164,
29918,
20640,
3950,
29901,
4072,
29889,
20624,
326,
3950,
29892,
13,
1669,
15595,
29918,
20640,
3950,
29901,
4072,
29889,
20624,
326,
3950,
29892,
13,
1669,
11339,
29918,
6758,
29918,
7915,
29901,
4072,
29889,
11031,
353,
29871,
29896,
29889,
29900,
29892,
13,
1669,
11164,
29918,
6758,
29918,
7915,
29901,
4072,
29889,
11031,
353,
29871,
29900,
29889,
29945,
29892,
13,
1669,
15595,
29918,
6758,
29918,
7915,
29901,
4072,
29889,
11031,
353,
29871,
29896,
29889,
29900,
29892,
13,
1669,
11339,
29918,
22197,
29918,
2801,
29901,
8251,
519,
29961,
13,
462,
259,
2023,
29892,
15886,
29918,
22197,
29889,
8969,
15644,
29962,
353,
11339,
29918,
22197,
29889,
29909,
2801,
15644,
29892,
13,
1669,
11164,
29918,
11618,
29918,
29906,
29901,
28379,
29961,
11618,
29889,
13724,
29962,
353,
6213,
29892,
13,
1669,
3646,
29918,
9695,
293,
29918,
11618,
29901,
28379,
29961,
11618,
29889,
13724,
29962,
353,
6213,
29892,
13,
1669,
3646,
29918,
9695,
293,
29918,
11618,
29918,
29906,
29901,
28379,
29961,
11618,
29889,
13724,
29962,
353,
6213,
29892,
13,
1669,
3646,
29918,
5504,
29918,
4722,
29901,
4072,
29889,
11031,
353,
29871,
29896,
29889,
29900,
29892,
13,
1669,
3646,
29918,
5504,
29918,
19145,
29901,
4072,
29889,
2928,
353,
29871,
29896,
29892,
13,
1669,
22599,
29918,
12523,
29918,
6758,
29918,
9144,
29901,
4072,
29889,
29931,
2209,
29137,
353,
15886,
29889,
755,
29889,
26613,
1965,
29918,
29881,
17678,
29892,
13,
1669,
330,
2735,
29901,
4072,
29889,
11031,
353,
29871,
29896,
29889,
29900,
29892,
13,
1669,
20751,
29918,
7052,
29918,
19790,
29901,
4072,
29889,
11031,
353,
29871,
29896,
29889,
29900,
29892,
13,
1669,
2847,
29918,
1188,
29918,
2312,
29901,
4072,
29889,
11031,
353,
29871,
29900,
29889,
29900,
29892,
13,
1669,
671,
29918,
1188,
29918,
2312,
29918,
262,
29918,
2312,
29918,
6758,
29901,
6120,
353,
5852,
29892,
13,
1669,
3646,
29918,
296,
14441,
29901,
28379,
29961,
8768,
29889,
11031,
29962,
353,
6213,
29892,
13,
1669,
16030,
29918,
11303,
3262,
29901,
28379,
29961,
8768,
29889,
11031,
29962,
353,
6213,
29892,
13,
1669,
4744,
29918,
2083,
3034,
583,
29901,
6120,
353,
7700,
29892,
13,
1669,
19138,
675,
29918,
5105,
29879,
29918,
392,
29918,
16908,
29901,
6120,
353,
7700,
29892,
13,
1669,
7945,
29918,
10568,
29918,
11808,
29901,
28379,
29961,
13264,
29889,
16174,
29962,
353,
6213,
29892,
13,
1669,
1024,
29901,
28379,
29961,
1626,
29962,
353,
6213,
1125,
13,
1678,
9995,
9832,
1078,
263,
317,
2477,
28330,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
418,
931,
29918,
10568,
29918,
6550,
29901,
319,
421,
2481,
14448,
29952,
1580,
310,
278,
3806,
931,
29918,
24530,
29889,
13,
418,
3158,
29918,
6550,
29901,
319,
17763,
310,
350,
7261,
29911,
6073,
10299,
15783,
278,
8820,
29889,
13,
418,
11164,
29918,
11618,
29901,
319,
740,
11164,
29918,
11618,
3552,
26739,
800,
29892,
8820,
876,
393,
13,
4706,
3639,
278,
3855,
29918,
5975,
363,
1269,
15500,
322,
3158,
29889,
13,
418,
11339,
29918,
11618,
29901,
319,
740,
11339,
29918,
11618,
29898,
26739,
362,
29892,
3158,
29918,
6550,
29897,
393,
13,
4706,
3639,
3158,
4978,
29889,
13,
418,
11339,
29918,
20640,
3950,
29901,
450,
5994,
3950,
304,
671,
363,
278,
11339,
3564,
29889,
13,
418,
11164,
29918,
20640,
3950,
29901,
450,
2322,
5994,
3950,
304,
671,
363,
278,
11164,
3564,
29889,
13,
418,
15595,
29918,
20640,
3950,
29901,
450,
2322,
5994,
3950,
304,
671,
363,
278,
15595,
2286,
29889,
13,
418,
11339,
29918,
6758,
29918,
7915,
29901,
450,
7688,
373,
11339,
6410,
29889,
13,
418,
11164,
29918,
6758,
29918,
7915,
29901,
450,
7688,
373,
11164,
6410,
29889,
13,
418,
15595,
29918,
6758,
29918,
7915,
29901,
450,
7688,
373,
15595,
6410,
29889,
13,
418,
11339,
29918,
22197,
29918,
2801,
29901,
450,
8898,
770,
304,
671,
29889,
13,
418,
11164,
29918,
11618,
29918,
29906,
29901,
313,
27636,
1846,
29871,
319,
421,
13264,
29918,
351,
1237,
29889,
11618,
29889,
13724,
29952,
304,
367,
1304,
408,
13,
4706,
278,
1473,
11164,
3564,
2645,
660,
6509,
29889,
29871,
450,
18177,
515,
13,
4706,
421,
9695,
293,
29918,
11618,
29952,
526,
13746,
565,
445,
338,
451,
4944,
29889,
13,
418,
3646,
29918,
9695,
293,
29918,
11618,
29901,
313,
27636,
1846,
29871,
319,
421,
13264,
29918,
351,
1237,
29889,
11618,
29889,
13724,
29952,
304,
367,
13,
4706,
1304,
408,
278,
3646,
11164,
3564,
2645,
660,
6509,
29889,
7569,
13,
4706,
421,
5182,
29918,
5504,
29918,
19145,
29952,
7945,
6576,
29892,
278,
18177,
515,
421,
9695,
293,
29918,
11618,
29952,
13,
4706,
526,
13746,
313,
28802,
14981,
411,
3844,
29877,
6046,
3025,
421,
5182,
29918,
5504,
29918,
4722,
6348,
304,
421,
13,
4706,
3646,
29918,
9695,
293,
29918,
11618,
1412,
29871,
960,
421,
5182,
29918,
9695,
293,
29918,
11618,
29952,
338,
451,
4944,
29892,
372,
13,
4706,
338,
2825,
491,
3907,
263,
3509,
310,
421,
9695,
293,
29918,
11618,
1673,
607,
2847,
7093,
263,
716,
13,
4706,
3564,
411,
278,
1021,
3829,
322,
967,
1914,
15359,
322,
18177,
29889,
13,
4706,
27313,
292,
263,
421,
13724,
29889,
8552,
29952,
947,
451,
664,
746,
278,
3564,
2777,
13,
4706,
2307,
756,
7945,
519,
4128,
313,
29872,
29889,
29887,
1696,
756,
2307,
1063,
4240,
29892,
470,
746,
13,
4706,
278,
3564,
338,
19383,
15359,
411,
1790,
467,
29871,
512,
1438,
4251,
29892,
372,
338,
701,
13,
4706,
304,
366,
304,
2048,
263,
3509,
2534,
18177,
393,
526,
451,
7258,
411,
278,
13,
4706,
2441,
421,
9695,
293,
29918,
11618,
1673,
577,
393,
445,
508,
367,
1304,
408,
263,
3646,
3564,
29889,
13,
4706,
960,
366,
3867,
263,
421,
5182,
29918,
9695,
293,
29918,
11618,
29952,
393,
29358,
738,
18177,
411,
13,
4706,
421,
9695,
293,
29918,
11618,
1673,
263,
9177,
674,
367,
13817,
541,
694,
3682,
338,
12005,
29889,
13,
418,
3646,
29918,
9695,
293,
29918,
11618,
29918,
29906,
29901,
313,
27636,
1846,
13999,
3564,
408,
13,
4706,
3646,
29918,
9695,
293,
29918,
11618,
541,
363,
278,
11164,
29918,
11618,
29918,
29906,
29889,
2823,
5106,
13,
4706,
363,
3646,
29918,
9695,
293,
29918,
11618,
29889,
2811,
871,
367,
1304,
565,
525,
9695,
293,
29918,
11618,
29918,
29906,
29915,
338,
13,
4706,
884,
6790,
29889,
13,
418,
3646,
29918,
5504,
29918,
4722,
29901,
383,
7168,
363,
4964,
2767,
310,
278,
3646,
14379,
29889,
13,
418,
3646,
29918,
5504,
29918,
19145,
29901,
29498,
363,
4964,
2767,
310,
278,
3646,
14379,
29889,
13,
418,
22599,
29918,
12523,
29918,
6758,
29918,
9144,
29901,
29871,
319,
740,
363,
20602,
278,
1543,
3538,
323,
29928,
4436,
13,
4706,
6410,
29889,
13,
418,
330,
2735,
29901,
319,
2313,
792,
7329,
363,
5434,
337,
2935,
29889,
13,
418,
20751,
29918,
7052,
29918,
19790,
29901,
9683,
666,
506,
1230,
6287,
363,
278,
20751,
29889,
13,
418,
2847,
29918,
1188,
29918,
2312,
29901,
17250,
995,
363,
1480,
29918,
2312,
29889,
13,
418,
671,
29918,
1188,
29918,
2312,
29918,
262,
29918,
2312,
29918,
6758,
29901,
319,
7223,
29892,
3692,
773,
1480,
29918,
2312,
470,
15595,
13,
4706,
297,
15595,
6410,
29889,
315,
13946,
20240,
310,
317,
2477,
671,
1480,
29918,
2312,
408,
1480,
13,
4706,
1819,
526,
6892,
16588,
261,
304,
664,
411,
29889,
13,
418,
3646,
29918,
296,
14441,
29901,
450,
3646,
6588,
8898,
24687,
29892,
363,
13271,
15595,
29889,
450,
13,
4706,
2322,
995,
338,
8178,
310,
278,
3001,
1353,
310,
8820,
29889,
13,
418,
16030,
29918,
11303,
3262,
29901,
5655,
3309,
304,
20102,
4656,
10070,
29889,
13,
418,
4744,
29918,
2083,
3034,
583,
29901,
319,
6120,
304,
11705,
4744,
19138,
583,
29889,
13,
418,
19138,
675,
29918,
5105,
29879,
29918,
392,
29918,
16908,
29901,
960,
5852,
29892,
16030,
322,
3564,
2286,
19138,
583,
13,
4706,
674,
367,
3971,
2645,
6694,
29889,
13,
418,
7945,
29918,
10568,
29918,
11808,
29901,
530,
13136,
6795,
304,
11924,
1432,
931,
278,
7945,
13,
4706,
1015,
338,
1065,
29889,
29871,
13109,
29879,
304,
278,
5534,
29918,
10568,
29889,
13,
418,
1024,
29901,
450,
1024,
310,
445,
10823,
29889,
2178,
3651,
297,
445,
3883,
674,
6416,
1090,
13,
4706,
393,
1024,
29889,
13109,
29879,
304,
278,
770,
1024,
29889,
13,
1678,
9995,
13,
1678,
15886,
29889,
7355,
17255,
2344,
12035,
1311,
29892,
1024,
29922,
978,
29897,
13,
13,
1678,
1583,
3032,
3198,
29918,
2467,
29918,
6550,
29898,
2467,
29918,
6550,
29897,
13,
13,
1678,
7787,
29918,
26739,
362,
29918,
6550,
353,
931,
29918,
10568,
29918,
6550,
29889,
26739,
362,
13,
1678,
11164,
29918,
6550,
353,
313,
1212,
29918,
26739,
362,
29918,
6550,
29892,
3158,
29918,
6550,
29897,
13,
13,
1678,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29896,
353,
11164,
29918,
11618,
13,
13,
1678,
565,
11164,
29918,
11618,
29918,
29906,
338,
451,
6213,
29901,
13,
418,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
353,
11164,
29918,
11618,
29918,
29906,
13,
1678,
1683,
29901,
13,
418,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
353,
11164,
29918,
11618,
29889,
8552,
29898,
978,
2433,
29907,
768,
293,
13724,
29906,
1495,
13,
418,
396,
1938,
451,
671,
3646,
29918,
9695,
293,
29918,
11618,
29918,
29906,
565,
11164,
29918,
11618,
29918,
29906,
338,
6213,
29889,
13,
418,
3646,
29918,
9695,
293,
29918,
11618,
29918,
29906,
353,
6213,
13,
13,
1678,
396,
20340,
2745,
11164,
29918,
11618,
29918,
29906,
756,
1063,
13746,
515,
11164,
29918,
11618,
29918,
29896,
1434,
13,
1678,
396,
4969,
3651,
373,
1716,
29889,
13,
1678,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29896,
29889,
3258,
29918,
20897,
29898,
9695,
293,
29918,
6550,
29897,
13,
1678,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
29889,
3258,
29918,
20897,
29898,
9695,
293,
29918,
6550,
29897,
13,
13,
1678,
565,
3646,
29918,
9695,
293,
29918,
11618,
29901,
13,
418,
3646,
29918,
9695,
293,
29918,
11618,
29889,
3258,
29918,
20897,
29898,
9695,
293,
29918,
6550,
29897,
13,
13,
1678,
1583,
3032,
5182,
29918,
9695,
293,
29918,
11618,
29918,
29896,
353,
313,
13,
4706,
3619,
29889,
26026,
29918,
8552,
29918,
5182,
29918,
11618,
29918,
2541,
29918,
3198,
29879,
29898,
13,
9651,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29896,
29892,
13,
9651,
3646,
29918,
9695,
293,
29918,
11618,
29892,
13,
9651,
1881,
29918,
6550,
29922,
9695,
293,
29918,
6550,
29892,
13,
9651,
1024,
2433,
8667,
29907,
768,
293,
13724,
29896,
8785,
13,
13,
1678,
565,
3646,
29918,
9695,
293,
29918,
11618,
29918,
29906,
29901,
13,
418,
3646,
29918,
9695,
293,
29918,
11618,
29918,
29906,
29889,
3258,
29918,
20897,
29898,
9695,
293,
29918,
6550,
29897,
13,
1678,
1583,
3032,
5182,
29918,
9695,
293,
29918,
11618,
29918,
29906,
353,
313,
13,
4706,
3619,
29889,
26026,
29918,
8552,
29918,
5182,
29918,
11618,
29918,
2541,
29918,
3198,
29879,
29898,
13,
9651,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
29892,
13,
9651,
3646,
29918,
9695,
293,
29918,
11618,
29918,
29906,
29892,
13,
9651,
1881,
29918,
6550,
29922,
9695,
293,
29918,
6550,
29892,
13,
9651,
1024,
2433,
8667,
29907,
768,
293,
13724,
29906,
8785,
13,
13,
1678,
565,
11339,
29918,
11618,
29901,
13,
418,
11339,
29918,
11618,
29889,
3258,
29918,
20897,
29898,
1212,
29918,
26739,
362,
29918,
6550,
29897,
13,
1678,
1583,
3032,
7168,
29918,
11618,
353,
11339,
29918,
11618,
13,
13,
1678,
8898,
353,
11339,
29918,
22197,
29918,
2801,
29898,
13,
4706,
931,
29918,
10568,
29918,
6550,
29922,
2230,
29918,
10568,
29918,
6550,
29892,
13,
4706,
3158,
29918,
6550,
29922,
2467,
29918,
6550,
29892,
13,
4706,
11339,
29918,
11618,
29922,
1311,
3032,
7168,
29918,
11618,
29892,
13,
4706,
6694,
29922,
8824,
29897,
13,
13,
1678,
1583,
3032,
14968,
29918,
22197,
353,
11339,
29918,
22197,
29918,
2801,
29898,
13,
4706,
931,
29918,
10568,
29918,
6550,
29922,
2230,
29918,
10568,
29918,
6550,
29892,
13,
4706,
3158,
29918,
6550,
29922,
2467,
29918,
6550,
29892,
13,
4706,
11339,
29918,
11618,
29922,
1311,
3032,
7168,
29918,
11618,
29892,
13,
4706,
6694,
29922,
5574,
29897,
13,
13,
1678,
1583,
3032,
1188,
29918,
2312,
353,
3619,
29889,
3258,
29918,
11918,
29898,
13,
4706,
525,
11228,
29918,
1188,
29918,
2312,
742,
13,
4706,
2847,
29918,
1767,
29922,
11228,
29918,
1188,
29918,
2312,
29892,
13,
4706,
26688,
29922,
13264,
29889,
7411,
29941,
29906,
29892,
13,
4706,
7945,
519,
29922,
5574,
29897,
13,
13,
1678,
565,
3646,
29918,
296,
14441,
338,
6213,
29901,
13,
418,
3646,
29918,
296,
14441,
353,
1583,
3032,
657,
29918,
4381,
29918,
5182,
29918,
296,
14441,
29898,
2467,
29918,
6550,
29897,
13,
13,
1678,
1583,
3032,
1509,
29918,
1188,
29918,
2312,
29918,
262,
29918,
2312,
29918,
6758,
353,
671,
29918,
1188,
29918,
2312,
29918,
262,
29918,
2312,
29918,
6758,
13,
1678,
1583,
3032,
5182,
29918,
5504,
29918,
4722,
353,
3646,
29918,
5504,
29918,
4722,
13,
1678,
1583,
3032,
5182,
29918,
5504,
29918,
19145,
353,
3646,
29918,
5504,
29918,
19145,
13,
1678,
1583,
3032,
7168,
29918,
20640,
3950,
353,
11339,
29918,
20640,
3950,
13,
1678,
1583,
3032,
9695,
293,
29918,
20640,
3950,
353,
11164,
29918,
20640,
3950,
13,
1678,
1583,
3032,
2312,
29918,
20640,
3950,
353,
15595,
29918,
20640,
3950,
13,
1678,
1583,
3032,
7168,
29918,
6758,
29918,
7915,
353,
11339,
29918,
6758,
29918,
7915,
13,
1678,
1583,
3032,
9695,
293,
29918,
6758,
29918,
7915,
353,
11164,
29918,
6758,
29918,
7915,
13,
1678,
1583,
3032,
2312,
29918,
6758,
29918,
7915,
353,
15595,
29918,
6758,
29918,
7915,
13,
1678,
1583,
3032,
1594,
29918,
12523,
29918,
6758,
29918,
9144,
353,
22599,
29918,
12523,
29918,
6758,
29918,
9144,
13,
1678,
1583,
3032,
4283,
353,
330,
2735,
13,
1678,
1583,
3032,
276,
1328,
29918,
7052,
29918,
19790,
353,
20751,
29918,
7052,
29918,
19790,
13,
1678,
1583,
3032,
5182,
29918,
296,
14441,
353,
3646,
29918,
296,
14441,
13,
1678,
1583,
3032,
24970,
29918,
11303,
3262,
353,
16030,
29918,
11303,
3262,
13,
1678,
1583,
3032,
8382,
29918,
2083,
3034,
583,
353,
4744,
29918,
2083,
3034,
583,
13,
1678,
1583,
3032,
2083,
3034,
675,
29918,
5105,
29879,
29918,
392,
29918,
16908,
353,
19138,
675,
29918,
5105,
29879,
29918,
392,
29918,
16908,
13,
1678,
1583,
3032,
5504,
29918,
5182,
353,
1583,
3032,
657,
29918,
5182,
29918,
786,
29881,
1008,
29898,
13,
4706,
260,
585,
29922,
1311,
3032,
5182,
29918,
5504,
29918,
4722,
29892,
3785,
29922,
1311,
3032,
5182,
29918,
5504,
29918,
19145,
29897,
13,
13,
1678,
7945,
29918,
16506,
29918,
2848,
353,
29871,
29906,
565,
451,
11164,
29918,
11618,
29889,
3859,
29918,
6550,
1683,
6213,
13,
13,
1678,
2428,
29898,
29903,
562,
19661,
29892,
1583,
467,
1649,
2344,
12035,
13,
4706,
931,
29918,
10568,
29918,
6550,
29892,
13,
4706,
3158,
29918,
6550,
29892,
13,
4706,
8898,
29922,
22197,
29892,
13,
4706,
6314,
29918,
22197,
29922,
22197,
29892,
13,
4706,
7945,
29918,
16506,
29918,
2848,
29922,
14968,
29918,
16506,
29918,
2848,
29892,
13,
4706,
4744,
29918,
2083,
3034,
583,
29922,
8382,
29918,
2083,
3034,
583,
29892,
13,
4706,
19138,
675,
29918,
5105,
29879,
29918,
392,
29918,
16908,
29922,
2083,
3034,
675,
29918,
5105,
29879,
29918,
392,
29918,
16908,
29892,
13,
4706,
7945,
29918,
10568,
29918,
11808,
29922,
14968,
29918,
10568,
29918,
11808,
29892,
13,
1678,
1723,
13,
13,
1678,
1583,
3032,
294,
29918,
20543,
353,
848,
29918,
535,
13549,
29889,
2887,
4300,
654,
29898,
13,
4706,
1583,
29889,
1272,
29918,
4703,
29892,
269,
802,
29872,
911,
29918,
2230,
29918,
6229,
7607,
14968,
29918,
16506,
29918,
2848,
1275,
29871,
29906,
876,
13,
13,
29871,
822,
903,
3198,
29918,
2467,
29918,
6550,
29898,
1311,
29892,
3158,
29918,
6550,
1125,
13,
1678,
12151,
29918,
2467,
29918,
6550,
353,
15886,
29889,
17510,
29889,
1579,
8606,
29898,
2467,
29918,
6550,
29897,
13,
1678,
363,
1580,
297,
12151,
29918,
2467,
29918,
6550,
29901,
13,
418,
565,
1580,
29889,
29881,
1853,
29889,
275,
29918,
16031,
29901,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
29898,
13,
9651,
525,
29903,
562,
19661,
947,
451,
5279,
2304,
19554,
8820,
29889,
525,
13,
9651,
525,
4276,
1580,
29901,
6571,
4286,
4830,
29898,
2467,
29918,
6550,
876,
13,
13,
29871,
822,
903,
657,
29918,
4381,
29918,
5182,
29918,
296,
14441,
29898,
1311,
29892,
3158,
29918,
6550,
1125,
13,
1678,
396,
960,
3646,
29918,
296,
14441,
471,
451,
4502,
29892,
731,
372,
304,
448,
6229,
29898,
29909,
6802,
29906,
29889,
29900,
13,
1678,
396,
3940,
393,
278,
2441,
2322,
24687,
3646,
338,
448,
6229,
29898,
29909,
29897,
297,
278,
317,
2477,
5650,
29889,
13,
1678,
396,
2398,
445,
883,
2785,
756,
884,
1063,
1304,
297,
6944,
491,
278,
2441,
13,
1678,
396,
15717,
322,
756,
297,
1749,
7271,
1063,
901,
13714,
363,
330,
962,
29914,
2589,
29926,
6235,
29889,
13,
1678,
12151,
29918,
2467,
29918,
6550,
353,
15886,
29889,
17510,
29889,
1579,
8606,
29898,
2467,
29918,
6550,
29897,
13,
1678,
3646,
29918,
296,
14441,
353,
448,
9302,
29889,
2083,
4197,
13,
4706,
7442,
29889,
4704,
29898,
14369,
29918,
6550,
29889,
12181,
29889,
294,
29918,
1761,
3101,
13,
4706,
363,
2323,
29918,
6550,
297,
12151,
29918,
2467,
29918,
6550,
13,
268,
2314,
847,
29871,
29906,
29889,
29900,
13,
1678,
736,
3646,
29918,
296,
14441,
13,
13,
29871,
822,
903,
24926,
29898,
1311,
1125,
13,
1678,
9995,
11609,
29879,
385,
1015,
304,
11905,
278,
10823,
29889,
13,
13,
1678,
10061,
583,
18177,
515,
278,
660,
14379,
304,
278,
3646,
660,
3564,
29889,
13,
1678,
9995,
13,
1678,
3619,
29889,
2695,
29918,
20897,
29918,
5504,
29898,
13,
4706,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29896,
29889,
20897,
29892,
13,
4706,
1583,
3032,
5182,
29918,
9695,
293,
29918,
11618,
29918,
29896,
29889,
20897,
29892,
13,
4706,
260,
585,
29922,
29896,
29889,
29900,
29897,
13,
1678,
3619,
29889,
2695,
29918,
20897,
29918,
5504,
29898,
13,
4706,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
29889,
20897,
29892,
13,
4706,
1583,
3032,
5182,
29918,
9695,
293,
29918,
11618,
29918,
29906,
29889,
20897,
29892,
13,
4706,
260,
585,
29922,
29896,
29889,
29900,
29897,
13,
13,
29871,
822,
903,
14968,
29898,
1311,
29892,
7271,
29892,
18177,
1125,
13,
1678,
9995,
11609,
29879,
263,
7945,
1015,
304,
2767,
278,
10823,
29915,
29879,
14379,
29889,
13,
13,
1678,
910,
1158,
22983,
411,
278,
4944,
9853,
287,
7271,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
418,
7271,
29901,
319,
931,
29899,
1429,
287,
23324,
706,
1203,
29889,
13,
418,
18177,
29901,
28379,
17336,
470,
1543,
3538,
313,
546,
29899,
16175,
29899,
8269,
29897,
13500,
13,
4706,
18177,
29889,
13,
13,
1678,
16969,
29901,
13,
418,
319,
7945,
29918,
459,
29889,
13,
13,
1678,
390,
1759,
267,
29901,
13,
418,
7865,
2392,
29901,
960,
5994,
19427,
526,
6213,
322,
694,
2322,
995,
471,
4944,
304,
13,
4706,
278,
5823,
29889,
13,
1678,
9995,
13,
1678,
9558,
353,
1583,
3032,
294,
29918,
20543,
29898,
735,
546,
5597,
29897,
13,
1678,
931,
29918,
24530,
29892,
8898,
29918,
24530,
29892,
2446,
29918,
2230,
29918,
24530,
353,
9558,
13,
1678,
8820,
353,
8898,
29918,
24530,
29889,
2467,
13,
13,
1678,
7945,
519,
29918,
9695,
293,
29918,
20897,
353,
1051,
29898,
3318,
29918,
22350,
29889,
2061,
18415,
2697,
29898,
13,
4706,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29896,
29889,
14968,
519,
29918,
20897,
718,
13,
4706,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
29889,
14968,
519,
29918,
20897,
876,
13,
13,
1678,
411,
15886,
29889,
25584,
993,
29911,
4085,
29898,
12344,
29918,
5943,
287,
29918,
20897,
29922,
8824,
29897,
408,
260,
4085,
29901,
13,
418,
4974,
7945,
519,
29918,
9695,
293,
29918,
20897,
29892,
6702,
3782,
7945,
519,
11164,
3651,
304,
525,
13,
462,
462,
3986,
525,
20640,
675,
29889,
1495,
13,
418,
260,
4085,
29889,
12344,
29898,
14968,
519,
29918,
9695,
293,
29918,
20897,
29897,
13,
418,
11164,
29918,
6758,
353,
1583,
3032,
9695,
293,
29918,
6758,
29918,
7915,
29930,
1311,
29889,
9695,
293,
29918,
6758,
29898,
13,
3986,
931,
29918,
24530,
29892,
13,
3986,
8820,
29892,
13,
3986,
2446,
29918,
2230,
29918,
24530,
29892,
13,
3986,
22599,
29918,
12523,
29918,
6758,
29918,
9144,
29922,
1311,
3032,
1594,
29918,
12523,
29918,
6758,
29918,
9144,
29892,
13,
3986,
330,
2735,
29922,
1311,
3032,
4283,
29892,
13,
3986,
20751,
29918,
7052,
29918,
19790,
29922,
1311,
3032,
276,
1328,
29918,
7052,
29918,
19790,
29892,
13,
3986,
18177,
29922,
705,
5861,
29892,
13,
3986,
6694,
29922,
5574,
29897,
13,
13,
1678,
15886,
29889,
8382,
3460,
29889,
3198,
29918,
8058,
1199,
29898,
9695,
293,
29918,
6758,
29892,
525,
29907,
768,
293,
6410,
338,
3041,
470,
23432,
29889,
1495,
13,
1678,
11164,
29918,
5105,
29879,
353,
260,
4085,
29889,
24970,
29898,
9695,
293,
29918,
6758,
29892,
7945,
519,
29918,
9695,
293,
29918,
20897,
29897,
13,
1678,
1583,
3032,
7302,
29918,
5105,
10070,
29898,
9695,
293,
29918,
5105,
29879,
29892,
7945,
519,
29918,
9695,
293,
29918,
20897,
29892,
13,
462,
3986,
1583,
3032,
9695,
293,
29918,
20640,
3950,
29897,
13,
13,
1678,
7945,
519,
29918,
7168,
29918,
20897,
353,
1583,
3032,
7168,
29918,
11618,
29889,
14968,
519,
29918,
20897,
13,
1678,
411,
15886,
29889,
25584,
993,
29911,
4085,
29898,
12344,
29918,
5943,
287,
29918,
20897,
29922,
8824,
29897,
408,
260,
4085,
29901,
13,
418,
4974,
7945,
519,
29918,
7168,
29918,
20897,
29892,
6702,
3782,
7945,
519,
11339,
3651,
304,
525,
13,
462,
462,
308,
525,
20640,
675,
29889,
1495,
13,
418,
260,
4085,
29889,
12344,
29898,
14968,
519,
29918,
7168,
29918,
20897,
29897,
13,
418,
11339,
29918,
6758,
353,
1583,
3032,
7168,
29918,
6758,
29918,
7915,
29930,
1311,
29889,
7168,
29918,
6758,
29898,
13,
3986,
931,
29918,
24530,
29892,
18177,
29922,
705,
5861,
29892,
6694,
29922,
5574,
29897,
13,
1678,
15886,
29889,
8382,
3460,
29889,
3198,
29918,
8058,
1199,
29898,
7168,
29918,
6758,
29892,
525,
29909,
2801,
6410,
338,
3041,
470,
23432,
29889,
1495,
13,
1678,
11339,
29918,
5105,
29879,
353,
260,
4085,
29889,
24970,
29898,
7168,
29918,
6758,
29892,
7945,
519,
29918,
7168,
29918,
20897,
29897,
13,
1678,
1583,
3032,
7302,
29918,
5105,
10070,
29898,
7168,
29918,
5105,
29879,
29892,
7945,
519,
29918,
7168,
29918,
20897,
29892,
13,
462,
3986,
1583,
3032,
7168,
29918,
20640,
3950,
29897,
13,
13,
1678,
15595,
29918,
11918,
353,
518,
1311,
3032,
1188,
29918,
2312,
29962,
13,
1678,
411,
15886,
29889,
25584,
993,
29911,
4085,
29898,
12344,
29918,
5943,
287,
29918,
20897,
29922,
8824,
29897,
408,
260,
4085,
29901,
13,
418,
4974,
15595,
29918,
11918,
29892,
525,
3782,
15595,
2286,
304,
24656,
6169,
13,
418,
260,
4085,
29889,
12344,
29898,
2312,
29918,
11918,
29897,
13,
418,
15595,
29918,
6758,
353,
1583,
3032,
2312,
29918,
6758,
29918,
7915,
334,
1583,
29889,
2312,
29918,
6758,
29898,
13,
3986,
931,
29918,
24530,
29892,
18177,
29922,
705,
5861,
29892,
6694,
29922,
5574,
29897,
13,
1678,
15886,
29889,
8382,
3460,
29889,
3198,
29918,
8058,
1199,
29898,
2312,
29918,
6758,
29892,
525,
28630,
6410,
338,
3041,
470,
23432,
29889,
1495,
13,
1678,
15595,
29918,
5105,
29879,
353,
260,
4085,
29889,
24970,
29898,
2312,
29918,
6758,
29892,
15595,
29918,
11918,
29897,
13,
1678,
1583,
3032,
7302,
29918,
5105,
10070,
29898,
2312,
29918,
5105,
29879,
29892,
15595,
29918,
11918,
29892,
1583,
3032,
2312,
29918,
20640,
3950,
29897,
13,
13,
1678,
411,
15886,
29889,
978,
29918,
6078,
877,
29931,
2209,
267,
29374,
13,
418,
15886,
29889,
12667,
29889,
29894,
29906,
29889,
7727,
29889,
19529,
279,
29898,
13,
3986,
1024,
2433,
9695,
293,
29918,
6758,
742,
848,
29922,
9695,
293,
29918,
6758,
29892,
4331,
29922,
1311,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
15886,
29889,
12667,
29889,
29894,
29906,
29889,
7727,
29889,
19529,
279,
29898,
13,
3986,
1024,
2433,
7168,
29918,
6758,
742,
848,
29922,
7168,
29918,
6758,
29892,
4331,
29922,
1311,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
15886,
29889,
12667,
29889,
29894,
29906,
29889,
7727,
29889,
19529,
279,
29898,
13,
3986,
1024,
2433,
2312,
29918,
6758,
742,
848,
29922,
2312,
29918,
6758,
29892,
4331,
29922,
1311,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
13,
1678,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29889,
16645,
29918,
1202,
29898,
29896,
29897,
13,
1678,
1583,
3032,
5504,
29918,
5182,
580,
13,
13,
1678,
3001,
29918,
6758,
353,
11164,
29918,
6758,
718,
11339,
29918,
6758,
718,
15595,
29918,
6758,
13,
13,
1678,
4805,
353,
15573,
29931,
2209,
3401,
29898,
13,
4706,
11164,
29918,
6758,
29922,
9695,
293,
29918,
6758,
29892,
11339,
29918,
6758,
29922,
7168,
29918,
6758,
29892,
15595,
29918,
6758,
29922,
2312,
29918,
6758,
29897,
13,
13,
1678,
736,
15886,
29918,
14748,
29889,
29931,
2209,
3401,
29898,
6758,
29922,
7827,
29918,
6758,
29892,
4805,
29922,
17833,
29897,
13,
13,
29871,
822,
903,
6758,
29898,
1311,
29892,
13,
9651,
7271,
29901,
4072,
29889,
29940,
2868,
29911,
6073,
29892,
13,
9651,
18177,
29901,
28379,
29961,
8768,
29889,
29911,
6073,
29962,
353,
6213,
29892,
13,
9651,
6694,
29901,
6120,
353,
7700,
1125,
13,
1678,
9995,
11609,
29879,
278,
6410,
310,
278,
4944,
7271,
29889,
13,
13,
1678,
910,
1158,
338,
871,
1304,
472,
1243,
931,
29991,
13,
13,
1678,
826,
3174,
29901,
13,
418,
7271,
29901,
319,
931,
29899,
1429,
287,
23324,
706,
1203,
29889,
13,
418,
18177,
29901,
28379,
17336,
470,
1543,
3538,
313,
546,
29899,
16175,
29899,
8269,
29897,
13500,
13,
4706,
18177,
29889,
13,
418,
6694,
29901,
26460,
445,
6410,
338,
1641,
12833,
408,
760,
310,
6694,
29889,
13,
13,
1678,
16969,
29901,
13,
418,
319,
421,
29931,
2209,
3401,
29952,
6943,
278,
6410,
363,
278,
7271,
29889,
13,
1678,
9995,
13,
1678,
9558,
353,
1583,
3032,
294,
29918,
20543,
29898,
735,
546,
5597,
29897,
13,
1678,
931,
29918,
24530,
29892,
8898,
29918,
24530,
29892,
2446,
29918,
2230,
29918,
24530,
353,
9558,
13,
1678,
8820,
353,
8898,
29918,
24530,
29889,
2467,
13,
1678,
11164,
29918,
6758,
353,
1583,
3032,
9695,
293,
29918,
6758,
29918,
7915,
334,
1583,
29889,
9695,
293,
29918,
6758,
29898,
13,
4706,
931,
29918,
24530,
29892,
13,
4706,
8820,
29892,
13,
4706,
2446,
29918,
2230,
29918,
24530,
29892,
13,
4706,
22599,
29918,
12523,
29918,
6758,
29918,
9144,
29922,
1311,
3032,
1594,
29918,
12523,
29918,
6758,
29918,
9144,
29892,
13,
4706,
330,
2735,
29922,
1311,
3032,
4283,
29892,
13,
4706,
20751,
29918,
7052,
29918,
19790,
29922,
1311,
3032,
276,
1328,
29918,
7052,
29918,
19790,
29892,
13,
4706,
18177,
29922,
705,
5861,
29892,
13,
4706,
6694,
29922,
26495,
29897,
13,
1678,
15886,
29889,
8382,
3460,
29889,
3198,
29918,
8058,
1199,
29898,
9695,
293,
29918,
6758,
29892,
525,
29907,
768,
293,
6410,
338,
3041,
470,
23432,
29889,
1495,
13,
13,
1678,
11339,
29918,
6758,
353,
1583,
3032,
7168,
29918,
6758,
29918,
7915,
334,
1583,
29889,
7168,
29918,
6758,
29898,
13,
4706,
931,
29918,
24530,
29892,
18177,
29922,
705,
5861,
29892,
6694,
29922,
26495,
29897,
13,
1678,
15886,
29889,
8382,
3460,
29889,
3198,
29918,
8058,
1199,
29898,
7168,
29918,
6758,
29892,
525,
29909,
2801,
6410,
338,
3041,
470,
23432,
29889,
1495,
13,
13,
1678,
15595,
29918,
6758,
353,
1583,
3032,
2312,
29918,
6758,
29918,
7915,
334,
1583,
29889,
2312,
29918,
6758,
29898,
13,
4706,
931,
29918,
24530,
29892,
18177,
29922,
705,
5861,
29892,
6694,
29922,
26495,
29897,
13,
1678,
15886,
29889,
8382,
3460,
29889,
3198,
29918,
8058,
1199,
29898,
2312,
29918,
6758,
29892,
525,
28630,
6410,
338,
3041,
470,
23432,
29889,
1495,
13,
13,
1678,
411,
15886,
29889,
978,
29918,
6078,
877,
29931,
2209,
267,
29374,
13,
418,
15886,
29889,
12667,
29889,
29894,
29906,
29889,
7727,
29889,
19529,
279,
29898,
13,
3986,
1024,
2433,
9695,
293,
29918,
6758,
742,
848,
29922,
9695,
293,
29918,
6758,
29892,
4331,
29922,
1311,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
15886,
29889,
12667,
29889,
29894,
29906,
29889,
7727,
29889,
19529,
279,
29898,
13,
3986,
1024,
2433,
7168,
29918,
6758,
742,
848,
29922,
7168,
29918,
6758,
29892,
4331,
29922,
1311,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
15886,
29889,
12667,
29889,
29894,
29906,
29889,
7727,
29889,
19529,
279,
29898,
13,
3986,
1024,
2433,
2312,
29918,
6758,
742,
848,
29922,
2312,
29918,
6758,
29892,
4331,
29922,
1311,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
13,
1678,
3001,
29918,
6758,
353,
11164,
29918,
6758,
718,
11339,
29918,
6758,
718,
15595,
29918,
6758,
13,
13,
1678,
4805,
353,
15573,
29931,
2209,
3401,
29898,
13,
4706,
11164,
29918,
6758,
29922,
9695,
293,
29918,
6758,
29892,
11339,
29918,
6758,
29922,
7168,
29918,
6758,
29892,
15595,
29918,
6758,
29922,
2312,
29918,
6758,
29897,
13,
13,
1678,
736,
15886,
29918,
14748,
29889,
29931,
2209,
3401,
29898,
6758,
29922,
7827,
29918,
6758,
29892,
4805,
29922,
17833,
29897,
13,
13,
29871,
822,
903,
7302,
29918,
5105,
10070,
29898,
1311,
29892,
4656,
10070,
29892,
3651,
29892,
5994,
3950,
1125,
13,
1678,
396,
1051,
29077,
338,
3734,
363,
5132,
29941,
29889,
13,
1678,
4656,
29879,
29918,
392,
29918,
16908,
353,
1051,
29898,
7554,
29898,
5105,
10070,
29892,
3651,
876,
13,
1678,
565,
1583,
3032,
24970,
29918,
11303,
3262,
338,
451,
6213,
29901,
13,
418,
4656,
29879,
29918,
392,
29918,
16908,
353,
19888,
29918,
13239,
29889,
24049,
29918,
24970,
29918,
12324,
29879,
29898,
5105,
29879,
29918,
392,
29918,
16908,
29892,
13,
462,
462,
462,
539,
1583,
3032,
24970,
29918,
11303,
3262,
29897,
13,
13,
1678,
565,
1583,
3032,
2083,
3034,
675,
29918,
5105,
29879,
29918,
392,
29918,
16908,
29901,
13,
418,
19888,
29918,
13239,
29889,
1202,
29918,
20897,
29918,
2083,
3034,
583,
29898,
5105,
29879,
29918,
392,
29918,
16908,
29892,
13,
462,
462,
3986,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
19888,
29918,
13239,
29889,
1202,
29918,
5105,
10070,
29918,
2083,
3034,
583,
29898,
5105,
29879,
29918,
392,
29918,
16908,
29892,
13,
462,
462,
3986,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
13,
1678,
5994,
3950,
29889,
7302,
29918,
5105,
10070,
29898,
5105,
29879,
29918,
392,
29918,
16908,
29897,
13,
13,
29871,
822,
903,
657,
29918,
5182,
29918,
786,
29881,
1008,
29898,
1311,
29892,
260,
585,
29922,
29896,
29889,
29900,
29892,
3785,
29922,
29896,
1125,
13,
1678,
9995,
5894,
9514,
263,
4964,
2767,
310,
278,
3646,
3564,
4128,
29889,
13,
13,
1678,
1152,
1269,
7688,
281,
29918,
29879,
297,
278,
2441,
3564,
29892,
322,
967,
6590,
13,
1678,
7688,
281,
29918,
29873,
297,
278,
3646,
3564,
29892,
263,
4964,
2767,
338,
29901,
13,
1678,
281,
29918,
29873,
353,
313,
29896,
29899,
260,
585,
29897,
921,
281,
29918,
29873,
718,
260,
585,
921,
16904,
13,
13,
1678,
826,
3174,
29901,
13,
418,
260,
585,
29901,
319,
5785,
17336,
297,
518,
29900,
29892,
29871,
29896,
1822,
13109,
421,
4722,
29922,
29896,
29889,
29900,
29952,
2794,
2898,
2767,
29889,
13,
418,
3785,
29901,
16696,
7292,
472,
607,
278,
3646,
3564,
338,
4784,
29889,
13,
13,
1678,
16969,
29901,
13,
418,
319,
1246,
519,
393,
23233,
263,
4964,
2767,
310,
278,
3646,
3564,
4128,
29889,
13,
1678,
9995,
13,
1678,
411,
15886,
29889,
978,
29918,
6078,
877,
5504,
29918,
5182,
29374,
13,
13,
418,
822,
2767,
7295,
13,
4706,
9995,
6422,
3646,
3564,
1213,
15945,
13,
4706,
11164,
29918,
5504,
29918,
29896,
353,
3619,
29889,
2695,
29918,
20897,
29918,
5504,
29898,
13,
9651,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29896,
29889,
20897,
29892,
13,
9651,
1583,
3032,
5182,
29918,
9695,
293,
29918,
11618,
29918,
29896,
29889,
20897,
29892,
13,
9651,
260,
585,
29892,
13,
9651,
260,
585,
29918,
5464,
29918,
14968,
519,
29922,
29896,
29889,
29900,
29897,
13,
13,
4706,
11164,
29918,
29906,
29918,
5504,
29918,
16908,
353,
3619,
29889,
7176,
786,
287,
29918,
11618,
29918,
20897,
29898,
13,
9651,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
29892,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29896,
29897,
13,
13,
4706,
3646,
29918,
9695,
293,
29918,
29906,
29918,
5504,
29918,
16908,
353,
3619,
29889,
7176,
786,
287,
29918,
11618,
29918,
20897,
29898,
13,
9651,
1583,
3032,
5182,
29918,
9695,
293,
29918,
11618,
29918,
29906,
29892,
1583,
3032,
5182,
29918,
9695,
293,
29918,
11618,
29918,
29896,
29897,
13,
13,
4706,
11164,
29918,
5504,
29918,
29906,
353,
3619,
29889,
2695,
29918,
20897,
29918,
5504,
29898,
13,
9651,
11164,
29918,
29906,
29918,
5504,
29918,
16908,
29892,
13,
9651,
3646,
29918,
9695,
293,
29918,
29906,
29918,
5504,
29918,
16908,
29892,
13,
9651,
260,
585,
29892,
13,
9651,
260,
585,
29918,
5464,
29918,
14968,
519,
29922,
29896,
29889,
29900,
29897,
13,
13,
4706,
736,
15886,
29889,
2972,
29898,
9695,
293,
29918,
5504,
29918,
29896,
29892,
11164,
29918,
5504,
29918,
29906,
29897,
13,
13,
418,
736,
3619,
29889,
29853,
1711,
29898,
5504,
29892,
3785,
29892,
525,
5504,
29918,
5182,
29879,
1495,
13,
13,
29871,
822,
903,
7387,
29918,
392,
29918,
1188,
29918,
771,
5824,
29898,
1311,
29892,
931,
29918,
24530,
29892,
6694,
29922,
8824,
1125,
13,
1678,
9995,
2577,
8820,
322,
6590,
1480,
2070,
11614,
515,
8898,
1213,
15945,
13,
1678,
396,
3617,
10650,
3158,
4978,
515,
8898,
29892,
322,
11905,
4768,
622,
943,
1051,
29889,
13,
1678,
9853,
29918,
2311,
353,
17763,
29918,
13239,
29889,
657,
29918,
5561,
29918,
12181,
29898,
2230,
29918,
24530,
29892,
1583,
3032,
2230,
29918,
10568,
29918,
6550,
9601,
29900,
29962,
13,
1678,
8898,
29918,
3859,
353,
1583,
3032,
14968,
29918,
22197,
29889,
657,
29918,
11228,
29918,
3859,
29898,
16175,
29918,
2311,
29897,
13,
1678,
565,
6694,
29901,
13,
418,
3158,
29918,
27691,
353,
1583,
3032,
14968,
29918,
22197,
29889,
27691,
29898,
13,
3986,
931,
29918,
24530,
29892,
8898,
29918,
3859,
29922,
22197,
29918,
3859,
467,
2467,
13,
1678,
1683,
29901,
13,
418,
3158,
29918,
27691,
353,
1583,
3032,
22197,
29889,
27691,
29898,
13,
3986,
931,
29918,
24530,
29892,
8898,
29918,
3859,
29922,
22197,
29918,
3859,
467,
2467,
13,
13,
1678,
396,
21029,
8820,
322,
1480,
29918,
3334,
515,
27615,
4978,
29889,
13,
1678,
8820,
353,
15886,
29889,
17510,
29889,
1958,
29918,
23905,
29898,
2892,
270,
29901,
270,
29889,
11249,
3285,
3158,
29918,
27691,
29897,
13,
1678,
1480,
29918,
1631,
353,
3619,
29889,
1188,
29918,
22795,
3097,
29898,
2467,
29918,
27691,
29892,
8820,
29892,
13,
462,
462,
1678,
1583,
29889,
2467,
29918,
6550,
29897,
13,
13,
1678,
736,
8820,
29892,
1480,
29918,
1631,
13,
13,
29871,
822,
11164,
29918,
6758,
29898,
1311,
29892,
13,
462,
29871,
931,
29918,
24530,
29901,
18696,
29889,
2481,
14448,
29892,
13,
462,
29871,
8820,
29901,
4072,
29889,
29911,
6073,
29892,
13,
462,
29871,
2446,
29918,
2230,
29918,
24530,
29901,
18696,
29889,
2481,
14448,
29892,
13,
462,
29871,
22599,
29918,
12523,
29918,
6758,
29918,
9144,
29901,
4072,
29889,
29931,
2209,
29137,
29892,
13,
462,
29871,
330,
2735,
29901,
4072,
29889,
11031,
353,
29871,
29896,
29889,
29900,
29892,
13,
462,
29871,
20751,
29918,
7052,
29918,
19790,
29901,
4072,
29889,
11031,
353,
29871,
29896,
29889,
29900,
29892,
13,
462,
29871,
18177,
29901,
28379,
29961,
8768,
29889,
29911,
6073,
29962,
353,
6213,
29892,
13,
462,
29871,
6694,
29901,
6120,
353,
7700,
29897,
1599,
4072,
29889,
29911,
6073,
29901,
13,
1678,
9995,
20606,
267,
278,
11164,
6410,
363,
317,
2477,
6694,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
418,
931,
29918,
24530,
29901,
319,
9853,
310,
5335,
4196,
567,
29889,
13,
418,
8820,
29901,
319,
9853,
310,
8820,
29889,
13,
418,
2446,
29918,
2230,
29918,
24530,
29901,
319,
9853,
310,
2446,
5335,
4196,
567,
29889,
13,
418,
22599,
29918,
12523,
29918,
6758,
29918,
9144,
29901,
319,
740,
29898,
1594,
29918,
5182,
29879,
29892,
27303,
29897,
304,
10272,
13,
4706,
1543,
3538,
313,
546,
29899,
16175,
29899,
8269,
29897,
6410,
29889,
13,
418,
330,
2735,
29901,
3295,
2798,
363,
5434,
337,
2935,
29889,
13,
418,
20751,
29918,
7052,
29918,
19790,
29901,
9683,
666,
506,
1230,
7329,
304,
6287,
337,
2935,
29889,
13,
418,
18177,
29901,
28379,
17336,
470,
1543,
3538,
313,
546,
29899,
16175,
29899,
8269,
29897,
13500,
13,
4706,
18177,
29889,
13,
418,
6694,
29901,
26460,
445,
6410,
338,
1641,
1304,
363,
6694,
29889,
13,
13,
1678,
16969,
29901,
13,
418,
11164,
29918,
6758,
29901,
319,
17336,
11164,
6410,
29889,
13,
1678,
9995,
13,
1678,
411,
15886,
29889,
978,
29918,
6078,
877,
9695,
293,
29918,
6758,
29374,
13,
418,
17763,
29918,
13239,
29889,
9294,
29918,
17642,
29918,
23905,
29898,
7387,
29892,
1583,
29889,
2467,
29918,
6550,
29897,
13,
418,
17763,
29918,
13239,
29889,
9294,
29918,
17642,
29918,
23905,
29898,
2230,
29918,
24530,
29892,
1583,
29889,
2230,
29918,
10568,
29918,
6550,
29897,
13,
418,
17763,
29918,
13239,
29889,
9294,
29918,
17642,
29918,
23905,
29898,
4622,
29918,
2230,
29918,
24530,
29892,
1583,
29889,
2230,
29918,
10568,
29918,
6550,
29897,
13,
13,
418,
396,
1334,
437,
451,
2767,
11339,
470,
3646,
14379,
297,
11164,
6410,
29889,
13,
418,
2446,
29918,
7387,
29892,
2446,
29918,
1188,
29918,
3334,
353,
1583,
3032,
7387,
29918,
392,
29918,
1188,
29918,
771,
5824,
29898,
4622,
29918,
2230,
29918,
24530,
29892,
13,
462,
462,
462,
1669,
6694,
29922,
8824,
29897,
13,
418,
3646,
29918,
2080,
353,
313,
4622,
29918,
2230,
29918,
24530,
29889,
26739,
362,
29892,
2446,
29918,
7387,
29897,
13,
418,
3646,
29918,
29939,
29918,
5975,
29896,
29892,
443,
3880,
29918,
11618,
29918,
3859,
29896,
353,
1583,
3032,
5182,
29918,
9695,
293,
29918,
11618,
29918,
29896,
29898,
13,
3986,
3646,
29918,
2080,
29892,
4331,
29918,
1853,
29922,
4622,
29918,
2230,
29918,
24530,
29889,
10568,
29918,
1853,
29892,
6694,
29922,
8824,
29897,
13,
418,
3646,
29918,
29939,
29918,
5975,
29906,
29892,
443,
3880,
29918,
11618,
29918,
3859,
29906,
353,
1583,
3032,
5182,
29918,
9695,
293,
29918,
11618,
29918,
29906,
29898,
13,
3986,
3646,
29918,
2080,
29892,
4331,
29918,
1853,
29922,
4622,
29918,
2230,
29918,
24530,
29889,
10568,
29918,
1853,
29892,
6694,
29922,
8824,
29897,
13,
418,
3646,
29918,
29939,
29918,
5975,
353,
313,
13,
3986,
15886,
29889,
1195,
12539,
29898,
5182,
29918,
29939,
29918,
5975,
29896,
29892,
3646,
29918,
29939,
29918,
5975,
29906,
29897,
448,
13,
3986,
15886,
29889,
4548,
29898,
1311,
3032,
1188,
29918,
2312,
29897,
334,
2446,
29918,
1188,
29918,
3334,
29897,
13,
13,
418,
22599,
29918,
5182,
29879,
353,
15886,
29889,
9847,
29918,
24970,
29898,
13,
3986,
20751,
29918,
7052,
29918,
19790,
334,
2446,
29918,
2230,
29918,
24530,
29889,
276,
1328,
718,
13,
3986,
330,
2735,
334,
2446,
29918,
2230,
29918,
24530,
29889,
2218,
2798,
334,
3646,
29918,
29939,
29918,
5975,
29897,
13,
13,
418,
4450,
29918,
2080,
353,
313,
2230,
29918,
24530,
29889,
26739,
362,
29892,
8820,
29897,
13,
418,
4450,
29918,
1594,
29918,
5182,
29879,
29896,
29892,
903,
353,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29896,
29898,
13,
3986,
4450,
29918,
2080,
29892,
4331,
29918,
1853,
29922,
2230,
29918,
24530,
29889,
10568,
29918,
1853,
29892,
6694,
29922,
26495,
29897,
13,
418,
4450,
29918,
1594,
29918,
5182,
29879,
29906,
29892,
903,
353,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
29898,
13,
3986,
4450,
29918,
2080,
29892,
4331,
29918,
1853,
29922,
2230,
29918,
24530,
29889,
10568,
29918,
1853,
29892,
6694,
29922,
26495,
29897,
13,
418,
11164,
29918,
6758,
29896,
353,
22599,
29918,
12523,
29918,
6758,
29918,
9144,
29898,
1594,
29918,
5182,
29879,
29892,
4450,
29918,
1594,
29918,
5182,
29879,
29896,
29897,
13,
418,
11164,
29918,
6758,
29906,
353,
22599,
29918,
12523,
29918,
6758,
29918,
9144,
29898,
1594,
29918,
5182,
29879,
29892,
4450,
29918,
1594,
29918,
5182,
29879,
29906,
29897,
13,
418,
11164,
29918,
6758,
353,
11164,
29918,
6758,
29896,
718,
11164,
29918,
6758,
29906,
13,
13,
418,
565,
11164,
29918,
6758,
29889,
12181,
29889,
10003,
1405,
29871,
29896,
29901,
13,
4706,
396,
6991,
975,
278,
931,
9927,
29889,
13,
4706,
11164,
29918,
6758,
353,
15886,
29889,
17469,
29918,
2083,
29898,
13,
9651,
11164,
29918,
6758,
29892,
9685,
29922,
3881,
29898,
29896,
29892,
11164,
29918,
6758,
29889,
12181,
29889,
10003,
876,
13,
13,
418,
946,
29887,
29918,
6758,
353,
3619,
29889,
26193,
403,
29918,
6758,
267,
29898,
13,
3986,
639,
29918,
4773,
29918,
6758,
29922,
9695,
293,
29918,
6758,
29892,
13,
3986,
4559,
29918,
7915,
29922,
705,
5861,
29892,
13,
3986,
4943,
2133,
29918,
6758,
7607,
1311,
3032,
9695,
293,
29918,
11618,
29918,
29896,
29889,
6758,
267,
718,
13,
462,
1669,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
29889,
6758,
267,
876,
13,
418,
11164,
29918,
6758,
353,
946,
29887,
29918,
6758,
29889,
7827,
29918,
6758,
13,
13,
418,
1583,
3032,
9695,
293,
29918,
6758,
29918,
8382,
29918,
2083,
3034,
583,
29898,
1594,
29918,
5182,
29879,
29892,
4450,
29918,
1594,
29918,
5182,
29879,
29896,
29892,
13,
462,
462,
4706,
4450,
29918,
1594,
29918,
5182,
29879,
29906,
29897,
13,
13,
418,
736,
11164,
29918,
6758,
13,
13,
29871,
822,
11339,
29918,
6758,
29898,
1311,
29892,
13,
462,
931,
29918,
24530,
29901,
18696,
29889,
2481,
14448,
29892,
13,
462,
18177,
29901,
28379,
29961,
8768,
29889,
29911,
6073,
29962,
353,
6213,
29892,
13,
462,
6694,
29901,
28379,
29961,
11227,
29962,
353,
5852,
29897,
1599,
4072,
29889,
29911,
6073,
29901,
13,
1678,
9995,
20606,
267,
278,
11339,
29918,
6758,
363,
317,
2477,
6694,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
418,
931,
29918,
24530,
29901,
319,
9853,
310,
5335,
4196,
567,
29889,
13,
418,
18177,
29901,
28379,
17336,
470,
1543,
3538,
313,
546,
29899,
16175,
29899,
8269,
29897,
13500,
13,
4706,
18177,
29889,
13,
418,
6694,
29901,
26460,
6694,
881,
367,
7436,
29889,
13,
13,
1678,
16969,
29901,
13,
418,
11339,
29918,
6758,
29901,
319,
17336,
11339,
6410,
29889,
13,
1678,
9995,
13,
1678,
411,
15886,
29889,
978,
29918,
6078,
877,
7168,
29918,
6758,
29374,
13,
418,
17763,
29918,
13239,
29889,
9294,
29918,
17642,
29918,
23905,
29898,
2230,
29918,
24530,
29892,
1583,
29889,
2230,
29918,
10568,
29918,
6550,
29897,
13,
13,
418,
8820,
29892,
1480,
29918,
1631,
353,
1583,
3032,
7387,
29918,
392,
29918,
1188,
29918,
771,
5824,
29898,
2230,
29918,
24530,
29892,
13,
462,
462,
462,
1678,
6694,
29922,
26495,
29897,
13,
418,
3646,
29918,
2080,
353,
313,
2230,
29918,
24530,
29889,
26739,
362,
29892,
8820,
29897,
13,
418,
396,
1334,
437,
451,
2767,
11164,
2645,
11339,
6410,
29889,
13,
418,
3646,
29918,
29939,
29918,
5975,
29896,
29892,
903,
353,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29896,
29898,
13,
3986,
3646,
29918,
2080,
29892,
4331,
29918,
1853,
29922,
2230,
29918,
24530,
29889,
10568,
29918,
1853,
29892,
6694,
29922,
8824,
29897,
13,
418,
3646,
29918,
29939,
29918,
5975,
29906,
29892,
903,
353,
1583,
3032,
9695,
293,
29918,
11618,
29918,
29906,
29898,
13,
3986,
3646,
29918,
2080,
29892,
4331,
29918,
1853,
29922,
2230,
29918,
24530,
29889,
10568,
29918,
1853,
29892,
6694,
29922,
8824,
29897,
13,
418,
3646,
29918,
29939,
29918,
5975,
353,
15886,
29889,
1195,
12539,
29898,
5182,
29918,
29939,
29918,
5975,
29896,
29892,
3646,
29918,
29939,
29918,
5975,
29906,
29897,
13,
418,
11339,
29918,
6758,
353,
15886,
29889,
4548,
29898,
1311,
3032,
1188,
29918,
2312,
29897,
334,
1480,
29918,
1631,
448,
3646,
29918,
29939,
29918,
5975,
13,
418,
565,
11339,
29918,
6758,
29889,
12181,
29889,
10003,
1405,
29871,
29896,
29901,
13,
4706,
396,
6991,
975,
278,
931,
9927,
29889,
13,
4706,
11339,
29918,
6758,
353,
15886,
29889,
17469,
29918,
2083,
29898,
13,
9651,
11339,
29918,
6758,
29892,
9685,
29922,
3881,
29898,
29896,
29892,
11339,
29918,
6758,
29889,
12181,
29889,
10003,
876,
13,
418,
1072,
29918,
6758,
353,
1583,
3032,
7168,
29918,
11618,
29889,
6758,
267,
565,
1583,
3032,
7168,
29918,
11618,
1683,
6213,
13,
418,
946,
29887,
29918,
6758,
353,
3619,
29889,
26193,
403,
29918,
6758,
267,
29898,
13,
3986,
639,
29918,
4773,
29918,
6758,
29922,
7168,
29918,
6758,
29892,
13,
3986,
4559,
29918,
7915,
29922,
705,
5861,
29892,
13,
3986,
4943,
2133,
29918,
6758,
29922,
1727,
29918,
6758,
29897,
13,
418,
11339,
29918,
6758,
353,
946,
29887,
29918,
6758,
29889,
7827,
29918,
6758,
13,
418,
1583,
3032,
7168,
29918,
6758,
29918,
8382,
29918,
2083,
3034,
583,
29898,
7168,
29918,
6758,
29892,
8820,
29892,
1480,
29918,
1631,
29892,
13,
462,
462,
539,
3646,
29918,
29939,
29918,
5975,
29892,
931,
29918,
24530,
29897,
13,
13,
418,
736,
11339,
29918,
6758,
13,
13,
29871,
822,
15595,
29918,
6758,
29898,
1311,
29892,
13,
462,
931,
29918,
24530,
29901,
18696,
29889,
2481,
14448,
29892,
13,
462,
18177,
29901,
28379,
29961,
8768,
29889,
29911,
6073,
29962,
353,
6213,
29892,
13,
462,
6694,
29901,
6120,
353,
7700,
29897,
1599,
4072,
29889,
29911,
6073,
29901,
13,
1678,
9995,
20606,
267,
278,
15595,
29918,
6758,
363,
17522,
29899,
29903,
2477,
6694,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
418,
931,
29918,
24530,
29901,
319,
9853,
310,
5335,
4196,
567,
29889,
13,
418,
18177,
29901,
28379,
17336,
470,
1543,
3538,
313,
546,
29899,
16175,
29899,
8269,
29897,
13500,
13,
4706,
18177,
29889,
13,
418,
6694,
29901,
26460,
445,
6410,
338,
1641,
1304,
2645,
6694,
29889,
13,
13,
1678,
16969,
29901,
13,
418,
15595,
29918,
6758,
29901,
319,
17336,
15595,
6410,
29889,
13,
1678,
9995,
13,
1678,
411,
15886,
29889,
978,
29918,
6078,
877,
2312,
29918,
6758,
29374,
13,
418,
17763,
29918,
13239,
29889,
9294,
29918,
17642,
29918,
23905,
29898,
2230,
29918,
24530,
29892,
1583,
29889,
2230,
29918,
10568,
29918,
6550,
29897,
13,
13,
418,
396,
1334,
437,
451,
2767,
11339,
2645,
15595,
6410,
29889,
13,
418,
443,
3880,
29918,
7387,
29892,
1480,
29918,
1631,
353,
1583,
3032,
7387,
29918,
392,
29918,
1188,
29918,
771,
5824,
29898,
13,
3986,
931,
29918,
24530,
29892,
6694,
29922,
8824,
29897,
13,
418,
24687,
29918,
12765,
353,
15886,
29889,
9847,
29918,
24970,
6278,
1188,
29918,
1631,
448,
1583,
3032,
5182,
29918,
296,
14441,
29897,
13,
418,
565,
1583,
3032,
1509,
29918,
1188,
29918,
2312,
29918,
262,
29918,
2312,
29918,
6758,
29901,
13,
4706,
15595,
29918,
6758,
353,
313,
1311,
3032,
1188,
29918,
2312,
334,
24687,
29918,
12765,
29897,
13,
418,
1683,
29901,
13,
4706,
15595,
29918,
6758,
353,
313,
13264,
29889,
4548,
29898,
1311,
3032,
1188,
29918,
2312,
29897,
334,
24687,
29918,
12765,
29897,
13,
13,
418,
565,
15595,
29918,
6758,
29889,
12181,
29889,
10003,
1405,
29871,
29896,
29901,
13,
4706,
396,
6991,
975,
278,
931,
9927,
29889,
13,
4706,
15595,
29918,
6758,
353,
15886,
29889,
17469,
29918,
2083,
29898,
13,
9651,
15595,
29918,
6758,
29892,
9685,
29922,
3881,
29898,
29896,
29892,
15595,
29918,
6758,
29889,
12181,
29889,
10003,
876,
13,
13,
418,
946,
29887,
29918,
6758,
353,
3619,
29889,
26193,
403,
29918,
6758,
267,
29898,
13,
3986,
639,
29918,
4773,
29918,
6758,
29922,
2312,
29918,
6758,
29892,
4559,
29918,
7915,
29922,
705,
5861,
29897,
13,
418,
15595,
29918,
6758,
353,
946,
29887,
29918,
6758,
29889,
7827,
29918,
6758,
13,
13,
418,
1583,
3032,
2312,
29918,
6758,
29918,
8382,
29918,
2083,
3034,
583,
29898,
2312,
29918,
6758,
29892,
24687,
29918,
12765,
29897,
13,
13,
418,
736,
15595,
29918,
6758,
13,
13,
29871,
822,
903,
9695,
293,
29918,
6758,
29918,
8382,
29918,
2083,
3034,
583,
29898,
1311,
29892,
22599,
29918,
5182,
29879,
29892,
4450,
29918,
1594,
29918,
5182,
29879,
29896,
29892,
13,
462,
462,
259,
4450,
29918,
1594,
29918,
5182,
29879,
29906,
1125,
13,
1678,
565,
1583,
3032,
8382,
29918,
2083,
3034,
583,
29901,
13,
418,
22599,
29918,
12523,
29896,
353,
22599,
29918,
5182,
29879,
448,
4450,
29918,
1594,
29918,
5182,
29879,
29896,
13,
418,
22599,
29918,
12523,
29906,
353,
22599,
29918,
5182,
29879,
448,
4450,
29918,
1594,
29918,
5182,
29879,
29906,
13,
418,
22599,
29918,
12523,
353,
15886,
29889,
17685,
4197,
1594,
29918,
12523,
29896,
29892,
22599,
29918,
12523,
29906,
1402,
9685,
29922,
29900,
29897,
13,
418,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
1594,
29918,
12523,
742,
22599,
29918,
12523,
29892,
13,
462,
462,
539,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
1594,
29918,
5182,
29879,
742,
22599,
29918,
5182,
29879,
29892,
13,
462,
462,
539,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
11965,
29918,
1594,
29918,
5182,
29879,
29896,
742,
4450,
29918,
1594,
29918,
5182,
29879,
29896,
29892,
13,
462,
462,
539,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
11965,
29918,
1594,
29918,
5182,
29879,
29906,
742,
4450,
29918,
1594,
29918,
5182,
29879,
29906,
29892,
13,
462,
462,
539,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
13,
29871,
822,
903,
7168,
29918,
6758,
29918,
8382,
29918,
2083,
3034,
583,
29898,
1311,
29892,
11339,
29918,
6758,
29892,
8820,
29892,
1480,
29918,
1631,
29892,
13,
462,
462,
29871,
3646,
29918,
29939,
29918,
5975,
29892,
931,
29918,
24530,
1125,
13,
1678,
565,
1583,
3032,
8382,
29918,
2083,
3034,
583,
29901,
13,
418,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
7168,
29918,
6758,
742,
11339,
29918,
6758,
29892,
13,
462,
462,
539,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
1018,
29901,
13,
4706,
363,
1024,
29892,
3158,
297,
17763,
29918,
13239,
29889,
1579,
8606,
29918,
2541,
29918,
2212,
1312,
29918,
24772,
29898,
7387,
1125,
13,
3986,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
29898,
978,
29892,
3158,
29892,
13,
462,
462,
965,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
5174,
7865,
2392,
29901,
13,
4706,
1209,
29871,
396,
13211,
2750,
7463,
317,
2477,
29161,
393,
437,
451,
4153,
13,
4706,
396,
5706,
8820,
29889,
13,
13,
418,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
1188,
29918,
1631,
742,
1480,
29918,
1631,
29892,
13,
462,
462,
539,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
15886,
29889,
12667,
29889,
29894,
29906,
29889,
7727,
29889,
19529,
279,
29898,
13,
3986,
1024,
2433,
296,
14441,
29918,
485,
29887,
742,
13,
3986,
848,
10457,
13264,
29889,
17469,
29918,
12676,
29898,
2080,
29918,
20158,
29922,
1188,
29918,
1631,
511,
13,
3986,
4331,
29922,
1311,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
5182,
29918,
29939,
29918,
5975,
742,
3646,
29918,
29939,
29918,
5975,
29892,
13,
462,
462,
539,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
9853,
29918,
2311,
353,
17763,
29918,
13239,
29889,
657,
29918,
5561,
29918,
12181,
29898,
2230,
29918,
24530,
29892,
13,
462,
462,
795,
1583,
3032,
2230,
29918,
10568,
29918,
6550,
9601,
29900,
29962,
13,
418,
8898,
29918,
3859,
353,
1583,
3032,
14968,
29918,
22197,
29889,
657,
29918,
11228,
29918,
3859,
29898,
16175,
29918,
2311,
29897,
13,
418,
3158,
29918,
27691,
353,
1583,
3032,
14968,
29918,
22197,
29889,
27691,
29898,
13,
3986,
931,
29918,
24530,
29892,
8898,
29918,
3859,
467,
2467,
13,
418,
565,
338,
8758,
29898,
2467,
29918,
27691,
29892,
15886,
29886,
29889,
27691,
29879,
29889,
19077,
1125,
13,
4706,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
627,
29918,
12676,
742,
3158,
29918,
27691,
29889,
2029,
29892,
13,
462,
462,
308,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
4706,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
627,
29918,
4172,
3359,
742,
13,
462,
462,
308,
3158,
29918,
27691,
29889,
7052,
29892,
13,
462,
462,
308,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
25342,
338,
8758,
29898,
2467,
29918,
27691,
29892,
15886,
29886,
29889,
27691,
29879,
29889,
29907,
20440,
936,
1125,
13,
4706,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
627,
29918,
8513,
742,
3158,
29918,
27691,
29889,
8513,
3285,
13,
462,
462,
308,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
1018,
29901,
13,
4706,
363,
1024,
29892,
3158,
29918,
5721,
297,
17763,
29918,
13239,
29889,
1579,
8606,
29918,
2541,
29918,
2212,
1312,
29918,
24772,
29898,
13,
9651,
3158,
29918,
27691,
1125,
13,
3986,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
296,
14441,
29918,
29915,
718,
1024,
29892,
13,
462,
462,
965,
3158,
29918,
5721,
29889,
296,
14441,
3285,
13,
462,
462,
965,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
5174,
2216,
1888,
2037,
287,
2392,
29901,
13,
4706,
1209,
29871,
396,
3834,
18822,
437,
451,
505,
385,
16114,
293,
24687,
29889,
13,
13,
29871,
822,
903,
2312,
29918,
6758,
29918,
8382,
29918,
2083,
3034,
583,
29898,
1311,
29892,
15595,
29918,
6758,
29892,
24687,
29918,
12765,
1125,
13,
1678,
565,
1583,
3032,
8382,
29918,
2083,
3034,
583,
29901,
13,
418,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
2312,
29918,
6758,
742,
15595,
29918,
6758,
29892,
13,
462,
462,
539,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
418,
3619,
29889,
17158,
29918,
20158,
29918,
2083,
3034,
583,
877,
296,
14441,
29918,
12765,
742,
24687,
29918,
12765,
29892,
13,
462,
462,
539,
1583,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
13,
418,
15886,
29889,
12667,
29889,
29894,
29906,
29889,
7727,
29889,
19529,
279,
29898,
13,
3986,
1024,
2433,
1188,
29918,
2312,
742,
848,
29922,
1311,
3032,
1188,
29918,
2312,
29892,
4331,
29922,
1311,
29889,
14968,
29918,
10568,
29918,
11808,
29897,
13,
2
] |
tests/test_allof.py
|
tgallant/sphinx-json-schema
| 0 |
90653
|
from unittest import TestCase
from sphinx_json_schema_formatter.mergers import merge
class AllOfTestCase(TestCase):
def test_merge_properties(self):
base = {
"required": ["A"],
"properties": {
"A": {"type": "string", "enum": ["x", "y"]},
"B": {"type": "string"},
},
}
to_merge = {
"required": ["C"],
"properties": {
"A": {"type": "string", "enum": ["x"]},
"C": {"type": "string"},
},
}
merge(base, to_merge, "allOf")
self.assertDictEqual(
base,
{
"required": ["A", "C"],
"properties": {
"A": {"type": "string", "enum": ["x"]},
"B": {"type": "string"},
"C": {"type": "string"},
},
},
)
|
[
1,
515,
443,
27958,
1053,
4321,
8259,
13,
13,
3166,
269,
561,
14668,
29918,
3126,
29918,
11010,
29918,
689,
2620,
29889,
1050,
5743,
1053,
10366,
13,
13,
13,
1990,
2178,
2776,
3057,
8259,
29898,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
14634,
29918,
11330,
29898,
1311,
1125,
13,
4706,
2967,
353,
426,
13,
9651,
376,
12403,
1115,
6796,
29909,
12436,
13,
9651,
376,
11330,
1115,
426,
13,
18884,
376,
29909,
1115,
8853,
1853,
1115,
376,
1807,
613,
376,
18605,
1115,
6796,
29916,
613,
376,
29891,
3108,
1118,
13,
18884,
376,
29933,
1115,
8853,
1853,
1115,
376,
1807,
10758,
13,
9651,
2981,
13,
4706,
500,
13,
13,
4706,
304,
29918,
14634,
353,
426,
13,
9651,
376,
12403,
1115,
6796,
29907,
12436,
13,
9651,
376,
11330,
1115,
426,
13,
18884,
376,
29909,
1115,
8853,
1853,
1115,
376,
1807,
613,
376,
18605,
1115,
6796,
29916,
3108,
1118,
13,
18884,
376,
29907,
1115,
8853,
1853,
1115,
376,
1807,
10758,
13,
9651,
2981,
13,
4706,
500,
13,
13,
4706,
10366,
29898,
3188,
29892,
304,
29918,
14634,
29892,
376,
497,
2776,
1159,
13,
13,
4706,
1583,
29889,
9294,
21533,
9843,
29898,
13,
9651,
2967,
29892,
13,
9651,
426,
13,
18884,
376,
12403,
1115,
6796,
29909,
613,
376,
29907,
12436,
13,
18884,
376,
11330,
1115,
426,
13,
462,
1678,
376,
29909,
1115,
8853,
1853,
1115,
376,
1807,
613,
376,
18605,
1115,
6796,
29916,
3108,
1118,
13,
462,
1678,
376,
29933,
1115,
8853,
1853,
1115,
376,
1807,
10758,
13,
462,
1678,
376,
29907,
1115,
8853,
1853,
1115,
376,
1807,
10758,
13,
18884,
2981,
13,
9651,
2981,
13,
4706,
1723,
13,
2
] |
projects/models.py
|
fantasticfour7/crowdfunding
| 0 |
116579
|
<filename>projects/models.py
from django.db import models
#domain choices
Domain_Choices = [
('1', ('Agriculture')),
('2', ('Business')),
('3', ('Computer')),
('4', ('Civil')),
('5', ('Performing Arts')),
('6', ('Electrical')),
('7', ('Biotechnology')),
('8', ('Biomedical')),
('9', ('Electronics')),
('10', ('Mechanical')),
('11', ('Chemical')),
('12', ('Cinematography')),
('13', ('Educational')),
]
# class for Student projects
class UserProject(models.Model):
owner = models.ForeignKey('accounts.CustomUser',related_name='project', on_delete = models.CASCADE)
name = models.CharField(max_length = 100)
funds_Required = models.PositiveIntegerField()
domain = models.CharField(choices = Domain_Choices, default = False, blank = False, max_length = 10 )
Project_Description = models.TextField()
image1 = models.FileField()
image2 = models.FileField()
image3 = models.FileField()
image4 = models.FileField()
contributors = models.CharField(max_length = 300)
ongoing = models.BooleanField(default = False)
def __str__(self):
return self.name
|
[
1,
529,
9507,
29958,
16418,
29914,
9794,
29889,
2272,
13,
3166,
9557,
29889,
2585,
1053,
4733,
13,
13,
29937,
7247,
19995,
13,
15951,
29918,
15954,
1575,
353,
518,
13,
1678,
6702,
29896,
742,
6702,
29909,
629,
3953,
545,
1495,
511,
13,
1678,
6702,
29906,
742,
6702,
16890,
3335,
1495,
511,
13,
1678,
6702,
29941,
742,
6702,
20606,
261,
1495,
511,
13,
1678,
6702,
29946,
742,
6702,
29907,
5341,
1495,
511,
13,
1678,
6702,
29945,
742,
6702,
5894,
689,
292,
11401,
1495,
511,
13,
1678,
6702,
29953,
742,
6702,
29923,
781,
16888,
1495,
511,
13,
1678,
6702,
29955,
742,
6702,
20517,
866,
3049,
3002,
1495,
511,
13,
1678,
6702,
29947,
742,
6702,
29933,
14910,
287,
936,
1495,
511,
13,
1678,
6702,
29929,
742,
6702,
29923,
781,
1617,
1199,
1495,
511,
13,
1678,
6702,
29896,
29900,
742,
6702,
6816,
5083,
936,
1495,
511,
13,
1678,
6702,
29896,
29896,
742,
6702,
1451,
331,
936,
1495,
511,
13,
1678,
6702,
29896,
29906,
742,
6702,
29907,
262,
4579,
5275,
1495,
511,
13,
1678,
6702,
29896,
29941,
742,
6702,
29923,
700,
29883,
1288,
1495,
511,
13,
29962,
13,
13,
29937,
770,
363,
15740,
9279,
13,
1990,
4911,
7653,
29898,
9794,
29889,
3195,
1125,
13,
1678,
12271,
353,
4733,
29889,
27755,
2558,
877,
10149,
29879,
29889,
7281,
2659,
742,
12817,
29918,
978,
2433,
4836,
742,
373,
29918,
8143,
353,
4733,
29889,
29907,
3289,
5454,
2287,
29897,
13,
1678,
1024,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29896,
29900,
29900,
29897,
13,
1678,
29199,
29918,
19347,
353,
4733,
29889,
9135,
3321,
7798,
3073,
580,
13,
1678,
5354,
353,
4733,
29889,
27890,
29898,
1859,
1575,
353,
28460,
29918,
15954,
1575,
29892,
2322,
353,
7700,
29892,
9654,
353,
7700,
29892,
4236,
29918,
2848,
353,
29871,
29896,
29900,
1723,
13,
1678,
8010,
29918,
9868,
29871,
353,
4733,
29889,
15778,
580,
13,
1678,
1967,
29896,
353,
4733,
29889,
2283,
3073,
580,
13,
1678,
1967,
29906,
353,
4733,
29889,
2283,
3073,
580,
13,
1678,
1967,
29941,
353,
4733,
29889,
2283,
3073,
580,
13,
1678,
1967,
29946,
353,
4733,
29889,
2283,
3073,
580,
13,
1678,
17737,
29560,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
353,
29871,
29941,
29900,
29900,
29897,
13,
1678,
373,
17696,
353,
4733,
29889,
18146,
3073,
29898,
4381,
353,
7700,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
978,
2
] |
Medium/229.py
|
Hellofafar/Leetcode
| 6 |
111139
|
# ------------------------------
# 229. Majority Element II
#
# Description:
# Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.
# Note: The algorithm should run in linear time and in O(1) space.
# Example 1:
# Input: [3,2,3]
# Output: [3]
#
# Example 2:
# Input: [1,1,1,3,3,2,2,2]
# Output: [1,2]
#
# Version: 1.0
# 09/26/18 by Jianfa
# ------------------------------
class Solution(object):
def majorityElement(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
since the requirement is finding the majority for more than ceiling of [n/3],
the answer would be less than or equal to two numbers.
"""
if not nums:
return []
count1, count2, candidate1, candidate2 = 0, 0, 0, 1
for n in nums:
if n == candidate1:
count1 += 1
elif n == candidate2:
count2 += 1
elif count1 == 0:
candidate1, count1 = n, 1
elif count2 == 0:
candidate2, count2 = n, 1
else:
count1 -= 1
count2 -= 1
res = []
for i in (candidate1, candidate2):
if nums.count(i) > len(nums) / 3:
res.append(i)
return res
# Used for testing
if __name__ == "__main__":
test = Solution()
# ------------------------------
# Summary:
# Get idea from https://leetcode.com/problems/majority-element-ii/discuss/63520/Boyer-Moore-Majority-Vote-algorithm-and-my-elaboration
# Boyer-Moore Majority Vote algorithm: http://goo.gl/64Nams
|
[
1,
396,
448,
2683,
9072,
29899,
13,
29937,
29871,
29906,
29906,
29929,
29889,
11019,
537,
10619,
1944,
13,
29937,
29871,
13,
29937,
12953,
29901,
13,
29937,
11221,
385,
6043,
1409,
310,
2159,
302,
29892,
1284,
599,
3161,
393,
2615,
901,
1135,
29871,
229,
143,
141,
302,
29914,
29941,
29871,
229,
143,
142,
3064,
29889,
13,
29937,
3940,
29901,
450,
5687,
881,
1065,
297,
5608,
931,
322,
297,
438,
29898,
29896,
29897,
2913,
29889,
13,
29937,
8741,
29871,
29896,
29901,
13,
29937,
10567,
29901,
518,
29941,
29892,
29906,
29892,
29941,
29962,
13,
29937,
10604,
29901,
518,
29941,
29962,
13,
29937,
29871,
13,
29937,
8741,
29871,
29906,
29901,
13,
29937,
10567,
29901,
518,
29896,
29892,
29896,
29892,
29896,
29892,
29941,
29892,
29941,
29892,
29906,
29892,
29906,
29892,
29906,
29962,
13,
29937,
10604,
29901,
518,
29896,
29892,
29906,
29962,
13,
29937,
29871,
13,
29937,
10079,
29901,
29871,
29896,
29889,
29900,
13,
29937,
29871,
29900,
29929,
29914,
29906,
29953,
29914,
29896,
29947,
491,
435,
713,
5444,
13,
29937,
448,
2683,
9072,
29899,
13,
13,
1990,
24380,
29898,
3318,
1125,
13,
1678,
822,
13638,
2642,
29898,
1311,
29892,
954,
29879,
1125,
13,
4706,
9995,
13,
4706,
584,
1853,
954,
29879,
29901,
2391,
29961,
524,
29962,
13,
4706,
584,
29878,
1853,
29901,
2391,
29961,
524,
29962,
13,
308,
13,
4706,
1951,
278,
11809,
338,
9138,
278,
13638,
363,
901,
1135,
2257,
6504,
310,
518,
29876,
29914,
29941,
1402,
29871,
13,
4706,
278,
1234,
723,
367,
3109,
1135,
470,
5186,
304,
1023,
3694,
29889,
13,
4706,
9995,
13,
4706,
565,
451,
954,
29879,
29901,
13,
9651,
736,
5159,
13,
308,
13,
4706,
2302,
29896,
29892,
2302,
29906,
29892,
14020,
29896,
29892,
14020,
29906,
353,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
13,
4706,
363,
302,
297,
954,
29879,
29901,
13,
9651,
565,
302,
1275,
14020,
29896,
29901,
13,
18884,
2302,
29896,
4619,
29871,
29896,
13,
9651,
25342,
302,
1275,
14020,
29906,
29901,
13,
18884,
2302,
29906,
4619,
29871,
29896,
13,
9651,
25342,
2302,
29896,
1275,
29871,
29900,
29901,
13,
18884,
14020,
29896,
29892,
2302,
29896,
353,
302,
29892,
29871,
29896,
13,
9651,
25342,
2302,
29906,
1275,
29871,
29900,
29901,
13,
18884,
14020,
29906,
29892,
2302,
29906,
353,
302,
29892,
29871,
29896,
13,
9651,
1683,
29901,
13,
18884,
2302,
29896,
22361,
29871,
29896,
13,
18884,
2302,
29906,
22361,
29871,
29896,
13,
308,
13,
4706,
620,
353,
5159,
13,
4706,
363,
474,
297,
313,
29883,
5380,
403,
29896,
29892,
14020,
29906,
1125,
13,
9651,
565,
954,
29879,
29889,
2798,
29898,
29875,
29897,
1405,
7431,
29898,
1949,
29879,
29897,
847,
29871,
29941,
29901,
13,
18884,
620,
29889,
4397,
29898,
29875,
29897,
13,
308,
13,
4706,
736,
620,
13,
308,
13,
13,
29937,
501,
8485,
363,
6724,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1243,
353,
24380,
580,
13,
13,
29937,
448,
2683,
9072,
29899,
13,
29937,
6991,
5219,
29901,
13,
29937,
3617,
2969,
515,
2045,
597,
280,
300,
401,
29889,
510,
29914,
17199,
29879,
29914,
21355,
537,
29899,
5029,
29899,
2236,
29914,
2218,
13571,
29914,
29953,
29941,
29945,
29906,
29900,
29914,
8431,
7598,
29899,
22638,
487,
29899,
29924,
1175,
272,
537,
29899,
29963,
866,
29899,
20567,
29899,
392,
29899,
1357,
29899,
295,
3717,
362,
13,
29937,
1952,
7598,
29899,
22638,
487,
11019,
537,
478,
866,
5687,
29901,
1732,
597,
1484,
29877,
29889,
3820,
29914,
29953,
29946,
29940,
2232,
2
] |
python/app.py
|
ncolesummers/microservices-calculator
| 0 |
28510
|
<filename>python/app.py<gh_stars>0
import flask
from flask import request, jsonify
from flask_cors import CORS
import math
from wasmer import engine, Store, Module, Instance
app = flask.Flask(__name__)
CORS(app)
@app.route('/add', methods=['POST'])
def add():
store = Store()
# Let's compile the module to be able to execute it!
module = Module(store, """
(module
(type (func (param f32 f32) (result f32)))
(func (export "sum") (type 0) (param f32) (param f32) (result f32)
local.get 0
local.get 1
f32.add))
""")
# Now the module is compiled, we can instantiate it.
instance = Instance(module)
content = request.json
[operand_one, operand_two] = [float(content['operandOne']), float(content['operandTwo'])]
print(f"Calculating {operand_one} + {operand_two}", flush=True)
out = jsonify({"result": instance.exports.sum(operand_one, operand_two)})
return out
app.run(host="0.0.0.0")
|
[
1,
529,
9507,
29958,
4691,
29914,
932,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
29784,
13,
3166,
29784,
1053,
2009,
29892,
4390,
1598,
13,
3166,
29784,
29918,
29883,
943,
1053,
315,
24125,
13,
5215,
5844,
13,
13,
3166,
471,
1050,
1053,
6012,
29892,
14491,
29892,
15591,
29892,
2799,
749,
13,
13,
932,
353,
29784,
29889,
8754,
1278,
22168,
978,
1649,
29897,
13,
29907,
24125,
29898,
932,
29897,
13,
13,
13,
29992,
932,
29889,
13134,
11219,
1202,
742,
3519,
29922,
1839,
5438,
11287,
13,
1753,
788,
7295,
13,
29871,
3787,
353,
14491,
580,
13,
13,
29871,
396,
2803,
29915,
29879,
6633,
278,
3883,
304,
367,
2221,
304,
6222,
372,
29991,
13,
29871,
3883,
353,
15591,
29898,
8899,
29892,
9995,
13,
29871,
313,
5453,
13,
1678,
313,
1853,
313,
9891,
313,
3207,
285,
29941,
29906,
285,
29941,
29906,
29897,
313,
2914,
285,
29941,
29906,
4961,
13,
1678,
313,
9891,
313,
15843,
376,
2083,
1159,
313,
1853,
29871,
29900,
29897,
313,
3207,
285,
29941,
29906,
29897,
313,
3207,
285,
29941,
29906,
29897,
313,
2914,
285,
29941,
29906,
29897,
13,
418,
1887,
29889,
657,
29871,
29900,
13,
418,
1887,
29889,
657,
29871,
29896,
13,
418,
285,
29941,
29906,
29889,
1202,
876,
13,
29871,
5124,
1159,
13,
13,
29871,
396,
2567,
278,
3883,
338,
13126,
29892,
591,
508,
25112,
372,
29889,
13,
29871,
2777,
353,
2799,
749,
29898,
5453,
29897,
13,
13,
29871,
2793,
353,
2009,
29889,
3126,
13,
29871,
518,
3372,
392,
29918,
650,
29892,
1751,
392,
29918,
10184,
29962,
353,
518,
7411,
29898,
3051,
1839,
3372,
392,
6716,
2033,
511,
5785,
29898,
3051,
1839,
3372,
392,
13985,
2033,
4638,
13,
29871,
1596,
29898,
29888,
29908,
27065,
1218,
426,
3372,
392,
29918,
650,
29913,
718,
426,
3372,
392,
29918,
10184,
17671,
28371,
29922,
5574,
29897,
13,
29871,
714,
353,
4390,
1598,
3319,
29908,
2914,
1115,
2777,
29889,
26500,
29889,
2083,
29898,
3372,
392,
29918,
650,
29892,
1751,
392,
29918,
10184,
26972,
13,
259,
13,
29871,
736,
714,
13,
13,
932,
29889,
3389,
29898,
3069,
543,
29900,
29889,
29900,
29889,
29900,
29889,
29900,
1159,
13,
2
] |
game/serializers/question_with_answer_serializer.py
|
dimadk24/english-fight-api
| 0 |
47072
|
from rest_framework import serializers
from game.serializers.question_serializer import QuestionSerializer
class QuestionWithAnswerSerializer(QuestionSerializer):
correct_answer = serializers.CharField()
|
[
1,
515,
1791,
29918,
4468,
1053,
7797,
19427,
13,
13,
3166,
3748,
29889,
15550,
19427,
29889,
12470,
29918,
15550,
3950,
1053,
894,
17679,
13,
13,
13,
1990,
894,
3047,
22550,
17679,
29898,
16492,
17679,
1125,
13,
1678,
1959,
29918,
12011,
353,
7797,
19427,
29889,
27890,
580,
13,
2
] |
simtest.py
|
agilethought/RasbPiAgileBot
| 1 |
60156
|
import time
from breezycreate2 import Robot
#robot = create.Create('/dev/ttyUSB0')
#robot = Robot('/dev/ttyUSB0', "57600")
robot = Robot('sim')
def write_sensors():
#robot.robot.get_packet(19)
#robot.robot.get_packet(20)
print('distance: ', robot.robot.sensor_state['distance'])
print('angle: ', robot.robot.sensor_state['angle'])
#print('RIGHT_VELOCITY: ', robot.getSensor('RIGHT_VELOCITY'))
#print('LEFT_VELOCITY: ', robot.getSensor('LEFT_VELOCITY'))
write_sensors()
robot.drive(100, 1500)
time.sleep(1)
write_sensors()
time.sleep(1)
write_sensors()
time.sleep(1)
write_sensors()
robot.drive(-200, 500)
time.sleep(1)
write_sensors()
#robot.shutdown()
|
[
1,
1053,
931,
13,
3166,
289,
929,
1537,
3258,
29906,
1053,
6417,
327,
13,
13,
29937,
307,
7451,
353,
1653,
29889,
4391,
11219,
3359,
29914,
4349,
29965,
1744,
29900,
1495,
13,
29937,
307,
7451,
353,
6417,
327,
11219,
3359,
29914,
4349,
29965,
1744,
29900,
742,
376,
29945,
29955,
29953,
29900,
29900,
1159,
13,
307,
7451,
353,
6417,
327,
877,
3601,
1495,
13,
13,
1753,
2436,
29918,
23149,
943,
7295,
13,
268,
396,
307,
7451,
29889,
307,
7451,
29889,
657,
29918,
4058,
300,
29898,
29896,
29929,
29897,
13,
268,
396,
307,
7451,
29889,
307,
7451,
29889,
657,
29918,
4058,
300,
29898,
29906,
29900,
29897,
13,
268,
1596,
877,
19244,
29901,
13420,
19964,
29889,
307,
7451,
29889,
29879,
6073,
29918,
3859,
1839,
19244,
11287,
13,
268,
1596,
877,
2521,
29901,
13420,
19964,
29889,
307,
7451,
29889,
29879,
6073,
29918,
3859,
1839,
2521,
11287,
13,
1678,
396,
2158,
877,
22789,
3912,
29918,
12064,
16652,
11937,
29901,
13420,
19964,
29889,
657,
29903,
6073,
877,
22789,
3912,
29918,
12064,
16652,
11937,
8785,
13,
1678,
396,
2158,
877,
28024,
29918,
12064,
16652,
11937,
29901,
13420,
19964,
29889,
657,
29903,
6073,
877,
28024,
29918,
12064,
16652,
11937,
8785,
13,
29871,
13,
3539,
29918,
23149,
943,
580,
13,
307,
7451,
29889,
21594,
29898,
29896,
29900,
29900,
29892,
29871,
29896,
29945,
29900,
29900,
29897,
13,
2230,
29889,
17059,
29898,
29896,
29897,
13,
13,
3539,
29918,
23149,
943,
580,
13,
2230,
29889,
17059,
29898,
29896,
29897,
13,
13,
3539,
29918,
23149,
943,
580,
13,
2230,
29889,
17059,
29898,
29896,
29897,
13,
13,
3539,
29918,
23149,
943,
580,
13,
13,
307,
7451,
29889,
21594,
6278,
29906,
29900,
29900,
29892,
29871,
29945,
29900,
29900,
29897,
13,
2230,
29889,
17059,
29898,
29896,
29897,
13,
13,
3539,
29918,
23149,
943,
580,
13,
29937,
307,
7451,
29889,
845,
329,
3204,
580,
13,
2
] |
setup.py
|
nishantsinghdev/mshow
| 0 |
76570
|
from setuptools import setup
setup(name='mshow',
version = '7.0',
__version__='7.0',
description='Sample Message Showing Library',
url='https://github.com/nishantsinghdev/mshow',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=['mshow'],
zip_safe=False)
|
[
1,
515,
731,
21245,
8789,
1053,
6230,
13,
13,
14669,
29898,
978,
2433,
29885,
4294,
742,
13,
418,
1873,
353,
525,
29955,
29889,
29900,
742,
13,
418,
4770,
3259,
1649,
2433,
29955,
29889,
29900,
742,
13,
418,
6139,
2433,
17708,
7777,
7704,
292,
9538,
742,
13,
418,
3142,
2433,
991,
597,
3292,
29889,
510,
29914,
29876,
728,
1934,
292,
29882,
3359,
29914,
29885,
4294,
742,
13,
418,
4148,
2433,
29966,
5813,
29958,
742,
13,
418,
4148,
29918,
5269,
2433,
29966,
26862,
6227,
29958,
742,
13,
418,
19405,
2433,
26349,
742,
13,
418,
9741,
29922,
1839,
29885,
4294,
7464,
13,
418,
14319,
29918,
11177,
29922,
8824,
29897,
13,
2
] |
part-2/2-iterators/Example-consuming_iterators_manually.py
|
boconlonton/python-deep-dive
| 0 |
16261
|
"""
Consuming Iterator manually
"""
from collections import namedtuple
def cast(data_type, value):
"""Cast the value into a correct data type"""
if data_type == 'DOUBLE':
return float(value)
elif data_type == 'STRING':
return str(value)
elif data_type == 'INT':
return int(value)
def cast_row(data_types1, data_row):
return [
cast(data_type, value)
for data_type, value in zip(data_types1, data_row)
]
# cars = []
# with open('cars.csv') as file:
# row_index = 0
# for line in file:
# if row_index == 0:
# # Header row
# headers = line.strip('\n').split(';')
# Car = namedtuple('Car', headers)
# elif row_index == 1:
# data_types = line.strip('\n').split(';')
# # print('types', data_types)
# else:
# # data row
# data = line.strip('\n').split(';')
# data = cast_row(data_types, data)
# car = Car(*data)
# cars.append(car)
# # print(data)
# row_index += 1
# with open('cars.csv') as file:
# file_iter = iter(file)
# headers = next(file_iter).strip('\n').split(';')
# Car = namedtuple('Car', headers)
# data_types = next(file_iter).strip('\n').split(';')
# for line in file_iter:
# data = line.strip('\n').split(';')
# data = cast_row(data_types, data)
# car = Car(*data)
# cars.append(car)
with open('cars.csv') as file:
file_iter = iter(file)
headers = next(file_iter).strip('\n').split(';')
Car = namedtuple('Car', headers)
data_types = next(file_iter).strip('\n').split(';')
cars = [Car(*cast_row(
data_types,
line.strip('\n').split(';')
))
for line in file_iter]
print(cars)
|
[
1,
9995,
13,
13696,
9929,
20504,
1061,
7522,
13,
15945,
29908,
13,
3166,
16250,
1053,
4257,
23583,
13,
13,
13,
1753,
4320,
29898,
1272,
29918,
1853,
29892,
995,
1125,
13,
1678,
9995,
15738,
278,
995,
964,
263,
1959,
848,
1134,
15945,
29908,
13,
1678,
565,
848,
29918,
1853,
1275,
525,
3970,
7466,
1307,
2396,
13,
4706,
736,
5785,
29898,
1767,
29897,
13,
1678,
25342,
848,
29918,
1853,
1275,
525,
20785,
2396,
13,
4706,
736,
851,
29898,
1767,
29897,
13,
1678,
25342,
848,
29918,
1853,
1275,
525,
10192,
2396,
13,
4706,
736,
938,
29898,
1767,
29897,
13,
13,
13,
1753,
4320,
29918,
798,
29898,
1272,
29918,
8768,
29896,
29892,
848,
29918,
798,
1125,
13,
1678,
736,
518,
13,
4706,
4320,
29898,
1272,
29918,
1853,
29892,
995,
29897,
13,
4706,
363,
848,
29918,
1853,
29892,
995,
297,
14319,
29898,
1272,
29918,
8768,
29896,
29892,
848,
29918,
798,
29897,
13,
1678,
4514,
13,
13,
13,
29937,
18647,
353,
5159,
13,
13,
29937,
411,
1722,
877,
29883,
1503,
29889,
7638,
1495,
408,
934,
29901,
13,
29937,
268,
1948,
29918,
2248,
353,
29871,
29900,
13,
29937,
268,
363,
1196,
297,
934,
29901,
13,
29937,
308,
565,
1948,
29918,
2248,
1275,
29871,
29900,
29901,
13,
29937,
632,
396,
19345,
1948,
13,
29937,
632,
9066,
353,
1196,
29889,
17010,
28909,
29876,
2824,
5451,
877,
29936,
1495,
13,
29937,
632,
1704,
353,
4257,
23583,
877,
8179,
742,
9066,
29897,
13,
29937,
308,
25342,
1948,
29918,
2248,
1275,
29871,
29896,
29901,
13,
29937,
632,
848,
29918,
8768,
353,
1196,
29889,
17010,
28909,
29876,
2824,
5451,
877,
29936,
1495,
13,
29937,
632,
396,
1596,
877,
8768,
742,
848,
29918,
8768,
29897,
13,
29937,
308,
1683,
29901,
13,
29937,
632,
396,
848,
1948,
13,
29937,
632,
848,
353,
1196,
29889,
17010,
28909,
29876,
2824,
5451,
877,
29936,
1495,
13,
29937,
632,
848,
353,
4320,
29918,
798,
29898,
1272,
29918,
8768,
29892,
848,
29897,
13,
29937,
632,
1559,
353,
1704,
10456,
1272,
29897,
13,
29937,
632,
18647,
29889,
4397,
29898,
4287,
29897,
13,
29937,
632,
396,
1596,
29898,
1272,
29897,
13,
29937,
308,
1948,
29918,
2248,
4619,
29871,
29896,
13,
13,
29937,
411,
1722,
877,
29883,
1503,
29889,
7638,
1495,
408,
934,
29901,
13,
29937,
268,
934,
29918,
1524,
353,
4256,
29898,
1445,
29897,
13,
29937,
268,
9066,
353,
2446,
29898,
1445,
29918,
1524,
467,
17010,
28909,
29876,
2824,
5451,
877,
29936,
1495,
13,
29937,
268,
1704,
353,
4257,
23583,
877,
8179,
742,
9066,
29897,
13,
29937,
268,
848,
29918,
8768,
353,
2446,
29898,
1445,
29918,
1524,
467,
17010,
28909,
29876,
2824,
5451,
877,
29936,
1495,
13,
29937,
268,
363,
1196,
297,
934,
29918,
1524,
29901,
13,
29937,
308,
848,
353,
1196,
29889,
17010,
28909,
29876,
2824,
5451,
877,
29936,
1495,
13,
29937,
308,
848,
353,
4320,
29918,
798,
29898,
1272,
29918,
8768,
29892,
848,
29897,
13,
29937,
308,
1559,
353,
1704,
10456,
1272,
29897,
13,
29937,
308,
18647,
29889,
4397,
29898,
4287,
29897,
13,
13,
2541,
1722,
877,
29883,
1503,
29889,
7638,
1495,
408,
934,
29901,
13,
1678,
934,
29918,
1524,
353,
4256,
29898,
1445,
29897,
13,
1678,
9066,
353,
2446,
29898,
1445,
29918,
1524,
467,
17010,
28909,
29876,
2824,
5451,
877,
29936,
1495,
13,
1678,
1704,
353,
4257,
23583,
877,
8179,
742,
9066,
29897,
13,
1678,
848,
29918,
8768,
353,
2446,
29898,
1445,
29918,
1524,
467,
17010,
28909,
29876,
2824,
5451,
877,
29936,
1495,
13,
1678,
18647,
353,
518,
8179,
10456,
4384,
29918,
798,
29898,
13,
18884,
848,
29918,
8768,
29892,
13,
18884,
1196,
29889,
17010,
28909,
29876,
2824,
5451,
877,
29936,
1495,
13,
462,
876,
13,
9651,
363,
1196,
297,
934,
29918,
1524,
29962,
13,
13,
2158,
29898,
29883,
1503,
29897,
13,
2
] |
pymovingintelligence_ha/__init__.py
|
cyberjunky/python-movingintelligence-ha
| 0 |
42791
|
"""Home Assistant Python 3 API wrapper for Moving Intelligence."""
import datetime
import logging
from .utils import Utils
_LOGGER = logging.getLogger("pymovingintelligence_ha")
class MovingIntelligence:
"""Class for communicating with the Moving Intelligence API."""
def __init__(
self,
username: str = None,
apikey: str = None,
):
"""Init module."""
self.utils = Utils(username, apikey)
async def get_devices(self) -> dict:
"""Get devices."""
result = []
objects = await self.utils.request(
"GET",
endpoint="/v1/objects",
)
for item in objects:
device = Device(self.utils, item["licence"])
await device.update_from_json(item)
if device.odometer:
result.append(device)
return result
class Device:
"""Entity used to store device information."""
def __init__(self, utilities, license_plate):
"""Initialize a device, also a vehicle."""
self._utilities = utilities
self.identifier = None
self.make = None
self.model = None
self.license_plate = license_plate
self.chassis_number = None
self.in_use_date = None
self.year = None
self.remarks = None
self.latitude = 0
self.longitude = 0
self.odometer = None
self.speed = None
self.start_trip_time = None
self.start_trip_street = None
self.start_trip_city = None
self.start_trip_country = None
self.trip_distance = None
self.end_trip_street = None
self.end_trip_city = None
self.end_trip_country = None
self.end_trip_time = None
self.trip_distance = None
self.start_trip_address = None
self.end_trip_address = None
self.last_seen = None
self.location_alias = None
@property
def data(self):
"""Return all data of the vehicle."""
return {
"id": self.identifier,
"make": self.make,
"model": self.model,
"license_plate": self.license_plate,
"chassis_number": self.chassis_number,
"in_use_date": self.in_use_date,
"year": self.year,
"remarks": self.remarks,
"latitude": self.latitude,
"longitude": self.longitude,
"odometer": self.odometer,
"speed": self.speed,
"start_trip_time": self.start_trip_time,
"start_trip_address": self.start_trip_address,
"end_trip_time": self.end_trip_time,
"end_trip_address": self.end_trip_address,
"trip_distance": self.trip_distance,
"last_seen": self.end_trip_time,
"location_alias": self.location_alias,
}
async def update_from_json(self, data):
"""Set all attributes based on API response."""
self.identifier = self.getvalue(data, "id")
self.license_plate = self.getvalue(data, "licence")
self.make = self.getvalue(data, "brand")
self.model = self.getvalue(data, "model")
self.chassis_number = self.getvalue(data, "chassisNumber")
self.in_use_date = self.converttime(self.getvalue(data, "startDate"))
self.year = self.getvalue(data, "yearOfManufacture")
self.remarks = self.getvalue(data, "remarks")
self.odometer = await self.get_odometer(self.identifier)
trip = await self.get_object_detailed_trips(
self.identifier, "CURRENT_MONTH", "UNKNOWN"
)
if trip:
location = trip[-1]["locationAndSpeed"]
if len(location) > 0 and location[-1].get("lat") is not None:
self.latitude = float(location[-1]["lat"] / 1000000)
self.longitude = float(location[-1]["lon"] / 1000000)
self.speed = location[-1]["speed"]
self.start_trip_time = self.converttime(
self.getvalue(trip[-1], "startDate")
)
self.start_trip_street = self.getvalue(trip[-1], "startRoad")
self.start_trip_city = self.getvalue(trip[-1], "startCity")
self.start_trip_city = self.start_trip_city.replace("|m:", " ")
self.start_trip_country = self.getvalue(trip[-1], "startCountry")
self.end_trip_street = self.getvalue(trip[-1], "endRoad")
self.end_trip_city = self.getvalue(trip[-1], "endCity")
self.end_trip_city = self.end_trip_city.replace("|m:", " ")
self.end_trip_country = self.getvalue(trip[-1], "endCountry")
self.end_trip_time = self.converttime(self.getvalue(trip[-1], "endDate"))
self.trip_distance = self.getvalue(trip[-1], "distance") / 1000
self.location_alias = self.getvalue(trip[-1], "endAlias")
self.start_trip_address = f"{self.start_trip_street}, {self.start_trip_city}, {self.start_trip_country}"
self.end_trip_address = (
f"{self.end_trip_street}, {self.end_trip_city}, {self.end_trip_country}"
)
@staticmethod
def getvalue(data, value):
"""Safely get values."""
if value in data:
return data[value]
return None
@staticmethod
def converttime(stamp):
"""Convert datestamp."""
if not stamp:
return stamp
when = datetime.datetime.fromtimestamp(stamp)
return when.strftime("%Y-%m-%d %H:%M:%S")
async def get_odometer(self, object_id: str) -> dict:
"""Get odometer readings."""
odometer = None
data = await self._utilities.request(
"GET", endpoint=f"/v1/object/{object_id}/odometer"
)
if data:
odometer = int(self.getvalue(data, "odoInMeters") / 1000)
return odometer
async def get_object_detailed_trips(
self, object_id: str, period: str, classifications
) -> dict:
"""Get detailed trips for object."""
return await self._utilities.request(
"GET",
endpoint=f"/v1/object/{object_id}/detailedtrips",
params=self._utilities.clean_request_params(
{
"period": period,
"classifications": classifications,
}
),
)
|
[
1,
9995,
11184,
4007,
22137,
5132,
29871,
29941,
3450,
14476,
363,
14104,
292,
3159,
28286,
1213,
15945,
13,
5215,
12865,
13,
5215,
12183,
13,
13,
3166,
869,
13239,
1053,
22310,
29879,
13,
13,
29918,
14480,
17070,
353,
12183,
29889,
657,
16363,
703,
29886,
962,
21081,
524,
28286,
29918,
2350,
1159,
13,
13,
13,
1990,
14104,
292,
2928,
28286,
29901,
13,
1678,
9995,
2385,
363,
7212,
1218,
411,
278,
14104,
292,
3159,
28286,
3450,
1213,
15945,
13,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
8952,
29901,
851,
353,
6213,
29892,
13,
4706,
7882,
1989,
29901,
851,
353,
6213,
29892,
13,
268,
1125,
13,
4706,
9995,
6644,
3883,
1213,
15945,
13,
13,
4706,
1583,
29889,
13239,
353,
22310,
29879,
29898,
6786,
29892,
7882,
1989,
29897,
13,
13,
1678,
7465,
822,
679,
29918,
3359,
1575,
29898,
1311,
29897,
1599,
9657,
29901,
13,
4706,
9995,
2577,
9224,
1213,
15945,
13,
4706,
1121,
353,
5159,
13,
13,
4706,
3618,
353,
7272,
1583,
29889,
13239,
29889,
3827,
29898,
13,
9651,
376,
7194,
613,
13,
9651,
16248,
13802,
29894,
29896,
29914,
12650,
613,
13,
4706,
1723,
13,
13,
4706,
363,
2944,
297,
3618,
29901,
13,
9651,
4742,
353,
21830,
29898,
1311,
29889,
13239,
29892,
2944,
3366,
506,
663,
20068,
13,
9651,
7272,
4742,
29889,
5504,
29918,
3166,
29918,
3126,
29898,
667,
29897,
13,
9651,
565,
4742,
29889,
397,
8328,
29901,
13,
18884,
1121,
29889,
4397,
29898,
10141,
29897,
13,
13,
4706,
736,
1121,
13,
13,
13,
1990,
21830,
29901,
13,
1678,
9995,
6691,
1304,
304,
3787,
4742,
2472,
1213,
15945,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3667,
1907,
29892,
19405,
29918,
2341,
1125,
13,
4706,
9995,
6644,
6646,
263,
4742,
29892,
884,
263,
19716,
1213,
15945,
13,
4706,
1583,
3032,
4422,
1907,
353,
3667,
1907,
13,
13,
4706,
1583,
29889,
25378,
353,
6213,
13,
4706,
1583,
29889,
5675,
353,
6213,
13,
4706,
1583,
29889,
4299,
353,
6213,
13,
4706,
1583,
29889,
506,
1947,
29918,
2341,
353,
19405,
29918,
2341,
13,
4706,
1583,
29889,
305,
465,
275,
29918,
4537,
353,
6213,
13,
4706,
1583,
29889,
262,
29918,
1509,
29918,
1256,
353,
6213,
13,
4706,
1583,
29889,
6360,
353,
6213,
13,
4706,
1583,
29889,
1745,
17862,
353,
6213,
13,
4706,
1583,
29889,
5066,
4279,
353,
29871,
29900,
13,
4706,
1583,
29889,
5426,
4279,
353,
29871,
29900,
13,
4706,
1583,
29889,
397,
8328,
353,
6213,
13,
4706,
1583,
29889,
19322,
353,
6213,
13,
4706,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
2230,
353,
6213,
13,
4706,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
29352,
353,
6213,
13,
4706,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
12690,
353,
6213,
13,
4706,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
13509,
353,
6213,
13,
4706,
1583,
29889,
3626,
29886,
29918,
19244,
353,
6213,
13,
4706,
1583,
29889,
355,
29918,
3626,
29886,
29918,
29352,
353,
6213,
13,
4706,
1583,
29889,
355,
29918,
3626,
29886,
29918,
12690,
353,
6213,
13,
4706,
1583,
29889,
355,
29918,
3626,
29886,
29918,
13509,
353,
6213,
13,
4706,
1583,
29889,
355,
29918,
3626,
29886,
29918,
2230,
353,
6213,
13,
4706,
1583,
29889,
3626,
29886,
29918,
19244,
353,
6213,
13,
4706,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
7328,
353,
6213,
13,
4706,
1583,
29889,
355,
29918,
3626,
29886,
29918,
7328,
353,
6213,
13,
4706,
1583,
29889,
4230,
29918,
28026,
353,
6213,
13,
4706,
1583,
29889,
5479,
29918,
19973,
353,
6213,
13,
13,
1678,
732,
6799,
13,
1678,
822,
848,
29898,
1311,
1125,
13,
4706,
9995,
11609,
599,
848,
310,
278,
19716,
1213,
15945,
13,
13,
4706,
736,
426,
13,
9651,
376,
333,
1115,
1583,
29889,
25378,
29892,
13,
9651,
376,
5675,
1115,
1583,
29889,
5675,
29892,
13,
9651,
376,
4299,
1115,
1583,
29889,
4299,
29892,
13,
9651,
376,
506,
1947,
29918,
2341,
1115,
1583,
29889,
506,
1947,
29918,
2341,
29892,
13,
9651,
376,
305,
465,
275,
29918,
4537,
1115,
1583,
29889,
305,
465,
275,
29918,
4537,
29892,
13,
9651,
376,
262,
29918,
1509,
29918,
1256,
1115,
1583,
29889,
262,
29918,
1509,
29918,
1256,
29892,
13,
9651,
376,
6360,
1115,
1583,
29889,
6360,
29892,
13,
9651,
376,
1745,
17862,
1115,
1583,
29889,
1745,
17862,
29892,
13,
9651,
376,
5066,
4279,
1115,
1583,
29889,
5066,
4279,
29892,
13,
9651,
376,
5426,
4279,
1115,
1583,
29889,
5426,
4279,
29892,
13,
9651,
376,
397,
8328,
1115,
1583,
29889,
397,
8328,
29892,
13,
9651,
376,
19322,
1115,
1583,
29889,
19322,
29892,
13,
9651,
376,
2962,
29918,
3626,
29886,
29918,
2230,
1115,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
2230,
29892,
13,
9651,
376,
2962,
29918,
3626,
29886,
29918,
7328,
1115,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
7328,
29892,
13,
9651,
376,
355,
29918,
3626,
29886,
29918,
2230,
1115,
1583,
29889,
355,
29918,
3626,
29886,
29918,
2230,
29892,
13,
9651,
376,
355,
29918,
3626,
29886,
29918,
7328,
1115,
1583,
29889,
355,
29918,
3626,
29886,
29918,
7328,
29892,
13,
9651,
376,
3626,
29886,
29918,
19244,
1115,
1583,
29889,
3626,
29886,
29918,
19244,
29892,
13,
9651,
376,
4230,
29918,
28026,
1115,
1583,
29889,
355,
29918,
3626,
29886,
29918,
2230,
29892,
13,
9651,
376,
5479,
29918,
19973,
1115,
1583,
29889,
5479,
29918,
19973,
29892,
13,
4706,
500,
13,
13,
1678,
7465,
822,
2767,
29918,
3166,
29918,
3126,
29898,
1311,
29892,
848,
1125,
13,
4706,
9995,
2697,
599,
8393,
2729,
373,
3450,
2933,
1213,
15945,
13,
13,
4706,
1583,
29889,
25378,
353,
1583,
29889,
657,
1767,
29898,
1272,
29892,
376,
333,
1159,
13,
4706,
1583,
29889,
506,
1947,
29918,
2341,
353,
1583,
29889,
657,
1767,
29898,
1272,
29892,
376,
506,
663,
1159,
13,
4706,
1583,
29889,
5675,
353,
1583,
29889,
657,
1767,
29898,
1272,
29892,
376,
16472,
1159,
13,
4706,
1583,
29889,
4299,
353,
1583,
29889,
657,
1767,
29898,
1272,
29892,
376,
4299,
1159,
13,
4706,
1583,
29889,
305,
465,
275,
29918,
4537,
353,
1583,
29889,
657,
1767,
29898,
1272,
29892,
376,
305,
465,
275,
4557,
1159,
13,
4706,
1583,
29889,
262,
29918,
1509,
29918,
1256,
353,
1583,
29889,
535,
369,
698,
603,
29898,
1311,
29889,
657,
1767,
29898,
1272,
29892,
376,
2962,
2539,
5783,
13,
4706,
1583,
29889,
6360,
353,
1583,
29889,
657,
1767,
29898,
1272,
29892,
376,
6360,
2776,
2517,
9765,
545,
1159,
13,
4706,
1583,
29889,
1745,
17862,
353,
1583,
29889,
657,
1767,
29898,
1272,
29892,
376,
1745,
17862,
1159,
13,
4706,
1583,
29889,
397,
8328,
353,
7272,
1583,
29889,
657,
29918,
397,
8328,
29898,
1311,
29889,
25378,
29897,
13,
13,
4706,
17487,
353,
7272,
1583,
29889,
657,
29918,
3318,
29918,
29881,
11881,
29918,
3626,
567,
29898,
13,
9651,
1583,
29889,
25378,
29892,
376,
22484,
29450,
29918,
22877,
4690,
613,
376,
3904,
29968,
6632,
16048,
29908,
13,
4706,
1723,
13,
13,
4706,
565,
17487,
29901,
13,
9651,
4423,
353,
17487,
14352,
29896,
29962,
3366,
5479,
2855,
26539,
3108,
13,
9651,
565,
7431,
29898,
5479,
29897,
1405,
29871,
29900,
322,
4423,
14352,
29896,
1822,
657,
703,
5066,
1159,
338,
451,
6213,
29901,
13,
18884,
1583,
29889,
5066,
4279,
353,
5785,
29898,
5479,
14352,
29896,
29962,
3366,
5066,
3108,
847,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29897,
13,
18884,
1583,
29889,
5426,
4279,
353,
5785,
29898,
5479,
14352,
29896,
29962,
3366,
12957,
3108,
847,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29897,
13,
18884,
1583,
29889,
19322,
353,
4423,
14352,
29896,
29962,
3366,
19322,
3108,
13,
13,
9651,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
2230,
353,
1583,
29889,
535,
369,
698,
603,
29898,
13,
18884,
1583,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
2962,
2539,
1159,
13,
9651,
1723,
13,
9651,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
29352,
353,
1583,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
2962,
9588,
328,
1159,
13,
9651,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
12690,
353,
1583,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
2962,
16885,
1159,
13,
9651,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
12690,
353,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
12690,
29889,
6506,
703,
29989,
29885,
29901,
613,
376,
16521,
13,
9651,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
13509,
353,
1583,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
2962,
20779,
1159,
13,
13,
9651,
1583,
29889,
355,
29918,
3626,
29886,
29918,
29352,
353,
1583,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
355,
9588,
328,
1159,
13,
9651,
1583,
29889,
355,
29918,
3626,
29886,
29918,
12690,
353,
1583,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
355,
16885,
1159,
13,
9651,
1583,
29889,
355,
29918,
3626,
29886,
29918,
12690,
353,
1583,
29889,
355,
29918,
3626,
29886,
29918,
12690,
29889,
6506,
703,
29989,
29885,
29901,
613,
376,
16521,
13,
9651,
1583,
29889,
355,
29918,
3626,
29886,
29918,
13509,
353,
1583,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
355,
20779,
1159,
13,
9651,
1583,
29889,
355,
29918,
3626,
29886,
29918,
2230,
353,
1583,
29889,
535,
369,
698,
603,
29898,
1311,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
355,
2539,
5783,
13,
13,
9651,
1583,
29889,
3626,
29886,
29918,
19244,
353,
1583,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
19244,
1159,
847,
29871,
29896,
29900,
29900,
29900,
13,
9651,
1583,
29889,
5479,
29918,
19973,
353,
1583,
29889,
657,
1767,
29898,
3626,
29886,
14352,
29896,
1402,
376,
355,
29909,
18849,
1159,
13,
13,
9651,
1583,
29889,
2962,
29918,
3626,
29886,
29918,
7328,
353,
285,
29908,
29912,
1311,
29889,
2962,
29918,
3626,
29886,
29918,
29352,
1118,
426,
1311,
29889,
2962,
29918,
3626,
29886,
29918,
12690,
1118,
426,
1311,
29889,
2962,
29918,
3626,
29886,
29918,
13509,
5038,
13,
9651,
1583,
29889,
355,
29918,
3626,
29886,
29918,
7328,
353,
313,
13,
18884,
285,
29908,
29912,
1311,
29889,
355,
29918,
3626,
29886,
29918,
29352,
1118,
426,
1311,
29889,
355,
29918,
3626,
29886,
29918,
12690,
1118,
426,
1311,
29889,
355,
29918,
3626,
29886,
29918,
13509,
5038,
13,
9651,
1723,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
679,
1767,
29898,
1272,
29892,
995,
1125,
13,
4706,
9995,
29903,
2142,
873,
679,
1819,
1213,
15945,
13,
4706,
565,
995,
297,
848,
29901,
13,
9651,
736,
848,
29961,
1767,
29962,
13,
4706,
736,
6213,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
5486,
698,
603,
29898,
303,
1160,
1125,
13,
4706,
9995,
18455,
1418,
7416,
1213,
15945,
13,
4706,
565,
451,
25214,
29901,
13,
9651,
736,
25214,
13,
13,
4706,
746,
353,
12865,
29889,
12673,
29889,
3166,
16394,
29898,
303,
1160,
29897,
13,
4706,
736,
746,
29889,
710,
615,
603,
11702,
29979,
19222,
29885,
19222,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
1159,
13,
13,
1678,
7465,
822,
679,
29918,
397,
8328,
29898,
1311,
29892,
1203,
29918,
333,
29901,
851,
29897,
1599,
9657,
29901,
13,
4706,
9995,
2577,
2413,
8328,
1303,
886,
1213,
15945,
13,
13,
4706,
2413,
8328,
353,
6213,
13,
4706,
848,
353,
7272,
1583,
3032,
4422,
1907,
29889,
3827,
29898,
13,
9651,
376,
7194,
613,
16248,
29922,
29888,
23901,
29894,
29896,
29914,
3318,
19248,
3318,
29918,
333,
6822,
397,
8328,
29908,
13,
4706,
1723,
13,
13,
4706,
565,
848,
29901,
13,
9651,
2413,
8328,
353,
938,
29898,
1311,
29889,
657,
1767,
29898,
1272,
29892,
376,
8144,
797,
29924,
2699,
1159,
847,
29871,
29896,
29900,
29900,
29900,
29897,
13,
13,
4706,
736,
2413,
8328,
13,
13,
1678,
7465,
822,
679,
29918,
3318,
29918,
29881,
11881,
29918,
3626,
567,
29898,
13,
4706,
1583,
29892,
1203,
29918,
333,
29901,
851,
29892,
3785,
29901,
851,
29892,
770,
8232,
13,
1678,
1723,
1599,
9657,
29901,
13,
4706,
9995,
2577,
13173,
3367,
567,
363,
1203,
1213,
15945,
13,
13,
4706,
736,
7272,
1583,
3032,
4422,
1907,
29889,
3827,
29898,
13,
9651,
376,
7194,
613,
13,
9651,
16248,
29922,
29888,
23901,
29894,
29896,
29914,
3318,
19248,
3318,
29918,
333,
6822,
29881,
11881,
3626,
567,
613,
13,
9651,
8636,
29922,
1311,
3032,
4422,
1907,
29889,
14941,
29918,
3827,
29918,
7529,
29898,
13,
18884,
426,
13,
462,
1678,
376,
19145,
1115,
3785,
29892,
13,
462,
1678,
376,
1990,
8232,
1115,
770,
8232,
29892,
13,
18884,
500,
13,
9651,
10353,
13,
4706,
1723,
13,
2
] |
kitsune/flagit/migrations/0002_auto_20200629_0826.py
|
AndrewDVXI/kitsune
| 929 |
157100
|
# Generated by Django 2.2.13 on 2020-06-29 08:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('flagit', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='flaggedobject',
name='notes',
field=models.TextField(blank=True, default=''),
),
migrations.AlterField(
model_name='flaggedobject',
name='reason',
field=models.CharField(choices=[('spam', 'Spam or other unrelated content'), ('language', 'Inappropriate language/dialog'), ('bug_support', 'Misplaced bug report or support request'), ('abuse', 'Abusive content'), ('other', 'Other (please specify)')], max_length=64),
),
]
|
[
1,
396,
3251,
630,
491,
15337,
29871,
29906,
29889,
29906,
29889,
29896,
29941,
373,
29871,
29906,
29900,
29906,
29900,
29899,
29900,
29953,
29899,
29906,
29929,
29871,
29900,
29947,
29901,
29906,
29953,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
15581,
277,
742,
525,
29900,
29900,
29900,
29896,
29918,
11228,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
15581,
3192,
3318,
742,
13,
9651,
1024,
2433,
16953,
742,
13,
9651,
1746,
29922,
9794,
29889,
15778,
29898,
19465,
29922,
5574,
29892,
2322,
2433,
5477,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
15581,
3192,
3318,
742,
13,
9651,
1024,
2433,
23147,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
1859,
1575,
11759,
877,
1028,
314,
742,
525,
5592,
314,
470,
916,
443,
12817,
2793,
5477,
6702,
11675,
742,
525,
797,
932,
6649,
403,
4086,
29914,
15901,
5477,
6702,
6152,
29918,
5924,
742,
525,
29924,
11936,
433,
1133,
6494,
3461,
470,
2304,
2009,
5477,
6702,
370,
1509,
742,
525,
4920,
375,
573,
2793,
5477,
6702,
1228,
742,
525,
16107,
313,
552,
559,
6084,
29897,
1495,
1402,
4236,
29918,
2848,
29922,
29953,
29946,
511,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
lap_tracker/__init__.py
|
glyg/lap_tracker
| 6 |
43550
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
__version__ = "0.1"
from .lap_tracking import LAPTracker
from .tester import *
import os
import logging
from .utils.color_system import color
def in_ipython():
try:
__IPYTHON__
except NameError:
return False
else:
return True
if in_ipython():
logformat = '%(asctime)s' + ':'
logformat += '%(levelname)s' + ':'
logformat += '%(name)s' + ':'
# logformat += '%(funcName)s' + ': '
logformat += ' %(message)s'
else:
logformat = color('%(asctime)s', 'BLUE') + ':'
logformat += color('%(levelname)s', 'RED') + ':'
logformat += color('%(name)s', 'YELLOW') + ':'
# logformat += color('%(funcName)s', 'GREEN') + ': '
logformat += color(' %(message)s', 'ENDC')
thisdir = os.path.abspath(os.path.dirname(__file__))
pkgdir = os.path.dirname(thisdir)
samplesdir = os.path.join(pkgdir, 'samples')
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
formatter = logging.Formatter(logformat, "%Y-%m-%d %H:%M:%S")
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
logger.propagate = False
import warnings
warnings.filterwarnings("ignore")
try:
import matplotlib
matplotlib.rcParams['backend'] = "Agg"
except ImportError:
logger.warning(
'Matplotlib has not been detected. Some functions may not work.')
|
[
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
1649,
3259,
1649,
353,
376,
29900,
29889,
29896,
29908,
13,
13,
3166,
869,
6984,
29918,
11294,
292,
1053,
365,
3301,
5323,
4937,
13,
3166,
869,
1688,
261,
1053,
334,
13,
13,
5215,
2897,
13,
5215,
12183,
13,
13,
3166,
869,
13239,
29889,
2780,
29918,
5205,
1053,
2927,
13,
13,
13,
1753,
297,
29918,
666,
1656,
7295,
13,
1678,
1018,
29901,
13,
4706,
4770,
5690,
29979,
4690,
1164,
1649,
13,
1678,
5174,
4408,
2392,
29901,
13,
4706,
736,
7700,
13,
1678,
1683,
29901,
13,
4706,
736,
5852,
13,
13,
361,
297,
29918,
666,
1656,
7295,
13,
1678,
1480,
4830,
353,
14210,
29898,
294,
312,
603,
29897,
29879,
29915,
718,
525,
11283,
13,
1678,
1480,
4830,
4619,
14210,
29898,
5563,
978,
29897,
29879,
29915,
718,
525,
11283,
13,
1678,
1480,
4830,
4619,
14210,
29898,
978,
29897,
29879,
29915,
718,
525,
11283,
13,
1678,
396,
1480,
4830,
4619,
14210,
29898,
9891,
1170,
29897,
29879,
29915,
718,
525,
29901,
525,
13,
1678,
1480,
4830,
4619,
525,
1273,
29898,
4906,
29897,
29879,
29915,
13,
2870,
29901,
13,
1678,
1480,
4830,
353,
2927,
877,
29995,
29898,
294,
312,
603,
29897,
29879,
742,
525,
13367,
4462,
1495,
718,
525,
11283,
13,
1678,
1480,
4830,
4619,
2927,
877,
29995,
29898,
5563,
978,
29897,
29879,
742,
525,
19386,
1495,
718,
525,
11283,
13,
1678,
1480,
4830,
4619,
2927,
877,
29995,
29898,
978,
29897,
29879,
742,
525,
29979,
29923,
2208,
9806,
1495,
718,
525,
11283,
13,
1678,
396,
1480,
4830,
4619,
2927,
877,
29995,
29898,
9891,
1170,
29897,
29879,
742,
525,
29954,
1525,
1430,
1495,
718,
525,
29901,
525,
13,
1678,
1480,
4830,
4619,
2927,
877,
1273,
29898,
4906,
29897,
29879,
742,
525,
11794,
29907,
1495,
13,
13,
1366,
3972,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
876,
13,
15865,
3972,
353,
2897,
29889,
2084,
29889,
25721,
29898,
1366,
3972,
29897,
13,
27736,
3972,
353,
2897,
29889,
2084,
29889,
7122,
29898,
15865,
3972,
29892,
525,
27736,
1495,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13789,
353,
12183,
29889,
3835,
4598,
580,
13,
689,
2620,
353,
12183,
29889,
18522,
29898,
1188,
4830,
29892,
11860,
29979,
19222,
29885,
19222,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
1159,
13,
13789,
29889,
842,
18522,
29898,
689,
2620,
29897,
13,
21707,
29889,
1202,
4598,
29898,
13789,
29897,
13,
21707,
29889,
842,
10108,
29898,
21027,
29889,
18525,
29897,
13,
21707,
29889,
7728,
351,
403,
353,
7700,
13,
13,
5215,
18116,
13,
25442,
886,
29889,
4572,
25442,
886,
703,
17281,
1159,
13,
2202,
29901,
13,
1678,
1053,
22889,
13,
1678,
22889,
29889,
2214,
9629,
1839,
27852,
2033,
353,
376,
29909,
1505,
29908,
13,
19499,
16032,
2392,
29901,
13,
1678,
17927,
29889,
27392,
29898,
13,
4706,
525,
9782,
17357,
756,
451,
1063,
17809,
29889,
3834,
3168,
1122,
451,
664,
29889,
1495,
13,
13,
2
] |
models/language_translation/tensorflow/transformer_mlperf/inference/fp32/transformer/export_transformer.py
|
ashahba/models
| 357 |
177087
|
#! /usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import argparse
import sys
import tensorflow as tf
from model import model_params
from model import transformer
tf.compat.v1.disable_v2_behavior()
_EXTRA_DECODE_LENGTH = 100
_BEAM_SIZE = 4
_ALPHA = 0.6
def main(unused_argv):
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.INFO)
if FLAGS.params == "base":
params = model_params.TransformerBaseParams
elif FLAGS.params == "big":
params = model_params.TransformerBigParams
else:
raise ValueError("Invalid parameter set defined: %s."
"Expected 'base' or 'big.'" % FLAGS.params)
# Set up estimator and params
params.beam_size = _BEAM_SIZE
params.alpha = _ALPHA
params.extra_decode_length = _EXTRA_DECODE_LENGTH
params.frozen_graph = None
input_shape = [None, None]
input_tokens = tf.compat.v1.placeholder(tf.int64, input_shape,
name='input_tokens')
with tf.compat.v1.variable_scope("model"):
model = transformer.Transformer(params, False)
output = model(input_tokens)
# Restore variables from checkpoint
sess = tf.compat.v1.Session()
latest_model = tf.train.latest_checkpoint(FLAGS.model_dir)
saver = tf.compat.v1.train.Saver()
saver.restore(sess, latest_model)
# Freeze the graph
graph_def = sess.graph.as_graph_def()
output_names = ['model/Transformer/strided_slice_15',
'model/Transformer/strided_slice_16']
graph_def = tf.compat.v1.graph_util.convert_variables_to_constants(sess,
graph_def, output_names)
print("pb_path is", FLAGS.pb_path)
with tf.compat.v1.gfile.GFile(FLAGS.pb_path, 'wb') as pb_file:
pb_file.write(graph_def.SerializeToString())
if __name__ == "__main__":
parser = argparse.ArgumentParser()
# Model arguments
parser.add_argument(
"--model_dir", "-md", type=str, required=True,
help="Directory containing Transformer model checkpoints.",
metavar="<MD>")
parser.add_argument(
"--pb_path", "-pp", type=str, required=True,
help="The output pb file path",
metavar="<PP>")
parser.add_argument(
"--params", "-p", type=str, default="big", choices=["base", "big"],
help="[default: %(default)s] Parameter used for trained model.",
metavar="<P>")
FLAGS, unparsed = parser.parse_known_args()
main(sys.argv)
|
[
1,
396,
29991,
847,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
5215,
2897,
13,
5215,
1852,
5510,
13,
5215,
10876,
13,
13,
5215,
26110,
408,
15886,
13,
3166,
1904,
1053,
1904,
29918,
7529,
13,
3166,
1904,
1053,
4327,
261,
13,
13,
13264,
29889,
12667,
29889,
29894,
29896,
29889,
20472,
29918,
29894,
29906,
29918,
915,
16300,
580,
13,
13,
29918,
12194,
4717,
29918,
2287,
16524,
29918,
19433,
353,
29871,
29896,
29900,
29900,
13,
29918,
15349,
5194,
29918,
14226,
353,
29871,
29946,
13,
29918,
1964,
29925,
15715,
353,
29871,
29900,
29889,
29953,
13,
13,
1753,
1667,
29898,
348,
3880,
29918,
19218,
1125,
13,
29871,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
21027,
29889,
842,
29918,
18248,
359,
537,
29898,
13264,
29889,
12667,
29889,
29894,
29896,
29889,
21027,
29889,
11690,
29897,
13,
13,
29871,
565,
383,
4375,
10749,
29889,
7529,
1275,
376,
3188,
1115,
13,
1678,
8636,
353,
1904,
29918,
7529,
29889,
13372,
261,
5160,
9629,
13,
29871,
25342,
383,
4375,
10749,
29889,
7529,
1275,
376,
3752,
1115,
13,
1678,
8636,
353,
1904,
29918,
7529,
29889,
13372,
261,
6970,
9629,
13,
29871,
1683,
29901,
13,
1678,
12020,
7865,
2392,
703,
13919,
3443,
731,
3342,
29901,
1273,
29879,
1213,
13,
462,
268,
376,
1252,
6021,
525,
3188,
29915,
470,
525,
3752,
6169,
29908,
1273,
383,
4375,
10749,
29889,
7529,
29897,
13,
29871,
396,
3789,
701,
4844,
1061,
322,
8636,
13,
29871,
8636,
29889,
915,
314,
29918,
2311,
353,
903,
15349,
5194,
29918,
14226,
13,
29871,
8636,
29889,
2312,
353,
903,
1964,
29925,
15715,
13,
29871,
8636,
29889,
17833,
29918,
13808,
29918,
2848,
353,
903,
12194,
4717,
29918,
2287,
16524,
29918,
19433,
13,
29871,
8636,
29889,
29888,
307,
2256,
29918,
4262,
353,
6213,
13,
29871,
1881,
29918,
12181,
353,
518,
8516,
29892,
6213,
29962,
13,
29871,
1881,
29918,
517,
12360,
353,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
27074,
29898,
13264,
29889,
524,
29953,
29946,
29892,
1881,
29918,
12181,
29892,
13,
462,
462,
3986,
1024,
2433,
2080,
29918,
517,
12360,
1495,
13,
29871,
411,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
11918,
29918,
6078,
703,
4299,
29908,
1125,
13,
1678,
1904,
353,
4327,
261,
29889,
13372,
261,
29898,
7529,
29892,
7700,
29897,
29871,
13,
1678,
1962,
353,
1904,
29898,
2080,
29918,
517,
12360,
29897,
13,
13,
29871,
396,
11654,
487,
3651,
515,
1423,
3149,
13,
29871,
27937,
353,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
7317,
580,
13,
29871,
9281,
29918,
4299,
353,
15886,
29889,
14968,
29889,
12333,
29918,
3198,
3149,
29898,
18823,
10749,
29889,
4299,
29918,
3972,
29897,
13,
29871,
872,
369,
353,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
14968,
29889,
29903,
12483,
580,
13,
29871,
872,
369,
29889,
5060,
487,
29898,
29879,
404,
29892,
9281,
29918,
4299,
29897,
13,
13,
29871,
396,
12362,
911,
278,
3983,
13,
29871,
3983,
29918,
1753,
353,
27937,
29889,
4262,
29889,
294,
29918,
4262,
29918,
1753,
580,
13,
29871,
1962,
29918,
7039,
353,
6024,
4299,
29914,
13372,
261,
29914,
710,
2618,
29918,
18337,
29918,
29896,
29945,
742,
13,
462,
29871,
525,
4299,
29914,
13372,
261,
29914,
710,
2618,
29918,
18337,
29918,
29896,
29953,
2033,
13,
29871,
3983,
29918,
1753,
353,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
4262,
29918,
4422,
29889,
13441,
29918,
20897,
29918,
517,
29918,
3075,
1934,
29898,
29879,
404,
29892,
13,
4706,
3983,
29918,
1753,
29892,
1962,
29918,
7039,
29897,
13,
29871,
1596,
703,
24381,
29918,
2084,
338,
613,
383,
4375,
10749,
29889,
24381,
29918,
2084,
29897,
13,
29871,
411,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
29887,
1445,
29889,
29954,
2283,
29898,
18823,
10749,
29889,
24381,
29918,
2084,
29892,
525,
29893,
29890,
1495,
408,
282,
29890,
29918,
1445,
29901,
13,
1678,
282,
29890,
29918,
1445,
29889,
3539,
29898,
4262,
29918,
1753,
29889,
1748,
6646,
8246,
3101,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
29871,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
13,
29871,
396,
8125,
6273,
13,
29871,
13812,
29889,
1202,
29918,
23516,
29898,
13,
268,
376,
489,
4299,
29918,
3972,
613,
11663,
3487,
613,
1134,
29922,
710,
29892,
3734,
29922,
5574,
29892,
13,
418,
1371,
543,
9882,
6943,
4103,
24784,
1904,
1423,
9748,
19602,
13,
418,
1539,
485,
279,
543,
29966,
5773,
29958,
1159,
13,
29871,
13812,
29889,
1202,
29918,
23516,
29898,
13,
418,
376,
489,
24381,
29918,
2084,
613,
11663,
407,
613,
1134,
29922,
710,
29892,
3734,
29922,
5574,
29892,
13,
418,
1371,
543,
1576,
1962,
282,
29890,
934,
2224,
613,
13,
418,
1539,
485,
279,
543,
29966,
18009,
29958,
1159,
13,
29871,
13812,
29889,
1202,
29918,
23516,
29898,
13,
418,
376,
489,
7529,
613,
11663,
29886,
613,
1134,
29922,
710,
29892,
2322,
543,
3752,
613,
19995,
29922,
3366,
3188,
613,
376,
3752,
12436,
13,
418,
1371,
543,
29961,
4381,
29901,
1273,
29898,
4381,
29897,
29879,
29962,
24953,
1304,
363,
16370,
1904,
19602,
13,
418,
1539,
485,
279,
543,
29966,
29925,
29958,
1159,
13,
13,
29871,
383,
4375,
10749,
29892,
443,
862,
8485,
353,
13812,
29889,
5510,
29918,
5203,
29918,
5085,
580,
13,
29871,
1667,
29898,
9675,
29889,
19218,
29897,
13,
2
] |
blenderlib/bpy.app.py
|
kabuku/blender-python
| 23 |
156327
|
'''Application Data (bpy.app)
This module contains application values that remain unchanged during runtime.
'''
debug = None
'''Boolean, for debug info (started with --debug / --debug_* matching this attribute name)
'''
debug_events = None
'''Boolean, for debug info (started with --debug / --debug_* matching this attribute name)
'''
debug_ffmpeg = None
'''Boolean, for debug info (started with --debug / --debug_* matching this attribute name)
'''
debug_handlers = None
'''Boolean, for debug info (started with --debug / --debug_* matching this attribute name)
'''
debug_python = None
'''Boolean, for debug info (started with --debug / --debug_* matching this attribute name)
'''
debug_value = None
'''Int, number which can be set to non-zero values for testing purposes
'''
debug_wm = None
'''Boolean, for debug info (started with --debug / --debug_* matching this attribute name)
'''
driver_namespace = None
'''Dictionary for drivers namespace, editable in-place, reset on file load (read-only)
'''
tempdir = None
'''String, the temp directory used by blender (read-only)
'''
background = None
'''Boolean, True when blender is running without a user interface (started with -b)
'''
binary_path = None
'''The location of blenders executable, useful for utilities that spawn new instances
'''
build_cflags = None
'''C compiler flags
'''
build_cxxflags = None
'''C++ compiler flags
'''
build_date = None
'''The date this blender instance was built
'''
build_linkflags = None
'''Binary linking flags
'''
build_options = None
'''A set containing most important enabled optional build features
'''
build_platform = None
'''The platform this blender instance was built for
'''
build_revision = None
'''The subversion revision this blender instance was built with
'''
build_system = None
'''Build system used
'''
build_time = None
'''The time this blender instance was built
'''
build_type = None
'''The type of build (Release, Debug)
'''
ffmpeg = None
'''FFmpeg library information backend
'''
handlers = None
'''Application handler callbacks
'''
translations = None
'''Application and addons internationalization API
'''
version = None
'''The Blender version as a tuple of 3 numbers. eg. (2, 50, 11)
'''
version_char = None
'''The Blender version character (for minor releases)
'''
version_cycle = None
'''The release status of this build alpha/beta/rc/release
'''
version_string = None
'''The Blender version formatted as a string
'''
def count(*argv):
'''T.count(value) -> integer -- return number of occurrences of value
'''
pass
def index(*argv):
'''T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
'''
pass
|
[
1,
14550,
4873,
3630,
313,
29890,
2272,
29889,
932,
8443,
13,
259,
910,
3883,
3743,
2280,
1819,
393,
3933,
443,
15033,
2645,
10073,
22993,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
8382,
353,
6213,
30004,
13,
12008,
18146,
29892,
363,
4744,
5235,
313,
2962,
287,
411,
1192,
8382,
847,
1192,
8382,
24563,
9686,
445,
5352,
1024,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
8382,
29918,
13604,
353,
6213,
30004,
13,
12008,
18146,
29892,
363,
4744,
5235,
313,
2962,
287,
411,
1192,
8382,
847,
1192,
8382,
24563,
9686,
445,
5352,
1024,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
8382,
29918,
600,
20856,
353,
6213,
30004,
13,
12008,
18146,
29892,
363,
4744,
5235,
313,
2962,
287,
411,
1192,
8382,
847,
1192,
8382,
24563,
9686,
445,
5352,
1024,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
8382,
29918,
3179,
9306,
353,
6213,
30004,
13,
12008,
18146,
29892,
363,
4744,
5235,
313,
2962,
287,
411,
1192,
8382,
847,
1192,
8382,
24563,
9686,
445,
5352,
1024,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
8382,
29918,
4691,
353,
6213,
30004,
13,
12008,
18146,
29892,
363,
4744,
5235,
313,
2962,
287,
411,
1192,
8382,
847,
1192,
8382,
24563,
9686,
445,
5352,
1024,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
8382,
29918,
1767,
353,
6213,
30004,
13,
12008,
2928,
29892,
1353,
607,
508,
367,
731,
304,
1661,
29899,
9171,
1819,
363,
6724,
11976,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
8382,
29918,
29893,
29885,
353,
6213,
30004,
13,
12008,
18146,
29892,
363,
4744,
5235,
313,
2962,
287,
411,
1192,
8382,
847,
1192,
8382,
24563,
9686,
445,
5352,
1024,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
9465,
29918,
22377,
353,
6213,
30004,
13,
12008,
11513,
363,
18563,
7397,
29892,
3863,
519,
297,
29899,
6689,
29892,
10092,
373,
934,
2254,
313,
949,
29899,
6194,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
7382,
3972,
353,
6213,
30004,
13,
12008,
1231,
29892,
278,
5694,
3884,
1304,
491,
1999,
1581,
313,
949,
29899,
6194,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
7042,
353,
6213,
30004,
13,
12008,
18146,
29892,
5852,
746,
1999,
1581,
338,
2734,
1728,
263,
1404,
5067,
313,
2962,
287,
411,
448,
29890,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
19541,
29918,
2084,
353,
6213,
30004,
13,
12008,
1576,
4423,
310,
1999,
21043,
16813,
29892,
5407,
363,
3667,
1907,
393,
29178,
716,
8871,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
29883,
15764,
353,
6213,
30004,
13,
12008,
29907,
6516,
13449,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
29883,
4419,
15764,
353,
6213,
30004,
13,
12008,
29907,
1817,
6516,
13449,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
1256,
353,
6213,
30004,
13,
12008,
1576,
2635,
445,
1999,
1581,
2777,
471,
4240,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
2324,
15764,
353,
6213,
30004,
13,
12008,
25196,
25236,
13449,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
6768,
353,
6213,
30004,
13,
12008,
29909,
731,
6943,
1556,
4100,
9615,
13136,
2048,
5680,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
12120,
353,
6213,
30004,
13,
12008,
1576,
7481,
445,
1999,
1581,
2777,
471,
4240,
363,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
276,
4924,
353,
6213,
30004,
13,
12008,
1576,
1014,
3259,
26554,
445,
1999,
1581,
2777,
471,
4240,
411,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
5205,
353,
6213,
30004,
13,
12008,
8893,
1788,
1304,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
2230,
353,
6213,
30004,
13,
12008,
1576,
931,
445,
1999,
1581,
2777,
471,
4240,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
4282,
29918,
1853,
353,
6213,
30004,
13,
12008,
1576,
1134,
310,
2048,
313,
19729,
29892,
16171,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
600,
20856,
353,
6213,
30004,
13,
12008,
4198,
20856,
3489,
2472,
14998,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
3179,
9306,
353,
6213,
30004,
13,
12008,
4873,
7834,
6939,
29879,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
3286,
29880,
800,
353,
6213,
30004,
13,
12008,
4873,
322,
788,
787,
6121,
2133,
3450,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
3259,
353,
6213,
30004,
13,
12008,
1576,
3164,
1581,
1873,
408,
263,
18761,
310,
29871,
29941,
3694,
29889,
8087,
29889,
313,
29906,
29892,
29871,
29945,
29900,
29892,
29871,
29896,
29896,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
3259,
29918,
3090,
353,
6213,
30004,
13,
12008,
1576,
3164,
1581,
1873,
2931,
313,
1454,
9461,
27474,
8443,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
3259,
29918,
23090,
353,
6213,
30004,
13,
12008,
1576,
6507,
4660,
310,
445,
2048,
15595,
29914,
3571,
29914,
2214,
29914,
14096,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
3259,
29918,
1807,
353,
6213,
30004,
13,
12008,
1576,
3164,
1581,
1873,
20917,
408,
263,
1347,
30004,
13,
259,
6756,
13,
12008,
30004,
13,
30004,
13,
30004,
13,
1753,
2302,
10456,
19218,
1125,
30004,
13,
259,
14550,
29911,
29889,
2798,
29898,
1767,
29897,
1599,
6043,
1192,
736,
1353,
310,
13920,
2063,
310,
995,
30004,
13,
418,
6756,
13,
259,
14550,
30004,
13,
30004,
13,
259,
1209,
30004,
13,
30004,
13,
1753,
2380,
10456,
19218,
1125,
30004,
13,
259,
14550,
29911,
29889,
2248,
29898,
1767,
29892,
518,
2962,
29892,
518,
9847,
24960,
1599,
6043,
1192,
736,
937,
2380,
310,
995,
22993,
13,
418,
390,
1759,
267,
7865,
2392,
565,
278,
995,
338,
451,
2198,
22993,
13,
418,
6756,
13,
259,
14550,
30004,
13,
30004,
13,
259,
1209,
30004,
13,
30004,
13,
2
] |
dplace_app/load/util.py
|
Lumilam/D-Place
| 0 |
101555
|
# coding: utf8
from __future__ import unicode_literals
import csv
import logging
from six import BytesIO
from django.db import connection
DATASET_SHORT = {'Binford': 'B'}
def delete_all(model):
model.objects.all().delete()
with connection.cursor() as c:
c.execute(
"ALTER SEQUENCE %s_id_seq RESTART WITH 1" % model._meta.db_table
)
def var_number_to_label(dataset, number):
return "{0}{1:0>3}".format(DATASET_SHORT.get(dataset, dataset), number)
def configure_logging(test=False):
logger = logging.getLogger()
logger.setLevel(logging.CRITICAL if test else logging.INFO)
# file load.log gets everything
fh = logging.FileHandler('load.log')
fh.setLevel(logging.CRITICAL if test else logging.INFO)
# create console handler with a higher log level
ch = logging.StreamHandler()
ch.setLevel(logging.CRITICAL if test else logging.WARN)
# create formatter and add it to the handlers
formatter = logging.Formatter('%(levelname)s:%(message)s')
fh.setFormatter(formatter)
ch.setFormatter(formatter)
# add the handlers to the logger
logger.addHandler(fh)
logger.addHandler(ch)
def stream(fname):
with open(fname, 'rb') as fp:
stream_ = BytesIO(fp.read())
stream_.seek(0)
return stream_
def csv_reader(fname):
for row in csv.reader(stream(fname)):
yield [
col if col is None else col.decode('utf8').strip() for col in row
]
def csv_dict_reader(fname):
for dict_row in csv.DictReader(stream(fname)):
for k in dict_row:
if dict_row[k] is None:
continue
try:
dict_row[k] = dict_row[k].decode('utf8').strip()
except:
logging.warn('cannot decode row item %s in %s' % (k, dict_row))
yield dict_row
|
[
1,
396,
14137,
29901,
23616,
29947,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
5215,
11799,
13,
5215,
12183,
13,
13,
3166,
4832,
1053,
2648,
2167,
5971,
13,
3166,
9557,
29889,
2585,
1053,
3957,
13,
13,
13,
25832,
8127,
29911,
29918,
7068,
8476,
353,
11117,
29933,
262,
4006,
2396,
525,
29933,
10827,
13,
13,
13,
1753,
5217,
29918,
497,
29898,
4299,
1125,
13,
1678,
1904,
29889,
12650,
29889,
497,
2141,
8143,
580,
13,
1678,
411,
3957,
29889,
18127,
580,
408,
274,
29901,
13,
4706,
274,
29889,
7978,
29898,
13,
9651,
376,
1964,
4945,
3725,
13356,
1430,
4741,
1273,
29879,
29918,
333,
29918,
11762,
16759,
8322,
22659,
29871,
29896,
29908,
1273,
1904,
3032,
7299,
29889,
2585,
29918,
2371,
13,
4706,
1723,
13,
13,
13,
1753,
722,
29918,
4537,
29918,
517,
29918,
1643,
29898,
24713,
29892,
1353,
1125,
13,
1678,
736,
29850,
29900,
1157,
29896,
29901,
29900,
29958,
29941,
29913,
1642,
4830,
29898,
25832,
8127,
29911,
29918,
7068,
8476,
29889,
657,
29898,
24713,
29892,
8783,
511,
1353,
29897,
13,
13,
13,
1753,
10822,
29918,
21027,
29898,
1688,
29922,
8824,
1125,
13,
1678,
17927,
353,
12183,
29889,
657,
16363,
580,
13,
1678,
17927,
29889,
842,
10108,
29898,
21027,
29889,
11341,
1806,
2965,
1964,
565,
1243,
1683,
12183,
29889,
11690,
29897,
13,
1678,
396,
934,
2254,
29889,
1188,
4947,
4129,
13,
1678,
285,
29882,
353,
12183,
29889,
2283,
4598,
877,
1359,
29889,
1188,
1495,
13,
1678,
285,
29882,
29889,
842,
10108,
29898,
21027,
29889,
11341,
1806,
2965,
1964,
565,
1243,
1683,
12183,
29889,
11690,
29897,
13,
1678,
396,
1653,
2991,
7834,
411,
263,
6133,
1480,
3233,
13,
1678,
521,
353,
12183,
29889,
3835,
4598,
580,
13,
1678,
521,
29889,
842,
10108,
29898,
21027,
29889,
11341,
1806,
2965,
1964,
565,
1243,
1683,
12183,
29889,
29956,
15249,
29897,
13,
1678,
396,
1653,
883,
2620,
322,
788,
372,
304,
278,
25795,
13,
1678,
883,
2620,
353,
12183,
29889,
18522,
877,
29995,
29898,
5563,
978,
29897,
29879,
16664,
29898,
4906,
29897,
29879,
1495,
13,
1678,
285,
29882,
29889,
842,
18522,
29898,
689,
2620,
29897,
13,
1678,
521,
29889,
842,
18522,
29898,
689,
2620,
29897,
13,
1678,
396,
788,
278,
25795,
304,
278,
17927,
13,
1678,
17927,
29889,
1202,
4598,
29898,
29888,
29882,
29897,
13,
1678,
17927,
29889,
1202,
4598,
29898,
305,
29897,
13,
13,
13,
1753,
4840,
29898,
29888,
978,
1125,
13,
1678,
411,
1722,
29898,
29888,
978,
29892,
525,
6050,
1495,
408,
285,
29886,
29901,
13,
4706,
4840,
29918,
353,
2648,
2167,
5971,
29898,
18091,
29889,
949,
3101,
13,
4706,
4840,
5396,
344,
1416,
29898,
29900,
29897,
13,
4706,
736,
4840,
29918,
13,
13,
13,
1753,
11799,
29918,
16950,
29898,
29888,
978,
1125,
13,
1678,
363,
1948,
297,
11799,
29889,
16950,
29898,
5461,
29898,
29888,
978,
22164,
13,
4706,
7709,
518,
13,
9651,
784,
565,
784,
338,
6213,
1683,
784,
29889,
13808,
877,
9420,
29947,
2824,
17010,
580,
363,
784,
297,
1948,
13,
4706,
4514,
13,
13,
13,
1753,
11799,
29918,
8977,
29918,
16950,
29898,
29888,
978,
1125,
13,
1678,
363,
9657,
29918,
798,
297,
11799,
29889,
21533,
6982,
29898,
5461,
29898,
29888,
978,
22164,
13,
4706,
363,
413,
297,
9657,
29918,
798,
29901,
13,
9651,
565,
9657,
29918,
798,
29961,
29895,
29962,
338,
6213,
29901,
13,
18884,
6773,
13,
9651,
1018,
29901,
13,
18884,
9657,
29918,
798,
29961,
29895,
29962,
353,
9657,
29918,
798,
29961,
29895,
1822,
13808,
877,
9420,
29947,
2824,
17010,
580,
13,
9651,
5174,
29901,
13,
18884,
12183,
29889,
25442,
877,
29883,
6735,
21822,
1948,
2944,
1273,
29879,
297,
1273,
29879,
29915,
1273,
313,
29895,
29892,
9657,
29918,
798,
876,
13,
4706,
7709,
9657,
29918,
798,
13,
2
] |
civis_jupyter_notebooks/platform_persistence.py
|
menglewis/civis-jupyter-notebook
| 0 |
19993
|
<gh_stars>0
"""
This file contains utilities that bind the Jupyter notebook to our platform.
It performs two functions:
1. On startup, pull the contents of the notebook from platform to the local disk
2. As a Jupyter post-save hook, push the contents of the notebook and a HTML preview of the same back to platform.
3. Custom Error class for when a Notebook does not correctly initialize
"""
import civis
import nbformat
import os
import sys
import subprocess
import requests
from io import open
from subprocess import check_call
from subprocess import CalledProcessError
from civis_jupyter_notebooks import log_utils
def initialize_notebook_from_platform(notebook_path):
""" This runs on startup to initialize the notebook """
logger.info('Retrieving notebook information from Platform')
client = get_client()
notebook_model = client.notebooks.get(os.environ['PLATFORM_OBJECT_ID'])
logger.info('Pulling contents of notebook file from S3')
r = requests.get(notebook_model.notebook_url)
if r.status_code != 200:
raise NotebookManagementError('Failed to pull down notebook file from S3')
notebook = nbformat.reads(r.content, nbformat.NO_CONVERT)
s3_notebook_new = notebook.get('metadata', {}).get('civis', {}).get('new_notebook', False)
if s3_notebook_new:
notebook.metadata.pop('civis')
# Only overwrite the git version of the notebook with the S3 version if
# the S3 version is not the brand new empty template
git_notebook_exists = os.path.isfile(notebook_path)
if not git_notebook_exists or not s3_notebook_new:
logger.info('Restoring notebook file from S3')
directory = os.path.dirname(notebook_path)
if not os.path.exists(directory):
os.makedirs(directory)
with open(notebook_path, mode='w', encoding='utf-8') as nb_file:
nbformat.write(notebook, nb_file)
logger.info('Notebook file ready')
if hasattr(notebook_model, 'requirements_url') and notebook_model.requirements_url:
__pull_and_load_requirements(notebook_model.requirements_url, notebook_path)
def __pull_and_load_requirements(url, notebook_path):
logger.info('Pulling down the requirements file')
r = requests.get(url)
if r.status_code != 200:
raise NotebookManagementError('Failed to pull down requirements.txt file from S3')
logger.info('Writing contents of requirements file')
requirements_path = os.path.join(os.path.dirname(notebook_path), 'requirements.txt')
with open(requirements_path, 'wb') as requirements:
requirements.write(r.content)
logger.info('Requirements file ready')
def find_and_install_requirements(requirements_path):
while os.path.isdir(requirements_path) and requirements_path != '/root':
requirements_file = os.path.join(requirements_path, 'requirements.txt')
logger.info('Looking for requirements at %s' % requirements_file)
if not os.path.isfile(requirements_file):
requirements_path = os.path.dirname(requirements_path)
continue
pip_install(requirements_file)
break
def pip_install(requirements_file):
logger.info('Installing packages from %s' % requirements_file)
try:
subprocess.check_output(
[sys.executable, '-m', 'pip', 'install', '-r', requirements_file],
stderr=subprocess.STDOUT
)
logger.info('Installed requirements.txt')
except subprocess.CalledProcessError as e:
raise NotebookManagementError(e.output.decode("utf-8"))
def post_save(model, os_path, contents_manager):
""" Called from Jupyter post-save hook. Manages save of NB """
if model['type'] != 'notebook':
return
logger.info('Getting URLs to update notebook')
update_url, update_preview_url = get_update_urls()
save_notebook(update_url, os_path)
generate_and_save_preview(update_preview_url, os_path)
logger.info('Notebook save complete')
def get_update_urls():
"""
Get the URLs needed to update the NB.
These URLs expire after a few minutes so do not cache them
"""
client = get_client()
urls = client.notebooks.list_update_links(os.environ['PLATFORM_OBJECT_ID'])
return (urls.update_url, urls.update_preview_url)
def save_notebook(url, os_path):
""" Push raw notebook to S3 """
with open(os_path, 'rb') as nb_file:
logger.info('Pushing latest notebook file to S3')
requests.put(url, data=nb_file.read())
logger.info('Notebook file updated')
def generate_and_save_preview(url, os_path):
""" Render NB-as-HTML and push that file to S3 """
d, fname = os.path.split(os_path)
logger.info('Rendering notebook to HTML')
try:
check_call(['jupyter', 'nbconvert', '--to', 'html', fname], cwd=d)
except CalledProcessError as e:
raise NotebookManagementError('nbconvert failed to convert notebook file to html: {}'.format(repr(e)))
preview_path = os.path.splitext(os_path)[0] + '.html'
with open(preview_path, 'rb') as preview_file:
logger.info('Pushing latest notebook preview to S3')
requests.put(url, data=preview_file.read())
logger.info('Notebook preview updated')
def get_client():
""" This gets a client that knows about our notebook endpoints """
# TODO: Simplify this once the notebooks endpoints are in the client
return civis.APIClient(resources='all')
class NotebookManagementError(Exception):
'''
raised whenever we hit an error trying to move
notebook data between our notebook and platform
'''
logger = log_utils.setup_stream_logging()
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
13,
29871,
910,
934,
3743,
3667,
1907,
393,
7868,
278,
27441,
25547,
451,
19273,
304,
1749,
7481,
29889,
13,
29871,
739,
23233,
1023,
3168,
29901,
13,
259,
29896,
29889,
1551,
20234,
29892,
8206,
278,
8118,
310,
278,
451,
19273,
515,
7481,
304,
278,
1887,
8086,
13,
259,
29906,
29889,
1094,
263,
27441,
25547,
1400,
29899,
7620,
12422,
29892,
5503,
278,
8118,
310,
278,
451,
19273,
322,
263,
4544,
25267,
310,
278,
1021,
1250,
304,
7481,
29889,
13,
259,
29941,
29889,
8701,
4829,
770,
363,
746,
263,
2216,
19273,
947,
451,
5149,
11905,
13,
15945,
29908,
13,
5215,
14175,
275,
13,
5215,
302,
29890,
4830,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
1014,
5014,
13,
5215,
7274,
13,
3166,
12013,
1053,
1722,
13,
3166,
1014,
5014,
1053,
1423,
29918,
4804,
13,
3166,
1014,
5014,
1053,
3037,
839,
7032,
2392,
13,
3166,
14175,
275,
29918,
29926,
786,
25547,
29918,
1333,
19273,
29879,
1053,
1480,
29918,
13239,
13,
13,
13,
1753,
11905,
29918,
1333,
19273,
29918,
3166,
29918,
12120,
29898,
1333,
19273,
29918,
2084,
1125,
13,
1678,
9995,
910,
6057,
373,
20234,
304,
11905,
278,
451,
19273,
9995,
13,
1678,
17927,
29889,
3888,
877,
8015,
2546,
1747,
451,
19273,
2472,
515,
28096,
1495,
13,
1678,
3132,
353,
679,
29918,
4645,
580,
13,
1678,
451,
19273,
29918,
4299,
353,
3132,
29889,
1333,
19273,
29879,
29889,
657,
29898,
359,
29889,
21813,
1839,
7390,
1299,
19094,
29918,
14824,
17637,
29918,
1367,
11287,
13,
13,
1678,
17927,
29889,
3888,
877,
29925,
913,
292,
8118,
310,
451,
19273,
934,
515,
317,
29941,
1495,
13,
1678,
364,
353,
7274,
29889,
657,
29898,
1333,
19273,
29918,
4299,
29889,
1333,
19273,
29918,
2271,
29897,
13,
1678,
565,
364,
29889,
4882,
29918,
401,
2804,
29871,
29906,
29900,
29900,
29901,
13,
4706,
12020,
2216,
19273,
27107,
2392,
877,
17776,
304,
8206,
1623,
451,
19273,
934,
515,
317,
29941,
1495,
13,
1678,
451,
19273,
353,
302,
29890,
4830,
29889,
949,
29879,
29898,
29878,
29889,
3051,
29892,
302,
29890,
4830,
29889,
6632,
29918,
6007,
5348,
29911,
29897,
13,
13,
1678,
269,
29941,
29918,
1333,
19273,
29918,
1482,
353,
451,
19273,
29889,
657,
877,
19635,
742,
6571,
467,
657,
877,
29883,
440,
275,
742,
6571,
467,
657,
877,
1482,
29918,
1333,
19273,
742,
7700,
29897,
13,
1678,
565,
269,
29941,
29918,
1333,
19273,
29918,
1482,
29901,
13,
4706,
451,
19273,
29889,
19635,
29889,
7323,
877,
29883,
440,
275,
1495,
13,
13,
1678,
396,
9333,
26556,
278,
6315,
1873,
310,
278,
451,
19273,
411,
278,
317,
29941,
1873,
565,
13,
1678,
396,
278,
317,
29941,
1873,
338,
451,
278,
14982,
716,
4069,
4472,
13,
1678,
6315,
29918,
1333,
19273,
29918,
9933,
353,
2897,
29889,
2084,
29889,
275,
1445,
29898,
1333,
19273,
29918,
2084,
29897,
13,
1678,
565,
451,
6315,
29918,
1333,
19273,
29918,
9933,
470,
451,
269,
29941,
29918,
1333,
19273,
29918,
1482,
29901,
13,
4706,
17927,
29889,
3888,
877,
15078,
8253,
451,
19273,
934,
515,
317,
29941,
1495,
13,
4706,
3884,
353,
2897,
29889,
2084,
29889,
25721,
29898,
1333,
19273,
29918,
2084,
29897,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
12322,
1125,
13,
9651,
2897,
29889,
29885,
12535,
12935,
29898,
12322,
29897,
13,
13,
4706,
411,
1722,
29898,
1333,
19273,
29918,
2084,
29892,
4464,
2433,
29893,
742,
8025,
2433,
9420,
29899,
29947,
1495,
408,
302,
29890,
29918,
1445,
29901,
13,
9651,
302,
29890,
4830,
29889,
3539,
29898,
1333,
19273,
29892,
302,
29890,
29918,
1445,
29897,
13,
13,
1678,
17927,
29889,
3888,
877,
3664,
19273,
934,
7960,
1495,
13,
13,
1678,
565,
756,
5552,
29898,
1333,
19273,
29918,
4299,
29892,
525,
12277,
1860,
29918,
2271,
1495,
322,
451,
19273,
29918,
4299,
29889,
12277,
1860,
29918,
2271,
29901,
13,
4706,
4770,
26746,
29918,
392,
29918,
1359,
29918,
12277,
1860,
29898,
1333,
19273,
29918,
4299,
29889,
12277,
1860,
29918,
2271,
29892,
451,
19273,
29918,
2084,
29897,
13,
13,
13,
1753,
4770,
26746,
29918,
392,
29918,
1359,
29918,
12277,
1860,
29898,
2271,
29892,
451,
19273,
29918,
2084,
1125,
13,
1678,
17927,
29889,
3888,
877,
29925,
913,
292,
1623,
278,
11780,
934,
1495,
13,
1678,
364,
353,
7274,
29889,
657,
29898,
2271,
29897,
13,
13,
1678,
565,
364,
29889,
4882,
29918,
401,
2804,
29871,
29906,
29900,
29900,
29901,
13,
4706,
12020,
2216,
19273,
27107,
2392,
877,
17776,
304,
8206,
1623,
11780,
29889,
3945,
934,
515,
317,
29941,
1495,
13,
13,
1678,
17927,
29889,
3888,
877,
29956,
768,
292,
8118,
310,
11780,
934,
1495,
13,
1678,
11780,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
29898,
1333,
19273,
29918,
2084,
511,
525,
12277,
1860,
29889,
3945,
1495,
13,
1678,
411,
1722,
29898,
12277,
1860,
29918,
2084,
29892,
525,
29893,
29890,
1495,
408,
11780,
29901,
13,
4706,
11780,
29889,
3539,
29898,
29878,
29889,
3051,
29897,
13,
13,
1678,
17927,
29889,
3888,
877,
1123,
1548,
1860,
934,
7960,
1495,
13,
13,
13,
1753,
1284,
29918,
392,
29918,
6252,
29918,
12277,
1860,
29898,
12277,
1860,
29918,
2084,
1125,
13,
1678,
1550,
2897,
29889,
2084,
29889,
275,
3972,
29898,
12277,
1860,
29918,
2084,
29897,
322,
11780,
29918,
2084,
2804,
8207,
4632,
2396,
13,
4706,
11780,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
12277,
1860,
29918,
2084,
29892,
525,
12277,
1860,
29889,
3945,
1495,
13,
4706,
17927,
29889,
3888,
877,
14959,
292,
363,
11780,
472,
1273,
29879,
29915,
1273,
11780,
29918,
1445,
29897,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
275,
1445,
29898,
12277,
1860,
29918,
1445,
1125,
13,
9651,
11780,
29918,
2084,
353,
2897,
29889,
2084,
29889,
25721,
29898,
12277,
1860,
29918,
2084,
29897,
13,
9651,
6773,
13,
13,
4706,
8450,
29918,
6252,
29898,
12277,
1860,
29918,
1445,
29897,
13,
4706,
2867,
13,
13,
13,
1753,
8450,
29918,
6252,
29898,
12277,
1860,
29918,
1445,
1125,
13,
1678,
17927,
29889,
3888,
877,
23271,
292,
9741,
515,
1273,
29879,
29915,
1273,
11780,
29918,
1445,
29897,
13,
1678,
1018,
29901,
13,
4706,
1014,
5014,
29889,
3198,
29918,
4905,
29898,
13,
18884,
518,
9675,
29889,
4258,
9246,
29892,
17411,
29885,
742,
525,
13096,
742,
525,
6252,
742,
17411,
29878,
742,
11780,
29918,
1445,
1402,
13,
18884,
380,
20405,
29922,
1491,
5014,
29889,
1254,
3970,
2692,
13,
18884,
1723,
13,
4706,
17927,
29889,
3888,
877,
3379,
4212,
11780,
29889,
3945,
1495,
13,
1678,
5174,
1014,
5014,
29889,
29907,
4212,
7032,
2392,
408,
321,
29901,
13,
4706,
12020,
2216,
19273,
27107,
2392,
29898,
29872,
29889,
4905,
29889,
13808,
703,
9420,
29899,
29947,
5783,
13,
13,
13,
1753,
1400,
29918,
7620,
29898,
4299,
29892,
2897,
29918,
2084,
29892,
8118,
29918,
12847,
1125,
13,
1678,
9995,
3037,
839,
515,
27441,
25547,
1400,
29899,
7620,
12422,
29889,
2315,
1179,
4078,
310,
405,
29933,
9995,
13,
13,
1678,
565,
1904,
1839,
1853,
2033,
2804,
525,
1333,
19273,
2396,
13,
4706,
736,
13,
1678,
17927,
29889,
3888,
877,
2577,
1259,
24295,
304,
2767,
451,
19273,
1495,
13,
1678,
2767,
29918,
2271,
29892,
2767,
29918,
25347,
29918,
2271,
353,
679,
29918,
5504,
29918,
26045,
580,
13,
1678,
4078,
29918,
1333,
19273,
29898,
5504,
29918,
2271,
29892,
2897,
29918,
2084,
29897,
13,
1678,
5706,
29918,
392,
29918,
7620,
29918,
25347,
29898,
5504,
29918,
25347,
29918,
2271,
29892,
2897,
29918,
2084,
29897,
13,
1678,
17927,
29889,
3888,
877,
3664,
19273,
4078,
4866,
1495,
13,
13,
13,
1753,
679,
29918,
5504,
29918,
26045,
7295,
13,
1678,
9995,
13,
418,
3617,
278,
24295,
4312,
304,
2767,
278,
405,
29933,
29889,
13,
418,
4525,
24295,
1518,
533,
1156,
263,
2846,
6233,
577,
437,
451,
7090,
963,
13,
1678,
9995,
13,
13,
1678,
3132,
353,
679,
29918,
4645,
580,
13,
1678,
23942,
353,
3132,
29889,
1333,
19273,
29879,
29889,
1761,
29918,
5504,
29918,
4965,
29898,
359,
29889,
21813,
1839,
7390,
1299,
19094,
29918,
14824,
17637,
29918,
1367,
11287,
13,
1678,
736,
313,
26045,
29889,
5504,
29918,
2271,
29892,
23942,
29889,
5504,
29918,
25347,
29918,
2271,
29897,
13,
13,
13,
1753,
4078,
29918,
1333,
19273,
29898,
2271,
29892,
2897,
29918,
2084,
1125,
13,
1678,
9995,
349,
1878,
10650,
451,
19273,
304,
317,
29941,
9995,
13,
1678,
411,
1722,
29898,
359,
29918,
2084,
29892,
525,
6050,
1495,
408,
302,
29890,
29918,
1445,
29901,
13,
4706,
17927,
29889,
3888,
877,
29925,
21616,
9281,
451,
19273,
934,
304,
317,
29941,
1495,
13,
4706,
7274,
29889,
649,
29898,
2271,
29892,
848,
29922,
9877,
29918,
1445,
29889,
949,
3101,
13,
4706,
17927,
29889,
3888,
877,
3664,
19273,
934,
4784,
1495,
13,
13,
13,
1753,
5706,
29918,
392,
29918,
7620,
29918,
25347,
29898,
2271,
29892,
2897,
29918,
2084,
1125,
13,
1678,
9995,
26000,
405,
29933,
29899,
294,
29899,
7020,
322,
5503,
393,
934,
304,
317,
29941,
9995,
13,
1678,
270,
29892,
285,
978,
353,
2897,
29889,
2084,
29889,
5451,
29898,
359,
29918,
2084,
29897,
13,
1678,
17927,
29889,
3888,
877,
10716,
292,
451,
19273,
304,
4544,
1495,
13,
1678,
1018,
29901,
13,
4706,
1423,
29918,
4804,
18959,
29926,
786,
25547,
742,
525,
9877,
13441,
742,
525,
489,
517,
742,
525,
1420,
742,
285,
978,
1402,
274,
9970,
29922,
29881,
29897,
13,
1678,
5174,
3037,
839,
7032,
2392,
408,
321,
29901,
13,
4706,
12020,
2216,
19273,
27107,
2392,
877,
9877,
13441,
5229,
304,
3588,
451,
19273,
934,
304,
3472,
29901,
6571,
4286,
4830,
29898,
276,
558,
29898,
29872,
4961,
13,
13,
1678,
25267,
29918,
2084,
353,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
359,
29918,
2084,
9601,
29900,
29962,
718,
15300,
1420,
29915,
13,
1678,
411,
1722,
29898,
25347,
29918,
2084,
29892,
525,
6050,
1495,
408,
25267,
29918,
1445,
29901,
13,
4706,
17927,
29889,
3888,
877,
29925,
21616,
9281,
451,
19273,
25267,
304,
317,
29941,
1495,
13,
4706,
7274,
29889,
649,
29898,
2271,
29892,
848,
29922,
25347,
29918,
1445,
29889,
949,
3101,
13,
4706,
17927,
29889,
3888,
877,
3664,
19273,
25267,
4784,
1495,
13,
13,
13,
1753,
679,
29918,
4645,
7295,
13,
1678,
9995,
910,
4947,
263,
3132,
393,
9906,
1048,
1749,
451,
19273,
1095,
9748,
9995,
13,
13,
1678,
396,
14402,
29901,
3439,
572,
1598,
445,
2748,
278,
451,
19273,
29879,
1095,
9748,
526,
297,
278,
3132,
13,
1678,
736,
14175,
275,
29889,
8787,
4032,
29898,
13237,
2433,
497,
1495,
13,
13,
13,
1990,
2216,
19273,
27107,
2392,
29898,
2451,
1125,
13,
1678,
14550,
13,
1678,
10425,
10940,
591,
7124,
385,
1059,
1811,
304,
4337,
13,
1678,
451,
19273,
848,
1546,
1749,
451,
19273,
322,
7481,
13,
1678,
14550,
13,
13,
13,
21707,
353,
1480,
29918,
13239,
29889,
14669,
29918,
5461,
29918,
21027,
580,
13,
2
] |
club/urls.py
|
reddevilcero/SchoolWeb
| 0 |
1607277
|
<reponame>reddevilcero/SchoolWeb<filename>club/urls.py
from django.urls import path
from .views import ClubListView, ClubDetailView
urlpatterns = [
path('', ClubListView.as_view(), name='club'),
path('<int:pk>/<slug:page_slug>/', ClubDetailView.as_view(),
name='club_details'),
]
|
[
1,
529,
276,
1112,
420,
29958,
1127,
3359,
309,
29883,
1489,
29914,
4504,
1507,
3609,
29966,
9507,
29958,
29066,
29914,
26045,
29889,
2272,
13,
3166,
9557,
29889,
26045,
1053,
2224,
13,
3166,
869,
7406,
1053,
5977,
15660,
29892,
5977,
16570,
1043,
13,
13,
2271,
11037,
29879,
353,
518,
13,
1678,
2224,
877,
742,
5977,
15660,
29889,
294,
29918,
1493,
3285,
1024,
2433,
29066,
5477,
13,
1678,
2224,
877,
29966,
524,
29901,
20571,
20690,
29966,
29517,
29901,
3488,
29918,
29517,
20690,
742,
5977,
16570,
1043,
29889,
294,
29918,
1493,
3285,
13,
308,
1024,
2433,
29066,
29918,
14144,
5477,
13,
1678,
4514,
13,
2
] |
nq_eval_yorko.py
|
Yorko/natural-questions
| 1 |
63740
|
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
r"""Evaluation script for TensorFlow 2.0 Question Answering,
adapted by yorko from nq_eval, Natural Questions
https://ai.google.com/research/NaturalQuestions
https://www.kaggle.com/c/tensorflow2-question-answering/
------------------------------------------------------------------------------
Example usage:
nq_eval_yorko --gold_path=<path-to-gold-files> --predictions_path=<path_to_json>
This will compute both the official F1 scores as well as recall@precision
tables for both long and short answers. Note that R@P are only meaningful
if your model populates the score fields of the prediction JSON format.
gold_path should point to the five way annotated dev data in the
original download format (gzipped jsonlines).
predictions_path should point to a json file containing the predictions in
the format given below.
------------------------------------------------------------------------------
Prediction format:
{'predictions': [
{
'example_id': -2226525965842375672,
'long_answer': {
'start_byte': 62657, 'end_byte': 64776,
'start_token': 391, 'end_token': 604
},
'long_answer_score': 13.5,
'short_answers': [
{'start_byte': 64206, 'end_byte': 64280,
'start_token': 555, 'end_token': 560}, ...],
'short_answers_score': 26.4,
'yes_no_answer': 'NONE'
}, ... ]
}
"""
from collections import OrderedDict
from absl import app
from absl import flags
import eval_utils as util
flags.DEFINE_string(
'gold_path', None, 'Path to the gzip JSON data. For '
'multiple files, should be a glob '
'pattern (e.g. "/path/to/files-*"')
flags.DEFINE_string('predictions_path', None, 'Path to prediction JSON.')
flags.DEFINE_integer('num_threads', 10, 'Number of threads for reading.')
flags.DEFINE_float('score_thres_long', -100, 'Score threshold for long answers')
flags.DEFINE_float('score_thres_short', -100, 'Score threshold for short answers')
FLAGS = flags.FLAGS
def safe_divide(x, y):
"""Compute x / y, but return 0 if y is zero."""
if y == 0:
return 0
else:
return x / y
def score_long_answer(gold_label_list, pred_label, score_thres):
"""Scores a long answer as correct or not.
1) First decide if there is a gold long answer with LONG_NO_NULL_THRESHOLD.
2) The prediction will get a match if:
a. There is a gold long answer.
b. The prediction span match exactly with *one* of the non-null gold
long answer span.
Args:
gold_label_list: A list of NQLabel, could be None.
pred_label: A single NQLabel, could be None.
score_thres; score threshold
Returns:
gold_has_answer, pred_has_answer, is_correct, score
"""
gold_has_answer = util.gold_has_long_answer(gold_label_list)
is_correct = False
score = pred_label.long_score
pred_has_answer = pred_label and (
not pred_label.long_answer_span.is_null_span()) and score >= score_thres
# Both sides are non-null spans.
if gold_has_answer and pred_has_answer:
for gold_label in gold_label_list:
# while the voting results indicate there is an long answer, each
# annotator might still say there is no long answer.
if gold_label.long_answer_span.is_null_span():
continue
if util.nonnull_span_equal(gold_label.long_answer_span,
pred_label.long_answer_span):
is_correct = True
break
return gold_has_answer, pred_has_answer, is_correct, score
def score_short_answer(gold_label_list, pred_label, score_thres):
"""Scores a short answer as correct or not.
1) First decide if there is a gold short answer with SHORT_NO_NULL_THRESHOLD.
2) The prediction will get a match if:
a. There is a gold short answer.
b. The prediction span *set* match exactly with *one* of the non-null gold
short answer span *set*.
Args:
gold_label_list: A list of NQLabel.
pred_label: A single NQLabel.
score_thres: score threshold
Returns:
gold_has_answer, pred_has_answer, is_correct, score
"""
# There is a gold short answer if gold_label_list not empty and non null
# answers is over the threshold (sum over annotators).
gold_has_answer = util.gold_has_short_answer(gold_label_list)
is_correct = False
score = pred_label.short_score
# There is a pred long answer if pred_label is not empty and short answer
# set is not empty.
pred_has_answer = pred_label and (
(not util.is_null_span_list(pred_label.short_answer_span_list)) or
pred_label.yes_no_answer != 'none') and score >= score_thres
# Both sides have short answers, which contains yes/no questions.
if gold_has_answer and pred_has_answer:
if pred_label.yes_no_answer != 'none': # System thinks its y/n questions.
for gold_label in gold_label_list:
if pred_label.yes_no_answer == gold_label.yes_no_answer:
is_correct = True
break
else:
for gold_label in gold_label_list:
if util.span_set_equal(gold_label.short_answer_span_list,
pred_label.short_answer_span_list):
is_correct = True
break
return gold_has_answer, pred_has_answer, is_correct, score
def score_answers(gold_annotation_dict, pred_dict,
score_thres_long, score_thres_short):
"""Scores all answers for all documents.
Args:
gold_annotation_dict: a dict from example id to list of NQLabels.
pred_dict: a dict from example id to list of NQLabels.
score_thres_long: score threshold for long answers
score_thres_short: score threshold for short answers
Returns:
long_answer_stats: List of scores for long answers.
short_answer_stats: List of scores for short answers.
"""
gold_id_set = set(gold_annotation_dict.keys())
pred_id_set = set(pred_dict.keys())
if gold_id_set.symmetric_difference(pred_id_set):
raise ValueError('ERROR: the example ids in gold annotations and example '
'ids in the prediction are not equal.')
long_answer_stats = []
short_answer_stats = []
for example_id in gold_id_set:
gold = gold_annotation_dict[example_id]
pred = pred_dict[example_id]
long_answer_stats.append(score_long_answer(gold, pred, score_thres_long))
short_answer_stats.append(score_short_answer(gold, pred, score_thres_short))
# use the 'score' column, which is last
long_answer_stats.sort(key=lambda x: x[-1], reverse=True)
short_answer_stats.sort(key=lambda x: x[-1], reverse=True)
return long_answer_stats, short_answer_stats
def compute_f1(answer_stats, prefix=''):
"""Computes F1, precision, recall for a list of answer scores.
Args:
answer_stats: List of per-example scores.
prefix (''): Prefix to prepend to score dictionary.
Returns:
Dictionary mapping string names to scores.
"""
has_gold, has_pred, is_correct, _ = list(zip(*answer_stats))
precision = safe_divide(sum(is_correct), sum(has_pred))
recall = safe_divide(sum(is_correct), sum(has_gold))
f1 = safe_divide(2 * precision * recall, precision + recall)
return OrderedDict({
prefix + 'n': len(answer_stats),
prefix + 'f1': f1,
prefix + 'precision': precision,
prefix + 'recall': recall
})
def compute_final_f1(long_answer_stats, short_answer_stats):
"""Computes overall F1 given long and short answers, ignoring scores.
Note: this assumes that the answers have been thresholded.
Arguments:
long_answer_stats: List of long answer scores.
short_answer_stats: List of short answer scores.
Returns:
Dictionary of name (string) -> score.
"""
scores = compute_f1(long_answer_stats, prefix='long-answer-')
scores.update(compute_f1(short_answer_stats, prefix='short-answer-'))
scores.update(compute_f1(long_answer_stats + short_answer_stats, prefix='all-answer-'))
return scores
def main(_):
nq_gold_dict = util.read_annotation(FLAGS.gold_path, n_threads=FLAGS.num_threads)
nq_pred_dict = util.read_prediction_json(FLAGS.predictions_path)
long_answer_stats, short_answer_stats = score_answers(nq_gold_dict,
nq_pred_dict,
score_thres_long=FLAGS.score_thres_long,
score_thres_short=FLAGS.score_thres_short)
# reporting results
print('*' * 20)
scores = compute_final_f1(long_answer_stats, short_answer_stats)
print('*' * 20)
print('SCORES (n={}):'.format(
scores['long-answer-n']))
print(' F1 / P / R')
print('Long answer {: >7.2%} / {: >7.2%} / {: >7.2%}'.format(
scores['long-answer-f1'], scores['long-answer-precision'],
scores['long-answer-recall']))
print('Short answer {: >7.2%} / {: >7.2%} / {: >7.2%}'.format(
scores['short-answer-f1'], scores['short-answer-precision'],
scores['short-answer-recall']))
print('All answers {: >7.2%} / {: >7.2%} / {: >7.2%}'.format(
scores['all-answer-f1'], scores['all-answer-precision'],
scores['all-answer-recall']))
if __name__ == '__main__':
flags.mark_flag_as_required('gold_path')
flags.mark_flag_as_required('predictions_path')
app.run(main)
|
[
1,
396,
14137,
29922,
9420,
29899,
29947,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29947,
450,
5087,
319,
29902,
17088,
8583,
13189,
943,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
29878,
15945,
29908,
29923,
4387,
362,
2471,
363,
323,
6073,
17907,
29871,
29906,
29889,
29900,
894,
673,
292,
29892,
13,
1678,
23430,
491,
343,
548,
29877,
515,
302,
29939,
29918,
14513,
29892,
18385,
894,
29879,
13,
13,
29871,
2045,
597,
1794,
29889,
3608,
29889,
510,
29914,
690,
2842,
29914,
29940,
18771,
2182,
2297,
13,
29871,
2045,
597,
1636,
29889,
29895,
351,
6234,
29889,
510,
29914,
29883,
29914,
29056,
29906,
29899,
12470,
29899,
12011,
292,
29914,
13,
13,
29871,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
29871,
8741,
8744,
29901,
13,
13,
29871,
302,
29939,
29918,
14513,
29918,
29891,
548,
29877,
1192,
29887,
1025,
29918,
2084,
29922,
29966,
2084,
29899,
517,
29899,
29887,
1025,
29899,
5325,
29958,
1192,
27711,
1080,
29918,
2084,
29922,
29966,
2084,
29918,
517,
29918,
3126,
29958,
13,
13,
29871,
910,
674,
10272,
1716,
278,
6221,
383,
29896,
19435,
408,
1532,
408,
17386,
29992,
17990,
2459,
13,
29871,
6131,
363,
1716,
1472,
322,
3273,
6089,
29889,
3940,
393,
390,
29992,
29925,
526,
871,
6593,
1319,
13,
29871,
565,
596,
1904,
14938,
1078,
278,
8158,
4235,
310,
278,
18988,
4663,
3402,
29889,
13,
13,
29871,
7684,
29918,
2084,
881,
1298,
304,
278,
5320,
982,
9732,
630,
2906,
848,
297,
278,
13,
29871,
2441,
5142,
3402,
313,
29887,
2526,
2986,
4390,
9012,
467,
13,
13,
29871,
27303,
29918,
2084,
881,
1298,
304,
263,
4390,
934,
6943,
278,
27303,
297,
13,
29871,
278,
3402,
2183,
2400,
29889,
13,
13,
29871,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
29871,
21099,
2463,
3402,
29901,
13,
13,
29871,
11117,
27711,
1080,
2396,
518,
13,
1678,
426,
13,
418,
525,
4773,
29918,
333,
2396,
448,
29906,
29906,
29906,
29953,
29945,
29906,
29945,
29929,
29953,
29945,
29947,
29946,
29906,
29941,
29955,
29945,
29953,
29955,
29906,
29892,
13,
418,
525,
5426,
29918,
12011,
2396,
426,
13,
4706,
525,
2962,
29918,
10389,
2396,
29871,
29953,
29906,
29953,
29945,
29955,
29892,
525,
355,
29918,
10389,
2396,
29871,
29953,
29946,
29955,
29955,
29953,
29892,
13,
4706,
525,
2962,
29918,
6979,
2396,
29871,
29941,
29929,
29896,
29892,
525,
355,
29918,
6979,
2396,
29871,
29953,
29900,
29946,
13,
418,
2981,
13,
418,
525,
5426,
29918,
12011,
29918,
13628,
2396,
29871,
29896,
29941,
29889,
29945,
29892,
13,
418,
525,
12759,
29918,
550,
17538,
2396,
518,
13,
4706,
11117,
2962,
29918,
10389,
2396,
29871,
29953,
29946,
29906,
29900,
29953,
29892,
525,
355,
29918,
10389,
2396,
29871,
29953,
29946,
29906,
29947,
29900,
29892,
13,
308,
525,
2962,
29918,
6979,
2396,
29871,
29945,
29945,
29945,
29892,
525,
355,
29918,
6979,
2396,
29871,
29945,
29953,
29900,
1118,
2023,
1402,
13,
418,
525,
12759,
29918,
550,
17538,
29918,
13628,
2396,
29871,
29906,
29953,
29889,
29946,
29892,
13,
418,
525,
3582,
29918,
1217,
29918,
12011,
2396,
525,
29940,
12413,
29915,
13,
1678,
2981,
2023,
4514,
13,
29871,
500,
13,
15945,
29908,
13,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
3166,
633,
2536,
1053,
623,
13,
3166,
633,
2536,
1053,
13449,
13,
5215,
19745,
29918,
13239,
408,
3667,
13,
13,
15764,
29889,
24405,
8895,
29918,
1807,
29898,
13,
1678,
525,
29887,
1025,
29918,
2084,
742,
6213,
29892,
525,
2605,
304,
278,
330,
7554,
4663,
848,
29889,
1152,
525,
13,
462,
539,
525,
20787,
2066,
29892,
881,
367,
263,
13149,
525,
13,
462,
539,
525,
11037,
313,
29872,
29889,
29887,
29889,
5591,
2084,
29914,
517,
29914,
5325,
29899,
20605,
1495,
13,
15764,
29889,
24405,
8895,
29918,
1807,
877,
27711,
1080,
29918,
2084,
742,
6213,
29892,
525,
2605,
304,
18988,
4663,
29889,
1495,
13,
15764,
29889,
24405,
8895,
29918,
16031,
877,
1949,
29918,
28993,
742,
29871,
29896,
29900,
29892,
525,
4557,
310,
9717,
363,
5183,
29889,
1495,
13,
15764,
29889,
24405,
8895,
29918,
7411,
877,
13628,
29918,
386,
690,
29918,
5426,
742,
448,
29896,
29900,
29900,
29892,
525,
20097,
16897,
363,
1472,
6089,
1495,
13,
15764,
29889,
24405,
8895,
29918,
7411,
877,
13628,
29918,
386,
690,
29918,
12759,
742,
448,
29896,
29900,
29900,
29892,
525,
20097,
16897,
363,
3273,
6089,
1495,
13,
13,
18823,
10749,
353,
13449,
29889,
18823,
10749,
13,
13,
13,
1753,
9109,
29918,
4563,
680,
29898,
29916,
29892,
343,
1125,
13,
1678,
9995,
20606,
29872,
921,
847,
343,
29892,
541,
736,
29871,
29900,
565,
343,
338,
5225,
1213,
15945,
13,
1678,
565,
343,
1275,
29871,
29900,
29901,
13,
4706,
736,
29871,
29900,
13,
1678,
1683,
29901,
13,
4706,
736,
921,
847,
343,
13,
13,
13,
1753,
8158,
29918,
5426,
29918,
12011,
29898,
29887,
1025,
29918,
1643,
29918,
1761,
29892,
4450,
29918,
1643,
29892,
8158,
29918,
386,
690,
1125,
13,
1678,
9995,
4421,
2361,
263,
1472,
1234,
408,
1959,
470,
451,
29889,
13,
13,
268,
29896,
29897,
3824,
11097,
565,
727,
338,
263,
7684,
1472,
1234,
411,
365,
20614,
29918,
6632,
29918,
10074,
29918,
4690,
1525,
7068,
5607,
29928,
29889,
13,
268,
29906,
29897,
450,
18988,
674,
679,
263,
1993,
565,
29901,
13,
539,
263,
29889,
1670,
338,
263,
7684,
1472,
1234,
29889,
13,
539,
289,
29889,
450,
18988,
10638,
1993,
3721,
411,
334,
650,
29930,
310,
278,
1661,
29899,
4304,
7684,
13,
3986,
1472,
1234,
10638,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
418,
7684,
29918,
1643,
29918,
1761,
29901,
319,
1051,
310,
405,
2239,
1107,
29892,
1033,
367,
6213,
29889,
13,
418,
4450,
29918,
1643,
29901,
319,
2323,
405,
2239,
1107,
29892,
1033,
367,
6213,
29889,
13,
418,
8158,
29918,
386,
690,
29936,
8158,
16897,
13,
13,
1678,
16969,
29901,
13,
418,
7684,
29918,
5349,
29918,
12011,
29892,
4450,
29918,
5349,
29918,
12011,
29892,
338,
29918,
15728,
29892,
8158,
13,
1678,
9995,
13,
1678,
7684,
29918,
5349,
29918,
12011,
353,
3667,
29889,
29887,
1025,
29918,
5349,
29918,
5426,
29918,
12011,
29898,
29887,
1025,
29918,
1643,
29918,
1761,
29897,
13,
13,
1678,
338,
29918,
15728,
353,
7700,
13,
1678,
8158,
353,
4450,
29918,
1643,
29889,
5426,
29918,
13628,
13,
13,
1678,
4450,
29918,
5349,
29918,
12011,
353,
4450,
29918,
1643,
322,
313,
13,
4706,
451,
4450,
29918,
1643,
29889,
5426,
29918,
12011,
29918,
9653,
29889,
275,
29918,
4304,
29918,
9653,
3101,
322,
8158,
6736,
8158,
29918,
386,
690,
13,
13,
1678,
396,
9134,
11192,
526,
1661,
29899,
4304,
805,
550,
29889,
13,
1678,
565,
7684,
29918,
5349,
29918,
12011,
322,
4450,
29918,
5349,
29918,
12011,
29901,
13,
4706,
363,
7684,
29918,
1643,
297,
7684,
29918,
1643,
29918,
1761,
29901,
13,
9651,
396,
1550,
278,
28931,
2582,
12266,
727,
338,
385,
1472,
1234,
29892,
1269,
13,
9651,
396,
9732,
1061,
1795,
1603,
1827,
727,
338,
694,
1472,
1234,
29889,
13,
9651,
565,
7684,
29918,
1643,
29889,
5426,
29918,
12011,
29918,
9653,
29889,
275,
29918,
4304,
29918,
9653,
7295,
13,
18884,
6773,
13,
13,
9651,
565,
3667,
29889,
29876,
3409,
913,
29918,
9653,
29918,
11745,
29898,
29887,
1025,
29918,
1643,
29889,
5426,
29918,
12011,
29918,
9653,
29892,
13,
462,
462,
539,
4450,
29918,
1643,
29889,
5426,
29918,
12011,
29918,
9653,
1125,
13,
18884,
338,
29918,
15728,
353,
5852,
13,
18884,
2867,
13,
13,
1678,
736,
7684,
29918,
5349,
29918,
12011,
29892,
4450,
29918,
5349,
29918,
12011,
29892,
338,
29918,
15728,
29892,
8158,
13,
13,
13,
1753,
8158,
29918,
12759,
29918,
12011,
29898,
29887,
1025,
29918,
1643,
29918,
1761,
29892,
4450,
29918,
1643,
29892,
8158,
29918,
386,
690,
1125,
13,
1678,
9995,
4421,
2361,
263,
3273,
1234,
408,
1959,
470,
451,
29889,
13,
13,
268,
29896,
29897,
3824,
11097,
565,
727,
338,
263,
7684,
3273,
1234,
411,
24972,
8476,
29918,
6632,
29918,
10074,
29918,
4690,
1525,
7068,
5607,
29928,
29889,
13,
268,
29906,
29897,
450,
18988,
674,
679,
263,
1993,
565,
29901,
13,
539,
263,
29889,
1670,
338,
263,
7684,
3273,
1234,
29889,
13,
539,
289,
29889,
450,
18988,
10638,
334,
842,
29930,
1993,
3721,
411,
334,
650,
29930,
310,
278,
1661,
29899,
4304,
7684,
13,
3986,
3273,
1234,
10638,
334,
842,
10521,
13,
13,
1678,
826,
3174,
29901,
13,
418,
7684,
29918,
1643,
29918,
1761,
29901,
319,
1051,
310,
405,
2239,
1107,
29889,
13,
418,
4450,
29918,
1643,
29901,
319,
2323,
405,
2239,
1107,
29889,
13,
418,
8158,
29918,
386,
690,
29901,
8158,
16897,
13,
13,
1678,
16969,
29901,
13,
418,
7684,
29918,
5349,
29918,
12011,
29892,
4450,
29918,
5349,
29918,
12011,
29892,
338,
29918,
15728,
29892,
8158,
13,
1678,
9995,
13,
13,
1678,
396,
1670,
338,
263,
7684,
3273,
1234,
565,
7684,
29918,
1643,
29918,
1761,
451,
4069,
322,
1661,
1870,
13,
1678,
396,
6089,
338,
975,
278,
16897,
313,
2083,
975,
9732,
4097,
467,
13,
1678,
7684,
29918,
5349,
29918,
12011,
353,
3667,
29889,
29887,
1025,
29918,
5349,
29918,
12759,
29918,
12011,
29898,
29887,
1025,
29918,
1643,
29918,
1761,
29897,
13,
13,
1678,
338,
29918,
15728,
353,
7700,
13,
1678,
8158,
353,
4450,
29918,
1643,
29889,
12759,
29918,
13628,
13,
13,
1678,
396,
1670,
338,
263,
4450,
1472,
1234,
565,
4450,
29918,
1643,
338,
451,
4069,
322,
3273,
1234,
13,
1678,
396,
731,
338,
451,
4069,
29889,
13,
1678,
4450,
29918,
5349,
29918,
12011,
353,
4450,
29918,
1643,
322,
313,
13,
9651,
313,
1333,
3667,
29889,
275,
29918,
4304,
29918,
9653,
29918,
1761,
29898,
11965,
29918,
1643,
29889,
12759,
29918,
12011,
29918,
9653,
29918,
1761,
876,
470,
13,
9651,
4450,
29918,
1643,
29889,
3582,
29918,
1217,
29918,
12011,
2804,
525,
9290,
1495,
322,
8158,
6736,
8158,
29918,
386,
690,
13,
13,
1678,
396,
9134,
11192,
505,
3273,
6089,
29892,
607,
3743,
4874,
29914,
1217,
5155,
29889,
13,
1678,
565,
7684,
29918,
5349,
29918,
12011,
322,
4450,
29918,
5349,
29918,
12011,
29901,
13,
4706,
565,
4450,
29918,
1643,
29889,
3582,
29918,
1217,
29918,
12011,
2804,
525,
9290,
2396,
29871,
396,
2184,
22405,
967,
343,
29914,
29876,
5155,
29889,
13,
9651,
363,
7684,
29918,
1643,
297,
7684,
29918,
1643,
29918,
1761,
29901,
13,
18884,
565,
4450,
29918,
1643,
29889,
3582,
29918,
1217,
29918,
12011,
1275,
7684,
29918,
1643,
29889,
3582,
29918,
1217,
29918,
12011,
29901,
13,
462,
1678,
338,
29918,
15728,
353,
5852,
13,
462,
1678,
2867,
13,
4706,
1683,
29901,
13,
9651,
363,
7684,
29918,
1643,
297,
7684,
29918,
1643,
29918,
1761,
29901,
13,
18884,
565,
3667,
29889,
9653,
29918,
842,
29918,
11745,
29898,
29887,
1025,
29918,
1643,
29889,
12759,
29918,
12011,
29918,
9653,
29918,
1761,
29892,
13,
462,
462,
539,
4450,
29918,
1643,
29889,
12759,
29918,
12011,
29918,
9653,
29918,
1761,
1125,
13,
462,
1678,
338,
29918,
15728,
353,
5852,
13,
462,
1678,
2867,
13,
13,
1678,
736,
7684,
29918,
5349,
29918,
12011,
29892,
4450,
29918,
5349,
29918,
12011,
29892,
338,
29918,
15728,
29892,
8158,
13,
13,
13,
1753,
8158,
29918,
550,
17538,
29898,
29887,
1025,
29918,
18317,
29918,
8977,
29892,
4450,
29918,
8977,
29892,
13,
462,
29871,
8158,
29918,
386,
690,
29918,
5426,
29892,
8158,
29918,
386,
690,
29918,
12759,
1125,
13,
1678,
9995,
4421,
2361,
599,
6089,
363,
599,
10701,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
418,
7684,
29918,
18317,
29918,
8977,
29901,
263,
9657,
515,
1342,
1178,
304,
1051,
310,
405,
2239,
1107,
29879,
29889,
13,
418,
4450,
29918,
8977,
29901,
263,
9657,
515,
1342,
1178,
304,
1051,
310,
405,
2239,
1107,
29879,
29889,
13,
418,
8158,
29918,
386,
690,
29918,
5426,
29901,
8158,
16897,
363,
1472,
6089,
13,
418,
8158,
29918,
386,
690,
29918,
12759,
29901,
8158,
16897,
363,
3273,
6089,
13,
13,
1678,
16969,
29901,
13,
418,
1472,
29918,
12011,
29918,
16202,
29901,
2391,
310,
19435,
363,
1472,
6089,
29889,
13,
418,
3273,
29918,
12011,
29918,
16202,
29901,
2391,
310,
19435,
363,
3273,
6089,
29889,
13,
1678,
9995,
13,
1678,
7684,
29918,
333,
29918,
842,
353,
731,
29898,
29887,
1025,
29918,
18317,
29918,
8977,
29889,
8149,
3101,
13,
1678,
4450,
29918,
333,
29918,
842,
353,
731,
29898,
11965,
29918,
8977,
29889,
8149,
3101,
13,
13,
1678,
565,
7684,
29918,
333,
29918,
842,
29889,
11967,
16414,
29918,
29881,
17678,
29898,
11965,
29918,
333,
29918,
842,
1125,
13,
4706,
12020,
7865,
2392,
877,
11432,
29901,
278,
1342,
18999,
297,
7684,
25495,
322,
1342,
525,
13,
462,
308,
525,
4841,
297,
278,
18988,
526,
451,
5186,
29889,
1495,
13,
13,
1678,
1472,
29918,
12011,
29918,
16202,
353,
5159,
13,
1678,
3273,
29918,
12011,
29918,
16202,
353,
5159,
13,
13,
1678,
363,
1342,
29918,
333,
297,
7684,
29918,
333,
29918,
842,
29901,
13,
4706,
7684,
353,
7684,
29918,
18317,
29918,
8977,
29961,
4773,
29918,
333,
29962,
13,
4706,
4450,
353,
4450,
29918,
8977,
29961,
4773,
29918,
333,
29962,
13,
13,
4706,
1472,
29918,
12011,
29918,
16202,
29889,
4397,
29898,
13628,
29918,
5426,
29918,
12011,
29898,
29887,
1025,
29892,
4450,
29892,
8158,
29918,
386,
690,
29918,
5426,
876,
13,
4706,
3273,
29918,
12011,
29918,
16202,
29889,
4397,
29898,
13628,
29918,
12759,
29918,
12011,
29898,
29887,
1025,
29892,
4450,
29892,
8158,
29918,
386,
690,
29918,
12759,
876,
13,
13,
1678,
396,
671,
278,
525,
13628,
29915,
1897,
29892,
607,
338,
1833,
13,
1678,
1472,
29918,
12011,
29918,
16202,
29889,
6605,
29898,
1989,
29922,
2892,
921,
29901,
921,
14352,
29896,
1402,
11837,
29922,
5574,
29897,
13,
1678,
3273,
29918,
12011,
29918,
16202,
29889,
6605,
29898,
1989,
29922,
2892,
921,
29901,
921,
14352,
29896,
1402,
11837,
29922,
5574,
29897,
13,
13,
1678,
736,
1472,
29918,
12011,
29918,
16202,
29892,
3273,
29918,
12011,
29918,
16202,
13,
13,
13,
1753,
10272,
29918,
29888,
29896,
29898,
12011,
29918,
16202,
29892,
10944,
2433,
29374,
13,
1678,
9995,
20606,
267,
383,
29896,
29892,
16716,
29892,
17386,
363,
263,
1051,
310,
1234,
19435,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
418,
1234,
29918,
16202,
29901,
2391,
310,
639,
29899,
4773,
19435,
29889,
13,
418,
10944,
313,
4907,
1125,
349,
9569,
304,
8273,
355,
304,
8158,
8600,
29889,
13,
13,
1678,
16969,
29901,
13,
418,
13343,
10417,
1347,
2983,
304,
19435,
29889,
13,
1678,
9995,
13,
13,
1678,
756,
29918,
29887,
1025,
29892,
756,
29918,
11965,
29892,
338,
29918,
15728,
29892,
903,
353,
1051,
29898,
7554,
10456,
12011,
29918,
16202,
876,
13,
1678,
16716,
353,
9109,
29918,
4563,
680,
29898,
2083,
29898,
275,
29918,
15728,
511,
2533,
29898,
5349,
29918,
11965,
876,
13,
1678,
17386,
353,
9109,
29918,
4563,
680,
29898,
2083,
29898,
275,
29918,
15728,
511,
2533,
29898,
5349,
29918,
29887,
1025,
876,
13,
1678,
285,
29896,
353,
9109,
29918,
4563,
680,
29898,
29906,
334,
16716,
334,
17386,
29892,
16716,
718,
17386,
29897,
13,
13,
1678,
736,
8170,
287,
21533,
3319,
13,
4706,
10944,
718,
525,
29876,
2396,
7431,
29898,
12011,
29918,
16202,
511,
13,
4706,
10944,
718,
525,
29888,
29896,
2396,
285,
29896,
29892,
13,
4706,
10944,
718,
525,
17990,
2459,
2396,
16716,
29892,
13,
4706,
10944,
718,
525,
3757,
497,
2396,
17386,
13,
1678,
5615,
13,
13,
13,
1753,
10272,
29918,
8394,
29918,
29888,
29896,
29898,
5426,
29918,
12011,
29918,
16202,
29892,
3273,
29918,
12011,
29918,
16202,
1125,
13,
1678,
9995,
20606,
267,
12463,
383,
29896,
2183,
1472,
322,
3273,
6089,
29892,
5330,
8253,
19435,
29889,
13,
13,
1678,
3940,
29901,
445,
15894,
393,
278,
6089,
505,
1063,
16897,
287,
29889,
13,
13,
1678,
11842,
9331,
29901,
13,
539,
1472,
29918,
12011,
29918,
16202,
29901,
2391,
310,
1472,
1234,
19435,
29889,
13,
539,
3273,
29918,
12011,
29918,
16202,
29901,
2391,
310,
3273,
1234,
19435,
29889,
13,
13,
1678,
16969,
29901,
13,
539,
13343,
310,
1024,
313,
1807,
29897,
1599,
8158,
29889,
13,
1678,
9995,
13,
1678,
19435,
353,
10272,
29918,
29888,
29896,
29898,
5426,
29918,
12011,
29918,
16202,
29892,
10944,
2433,
5426,
29899,
12011,
29899,
1495,
13,
1678,
19435,
29889,
5504,
29898,
26017,
29918,
29888,
29896,
29898,
12759,
29918,
12011,
29918,
16202,
29892,
10944,
2433,
12759,
29899,
12011,
29899,
8785,
13,
1678,
19435,
29889,
5504,
29898,
26017,
29918,
29888,
29896,
29898,
5426,
29918,
12011,
29918,
16202,
718,
3273,
29918,
12011,
29918,
16202,
29892,
10944,
2433,
497,
29899,
12011,
29899,
8785,
13,
1678,
736,
19435,
13,
13,
13,
1753,
1667,
7373,
1125,
13,
1678,
302,
29939,
29918,
29887,
1025,
29918,
8977,
353,
3667,
29889,
949,
29918,
18317,
29898,
18823,
10749,
29889,
29887,
1025,
29918,
2084,
29892,
302,
29918,
28993,
29922,
18823,
10749,
29889,
1949,
29918,
28993,
29897,
13,
13,
1678,
302,
29939,
29918,
11965,
29918,
8977,
353,
3667,
29889,
949,
29918,
11965,
2463,
29918,
3126,
29898,
18823,
10749,
29889,
27711,
1080,
29918,
2084,
29897,
13,
13,
1678,
1472,
29918,
12011,
29918,
16202,
29892,
3273,
29918,
12011,
29918,
16202,
353,
8158,
29918,
550,
17538,
29898,
29876,
29939,
29918,
29887,
1025,
29918,
8977,
29892,
13,
462,
462,
462,
3986,
302,
29939,
29918,
11965,
29918,
8977,
29892,
13,
462,
462,
462,
3986,
8158,
29918,
386,
690,
29918,
5426,
29922,
18823,
10749,
29889,
13628,
29918,
386,
690,
29918,
5426,
29892,
13,
462,
462,
462,
3986,
8158,
29918,
386,
690,
29918,
12759,
29922,
18823,
10749,
29889,
13628,
29918,
386,
690,
29918,
12759,
29897,
13,
13,
1678,
396,
23415,
2582,
13,
1678,
1596,
877,
29930,
29915,
334,
29871,
29906,
29900,
29897,
13,
13,
1678,
19435,
353,
10272,
29918,
8394,
29918,
29888,
29896,
29898,
5426,
29918,
12011,
29918,
16202,
29892,
3273,
29918,
12011,
29918,
16202,
29897,
13,
1678,
1596,
877,
29930,
29915,
334,
29871,
29906,
29900,
29897,
13,
1678,
1596,
877,
29903,
3217,
15989,
313,
29876,
3790,
29913,
1125,
4286,
4830,
29898,
13,
4706,
19435,
1839,
5426,
29899,
12011,
29899,
29876,
25901,
13,
1678,
1596,
877,
795,
383,
29896,
268,
847,
29871,
349,
418,
847,
29871,
390,
1495,
13,
1678,
1596,
877,
8208,
1234,
29871,
12365,
1405,
29955,
29889,
29906,
29995,
29913,
847,
12365,
1405,
29955,
29889,
29906,
29995,
29913,
847,
12365,
1405,
29955,
29889,
29906,
29995,
29913,
4286,
4830,
29898,
13,
4706,
19435,
1839,
5426,
29899,
12011,
29899,
29888,
29896,
7464,
19435,
1839,
5426,
29899,
12011,
29899,
17990,
2459,
7464,
13,
4706,
19435,
1839,
5426,
29899,
12011,
29899,
3757,
497,
25901,
13,
1678,
1596,
877,
21322,
1234,
12365,
1405,
29955,
29889,
29906,
29995,
29913,
847,
12365,
1405,
29955,
29889,
29906,
29995,
29913,
847,
12365,
1405,
29955,
29889,
29906,
29995,
29913,
4286,
4830,
29898,
13,
4706,
19435,
1839,
12759,
29899,
12011,
29899,
29888,
29896,
7464,
19435,
1839,
12759,
29899,
12011,
29899,
17990,
2459,
7464,
13,
4706,
19435,
1839,
12759,
29899,
12011,
29899,
3757,
497,
25901,
13,
1678,
1596,
877,
3596,
6089,
29871,
12365,
1405,
29955,
29889,
29906,
29995,
29913,
847,
12365,
1405,
29955,
29889,
29906,
29995,
29913,
847,
12365,
1405,
29955,
29889,
29906,
29995,
29913,
4286,
4830,
29898,
13,
4706,
19435,
1839,
497,
29899,
12011,
29899,
29888,
29896,
7464,
19435,
1839,
497,
29899,
12011,
29899,
17990,
2459,
7464,
13,
4706,
19435,
1839,
497,
29899,
12011,
29899,
3757,
497,
25901,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
13449,
29889,
3502,
29918,
15581,
29918,
294,
29918,
12403,
877,
29887,
1025,
29918,
2084,
1495,
13,
1678,
13449,
29889,
3502,
29918,
15581,
29918,
294,
29918,
12403,
877,
27711,
1080,
29918,
2084,
1495,
13,
1678,
623,
29889,
3389,
29898,
3396,
29897,
13,
2
] |
awscfncli2/cli/monkeypatch_clickcompletion.py
|
alytle/awscfncli
| 60 |
88659
|
<reponame>alytle/awscfncli
from click import MultiCommand
from click_completion.core import resolve_ctx, match, Option, Argument, \
completion_configuration
def get_choices(cli, prog_name, args, incomplete):
"""
Parameters
----------
cli : click.Command
The main click Command of the program
prog_name : str
The program name on the command line
args : [str]
The arguments already written by the user on the command line
incomplete : str
The partial argument to complete
Returns
-------
[(str, str)]
A list of completion results. The first element of each tuple is actually the argument to complete, the second
element is an help string for this argument.
"""
ctx = resolve_ctx(cli, prog_name, args)
if ctx is None:
return
optctx = None
if args:
options = [param
for param in ctx.command.get_params(ctx)
if isinstance(param, Option)]
arguments = [param
for param in ctx.command.get_params(ctx)
if isinstance(param, Argument)]
for param in options:
if not param.is_flag and args[-1] in param.opts + param.secondary_opts:
optctx = param
if optctx is None:
for param in arguments:
if (
not incomplete.startswith("-")
and (
ctx.params.get(param.name) in (None, ())
or param.nargs == -1
)
):
optctx = param
break
choices = []
if optctx:
choices += [c if isinstance(c, tuple) else (c, None) for c in
optctx.type.complete(ctx, incomplete)]
if not choices and hasattr(optctx,
'autocompletion') and optctx.autocompletion is not None:
dynamic_completions = optctx.autocompletion(ctx=ctx, args=args,
incomplete=incomplete)
choices += [c if isinstance(c, tuple) else (c, None) for c in
dynamic_completions]
else:
for param in ctx.command.get_params(ctx):
if (
completion_configuration.complete_options or incomplete and not incomplete[
:1].isalnum()) and isinstance(
param, Option):
# filter hidden click.Option
if getattr(param, 'hidden', False):
continue
for opt in param.opts:
if match(opt, incomplete):
choices.append((opt, param.help))
for opt in param.secondary_opts:
if match(opt, incomplete):
# don't put the doc so fish won't group the primary and
# and secondary options
choices.append((opt, None))
if isinstance(ctx.command, MultiCommand):
for name in ctx.command.list_commands(ctx):
if match(name, incomplete):
choices.append(
(name, ctx.command.get_command_short_help(ctx, name)))
for item, help in choices:
yield (item, help)
def monkey_patch():
import click_completion
click_completion.core.get_choices = get_choices
|
[
1,
529,
276,
1112,
420,
29958,
284,
3637,
280,
29914,
1450,
1557,
9144,
11303,
13,
3166,
2828,
1053,
14974,
6255,
13,
3166,
2828,
29918,
5729,
12757,
29889,
3221,
1053,
8814,
29918,
13073,
29892,
1993,
29892,
10831,
29892,
23125,
29892,
320,
13,
1678,
13285,
29918,
13305,
13,
13,
13,
1753,
679,
29918,
1859,
1575,
29898,
11303,
29892,
410,
29887,
29918,
978,
29892,
6389,
29892,
28907,
1125,
13,
1678,
9995,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
9335,
584,
2828,
29889,
6255,
13,
4706,
450,
1667,
2828,
10516,
310,
278,
1824,
13,
1678,
410,
29887,
29918,
978,
584,
851,
13,
4706,
450,
1824,
1024,
373,
278,
1899,
1196,
13,
1678,
6389,
584,
518,
710,
29962,
13,
4706,
450,
6273,
2307,
3971,
491,
278,
1404,
373,
278,
1899,
1196,
13,
1678,
28907,
584,
851,
13,
4706,
450,
7687,
2980,
304,
4866,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
17288,
710,
29892,
851,
4638,
13,
4706,
319,
1051,
310,
13285,
2582,
29889,
450,
937,
1543,
310,
1269,
18761,
338,
2869,
278,
2980,
304,
4866,
29892,
278,
1473,
13,
4706,
1543,
338,
385,
1371,
1347,
363,
445,
2980,
29889,
13,
1678,
9995,
13,
1678,
12893,
353,
8814,
29918,
13073,
29898,
11303,
29892,
410,
29887,
29918,
978,
29892,
6389,
29897,
13,
1678,
565,
12893,
338,
6213,
29901,
13,
4706,
736,
13,
1678,
3523,
13073,
353,
6213,
13,
1678,
565,
6389,
29901,
13,
4706,
3987,
353,
518,
3207,
13,
462,
259,
363,
1828,
297,
12893,
29889,
6519,
29889,
657,
29918,
7529,
29898,
13073,
29897,
13,
462,
259,
565,
338,
8758,
29898,
3207,
29892,
10831,
4638,
13,
4706,
6273,
353,
518,
3207,
13,
462,
268,
363,
1828,
297,
12893,
29889,
6519,
29889,
657,
29918,
7529,
29898,
13073,
29897,
13,
462,
268,
565,
338,
8758,
29898,
3207,
29892,
23125,
4638,
13,
4706,
363,
1828,
297,
3987,
29901,
13,
9651,
565,
451,
1828,
29889,
275,
29918,
15581,
322,
6389,
14352,
29896,
29962,
297,
1828,
29889,
25707,
718,
1828,
29889,
7496,
653,
29918,
25707,
29901,
13,
18884,
3523,
13073,
353,
1828,
13,
4706,
565,
3523,
13073,
338,
6213,
29901,
13,
9651,
363,
1828,
297,
6273,
29901,
13,
18884,
565,
313,
13,
462,
4706,
451,
28907,
29889,
27382,
2541,
703,
29899,
1159,
13,
462,
4706,
322,
313,
13,
462,
4706,
12893,
29889,
7529,
29889,
657,
29898,
3207,
29889,
978,
29897,
297,
313,
8516,
29892,
313,
876,
13,
462,
4706,
470,
1828,
29889,
29876,
5085,
1275,
448,
29896,
13,
18884,
1723,
13,
462,
1125,
13,
462,
1678,
3523,
13073,
353,
1828,
13,
462,
1678,
2867,
13,
1678,
19995,
353,
5159,
13,
1678,
565,
3523,
13073,
29901,
13,
4706,
19995,
4619,
518,
29883,
565,
338,
8758,
29898,
29883,
29892,
18761,
29897,
1683,
313,
29883,
29892,
6213,
29897,
363,
274,
297,
13,
462,
1678,
3523,
13073,
29889,
1853,
29889,
8835,
29898,
13073,
29892,
28907,
4638,
13,
4706,
565,
451,
19995,
322,
756,
5552,
29898,
3670,
13073,
29892,
13,
462,
462,
259,
525,
6921,
5729,
12757,
1495,
322,
3523,
13073,
29889,
6921,
5729,
12757,
338,
451,
6213,
29901,
13,
9651,
7343,
29918,
5729,
29873,
1080,
353,
3523,
13073,
29889,
6921,
5729,
12757,
29898,
13073,
29922,
13073,
29892,
6389,
29922,
5085,
29892,
13,
462,
462,
462,
4706,
28907,
29922,
262,
8835,
29897,
13,
9651,
19995,
4619,
518,
29883,
565,
338,
8758,
29898,
29883,
29892,
18761,
29897,
1683,
313,
29883,
29892,
6213,
29897,
363,
274,
297,
13,
462,
4706,
7343,
29918,
5729,
29873,
1080,
29962,
13,
1678,
1683,
29901,
13,
4706,
363,
1828,
297,
12893,
29889,
6519,
29889,
657,
29918,
7529,
29898,
13073,
1125,
13,
9651,
565,
313,
13,
462,
1678,
13285,
29918,
13305,
29889,
8835,
29918,
6768,
470,
28907,
322,
451,
28907,
29961,
13,
462,
462,
462,
462,
462,
1678,
584,
29896,
1822,
275,
284,
1949,
3101,
322,
338,
8758,
29898,
13,
462,
1678,
1828,
29892,
10831,
1125,
13,
18884,
396,
4175,
7934,
2828,
29889,
8375,
13,
18884,
565,
679,
5552,
29898,
3207,
29892,
525,
10892,
742,
7700,
1125,
13,
462,
1678,
6773,
13,
18884,
363,
3523,
297,
1828,
29889,
25707,
29901,
13,
462,
1678,
565,
1993,
29898,
3670,
29892,
28907,
1125,
13,
462,
4706,
19995,
29889,
4397,
3552,
3670,
29892,
1828,
29889,
8477,
876,
13,
18884,
363,
3523,
297,
1828,
29889,
7496,
653,
29918,
25707,
29901,
13,
462,
1678,
565,
1993,
29898,
3670,
29892,
28907,
1125,
13,
462,
4706,
396,
1016,
29915,
29873,
1925,
278,
1574,
577,
9427,
2113,
29915,
29873,
2318,
278,
7601,
322,
13,
462,
4706,
396,
322,
16723,
3987,
13,
462,
4706,
19995,
29889,
4397,
3552,
3670,
29892,
6213,
876,
13,
4706,
565,
338,
8758,
29898,
13073,
29889,
6519,
29892,
14974,
6255,
1125,
13,
9651,
363,
1024,
297,
12893,
29889,
6519,
29889,
1761,
29918,
26381,
29898,
13073,
1125,
13,
18884,
565,
1993,
29898,
978,
29892,
28907,
1125,
13,
462,
1678,
19995,
29889,
4397,
29898,
13,
462,
4706,
313,
978,
29892,
12893,
29889,
6519,
29889,
657,
29918,
6519,
29918,
12759,
29918,
8477,
29898,
13073,
29892,
1024,
4961,
13,
13,
1678,
363,
2944,
29892,
1371,
297,
19995,
29901,
13,
4706,
7709,
313,
667,
29892,
1371,
29897,
13,
13,
13,
1753,
1601,
1989,
29918,
5041,
7295,
13,
1678,
1053,
2828,
29918,
5729,
12757,
13,
1678,
2828,
29918,
5729,
12757,
29889,
3221,
29889,
657,
29918,
1859,
1575,
353,
679,
29918,
1859,
1575,
13,
2
] |
server/game/action.py
|
artemb/zombie-plague
| 0 |
122477
|
from enum import Enum
class Action:
def __init__(self, ap):
self.ap = ap
class StepAction(Action):
def __init__(self):
super().__init__(1)
def run(self, char, step):
char.step(step)
class TurnAction(Action):
def __init__(self):
super().__init__(1)
def run(self, char, turn):
char.turn(turn)
class ActionType(Enum):
STEP = 'STEP', StepAction()
TURN = 'TURN', TurnAction()
def __new__(cls, value, action=None):
obj = object.__new__(cls)
obj._value_ = value
obj.action = action
return obj
class Turn(Enum):
LEFT = 'LEFT'
RIGHT = 'RIGHT'
class Direction(Enum):
UP = 'UP', (0, -1)
DOWN = 'DOWN', (0, 1)
RIGHT = 'RIGHT', (1, 0)
LEFT = 'LEFT', (-1, 0)
def __new__(cls, value, vector):
obj = object.__new__(cls)
obj._value_ = value
obj.vector = vector
return obj
def turn(self, turn: Turn):
if self == Direction.RIGHT:
return Direction.UP if turn == Turn.LEFT else Direction.DOWN
elif self == Direction.UP:
return Direction.LEFT if turn == Turn.LEFT else Direction.RIGHT
elif self == Direction.LEFT:
return Direction.DOWN if turn == Turn.LEFT else Direction.UP
elif self == Direction.DOWN:
return Direction.RIGHT if turn == Turn.LEFT else Direction.LEFT
class Step(Enum):
FORWARD = 'FORWARD', 1
BACKWARD = 'BACKWARD', -1
def __new__(cls, value, modifier):
obj = object.__new__(cls)
obj._value_ = value
obj.modifier = modifier
return obj
|
[
1,
515,
14115,
1053,
1174,
398,
13,
13,
13,
1990,
9123,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3095,
1125,
13,
4706,
1583,
29889,
481,
353,
3095,
13,
13,
13,
1990,
16696,
4276,
29898,
4276,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
2344,
12035,
29896,
29897,
13,
13,
1678,
822,
1065,
29898,
1311,
29892,
1373,
29892,
4331,
1125,
13,
4706,
1373,
29889,
10568,
29898,
10568,
29897,
13,
13,
13,
1990,
9603,
4276,
29898,
4276,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
2344,
12035,
29896,
29897,
13,
13,
1678,
822,
1065,
29898,
1311,
29892,
1373,
29892,
2507,
1125,
13,
4706,
1373,
29889,
685,
29898,
685,
29897,
13,
13,
13,
1990,
9123,
1542,
29898,
16854,
1125,
13,
1678,
317,
4330,
29925,
353,
525,
1254,
15488,
742,
16696,
4276,
580,
13,
1678,
323,
24015,
353,
525,
29911,
24015,
742,
9603,
4276,
580,
13,
13,
1678,
822,
4770,
1482,
12035,
25932,
29892,
995,
29892,
3158,
29922,
8516,
1125,
13,
4706,
5446,
353,
1203,
17255,
1482,
12035,
25932,
29897,
13,
4706,
5446,
3032,
1767,
29918,
353,
995,
13,
4706,
5446,
29889,
2467,
353,
3158,
13,
4706,
736,
5446,
13,
13,
13,
1990,
9603,
29898,
16854,
1125,
13,
1678,
19246,
353,
525,
28024,
29915,
13,
1678,
390,
22530,
353,
525,
22789,
3912,
29915,
13,
13,
13,
1990,
360,
8684,
29898,
16854,
1125,
13,
1678,
11901,
353,
525,
4897,
742,
313,
29900,
29892,
448,
29896,
29897,
13,
1678,
360,
9806,
29940,
353,
525,
3970,
16048,
742,
313,
29900,
29892,
29871,
29896,
29897,
13,
1678,
390,
22530,
353,
525,
22789,
3912,
742,
313,
29896,
29892,
29871,
29900,
29897,
13,
1678,
19246,
353,
525,
28024,
742,
8521,
29896,
29892,
29871,
29900,
29897,
13,
13,
1678,
822,
4770,
1482,
12035,
25932,
29892,
995,
29892,
4608,
1125,
13,
4706,
5446,
353,
1203,
17255,
1482,
12035,
25932,
29897,
13,
4706,
5446,
3032,
1767,
29918,
353,
995,
13,
4706,
5446,
29889,
8111,
353,
4608,
13,
4706,
736,
5446,
13,
13,
1678,
822,
2507,
29898,
1311,
29892,
2507,
29901,
9603,
1125,
13,
4706,
565,
1583,
1275,
360,
8684,
29889,
22789,
3912,
29901,
13,
9651,
736,
360,
8684,
29889,
4897,
565,
2507,
1275,
9603,
29889,
28024,
1683,
360,
8684,
29889,
3970,
16048,
13,
4706,
25342,
1583,
1275,
360,
8684,
29889,
4897,
29901,
13,
9651,
736,
360,
8684,
29889,
28024,
565,
2507,
1275,
9603,
29889,
28024,
1683,
360,
8684,
29889,
22789,
3912,
13,
4706,
25342,
1583,
1275,
360,
8684,
29889,
28024,
29901,
13,
9651,
736,
360,
8684,
29889,
3970,
16048,
565,
2507,
1275,
9603,
29889,
28024,
1683,
360,
8684,
29889,
4897,
13,
4706,
25342,
1583,
1275,
360,
8684,
29889,
3970,
16048,
29901,
13,
9651,
736,
360,
8684,
29889,
22789,
3912,
565,
2507,
1275,
9603,
29889,
28024,
1683,
360,
8684,
29889,
28024,
13,
13,
13,
1990,
16696,
29898,
16854,
1125,
13,
1678,
15842,
29956,
17011,
353,
525,
22051,
29956,
17011,
742,
29871,
29896,
13,
1678,
350,
11375,
29956,
17011,
353,
525,
29933,
11375,
29956,
17011,
742,
448,
29896,
13,
13,
1678,
822,
4770,
1482,
12035,
25932,
29892,
995,
29892,
878,
3709,
1125,
13,
4706,
5446,
353,
1203,
17255,
1482,
12035,
25932,
29897,
13,
4706,
5446,
3032,
1767,
29918,
353,
995,
13,
4706,
5446,
29889,
26625,
353,
878,
3709,
13,
4706,
736,
5446,
2
] |
src/astrolib/integration/euler.py
|
space-geek/integrationutils
| 0 |
150191
|
from typing import Callable
from typing import Tuple
from astrolib.base_objects import Matrix
from astrolib.base_objects import TimeSpan
def integrate(t_0: TimeSpan, X_0: Matrix, h: TimeSpan, dynamics_func: Callable[[TimeSpan, Matrix],Matrix]) -> Tuple[TimeSpan, Matrix, TimeSpan]:
""" Function utilizes a first-order/Euler integration scheme to integrate
the input state from the initial to the final epoch.
Arguments:
t_0 (TimeSpan) Epoch of the initial state.
X_0 (Matrix) Initial state vector, in column matrix form.
h (TimeSpan) Step size for integration step to take.
dynamics_func ([Callable[TimeSpan, Matrix],Matrix]) State vector dynamics function.
Returns:
Tuple[TimeSpan, Matrix, TimeSpan] Tuple of the propagated state vector epoch, the
propagated state vector, and the step size taken.
"""
return t_0 + h, X_0 + h.to_seconds() * dynamics_func(t_0, X_0), h
|
[
1,
515,
19229,
1053,
8251,
519,
13,
3166,
19229,
1053,
12603,
552,
13,
13,
3166,
8717,
307,
1982,
29889,
3188,
29918,
12650,
1053,
22513,
13,
3166,
8717,
307,
1982,
29889,
3188,
29918,
12650,
1053,
5974,
15495,
13,
13,
13,
1753,
22782,
29898,
29873,
29918,
29900,
29901,
5974,
15495,
29892,
1060,
29918,
29900,
29901,
22513,
29892,
298,
29901,
5974,
15495,
29892,
19753,
29918,
9891,
29901,
8251,
519,
8999,
2481,
15495,
29892,
22513,
1402,
14609,
2314,
1599,
12603,
552,
29961,
2481,
15495,
29892,
22513,
29892,
5974,
15495,
5387,
13,
1678,
9995,
6680,
3667,
7093,
263,
937,
29899,
2098,
29914,
29923,
8584,
13465,
11380,
304,
22782,
13,
4706,
278,
1881,
2106,
515,
278,
2847,
304,
278,
2186,
21502,
305,
29889,
13,
13,
1678,
11842,
9331,
29901,
13,
4706,
260,
29918,
29900,
313,
2481,
15495,
29897,
462,
462,
418,
382,
1129,
305,
310,
278,
2847,
2106,
29889,
13,
4706,
1060,
29918,
29900,
313,
14609,
29897,
462,
462,
4706,
17250,
2106,
4608,
29892,
297,
1897,
4636,
883,
29889,
13,
4706,
298,
313,
2481,
15495,
29897,
462,
462,
4706,
16696,
2159,
363,
13465,
4331,
304,
2125,
29889,
13,
4706,
19753,
29918,
9891,
9310,
5594,
519,
29961,
2481,
15495,
29892,
22513,
1402,
14609,
2314,
4306,
4608,
19753,
740,
29889,
13,
13,
1678,
16969,
29901,
13,
4706,
12603,
552,
29961,
2481,
15495,
29892,
22513,
29892,
5974,
15495,
29962,
462,
259,
12603,
552,
310,
278,
13089,
630,
2106,
4608,
21502,
305,
29892,
278,
13,
462,
462,
462,
9651,
13089,
630,
2106,
4608,
29892,
322,
278,
4331,
2159,
4586,
29889,
13,
1678,
9995,
13,
1678,
736,
260,
29918,
29900,
718,
298,
29892,
1060,
29918,
29900,
718,
298,
29889,
517,
29918,
23128,
580,
334,
19753,
29918,
9891,
29898,
29873,
29918,
29900,
29892,
1060,
29918,
29900,
511,
298,
13,
2
] |
tests/test_sqlite_joins.py
|
WinVector/data_algebra
| 37 |
191720
|
import numpy
import data_algebra
import data_algebra.test_util
import data_algebra.util
from data_algebra.data_ops import *
import data_algebra.SQLite
import data_algebra.MySQL
direct_test_sqlite = False
def test_sqlite_joins_left_to_right():
sqlite_handle = None
if direct_test_sqlite:
sqlite_handle = data_algebra.SQLite.example_handle()
# No none keys, as they treat missingness different
# in Pandas and databases
d1 = data_algebra.default_data_model.pd.DataFrame({
'g': ['a', 'a', 'b', 'b', 'b'],
'v1': [1, None, 3, 4, None],
'v2': [None, 1, 2, 7, 8],
})
d2 = data_algebra.default_data_model.pd.DataFrame({
'g': ['c', 'b', 'b'],
'v1': [None, 1, None],
'v2': [1, None, 2],
})
ops_1 = descr(d1=d1).natural_join(b=descr(d2=d2), by=['g'], jointype='left')
expect_1 = data_algebra.default_data_model.pd.DataFrame({
'g': ['a', 'a', 'b', 'b', 'b', 'b', 'b', 'b'],
'v1': [1.0, None, 3.0, 3.0, 4.0, 4.0, 1.0, None],
'v2': [None, 1.0, 2.0, 2.0, 7.0, 7.0, 8.0, 8.0],
})
res_1 = ops_1.eval({'d1': d1, 'd2': d2})
assert data_algebra.test_util.equivalent_frames(res_1, expect_1)
if direct_test_sqlite:
print(sqlite_handle.to_sql(ops_1))
data_algebra.test_util.check_transform(
ops=ops_1,
data={'d1': d1, 'd2': d2},
expect=expect_1,
models_to_skip={str(data_algebra.MySQL.MySQLModel())},)
ops_2 = descr(d1=d1).natural_join(b=descr(d2=d2), by=['g'], jointype='right')
expect_2 = data_algebra.default_data_model.pd.DataFrame({
'g': ['c', 'b', 'b', 'b', 'b', 'b', 'b'],
'v1': [None, 3.0, 4.0, 1.0, 3.0, 4.0, None],
'v2': [1.0, 2.0, 7.0, 8.0, 2.0, 7.0, 8.0],
})
res_2 = ops_2.eval({'d1': d1, 'd2': d2})
assert data_algebra.test_util.equivalent_frames(res_2, expect_2)
if direct_test_sqlite:
print(sqlite_handle.to_sql(ops_2))
data_algebra.test_util.check_transform(
ops=ops_2,
data={'d1': d1, 'd2': d2},
expect=expect_2,
models_to_skip={str(data_algebra.MySQL.MySQLModel())},)
# check test is strong enough
assert not data_algebra.test_util.equivalent_frames(expect_1, expect_2)
# naive reversal (interferes with coalesce)
ops_n = descr(d2=d2).natural_join(b=descr(d1=d1), by=['g'], jointype='left')
res_n = ops_n.eval({'d1': d1, 'd2': d2})
assert not data_algebra.test_util.equivalent_frames(res_n, expect_1)
assert not data_algebra.test_util.equivalent_frames(res_n, expect_2)
if sqlite_handle is not None:
sqlite_handle.close()
def test_sqlite_joins_simulate_full_join():
sqlite_handle = None
if direct_test_sqlite:
sqlite_handle = data_algebra.SQLite.example_handle()
d1 = data_algebra.default_data_model.pd.DataFrame({
'g': ['a', 'a', 'b', 'b', 'b'],
'v1': [1, None, 3, 4, None],
'v2': [None, 1, None, 7, 8],
})
d2 = data_algebra.default_data_model.pd.DataFrame({
'g': ['c', 'b', 'b'],
'v1': [None, 1, None],
'v2': [1, None, 2],
})
join_columns = ['g']
ops = (
descr(d1=d1)
.natural_join(
b=descr(d2=d2),
by=join_columns,
jointype='full')
)
res_pandas = ops.eval({'d1': d1, 'd2': d2})
if direct_test_sqlite:
print(sqlite_handle.to_sql(ops))
data_algebra.test_util.check_transform(
ops=ops,
data={'d1': d1, 'd2': d2},
expect=res_pandas,
models_to_skip={str(data_algebra.MySQL.MySQLModel())},)
ops_simulate = (
# get shared key set
descr(d1=d1)
.project({}, group_by=join_columns)
.concat_rows(
b=descr(d2=d2)
.project({}, group_by=join_columns),
id_column=None,
)
.project({}, group_by=join_columns)
# simulate full join with left joins
.natural_join(
b=descr(d1=d1),
by=join_columns,
jointype='left')
.natural_join(
b=descr(d2=d2),
by=join_columns,
jointype='left')
)
data_algebra.test_util.check_transform(
ops=ops_simulate,
data={'d1': d1, 'd2': d2},
expect=res_pandas,
models_to_skip={str(data_algebra.MySQL.MySQLModel())},)
if sqlite_handle is not None:
sqlite_handle.close()
def test_sqlite_joins_staged():
sqlite_handle = None
if direct_test_sqlite:
sqlite_handle = data_algebra.SQLite.example_handle()
d1 = data_algebra.default_data_model.pd.DataFrame({
'g': ['a', 'a', 'b', 'b', 'b'],
'v1': [1, None, 3, 4, None],
'v2': [None, 1, None, 7, 8],
})
d2 = data_algebra.default_data_model.pd.DataFrame({
'g': ['c', 'b', 'b'],
'v1': [None, 1, None],
'v2': [1, None, 2],
})
join_columns = ['g']
ops = (
descr(d1=d1)
.extend({'v1': 'v1 * v1'})
.natural_join(
b=(
descr(d2=d2)
.extend({'v2': 'v2 + v2'})),
by=join_columns,
jointype='full')
)
res_pandas = ops.eval({'d1': d1, 'd2': d2})
if direct_test_sqlite:
print(sqlite_handle.to_sql(ops))
data_algebra.test_util.check_transform(
ops=ops,
data={'d1': d1, 'd2': d2},
expect=res_pandas,
models_to_skip={str(data_algebra.MySQL.MySQLModel())}, )
if sqlite_handle is not None:
sqlite_handle.close()
|
[
1,
29871,
13,
5215,
12655,
13,
13,
5215,
848,
29918,
15742,
13,
5215,
848,
29918,
15742,
29889,
1688,
29918,
4422,
13,
5215,
848,
29918,
15742,
29889,
4422,
13,
3166,
848,
29918,
15742,
29889,
1272,
29918,
3554,
1053,
334,
13,
5215,
848,
29918,
15742,
29889,
4176,
568,
13,
5215,
848,
29918,
15742,
29889,
3421,
4176,
13,
13,
11851,
29918,
1688,
29918,
22793,
353,
7700,
13,
13,
13,
1753,
1243,
29918,
22793,
29918,
2212,
1144,
29918,
1563,
29918,
517,
29918,
1266,
7295,
13,
1678,
21120,
29918,
8411,
353,
6213,
13,
1678,
565,
1513,
29918,
1688,
29918,
22793,
29901,
13,
4706,
21120,
29918,
8411,
353,
848,
29918,
15742,
29889,
4176,
568,
29889,
4773,
29918,
8411,
580,
13,
13,
1678,
396,
1939,
5642,
6611,
29892,
408,
896,
7539,
4567,
2264,
1422,
13,
1678,
396,
297,
349,
7086,
322,
21218,
13,
1678,
270,
29896,
353,
848,
29918,
15742,
29889,
4381,
29918,
1272,
29918,
4299,
29889,
15926,
29889,
17271,
3319,
13,
4706,
525,
29887,
2396,
6024,
29874,
742,
525,
29874,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
7464,
13,
4706,
525,
29894,
29896,
2396,
518,
29896,
29892,
6213,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
6213,
1402,
13,
4706,
525,
29894,
29906,
2396,
518,
8516,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29955,
29892,
29871,
29947,
1402,
13,
1678,
5615,
13,
13,
1678,
270,
29906,
353,
848,
29918,
15742,
29889,
4381,
29918,
1272,
29918,
4299,
29889,
15926,
29889,
17271,
3319,
13,
4706,
525,
29887,
2396,
6024,
29883,
742,
525,
29890,
742,
525,
29890,
7464,
13,
4706,
525,
29894,
29896,
2396,
518,
8516,
29892,
29871,
29896,
29892,
6213,
1402,
13,
4706,
525,
29894,
29906,
2396,
518,
29896,
29892,
6213,
29892,
29871,
29906,
1402,
13,
1678,
5615,
13,
13,
1678,
288,
567,
29918,
29896,
353,
5153,
29878,
29898,
29881,
29896,
29922,
29881,
29896,
467,
25047,
29918,
7122,
29898,
29890,
29922,
2783,
7283,
29898,
29881,
29906,
29922,
29881,
29906,
511,
491,
29922,
1839,
29887,
7464,
14002,
668,
2433,
1563,
1495,
13,
1678,
2149,
29918,
29896,
353,
848,
29918,
15742,
29889,
4381,
29918,
1272,
29918,
4299,
29889,
15926,
29889,
17271,
3319,
13,
4706,
525,
29887,
2396,
6024,
29874,
742,
525,
29874,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
7464,
13,
4706,
525,
29894,
29896,
2396,
518,
29896,
29889,
29900,
29892,
6213,
29892,
29871,
29941,
29889,
29900,
29892,
29871,
29941,
29889,
29900,
29892,
29871,
29946,
29889,
29900,
29892,
29871,
29946,
29889,
29900,
29892,
29871,
29896,
29889,
29900,
29892,
6213,
1402,
13,
4706,
525,
29894,
29906,
2396,
518,
8516,
29892,
29871,
29896,
29889,
29900,
29892,
29871,
29906,
29889,
29900,
29892,
29871,
29906,
29889,
29900,
29892,
29871,
29955,
29889,
29900,
29892,
29871,
29955,
29889,
29900,
29892,
29871,
29947,
29889,
29900,
29892,
29871,
29947,
29889,
29900,
1402,
13,
4706,
5615,
13,
1678,
620,
29918,
29896,
353,
288,
567,
29918,
29896,
29889,
14513,
3319,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1800,
13,
1678,
4974,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
1686,
27445,
29918,
19935,
29898,
690,
29918,
29896,
29892,
2149,
29918,
29896,
29897,
13,
1678,
565,
1513,
29918,
1688,
29918,
22793,
29901,
13,
4706,
1596,
29898,
22793,
29918,
8411,
29889,
517,
29918,
2850,
29898,
3554,
29918,
29896,
876,
13,
1678,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
3198,
29918,
9067,
29898,
13,
4706,
288,
567,
29922,
3554,
29918,
29896,
29892,
13,
4706,
848,
3790,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1118,
13,
4706,
2149,
29922,
17854,
29918,
29896,
29892,
13,
4706,
4733,
29918,
517,
29918,
11014,
3790,
710,
29898,
1272,
29918,
15742,
29889,
3421,
4176,
29889,
3421,
4176,
3195,
3101,
1118,
29897,
13,
13,
1678,
288,
567,
29918,
29906,
353,
5153,
29878,
29898,
29881,
29896,
29922,
29881,
29896,
467,
25047,
29918,
7122,
29898,
29890,
29922,
2783,
7283,
29898,
29881,
29906,
29922,
29881,
29906,
511,
491,
29922,
1839,
29887,
7464,
14002,
668,
2433,
1266,
1495,
13,
1678,
2149,
29918,
29906,
353,
848,
29918,
15742,
29889,
4381,
29918,
1272,
29918,
4299,
29889,
15926,
29889,
17271,
3319,
13,
4706,
525,
29887,
2396,
6024,
29883,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
7464,
13,
4706,
525,
29894,
29896,
2396,
518,
8516,
29892,
29871,
29941,
29889,
29900,
29892,
29871,
29946,
29889,
29900,
29892,
29871,
29896,
29889,
29900,
29892,
29871,
29941,
29889,
29900,
29892,
29871,
29946,
29889,
29900,
29892,
6213,
1402,
13,
4706,
525,
29894,
29906,
2396,
518,
29896,
29889,
29900,
29892,
29871,
29906,
29889,
29900,
29892,
29871,
29955,
29889,
29900,
29892,
29871,
29947,
29889,
29900,
29892,
29871,
29906,
29889,
29900,
29892,
29871,
29955,
29889,
29900,
29892,
29871,
29947,
29889,
29900,
1402,
13,
4706,
5615,
13,
1678,
620,
29918,
29906,
353,
288,
567,
29918,
29906,
29889,
14513,
3319,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1800,
13,
1678,
4974,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
1686,
27445,
29918,
19935,
29898,
690,
29918,
29906,
29892,
2149,
29918,
29906,
29897,
13,
1678,
565,
1513,
29918,
1688,
29918,
22793,
29901,
13,
4706,
1596,
29898,
22793,
29918,
8411,
29889,
517,
29918,
2850,
29898,
3554,
29918,
29906,
876,
13,
1678,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
3198,
29918,
9067,
29898,
13,
4706,
288,
567,
29922,
3554,
29918,
29906,
29892,
13,
4706,
848,
3790,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1118,
13,
4706,
2149,
29922,
17854,
29918,
29906,
29892,
13,
4706,
4733,
29918,
517,
29918,
11014,
3790,
710,
29898,
1272,
29918,
15742,
29889,
3421,
4176,
29889,
3421,
4176,
3195,
3101,
1118,
29897,
13,
13,
1678,
396,
1423,
1243,
338,
4549,
3307,
13,
1678,
4974,
451,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
1686,
27445,
29918,
19935,
29898,
17854,
29918,
29896,
29892,
2149,
29918,
29906,
29897,
13,
13,
1678,
396,
1055,
573,
18764,
284,
313,
1639,
571,
267,
411,
1302,
2122,
346,
29897,
13,
1678,
288,
567,
29918,
29876,
353,
5153,
29878,
29898,
29881,
29906,
29922,
29881,
29906,
467,
25047,
29918,
7122,
29898,
29890,
29922,
2783,
7283,
29898,
29881,
29896,
29922,
29881,
29896,
511,
491,
29922,
1839,
29887,
7464,
14002,
668,
2433,
1563,
1495,
13,
1678,
620,
29918,
29876,
353,
288,
567,
29918,
29876,
29889,
14513,
3319,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1800,
13,
1678,
4974,
451,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
1686,
27445,
29918,
19935,
29898,
690,
29918,
29876,
29892,
2149,
29918,
29896,
29897,
13,
1678,
4974,
451,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
1686,
27445,
29918,
19935,
29898,
690,
29918,
29876,
29892,
2149,
29918,
29906,
29897,
13,
13,
1678,
565,
21120,
29918,
8411,
338,
451,
6213,
29901,
13,
4706,
21120,
29918,
8411,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
22793,
29918,
2212,
1144,
29918,
3601,
5987,
29918,
8159,
29918,
7122,
7295,
13,
1678,
21120,
29918,
8411,
353,
6213,
13,
1678,
565,
1513,
29918,
1688,
29918,
22793,
29901,
13,
4706,
21120,
29918,
8411,
353,
848,
29918,
15742,
29889,
4176,
568,
29889,
4773,
29918,
8411,
580,
13,
13,
1678,
270,
29896,
353,
848,
29918,
15742,
29889,
4381,
29918,
1272,
29918,
4299,
29889,
15926,
29889,
17271,
3319,
13,
4706,
525,
29887,
2396,
6024,
29874,
742,
525,
29874,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
7464,
13,
4706,
525,
29894,
29896,
2396,
518,
29896,
29892,
6213,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
6213,
1402,
13,
4706,
525,
29894,
29906,
2396,
518,
8516,
29892,
29871,
29896,
29892,
6213,
29892,
29871,
29955,
29892,
29871,
29947,
1402,
13,
1678,
5615,
13,
13,
1678,
270,
29906,
353,
848,
29918,
15742,
29889,
4381,
29918,
1272,
29918,
4299,
29889,
15926,
29889,
17271,
3319,
13,
4706,
525,
29887,
2396,
6024,
29883,
742,
525,
29890,
742,
525,
29890,
7464,
13,
4706,
525,
29894,
29896,
2396,
518,
8516,
29892,
29871,
29896,
29892,
6213,
1402,
13,
4706,
525,
29894,
29906,
2396,
518,
29896,
29892,
6213,
29892,
29871,
29906,
1402,
13,
1678,
5615,
13,
13,
1678,
5988,
29918,
13099,
353,
6024,
29887,
2033,
13,
13,
1678,
288,
567,
353,
313,
13,
4706,
5153,
29878,
29898,
29881,
29896,
29922,
29881,
29896,
29897,
13,
9651,
869,
25047,
29918,
7122,
29898,
13,
9651,
289,
29922,
2783,
7283,
29898,
29881,
29906,
29922,
29881,
29906,
511,
13,
9651,
491,
29922,
7122,
29918,
13099,
29892,
13,
9651,
14002,
668,
2433,
8159,
1495,
13,
1678,
1723,
13,
13,
1678,
620,
29918,
15112,
353,
288,
567,
29889,
14513,
3319,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1800,
13,
13,
1678,
565,
1513,
29918,
1688,
29918,
22793,
29901,
13,
4706,
1596,
29898,
22793,
29918,
8411,
29889,
517,
29918,
2850,
29898,
3554,
876,
13,
13,
1678,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
3198,
29918,
9067,
29898,
13,
4706,
288,
567,
29922,
3554,
29892,
13,
4706,
848,
3790,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1118,
13,
4706,
2149,
29922,
690,
29918,
15112,
29892,
13,
4706,
4733,
29918,
517,
29918,
11014,
3790,
710,
29898,
1272,
29918,
15742,
29889,
3421,
4176,
29889,
3421,
4176,
3195,
3101,
1118,
29897,
13,
13,
1678,
288,
567,
29918,
3601,
5987,
353,
313,
13,
4706,
396,
679,
7258,
1820,
731,
13,
4706,
5153,
29878,
29898,
29881,
29896,
29922,
29881,
29896,
29897,
13,
9651,
869,
4836,
3319,
1118,
2318,
29918,
1609,
29922,
7122,
29918,
13099,
29897,
13,
18884,
869,
17685,
29918,
5727,
29898,
13,
18884,
289,
29922,
2783,
7283,
29898,
29881,
29906,
29922,
29881,
29906,
29897,
13,
462,
1678,
869,
4836,
3319,
1118,
2318,
29918,
1609,
29922,
7122,
29918,
13099,
511,
13,
18884,
1178,
29918,
4914,
29922,
8516,
29892,
13,
9651,
1723,
13,
9651,
869,
4836,
3319,
1118,
2318,
29918,
1609,
29922,
7122,
29918,
13099,
29897,
13,
9651,
396,
29611,
2989,
5988,
411,
2175,
26205,
13,
9651,
869,
25047,
29918,
7122,
29898,
13,
18884,
289,
29922,
2783,
7283,
29898,
29881,
29896,
29922,
29881,
29896,
511,
13,
18884,
491,
29922,
7122,
29918,
13099,
29892,
13,
18884,
14002,
668,
2433,
1563,
1495,
13,
9651,
869,
25047,
29918,
7122,
29898,
13,
18884,
289,
29922,
2783,
7283,
29898,
29881,
29906,
29922,
29881,
29906,
511,
13,
18884,
491,
29922,
7122,
29918,
13099,
29892,
13,
18884,
14002,
668,
2433,
1563,
1495,
13,
1678,
1723,
13,
13,
1678,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
3198,
29918,
9067,
29898,
13,
4706,
288,
567,
29922,
3554,
29918,
3601,
5987,
29892,
13,
4706,
848,
3790,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1118,
13,
4706,
2149,
29922,
690,
29918,
15112,
29892,
13,
4706,
4733,
29918,
517,
29918,
11014,
3790,
710,
29898,
1272,
29918,
15742,
29889,
3421,
4176,
29889,
3421,
4176,
3195,
3101,
1118,
29897,
13,
13,
1678,
565,
21120,
29918,
8411,
338,
451,
6213,
29901,
13,
4706,
21120,
29918,
8411,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
22793,
29918,
2212,
1144,
29918,
303,
4063,
7295,
13,
1678,
21120,
29918,
8411,
353,
6213,
13,
1678,
565,
1513,
29918,
1688,
29918,
22793,
29901,
13,
4706,
21120,
29918,
8411,
353,
848,
29918,
15742,
29889,
4176,
568,
29889,
4773,
29918,
8411,
580,
13,
13,
1678,
270,
29896,
353,
848,
29918,
15742,
29889,
4381,
29918,
1272,
29918,
4299,
29889,
15926,
29889,
17271,
3319,
13,
4706,
525,
29887,
2396,
6024,
29874,
742,
525,
29874,
742,
525,
29890,
742,
525,
29890,
742,
525,
29890,
7464,
13,
4706,
525,
29894,
29896,
2396,
518,
29896,
29892,
6213,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
6213,
1402,
13,
4706,
525,
29894,
29906,
2396,
518,
8516,
29892,
29871,
29896,
29892,
6213,
29892,
29871,
29955,
29892,
29871,
29947,
1402,
13,
1678,
5615,
13,
13,
1678,
270,
29906,
353,
848,
29918,
15742,
29889,
4381,
29918,
1272,
29918,
4299,
29889,
15926,
29889,
17271,
3319,
13,
4706,
525,
29887,
2396,
6024,
29883,
742,
525,
29890,
742,
525,
29890,
7464,
13,
4706,
525,
29894,
29896,
2396,
518,
8516,
29892,
29871,
29896,
29892,
6213,
1402,
13,
4706,
525,
29894,
29906,
2396,
518,
29896,
29892,
6213,
29892,
29871,
29906,
1402,
13,
1678,
5615,
13,
13,
1678,
5988,
29918,
13099,
353,
6024,
29887,
2033,
13,
13,
1678,
288,
567,
353,
313,
13,
4706,
5153,
29878,
29898,
29881,
29896,
29922,
29881,
29896,
29897,
13,
9651,
869,
21843,
3319,
29915,
29894,
29896,
2396,
525,
29894,
29896,
334,
325,
29896,
29915,
1800,
13,
9651,
869,
25047,
29918,
7122,
29898,
13,
18884,
289,
7607,
13,
462,
1678,
5153,
29878,
29898,
29881,
29906,
29922,
29881,
29906,
29897,
13,
462,
4706,
869,
21843,
3319,
29915,
29894,
29906,
2396,
525,
29894,
29906,
718,
325,
29906,
29915,
1800,
511,
13,
18884,
491,
29922,
7122,
29918,
13099,
29892,
13,
18884,
14002,
668,
2433,
8159,
1495,
13,
1678,
1723,
13,
13,
1678,
620,
29918,
15112,
353,
288,
567,
29889,
14513,
3319,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1800,
13,
13,
1678,
565,
1513,
29918,
1688,
29918,
22793,
29901,
13,
4706,
1596,
29898,
22793,
29918,
8411,
29889,
517,
29918,
2850,
29898,
3554,
876,
13,
13,
1678,
848,
29918,
15742,
29889,
1688,
29918,
4422,
29889,
3198,
29918,
9067,
29898,
13,
4706,
288,
567,
29922,
3554,
29892,
13,
4706,
848,
3790,
29915,
29881,
29896,
2396,
270,
29896,
29892,
525,
29881,
29906,
2396,
270,
29906,
1118,
13,
4706,
2149,
29922,
690,
29918,
15112,
29892,
13,
4706,
4733,
29918,
517,
29918,
11014,
3790,
710,
29898,
1272,
29918,
15742,
29889,
3421,
4176,
29889,
3421,
4176,
3195,
3101,
1118,
1723,
13,
13,
1678,
565,
21120,
29918,
8411,
338,
451,
6213,
29901,
13,
4706,
21120,
29918,
8411,
29889,
5358,
580,
13,
2
] |
pytreex/block/t2a/cs/addreflexiveparticles.py
|
leotilli/pytreex
| 11 |
132246
|
<reponame>leotilli/pytreex<filename>pytreex/block/t2a/cs/addreflexiveparticles.py
#!/usr/bin/env python
# coding=utf-8
#
# A Treex block
#
from __future__ import unicode_literals
from pytreex.core.block import Block
from pytreex.core.exception import LoadingException
import re
__author__ = "<NAME>"
__date__ = "2012"
class AddReflexiveParticles(Block):
"""
Add reflexive particles to reflexiva tantum and reflexive passive verbs.
Arguments:
language: the language of the target tree
selector: the selector of the target tree
"""
def __init__(self, scenario, args):
"Constructor, just checking the argument values"
Block.__init__(self, scenario, args)
if self.language is None:
raise LoadingException('Language must be defined!')
def process_tnode(self, tnode):
"Add reflexive particle to a node, if applicable."
tantum_match = re.search(r'_(s[ei])$', tnode.t_lemma)
# reflexiva tantum
if tantum_match:
refl_form = tantum_match.group(1)
afun = 'AuxT'
# reflexive passive
elif tnode.voice == 'reflexive_diathesis' or \
tnode.gram_diathesis == 'deagent':
refl_form = 'se'
afun = 'AuxR'
# no particle to add
else:
return
# add the particle
anode = tnode.lex_anode
refl_node = anode.create_child()
refl_node.form = refl_form
refl_node.afun = afun
refl_node.lemma = refl_form
refl_node.morphcat_pos = 'P'
refl_node.morphcat_subpos = '7'
refl_node.morphcat_number = 'X'
refl_node.morphcat_case = refl_form == 'si' and '3' or '4'
# to be moved to Wackernagel position later
refl_node.shift_after_node(anode)
# add auxiliary link
tnode.add_aux_anodes(refl_node)
|
[
1,
529,
276,
1112,
420,
29958,
280,
327,
12840,
29914,
2272,
2484,
735,
29966,
9507,
29958,
2272,
2484,
735,
29914,
1271,
29914,
29873,
29906,
29874,
29914,
2395,
29914,
1202,
999,
2506,
573,
1595,
4027,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
14137,
29922,
9420,
29899,
29947,
13,
29937,
13,
29937,
319,
6479,
735,
2908,
13,
29937,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
11451,
2484,
735,
29889,
3221,
29889,
1271,
1053,
15658,
13,
3166,
11451,
2484,
735,
29889,
3221,
29889,
11739,
1053,
4309,
9382,
2451,
13,
5215,
337,
13,
13,
1649,
8921,
1649,
353,
9872,
5813,
11903,
13,
1649,
1256,
1649,
353,
376,
29906,
29900,
29896,
29906,
29908,
13,
13,
13,
1990,
3462,
5620,
2506,
573,
7439,
4027,
29898,
7445,
1125,
13,
1678,
9995,
13,
1678,
3462,
2143,
2506,
573,
17105,
304,
2143,
2506,
4244,
11172,
398,
322,
2143,
2506,
573,
1209,
573,
1147,
5824,
29889,
13,
13,
1678,
11842,
9331,
29901,
13,
4706,
4086,
29901,
278,
4086,
310,
278,
3646,
5447,
13,
4706,
11764,
29901,
278,
11764,
310,
278,
3646,
5447,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10483,
29892,
6389,
1125,
13,
4706,
376,
23770,
29892,
925,
8454,
278,
2980,
1819,
29908,
13,
4706,
15658,
17255,
2344,
12035,
1311,
29892,
10483,
29892,
6389,
29897,
13,
4706,
565,
1583,
29889,
11675,
338,
6213,
29901,
13,
9651,
12020,
4309,
9382,
2451,
877,
21233,
1818,
367,
3342,
29991,
1495,
13,
13,
1678,
822,
1889,
29918,
29873,
3177,
29898,
1311,
29892,
260,
3177,
1125,
13,
4706,
376,
2528,
2143,
2506,
573,
16445,
304,
263,
2943,
29892,
565,
22903,
1213,
13,
4706,
11172,
398,
29918,
4352,
353,
337,
29889,
4478,
29898,
29878,
15972,
29898,
29879,
29961,
10096,
29962,
1262,
742,
260,
3177,
29889,
29873,
29918,
13846,
29897,
13,
4706,
396,
2143,
2506,
4244,
11172,
398,
13,
4706,
565,
11172,
398,
29918,
4352,
29901,
13,
9651,
337,
1579,
29918,
689,
353,
11172,
398,
29918,
4352,
29889,
2972,
29898,
29896,
29897,
13,
9651,
2511,
348,
353,
525,
29909,
1314,
29911,
29915,
13,
4706,
396,
2143,
2506,
573,
1209,
573,
13,
4706,
25342,
260,
3177,
29889,
14917,
1275,
525,
999,
2506,
573,
29918,
6051,
493,
6656,
29915,
470,
320,
13,
18884,
260,
3177,
29889,
1393,
29918,
6051,
493,
6656,
1275,
525,
311,
14748,
2396,
13,
9651,
337,
1579,
29918,
689,
353,
525,
344,
29915,
13,
9651,
2511,
348,
353,
525,
29909,
1314,
29934,
29915,
13,
4706,
396,
694,
16445,
304,
788,
13,
4706,
1683,
29901,
13,
9651,
736,
13,
4706,
396,
788,
278,
16445,
13,
4706,
385,
356,
353,
260,
3177,
29889,
2506,
29918,
273,
356,
13,
4706,
337,
1579,
29918,
3177,
353,
385,
356,
29889,
3258,
29918,
5145,
580,
13,
4706,
337,
1579,
29918,
3177,
29889,
689,
353,
337,
1579,
29918,
689,
13,
4706,
337,
1579,
29918,
3177,
29889,
2142,
348,
353,
2511,
348,
13,
4706,
337,
1579,
29918,
3177,
29889,
13846,
353,
337,
1579,
29918,
689,
13,
4706,
337,
1579,
29918,
3177,
29889,
29885,
5676,
4117,
29918,
1066,
353,
525,
29925,
29915,
13,
4706,
337,
1579,
29918,
3177,
29889,
29885,
5676,
4117,
29918,
1491,
1066,
353,
525,
29955,
29915,
13,
4706,
337,
1579,
29918,
3177,
29889,
29885,
5676,
4117,
29918,
4537,
353,
525,
29990,
29915,
13,
4706,
337,
1579,
29918,
3177,
29889,
29885,
5676,
4117,
29918,
4878,
353,
337,
1579,
29918,
689,
1275,
525,
1039,
29915,
322,
525,
29941,
29915,
470,
525,
29946,
29915,
13,
4706,
396,
304,
367,
6153,
304,
399,
547,
824,
351,
295,
2602,
2678,
13,
4706,
337,
1579,
29918,
3177,
29889,
10889,
29918,
7045,
29918,
3177,
29898,
273,
356,
29897,
13,
4706,
396,
788,
29587,
653,
1544,
13,
4706,
260,
3177,
29889,
1202,
29918,
2993,
29918,
273,
2631,
29898,
999,
29880,
29918,
3177,
29897,
13,
2
] |
src/wissenslandkarte/settings.py
|
Mattan-Qwer/test1
| 1 |
78584
|
"""
Django settings for wissenslandkarte project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib import Path
from django.core.management.utils import get_random_secret_key
import pickle
import os
import json
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
DEBUG_FILE = BASE_DIR.joinpath("./data/ACTIVATE_DEBUG_MODE")
# If you want to debug; create a file in the directory indicated above.
DEBUG = DEBUG_FILE.exists()
ENABLE_LIVE_JS = DEBUG and False
# this allows to use {% if debug %} in django templates.
INTERNAL_IPS = ['127.0.0.1', '::1']
SECRET_KEY_FILE = BASE_DIR.joinpath("./data/django-secret-key.pickle")
def load_or_create_secret_key() -> str:
# TODO we might want to record hostname and time of the secret creation in this pickle, to allow us to recognize if
# it becomes a constant during docker builds. Also, we might want to delete/recreate it explicitly during
# first startup.
try:
secret = pickle.load(open(SECRET_KEY_FILE, "rb"))
return secret
except FileNotFoundError:
secret = get_random_secret_key()
pickle.dump(secret, open(SECRET_KEY_FILE, "wb"))
return secret
SECRET_KEY = load_or_create_secret_key()
ALLOWED_HOSTS = [
'localhost',
'127.0.0.1',
'[::1]',
'python',
# 'wissenslandkarte.betre<EMAIL>',
]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin', # https://docs.djangoproject.com/en/3.2/ref/contrib/admin/
'django.contrib.auth', # https://docs.djangoproject.com/en/3.2/ref/contrib/auth/
'django.contrib.contenttypes', # https://docs.djangoproject.com/en/3.2/ref/contrib/contenttypes/
'django.contrib.sessions', # https://docs.djangoproject.com/en/3.2/topics/http/sessions/
'django.contrib.messages', # https://docs.djangoproject.com/en/3.2/ref/contrib/messages/
'django.contrib.staticfiles', # https://docs.djangoproject.com/en/3.2/ref/contrib/staticfiles/
'fontawesome_5',
'api',
'compliance',
'web_homepage',
'accounts',
]
MIDDLEWARE = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# TODO both of these are not active for static files, and have to be configured in nginx again.
# this applies especially to:
# * CSP on static html files that are served to be displayed
# * User Uploads, e.g. images.
# * HSTS on every ressource.
'django.middleware.security.SecurityMiddleware',
'csp.middleware.CSPMiddleware',
]
ROOT_URLCONF = 'wissenslandkarte.urls'
AUTH_USER_MODEL = "accounts.User"
TEMPLATES = [
{
'BACKEND': 'django.template.backends.jinja2.Jinja2',
'DIRS': ["jinja-templates"],
'APP_DIRS': True,
'OPTIONS': {
'environment': 'web_homepage.jinja.environment'
},
},
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ["templates"],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'wissenslandkarte.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'data' / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
# TODO we should use a german list for our target group, however, these are difficult to find.
# Use Duden, given names, surnames, sports clubs and qwertz-Keywalks?
# https://docs.djangoproject.com/en/3.1/topics/auth/passwords/#password-validation
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
# 'password_list_path' : '...'
# This file should contain one lowercase password per line and may be plain text or gzipped.
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/
STATIC_URL = '/static/'
# STATICFILES_DIRS = ["static"]
STATIC_ROOT = os.getenv("COLLECTSTATIC_DIR", None)
# TODO decide how to handle development environments.
# SECURE_HSTS_SECONDS = 0
# TODO
# [Vue warn]: It seems you are using the standalone build of Vue.js in an environment with Content Security Policy
# that prohibits unsafe-eval. The template compiler cannot work in this environment. Consider relaxing the policy to
# allow unsafe-eval or pre-compiling your templates into render functions.
CSP_DEFAULT_SRC = ("'self'", "'unsafe-eval'")
CSP_IMG_SRC = ("'self'", "https://betreiberverein.de")
if DEBUG:
# this is required for live.js.
CSP_DEFAULT_SRC = ("'self'", "'unsafe-inline'", "'unsafe-eval'")
CSP_SCRIPT_SRC = ("'self'", "'unsafe-inline'", "'unsafe-eval'")
if not DEBUG:
# This should only be enabled from certain docker container builds, due to a quota; and should be configurable by the admin.
# CSP_REPORT_URI = "https://p.report-uri.com/r/d/csp/enforce"
pass
# CSP_REPORT_TO = "default"
|
[
1,
9995,
13,
29928,
5364,
6055,
363,
281,
790,
575,
1049,
5689,
371,
2060,
29889,
13,
13,
24565,
491,
525,
14095,
29899,
6406,
1369,
4836,
29915,
773,
15337,
29871,
29941,
29889,
29896,
29889,
29955,
29889,
13,
13,
2831,
901,
2472,
373,
445,
934,
29892,
1074,
13,
991,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29896,
29914,
3332,
1199,
29914,
11027,
29914,
13,
13,
2831,
278,
2989,
1051,
310,
6055,
322,
1009,
1819,
29892,
1074,
13,
991,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29896,
29914,
999,
29914,
11027,
29914,
13,
15945,
29908,
13,
13,
3166,
2224,
1982,
1053,
10802,
13,
3166,
9557,
29889,
3221,
29889,
21895,
29889,
13239,
1053,
679,
29918,
8172,
29918,
19024,
29918,
1989,
13,
5215,
5839,
280,
13,
5215,
2897,
13,
5215,
4390,
13,
13,
29937,
8878,
10898,
2768,
278,
2060,
763,
445,
29901,
350,
8127,
29918,
9464,
847,
525,
1491,
3972,
4286,
13,
25416,
29918,
9464,
353,
10802,
22168,
1445,
1649,
467,
17863,
2141,
3560,
29889,
3560,
13,
13,
29937,
26141,
29899,
2962,
5849,
6055,
448,
443,
2146,
8270,
363,
5802,
13,
29937,
2823,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29896,
29914,
3525,
517,
29914,
16519,
358,
29914,
3198,
1761,
29914,
13,
13,
18525,
29918,
7724,
353,
350,
8127,
29918,
9464,
29889,
7122,
2084,
703,
6904,
1272,
29914,
17923,
5667,
3040,
29918,
18525,
29918,
20387,
1159,
13,
29937,
960,
366,
864,
304,
4744,
29936,
1653,
263,
934,
297,
278,
3884,
18694,
2038,
29889,
13,
18525,
353,
21681,
29918,
7724,
29889,
9933,
580,
13,
1430,
6181,
29918,
5265,
12064,
29918,
8700,
353,
21681,
322,
7700,
13,
29937,
445,
6511,
304,
671,
18674,
565,
4744,
15493,
297,
9557,
17475,
29889,
13,
23845,
29940,
1964,
29918,
5690,
29903,
353,
6024,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
742,
525,
1057,
29896,
2033,
13,
13,
1660,
22245,
29911,
29918,
10818,
29918,
7724,
353,
350,
8127,
29918,
9464,
29889,
7122,
2084,
703,
6904,
1272,
29914,
14095,
29899,
19024,
29899,
1989,
29889,
23945,
280,
1159,
13,
13,
13,
1753,
2254,
29918,
272,
29918,
3258,
29918,
19024,
29918,
1989,
580,
1599,
851,
29901,
13,
1678,
396,
14402,
591,
1795,
864,
304,
2407,
3495,
978,
322,
931,
310,
278,
7035,
11265,
297,
445,
5839,
280,
29892,
304,
2758,
502,
304,
18720,
565,
13,
1678,
396,
29871,
372,
7415,
263,
4868,
2645,
10346,
23315,
29889,
3115,
29892,
591,
1795,
864,
304,
5217,
29914,
276,
3258,
372,
9479,
2645,
13,
1678,
396,
29871,
937,
20234,
29889,
13,
1678,
1018,
29901,
13,
4706,
7035,
353,
5839,
280,
29889,
1359,
29898,
3150,
29898,
1660,
22245,
29911,
29918,
10818,
29918,
7724,
29892,
376,
6050,
5783,
13,
4706,
736,
7035,
13,
1678,
5174,
3497,
17413,
2392,
29901,
13,
4706,
7035,
353,
679,
29918,
8172,
29918,
19024,
29918,
1989,
580,
13,
4706,
5839,
280,
29889,
15070,
29898,
19024,
29892,
1722,
29898,
1660,
22245,
29911,
29918,
10818,
29918,
7724,
29892,
376,
29893,
29890,
5783,
13,
4706,
736,
7035,
13,
13,
13,
1660,
22245,
29911,
29918,
10818,
353,
2254,
29918,
272,
29918,
3258,
29918,
19024,
29918,
1989,
580,
13,
13,
1964,
27998,
3352,
29918,
20832,
29903,
353,
518,
13,
1678,
525,
7640,
742,
13,
1678,
525,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
742,
13,
1678,
525,
29961,
1057,
29896,
29962,
742,
13,
1678,
525,
4691,
742,
13,
1678,
396,
525,
29893,
790,
575,
1049,
5689,
371,
29889,
6878,
276,
29966,
26862,
6227,
29958,
742,
13,
29962,
13,
13,
29937,
8427,
5023,
13,
13,
25580,
1964,
20566,
29918,
3301,
7024,
353,
518,
13,
1678,
525,
14095,
29889,
21570,
29889,
6406,
742,
29871,
396,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29906,
29914,
999,
29914,
21570,
29914,
6406,
29914,
13,
1678,
525,
14095,
29889,
21570,
29889,
5150,
742,
29871,
396,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29906,
29914,
999,
29914,
21570,
29914,
5150,
29914,
13,
1678,
525,
14095,
29889,
21570,
29889,
3051,
8768,
742,
29871,
396,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29906,
29914,
999,
29914,
21570,
29914,
3051,
8768,
29914,
13,
1678,
525,
14095,
29889,
21570,
29889,
29879,
10964,
742,
29871,
396,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29906,
29914,
3332,
1199,
29914,
1124,
29914,
29879,
10964,
29914,
13,
1678,
525,
14095,
29889,
21570,
29889,
19158,
742,
29871,
396,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29906,
29914,
999,
29914,
21570,
29914,
19158,
29914,
13,
1678,
525,
14095,
29889,
21570,
29889,
7959,
5325,
742,
29871,
396,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29906,
29914,
999,
29914,
21570,
29914,
7959,
5325,
29914,
13,
1678,
525,
5657,
1450,
14151,
29918,
29945,
742,
13,
1678,
525,
2754,
742,
13,
1678,
525,
2388,
13036,
742,
13,
1678,
525,
2676,
29918,
5184,
3488,
742,
13,
1678,
525,
10149,
29879,
742,
13,
29962,
13,
13,
29924,
1367,
29928,
1307,
12982,
1525,
353,
518,
13,
1678,
525,
14095,
29889,
21570,
29889,
29879,
10964,
29889,
17662,
2519,
29889,
7317,
25411,
2519,
742,
13,
1678,
525,
14095,
29889,
17662,
2519,
29889,
9435,
29889,
18877,
25411,
2519,
742,
13,
1678,
525,
14095,
29889,
17662,
2519,
29889,
2395,
9600,
29889,
29907,
29879,
9600,
1043,
25411,
2519,
742,
13,
1678,
525,
14095,
29889,
21570,
29889,
5150,
29889,
17662,
2519,
29889,
16746,
25411,
2519,
742,
13,
1678,
525,
14095,
29889,
21570,
29889,
19158,
29889,
17662,
2519,
29889,
3728,
25411,
2519,
742,
13,
1678,
525,
14095,
29889,
17662,
2519,
29889,
3808,
21452,
292,
29889,
29990,
4308,
5856,
25411,
2519,
742,
13,
1678,
396,
14402,
1716,
310,
1438,
526,
451,
6136,
363,
2294,
2066,
29892,
322,
505,
304,
367,
13252,
297,
19376,
1449,
29889,
13,
1678,
396,
29871,
445,
16058,
7148,
304,
29901,
13,
1678,
396,
29871,
334,
315,
5550,
373,
2294,
3472,
2066,
393,
526,
6766,
304,
367,
8833,
13,
1678,
396,
29871,
334,
4911,
5020,
18132,
29892,
321,
29889,
29887,
29889,
4558,
29889,
13,
1678,
396,
29871,
334,
379,
1254,
29903,
373,
1432,
18475,
1167,
29889,
13,
1678,
525,
14095,
29889,
17662,
2519,
29889,
8926,
29889,
13228,
25411,
2519,
742,
13,
1678,
525,
29883,
1028,
29889,
17662,
2519,
29889,
29907,
5550,
25411,
2519,
742,
13,
29962,
13,
13,
21289,
29918,
4219,
6007,
29943,
353,
525,
29893,
790,
575,
1049,
5689,
371,
29889,
26045,
29915,
13,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
353,
376,
10149,
29879,
29889,
2659,
29908,
13,
4330,
3580,
29931,
1299,
2890,
353,
518,
13,
1678,
426,
13,
4706,
525,
29933,
11375,
11794,
2396,
525,
14095,
29889,
6886,
29889,
1627,
1975,
29889,
28789,
1764,
29906,
29889,
29967,
262,
1764,
29906,
742,
13,
4706,
525,
9464,
29903,
2396,
6796,
28789,
1764,
29899,
20943,
12436,
13,
4706,
525,
20576,
29918,
9464,
29903,
2396,
5852,
29892,
13,
4706,
525,
14094,
27946,
2396,
426,
13,
9651,
525,
20944,
2396,
525,
2676,
29918,
5184,
3488,
29889,
28789,
1764,
29889,
20944,
29915,
13,
4706,
2981,
13,
1678,
2981,
13,
1678,
426,
13,
4706,
525,
29933,
11375,
11794,
2396,
525,
14095,
29889,
6886,
29889,
1627,
1975,
29889,
14095,
29889,
29928,
5364,
5776,
9884,
742,
13,
4706,
525,
9464,
29903,
2396,
6796,
20943,
12436,
13,
4706,
525,
20576,
29918,
9464,
29903,
2396,
5852,
29892,
13,
4706,
525,
14094,
27946,
2396,
426,
13,
9651,
525,
4703,
29918,
5014,
943,
2396,
518,
13,
18884,
525,
14095,
29889,
6886,
29889,
4703,
29918,
5014,
943,
29889,
8382,
742,
13,
18884,
525,
14095,
29889,
6886,
29889,
4703,
29918,
5014,
943,
29889,
3827,
742,
13,
18884,
525,
14095,
29889,
21570,
29889,
5150,
29889,
4703,
29918,
5014,
943,
29889,
5150,
742,
13,
18884,
525,
14095,
29889,
21570,
29889,
19158,
29889,
4703,
29918,
5014,
943,
29889,
19158,
742,
13,
9651,
21251,
13,
4706,
2981,
13,
1678,
2981,
13,
29962,
13,
13,
7811,
29954,
29902,
29918,
3301,
7390,
28541,
353,
525,
29893,
790,
575,
1049,
5689,
371,
29889,
5652,
3146,
29889,
6214,
29915,
13,
13,
29937,
5470,
13,
29937,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29896,
29914,
999,
29914,
11027,
8484,
29503,
2129,
13,
13,
25832,
27982,
29903,
353,
426,
13,
1678,
525,
4381,
2396,
426,
13,
4706,
525,
1430,
29954,
8895,
2396,
525,
14095,
29889,
2585,
29889,
1627,
1975,
29889,
22793,
29941,
742,
13,
4706,
525,
5813,
2396,
350,
8127,
29918,
9464,
847,
525,
1272,
29915,
847,
525,
2585,
29889,
22793,
29941,
742,
13,
1678,
500,
13,
29913,
13,
13,
29937,
25280,
8845,
13,
29937,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29896,
29914,
999,
29914,
11027,
8484,
5150,
29899,
5630,
29899,
3084,
4097,
13,
13,
20656,
29950,
29918,
25711,
17013,
29918,
26707,
1299,
24125,
353,
518,
13,
1678,
426,
13,
4706,
525,
5813,
2396,
525,
14095,
29889,
21570,
29889,
5150,
29889,
5630,
29918,
18157,
29889,
2659,
6708,
8942,
2327,
537,
24204,
742,
13,
1678,
2981,
13,
1678,
426,
13,
4706,
525,
5813,
2396,
525,
14095,
29889,
21570,
29889,
5150,
29889,
5630,
29918,
18157,
29889,
8140,
12539,
6513,
24204,
742,
13,
1678,
2981,
13,
1678,
426,
13,
4706,
396,
14402,
591,
881,
671,
263,
330,
3504,
1051,
363,
1749,
3646,
2318,
29892,
3138,
29892,
1438,
526,
5189,
304,
1284,
29889,
13,
4706,
396,
29871,
4803,
360,
27336,
29892,
2183,
2983,
29892,
269,
595,
1280,
29892,
14717,
17651,
322,
3855,
16347,
29920,
29899,
2558,
14625,
2039,
29973,
13,
4706,
396,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29896,
29914,
3332,
1199,
29914,
5150,
29914,
5630,
29879,
8484,
5630,
29899,
18157,
13,
4706,
525,
5813,
2396,
525,
14095,
29889,
21570,
29889,
5150,
29889,
5630,
29918,
18157,
29889,
18877,
10048,
24204,
742,
13,
4706,
396,
525,
5630,
29918,
1761,
29918,
2084,
29915,
584,
525,
856,
29915,
13,
4706,
396,
910,
934,
881,
1712,
697,
5224,
4878,
4800,
639,
1196,
322,
1122,
367,
8656,
1426,
470,
330,
2526,
2986,
29889,
13,
1678,
2981,
13,
1678,
426,
13,
4706,
525,
5813,
2396,
525,
14095,
29889,
21570,
29889,
5150,
29889,
5630,
29918,
18157,
29889,
29940,
25099,
10048,
24204,
742,
13,
1678,
2981,
13,
29962,
13,
13,
29937,
4623,
2133,
13,
29937,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29896,
29914,
3332,
1199,
29914,
29875,
29896,
29947,
29876,
29914,
13,
13,
29931,
19453,
29965,
10461,
29918,
16524,
353,
525,
264,
29899,
375,
29915,
13,
13,
15307,
29918,
29999,
12413,
353,
525,
26913,
29915,
13,
13,
17171,
29918,
29902,
29896,
29947,
29940,
353,
5852,
13,
13,
17171,
29918,
29931,
29896,
29900,
29940,
353,
5852,
13,
13,
17171,
29918,
29911,
29999,
353,
5852,
13,
13,
29937,
624,
2454,
2066,
313,
19407,
29892,
8286,
29892,
1954,
1179,
29897,
13,
29937,
2045,
597,
2640,
29889,
19776,
574,
26555,
622,
29889,
510,
29914,
264,
29914,
29941,
29889,
29896,
29914,
3525,
517,
29914,
7959,
29899,
5325,
29914,
13,
13,
17816,
2965,
29918,
4219,
353,
8207,
7959,
22208,
13,
29937,
6850,
1299,
2965,
24483,
29918,
9464,
29903,
353,
6796,
7959,
3108,
13,
17816,
2965,
29918,
21289,
353,
2897,
29889,
657,
6272,
703,
15032,
3281,
17816,
2965,
29918,
9464,
613,
6213,
29897,
13,
13,
29937,
14402,
11097,
920,
304,
4386,
5849,
23136,
29889,
13,
29937,
3725,
29907,
11499,
29918,
29950,
1254,
29903,
29918,
1660,
6007,
8452,
353,
29871,
29900,
13,
13,
29937,
14402,
13,
29937,
29871,
518,
29963,
434,
29383,
5387,
739,
2444,
366,
526,
773,
278,
2317,
18785,
2048,
310,
22518,
29889,
1315,
297,
385,
5177,
411,
10576,
14223,
25219,
13,
29937,
29871,
393,
21460,
1169,
25110,
29899,
14513,
29889,
450,
4472,
6516,
2609,
664,
297,
445,
5177,
29889,
10056,
26681,
292,
278,
8898,
304,
13,
29937,
29871,
2758,
25110,
29899,
14513,
470,
758,
29899,
2388,
6504,
596,
17475,
964,
4050,
3168,
29889,
13,
29907,
5550,
29918,
23397,
29918,
29903,
10363,
353,
4852,
29915,
1311,
29915,
613,
13577,
348,
11177,
29899,
14513,
29915,
1159,
13,
29907,
5550,
29918,
7833,
29954,
29918,
29903,
10363,
353,
4852,
29915,
1311,
29915,
613,
376,
991,
597,
6878,
5803,
495,
22655,
29889,
311,
1159,
13,
361,
21681,
29901,
13,
1678,
396,
445,
338,
3734,
363,
5735,
29889,
1315,
29889,
13,
1678,
315,
5550,
29918,
23397,
29918,
29903,
10363,
353,
4852,
29915,
1311,
29915,
613,
13577,
348,
11177,
29899,
14764,
29915,
613,
13577,
348,
11177,
29899,
14513,
29915,
1159,
13,
1678,
315,
5550,
29918,
7187,
24290,
29918,
29903,
10363,
353,
4852,
29915,
1311,
29915,
613,
13577,
348,
11177,
29899,
14764,
29915,
613,
13577,
348,
11177,
29899,
14513,
29915,
1159,
13,
361,
451,
21681,
29901,
13,
1678,
396,
910,
881,
871,
367,
9615,
515,
3058,
10346,
5639,
23315,
29892,
2861,
304,
263,
439,
4616,
29936,
322,
881,
367,
17127,
519,
491,
278,
4113,
29889,
13,
1678,
396,
315,
5550,
29918,
1525,
15082,
29918,
15551,
353,
376,
991,
597,
29886,
29889,
12276,
29899,
5338,
29889,
510,
29914,
29878,
29914,
29881,
29914,
29883,
1028,
29914,
264,
10118,
29908,
13,
1678,
1209,
13,
29937,
315,
5550,
29918,
1525,
15082,
29918,
4986,
353,
376,
4381,
29908,
13,
2
] |
mayan/apps/storage/tests/test_backends.py
|
morlandi/Mayan-EDMS
| 0 |
72169
|
from pathlib import Path
from django.core.files.base import ContentFile
from django.utils.encoding import force_bytes
from mayan.apps.mimetype.api import get_mimetype
from mayan.apps.storage.utils import fs_cleanup, mkdtemp
from mayan.apps.testing.tests.base import BaseTestCase
from ..backends.compressedstorage import ZipCompressedPassthroughStorage
from ..backends.encryptedstorage import EncryptedPassthroughStorage
from .literals import TEST_CONTENT, TEST_FILE_NAME
class EncryptedPassthroughStorageTestCase(BaseTestCase):
def setUp(self):
super(EncryptedPassthroughStorageTestCase, self).setUp()
self.temporary_directory = mkdtemp()
def tearDown(self):
fs_cleanup(filename=self.temporary_directory)
super(EncryptedPassthroughStorageTestCase, self).tearDown()
def test_file_save_and_load(self):
storage = EncryptedPassthroughStorage(
password='<PASSWORD>',
next_storage_backend_arguments={
'location': self.temporary_directory,
}
)
test_file_name = storage.save(
name=TEST_FILE_NAME, content=ContentFile(
content=force_bytes(TEST_CONTENT)
)
)
path_file = Path(self.temporary_directory) / test_file_name
with path_file.open(mode='rb') as file_object:
self.assertEqual(
get_mimetype(file_object=file_object),
('application/octet-stream', 'binary')
)
with storage.open(name=TEST_FILE_NAME, mode='r') as file_object:
self.assertEqual(file_object.read(), TEST_CONTENT)
with storage.open(name=TEST_FILE_NAME, mode='r') as file_object:
self.assertEqual(file_object.read(1), TEST_CONTENT[0:1])
with storage.open(name=TEST_FILE_NAME, mode='r') as file_object:
self.assertEqual(file_object.read(999), TEST_CONTENT)
class ZipCompressedPassthroughStorageTestCase(BaseTestCase):
def setUp(self):
super(ZipCompressedPassthroughStorageTestCase, self).setUp()
self.temporary_directory = mkdtemp()
def tearDown(self):
fs_cleanup(filename=self.temporary_directory)
super(ZipCompressedPassthroughStorageTestCase, self).tearDown()
def test_file_save_and_load(self):
storage = ZipCompressedPassthroughStorage(
next_storage_backend_arguments={
'location': self.temporary_directory
}
)
test_file_name = storage.save(
name=TEST_FILE_NAME, content=ContentFile(content=TEST_CONTENT)
)
path_file = Path(self.temporary_directory) / test_file_name
with path_file.open(mode='rb') as file_object:
self.assertEqual(
get_mimetype(file_object=file_object),
('application/zip', 'binary')
)
with path_file.open(mode='rb') as file_object:
self.assertNotEqual(
file_object.read(), force_bytes(TEST_CONTENT)
)
with storage.open(name=TEST_FILE_NAME, mode='r') as file_object:
self.assertEqual(file_object.read(), TEST_CONTENT)
|
[
1,
515,
2224,
1982,
1053,
10802,
13,
13,
3166,
9557,
29889,
3221,
29889,
5325,
29889,
3188,
1053,
10576,
2283,
13,
3166,
9557,
29889,
13239,
29889,
22331,
1053,
4889,
29918,
13193,
13,
13,
3166,
1122,
273,
29889,
13371,
29889,
29885,
17528,
668,
29889,
2754,
1053,
679,
29918,
29885,
17528,
668,
13,
3166,
1122,
273,
29889,
13371,
29889,
12925,
29889,
13239,
1053,
18920,
29918,
14941,
786,
29892,
14690,
29881,
7382,
13,
3166,
1122,
273,
29889,
13371,
29889,
13424,
29889,
21150,
29889,
3188,
1053,
7399,
3057,
8259,
13,
13,
3166,
6317,
1627,
1975,
29889,
510,
13120,
12925,
1053,
796,
666,
1523,
13120,
29925,
294,
303,
1092,
820,
10486,
13,
3166,
6317,
1627,
1975,
29889,
3977,
14740,
12925,
1053,
11346,
14740,
29925,
294,
303,
1092,
820,
10486,
13,
13,
3166,
869,
20889,
1338,
1053,
17067,
1254,
29918,
22412,
3919,
29892,
17067,
1254,
29918,
7724,
29918,
5813,
13,
13,
13,
1990,
11346,
14740,
29925,
294,
303,
1092,
820,
10486,
3057,
8259,
29898,
5160,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
2428,
29898,
8566,
14740,
29925,
294,
303,
1092,
820,
10486,
3057,
8259,
29892,
1583,
467,
842,
3373,
580,
13,
4706,
1583,
29889,
1356,
1971,
653,
29918,
12322,
353,
14690,
29881,
7382,
580,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
18920,
29918,
14941,
786,
29898,
9507,
29922,
1311,
29889,
1356,
1971,
653,
29918,
12322,
29897,
13,
4706,
2428,
29898,
8566,
14740,
29925,
294,
303,
1092,
820,
10486,
3057,
8259,
29892,
1583,
467,
371,
279,
6767,
580,
13,
13,
1678,
822,
1243,
29918,
1445,
29918,
7620,
29918,
392,
29918,
1359,
29898,
1311,
1125,
13,
4706,
8635,
353,
11346,
14740,
29925,
294,
303,
1092,
820,
10486,
29898,
13,
9651,
4800,
2433,
29966,
25711,
17013,
29958,
742,
13,
9651,
2446,
29918,
12925,
29918,
27852,
29918,
25699,
3790,
13,
18884,
525,
5479,
2396,
1583,
29889,
1356,
1971,
653,
29918,
12322,
29892,
13,
9651,
500,
13,
4706,
1723,
13,
13,
4706,
1243,
29918,
1445,
29918,
978,
353,
8635,
29889,
7620,
29898,
13,
9651,
1024,
29922,
18267,
29918,
7724,
29918,
5813,
29892,
2793,
29922,
3916,
2283,
29898,
13,
18884,
2793,
29922,
10118,
29918,
13193,
29898,
18267,
29918,
22412,
3919,
29897,
13,
9651,
1723,
13,
4706,
1723,
13,
13,
4706,
2224,
29918,
1445,
353,
10802,
29898,
1311,
29889,
1356,
1971,
653,
29918,
12322,
29897,
847,
1243,
29918,
1445,
29918,
978,
13,
13,
4706,
411,
2224,
29918,
1445,
29889,
3150,
29898,
8513,
2433,
6050,
1495,
408,
934,
29918,
3318,
29901,
13,
9651,
1583,
29889,
9294,
9843,
29898,
13,
18884,
679,
29918,
29885,
17528,
668,
29898,
1445,
29918,
3318,
29922,
1445,
29918,
3318,
511,
13,
18884,
6702,
6214,
29914,
20082,
300,
29899,
5461,
742,
525,
19541,
1495,
13,
9651,
1723,
13,
13,
4706,
411,
8635,
29889,
3150,
29898,
978,
29922,
18267,
29918,
7724,
29918,
5813,
29892,
4464,
2433,
29878,
1495,
408,
934,
29918,
3318,
29901,
13,
9651,
1583,
29889,
9294,
9843,
29898,
1445,
29918,
3318,
29889,
949,
3285,
17067,
1254,
29918,
22412,
3919,
29897,
13,
13,
4706,
411,
8635,
29889,
3150,
29898,
978,
29922,
18267,
29918,
7724,
29918,
5813,
29892,
4464,
2433,
29878,
1495,
408,
934,
29918,
3318,
29901,
13,
9651,
1583,
29889,
9294,
9843,
29898,
1445,
29918,
3318,
29889,
949,
29898,
29896,
511,
17067,
1254,
29918,
22412,
3919,
29961,
29900,
29901,
29896,
2314,
13,
13,
4706,
411,
8635,
29889,
3150,
29898,
978,
29922,
18267,
29918,
7724,
29918,
5813,
29892,
4464,
2433,
29878,
1495,
408,
934,
29918,
3318,
29901,
13,
9651,
1583,
29889,
9294,
9843,
29898,
1445,
29918,
3318,
29889,
949,
29898,
29929,
29929,
29929,
511,
17067,
1254,
29918,
22412,
3919,
29897,
13,
13,
13,
1990,
796,
666,
1523,
13120,
29925,
294,
303,
1092,
820,
10486,
3057,
8259,
29898,
5160,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
2428,
29898,
26264,
1523,
13120,
29925,
294,
303,
1092,
820,
10486,
3057,
8259,
29892,
1583,
467,
842,
3373,
580,
13,
4706,
1583,
29889,
1356,
1971,
653,
29918,
12322,
353,
14690,
29881,
7382,
580,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
18920,
29918,
14941,
786,
29898,
9507,
29922,
1311,
29889,
1356,
1971,
653,
29918,
12322,
29897,
13,
4706,
2428,
29898,
26264,
1523,
13120,
29925,
294,
303,
1092,
820,
10486,
3057,
8259,
29892,
1583,
467,
371,
279,
6767,
580,
13,
13,
1678,
822,
1243,
29918,
1445,
29918,
7620,
29918,
392,
29918,
1359,
29898,
1311,
1125,
13,
4706,
8635,
353,
796,
666,
1523,
13120,
29925,
294,
303,
1092,
820,
10486,
29898,
13,
9651,
2446,
29918,
12925,
29918,
27852,
29918,
25699,
3790,
13,
18884,
525,
5479,
2396,
1583,
29889,
1356,
1971,
653,
29918,
12322,
13,
9651,
500,
13,
4706,
1723,
13,
13,
4706,
1243,
29918,
1445,
29918,
978,
353,
8635,
29889,
7620,
29898,
13,
9651,
1024,
29922,
18267,
29918,
7724,
29918,
5813,
29892,
2793,
29922,
3916,
2283,
29898,
3051,
29922,
18267,
29918,
22412,
3919,
29897,
13,
4706,
1723,
13,
13,
4706,
2224,
29918,
1445,
353,
10802,
29898,
1311,
29889,
1356,
1971,
653,
29918,
12322,
29897,
847,
1243,
29918,
1445,
29918,
978,
13,
13,
4706,
411,
2224,
29918,
1445,
29889,
3150,
29898,
8513,
2433,
6050,
1495,
408,
934,
29918,
3318,
29901,
13,
9651,
1583,
29889,
9294,
9843,
29898,
13,
18884,
679,
29918,
29885,
17528,
668,
29898,
1445,
29918,
3318,
29922,
1445,
29918,
3318,
511,
13,
18884,
6702,
6214,
29914,
7554,
742,
525,
19541,
1495,
13,
9651,
1723,
13,
13,
4706,
411,
2224,
29918,
1445,
29889,
3150,
29898,
8513,
2433,
6050,
1495,
408,
934,
29918,
3318,
29901,
13,
9651,
1583,
29889,
9294,
3664,
9843,
29898,
13,
18884,
934,
29918,
3318,
29889,
949,
3285,
4889,
29918,
13193,
29898,
18267,
29918,
22412,
3919,
29897,
13,
9651,
1723,
13,
13,
4706,
411,
8635,
29889,
3150,
29898,
978,
29922,
18267,
29918,
7724,
29918,
5813,
29892,
4464,
2433,
29878,
1495,
408,
934,
29918,
3318,
29901,
13,
9651,
1583,
29889,
9294,
9843,
29898,
1445,
29918,
3318,
29889,
949,
3285,
17067,
1254,
29918,
22412,
3919,
29897,
13,
2
] |
models/__init__.py
|
jmojoo/MLMO
| 0 |
42627
|
<gh_stars>0
from .extractors import AlexNet
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
869,
21111,
943,
1053,
4827,
6779,
2
] |
scripts/python-phoniebox/helpers_unused_atm/helpers.py
|
Microgenic/RPi-Jukebox-RFID
| 3 |
147263
|
<gh_stars>1-10
__name__ = "helpers"
def is_int(s):
""" return True if string is an int """
try:
int(s)
return True
except ValueError:
return False
def str2bool(s):
""" convert string to a python boolean """
return s.lower() in ("yes", "true", "t", "1")
def str2num(s):
""" convert string to an int or a float """
try:
return int(s)
except ValueError:
return float(s)
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
1649,
978,
1649,
353,
376,
3952,
6774,
29908,
13,
13,
1753,
338,
29918,
524,
29898,
29879,
1125,
13,
1678,
9995,
736,
5852,
565,
1347,
338,
385,
938,
9995,
13,
1678,
1018,
29901,
13,
4706,
938,
29898,
29879,
29897,
13,
4706,
736,
5852,
13,
1678,
5174,
7865,
2392,
29901,
13,
4706,
736,
7700,
13,
13,
1753,
851,
29906,
11227,
29898,
29879,
1125,
13,
1678,
9995,
3588,
1347,
304,
263,
3017,
7223,
9995,
13,
1678,
736,
269,
29889,
13609,
580,
297,
4852,
3582,
613,
376,
3009,
613,
376,
29873,
613,
376,
29896,
1159,
13,
13,
1753,
851,
29906,
1949,
29898,
29879,
1125,
13,
1678,
9995,
3588,
1347,
304,
385,
938,
470,
263,
5785,
9995,
13,
1678,
1018,
29901,
13,
4706,
736,
938,
29898,
29879,
29897,
13,
1678,
5174,
7865,
2392,
29901,
13,
4706,
736,
5785,
29898,
29879,
29897,
13,
2
] |
soccerpy/__init__.py
|
SlapBot/soccerpy
| 0 |
169328
|
<gh_stars>0
from soccerpy.modules.Competition.competition import Competition
from soccerpy.modules.Fixture.fixture import Fixture
from soccerpy.modules.Team.team import Team
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
269,
11953,
2272,
29889,
7576,
29889,
6843,
300,
654,
29889,
2388,
300,
654,
1053,
24620,
654,
13,
3166,
269,
11953,
2272,
29889,
7576,
29889,
18800,
15546,
29889,
7241,
15546,
1053,
383,
29875,
15546,
13,
3166,
269,
11953,
2272,
29889,
7576,
29889,
19409,
29889,
14318,
1053,
8583,
13,
2
] |
tests/test_units/test_units.py
|
dcambie/spectrochempy
| 3 |
1612441
|
<filename>tests/test_units/test_units.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# ======================================================================================================================
# Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France. =
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See full LICENSE agreement in the root directory =
# ======================================================================================================================
from spectrochempy import ur, set_nmr_context, Quantity
def test_ppm():
x = 1 * ur.ppm
assert x.units == ur.ppm
def test_nmr_context():
set_nmr_context(larmor=104.3 * ur.MHz)
fhz = 10000 * ur.Hz
with ur.context('nmr'):
fppm = fhz.to('ppm')
assert "{:~.3f}".format(fppm) == '95.877 ppm'
print("{:.1f}".format(fppm))
with ur.context('nmr'):
fhz = fppm.to('Hz')
assert "{:~.3f}".format(fhz) == '10000.000 Hz'
print("{:.1f}".format(fhz))
def test_units():
assert 10 * ur.km == 10000 * ur.m
assert ur.km / ur.m == 1000.
x = (ur.km / ur.m)
assert x.dimensionless
def test_repr_html():
a = Quantity(10, 's/km')
assert "{}".format(a) == "10 second / kilometer"
assert a._repr_html_() == "10 s.km<sup>-1</sup>"
def test_unit_dimensionality():
a = Quantity(1., 'cm')
b = a / Quantity(1., 'km')
assert b._repr_html_() == '1.0 scaled-dimensionless (1e-05)'
# def test_matplotlib():
#
# import matplotlib.pyplot as plt
# import numpy as np
# import pint
#
# ureg = pint.UnitRegistry()
# ureg.setup_matplotlib(True)
#
# y = np.linspace(0, 30) * ureg.miles
# x = np.linspace(0, 5) * ureg.hours
#
# fig, ax = plt.subplots()
# ax.yaxis.set_units(ureg.inches)
# ax.xaxis.set_units(ureg.seconds)
#
# ax.plot(x, y, 'tab:blue')
#
# ax.axhline(26400 * ureg.feet, color='tab:red')
# ax.axvline(120 * ureg.minutes, color='tab:green')
#
# # here we just test that we can add some label to the default unit labeling
# ax.set_xlabel('xxx ({})'.format(ax.get_xlabel()))
# assert ax.get_xlabel() == 'xxx (second)'
#
# show()
|
[
1,
529,
9507,
29958,
21150,
29914,
1688,
29918,
348,
1169,
29914,
1688,
29918,
348,
1169,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
9166,
9166,
9166,
2751,
13,
29937,
29871,
14187,
1266,
313,
30211,
29897,
29871,
29906,
29900,
29896,
29945,
29899,
29906,
29900,
29906,
29896,
365,
9295,
448,
16715,
20141,
11732,
29891,
344,
634,
27738,
307,
305,
326,
347,
29892,
9243,
264,
29892,
3444,
29889,
462,
462,
29871,
353,
13,
29937,
29871,
7747,
8426,
2208,
29899,
29933,
383,
21661,
7791,
7818,
12982,
1525,
365,
2965,
1430,
1660,
16369,
1525,
12665,
3919,
448,
2823,
2989,
365,
2965,
1430,
1660,
17327,
297,
278,
3876,
3884,
462,
308,
353,
13,
29937,
1275,
9166,
9166,
9166,
9166,
9166,
9166,
9166,
2751,
13,
13,
3166,
6683,
307,
14969,
2272,
1053,
5065,
29892,
731,
29918,
22882,
29878,
29918,
4703,
29892,
22746,
537,
13,
13,
13,
1753,
1243,
29918,
407,
29885,
7295,
13,
1678,
921,
353,
29871,
29896,
334,
5065,
29889,
407,
29885,
13,
1678,
4974,
921,
29889,
348,
1169,
1275,
5065,
29889,
407,
29885,
13,
13,
13,
1753,
1243,
29918,
22882,
29878,
29918,
4703,
7295,
13,
1678,
731,
29918,
22882,
29878,
29918,
4703,
29898,
29880,
2817,
272,
29922,
29896,
29900,
29946,
29889,
29941,
334,
5065,
29889,
29924,
12661,
29897,
13,
1678,
285,
29882,
29920,
353,
29871,
29896,
29900,
29900,
29900,
29900,
334,
5065,
29889,
12661,
13,
1678,
411,
5065,
29889,
4703,
877,
22882,
29878,
29374,
13,
4706,
285,
407,
29885,
353,
285,
29882,
29920,
29889,
517,
877,
407,
29885,
1495,
13,
1678,
4974,
376,
25641,
30022,
29889,
29941,
29888,
29913,
1642,
4830,
29898,
29888,
407,
29885,
29897,
1275,
525,
29929,
29945,
29889,
29947,
29955,
29955,
282,
3358,
29915,
13,
1678,
1596,
703,
25641,
29889,
29896,
29888,
29913,
1642,
4830,
29898,
29888,
407,
29885,
876,
13,
13,
1678,
411,
5065,
29889,
4703,
877,
22882,
29878,
29374,
13,
4706,
285,
29882,
29920,
353,
285,
407,
29885,
29889,
517,
877,
12661,
1495,
13,
1678,
4974,
376,
25641,
30022,
29889,
29941,
29888,
29913,
1642,
4830,
29898,
29888,
29882,
29920,
29897,
1275,
525,
29896,
29900,
29900,
29900,
29900,
29889,
29900,
29900,
29900,
379,
29920,
29915,
13,
1678,
1596,
703,
25641,
29889,
29896,
29888,
29913,
1642,
4830,
29898,
29888,
29882,
29920,
876,
13,
13,
13,
1753,
1243,
29918,
348,
1169,
7295,
13,
1678,
4974,
29871,
29896,
29900,
334,
5065,
29889,
8848,
1275,
29871,
29896,
29900,
29900,
29900,
29900,
334,
5065,
29889,
29885,
13,
1678,
4974,
5065,
29889,
8848,
847,
5065,
29889,
29885,
1275,
29871,
29896,
29900,
29900,
29900,
29889,
13,
1678,
921,
353,
313,
332,
29889,
8848,
847,
5065,
29889,
29885,
29897,
13,
1678,
4974,
921,
29889,
6229,
2673,
2222,
13,
13,
13,
1753,
1243,
29918,
276,
558,
29918,
1420,
7295,
13,
1678,
263,
353,
22746,
537,
29898,
29896,
29900,
29892,
525,
29879,
29914,
8848,
1495,
13,
1678,
4974,
376,
8875,
1642,
4830,
29898,
29874,
29897,
1275,
376,
29896,
29900,
1473,
847,
23836,
29908,
13,
1678,
4974,
263,
3032,
276,
558,
29918,
1420,
29918,
580,
1275,
376,
29896,
29900,
269,
29889,
8848,
29966,
12587,
29958,
29899,
29896,
829,
12587,
11903,
13,
13,
13,
1753,
1243,
29918,
5441,
29918,
12531,
537,
7295,
13,
1678,
263,
353,
22746,
537,
29898,
29896,
1696,
525,
4912,
1495,
13,
1678,
289,
353,
263,
847,
22746,
537,
29898,
29896,
1696,
525,
8848,
1495,
13,
1678,
4974,
289,
3032,
276,
558,
29918,
1420,
29918,
580,
1275,
525,
29896,
29889,
29900,
6287,
29881,
29899,
6229,
2673,
2222,
313,
29896,
29872,
29899,
29900,
29945,
16029,
13,
13,
29937,
822,
1243,
29918,
2922,
17357,
7295,
13,
29937,
13,
29937,
268,
1053,
22889,
29889,
2272,
5317,
408,
14770,
13,
29937,
268,
1053,
12655,
408,
7442,
13,
29937,
268,
1053,
16483,
13,
29937,
13,
29937,
268,
318,
1727,
353,
16483,
29889,
8325,
22579,
580,
13,
29937,
268,
318,
1727,
29889,
14669,
29918,
2922,
17357,
29898,
5574,
29897,
13,
29937,
13,
29937,
268,
343,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29892,
29871,
29941,
29900,
29897,
334,
318,
1727,
29889,
29885,
5475,
13,
29937,
268,
921,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29892,
29871,
29945,
29897,
334,
318,
1727,
29889,
29882,
2470,
13,
29937,
13,
29937,
268,
2537,
29892,
4853,
353,
14770,
29889,
1491,
26762,
580,
13,
29937,
268,
4853,
29889,
29891,
8990,
29889,
842,
29918,
348,
1169,
29898,
545,
29887,
29889,
262,
6609,
29897,
13,
29937,
268,
4853,
29889,
29916,
8990,
29889,
842,
29918,
348,
1169,
29898,
545,
29887,
29889,
23128,
29897,
13,
29937,
13,
29937,
268,
4853,
29889,
5317,
29898,
29916,
29892,
343,
29892,
525,
3891,
29901,
9539,
1495,
13,
29937,
13,
29937,
268,
4853,
29889,
1165,
7760,
29898,
29906,
29953,
29946,
29900,
29900,
334,
318,
1727,
29889,
1725,
300,
29892,
2927,
2433,
3891,
29901,
1127,
1495,
13,
29937,
268,
4853,
29889,
1165,
29894,
1220,
29898,
29896,
29906,
29900,
334,
318,
1727,
29889,
1195,
2667,
29892,
2927,
2433,
3891,
29901,
12692,
1495,
13,
29937,
13,
29937,
268,
396,
1244,
591,
925,
1243,
393,
591,
508,
788,
777,
3858,
304,
278,
2322,
5190,
3858,
292,
13,
29937,
268,
4853,
29889,
842,
29918,
29916,
1643,
877,
12353,
21313,
1800,
4286,
4830,
29898,
1165,
29889,
657,
29918,
29916,
1643,
22130,
13,
29937,
268,
4974,
4853,
29889,
657,
29918,
29916,
1643,
580,
1275,
525,
12353,
313,
7496,
16029,
13,
29937,
13,
29937,
268,
1510,
580,
13,
2
] |
research/cv/vit_base/eval.py
|
leelige/mindspore
| 1 |
159518
|
<reponame>leelige/mindspore
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""
Process the test set with the .ckpt model in turn.
"""
import argparse
import mindspore.nn as nn
from mindspore import context
from mindspore.train.model import Model
from mindspore.train.serialization import load_checkpoint, load_param_into_net
from mindspore.common import set_seed
from mindspore import Tensor
from mindspore.common import dtype as mstype
from mindspore.nn.loss.loss import LossBase
from mindspore.ops import functional as F
from mindspore.ops import operations as P
from src.config import cifar10_cfg
from src.dataset import create_dataset_cifar10
from src.modeling_ms import VisionTransformer
import src.net_config as configs
set_seed(1)
parser = argparse.ArgumentParser(description='vit_base')
parser.add_argument('--dataset_name', type=str, default='cifar10', choices=['cifar10'],
help='dataset name.')
parser.add_argument('--sub_type', type=str, default='ViT-B_16',
choices=['ViT-B_16', 'ViT-B_32', 'ViT-L_16', 'ViT-L_32', 'ViT-H_14', 'testing'])
parser.add_argument('--checkpoint_path', type=str, default='./ckpt_0', help='Checkpoint file path')
parser.add_argument('--id', type=int, default=0, help='Device id')
args_opt = parser.parse_args()
class CrossEntropySmooth(LossBase):
"""CrossEntropy"""
def __init__(self, sparse=True, reduction='mean', smooth_factor=0., num_classes=1000):
super(CrossEntropySmooth, self).__init__()
self.onehot = P.OneHot()
self.sparse = sparse
self.on_value = Tensor(1.0 - smooth_factor, mstype.float32)
self.off_value = Tensor(1.0 * smooth_factor / (num_classes - 1), mstype.float32)
self.ce = nn.SoftmaxCrossEntropyWithLogits(reduction=reduction)
def construct(self, logit, label):
if self.sparse:
label = self.onehot(label, F.shape(logit)[1], self.on_value, self.off_value)
loss_ = self.ce(logit, label)
return loss_
if __name__ == '__main__':
CONFIGS = {'ViT-B_16': configs.get_b16_config,
'ViT-B_32': configs.get_b32_config,
'ViT-L_16': configs.get_l16_config,
'ViT-L_32': configs.get_l32_config,
'ViT-H_14': configs.get_h14_config,
'R50-ViT-B_16': configs.get_r50_b16_config,
'testing': configs.get_testing}
context.set_context(mode=context.GRAPH_MODE, device_target='Ascend', device_id=args_opt.id)
if args_opt.dataset_name == "cifar10":
cfg = cifar10_cfg
net = VisionTransformer(CONFIGS[args_opt.sub_type], num_classes=cfg.num_classes)
loss = nn.SoftmaxCrossEntropyWithLogits(sparse=True, reduction='mean')
opt = nn.Momentum(net.trainable_params(), 0.01, cfg.momentum, weight_decay=cfg.weight_decay)
dataset = create_dataset_cifar10(cfg.val_data_path, 1, False)
param_dict = load_checkpoint(args_opt.checkpoint_path)
print("load checkpoint from [{}].".format(args_opt.checkpoint_path))
load_param_into_net(net, param_dict)
net.set_train(False)
model = Model(net, loss_fn=loss, optimizer=opt, metrics={'acc'})
else:
raise ValueError("dataset is not support.")
acc = model.eval(dataset)
print(f"model's accuracy is {acc}")
|
[
1,
529,
276,
1112,
420,
29958,
280,
295,
2231,
29914,
24021,
1028,
487,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29896,
379,
3357,
26599,
8364,
11763,
3189,
1696,
19806,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
1360,
13,
15945,
29908,
13,
7032,
278,
1243,
731,
411,
278,
869,
384,
415,
1904,
297,
2507,
29889,
13,
15945,
29908,
13,
5215,
1852,
5510,
13,
5215,
3458,
1028,
487,
29889,
15755,
408,
302,
29876,
13,
3166,
3458,
1028,
487,
1053,
3030,
13,
3166,
3458,
1028,
487,
29889,
14968,
29889,
4299,
1053,
8125,
13,
3166,
3458,
1028,
487,
29889,
14968,
29889,
15550,
2133,
1053,
2254,
29918,
3198,
3149,
29892,
2254,
29918,
3207,
29918,
8941,
29918,
1212,
13,
3166,
3458,
1028,
487,
29889,
9435,
1053,
731,
29918,
26776,
13,
3166,
3458,
1028,
487,
1053,
323,
6073,
13,
3166,
3458,
1028,
487,
29889,
9435,
1053,
26688,
408,
286,
303,
668,
13,
3166,
3458,
1028,
487,
29889,
15755,
29889,
6758,
29889,
6758,
1053,
365,
2209,
5160,
13,
3166,
3458,
1028,
487,
29889,
3554,
1053,
13303,
408,
383,
13,
3166,
3458,
1028,
487,
29889,
3554,
1053,
6931,
408,
349,
13,
13,
3166,
4765,
29889,
2917,
1053,
274,
361,
279,
29896,
29900,
29918,
16859,
13,
3166,
4765,
29889,
24713,
1053,
1653,
29918,
24713,
29918,
29883,
361,
279,
29896,
29900,
13,
13,
3166,
4765,
29889,
4299,
292,
29918,
1516,
1053,
478,
2459,
13372,
261,
13,
5215,
4765,
29889,
1212,
29918,
2917,
408,
2295,
29879,
13,
13,
842,
29918,
26776,
29898,
29896,
29897,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
29894,
277,
29918,
3188,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
24713,
29918,
978,
742,
1134,
29922,
710,
29892,
2322,
2433,
29883,
361,
279,
29896,
29900,
742,
19995,
29922,
1839,
29883,
361,
279,
29896,
29900,
7464,
13,
462,
1678,
1371,
2433,
24713,
1024,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
1491,
29918,
1853,
742,
1134,
29922,
710,
29892,
2322,
2433,
29963,
29875,
29911,
29899,
29933,
29918,
29896,
29953,
742,
13,
462,
1678,
19995,
29922,
1839,
29963,
29875,
29911,
29899,
29933,
29918,
29896,
29953,
742,
525,
29963,
29875,
29911,
29899,
29933,
29918,
29941,
29906,
742,
525,
29963,
29875,
29911,
29899,
29931,
29918,
29896,
29953,
742,
525,
29963,
29875,
29911,
29899,
29931,
29918,
29941,
29906,
742,
525,
29963,
29875,
29911,
29899,
29950,
29918,
29896,
29946,
742,
525,
13424,
11287,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
3198,
3149,
29918,
2084,
742,
1134,
29922,
710,
29892,
2322,
2433,
6904,
384,
415,
29918,
29900,
742,
1371,
2433,
5596,
3149,
934,
2224,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
333,
742,
1134,
29922,
524,
29892,
2322,
29922,
29900,
29892,
1371,
2433,
11501,
1178,
1495,
13,
5085,
29918,
3670,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
13,
1990,
11189,
5292,
14441,
29903,
4346,
720,
29898,
29931,
2209,
5160,
1125,
13,
1678,
9995,
29907,
2124,
5292,
14441,
15945,
29908,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
29234,
29922,
5574,
29892,
20376,
2433,
12676,
742,
10597,
29918,
19790,
29922,
29900,
1696,
954,
29918,
13203,
29922,
29896,
29900,
29900,
29900,
1125,
13,
4706,
2428,
29898,
29907,
2124,
5292,
14441,
29903,
4346,
720,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
650,
8711,
353,
349,
29889,
6716,
28917,
580,
13,
4706,
1583,
29889,
29879,
5510,
353,
29234,
13,
4706,
1583,
29889,
265,
29918,
1767,
353,
323,
6073,
29898,
29896,
29889,
29900,
448,
10597,
29918,
19790,
29892,
286,
303,
668,
29889,
7411,
29941,
29906,
29897,
13,
4706,
1583,
29889,
2696,
29918,
1767,
353,
323,
6073,
29898,
29896,
29889,
29900,
334,
10597,
29918,
19790,
847,
313,
1949,
29918,
13203,
448,
29871,
29896,
511,
286,
303,
668,
29889,
7411,
29941,
29906,
29897,
13,
4706,
1583,
29889,
346,
353,
302,
29876,
29889,
6295,
615,
3317,
29907,
2124,
5292,
14441,
3047,
3403,
1169,
29898,
9313,
428,
29922,
9313,
428,
29897,
13,
13,
1678,
822,
3386,
29898,
1311,
29892,
1480,
277,
29892,
3858,
1125,
13,
4706,
565,
1583,
29889,
29879,
5510,
29901,
13,
9651,
3858,
353,
1583,
29889,
650,
8711,
29898,
1643,
29892,
383,
29889,
12181,
29898,
1188,
277,
9601,
29896,
1402,
1583,
29889,
265,
29918,
1767,
29892,
1583,
29889,
2696,
29918,
1767,
29897,
13,
4706,
6410,
29918,
353,
1583,
29889,
346,
29898,
1188,
277,
29892,
3858,
29897,
13,
4706,
736,
6410,
29918,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
8707,
3738,
10749,
353,
11117,
29963,
29875,
29911,
29899,
29933,
29918,
29896,
29953,
2396,
2295,
29879,
29889,
657,
29918,
29890,
29896,
29953,
29918,
2917,
29892,
13,
1669,
525,
29963,
29875,
29911,
29899,
29933,
29918,
29941,
29906,
2396,
2295,
29879,
29889,
657,
29918,
29890,
29941,
29906,
29918,
2917,
29892,
13,
1669,
525,
29963,
29875,
29911,
29899,
29931,
29918,
29896,
29953,
2396,
2295,
29879,
29889,
657,
29918,
29880,
29896,
29953,
29918,
2917,
29892,
13,
1669,
525,
29963,
29875,
29911,
29899,
29931,
29918,
29941,
29906,
2396,
2295,
29879,
29889,
657,
29918,
29880,
29941,
29906,
29918,
2917,
29892,
13,
1669,
525,
29963,
29875,
29911,
29899,
29950,
29918,
29896,
29946,
2396,
2295,
29879,
29889,
657,
29918,
29882,
29896,
29946,
29918,
2917,
29892,
13,
1669,
525,
29934,
29945,
29900,
29899,
29963,
29875,
29911,
29899,
29933,
29918,
29896,
29953,
2396,
2295,
29879,
29889,
657,
29918,
29878,
29945,
29900,
29918,
29890,
29896,
29953,
29918,
2917,
29892,
13,
1669,
525,
13424,
2396,
2295,
29879,
29889,
657,
29918,
13424,
29913,
13,
1678,
3030,
29889,
842,
29918,
4703,
29898,
8513,
29922,
4703,
29889,
14345,
3301,
29950,
29918,
20387,
29892,
4742,
29918,
5182,
2433,
29909,
1557,
355,
742,
4742,
29918,
333,
29922,
5085,
29918,
3670,
29889,
333,
29897,
13,
1678,
565,
6389,
29918,
3670,
29889,
24713,
29918,
978,
1275,
376,
29883,
361,
279,
29896,
29900,
1115,
13,
4706,
274,
16434,
353,
274,
361,
279,
29896,
29900,
29918,
16859,
13,
4706,
7787,
353,
478,
2459,
13372,
261,
29898,
6007,
3738,
10749,
29961,
5085,
29918,
3670,
29889,
1491,
29918,
1853,
1402,
954,
29918,
13203,
29922,
16859,
29889,
1949,
29918,
13203,
29897,
13,
4706,
6410,
353,
302,
29876,
29889,
6295,
615,
3317,
29907,
2124,
5292,
14441,
3047,
3403,
1169,
29898,
29879,
5510,
29922,
5574,
29892,
20376,
2433,
12676,
1495,
13,
4706,
3523,
353,
302,
29876,
29889,
29924,
2932,
398,
29898,
1212,
29889,
14968,
519,
29918,
7529,
3285,
29871,
29900,
29889,
29900,
29896,
29892,
274,
16434,
29889,
29885,
2932,
398,
29892,
7688,
29918,
7099,
388,
29922,
16859,
29889,
7915,
29918,
7099,
388,
29897,
13,
4706,
8783,
353,
1653,
29918,
24713,
29918,
29883,
361,
279,
29896,
29900,
29898,
16859,
29889,
791,
29918,
1272,
29918,
2084,
29892,
29871,
29896,
29892,
7700,
29897,
13,
4706,
1828,
29918,
8977,
353,
2254,
29918,
3198,
3149,
29898,
5085,
29918,
3670,
29889,
3198,
3149,
29918,
2084,
29897,
13,
4706,
1596,
703,
1359,
1423,
3149,
515,
15974,
6525,
1213,
29889,
4830,
29898,
5085,
29918,
3670,
29889,
3198,
3149,
29918,
2084,
876,
13,
4706,
2254,
29918,
3207,
29918,
8941,
29918,
1212,
29898,
1212,
29892,
1828,
29918,
8977,
29897,
13,
4706,
7787,
29889,
842,
29918,
14968,
29898,
8824,
29897,
13,
4706,
1904,
353,
8125,
29898,
1212,
29892,
6410,
29918,
9144,
29922,
6758,
29892,
5994,
3950,
29922,
3670,
29892,
21556,
3790,
29915,
5753,
29915,
1800,
13,
1678,
1683,
29901,
13,
4706,
12020,
7865,
2392,
703,
24713,
338,
451,
2304,
23157,
13,
13,
1678,
1035,
353,
1904,
29889,
14513,
29898,
24713,
29897,
13,
1678,
1596,
29898,
29888,
29908,
4299,
29915,
29879,
13600,
338,
426,
5753,
27195,
13,
2
] |
src/airflow_salesforce_plugin/hooks/salesforce_hook.py
|
techalchemy/airflow-salesforce-plugin
| 1 |
165138
|
# Copyright (c) 2019 <NAME>
# MIT License <https://opensource.org/licenses/mit>
from __future__ import absolute_import, unicode_literals
import collections
import csv
import io
import pathlib
import sqlite3
import tempfile
import uuid
from typing import Any, Dict, Generator, List, Optional, Set, Tuple, Union
import pandas as pd
import sqlparse
from airflow.exceptions import AirflowException
from airflow.hooks.base_hook import BaseHook
from simple_salesforce.api import Salesforce, exception_handler
class StreamingSalesforce(Salesforce):
def query_streaming(self, query, include_deleted=False, **kwargs):
url = self.base_url + ("queryAll/" if include_deleted else "query/")
params = {"q": query}
# `requests` will correctly encode the query string passed as `params`
return self._call_salesforce(
"GET", url, name="query", params=params, stream=True, **kwargs
)
def query_more_streaming(
self,
next_records_identifier,
identifier_is_url=False,
include_deleted=False,
**kwargs,
):
if identifier_is_url:
# Don't use `self.base_url` here because the full URI is provided
url = f"https://{self.sf_instance}{next_records_identifier}"
else:
endpoint = "queryAll" if include_deleted else "query"
url = f"{self.base_url}{endpoint}/{next_records_identifier}"
return self._call_salesforce("GET", url, name="query_more", stream=True, **kwargs)
class SalesforceHook(BaseHook):
"""
Salesforce connection hook.
..note:: Uses `simple_salesforce <https://github.com/simple-salesforce/>`_
with `requests <https://github.com/requests/requests>`_ for all connections
and queries to Salesforce.
"""
conn_name_attr = "conn_id"
default_conn_name = "salesforce_default"
def __init__(self, conn_id: str = "salesforce_default", *args, **kwargs) -> None:
self.conn_id: str = conn_id
self._args = args
self._kwargs = kwargs
self.connection = self.get_connection(self.conn_id)
self.session: Optional[StreamingSalesforce] = None
def login(self) -> "SalesforceHook":
"""
Establishes a connection to Salesforce.
:return: The current object instance
:rtype: SalesforceHook
"""
if isinstance(self.session, StreamingSalesforce):
return self
self.log.info(f"establishing connection to salesforce {self.connection.host!r}")
extras: Dict[str, str] = self.connection.extra_dejson
auth_type: str = extras.get("auth_type", "password")
auth_kwargs: Dict[str, Union[Optional[str], bool]] = {}
sandbox = extras.get("sandbox", False) in ("yes", "y", "1", 1, True)
if auth_type == "direct":
auth_kwargs = {
"instance_url": self.connection.host,
"session_id": self.connection.password,
}
else:
auth_kwargs = {
"username": self.connection.login,
"password": <PASSWORD>,
"security_token": extras.get("security_token"),
# "instance_url": self.connection.host,
"sandbox": sandbox,
}
self.log.info("Signing into salesforce...")
self.log.info(f"Using username: {self.connection.login} with sandbox={sandbox!s}")
self.session = StreamingSalesforce(**auth_kwargs) # type: ignore
if not self.session:
self.log.error(f"Failed connecting to salesforce: {self.session}")
raise AirflowException("Connection failure during salesforce connection!")
return self
def _parse_identifiers(self, sql: str) -> Tuple[str, List[str]]:
"""
Parses a sql statement for the first identifier list.
:param sql: The sql statement to parse
:type sql: str
:return: A tuple of the table name and the list of identifiers
:rtype: Tuple[str, List[str]]
"""
table_name: str = ""
columns: List[str] = []
statements: List[Any] = sqlparse.parse(sql)
# NOTE: only parses first full statement
for token in statements[0].tokens:
if isinstance(token, (sqlparse.sql.IdentifierList,)):
for identifier in token:
if (
isinstance(identifier, (sqlparse.sql.Identifier,))
or identifier.ttype in (sqlparse.tokens.Keyword,)
or identifier.value.lower() in ("type", "alias")
):
columns.append(identifier.value)
elif isinstance(token, (sqlparse.sql.Identifier,)) or token.ttype in (
sqlparse.tokens.Keyword,
):
table_name = token.value
return (table_name, columns)
def _extract_columns(self, sql: str, replace: Dict[str, str] = None) -> List[str]:
"""
Extracts column names from a given sql statement.
:param sql: The sql statement to parse
:type sql: str
:param replace: Character replacement for the column names, defaults to None
:param replace: Dict, optional
:return: The extracted column names
:rtype: List[str]
"""
if replace is None:
replace = {}
columns: List[str] = []
for field in self._parse_identifiers(sql)[-1]:
for (old, new) in replace.items():
field = field.replace(old, new)
columns.append(field)
return columns
def _extract_row(self, result: collections.OrderedDict) -> List[Any]:
"""
Extracts the rows from a given result from querying Salesforce.
:param result: The result to extract rows from
:type result: collections.OrderedDict
:return: A list of values
:rtype: list
"""
values: List[Any] = []
for (column, value) in result.items():
if column.lower() not in ("attributes",):
if isinstance(value, collections.OrderedDict):
values.extend(self._extract_row(value))
else:
values.append(value)
return values
def _get_results(self, sql: str, url: str = None, gen_uuid: str = None, **kwargs):
"""
Query the session instance for a response using the supplied sql or next url
:param str sql: Sql to execute
:param Optional[str] url: Url to visit, (default: None)
:param Optional[str] gen_uuid: UUID for the session, (default: None)
:return: A response instance from the session
:rtype: :class:`requests.PreparedResponse`
"""
assert self.session
if not url:
kwargs.update({"include_deleted": True})
return self.session.query_streaming(sql, **kwargs)
return self.session.query_more_streaming(url, identifier_is_url=True)
def _gen_result_frames(
self,
sql: str,
columns: List[str],
page: int = 1,
url: str = None,
gen_uuid: str = None,
include_headers: bool = False,
**kwargs,
) -> Optional[pd.DataFrame]:
"""
Generates results from executing a sql statement.
:param str sql: The sql statement to execute
:param Optional[str] url: The url of the next page of results (default: None)
:param Optional[str] gen_uuid: The session-specific UUID (default: None)
:return: A generator over the :class:`pd.DataFrame` instances from the results
:rtype: Generator
"""
if not gen_uuid:
gen_uuid = str(uuid.uuid4())
try:
df = pd.read_json(
self._get_results(sql, url=url, gen_uuid=gen_uuid).iter_lines(),
lines=True,
chunk=1,
)
except Exception:
df = pd.read_json(self._get_results(sql, url=url, gen_uuid=gen_uuid).text)
new_df = pd.DataFrame.from_records(
df.records.apply(lambda x: {k: v for k, v in x.items() if k != "attributes"})
)
df["page"] = page
if not df["records"].count():
return new_df
df["page"] = page
unique_records = df.done.unique()
try:
done = unique_records[0]
except IndexError:
done = True
if new_df.columns.size < 1:
new_df.columns = [c.replace(".", "_") for c in columns]
else:
new_df.columns = new_df.columns.str.lower()
joined_tables: Dict[str, Set[str]] = collections.defaultdict(set)
join_columns = [col for col in columns if "." in col]
for col in join_columns:
table, _, col_name = col.partition(".")
joined_tables[table].add(col_name)
for table in joined_tables:
table_df = new_df[table].apply(pd.Series)
table_df = table_df.drop("attributes", axis=1).add_prefix(f"{table}_")
table_df.columns = table_df.columns.str.lower()
new_df = pd.concat([new_df.drop([table], axis=1), table_df], axis=1)
columns = [c.replace(".", "_").lower() for c in columns]
new_df = new_df[columns]
yield new_df
next_url = None
if not done:
page += 1
next_url = df.nextRecordsUrl.unique()[0]
for next_df in self._gen_result_frames(
sql,
columns=columns,
url=next_url,
gen_uuid=gen_uuid,
include_headers=False,
):
yield next_df
def dump_sqlite(
self, sql: str, filepath: str, table: str, parameters: List[str], **kwargs
):
"""Dump the results of the supplied sql to the target sqlite database
:param str sql: Parameterized soql to use for querying
:param str filepath: Filepath to export results to
:param str table: The target table
:param List[str] parameters: Parameters to use as arguments to the soql
:return: A count of the rows written
:rtype: int
"""
if not self.session:
self.login()
if parameters is None:
parameters = []
if len(parameters) > 0:
sql = sql % tuple(parameters)
kwargs.update({"include_deleted": True})
columns = [col for col in self._extract_columns(sql)]
filepath = pathlib.Path(filepath).absolute().as_posix()
sqlite_conn = sqlite3.connect(filepath)
rows = 0
include_headers = True
for df in self._gen_result_frames(
sql, columns=columns, include_headers=include_headers, **kwargs
):
rows += len(df)
df.to_sql(
table, con=sqlite_conn, if_exists="append", chunksize=200, index=False
)
return rows
def dump_csv(
self,
sql: str,
filepath: str,
parameters: List[str],
include_headers: bool = True,
**kwargs,
) -> int:
"""Dump the results of the requested sql to CSV
:param str sql: Parameterized soql to use for querying
:param str filepath: Filepath to export results to
:param List[str] parameters: Parameters to use as arguments to the soql
:param bool include_headers: Whether to include headers in the output, defaults to True
:return: A count of the rows written
:rtype: int
"""
if not self.session:
self.login()
if parameters is None:
parameters = []
if len(parameters) > 0:
sql = sql % tuple(parameters)
kwargs.update({"include_deleted": True})
columns = [col for col in self._extract_columns(sql)]
temp_dir = tempfile.TemporaryDirectory(prefix="salesforce", suffix="csvs")
if not filepath:
tmpfile = tempfile.NamedTemporaryFile(
prefix="airflow",
suffix="salesforce.csv",
delete=False,
dir=temp_dir.name,
encoding="utf-8",
)
filepath = tmpfile.name
tmpfile.close()
rows = 0
for df in self._gen_result_frames(
sql,
columns=columns,
temp_dir=temp_dir,
temp_file=filepath,
include_headers=include_headers,
**kwargs,
):
rows += len(df)
df.to_csv(
filepath,
chunksize=200,
header=include_headers,
encoding="utf-8",
index=False,
mode="a",
)
if include_headers:
include_headers = False
return rows
def _gen_results(
self, sql: str, url: str = None, gen_uuid: str = None, **kwargs
) -> Generator[List[Any], None, None]:
"""
Generates results from executing a sql statement.
:param str sql: The sql statement to execute
:param Optional[str] url: The url of the next page of results (default: None)
:param Optional[str] gen_uuid: The session-specific UUID (default: None)
:return: A generator which resulting rows from executing the given sql
:rtype: Generator
"""
# create generation uuid to show what logs are part of the same process
if not gen_uuid:
gen_uuid = str(uuid.uuid4())
results = self._get_results(sql, url=url, gen_uuid=gen_uuid)
if not results:
yield []
next_url = None
for row in results.get("records", []):
yield self._extract_row(row)
if not results["done"]:
next_url = results.get("nextRecordsUrl", None)
for row in self._gen_results(sql, url=next_url, gen_uuid=gen_uuid):
yield row
def query(
self,
sql: str,
parameters: List[str] = None,
include_headers: bool = True,
**kwargs,
) -> Generator[List[Any], None, None]:
"""
Generates the results from executing a given sql statement
:param sql: The given sql statement to execute
:type sql: str
:param parameters: The parameters to use for the sql, defaults to None
:type parameters: List[str], optional
:param include_headers: True to include columns as the first result,
defaults to True
:type include_headers: bool, optional
:return: A generator which iterates over results from executing the givne sql
:rtype: Generator
"""
if parameters is None:
parameters = []
if len(parameters) > 0:
sql = sql % tuple(parameters)
kwargs.update({"include_deleted": True})
self.log.info(f"executing query {sql!r}")
if include_headers:
yield self._extract_columns(sql, replace={".": "_"})
self.login()
for row in self._gen_results(sql, **kwargs):
yield row
def export(
self,
sql: str,
filepath: str,
parameters: List[str] = None,
include_headers: bool = True,
**kwargs,
) -> str:
"""
Exports the result of executing sql to a given filepath.
:param sql: The sql statement to execute
:type sql: str
:param filepath: The filepath to export results to
:type filepath: str
:param parameters: The parameters to use for the sql, defaults to None
:type parameters: List[str], optional
:param include_headers: True to include columns as the first result,
defaults to True
:type include_headers: bool, optional
:return: The resulting exported filepath
:rtype: str
"""
self.log.info(f"writing results of sql {sql!r} to {filepath!r}")
if not parameters:
parameters = []
rowcount = self.dump_csv(
sql=sql, filepath=filepath, parameters=parameters, include_headers=True
)
self.log.info(f"*** TASK COMPLETE ***: Wrote {rowcount!s} rows!")
return filepath
|
[
1,
396,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29929,
529,
5813,
29958,
13,
29937,
341,
1806,
19245,
529,
991,
597,
22156,
1167,
29889,
990,
29914,
506,
11259,
29914,
2415,
29958,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
29892,
29104,
29918,
20889,
1338,
13,
13,
5215,
16250,
13,
5215,
11799,
13,
5215,
12013,
13,
5215,
2224,
1982,
13,
5215,
21120,
29941,
13,
5215,
5694,
1445,
13,
5215,
318,
5416,
13,
3166,
19229,
1053,
3139,
29892,
360,
919,
29892,
3251,
1061,
29892,
2391,
29892,
28379,
29892,
3789,
29892,
12603,
552,
29892,
7761,
13,
13,
5215,
11701,
408,
10518,
13,
5215,
4576,
5510,
13,
3166,
4799,
1731,
29889,
11739,
29879,
1053,
5593,
1731,
2451,
13,
3166,
4799,
1731,
29889,
1251,
12117,
29889,
3188,
29918,
20849,
1053,
7399,
29950,
2550,
13,
3166,
2560,
29918,
29879,
2122,
10118,
29889,
2754,
1053,
28389,
10118,
29892,
3682,
29918,
13789,
13,
13,
13,
1990,
13763,
292,
29903,
2122,
10118,
29898,
29903,
2122,
10118,
1125,
13,
1678,
822,
2346,
29918,
5461,
292,
29898,
1311,
29892,
2346,
29892,
3160,
29918,
311,
22742,
29922,
8824,
29892,
3579,
19290,
1125,
13,
4706,
3142,
353,
1583,
29889,
3188,
29918,
2271,
718,
4852,
1972,
3596,
12975,
565,
3160,
29918,
311,
22742,
1683,
376,
1972,
29914,
1159,
13,
4706,
8636,
353,
8853,
29939,
1115,
2346,
29913,
13,
4706,
396,
421,
24830,
29952,
674,
5149,
19750,
278,
2346,
1347,
4502,
408,
421,
7529,
29952,
13,
4706,
736,
1583,
3032,
4804,
29918,
29879,
2122,
10118,
29898,
13,
9651,
376,
7194,
613,
3142,
29892,
1024,
543,
1972,
613,
8636,
29922,
7529,
29892,
4840,
29922,
5574,
29892,
3579,
19290,
13,
4706,
1723,
13,
13,
1678,
822,
2346,
29918,
5514,
29918,
5461,
292,
29898,
13,
4706,
1583,
29892,
13,
4706,
2446,
29918,
3757,
4339,
29918,
25378,
29892,
13,
4706,
15882,
29918,
275,
29918,
2271,
29922,
8824,
29892,
13,
4706,
3160,
29918,
311,
22742,
29922,
8824,
29892,
13,
4706,
3579,
19290,
29892,
13,
268,
1125,
13,
4706,
565,
15882,
29918,
275,
29918,
2271,
29901,
13,
9651,
396,
3872,
29915,
29873,
671,
421,
1311,
29889,
3188,
29918,
2271,
29952,
1244,
1363,
278,
2989,
23539,
338,
4944,
13,
9651,
3142,
353,
285,
29908,
991,
597,
29912,
1311,
29889,
4668,
29918,
8758,
1157,
4622,
29918,
3757,
4339,
29918,
25378,
5038,
13,
4706,
1683,
29901,
13,
9651,
16248,
353,
376,
1972,
3596,
29908,
565,
3160,
29918,
311,
22742,
1683,
376,
1972,
29908,
13,
9651,
3142,
353,
285,
29908,
29912,
1311,
29889,
3188,
29918,
2271,
1157,
29734,
6822,
29912,
4622,
29918,
3757,
4339,
29918,
25378,
5038,
13,
4706,
736,
1583,
3032,
4804,
29918,
29879,
2122,
10118,
703,
7194,
613,
3142,
29892,
1024,
543,
1972,
29918,
5514,
613,
4840,
29922,
5574,
29892,
3579,
19290,
29897,
13,
13,
13,
1990,
28389,
10118,
29950,
2550,
29898,
5160,
29950,
2550,
1125,
13,
13,
1678,
9995,
13,
1678,
28389,
10118,
3957,
12422,
29889,
13,
13,
1678,
6317,
6812,
1057,
10783,
267,
421,
12857,
29918,
29879,
2122,
10118,
529,
991,
597,
3292,
29889,
510,
29914,
12857,
29899,
29879,
2122,
10118,
3779,
29952,
29918,
13,
4706,
411,
421,
24830,
529,
991,
597,
3292,
29889,
510,
29914,
24830,
29914,
24830,
13885,
29918,
363,
599,
12368,
13,
4706,
322,
9365,
304,
28389,
10118,
29889,
13,
1678,
9995,
13,
13,
1678,
11009,
29918,
978,
29918,
5552,
353,
376,
13082,
29918,
333,
29908,
13,
1678,
2322,
29918,
13082,
29918,
978,
353,
376,
29879,
2122,
10118,
29918,
4381,
29908,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
11009,
29918,
333,
29901,
851,
353,
376,
29879,
2122,
10118,
29918,
4381,
613,
334,
5085,
29892,
3579,
19290,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
13082,
29918,
333,
29901,
851,
353,
11009,
29918,
333,
13,
4706,
1583,
3032,
5085,
353,
6389,
13,
4706,
1583,
3032,
19290,
353,
9049,
5085,
13,
4706,
1583,
29889,
9965,
353,
1583,
29889,
657,
29918,
9965,
29898,
1311,
29889,
13082,
29918,
333,
29897,
13,
4706,
1583,
29889,
7924,
29901,
28379,
29961,
3835,
292,
29903,
2122,
10118,
29962,
353,
6213,
13,
13,
1678,
822,
6464,
29898,
1311,
29897,
1599,
376,
29903,
2122,
10118,
29950,
2550,
1115,
13,
4706,
9995,
13,
4706,
2661,
370,
1674,
267,
263,
3957,
304,
28389,
10118,
29889,
13,
13,
4706,
584,
2457,
29901,
450,
1857,
1203,
2777,
13,
4706,
584,
29878,
1853,
29901,
28389,
10118,
29950,
2550,
13,
4706,
9995,
13,
13,
4706,
565,
338,
8758,
29898,
1311,
29889,
7924,
29892,
13763,
292,
29903,
2122,
10118,
1125,
13,
9651,
736,
1583,
13,
13,
4706,
1583,
29889,
1188,
29889,
3888,
29898,
29888,
29908,
342,
370,
1674,
292,
3957,
304,
16538,
10118,
426,
1311,
29889,
9965,
29889,
3069,
29991,
29878,
27195,
13,
4706,
429,
10678,
29901,
360,
919,
29961,
710,
29892,
851,
29962,
353,
1583,
29889,
9965,
29889,
17833,
29918,
311,
3126,
13,
4706,
4817,
29918,
1853,
29901,
851,
353,
429,
10678,
29889,
657,
703,
5150,
29918,
1853,
613,
376,
5630,
1159,
13,
4706,
4817,
29918,
19290,
29901,
360,
919,
29961,
710,
29892,
7761,
29961,
27636,
29961,
710,
1402,
6120,
5262,
353,
6571,
13,
4706,
11982,
1884,
353,
429,
10678,
29889,
657,
703,
29879,
26738,
613,
7700,
29897,
297,
4852,
3582,
613,
376,
29891,
613,
376,
29896,
613,
29871,
29896,
29892,
5852,
29897,
13,
4706,
565,
4817,
29918,
1853,
1275,
376,
11851,
1115,
13,
9651,
4817,
29918,
19290,
353,
426,
13,
18884,
376,
8758,
29918,
2271,
1115,
1583,
29889,
9965,
29889,
3069,
29892,
13,
18884,
376,
7924,
29918,
333,
1115,
1583,
29889,
9965,
29889,
5630,
29892,
13,
9651,
500,
13,
4706,
1683,
29901,
13,
9651,
4817,
29918,
19290,
353,
426,
13,
18884,
376,
6786,
1115,
1583,
29889,
9965,
29889,
7507,
29892,
13,
18884,
376,
5630,
1115,
529,
25711,
17013,
10202,
13,
18884,
376,
8926,
29918,
6979,
1115,
429,
10678,
29889,
657,
703,
8926,
29918,
6979,
4968,
13,
18884,
396,
376,
8758,
29918,
2271,
1115,
1583,
29889,
9965,
29889,
3069,
29892,
13,
18884,
376,
29879,
26738,
1115,
11982,
1884,
29892,
13,
9651,
500,
13,
4706,
1583,
29889,
1188,
29889,
3888,
703,
10140,
292,
964,
16538,
10118,
856,
1159,
13,
4706,
1583,
29889,
1188,
29889,
3888,
29898,
29888,
29908,
15156,
8952,
29901,
426,
1311,
29889,
9965,
29889,
7507,
29913,
411,
11982,
1884,
3790,
29879,
26738,
29991,
29879,
27195,
13,
4706,
1583,
29889,
7924,
353,
13763,
292,
29903,
2122,
10118,
29898,
1068,
5150,
29918,
19290,
29897,
29871,
396,
1134,
29901,
11455,
13,
4706,
565,
451,
1583,
29889,
7924,
29901,
13,
9651,
1583,
29889,
1188,
29889,
2704,
29898,
29888,
29908,
17776,
16791,
304,
16538,
10118,
29901,
426,
1311,
29889,
7924,
27195,
13,
9651,
12020,
5593,
1731,
2451,
703,
5350,
10672,
2645,
16538,
10118,
3957,
29991,
1159,
13,
4706,
736,
1583,
13,
13,
1678,
822,
903,
5510,
29918,
1693,
14903,
29898,
1311,
29892,
4576,
29901,
851,
29897,
1599,
12603,
552,
29961,
710,
29892,
2391,
29961,
710,
5262,
29901,
13,
4706,
9995,
13,
4706,
1459,
29879,
267,
263,
4576,
3229,
363,
278,
937,
15882,
1051,
29889,
13,
13,
4706,
584,
3207,
4576,
29901,
450,
4576,
3229,
304,
6088,
13,
4706,
584,
1853,
4576,
29901,
851,
13,
4706,
584,
2457,
29901,
319,
18761,
310,
278,
1591,
1024,
322,
278,
1051,
310,
2893,
14903,
13,
4706,
584,
29878,
1853,
29901,
12603,
552,
29961,
710,
29892,
2391,
29961,
710,
5262,
13,
4706,
9995,
13,
13,
4706,
1591,
29918,
978,
29901,
851,
353,
5124,
13,
4706,
4341,
29901,
2391,
29961,
710,
29962,
353,
5159,
13,
4706,
9506,
29901,
2391,
29961,
10773,
29962,
353,
4576,
5510,
29889,
5510,
29898,
2850,
29897,
13,
13,
4706,
396,
6058,
29923,
29901,
871,
610,
29879,
267,
937,
2989,
3229,
13,
4706,
363,
5993,
297,
9506,
29961,
29900,
1822,
517,
12360,
29901,
13,
9651,
565,
338,
8758,
29898,
6979,
29892,
313,
2850,
5510,
29889,
2850,
29889,
12889,
1293,
29892,
22164,
13,
18884,
363,
15882,
297,
5993,
29901,
13,
462,
1678,
565,
313,
13,
462,
4706,
338,
8758,
29898,
25378,
29892,
313,
2850,
5510,
29889,
2850,
29889,
12889,
29892,
876,
13,
462,
4706,
470,
15882,
29889,
698,
668,
297,
313,
2850,
5510,
29889,
517,
12360,
29889,
2558,
1742,
29892,
29897,
13,
462,
4706,
470,
15882,
29889,
1767,
29889,
13609,
580,
297,
4852,
1853,
613,
376,
19973,
1159,
13,
462,
268,
1125,
13,
462,
4706,
4341,
29889,
4397,
29898,
25378,
29889,
1767,
29897,
13,
9651,
25342,
338,
8758,
29898,
6979,
29892,
313,
2850,
5510,
29889,
2850,
29889,
12889,
29892,
876,
470,
5993,
29889,
698,
668,
297,
313,
13,
18884,
4576,
5510,
29889,
517,
12360,
29889,
2558,
1742,
29892,
13,
632,
1125,
13,
18884,
1591,
29918,
978,
353,
5993,
29889,
1767,
13,
13,
4706,
736,
313,
2371,
29918,
978,
29892,
4341,
29897,
13,
13,
1678,
822,
903,
21111,
29918,
13099,
29898,
1311,
29892,
4576,
29901,
851,
29892,
5191,
29901,
360,
919,
29961,
710,
29892,
851,
29962,
353,
6213,
29897,
1599,
2391,
29961,
710,
5387,
13,
4706,
9995,
13,
4706,
7338,
1461,
29879,
1897,
2983,
515,
263,
2183,
4576,
3229,
29889,
13,
13,
4706,
584,
3207,
4576,
29901,
450,
4576,
3229,
304,
6088,
13,
4706,
584,
1853,
4576,
29901,
851,
13,
4706,
584,
3207,
5191,
29901,
26804,
16920,
363,
278,
1897,
2983,
29892,
21274,
304,
6213,
13,
4706,
584,
3207,
5191,
29901,
360,
919,
29892,
13136,
13,
4706,
584,
2457,
29901,
450,
23892,
1897,
2983,
13,
4706,
584,
29878,
1853,
29901,
2391,
29961,
710,
29962,
13,
4706,
9995,
13,
13,
4706,
565,
5191,
338,
6213,
29901,
13,
9651,
5191,
353,
6571,
13,
4706,
4341,
29901,
2391,
29961,
710,
29962,
353,
5159,
13,
4706,
363,
1746,
297,
1583,
3032,
5510,
29918,
1693,
14903,
29898,
2850,
9601,
29899,
29896,
5387,
13,
9651,
363,
313,
1025,
29892,
716,
29897,
297,
5191,
29889,
7076,
7295,
13,
18884,
1746,
353,
1746,
29889,
6506,
29898,
1025,
29892,
716,
29897,
13,
9651,
4341,
29889,
4397,
29898,
2671,
29897,
13,
4706,
736,
4341,
13,
13,
1678,
822,
903,
21111,
29918,
798,
29898,
1311,
29892,
1121,
29901,
16250,
29889,
7514,
287,
21533,
29897,
1599,
2391,
29961,
10773,
5387,
13,
4706,
9995,
13,
4706,
7338,
1461,
29879,
278,
4206,
515,
263,
2183,
1121,
515,
2346,
292,
28389,
10118,
29889,
13,
13,
4706,
584,
3207,
1121,
29901,
450,
1121,
304,
6597,
4206,
515,
13,
4706,
584,
1853,
1121,
29901,
16250,
29889,
7514,
287,
21533,
13,
4706,
584,
2457,
29901,
319,
1051,
310,
1819,
13,
4706,
584,
29878,
1853,
29901,
1051,
13,
4706,
9995,
13,
13,
4706,
1819,
29901,
2391,
29961,
10773,
29962,
353,
5159,
13,
4706,
363,
313,
4914,
29892,
995,
29897,
297,
1121,
29889,
7076,
7295,
13,
9651,
565,
1897,
29889,
13609,
580,
451,
297,
4852,
15697,
613,
1125,
13,
18884,
565,
338,
8758,
29898,
1767,
29892,
16250,
29889,
7514,
287,
21533,
1125,
13,
462,
1678,
1819,
29889,
21843,
29898,
1311,
3032,
21111,
29918,
798,
29898,
1767,
876,
13,
18884,
1683,
29901,
13,
462,
1678,
1819,
29889,
4397,
29898,
1767,
29897,
13,
4706,
736,
1819,
13,
13,
1678,
822,
903,
657,
29918,
9902,
29898,
1311,
29892,
4576,
29901,
851,
29892,
3142,
29901,
851,
353,
6213,
29892,
2531,
29918,
25118,
29901,
851,
353,
6213,
29892,
3579,
19290,
1125,
13,
4706,
9995,
13,
4706,
13641,
278,
4867,
2777,
363,
263,
2933,
773,
278,
19056,
4576,
470,
2446,
3142,
13,
13,
4706,
584,
3207,
851,
4576,
29901,
13093,
304,
6222,
13,
4706,
584,
3207,
28379,
29961,
710,
29962,
3142,
29901,
501,
2096,
304,
6493,
29892,
313,
4381,
29901,
6213,
29897,
13,
4706,
584,
3207,
28379,
29961,
710,
29962,
2531,
29918,
25118,
29901,
501,
11150,
363,
278,
4867,
29892,
313,
4381,
29901,
6213,
29897,
13,
4706,
584,
2457,
29901,
319,
2933,
2777,
515,
278,
4867,
13,
4706,
584,
29878,
1853,
29901,
584,
1990,
18078,
24830,
29889,
29925,
3445,
1965,
5103,
29952,
13,
4706,
9995,
13,
4706,
4974,
1583,
29889,
7924,
13,
4706,
565,
451,
3142,
29901,
13,
9651,
9049,
5085,
29889,
5504,
3319,
29908,
2856,
29918,
311,
22742,
1115,
5852,
1800,
13,
9651,
736,
1583,
29889,
7924,
29889,
1972,
29918,
5461,
292,
29898,
2850,
29892,
3579,
19290,
29897,
13,
4706,
736,
1583,
29889,
7924,
29889,
1972,
29918,
5514,
29918,
5461,
292,
29898,
2271,
29892,
15882,
29918,
275,
29918,
2271,
29922,
5574,
29897,
13,
13,
1678,
822,
903,
1885,
29918,
2914,
29918,
19935,
29898,
13,
4706,
1583,
29892,
13,
4706,
4576,
29901,
851,
29892,
13,
4706,
4341,
29901,
2391,
29961,
710,
1402,
13,
4706,
1813,
29901,
938,
353,
29871,
29896,
29892,
13,
4706,
3142,
29901,
851,
353,
6213,
29892,
13,
4706,
2531,
29918,
25118,
29901,
851,
353,
6213,
29892,
13,
4706,
3160,
29918,
13662,
29901,
6120,
353,
7700,
29892,
13,
4706,
3579,
19290,
29892,
13,
1678,
1723,
1599,
28379,
29961,
15926,
29889,
17271,
5387,
13,
4706,
9995,
13,
4706,
3251,
1078,
2582,
515,
14012,
263,
4576,
3229,
29889,
13,
13,
4706,
584,
3207,
851,
4576,
29901,
450,
4576,
3229,
304,
6222,
13,
4706,
584,
3207,
28379,
29961,
710,
29962,
3142,
29901,
450,
3142,
310,
278,
2446,
1813,
310,
2582,
313,
4381,
29901,
6213,
29897,
13,
4706,
584,
3207,
28379,
29961,
710,
29962,
2531,
29918,
25118,
29901,
450,
4867,
29899,
14940,
501,
11150,
313,
4381,
29901,
6213,
29897,
13,
4706,
584,
2457,
29901,
319,
15299,
975,
278,
584,
1990,
18078,
15926,
29889,
17271,
29952,
8871,
515,
278,
2582,
13,
4706,
584,
29878,
1853,
29901,
3251,
1061,
13,
4706,
9995,
13,
13,
4706,
565,
451,
2531,
29918,
25118,
29901,
13,
9651,
2531,
29918,
25118,
353,
851,
29898,
25118,
29889,
25118,
29946,
3101,
13,
4706,
1018,
29901,
13,
9651,
4489,
353,
10518,
29889,
949,
29918,
3126,
29898,
13,
18884,
1583,
3032,
657,
29918,
9902,
29898,
2850,
29892,
3142,
29922,
2271,
29892,
2531,
29918,
25118,
29922,
1885,
29918,
25118,
467,
1524,
29918,
9012,
3285,
13,
18884,
3454,
29922,
5574,
29892,
13,
18884,
19875,
29922,
29896,
29892,
13,
9651,
1723,
13,
4706,
5174,
8960,
29901,
13,
9651,
4489,
353,
10518,
29889,
949,
29918,
3126,
29898,
1311,
3032,
657,
29918,
9902,
29898,
2850,
29892,
3142,
29922,
2271,
29892,
2531,
29918,
25118,
29922,
1885,
29918,
25118,
467,
726,
29897,
13,
4706,
716,
29918,
2176,
353,
10518,
29889,
17271,
29889,
3166,
29918,
3757,
4339,
29898,
13,
9651,
4489,
29889,
3757,
4339,
29889,
7302,
29898,
2892,
921,
29901,
426,
29895,
29901,
325,
363,
413,
29892,
325,
297,
921,
29889,
7076,
580,
565,
413,
2804,
376,
15697,
29908,
1800,
13,
4706,
1723,
13,
4706,
4489,
3366,
3488,
3108,
353,
1813,
13,
4706,
565,
451,
4489,
3366,
3757,
4339,
16862,
2798,
7295,
13,
9651,
736,
716,
29918,
2176,
13,
4706,
4489,
3366,
3488,
3108,
353,
1813,
13,
4706,
5412,
29918,
3757,
4339,
353,
4489,
29889,
15091,
29889,
13092,
580,
13,
4706,
1018,
29901,
13,
9651,
2309,
353,
5412,
29918,
3757,
4339,
29961,
29900,
29962,
13,
4706,
5174,
11374,
2392,
29901,
13,
9651,
2309,
353,
5852,
13,
4706,
565,
716,
29918,
2176,
29889,
13099,
29889,
2311,
529,
29871,
29896,
29901,
13,
9651,
716,
29918,
2176,
29889,
13099,
353,
518,
29883,
29889,
6506,
17350,
613,
11119,
1159,
363,
274,
297,
4341,
29962,
13,
4706,
1683,
29901,
13,
9651,
716,
29918,
2176,
29889,
13099,
353,
716,
29918,
2176,
29889,
13099,
29889,
710,
29889,
13609,
580,
13,
9651,
8772,
29918,
24051,
29901,
360,
919,
29961,
710,
29892,
3789,
29961,
710,
5262,
353,
16250,
29889,
4381,
8977,
29898,
842,
29897,
13,
9651,
5988,
29918,
13099,
353,
518,
1054,
363,
784,
297,
4341,
565,
376,
1213,
297,
784,
29962,
13,
9651,
363,
784,
297,
5988,
29918,
13099,
29901,
13,
18884,
1591,
29892,
17117,
784,
29918,
978,
353,
784,
29889,
16707,
17350,
1159,
13,
18884,
8772,
29918,
24051,
29961,
2371,
1822,
1202,
29898,
1054,
29918,
978,
29897,
13,
9651,
363,
1591,
297,
8772,
29918,
24051,
29901,
13,
18884,
1591,
29918,
2176,
353,
716,
29918,
2176,
29961,
2371,
1822,
7302,
29898,
15926,
29889,
19204,
29897,
13,
18884,
1591,
29918,
2176,
353,
1591,
29918,
2176,
29889,
8865,
703,
15697,
613,
9685,
29922,
29896,
467,
1202,
29918,
13506,
29898,
29888,
29908,
29912,
2371,
2403,
1159,
13,
18884,
1591,
29918,
2176,
29889,
13099,
353,
1591,
29918,
2176,
29889,
13099,
29889,
710,
29889,
13609,
580,
13,
18884,
716,
29918,
2176,
353,
10518,
29889,
17685,
4197,
1482,
29918,
2176,
29889,
8865,
4197,
2371,
1402,
9685,
29922,
29896,
511,
1591,
29918,
2176,
1402,
9685,
29922,
29896,
29897,
13,
4706,
4341,
353,
518,
29883,
29889,
6506,
17350,
613,
11119,
2564,
13609,
580,
363,
274,
297,
4341,
29962,
13,
4706,
716,
29918,
2176,
353,
716,
29918,
2176,
29961,
13099,
29962,
13,
4706,
7709,
716,
29918,
2176,
13,
4706,
2446,
29918,
2271,
353,
6213,
13,
4706,
565,
451,
2309,
29901,
13,
9651,
1813,
4619,
29871,
29896,
13,
9651,
2446,
29918,
2271,
353,
4489,
29889,
4622,
4789,
4339,
5983,
29889,
13092,
580,
29961,
29900,
29962,
13,
9651,
363,
2446,
29918,
2176,
297,
1583,
3032,
1885,
29918,
2914,
29918,
19935,
29898,
13,
18884,
4576,
29892,
13,
18884,
4341,
29922,
13099,
29892,
13,
18884,
3142,
29922,
4622,
29918,
2271,
29892,
13,
18884,
2531,
29918,
25118,
29922,
1885,
29918,
25118,
29892,
13,
18884,
3160,
29918,
13662,
29922,
8824,
29892,
13,
632,
1125,
13,
18884,
7709,
2446,
29918,
2176,
13,
13,
1678,
822,
16766,
29918,
22793,
29898,
13,
4706,
1583,
29892,
4576,
29901,
851,
29892,
934,
2084,
29901,
851,
29892,
1591,
29901,
851,
29892,
4128,
29901,
2391,
29961,
710,
1402,
3579,
19290,
13,
268,
1125,
13,
4706,
9995,
29928,
3427,
278,
2582,
310,
278,
19056,
4576,
304,
278,
3646,
21120,
2566,
13,
13,
4706,
584,
3207,
851,
4576,
29901,
24953,
1891,
577,
1519,
304,
671,
363,
2346,
292,
13,
4706,
584,
3207,
851,
934,
2084,
29901,
3497,
2084,
304,
5609,
2582,
304,
13,
4706,
584,
3207,
851,
1591,
29901,
450,
3646,
1591,
13,
4706,
584,
3207,
2391,
29961,
710,
29962,
4128,
29901,
12662,
2699,
304,
671,
408,
6273,
304,
278,
577,
1519,
13,
4706,
584,
2457,
29901,
319,
2302,
310,
278,
4206,
3971,
13,
4706,
584,
29878,
1853,
29901,
938,
13,
4706,
9995,
13,
4706,
565,
451,
1583,
29889,
7924,
29901,
13,
9651,
1583,
29889,
7507,
580,
13,
4706,
565,
4128,
338,
6213,
29901,
13,
9651,
4128,
353,
5159,
13,
4706,
565,
7431,
29898,
16744,
29897,
1405,
29871,
29900,
29901,
13,
9651,
4576,
353,
4576,
1273,
18761,
29898,
16744,
29897,
13,
4706,
9049,
5085,
29889,
5504,
3319,
29908,
2856,
29918,
311,
22742,
1115,
5852,
1800,
13,
4706,
4341,
353,
518,
1054,
363,
784,
297,
1583,
3032,
21111,
29918,
13099,
29898,
2850,
4638,
13,
4706,
934,
2084,
353,
2224,
1982,
29889,
2605,
29898,
1445,
2084,
467,
23552,
2141,
294,
29918,
1066,
861,
580,
13,
4706,
21120,
29918,
13082,
353,
21120,
29941,
29889,
6915,
29898,
1445,
2084,
29897,
13,
4706,
4206,
353,
29871,
29900,
13,
4706,
3160,
29918,
13662,
353,
5852,
13,
4706,
363,
4489,
297,
1583,
3032,
1885,
29918,
2914,
29918,
19935,
29898,
13,
9651,
4576,
29892,
4341,
29922,
13099,
29892,
3160,
29918,
13662,
29922,
2856,
29918,
13662,
29892,
3579,
19290,
13,
308,
1125,
13,
9651,
4206,
4619,
7431,
29898,
2176,
29897,
13,
9651,
4489,
29889,
517,
29918,
2850,
29898,
13,
18884,
1591,
29892,
378,
29922,
22793,
29918,
13082,
29892,
565,
29918,
9933,
543,
4397,
613,
521,
18801,
675,
29922,
29906,
29900,
29900,
29892,
2380,
29922,
8824,
13,
9651,
1723,
13,
4706,
736,
4206,
13,
13,
1678,
822,
16766,
29918,
7638,
29898,
13,
4706,
1583,
29892,
13,
4706,
4576,
29901,
851,
29892,
13,
4706,
934,
2084,
29901,
851,
29892,
13,
4706,
4128,
29901,
2391,
29961,
710,
1402,
13,
4706,
3160,
29918,
13662,
29901,
6120,
353,
5852,
29892,
13,
4706,
3579,
19290,
29892,
13,
1678,
1723,
1599,
938,
29901,
13,
4706,
9995,
29928,
3427,
278,
2582,
310,
278,
13877,
4576,
304,
16874,
13,
13,
4706,
584,
3207,
851,
4576,
29901,
24953,
1891,
577,
1519,
304,
671,
363,
2346,
292,
13,
4706,
584,
3207,
851,
934,
2084,
29901,
3497,
2084,
304,
5609,
2582,
304,
13,
4706,
584,
3207,
2391,
29961,
710,
29962,
4128,
29901,
12662,
2699,
304,
671,
408,
6273,
304,
278,
577,
1519,
13,
4706,
584,
3207,
6120,
3160,
29918,
13662,
29901,
26460,
304,
3160,
9066,
297,
278,
1962,
29892,
21274,
304,
5852,
13,
4706,
584,
2457,
29901,
319,
2302,
310,
278,
4206,
3971,
13,
4706,
584,
29878,
1853,
29901,
938,
13,
4706,
9995,
13,
4706,
565,
451,
1583,
29889,
7924,
29901,
13,
9651,
1583,
29889,
7507,
580,
13,
4706,
565,
4128,
338,
6213,
29901,
13,
9651,
4128,
353,
5159,
13,
4706,
565,
7431,
29898,
16744,
29897,
1405,
29871,
29900,
29901,
13,
9651,
4576,
353,
4576,
1273,
18761,
29898,
16744,
29897,
13,
4706,
9049,
5085,
29889,
5504,
3319,
29908,
2856,
29918,
311,
22742,
1115,
5852,
1800,
13,
4706,
4341,
353,
518,
1054,
363,
784,
297,
1583,
3032,
21111,
29918,
13099,
29898,
2850,
4638,
13,
4706,
5694,
29918,
3972,
353,
5694,
1445,
29889,
5776,
1971,
653,
9882,
29898,
13506,
543,
29879,
2122,
10118,
613,
25557,
543,
2395,
4270,
1159,
13,
4706,
565,
451,
934,
2084,
29901,
13,
9651,
13128,
1445,
353,
5694,
1445,
29889,
22175,
5776,
1971,
653,
2283,
29898,
13,
18884,
10944,
543,
1466,
1731,
613,
13,
18884,
25557,
543,
29879,
2122,
10118,
29889,
7638,
613,
13,
18884,
5217,
29922,
8824,
29892,
13,
18884,
4516,
29922,
7382,
29918,
3972,
29889,
978,
29892,
13,
18884,
8025,
543,
9420,
29899,
29947,
613,
13,
9651,
1723,
13,
9651,
934,
2084,
353,
13128,
1445,
29889,
978,
13,
9651,
13128,
1445,
29889,
5358,
580,
13,
4706,
4206,
353,
29871,
29900,
13,
4706,
363,
4489,
297,
1583,
3032,
1885,
29918,
2914,
29918,
19935,
29898,
13,
9651,
4576,
29892,
13,
9651,
4341,
29922,
13099,
29892,
13,
9651,
5694,
29918,
3972,
29922,
7382,
29918,
3972,
29892,
13,
9651,
5694,
29918,
1445,
29922,
1445,
2084,
29892,
13,
9651,
3160,
29918,
13662,
29922,
2856,
29918,
13662,
29892,
13,
9651,
3579,
19290,
29892,
13,
308,
1125,
13,
9651,
4206,
4619,
7431,
29898,
2176,
29897,
13,
9651,
4489,
29889,
517,
29918,
7638,
29898,
13,
18884,
934,
2084,
29892,
13,
18884,
521,
18801,
675,
29922,
29906,
29900,
29900,
29892,
13,
18884,
4839,
29922,
2856,
29918,
13662,
29892,
13,
18884,
8025,
543,
9420,
29899,
29947,
613,
13,
18884,
2380,
29922,
8824,
29892,
13,
18884,
4464,
543,
29874,
613,
13,
9651,
1723,
13,
9651,
565,
3160,
29918,
13662,
29901,
13,
18884,
3160,
29918,
13662,
353,
7700,
13,
4706,
736,
4206,
13,
13,
1678,
822,
903,
1885,
29918,
9902,
29898,
13,
4706,
1583,
29892,
4576,
29901,
851,
29892,
3142,
29901,
851,
353,
6213,
29892,
2531,
29918,
25118,
29901,
851,
353,
6213,
29892,
3579,
19290,
13,
1678,
1723,
1599,
3251,
1061,
29961,
1293,
29961,
10773,
1402,
6213,
29892,
6213,
5387,
13,
4706,
9995,
13,
4706,
3251,
1078,
2582,
515,
14012,
263,
4576,
3229,
29889,
13,
13,
4706,
584,
3207,
851,
4576,
29901,
450,
4576,
3229,
304,
6222,
13,
4706,
584,
3207,
28379,
29961,
710,
29962,
3142,
29901,
450,
3142,
310,
278,
2446,
1813,
310,
2582,
313,
4381,
29901,
6213,
29897,
13,
4706,
584,
3207,
28379,
29961,
710,
29962,
2531,
29918,
25118,
29901,
450,
4867,
29899,
14940,
501,
11150,
313,
4381,
29901,
6213,
29897,
13,
4706,
584,
2457,
29901,
319,
15299,
607,
9819,
4206,
515,
14012,
278,
2183,
4576,
13,
4706,
584,
29878,
1853,
29901,
3251,
1061,
13,
4706,
9995,
13,
4706,
396,
1653,
12623,
318,
5416,
304,
1510,
825,
10748,
526,
760,
310,
278,
1021,
1889,
13,
4706,
565,
451,
2531,
29918,
25118,
29901,
13,
9651,
2531,
29918,
25118,
353,
851,
29898,
25118,
29889,
25118,
29946,
3101,
13,
4706,
2582,
353,
1583,
3032,
657,
29918,
9902,
29898,
2850,
29892,
3142,
29922,
2271,
29892,
2531,
29918,
25118,
29922,
1885,
29918,
25118,
29897,
13,
4706,
565,
451,
2582,
29901,
13,
9651,
7709,
5159,
13,
13,
4706,
2446,
29918,
2271,
353,
6213,
13,
4706,
363,
1948,
297,
2582,
29889,
657,
703,
3757,
4339,
613,
5159,
1125,
13,
9651,
7709,
1583,
3032,
21111,
29918,
798,
29898,
798,
29897,
13,
4706,
565,
451,
2582,
3366,
15091,
3108,
29901,
13,
9651,
2446,
29918,
2271,
353,
2582,
29889,
657,
703,
4622,
4789,
4339,
5983,
613,
6213,
29897,
13,
9651,
363,
1948,
297,
1583,
3032,
1885,
29918,
9902,
29898,
2850,
29892,
3142,
29922,
4622,
29918,
2271,
29892,
2531,
29918,
25118,
29922,
1885,
29918,
25118,
1125,
13,
18884,
7709,
1948,
13,
13,
1678,
822,
2346,
29898,
13,
4706,
1583,
29892,
13,
4706,
4576,
29901,
851,
29892,
13,
4706,
4128,
29901,
2391,
29961,
710,
29962,
353,
6213,
29892,
13,
4706,
3160,
29918,
13662,
29901,
6120,
353,
5852,
29892,
13,
4706,
3579,
19290,
29892,
13,
1678,
1723,
1599,
3251,
1061,
29961,
1293,
29961,
10773,
1402,
6213,
29892,
6213,
5387,
13,
4706,
9995,
13,
4706,
3251,
1078,
278,
2582,
515,
14012,
263,
2183,
4576,
3229,
13,
13,
4706,
584,
3207,
4576,
29901,
450,
2183,
4576,
3229,
304,
6222,
13,
4706,
584,
1853,
4576,
29901,
851,
13,
4706,
584,
3207,
4128,
29901,
450,
4128,
304,
671,
363,
278,
4576,
29892,
21274,
304,
6213,
13,
4706,
584,
1853,
4128,
29901,
2391,
29961,
710,
1402,
13136,
13,
4706,
584,
3207,
3160,
29918,
13662,
29901,
5852,
304,
3160,
4341,
408,
278,
937,
1121,
29892,
13,
9651,
21274,
304,
5852,
13,
4706,
584,
1853,
3160,
29918,
13662,
29901,
6120,
29892,
13136,
13,
4706,
584,
2457,
29901,
319,
15299,
607,
4256,
1078,
975,
2582,
515,
14012,
278,
1517,
484,
4576,
13,
4706,
584,
29878,
1853,
29901,
3251,
1061,
13,
4706,
9995,
13,
13,
4706,
565,
4128,
338,
6213,
29901,
13,
9651,
4128,
353,
5159,
13,
4706,
565,
7431,
29898,
16744,
29897,
1405,
29871,
29900,
29901,
13,
9651,
4576,
353,
4576,
1273,
18761,
29898,
16744,
29897,
13,
13,
4706,
9049,
5085,
29889,
5504,
3319,
29908,
2856,
29918,
311,
22742,
1115,
5852,
1800,
13,
4706,
1583,
29889,
1188,
29889,
3888,
29898,
29888,
29908,
4258,
17068,
2346,
426,
2850,
29991,
29878,
27195,
13,
13,
4706,
565,
3160,
29918,
13662,
29901,
13,
9651,
7709,
1583,
3032,
21111,
29918,
13099,
29898,
2850,
29892,
5191,
3790,
1642,
1115,
11119,
29908,
1800,
13,
13,
4706,
1583,
29889,
7507,
580,
13,
13,
4706,
363,
1948,
297,
1583,
3032,
1885,
29918,
9902,
29898,
2850,
29892,
3579,
19290,
1125,
13,
9651,
7709,
1948,
13,
13,
1678,
822,
5609,
29898,
13,
4706,
1583,
29892,
13,
4706,
4576,
29901,
851,
29892,
13,
4706,
934,
2084,
29901,
851,
29892,
13,
4706,
4128,
29901,
2391,
29961,
710,
29962,
353,
6213,
29892,
13,
4706,
3160,
29918,
13662,
29901,
6120,
353,
5852,
29892,
13,
4706,
3579,
19290,
29892,
13,
1678,
1723,
1599,
851,
29901,
13,
4706,
9995,
13,
4706,
1222,
4011,
278,
1121,
310,
14012,
4576,
304,
263,
2183,
934,
2084,
29889,
13,
13,
4706,
584,
3207,
4576,
29901,
450,
4576,
3229,
304,
6222,
13,
4706,
584,
1853,
4576,
29901,
851,
13,
4706,
584,
3207,
934,
2084,
29901,
450,
934,
2084,
304,
5609,
2582,
304,
13,
4706,
584,
1853,
934,
2084,
29901,
851,
13,
4706,
584,
3207,
4128,
29901,
450,
4128,
304,
671,
363,
278,
4576,
29892,
21274,
304,
6213,
13,
4706,
584,
1853,
4128,
29901,
2391,
29961,
710,
1402,
13136,
13,
4706,
584,
3207,
3160,
29918,
13662,
29901,
5852,
304,
3160,
4341,
408,
278,
937,
1121,
29892,
13,
9651,
21274,
304,
5852,
13,
4706,
584,
1853,
3160,
29918,
13662,
29901,
6120,
29892,
13136,
13,
4706,
584,
2457,
29901,
450,
9819,
5609,
287,
934,
2084,
13,
4706,
584,
29878,
1853,
29901,
851,
13,
4706,
9995,
13,
13,
4706,
1583,
29889,
1188,
29889,
3888,
29898,
29888,
29908,
16554,
2582,
310,
4576,
426,
2850,
29991,
29878,
29913,
304,
426,
1445,
2084,
29991,
29878,
27195,
13,
4706,
565,
451,
4128,
29901,
13,
9651,
4128,
353,
5159,
13,
4706,
1948,
2798,
353,
1583,
29889,
15070,
29918,
7638,
29898,
13,
9651,
4576,
29922,
2850,
29892,
934,
2084,
29922,
1445,
2084,
29892,
4128,
29922,
16744,
29892,
3160,
29918,
13662,
29922,
5574,
13,
4706,
1723,
13,
4706,
1583,
29889,
1188,
29889,
3888,
29898,
29888,
29908,
17435,
323,
3289,
29968,
4810,
3580,
18476,
18610,
29901,
399,
4859,
426,
798,
2798,
29991,
29879,
29913,
4206,
29991,
1159,
13,
4706,
736,
934,
2084,
13,
2
] |
daiquiri_client/auth.py
|
aipescience/django-daiquiri-client
| 0 |
10930
|
class Auth():
def __init__(self, client):
self.client = client
def get_profiles(self):
return self.client.get('/auth/api/profiles/', {'page_size': 10000})['results']
def get_groups(self):
return self.client.get('/auth/api/groups/')
def get_group_map(self):
return {group['id']: group['name'] for group in self.get_groups()}
def activate_profile(self, pk):
return self.client.put('/auth/api/profiles/%d/activate/' % pk, {})
def update_profile_attributes(self, pk, attributes):
return self.client.patch('/auth/api/profiles/%d/' % pk, {'attributes': attributes})
|
[
1,
770,
13189,
7295,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3132,
1125,
13,
4706,
1583,
29889,
4645,
353,
3132,
13,
13,
1678,
822,
679,
29918,
771,
5325,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
4645,
29889,
657,
11219,
5150,
29914,
2754,
29914,
771,
5325,
29914,
742,
11117,
3488,
29918,
2311,
2396,
29871,
29896,
29900,
29900,
29900,
29900,
1800,
1839,
9902,
2033,
13,
13,
1678,
822,
679,
29918,
13155,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
4645,
29889,
657,
11219,
5150,
29914,
2754,
29914,
13155,
29914,
1495,
13,
13,
1678,
822,
679,
29918,
2972,
29918,
1958,
29898,
1311,
1125,
13,
4706,
736,
426,
2972,
1839,
333,
2033,
29901,
2318,
1839,
978,
2033,
363,
2318,
297,
1583,
29889,
657,
29918,
13155,
28296,
13,
13,
1678,
822,
5039,
403,
29918,
10185,
29898,
1311,
29892,
282,
29895,
1125,
13,
4706,
736,
1583,
29889,
4645,
29889,
649,
11219,
5150,
29914,
2754,
29914,
771,
5325,
22584,
29881,
29914,
11236,
403,
22208,
1273,
282,
29895,
29892,
426,
1800,
13,
13,
1678,
822,
2767,
29918,
10185,
29918,
15697,
29898,
1311,
29892,
282,
29895,
29892,
8393,
1125,
13,
4706,
736,
1583,
29889,
4645,
29889,
5041,
11219,
5150,
29914,
2754,
29914,
771,
5325,
22584,
29881,
22208,
1273,
282,
29895,
29892,
11117,
15697,
2396,
8393,
1800,
13,
2
] |
tinychronicler/main.py
|
adzialocha/tinychronicler
| 4 |
195034
|
<reponame>adzialocha/tinychronicler<filename>tinychronicler/main.py
import logging
import sys
import click
from loguru import logger
from uvicorn import Config, Server
from .constants import LOG_LEVELS
from .database import engine, models
class InterceptHandler(logging.Handler):
def emit(self, record):
# Get corresponding Loguru level if it exists
try:
level = logger.level(record.levelname).name
except ValueError:
level = record.levelno
# Find caller from where originated the logged message
frame, depth = logging.currentframe(), 2
while frame.f_code.co_filename == logging.__file__:
frame = frame.f_back
depth += 1
# Finally log the message
logger.opt(depth=depth, exception=record.exc_info).log(
level, record.getMessage()
)
def setup_logging(log_level: str):
# Intercept everything at the root logger
logging.root.handlers = [InterceptHandler()]
logging.root.setLevel(log_level.upper())
# Remove every other logger's handlers and propagate to root logger
for name in logging.root.manager.loggerDict.keys():
logging.getLogger(name).handlers = []
logging.getLogger(name).propagate = True
# Configure loguru
logger.configure(handlers=[{"sink": sys.stdout, "serialize": False}])
def setup_server(host: str, port: int, log_level: str):
config = Config(
"tinychronicler:server",
host=host,
port=port,
log_level=log_level,
)
server = Server(config=config)
return server
@click.command()
@click.option(
"--host",
type=str,
default="0.0.0.0",
help="Bind socket to this host.",
show_default=True,
)
@click.option(
"--port",
type=int,
default=8000,
help="Bind socket to this port.",
show_default=True,
)
@click.option(
"--log-level",
type=click.Choice(list(LOG_LEVELS.keys())),
default="info",
help="Log level.",
show_default=True,
)
def main(host: str, port: int, log_level: str):
# Run all migrations
models.Base.metadata.create_all(bind=engine)
# Start HTTP server hosting web interface for users
server = setup_server(host, port, log_level)
# Set up logging after server setup to make sure it overrides everything
setup_logging(log_level)
# Start server and block thread from here on
server.run()
|
[
1,
529,
276,
1112,
420,
29958,
328,
10527,
2878,
29874,
29914,
29873,
262,
3376,
1617,
293,
1358,
29966,
9507,
29958,
29873,
262,
3376,
1617,
293,
1358,
29914,
3396,
29889,
2272,
13,
5215,
12183,
13,
5215,
10876,
13,
13,
5215,
2828,
13,
3166,
1480,
20144,
1053,
17927,
13,
3166,
318,
26311,
1398,
1053,
12782,
29892,
5656,
13,
13,
3166,
869,
3075,
1934,
1053,
25401,
29918,
1307,
29963,
6670,
29903,
13,
3166,
869,
9803,
1053,
6012,
29892,
4733,
13,
13,
13,
1990,
4124,
1547,
4598,
29898,
21027,
29889,
4598,
1125,
13,
1678,
822,
20076,
29898,
1311,
29892,
2407,
1125,
13,
4706,
396,
3617,
6590,
4522,
20144,
3233,
565,
372,
4864,
13,
4706,
1018,
29901,
13,
9651,
3233,
353,
17927,
29889,
5563,
29898,
11651,
29889,
5563,
978,
467,
978,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
3233,
353,
2407,
29889,
5563,
1217,
13,
13,
4706,
396,
10987,
24959,
515,
988,
3978,
630,
278,
13817,
2643,
13,
4706,
3515,
29892,
10809,
353,
12183,
29889,
3784,
2557,
3285,
29871,
29906,
13,
4706,
1550,
3515,
29889,
29888,
29918,
401,
29889,
1111,
29918,
9507,
1275,
12183,
17255,
1445,
1649,
29901,
13,
9651,
3515,
353,
3515,
29889,
29888,
29918,
1627,
13,
9651,
10809,
4619,
29871,
29896,
13,
13,
4706,
396,
9788,
1480,
278,
2643,
13,
4706,
17927,
29889,
3670,
29898,
19488,
29922,
19488,
29892,
3682,
29922,
11651,
29889,
735,
29883,
29918,
3888,
467,
1188,
29898,
13,
9651,
3233,
29892,
2407,
29889,
28983,
580,
13,
4706,
1723,
13,
13,
13,
1753,
6230,
29918,
21027,
29898,
1188,
29918,
5563,
29901,
851,
1125,
13,
1678,
396,
4124,
1547,
4129,
472,
278,
3876,
17927,
13,
1678,
12183,
29889,
4632,
29889,
3179,
9306,
353,
518,
4074,
1547,
4598,
580,
29962,
13,
1678,
12183,
29889,
4632,
29889,
842,
10108,
29898,
1188,
29918,
5563,
29889,
21064,
3101,
13,
13,
1678,
396,
15154,
1432,
916,
17927,
29915,
29879,
25795,
322,
13089,
403,
304,
3876,
17927,
13,
1678,
363,
1024,
297,
12183,
29889,
4632,
29889,
12847,
29889,
21707,
21533,
29889,
8149,
7295,
13,
4706,
12183,
29889,
657,
16363,
29898,
978,
467,
3179,
9306,
353,
5159,
13,
4706,
12183,
29889,
657,
16363,
29898,
978,
467,
7728,
351,
403,
353,
5852,
13,
13,
1678,
396,
1281,
4532,
1480,
20144,
13,
1678,
17927,
29889,
17591,
29898,
3179,
9306,
11759,
6377,
29879,
682,
1115,
10876,
29889,
25393,
29892,
376,
643,
6646,
1115,
7700,
29913,
2314,
13,
13,
13,
1753,
6230,
29918,
2974,
29898,
3069,
29901,
851,
29892,
2011,
29901,
938,
29892,
1480,
29918,
5563,
29901,
851,
1125,
13,
1678,
2295,
353,
12782,
29898,
13,
4706,
376,
29873,
262,
3376,
1617,
293,
1358,
29901,
2974,
613,
13,
4706,
3495,
29922,
3069,
29892,
13,
4706,
2011,
29922,
637,
29892,
13,
4706,
1480,
29918,
5563,
29922,
1188,
29918,
5563,
29892,
13,
1678,
1723,
13,
1678,
1923,
353,
5656,
29898,
2917,
29922,
2917,
29897,
13,
1678,
736,
1923,
13,
13,
13,
29992,
3808,
29889,
6519,
580,
13,
29992,
3808,
29889,
3385,
29898,
13,
1678,
376,
489,
3069,
613,
13,
1678,
1134,
29922,
710,
29892,
13,
1678,
2322,
543,
29900,
29889,
29900,
29889,
29900,
29889,
29900,
613,
13,
1678,
1371,
543,
15708,
9909,
304,
445,
3495,
19602,
13,
1678,
1510,
29918,
4381,
29922,
5574,
29892,
13,
29897,
13,
29992,
3808,
29889,
3385,
29898,
13,
1678,
376,
489,
637,
613,
13,
1678,
1134,
29922,
524,
29892,
13,
1678,
2322,
29922,
29947,
29900,
29900,
29900,
29892,
13,
1678,
1371,
543,
15708,
9909,
304,
445,
2011,
19602,
13,
1678,
1510,
29918,
4381,
29922,
5574,
29892,
13,
29897,
13,
29992,
3808,
29889,
3385,
29898,
13,
1678,
376,
489,
1188,
29899,
5563,
613,
13,
1678,
1134,
29922,
3808,
29889,
29620,
29898,
1761,
29898,
14480,
29918,
1307,
29963,
6670,
29903,
29889,
8149,
3101,
511,
13,
1678,
2322,
543,
3888,
613,
13,
1678,
1371,
543,
3403,
3233,
19602,
13,
1678,
1510,
29918,
4381,
29922,
5574,
29892,
13,
29897,
13,
1753,
1667,
29898,
3069,
29901,
851,
29892,
2011,
29901,
938,
29892,
1480,
29918,
5563,
29901,
851,
1125,
13,
1678,
396,
7525,
599,
9725,
800,
13,
1678,
4733,
29889,
5160,
29889,
19635,
29889,
3258,
29918,
497,
29898,
5355,
29922,
10599,
29897,
13,
13,
1678,
396,
7370,
7331,
1923,
23376,
1856,
5067,
363,
4160,
13,
1678,
1923,
353,
6230,
29918,
2974,
29898,
3069,
29892,
2011,
29892,
1480,
29918,
5563,
29897,
13,
13,
1678,
396,
3789,
701,
12183,
1156,
1923,
6230,
304,
1207,
1854,
372,
975,
24040,
4129,
13,
1678,
6230,
29918,
21027,
29898,
1188,
29918,
5563,
29897,
13,
13,
1678,
396,
7370,
1923,
322,
2908,
3244,
515,
1244,
373,
13,
1678,
1923,
29889,
3389,
580,
13,
2
] |
tests/initialisations/test_onoda2012pca.py
|
simonharris/pykmeans
| 1 |
145947
|
<filename>tests/initialisations/test_onoda2012pca.py
"""
Tests for Onoda 2012 PCA initialisation algorithm
"""
import unittest
from datasets import testloader
from initialisations import onoda_pca as onoda
class OnodaPCATestSuite(unittest.TestCase):
"""Test suite for Onoda/PCA"""
def test_code_runs(self):
"""This needs more, but at least prove it runs"""
dataset = testloader.load_iris()
centroids = onoda.generate(dataset.data, 3)
self.assertEqual((3, 4), centroids.shape)
|
[
1,
529,
9507,
29958,
21150,
29914,
11228,
275,
800,
29914,
1688,
29918,
265,
8887,
29906,
29900,
29896,
29906,
29886,
1113,
29889,
2272,
13,
15945,
29908,
13,
24376,
363,
1551,
8887,
29871,
29906,
29900,
29896,
29906,
349,
5454,
2847,
4371,
5687,
13,
15945,
29908,
13,
13,
5215,
443,
27958,
13,
13,
3166,
20035,
1053,
1243,
12657,
13,
3166,
2847,
275,
800,
1053,
373,
8887,
29918,
29886,
1113,
408,
373,
8887,
13,
13,
13,
1990,
1551,
8887,
9026,
1299,
342,
5091,
568,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
9995,
3057,
9460,
363,
1551,
8887,
29914,
29925,
5454,
15945,
29908,
13,
13,
1678,
822,
1243,
29918,
401,
29918,
3389,
29879,
29898,
1311,
1125,
13,
4706,
9995,
4013,
4225,
901,
29892,
541,
472,
3203,
6356,
372,
6057,
15945,
29908,
13,
13,
4706,
8783,
353,
1243,
12657,
29889,
1359,
29918,
381,
275,
580,
13,
4706,
1644,
1007,
29879,
353,
373,
8887,
29889,
17158,
29898,
24713,
29889,
1272,
29892,
29871,
29941,
29897,
13,
4706,
1583,
29889,
9294,
9843,
3552,
29941,
29892,
29871,
29946,
511,
1644,
1007,
29879,
29889,
12181,
29897,
13,
2
] |
package/doctor.py
|
bodo97/ProyectoFinalPC
| 89 |
119657
|
<filename>package/doctor.py
#<NAME>
#Python 2.7
from flask_restful import Resource, Api, request
from package.model import conn
class Doctors(Resource):
"""This contain apis to carry out activity with all doctors"""
def get(self):
"""Retrive list of all the doctor"""
doctors = conn.execute("SELECT * FROM doctor ORDER BY doc_date DESC").fetchall()
return doctors
def post(self):
"""Add the new doctor"""
doctorInput = request.get_json(force=True)
doc_first_name=doctorInput['doc_first_name']
doc_last_name = doctorInput['doc_last_name']
doc_ph_no = doctorInput['doc_ph_no']
doc_address = doctorInput['doc_address']
doctorInput['doc_id']=conn.execute('''INSERT INTO doctor(doc_first_name,doc_last_name,doc_ph_no,doc_address)
VALUES(?,?,?,?)''', (doc_first_name, doc_last_name,doc_ph_no,doc_address)).lastrowid
conn.commit()
return doctorInput
class Doctor(Resource):
"""It include all the apis carrying out the activity with the single doctor"""
def get(self,id):
"""get the details of the docktor by the doctor id"""
doctor = conn.execute("SELECT * FROM doctor WHERE doc_id=?",(id,)).fetchall()
return doctor
def delete(self, id):
"""Delete the doctor by its id"""
conn.execute("DELETE FROM doctor WHERE doc_id=?", (id,))
conn.commit()
return {'msg': 'sucessfully deleted'}
def put(self,id):
"""Update the doctor by its id"""
doctorInput = request.get_json(force=True)
doc_first_name=doctorInput['doc_first_name']
doc_last_name = doctorInput['doc_last_name']
doc_ph_no = doctorInput['doc_ph_no']
doc_address = doctorInput['doc_address']
conn.execute(
"UPDATE doctor SET doc_first_name=?,doc_last_name=?,doc_ph_no=?,doc_address=? WHERE doc_id=?",
(doc_first_name, doc_last_name, doc_ph_no, doc_address, id))
conn.commit()
return doctorInput
|
[
1,
529,
9507,
29958,
5113,
29914,
1867,
2801,
29889,
2272,
13,
29937,
29966,
5813,
29958,
13,
29937,
11980,
29871,
29906,
29889,
29955,
13,
13,
3166,
29784,
29918,
5060,
1319,
1053,
18981,
29892,
29749,
29892,
2009,
13,
3166,
3577,
29889,
4299,
1053,
11009,
13,
1990,
1938,
14359,
29898,
6848,
1125,
13,
1678,
9995,
4013,
1712,
3095,
275,
304,
8677,
714,
6354,
411,
599,
437,
14359,
15945,
29908,
13,
13,
1678,
822,
679,
29898,
1311,
1125,
13,
4706,
9995,
8015,
4401,
1051,
310,
599,
278,
11619,
15945,
29908,
13,
13,
4706,
437,
14359,
353,
11009,
29889,
7978,
703,
6404,
334,
3895,
11619,
15606,
6770,
1574,
29918,
1256,
23050,
2564,
9155,
497,
580,
13,
4706,
736,
437,
14359,
13,
13,
13,
13,
1678,
822,
1400,
29898,
1311,
1125,
13,
4706,
9995,
2528,
278,
716,
11619,
15945,
29908,
13,
13,
4706,
11619,
4290,
353,
2009,
29889,
657,
29918,
3126,
29898,
10118,
29922,
5574,
29897,
13,
4706,
1574,
29918,
4102,
29918,
978,
29922,
1867,
2801,
4290,
1839,
1514,
29918,
4102,
29918,
978,
2033,
13,
4706,
1574,
29918,
4230,
29918,
978,
353,
11619,
4290,
1839,
1514,
29918,
4230,
29918,
978,
2033,
13,
4706,
1574,
29918,
561,
29918,
1217,
353,
11619,
4290,
1839,
1514,
29918,
561,
29918,
1217,
2033,
13,
4706,
1574,
29918,
7328,
353,
11619,
4290,
1839,
1514,
29918,
7328,
2033,
13,
4706,
11619,
4290,
1839,
1514,
29918,
333,
2033,
29922,
13082,
29889,
7978,
877,
4907,
19460,
11646,
11619,
29898,
1514,
29918,
4102,
29918,
978,
29892,
1514,
29918,
4230,
29918,
978,
29892,
1514,
29918,
561,
29918,
1217,
29892,
1514,
29918,
7328,
29897,
13,
9651,
15673,
10780,
29892,
14579,
14579,
7897,
4907,
742,
313,
1514,
29918,
4102,
29918,
978,
29892,
1574,
29918,
4230,
29918,
978,
29892,
1514,
29918,
561,
29918,
1217,
29892,
1514,
29918,
7328,
8106,
4230,
798,
333,
13,
4706,
11009,
29889,
15060,
580,
13,
4706,
736,
11619,
4290,
13,
13,
1990,
15460,
29898,
6848,
1125,
13,
1678,
9995,
3112,
3160,
599,
278,
3095,
275,
19436,
714,
278,
6354,
411,
278,
2323,
11619,
15945,
29908,
13,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
333,
1125,
13,
4706,
9995,
657,
278,
4902,
310,
278,
23630,
7345,
491,
278,
11619,
1178,
15945,
29908,
13,
13,
4706,
11619,
353,
11009,
29889,
7978,
703,
6404,
334,
3895,
11619,
5754,
1574,
29918,
333,
29922,
29973,
613,
29898,
333,
29892,
8106,
9155,
497,
580,
13,
4706,
736,
11619,
13,
13,
1678,
822,
5217,
29898,
1311,
29892,
1178,
1125,
13,
4706,
9995,
12498,
278,
11619,
491,
967,
1178,
15945,
29908,
13,
13,
4706,
11009,
29889,
7978,
703,
2287,
18476,
3895,
11619,
5754,
1574,
29918,
333,
29922,
29973,
613,
313,
333,
29892,
876,
13,
4706,
11009,
29889,
15060,
580,
13,
4706,
736,
11117,
7645,
2396,
525,
2146,
985,
3730,
11132,
10827,
13,
13,
1678,
822,
1925,
29898,
1311,
29892,
333,
1125,
13,
4706,
9995,
6422,
278,
11619,
491,
967,
1178,
15945,
29908,
13,
13,
4706,
11619,
4290,
353,
2009,
29889,
657,
29918,
3126,
29898,
10118,
29922,
5574,
29897,
13,
4706,
1574,
29918,
4102,
29918,
978,
29922,
1867,
2801,
4290,
1839,
1514,
29918,
4102,
29918,
978,
2033,
13,
4706,
1574,
29918,
4230,
29918,
978,
353,
11619,
4290,
1839,
1514,
29918,
4230,
29918,
978,
2033,
13,
4706,
1574,
29918,
561,
29918,
1217,
353,
11619,
4290,
1839,
1514,
29918,
561,
29918,
1217,
2033,
13,
4706,
1574,
29918,
7328,
353,
11619,
4290,
1839,
1514,
29918,
7328,
2033,
13,
4706,
11009,
29889,
7978,
29898,
13,
9651,
376,
14474,
11619,
11368,
1574,
29918,
4102,
29918,
978,
29922,
14579,
1514,
29918,
4230,
29918,
978,
29922,
14579,
1514,
29918,
561,
29918,
1217,
29922,
14579,
1514,
29918,
7328,
29922,
29973,
5754,
1574,
29918,
333,
29922,
29973,
613,
13,
9651,
313,
1514,
29918,
4102,
29918,
978,
29892,
1574,
29918,
4230,
29918,
978,
29892,
1574,
29918,
561,
29918,
1217,
29892,
1574,
29918,
7328,
29892,
1178,
876,
13,
4706,
11009,
29889,
15060,
580,
13,
4706,
736,
11619,
4290,
2
] |
p3d/__init__.py
|
Derfies/p3d
| 0 |
28757
|
<filename>p3d/__init__.py<gh_stars>0
from pandac.PandaModules import Vec3
P3D_VERSION = '0.1'
__version__ = P3D_VERSION
from constants import *
from functions import *
import commonUtils
from object import Object
from singleTask import SingleTask
from nodePathObject import NodePathObject
from pandaObject import *
from pandaBehaviour import PandaBehaviour
from pandaManager import PandaManager
from marquee import Marquee
from camera import *
from editorCamera import EditorCamera
from frameRate import FrameRate
from displayShading import DisplayShading
from mouse import *
from mousePicker import MousePicker
import geometry
try:
import wxPanda as wx
except:
print 'Failed to find wx module'
|
[
1,
529,
9507,
29958,
29886,
29941,
29881,
29914,
1649,
2344,
26914,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
282,
392,
562,
29889,
29925,
5863,
2111,
2540,
1053,
26393,
29941,
13,
13,
13,
29925,
29941,
29928,
29918,
16358,
353,
525,
29900,
29889,
29896,
29915,
13,
13,
13,
1649,
3259,
1649,
353,
349,
29941,
29928,
29918,
16358,
13,
13,
13,
3166,
17727,
1053,
334,
13,
3166,
3168,
1053,
334,
13,
5215,
3619,
12177,
13,
13,
3166,
1203,
1053,
4669,
13,
3166,
2323,
5398,
1053,
16740,
5398,
13,
3166,
2943,
2605,
2061,
1053,
9071,
2605,
2061,
13,
3166,
282,
5863,
2061,
1053,
334,
13,
3166,
282,
5863,
3629,
8708,
8975,
1053,
349,
5863,
3629,
8708,
8975,
13,
3166,
282,
5863,
3260,
1053,
349,
5863,
3260,
13,
13,
3166,
29452,
29872,
1053,
1085,
802,
29872,
13,
3166,
10656,
1053,
334,
13,
3166,
6920,
20717,
1053,
14059,
20717,
13,
3166,
3515,
19907,
1053,
12218,
19907,
13,
3166,
2479,
2713,
9382,
1053,
17440,
2713,
9382,
13,
3166,
9495,
1053,
334,
13,
3166,
9495,
13954,
1053,
25992,
13954,
13,
5215,
16303,
13,
2202,
29901,
13,
1678,
1053,
26437,
29925,
5863,
408,
26437,
13,
19499,
29901,
13,
1678,
1596,
525,
17776,
304,
1284,
26437,
3883,
29915,
2
] |
sagemaker-experiments/track-an-airflow-workflow/code/train.py
|
jerrypeng7773/amazon-sagemaker-examples
| 2,610 |
149611
|
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file 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 argparse
import logging
import os
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
from data_util import load_test_dataset, load_train_dataset
from model import get_model
from sklearn.model_selection import train_test_split
logging.getLogger().setLevel(logging.INFO)
tf.logging.set_verbosity(tf.logging.ERROR)
# Copy inference pre/post-processing script so it will be included in the model package
os.system("mkdir /opt/ml/model/code")
os.system("cp inference.py /opt/ml/model/code")
os.system("cp requirements.txt /opt/ml/model/code")
def save_model(model, path):
tf.contrib.saved_model.save_keras_model(model, f"{path}/SavedModel")
logging.info("Model successfully saved at: {}".format(path))
def main(args):
model = get_model(
filters=args.filter_sizes,
hidden_units=args.hidden_size,
dropouts=args.dropout_sizes,
num_class=args.num_classes,
)
# load training data
x, y = load_train_dataset(droot=args.train_dir)
# one-hot encode label
one_hot_y = np.zeros((y.shape[0], args.num_classes))
one_hot_y[np.arange(y.shape[0]), y] = 1
# split x and y into train and val set
X_train, X_val, y_train, y_val = train_test_split(
x, one_hot_y, test_size=args.test_size, random_state=42, shuffle=True
)
# normalize the x image
X_train = X_train / 255
X_val = X_val / 255
opt = tf.keras.optimizers.Adam(args.learning_rate, args.momentum)
model.compile(
loss="categorical_crossentropy",
optimizer=opt,
metrics=["categorical_crossentropy", "accuracy"],
)
# a callback to save model ckpt after each epoch if better model is found
model_ckpt_callback = tf.keras.callbacks.ModelCheckpoint(
args.output_data_dir + "/checkpoint-{epoch}.h5",
monitor="val_accuracy",
)
logging.info("Start training ...")
model.fit(
X_train,
y_train,
validation_data=(X_val, y_val),
batch_size=args.batch_size,
epochs=args.epochs,
callbacks=[model_ckpt_callback],
verbose=2,
)
save_model(model, args.model_output_dir)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--filter-sizes", nargs=2, type=int, default=[64, 32], help="Filter size with length of 2"
)
parser.add_argument(
"--hidden-size", type=int, default=256, help="Feed-forward layer hidden unit size."
)
parser.add_argument(
"--dropout-sizes",
nargs=3,
type=float,
default=[0.3, 0.3, 0.5],
help="Dropout layer size with length of 2",
)
parser.add_argument(
"--num-classes", type=int, default=10, help="Num of class in classification task."
)
parser.add_argument("--learning-rate", type=float, default=0.001, help="Initial learning rate.")
parser.add_argument("--epochs", type=int, default=10)
parser.add_argument("--batch-size", type=int, default=128)
parser.add_argument("--test-size", type=float, default=0.2)
parser.add_argument("--momentum", type=float, default=0.9)
parser.add_argument("--train-dir", type=str, default=os.environ.get("SM_CHANNEL_TRAINING"))
parser.add_argument("--model_dir", type=str)
parser.add_argument("--model-output-dir", type=str, default=os.environ.get("SM_MODEL_DIR"))
parser.add_argument("--output-data-dir", type=str, default=os.environ.get("SM_OUTPUT_DATA_DIR"))
args = parser.parse_args()
main(args)
|
[
1,
396,
14187,
1266,
29871,
29906,
29900,
29896,
29947,
16631,
29889,
510,
29892,
9266,
29889,
470,
967,
23736,
1078,
29889,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
2564,
887,
13,
29937,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
319,
3509,
310,
13,
29937,
278,
19245,
338,
5982,
472,
13,
29937,
13,
29937,
268,
1732,
597,
10467,
29889,
17260,
29889,
510,
29914,
4288,
29906,
29889,
29900,
29914,
13,
29937,
13,
29937,
470,
297,
278,
376,
506,
1947,
29908,
934,
10259,
1384,
292,
445,
934,
29889,
910,
934,
338,
13,
29937,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13,
29937,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
2823,
278,
19245,
363,
278,
2702,
13,
29937,
4086,
14765,
1076,
11239,
322,
27028,
1090,
278,
19245,
29889,
13,
13,
5215,
1852,
5510,
13,
5215,
12183,
13,
5215,
2897,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
26110,
408,
15886,
13,
5215,
26110,
29889,
3946,
294,
29889,
27852,
408,
476,
13,
3166,
848,
29918,
4422,
1053,
2254,
29918,
1688,
29918,
24713,
29892,
2254,
29918,
14968,
29918,
24713,
13,
3166,
1904,
1053,
679,
29918,
4299,
13,
3166,
2071,
19668,
29889,
4299,
29918,
21731,
1053,
7945,
29918,
1688,
29918,
5451,
13,
13,
21027,
29889,
657,
16363,
2141,
842,
10108,
29898,
21027,
29889,
11690,
29897,
13,
13264,
29889,
21027,
29889,
842,
29918,
18248,
359,
537,
29898,
13264,
29889,
21027,
29889,
11432,
29897,
13,
13,
29937,
29871,
14187,
27262,
758,
29914,
2490,
29899,
19170,
2471,
577,
372,
674,
367,
5134,
297,
278,
1904,
3577,
13,
359,
29889,
5205,
703,
11256,
3972,
847,
3670,
29914,
828,
29914,
4299,
29914,
401,
1159,
13,
359,
29889,
5205,
703,
6814,
27262,
29889,
2272,
847,
3670,
29914,
828,
29914,
4299,
29914,
401,
1159,
13,
359,
29889,
5205,
703,
6814,
11780,
29889,
3945,
847,
3670,
29914,
828,
29914,
4299,
29914,
401,
1159,
13,
13,
13,
1753,
4078,
29918,
4299,
29898,
4299,
29892,
2224,
1125,
13,
1678,
15886,
29889,
21570,
29889,
17314,
29918,
4299,
29889,
7620,
29918,
3946,
294,
29918,
4299,
29898,
4299,
29892,
285,
29908,
29912,
2084,
6822,
29903,
10511,
3195,
1159,
13,
1678,
12183,
29889,
3888,
703,
3195,
8472,
7160,
472,
29901,
6571,
1642,
4830,
29898,
2084,
876,
13,
13,
13,
1753,
1667,
29898,
5085,
1125,
13,
1678,
1904,
353,
679,
29918,
4299,
29898,
13,
4706,
18094,
29922,
5085,
29889,
4572,
29918,
29879,
7093,
29892,
13,
4706,
7934,
29918,
348,
1169,
29922,
5085,
29889,
10892,
29918,
2311,
29892,
13,
4706,
5768,
17718,
29922,
5085,
29889,
8865,
449,
29918,
29879,
7093,
29892,
13,
4706,
954,
29918,
1990,
29922,
5085,
29889,
1949,
29918,
13203,
29892,
13,
1678,
1723,
13,
13,
1678,
396,
2254,
6694,
848,
13,
1678,
921,
29892,
343,
353,
2254,
29918,
14968,
29918,
24713,
29898,
29881,
4632,
29922,
5085,
29889,
14968,
29918,
3972,
29897,
13,
1678,
396,
697,
29899,
8711,
19750,
3858,
13,
1678,
697,
29918,
8711,
29918,
29891,
353,
7442,
29889,
3298,
359,
3552,
29891,
29889,
12181,
29961,
29900,
1402,
6389,
29889,
1949,
29918,
13203,
876,
13,
1678,
697,
29918,
8711,
29918,
29891,
29961,
9302,
29889,
279,
927,
29898,
29891,
29889,
12181,
29961,
29900,
11724,
343,
29962,
353,
29871,
29896,
13,
1678,
396,
6219,
921,
322,
343,
964,
7945,
322,
659,
731,
13,
1678,
1060,
29918,
14968,
29892,
1060,
29918,
791,
29892,
343,
29918,
14968,
29892,
343,
29918,
791,
353,
7945,
29918,
1688,
29918,
5451,
29898,
13,
4706,
921,
29892,
697,
29918,
8711,
29918,
29891,
29892,
1243,
29918,
2311,
29922,
5085,
29889,
1688,
29918,
2311,
29892,
4036,
29918,
3859,
29922,
29946,
29906,
29892,
528,
21897,
29922,
5574,
13,
1678,
1723,
13,
13,
1678,
396,
4226,
675,
278,
921,
1967,
13,
1678,
1060,
29918,
14968,
353,
1060,
29918,
14968,
847,
29871,
29906,
29945,
29945,
13,
1678,
1060,
29918,
791,
353,
1060,
29918,
791,
847,
29871,
29906,
29945,
29945,
13,
13,
1678,
3523,
353,
15886,
29889,
3946,
294,
29889,
20640,
19427,
29889,
3253,
314,
29898,
5085,
29889,
21891,
29918,
10492,
29892,
6389,
29889,
29885,
2932,
398,
29897,
13,
13,
1678,
1904,
29889,
12198,
29898,
13,
4706,
6410,
543,
29883,
20440,
936,
29918,
19128,
296,
14441,
613,
13,
4706,
5994,
3950,
29922,
3670,
29892,
13,
4706,
21556,
29922,
3366,
29883,
20440,
936,
29918,
19128,
296,
14441,
613,
376,
562,
2764,
4135,
12436,
13,
1678,
1723,
13,
13,
1678,
396,
263,
6939,
304,
4078,
1904,
274,
29895,
415,
1156,
1269,
21502,
305,
565,
2253,
1904,
338,
1476,
13,
1678,
1904,
29918,
384,
415,
29918,
14035,
353,
15886,
29889,
3946,
294,
29889,
14035,
29879,
29889,
3195,
5596,
3149,
29898,
13,
4706,
6389,
29889,
4905,
29918,
1272,
29918,
3972,
718,
5591,
3198,
3149,
29899,
29912,
1022,
2878,
1836,
29882,
29945,
613,
13,
4706,
11819,
543,
791,
29918,
562,
2764,
4135,
613,
13,
1678,
1723,
13,
13,
1678,
12183,
29889,
3888,
703,
4763,
6694,
2023,
1159,
13,
1678,
1904,
29889,
9202,
29898,
13,
4706,
1060,
29918,
14968,
29892,
13,
4706,
343,
29918,
14968,
29892,
13,
4706,
8845,
29918,
1272,
7607,
29990,
29918,
791,
29892,
343,
29918,
791,
511,
13,
4706,
9853,
29918,
2311,
29922,
5085,
29889,
16175,
29918,
2311,
29892,
13,
4706,
21502,
12168,
29922,
5085,
29889,
1022,
2878,
29879,
29892,
13,
4706,
6939,
29879,
11759,
4299,
29918,
384,
415,
29918,
14035,
1402,
13,
4706,
26952,
29922,
29906,
29892,
13,
1678,
1723,
13,
13,
1678,
4078,
29918,
4299,
29898,
4299,
29892,
6389,
29889,
4299,
29918,
4905,
29918,
3972,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
4572,
29899,
29879,
7093,
613,
302,
5085,
29922,
29906,
29892,
1134,
29922,
524,
29892,
2322,
11759,
29953,
29946,
29892,
29871,
29941,
29906,
1402,
1371,
543,
5072,
2159,
411,
3309,
310,
29871,
29906,
29908,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
10892,
29899,
2311,
613,
1134,
29922,
524,
29892,
2322,
29922,
29906,
29945,
29953,
29892,
1371,
543,
29737,
29899,
11333,
7546,
7934,
5190,
2159,
1213,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
8865,
449,
29899,
29879,
7093,
613,
13,
4706,
302,
5085,
29922,
29941,
29892,
13,
4706,
1134,
29922,
7411,
29892,
13,
4706,
2322,
11759,
29900,
29889,
29941,
29892,
29871,
29900,
29889,
29941,
29892,
29871,
29900,
29889,
29945,
1402,
13,
4706,
1371,
543,
15063,
449,
7546,
2159,
411,
3309,
310,
29871,
29906,
613,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
1949,
29899,
13203,
613,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29900,
29892,
1371,
543,
8009,
310,
770,
297,
12965,
3414,
1213,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
21891,
29899,
10492,
613,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29900,
29900,
29896,
29892,
1371,
543,
15514,
6509,
6554,
23157,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
1022,
2878,
29879,
613,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29900,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
16175,
29899,
2311,
613,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29906,
29947,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
1688,
29899,
2311,
613,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29906,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
29885,
2932,
398,
613,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29929,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
14968,
29899,
3972,
613,
1134,
29922,
710,
29892,
2322,
29922,
359,
29889,
21813,
29889,
657,
703,
17061,
29918,
3210,
2190,
29940,
6670,
29918,
29911,
4717,
1177,
4214,
5783,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
4299,
29918,
3972,
613,
1134,
29922,
710,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
4299,
29899,
4905,
29899,
3972,
613,
1134,
29922,
710,
29892,
2322,
29922,
359,
29889,
21813,
29889,
657,
703,
17061,
29918,
20387,
29931,
29918,
9464,
5783,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
4905,
29899,
1272,
29899,
3972,
613,
1134,
29922,
710,
29892,
2322,
29922,
359,
29889,
21813,
29889,
657,
703,
17061,
29918,
12015,
12336,
29918,
14573,
29918,
9464,
5783,
13,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
1678,
1667,
29898,
5085,
29897,
13,
2
] |
train/manager.py
|
LiuTed/gym-TD
| 0 |
47066
|
import os
import shutil
import re
from collections import OrderedDict
import subprocess
import numpy as np
import atexit
class Result:
checkpoint = None
log = None
tarball = None
board = None
if __name__ == '__main__':
results = OrderedDict()
def load_files():
files = os.listdir()
for f in files:
res = re.match('ckpt-([0-9]{6}-[0-9]{6})', f)
if res is not None:
val = results.get(res.group(1), Result())
val.checkpoint = f
results[res.group(1)] = val
res = re.match('Result-([0-9]{6}-[0-9]{6})', f)
if res is not None:
val = results.get(res.group(1), Result())
val.log = f
results[res.group(1)] = val
res = re.match('result-([0-9]{6}-[0-9]{6}).tar.gz', f)
if res is not None:
val = results.get(res.group(1), Result())
val.tarball = f
results[res.group(1)] = val
def get_size(start, human = True):
ts = 0
unit = 0
if os.path.islink(start):
return ts, unit
if os.path.isdir(start):
for dirpath, dirnames, filenames in os.walk(start):
for f in filenames:
fp = os.path.join(dirpath, f)
if not os.path.islink(fp):
ts += os.path.getsize(fp)
else:
ts = os.path.getsize(start)
if human:
while ts >= 1024:
ts /= 1024
unit += 1
return ts, unit
def result_list():
print('ID:\tTime\t\tC L T B')
print('Size:\tC\tL\tT')
units = ['B', 'KB', 'MB', 'GB', 'TB', '']
for i, (d, r) in enumerate(results.items()):
print(
'{}:\t{}\t{} {} {} {}'.format(
i,
d,
'C' if r.checkpoint is not None else '-',
'L' if r.log is not None else '-',
'T' if r.tarball is not None else '-',
'B' if r.board is not None else '-'
)
)
if r.checkpoint is not None:
cs, cu = get_size(r.checkpoint)
else:
cs, cu = 0, 0
if r.log is not None:
ls, lu = get_size(r.log)
else:
ls, lu = 0, 0
if r.tarball is not None:
ts, tu = get_size(r.tarball)
else:
ts, tu = 0, 0
print(
'\t{:.1f}{}\t{:.1f}{}\t{:.1f}{}'.format(
cs, units[cu],
ls, units[lu],
ts, units[tu]
)
)
def get_key_val(sid, keys, show=True):
if len(sid.split('-')) == 1:
id = int(sid)
if id >= len(results):
if show:
print('Unknown index', sid)
return None, None
key = keys[id]
else:
key = sid
try:
val = results[key]
except:
if show:
print('Unknown time', key)
return None, None
return key, val
print('Checking files')
load_files()
print('Results:')
result_list()
while True:
cmd = input('> ')
values = list(results.values())
keys = list(results.keys())
if cmd.strip() == '':
continue
if cmd == 'ls' or cmd == 'list':
result_list()
continue
if cmd == 'exit':
break
res = re.match('rm( checkpoint| log| tarball)*( [0-9]+| [0-9]{6}-[0-9]{6})+\s*$', cmd)
if res is not None:
actions = 0
dkeys = []
for m in re.finditer('checkpoint|log|tarball', cmd):
act = m.group(0)
if act == 'checkpoint':
actions |= 1
continue
if act == 'log':
actions |= 2
continue
if act == 'tarball':
actions |= 4
continue
for m in re.finditer(' [0-9]+| [0-9]{6}-[0-9]{6}', cmd):
sid = m.group(0)
key, val = get_key_val(sid.strip(), keys)
if key is None:
continue
dkeys.append(key)
if actions == 0:
actions = 7
dkeys = np.unique(dkeys)
if len(dkeys) == 0:
print('Has nothing to delete')
continue
print('Deleting the{}{}{} of the following results:'.format(
' checkpoint' if actions & 1 != 0 else '',
' log' if actions & 2 != 0 else '',
' tarball' if actions & 4 != 0 else ''
))
for key in dkeys:
print(key)
ck = input('[y/N] ')
if ck.upper() == 'Y':
for key in dkeys:
val = results[key]
if actions & 1 != 0 and val.checkpoint is not None:
print('Deleting', val.checkpoint)
shutil.rmtree(val.checkpoint)
val.checkpoint = None
if actions & 2 != 0 and val.log is not None:
if val.board is not None:
print('Closing the tensorboard process of result {}'.format(key))
val.board.terminate()
val.board.wait(10)
if val.board.poll() is None:
val.board.kill()
val.board = None
print('Deleting', val.log)
shutil.rmtree(val.log)
val.log = None
if actions & 4 != 0 and val.tarball is not None:
print('Deleting', val.tarball)
os.remove(val.tarball)
val.tarball = None
if val.checkpoint is not None\
or val.log is not None\
or val.tarball is not None:
results[key] = val
else:
results.pop(key)
load_files()
continue
res = re.match('board ([0-9]+|[0-9]{6}-[0-9]{6})\s*$', cmd)
if res is not None:
sid = res.group(1)
key, val = get_key_val(sid, keys)
if key is None:
continue
if val.board is not None:
print('board of {} is running'.format(key))
continue
if val.log is None:
print('log of {} does not exists'.format(key))
continue
subp = subprocess.Popen(
['tensorboard', '--logdir='+val.log, '--bind_all'],
shell = False,
stdout = subprocess.DEVNULL
)
val.board = subp
results[key] = val
continue
res = re.match('stop ([0-9]+|[0-9]{6}-[0-9]{6})\s*$', cmd)
if res is not None:
sid = res.group(1)
key, val = get_key_val(sid, keys)
if key is None:
continue
if val.board is None:
print('board of {} is not running'.format(key))
continue
val.board.terminate()
val.board.wait()
val.board = None
results[key] = val
continue
res = re.match('pack ([0-9]+|[0-9]{6}-[0-9]{6})\s*$', cmd)
if res is not None:
sid = res.group(1)
key, val = get_key_val(sid, keys)
if key is None:
continue
if val.tarball is not None:
print('tarball of {} has already existed'.format(key))
continue
subp = subprocess.Popen(
'tar czvf result-{}.tar.gz {} {}'.format(
key, val.checkpoint or '', val.log or ''
),
shell = True
)
subp.wait()
val.tarball = 'result-{}.tar.gz'.format(key)
results[key] = val
continue
res = re.match('unpack ([0-9]+|[0-9]{6}-[0-9]{6})\s*$', cmd)
if res is not None:
sid = res.group(1)
key, val = get_key_val(sid, keys)
if key is None:
continue
if val.tarball is None:
print('tarball of {} does not exist'.format(key))
continue
subp = subprocess.Popen(
'tar xzvf {}'.format(val.tarball),
shell = True
)
subp.wait()
load_files()
continue
if cmd != 'help':
print('Unknown command', cmd)
print('''Usage:
help: show this message
ls: list the status of results with format \'ID: time has_checkpoint has_log has_tarball if_tensorboard_running\'
rm [checkpoint] [log] [tarball] id/time[ id/time[ ...]]: remove the results listed (double check needed)
board id/time: execute tensorboard to visualize the result specified
stop id/time: stop tensorboard of that result
pack id/time: pack the result into tar ball
unpack id/time: unpack the tar ball of result
exit: exit'''
)
|
[
1,
1053,
2897,
13,
5215,
528,
4422,
13,
5215,
337,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
5215,
1014,
5014,
13,
5215,
12655,
408,
7442,
13,
5215,
263,
4776,
277,
13,
13,
1990,
7867,
29901,
13,
1678,
1423,
3149,
353,
6213,
13,
1678,
1480,
353,
6213,
13,
1678,
9913,
2135,
353,
6213,
13,
1678,
7613,
353,
6213,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
2582,
353,
8170,
287,
21533,
580,
13,
13,
1678,
822,
2254,
29918,
5325,
7295,
13,
4706,
2066,
353,
2897,
29889,
1761,
3972,
580,
13,
4706,
363,
285,
297,
2066,
29901,
13,
9651,
620,
353,
337,
29889,
4352,
877,
384,
415,
29899,
4197,
29900,
29899,
29929,
3199,
29953,
7402,
29961,
29900,
29899,
29929,
3199,
29953,
1800,
742,
285,
29897,
13,
9651,
565,
620,
338,
451,
6213,
29901,
13,
18884,
659,
353,
2582,
29889,
657,
29898,
690,
29889,
2972,
29898,
29896,
511,
7867,
3101,
13,
18884,
659,
29889,
3198,
3149,
353,
285,
13,
18884,
2582,
29961,
690,
29889,
2972,
29898,
29896,
4638,
353,
659,
13,
9651,
620,
353,
337,
29889,
4352,
877,
3591,
29899,
4197,
29900,
29899,
29929,
3199,
29953,
7402,
29961,
29900,
29899,
29929,
3199,
29953,
1800,
742,
285,
29897,
13,
9651,
565,
620,
338,
451,
6213,
29901,
13,
18884,
659,
353,
2582,
29889,
657,
29898,
690,
29889,
2972,
29898,
29896,
511,
7867,
3101,
13,
18884,
659,
29889,
1188,
353,
285,
13,
18884,
2582,
29961,
690,
29889,
2972,
29898,
29896,
4638,
353,
659,
13,
9651,
620,
353,
337,
29889,
4352,
877,
2914,
29899,
4197,
29900,
29899,
29929,
3199,
29953,
7402,
29961,
29900,
29899,
29929,
3199,
29953,
7690,
12637,
29889,
18828,
742,
285,
29897,
13,
9651,
565,
620,
338,
451,
6213,
29901,
13,
18884,
659,
353,
2582,
29889,
657,
29898,
690,
29889,
2972,
29898,
29896,
511,
7867,
3101,
13,
18884,
659,
29889,
12637,
2135,
353,
285,
13,
18884,
2582,
29961,
690,
29889,
2972,
29898,
29896,
4638,
353,
659,
13,
268,
13,
1678,
822,
679,
29918,
2311,
29898,
2962,
29892,
5199,
353,
5852,
1125,
13,
4706,
18696,
353,
29871,
29900,
13,
4706,
5190,
353,
29871,
29900,
13,
4706,
565,
2897,
29889,
2084,
29889,
275,
2324,
29898,
2962,
1125,
13,
9651,
736,
18696,
29892,
5190,
13,
4706,
565,
2897,
29889,
2084,
29889,
275,
3972,
29898,
2962,
1125,
13,
9651,
363,
4516,
2084,
29892,
4516,
7039,
29892,
977,
264,
1280,
297,
2897,
29889,
20919,
29898,
2962,
1125,
13,
18884,
363,
285,
297,
977,
264,
1280,
29901,
13,
462,
1678,
285,
29886,
353,
2897,
29889,
2084,
29889,
7122,
29898,
3972,
2084,
29892,
285,
29897,
13,
462,
1678,
565,
451,
2897,
29889,
2084,
29889,
275,
2324,
29898,
18091,
1125,
13,
462,
4706,
18696,
4619,
2897,
29889,
2084,
29889,
657,
2311,
29898,
18091,
29897,
13,
4706,
1683,
29901,
13,
9651,
18696,
353,
2897,
29889,
2084,
29889,
657,
2311,
29898,
2962,
29897,
13,
4706,
565,
5199,
29901,
13,
9651,
1550,
18696,
6736,
29871,
29896,
29900,
29906,
29946,
29901,
13,
18884,
18696,
847,
29922,
29871,
29896,
29900,
29906,
29946,
13,
18884,
5190,
4619,
29871,
29896,
13,
4706,
736,
18696,
29892,
5190,
13,
268,
13,
1678,
822,
1121,
29918,
1761,
7295,
13,
4706,
1596,
877,
1367,
3583,
29873,
2481,
29905,
29873,
29905,
29873,
29907,
365,
323,
350,
1495,
13,
4706,
1596,
877,
3505,
3583,
29873,
29907,
29905,
29873,
29931,
29905,
29873,
29911,
1495,
13,
4706,
10340,
353,
6024,
29933,
742,
525,
26067,
742,
525,
9486,
742,
525,
7210,
742,
525,
24895,
742,
525,
2033,
13,
4706,
363,
474,
29892,
313,
29881,
29892,
364,
29897,
297,
26985,
29898,
9902,
29889,
7076,
580,
1125,
13,
9651,
1596,
29898,
13,
18884,
525,
8875,
3583,
29873,
29912,
1012,
29873,
8875,
6571,
6571,
6571,
4286,
4830,
29898,
13,
462,
1678,
474,
29892,
13,
462,
1678,
270,
29892,
13,
462,
1678,
525,
29907,
29915,
565,
364,
29889,
3198,
3149,
338,
451,
6213,
1683,
17411,
742,
13,
462,
1678,
525,
29931,
29915,
565,
364,
29889,
1188,
338,
451,
6213,
1683,
17411,
742,
13,
462,
1678,
525,
29911,
29915,
565,
364,
29889,
12637,
2135,
338,
451,
6213,
1683,
17411,
742,
13,
462,
1678,
525,
29933,
29915,
565,
364,
29889,
3377,
338,
451,
6213,
1683,
17411,
29915,
13,
18884,
1723,
13,
9651,
1723,
13,
9651,
565,
364,
29889,
3198,
3149,
338,
451,
6213,
29901,
13,
18884,
5939,
29892,
2723,
353,
679,
29918,
2311,
29898,
29878,
29889,
3198,
3149,
29897,
13,
9651,
1683,
29901,
13,
18884,
5939,
29892,
2723,
353,
29871,
29900,
29892,
29871,
29900,
13,
9651,
565,
364,
29889,
1188,
338,
451,
6213,
29901,
13,
18884,
19375,
29892,
8092,
353,
679,
29918,
2311,
29898,
29878,
29889,
1188,
29897,
13,
9651,
1683,
29901,
13,
18884,
19375,
29892,
8092,
353,
29871,
29900,
29892,
29871,
29900,
13,
9651,
565,
364,
29889,
12637,
2135,
338,
451,
6213,
29901,
13,
18884,
18696,
29892,
5291,
353,
679,
29918,
2311,
29898,
29878,
29889,
12637,
2135,
29897,
13,
9651,
1683,
29901,
13,
18884,
18696,
29892,
5291,
353,
29871,
29900,
29892,
29871,
29900,
13,
9651,
1596,
29898,
13,
18884,
11297,
29873,
25641,
29889,
29896,
29888,
1157,
1012,
29873,
25641,
29889,
29896,
29888,
1157,
1012,
29873,
25641,
29889,
29896,
29888,
1157,
29913,
4286,
4830,
29898,
13,
462,
1678,
5939,
29892,
10340,
29961,
4979,
1402,
13,
462,
1678,
19375,
29892,
10340,
29961,
6092,
1402,
13,
462,
1678,
18696,
29892,
10340,
29961,
9161,
29962,
13,
18884,
1723,
13,
9651,
1723,
13,
268,
13,
1678,
822,
679,
29918,
1989,
29918,
791,
29898,
29879,
333,
29892,
6611,
29892,
1510,
29922,
5574,
1125,
13,
4706,
565,
7431,
29898,
29879,
333,
29889,
5451,
877,
29899,
8785,
1275,
29871,
29896,
29901,
13,
9651,
1178,
353,
938,
29898,
29879,
333,
29897,
13,
9651,
565,
1178,
6736,
7431,
29898,
9902,
1125,
13,
18884,
565,
1510,
29901,
13,
462,
1678,
1596,
877,
14148,
2380,
742,
25349,
29897,
13,
18884,
736,
6213,
29892,
6213,
13,
9651,
1820,
353,
6611,
29961,
333,
29962,
13,
4706,
1683,
29901,
13,
9651,
1820,
353,
25349,
13,
4706,
1018,
29901,
13,
9651,
659,
353,
2582,
29961,
1989,
29962,
13,
4706,
5174,
29901,
13,
9651,
565,
1510,
29901,
13,
18884,
1596,
877,
14148,
931,
742,
1820,
29897,
13,
9651,
736,
6213,
29892,
6213,
13,
4706,
736,
1820,
29892,
659,
13,
308,
13,
1678,
1596,
877,
5596,
292,
2066,
1495,
13,
1678,
2254,
29918,
5325,
580,
13,
13,
1678,
1596,
877,
12191,
29901,
1495,
13,
1678,
1121,
29918,
1761,
580,
13,
13,
1678,
1550,
5852,
29901,
13,
4706,
9920,
353,
1881,
877,
29958,
25710,
13,
4706,
1819,
353,
1051,
29898,
9902,
29889,
5975,
3101,
13,
4706,
6611,
353,
1051,
29898,
9902,
29889,
8149,
3101,
13,
13,
4706,
565,
9920,
29889,
17010,
580,
1275,
525,
2396,
13,
9651,
6773,
13,
13,
4706,
565,
9920,
1275,
525,
3137,
29915,
470,
9920,
1275,
525,
1761,
2396,
13,
9651,
1121,
29918,
1761,
580,
13,
9651,
6773,
13,
308,
13,
4706,
565,
9920,
1275,
525,
13322,
2396,
13,
9651,
2867,
13,
13,
4706,
620,
353,
337,
29889,
4352,
877,
1758,
29898,
1423,
3149,
29989,
1480,
29989,
9913,
2135,
11877,
29898,
518,
29900,
29899,
29929,
10062,
29989,
518,
29900,
29899,
29929,
3199,
29953,
7402,
29961,
29900,
29899,
29929,
3199,
29953,
1800,
3124,
29879,
29394,
742,
9920,
29897,
13,
4706,
565,
620,
338,
451,
6213,
29901,
13,
9651,
8820,
353,
29871,
29900,
13,
9651,
270,
8149,
353,
5159,
13,
9651,
363,
286,
297,
337,
29889,
2886,
1524,
877,
3198,
3149,
29989,
1188,
29989,
12637,
2135,
742,
9920,
1125,
13,
18884,
1044,
353,
286,
29889,
2972,
29898,
29900,
29897,
13,
18884,
565,
1044,
1275,
525,
3198,
3149,
2396,
13,
462,
1678,
8820,
891,
29922,
29871,
29896,
13,
462,
1678,
6773,
13,
18884,
565,
1044,
1275,
525,
1188,
2396,
13,
462,
1678,
8820,
891,
29922,
29871,
29906,
13,
462,
1678,
6773,
13,
18884,
565,
1044,
1275,
525,
12637,
2135,
2396,
13,
462,
1678,
8820,
891,
29922,
29871,
29946,
13,
462,
1678,
6773,
13,
9651,
363,
286,
297,
337,
29889,
2886,
1524,
877,
518,
29900,
29899,
29929,
10062,
29989,
518,
29900,
29899,
29929,
3199,
29953,
7402,
29961,
29900,
29899,
29929,
3199,
29953,
29913,
742,
9920,
1125,
13,
18884,
25349,
353,
286,
29889,
2972,
29898,
29900,
29897,
13,
18884,
1820,
29892,
659,
353,
679,
29918,
1989,
29918,
791,
29898,
29879,
333,
29889,
17010,
3285,
6611,
29897,
13,
18884,
565,
1820,
338,
6213,
29901,
13,
462,
1678,
6773,
13,
18884,
270,
8149,
29889,
4397,
29898,
1989,
29897,
13,
9651,
565,
8820,
1275,
29871,
29900,
29901,
13,
18884,
8820,
353,
29871,
29955,
13,
9651,
270,
8149,
353,
7442,
29889,
13092,
29898,
29881,
8149,
29897,
13,
9651,
565,
7431,
29898,
29881,
8149,
29897,
1275,
29871,
29900,
29901,
13,
18884,
1596,
877,
14510,
3078,
304,
5217,
1495,
13,
18884,
6773,
13,
9651,
1596,
877,
2772,
1026,
292,
278,
29912,
1157,
1157,
29913,
310,
278,
1494,
2582,
29901,
4286,
4830,
29898,
13,
18884,
525,
1423,
3149,
29915,
565,
8820,
669,
29871,
29896,
2804,
29871,
29900,
1683,
15516,
13,
18884,
525,
1480,
29915,
565,
8820,
669,
29871,
29906,
2804,
29871,
29900,
1683,
15516,
13,
18884,
525,
9913,
2135,
29915,
565,
8820,
669,
29871,
29946,
2804,
29871,
29900,
1683,
6629,
13,
632,
876,
13,
9651,
363,
1820,
297,
270,
8149,
29901,
13,
18884,
1596,
29898,
1989,
29897,
13,
9651,
274,
29895,
353,
1881,
877,
29961,
29891,
29914,
29940,
29962,
25710,
13,
9651,
565,
274,
29895,
29889,
21064,
580,
1275,
525,
29979,
2396,
13,
18884,
363,
1820,
297,
270,
8149,
29901,
13,
462,
1678,
659,
353,
2582,
29961,
1989,
29962,
13,
462,
1678,
565,
8820,
669,
29871,
29896,
2804,
29871,
29900,
322,
659,
29889,
3198,
3149,
338,
451,
6213,
29901,
13,
462,
4706,
1596,
877,
2772,
1026,
292,
742,
659,
29889,
3198,
3149,
29897,
13,
462,
4706,
528,
4422,
29889,
1758,
8336,
29898,
791,
29889,
3198,
3149,
29897,
13,
462,
4706,
659,
29889,
3198,
3149,
353,
6213,
13,
462,
1678,
565,
8820,
669,
29871,
29906,
2804,
29871,
29900,
322,
659,
29889,
1188,
338,
451,
6213,
29901,
13,
462,
4706,
565,
659,
29889,
3377,
338,
451,
6213,
29901,
13,
462,
9651,
1596,
877,
29907,
5409,
292,
278,
12489,
3377,
1889,
310,
1121,
6571,
4286,
4830,
29898,
1989,
876,
13,
462,
9651,
659,
29889,
3377,
29889,
18821,
403,
580,
13,
462,
9651,
659,
29889,
3377,
29889,
10685,
29898,
29896,
29900,
29897,
13,
462,
9651,
565,
659,
29889,
3377,
29889,
29886,
3028,
580,
338,
6213,
29901,
13,
462,
18884,
659,
29889,
3377,
29889,
21174,
580,
13,
462,
9651,
659,
29889,
3377,
353,
6213,
13,
462,
4706,
1596,
877,
2772,
1026,
292,
742,
659,
29889,
1188,
29897,
13,
462,
4706,
528,
4422,
29889,
1758,
8336,
29898,
791,
29889,
1188,
29897,
13,
462,
4706,
659,
29889,
1188,
353,
6213,
13,
462,
1678,
565,
8820,
669,
29871,
29946,
2804,
29871,
29900,
322,
659,
29889,
12637,
2135,
338,
451,
6213,
29901,
13,
462,
4706,
1596,
877,
2772,
1026,
292,
742,
659,
29889,
12637,
2135,
29897,
13,
462,
4706,
2897,
29889,
5992,
29898,
791,
29889,
12637,
2135,
29897,
13,
462,
4706,
659,
29889,
12637,
2135,
353,
6213,
13,
462,
1678,
565,
659,
29889,
3198,
3149,
338,
451,
6213,
29905,
13,
462,
308,
470,
659,
29889,
1188,
338,
451,
6213,
29905,
13,
462,
308,
470,
659,
29889,
12637,
2135,
338,
451,
6213,
29901,
13,
462,
4706,
2582,
29961,
1989,
29962,
353,
659,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
2582,
29889,
7323,
29898,
1989,
29897,
13,
9651,
2254,
29918,
5325,
580,
13,
9651,
6773,
13,
13,
4706,
620,
353,
337,
29889,
4352,
877,
3377,
9310,
29900,
29899,
29929,
10062,
29989,
29961,
29900,
29899,
29929,
3199,
29953,
7402,
29961,
29900,
29899,
29929,
3199,
29953,
11606,
29879,
29394,
742,
9920,
29897,
13,
4706,
565,
620,
338,
451,
6213,
29901,
13,
9651,
25349,
353,
620,
29889,
2972,
29898,
29896,
29897,
13,
9651,
1820,
29892,
659,
353,
679,
29918,
1989,
29918,
791,
29898,
29879,
333,
29892,
6611,
29897,
13,
9651,
565,
1820,
338,
6213,
29901,
13,
18884,
6773,
13,
9651,
565,
659,
29889,
3377,
338,
451,
6213,
29901,
13,
18884,
1596,
877,
3377,
310,
6571,
338,
2734,
4286,
4830,
29898,
1989,
876,
13,
18884,
6773,
13,
9651,
565,
659,
29889,
1188,
338,
6213,
29901,
13,
18884,
1596,
877,
1188,
310,
6571,
947,
451,
4864,
4286,
4830,
29898,
1989,
876,
13,
18884,
6773,
13,
9651,
1014,
29886,
353,
1014,
5014,
29889,
29925,
3150,
29898,
13,
18884,
6024,
20158,
3377,
742,
525,
489,
1188,
3972,
2433,
29974,
791,
29889,
1188,
29892,
525,
489,
5355,
29918,
497,
7464,
13,
18884,
6473,
353,
7700,
29892,
13,
18884,
27591,
353,
1014,
5014,
29889,
2287,
29963,
10074,
13,
9651,
1723,
13,
9651,
659,
29889,
3377,
353,
1014,
29886,
13,
9651,
2582,
29961,
1989,
29962,
353,
659,
13,
9651,
6773,
13,
13,
4706,
620,
353,
337,
29889,
4352,
877,
9847,
9310,
29900,
29899,
29929,
10062,
29989,
29961,
29900,
29899,
29929,
3199,
29953,
7402,
29961,
29900,
29899,
29929,
3199,
29953,
11606,
29879,
29394,
742,
9920,
29897,
13,
4706,
565,
620,
338,
451,
6213,
29901,
13,
9651,
25349,
353,
620,
29889,
2972,
29898,
29896,
29897,
13,
9651,
1820,
29892,
659,
353,
679,
29918,
1989,
29918,
791,
29898,
29879,
333,
29892,
6611,
29897,
13,
9651,
565,
1820,
338,
6213,
29901,
13,
18884,
6773,
13,
9651,
565,
659,
29889,
3377,
338,
6213,
29901,
13,
18884,
1596,
877,
3377,
310,
6571,
338,
451,
2734,
4286,
4830,
29898,
1989,
876,
13,
18884,
6773,
13,
9651,
659,
29889,
3377,
29889,
18821,
403,
580,
13,
9651,
659,
29889,
3377,
29889,
10685,
580,
13,
9651,
659,
29889,
3377,
353,
6213,
13,
9651,
2582,
29961,
1989,
29962,
353,
659,
13,
9651,
6773,
13,
13,
4706,
620,
353,
337,
29889,
4352,
877,
4058,
9310,
29900,
29899,
29929,
10062,
29989,
29961,
29900,
29899,
29929,
3199,
29953,
7402,
29961,
29900,
29899,
29929,
3199,
29953,
11606,
29879,
29394,
742,
9920,
29897,
13,
4706,
565,
620,
338,
451,
6213,
29901,
13,
9651,
25349,
353,
620,
29889,
2972,
29898,
29896,
29897,
13,
9651,
1820,
29892,
659,
353,
679,
29918,
1989,
29918,
791,
29898,
29879,
333,
29892,
6611,
29897,
13,
9651,
565,
1820,
338,
6213,
29901,
13,
18884,
6773,
13,
9651,
565,
659,
29889,
12637,
2135,
338,
451,
6213,
29901,
13,
18884,
1596,
877,
12637,
2135,
310,
6571,
756,
2307,
22856,
4286,
4830,
29898,
1989,
876,
13,
18884,
6773,
13,
9651,
1014,
29886,
353,
1014,
5014,
29889,
29925,
3150,
29898,
13,
18884,
525,
12637,
5316,
29894,
29888,
1121,
29899,
29912,
1836,
12637,
29889,
18828,
6571,
6571,
4286,
4830,
29898,
13,
462,
1678,
1820,
29892,
659,
29889,
3198,
3149,
470,
15516,
659,
29889,
1188,
470,
6629,
13,
18884,
10353,
13,
18884,
6473,
353,
5852,
13,
9651,
1723,
13,
9651,
1014,
29886,
29889,
10685,
580,
13,
9651,
659,
29889,
12637,
2135,
353,
525,
2914,
29899,
29912,
1836,
12637,
29889,
18828,
4286,
4830,
29898,
1989,
29897,
13,
9651,
2582,
29961,
1989,
29962,
353,
659,
13,
9651,
6773,
13,
13,
4706,
620,
353,
337,
29889,
4352,
877,
348,
4058,
9310,
29900,
29899,
29929,
10062,
29989,
29961,
29900,
29899,
29929,
3199,
29953,
7402,
29961,
29900,
29899,
29929,
3199,
29953,
11606,
29879,
29394,
742,
9920,
29897,
13,
4706,
565,
620,
338,
451,
6213,
29901,
13,
9651,
25349,
353,
620,
29889,
2972,
29898,
29896,
29897,
13,
9651,
1820,
29892,
659,
353,
679,
29918,
1989,
29918,
791,
29898,
29879,
333,
29892,
6611,
29897,
13,
9651,
565,
1820,
338,
6213,
29901,
13,
18884,
6773,
13,
9651,
565,
659,
29889,
12637,
2135,
338,
6213,
29901,
13,
18884,
1596,
877,
12637,
2135,
310,
6571,
947,
451,
1863,
4286,
4830,
29898,
1989,
876,
13,
18884,
6773,
13,
9651,
1014,
29886,
353,
1014,
5014,
29889,
29925,
3150,
29898,
13,
18884,
525,
12637,
921,
29920,
29894,
29888,
6571,
4286,
4830,
29898,
791,
29889,
12637,
2135,
511,
13,
18884,
6473,
353,
5852,
13,
9651,
1723,
13,
9651,
1014,
29886,
29889,
10685,
580,
13,
9651,
2254,
29918,
5325,
580,
13,
9651,
6773,
13,
308,
13,
4706,
565,
9920,
2804,
525,
8477,
2396,
13,
9651,
1596,
877,
14148,
1899,
742,
9920,
29897,
13,
4706,
1596,
877,
4907,
27573,
29901,
13,
1678,
1371,
29901,
1510,
445,
2643,
13,
1678,
19375,
29901,
1051,
278,
4660,
310,
2582,
411,
3402,
320,
29915,
1367,
29901,
931,
756,
29918,
3198,
3149,
756,
29918,
1188,
756,
29918,
12637,
2135,
565,
29918,
20158,
3377,
29918,
21094,
20333,
13,
1678,
20241,
518,
3198,
3149,
29962,
518,
1188,
29962,
518,
12637,
2135,
29962,
1178,
29914,
2230,
29961,
1178,
29914,
2230,
29961,
2023,
5262,
29901,
3349,
278,
2582,
9904,
313,
8896,
1423,
4312,
29897,
13,
1678,
7613,
1178,
29914,
2230,
29901,
6222,
12489,
3377,
304,
7604,
675,
278,
1121,
6790,
13,
1678,
5040,
1178,
29914,
2230,
29901,
5040,
12489,
3377,
310,
393,
1121,
13,
1678,
4870,
1178,
29914,
2230,
29901,
4870,
278,
1121,
964,
9913,
8287,
13,
1678,
443,
4058,
1178,
29914,
2230,
29901,
443,
4058,
278,
9913,
8287,
310,
1121,
13,
1678,
6876,
29901,
6876,
12008,
13,
4706,
1723,
13,
632,
13,
308,
13,
2
] |
cpro/migrations/0003_auto_20160918_0506.py
|
FlockyChou/CinderellaProducers
| 0 |
60691
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import cpro.models
class Migration(migrations.Migration):
dependencies = [
('cpro', '0002_auto_20160916_2110'),
]
operations = [
migrations.AddField(
model_name='card',
name='_cache_event_image',
field=models.ImageField(null=True, upload_to=cpro.models.uploadItem(b'e'), blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='card',
name='_cache_event_last_update',
field=models.DateTimeField(null=True),
preserve_default=True,
),
migrations.AddField(
model_name='card',
name='_cache_event_name',
field=models.CharField(max_length=100, null=True),
preserve_default=True,
),
migrations.AddField(
model_name='card',
name='_cache_event_translated_name',
field=models.CharField(max_length=100, null=True),
preserve_default=True,
),
migrations.AlterField(
model_name='event',
name='i_kind',
field=models.PositiveIntegerField(default=0, verbose_name='Kind', choices=[(0, 'Token'), (1, 'Medley'), (2, 'Coop'), (3, 'Caravan')]),
preserve_default=True,
),
]
|
[
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
9557,
29889,
2585,
1053,
4733,
29892,
9725,
800,
13,
5215,
274,
771,
29889,
9794,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
29883,
771,
742,
525,
29900,
29900,
29900,
29906,
29918,
6921,
29918,
29906,
29900,
29896,
29953,
29900,
29929,
29896,
29953,
29918,
29906,
29896,
29896,
29900,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
7543,
742,
13,
9651,
1024,
2433,
29918,
8173,
29918,
3696,
29918,
3027,
742,
13,
9651,
1746,
29922,
9794,
29889,
2940,
3073,
29898,
4304,
29922,
5574,
29892,
6441,
29918,
517,
29922,
29883,
771,
29889,
9794,
29889,
9009,
2001,
29898,
29890,
29915,
29872,
5477,
9654,
29922,
5574,
511,
13,
9651,
19905,
29918,
4381,
29922,
5574,
29892,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
7543,
742,
13,
9651,
1024,
2433,
29918,
8173,
29918,
3696,
29918,
4230,
29918,
5504,
742,
13,
9651,
1746,
29922,
9794,
29889,
11384,
3073,
29898,
4304,
29922,
5574,
511,
13,
9651,
19905,
29918,
4381,
29922,
5574,
29892,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
7543,
742,
13,
9651,
1024,
2433,
29918,
8173,
29918,
3696,
29918,
978,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29896,
29900,
29900,
29892,
1870,
29922,
5574,
511,
13,
9651,
19905,
29918,
4381,
29922,
5574,
29892,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
7543,
742,
13,
9651,
1024,
2433,
29918,
8173,
29918,
3696,
29918,
3286,
29880,
630,
29918,
978,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29896,
29900,
29900,
29892,
1870,
29922,
5574,
511,
13,
9651,
19905,
29918,
4381,
29922,
5574,
29892,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
3696,
742,
13,
9651,
1024,
2433,
29875,
29918,
14380,
742,
13,
9651,
1746,
29922,
9794,
29889,
9135,
3321,
7798,
3073,
29898,
4381,
29922,
29900,
29892,
26952,
29918,
978,
2433,
11885,
742,
19995,
11759,
29898,
29900,
29892,
525,
6066,
5477,
313,
29896,
29892,
525,
19302,
2330,
5477,
313,
29906,
29892,
525,
7967,
459,
5477,
313,
29941,
29892,
525,
8179,
29080,
1495,
11724,
13,
9651,
19905,
29918,
4381,
29922,
5574,
29892,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
tests/cli_test.py
|
hall-lab/lah
| 0 |
181946
|
<reponame>hall-lab/lah
import click, os, unittest
from click.testing import CliRunner
from lah.cli import cli as lah_cli
@click.command()
def the_test_cmd():
print("Hello World!")
lah_cli.add_command(the_test_cmd, "test")
class CliTest(unittest.TestCase):
def test_lah(self):
runner = CliRunner()
result = runner.invoke(lah_cli, [])
self.assertEqual(result.exit_code, 0)
result = runner.invoke(lah_cli, ["-h"])
self.assertEqual(result.exit_code, 0)
result = runner.invoke(lah_cli, ["--help"])
self.assertEqual(result.exit_code, 0)
result = runner.invoke(lah_cli, ["test"])
self.assertEqual(result.exit_code, 0)
self.assertEqual(result.output, "Hello World!\n")
dbfile = os.path.join(os.path.dirname(__file__), "data", "dataset", "test.db")
result = runner.invoke(lah_cli, ["test"])
#result = runner.invoke(lah_cli, ["-d", dbfile, "test"])
self.assertEqual(result.exit_code, 0)
# -- CliTest
if __name__ == '__main__':
unittest.main(verbosity=2)
#-- __main__
|
[
1,
529,
276,
1112,
420,
29958,
27090,
29899,
8205,
29914,
8083,
13,
5215,
2828,
29892,
2897,
29892,
443,
27958,
13,
3166,
2828,
29889,
13424,
1053,
315,
492,
16802,
13,
13,
3166,
425,
29882,
29889,
11303,
1053,
9335,
408,
425,
29882,
29918,
11303,
13,
13,
29992,
3808,
29889,
6519,
580,
13,
1753,
278,
29918,
1688,
29918,
9006,
7295,
13,
1678,
1596,
703,
10994,
2787,
29991,
1159,
13,
8083,
29918,
11303,
29889,
1202,
29918,
6519,
29898,
1552,
29918,
1688,
29918,
9006,
29892,
376,
1688,
1159,
13,
13,
1990,
315,
492,
3057,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
8083,
29898,
1311,
1125,
13,
4706,
28877,
353,
315,
492,
16802,
580,
13,
13,
4706,
1121,
353,
28877,
29889,
9772,
29898,
8083,
29918,
11303,
29892,
518,
2314,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2914,
29889,
13322,
29918,
401,
29892,
29871,
29900,
29897,
13,
13,
4706,
1121,
353,
28877,
29889,
9772,
29898,
8083,
29918,
11303,
29892,
6796,
29899,
29882,
20068,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2914,
29889,
13322,
29918,
401,
29892,
29871,
29900,
29897,
13,
13,
4706,
1121,
353,
28877,
29889,
9772,
29898,
8083,
29918,
11303,
29892,
6796,
489,
8477,
20068,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2914,
29889,
13322,
29918,
401,
29892,
29871,
29900,
29897,
13,
13,
4706,
1121,
353,
28877,
29889,
9772,
29898,
8083,
29918,
11303,
29892,
6796,
1688,
20068,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2914,
29889,
13322,
29918,
401,
29892,
29871,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2914,
29889,
4905,
29892,
376,
10994,
2787,
9903,
29876,
1159,
13,
13,
4706,
4833,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
376,
1272,
613,
376,
24713,
613,
376,
1688,
29889,
2585,
1159,
13,
4706,
1121,
353,
28877,
29889,
9772,
29898,
8083,
29918,
11303,
29892,
6796,
1688,
20068,
13,
4706,
396,
2914,
353,
28877,
29889,
9772,
29898,
8083,
29918,
11303,
29892,
6796,
29899,
29881,
613,
4833,
1445,
29892,
376,
1688,
20068,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2914,
29889,
13322,
29918,
401,
29892,
29871,
29900,
29897,
13,
13,
29937,
1192,
315,
492,
3057,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
29898,
18248,
359,
537,
29922,
29906,
29897,
13,
13,
29937,
489,
4770,
3396,
1649,
13,
2
] |
flink-ai-flow/ai_flow/test/deployer/test_scheduler.py
|
MarvinMiao/flink-ai-extended
| 1 |
119145
|
<reponame>MarvinMiao/flink-ai-extended
#
# 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 os
import time
import unittest
import sys
from ai_flow.rest_endpoint.service.client.aiflow_client import AIFlowClient
import ai_flow as af
from ai_flow.deployer.scheduler import EventScheduler
from ai_flow.graph.edge import JobControlEdge, MetConfig, generate_job_status_key
from ai_flow.graph.edge import TaskAction
from ai_flow.meta.job_meta import State
from ai_flow.plugins.local_cmd_job_plugin import LocalCMDJob
from ai_flow.rest_endpoint.service.server import AIFlowServer
from ai_flow.store.db.base_model import base
from ai_flow.store.sqlalchemy_store import SqlAlchemyStore
from ai_flow.test.rest_endpoint.test_client import _SQLITE_DB_FILE, _PORT, _SQLITE_DB_URI
from ai_flow.workflow.job import BaseJob, BaseJobConfig
from ai_flow.workflow.job_config import PeriodicConfig
from ai_flow.workflow.job_context import JobContext
from ai_flow.workflow.workflow import Workflow
client: AIFlowClient = None
class TestScheduler(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
if os.path.exists(_SQLITE_DB_FILE):
os.remove(_SQLITE_DB_FILE)
cls.server = AIFlowServer(store_uri=_SQLITE_DB_URI, port=_PORT)
cls.sc_manager = cls.server.deploy_service.scheduler_manager
cls.server.run()
global client
client = AIFlowClient(server_uri='localhost:' + _PORT)
cls.ls_manager = cls.sc_manager.listener_manager
@classmethod
def tearDownClass(cls) -> None:
client.stop_listen_event()
store = SqlAlchemyStore(_SQLITE_DB_URI)
base.metadata.drop_all(store.db_engine)
os.remove(_SQLITE_DB_FILE)
def tearDown(self) -> None:
print('tearDown')
store = SqlAlchemyStore(_SQLITE_DB_URI)
base.metadata.drop_all(store.db_engine)
base.metadata.create_all(store.db_engine)
af.default_graph().clear_graph()
res = client.list_job(page_size=10, offset=0)
self.assertIsNone(res)
@staticmethod
def create_job(index, sleep_time=5) -> BaseJob:
job: BaseJob = LocalCMDJob(exec_cmd='echo "hello {}\n" && sleep {}'.format(str(index), str(sleep_time)))
job.job_context = JobContext()
job.job_context.workflow_execution_id = 1
job.instance_id = str(index) + "_job"
job.uuid = index
job.job_name = job.instance_id
return job
@staticmethod
def create_workflow() -> Workflow:
workflow = Workflow()
for i in range(3):
job = TestScheduler.create_job(i, 1)
workflow.add_job(job)
deps = []
deps.append(JobControlEdge(target_node_id='0_job', source_node_id='2_job',
met_config=MetConfig(event_key=generate_job_status_key('0_job'),
event_value=State.FINISHED.value)))
deps.append(JobControlEdge(target_node_id='1_job', source_node_id='2_job',
met_config=MetConfig(event_key=generate_job_status_key('1_job'),
event_value=State.FINISHED.value)))
workflow.add_edges("2_job", deps)
workflow.workflow_id = 1
return workflow
@staticmethod
def create_workflow_one_job() -> Workflow:
workflow = Workflow()
workflow.workflow_id = 1
job = TestScheduler.create_job(0, 1)
workflow.add_job(job)
return workflow
@staticmethod
def create_stream_workflow() -> Workflow:
workflow = Workflow()
for i in range(3):
job = TestScheduler.create_job(i, 5)
workflow.add_job(job)
deps = []
deps.append(JobControlEdge(target_node_id='0_job', source_node_id='2_job',
met_config=MetConfig(event_key=generate_job_status_key('0_job'),
event_value=State.FINISHED.value)))
deps.append(JobControlEdge(target_node_id='1_job', source_node_id='2_job',
met_config=MetConfig(event_key=generate_job_status_key('1_job'),
event_value=State.FINISHED.value)))
workflow.add_edges("2_job", deps)
workflow.workflow_id = 1
job = TestScheduler.create_job(3, 1)
workflow.add_job(job)
dep2 = []
dep2.append(JobControlEdge(target_node_id='0_job', source_node_id='3_job',
met_config=MetConfig(event_key='key1',
event_value='value1')))
workflow.add_edges('3_job', dep2)
return workflow
def test_stream_repeat_stream_job(self):
print(sys._getframe().f_code.co_name)
workflow = TestScheduler.create_stream_workflow()
TestScheduler.sc_manager.schedule_workflow(workflow=workflow)
client.publish_event(key='key1', value='value1')
client.publish_event(key='key1', value='value1')
TestScheduler.sc_manager.wait_finished(workflow.workflow_id)
res = TestScheduler.sc_manager.get_schedule_result(workflow_id=workflow.workflow_id)
self.assertEqual(0, res)
res = client.list_job(page_size=10, offset=0)
# self.assertEqual(5, len(res))
self.assertEqual(State.FINISHED, res[0].job_state)
def test_event_scheduler(self):
print(sys._getframe().f_code.co_name)
workflow = TestScheduler.create_workflow()
workflow.workflow_id = 1
event_scheduler = EventScheduler(client=client, listener_manager=TestScheduler.ls_manager, workflow=workflow)
res = event_scheduler.schedule()
self.assertEqual(0, res)
def test_event_scheduler_one_job(self):
print(sys._getframe().f_code.co_name)
workflow = TestScheduler.create_workflow_one_job()
workflow.workflow_id = 1
event_scheduler = EventScheduler(client=client, listener_manager=TestScheduler.ls_manager, workflow=workflow)
res = event_scheduler.schedule()
self.assertEqual(0, res)
@staticmethod
def create_periodic_job(index, sleep_time=1) -> BaseJob:
job: BaseJob = LocalCMDJob(exec_cmd='echo "hello {}\n" && sleep {}'.format(str(index), str(sleep_time)),
job_config=BaseJobConfig(platform="local", engine="cmd_line"))
job.uuid = index
job.job_name = job.instance_id
job.job_config.periodic_config = PeriodicConfig(periodic_type='interval', args={'seconds': 5})
job.instance_id = str(index) + "_job"
job.job_context = JobContext()
job.job_context.workflow_execution_id = 1
return job
@staticmethod
def create_periodic_workflow() -> Workflow:
workflow = Workflow()
for i in range(3):
job = TestScheduler.create_periodic_job(i, 1)
if 2 == i:
job.job_config.periodic_config = None
workflow.add_job(job)
deps = []
deps.append(JobControlEdge(target_node_id='0_job', source_node_id='2_job',
met_config=MetConfig(event_key=generate_job_status_key('0_job'),
event_value=State.FINISHED.value)))
deps.append(JobControlEdge(target_node_id='1_job', source_node_id='2_job',
met_config=MetConfig(event_key=generate_job_status_key('1_job'),
event_value=State.FINISHED.value)))
workflow.add_edges("2_job", deps)
workflow.workflow_id = 1
return workflow
def run_periodic_job(self):
print(sys._getframe().f_code.co_name)
workflow = TestScheduler.create_periodic_workflow()
TestScheduler.sc_manager.schedule_workflow(workflow=workflow)
time.sleep(13)
TestScheduler.sc_manager.stop_schedule_workflow(workflow_id=workflow.workflow_id)
res = client.list_job(page_size=10, offset=0)
self.assertGreater(len(res), 3)
self.assertEqual('2_job', res[2].job_id)
self.assertEqual('2_job', res[5].job_id)
def test_batch_periodic_job(self):
self.run_periodic_job()
@staticmethod
def create_restart_job_workflow() -> Workflow:
workflow = Workflow()
for i in range(2):
job = TestScheduler.create_periodic_job(i, 4)
workflow.add_job(job)
job = TestScheduler.create_periodic_job(2, 20)
job.job_config.periodic_config = None
workflow.add_job(job)
deps = []
deps.append(JobControlEdge(target_node_id='0_job', source_node_id='2_job',
met_config=MetConfig(event_key=generate_job_status_key('0_job'),
event_value=State.FINISHED.value,
action=TaskAction.RESTART)))
deps.append(JobControlEdge(target_node_id='1_job', source_node_id='2_job',
met_config=MetConfig(event_key=generate_job_status_key('1_job'),
event_value=State.FINISHED.value,
action=TaskAction.RESTART)))
workflow.add_edges("2_job", deps)
workflow.workflow_id = 1
return workflow
def test_restart_job(self):
print(sys._getframe().f_code.co_name)
workflow = TestScheduler.create_restart_job_workflow()
TestScheduler.sc_manager.schedule_workflow(workflow=workflow)
time.sleep(20)
TestScheduler.sc_manager.stop_schedule_workflow(workflow_id=workflow.workflow_id)
res = client.list_job(page_size=10, offset=0)
print(res)
self.assertGreater(len(res), 3)
def test_event_scheduler_manager(self):
print(sys._getframe().f_code.co_name)
workflow = TestScheduler.create_workflow()
TestScheduler.sc_manager.schedule_workflow(workflow=workflow)
TestScheduler.sc_manager.wait_finished(workflow.workflow_id)
res = TestScheduler.sc_manager.get_schedule_result(workflow_id=workflow.workflow_id)
self.assertEqual(0, res)
res = client.list_job(page_size=5, offset=0)
self.assertEqual(3, len(res))
self.assertEqual(State.FINISHED, res[0].job_state)
@staticmethod
def create_longrun_workflow() -> Workflow:
workflow = Workflow()
job_0 = TestScheduler.create_job(0, 10000)
workflow.add_job(job_0)
job_1 = TestScheduler.create_job(1, 1)
workflow.add_job(job_1)
deps = []
deps.append(JobControlEdge(target_node_id='1_job', source_node_id='0_job',
met_config=MetConfig(event_key='key_1',
event_value='value_1',
event_type='stop',
action=TaskAction.STOP)))
workflow.add_edges("0_job", deps)
workflow.workflow_id = 1
return workflow
def test_stop_job(self):
print(sys._getframe().f_code.co_name)
workflow = TestScheduler.create_longrun_workflow()
TestScheduler.sc_manager.schedule_workflow(workflow=workflow)
client.publish_event('key_1', 'value_1', 'stop')
TestScheduler.sc_manager.wait_finished(workflow.workflow_id)
res = TestScheduler.sc_manager.get_schedule_result(workflow_id=workflow.workflow_id)
self.assertEqual(0, res)
if __name__ == '__main__':
unittest.main()
|
[
1,
529,
276,
1112,
420,
29958,
7083,
3845,
29924,
29653,
29914,
1579,
682,
29899,
1794,
29899,
1062,
2760,
13,
29937,
13,
29937,
10413,
21144,
304,
278,
13380,
18540,
10606,
313,
3289,
29943,
29897,
1090,
697,
13,
29937,
470,
901,
17737,
3406,
19405,
8571,
4110,
29889,
29871,
2823,
278,
6058,
12107,
934,
13,
29937,
13235,
411,
445,
664,
363,
5684,
2472,
13,
29937,
11211,
3509,
1266,
27428,
29889,
29871,
450,
3339,
29943,
7794,
11259,
445,
934,
13,
29937,
304,
366,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
13,
29937,
376,
29931,
293,
1947,
1496,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
13,
29937,
411,
278,
19245,
29889,
29871,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
259,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
13,
29937,
7047,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
13,
29937,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
13,
29937,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
29871,
2823,
278,
19245,
363,
278,
13,
29937,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1090,
278,
19245,
29889,
13,
29937,
13,
5215,
2897,
13,
5215,
931,
13,
5215,
443,
27958,
13,
5215,
10876,
13,
3166,
7468,
29918,
1731,
29889,
5060,
29918,
29734,
29889,
5509,
29889,
4645,
29889,
29874,
361,
677,
29918,
4645,
1053,
319,
6545,
677,
4032,
13,
13,
5215,
7468,
29918,
1731,
408,
2511,
13,
3166,
7468,
29918,
1731,
29889,
16519,
261,
29889,
816,
14952,
1053,
6864,
4504,
14952,
13,
3166,
7468,
29918,
1731,
29889,
4262,
29889,
12864,
1053,
17163,
4809,
23894,
29892,
4737,
3991,
29892,
5706,
29918,
9057,
29918,
4882,
29918,
1989,
13,
3166,
7468,
29918,
1731,
29889,
4262,
29889,
12864,
1053,
9330,
4276,
13,
3166,
7468,
29918,
1731,
29889,
7299,
29889,
9057,
29918,
7299,
1053,
4306,
13,
3166,
7468,
29918,
1731,
29889,
12800,
29889,
2997,
29918,
9006,
29918,
9057,
29918,
8582,
1053,
9959,
29907,
5773,
11947,
13,
3166,
7468,
29918,
1731,
29889,
5060,
29918,
29734,
29889,
5509,
29889,
2974,
1053,
319,
6545,
677,
6004,
13,
3166,
7468,
29918,
1731,
29889,
8899,
29889,
2585,
29889,
3188,
29918,
4299,
1053,
2967,
13,
3166,
7468,
29918,
1731,
29889,
8899,
29889,
2850,
284,
305,
6764,
29918,
8899,
1053,
13093,
2499,
305,
6764,
9044,
13,
3166,
7468,
29918,
1731,
29889,
1688,
29889,
5060,
29918,
29734,
29889,
1688,
29918,
4645,
1053,
903,
4176,
9094,
29918,
4051,
29918,
7724,
29892,
903,
15082,
29892,
903,
4176,
9094,
29918,
4051,
29918,
15551,
13,
3166,
7468,
29918,
1731,
29889,
1287,
1731,
29889,
9057,
1053,
7399,
11947,
29892,
7399,
11947,
3991,
13,
3166,
7468,
29918,
1731,
29889,
1287,
1731,
29889,
9057,
29918,
2917,
1053,
29498,
293,
3991,
13,
3166,
7468,
29918,
1731,
29889,
1287,
1731,
29889,
9057,
29918,
4703,
1053,
17163,
2677,
13,
3166,
7468,
29918,
1731,
29889,
1287,
1731,
29889,
1287,
1731,
1053,
5244,
1731,
13,
13,
4645,
29901,
319,
6545,
677,
4032,
353,
6213,
13,
13,
13,
1990,
4321,
4504,
14952,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
731,
3373,
2385,
29898,
25932,
29897,
1599,
6213,
29901,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
7373,
4176,
9094,
29918,
4051,
29918,
7724,
1125,
13,
9651,
2897,
29889,
5992,
7373,
4176,
9094,
29918,
4051,
29918,
7724,
29897,
13,
4706,
1067,
29879,
29889,
2974,
353,
319,
6545,
677,
6004,
29898,
8899,
29918,
5338,
29922,
29918,
4176,
9094,
29918,
4051,
29918,
15551,
29892,
2011,
29922,
29918,
15082,
29897,
13,
4706,
1067,
29879,
29889,
1557,
29918,
12847,
353,
1067,
29879,
29889,
2974,
29889,
16519,
29918,
5509,
29889,
816,
14952,
29918,
12847,
13,
4706,
1067,
29879,
29889,
2974,
29889,
3389,
580,
13,
4706,
5534,
3132,
13,
4706,
3132,
353,
319,
6545,
677,
4032,
29898,
2974,
29918,
5338,
2433,
7640,
11283,
718,
903,
15082,
29897,
13,
4706,
1067,
29879,
29889,
3137,
29918,
12847,
353,
1067,
29879,
29889,
1557,
29918,
12847,
29889,
25894,
29918,
12847,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
734,
279,
6767,
2385,
29898,
25932,
29897,
1599,
6213,
29901,
13,
4706,
3132,
29889,
9847,
29918,
20631,
29918,
3696,
580,
13,
4706,
3787,
353,
13093,
2499,
305,
6764,
9044,
7373,
4176,
9094,
29918,
4051,
29918,
15551,
29897,
13,
4706,
2967,
29889,
19635,
29889,
8865,
29918,
497,
29898,
8899,
29889,
2585,
29918,
10599,
29897,
13,
4706,
2897,
29889,
5992,
7373,
4176,
9094,
29918,
4051,
29918,
7724,
29897,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1596,
877,
371,
279,
6767,
1495,
13,
4706,
3787,
353,
13093,
2499,
305,
6764,
9044,
7373,
4176,
9094,
29918,
4051,
29918,
15551,
29897,
13,
4706,
2967,
29889,
19635,
29889,
8865,
29918,
497,
29898,
8899,
29889,
2585,
29918,
10599,
29897,
13,
4706,
2967,
29889,
19635,
29889,
3258,
29918,
497,
29898,
8899,
29889,
2585,
29918,
10599,
29897,
13,
4706,
2511,
29889,
4381,
29918,
4262,
2141,
8551,
29918,
4262,
580,
13,
4706,
620,
353,
3132,
29889,
1761,
29918,
9057,
29898,
3488,
29918,
2311,
29922,
29896,
29900,
29892,
9210,
29922,
29900,
29897,
13,
4706,
1583,
29889,
9294,
3624,
8516,
29898,
690,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29918,
9057,
29898,
2248,
29892,
8709,
29918,
2230,
29922,
29945,
29897,
1599,
7399,
11947,
29901,
13,
4706,
4982,
29901,
7399,
11947,
353,
9959,
29907,
5773,
11947,
29898,
4258,
29918,
9006,
2433,
8057,
376,
12199,
426,
1012,
29876,
29908,
2607,
8709,
6571,
4286,
4830,
29898,
710,
29898,
2248,
511,
851,
29898,
17059,
29918,
2230,
4961,
13,
4706,
4982,
29889,
9057,
29918,
4703,
353,
17163,
2677,
580,
13,
4706,
4982,
29889,
9057,
29918,
4703,
29889,
1287,
1731,
29918,
22256,
29918,
333,
353,
29871,
29896,
13,
4706,
4982,
29889,
8758,
29918,
333,
353,
851,
29898,
2248,
29897,
718,
11119,
9057,
29908,
13,
4706,
4982,
29889,
25118,
353,
2380,
13,
4706,
4982,
29889,
9057,
29918,
978,
353,
4982,
29889,
8758,
29918,
333,
13,
4706,
736,
4982,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29918,
1287,
1731,
580,
1599,
5244,
1731,
29901,
13,
4706,
27321,
353,
5244,
1731,
580,
13,
4706,
363,
474,
297,
3464,
29898,
29941,
1125,
13,
9651,
4982,
353,
4321,
4504,
14952,
29889,
3258,
29918,
9057,
29898,
29875,
29892,
29871,
29896,
29897,
13,
9651,
27321,
29889,
1202,
29918,
9057,
29898,
9057,
29897,
13,
4706,
316,
567,
353,
5159,
13,
4706,
316,
567,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29900,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29906,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
29922,
17158,
29918,
9057,
29918,
4882,
29918,
1989,
877,
29900,
29918,
9057,
5477,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
29922,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29889,
1767,
4961,
13,
4706,
316,
567,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29896,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29906,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
29922,
17158,
29918,
9057,
29918,
4882,
29918,
1989,
877,
29896,
29918,
9057,
5477,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
29922,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29889,
1767,
4961,
13,
4706,
27321,
29889,
1202,
29918,
287,
2710,
703,
29906,
29918,
9057,
613,
316,
567,
29897,
13,
4706,
27321,
29889,
1287,
1731,
29918,
333,
353,
29871,
29896,
13,
4706,
736,
27321,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29918,
1287,
1731,
29918,
650,
29918,
9057,
580,
1599,
5244,
1731,
29901,
13,
4706,
27321,
353,
5244,
1731,
580,
13,
4706,
27321,
29889,
1287,
1731,
29918,
333,
353,
29871,
29896,
13,
4706,
4982,
353,
4321,
4504,
14952,
29889,
3258,
29918,
9057,
29898,
29900,
29892,
29871,
29896,
29897,
13,
4706,
27321,
29889,
1202,
29918,
9057,
29898,
9057,
29897,
13,
4706,
736,
27321,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29918,
5461,
29918,
1287,
1731,
580,
1599,
5244,
1731,
29901,
13,
4706,
27321,
353,
5244,
1731,
580,
13,
4706,
363,
474,
297,
3464,
29898,
29941,
1125,
13,
9651,
4982,
353,
4321,
4504,
14952,
29889,
3258,
29918,
9057,
29898,
29875,
29892,
29871,
29945,
29897,
13,
9651,
27321,
29889,
1202,
29918,
9057,
29898,
9057,
29897,
13,
4706,
316,
567,
353,
5159,
13,
4706,
316,
567,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29900,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29906,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
29922,
17158,
29918,
9057,
29918,
4882,
29918,
1989,
877,
29900,
29918,
9057,
5477,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
29922,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29889,
1767,
4961,
13,
4706,
316,
567,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29896,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29906,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
29922,
17158,
29918,
9057,
29918,
4882,
29918,
1989,
877,
29896,
29918,
9057,
5477,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
29922,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29889,
1767,
4961,
13,
4706,
27321,
29889,
1202,
29918,
287,
2710,
703,
29906,
29918,
9057,
613,
316,
567,
29897,
13,
4706,
27321,
29889,
1287,
1731,
29918,
333,
353,
29871,
29896,
13,
13,
4706,
4982,
353,
4321,
4504,
14952,
29889,
3258,
29918,
9057,
29898,
29941,
29892,
29871,
29896,
29897,
13,
4706,
27321,
29889,
1202,
29918,
9057,
29898,
9057,
29897,
13,
4706,
1401,
29906,
353,
5159,
13,
4706,
1401,
29906,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29900,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29941,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
2433,
1989,
29896,
742,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
2433,
1767,
29896,
29915,
4961,
13,
4706,
27321,
29889,
1202,
29918,
287,
2710,
877,
29941,
29918,
9057,
742,
1401,
29906,
29897,
13,
13,
4706,
736,
27321,
13,
13,
1678,
822,
1243,
29918,
5461,
29918,
14358,
29918,
5461,
29918,
9057,
29898,
1311,
1125,
13,
4706,
1596,
29898,
9675,
3032,
657,
2557,
2141,
29888,
29918,
401,
29889,
1111,
29918,
978,
29897,
13,
4706,
27321,
353,
4321,
4504,
14952,
29889,
3258,
29918,
5461,
29918,
1287,
1731,
580,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
816,
11272,
29918,
1287,
1731,
29898,
1287,
1731,
29922,
1287,
1731,
29897,
13,
4706,
3132,
29889,
23679,
29918,
3696,
29898,
1989,
2433,
1989,
29896,
742,
995,
2433,
1767,
29896,
1495,
13,
4706,
3132,
29889,
23679,
29918,
3696,
29898,
1989,
2433,
1989,
29896,
742,
995,
2433,
1767,
29896,
1495,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
10685,
29918,
4951,
3276,
29898,
1287,
1731,
29889,
1287,
1731,
29918,
333,
29897,
13,
4706,
620,
353,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
657,
29918,
816,
11272,
29918,
2914,
29898,
1287,
1731,
29918,
333,
29922,
1287,
1731,
29889,
1287,
1731,
29918,
333,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29900,
29892,
620,
29897,
13,
4706,
620,
353,
3132,
29889,
1761,
29918,
9057,
29898,
3488,
29918,
2311,
29922,
29896,
29900,
29892,
9210,
29922,
29900,
29897,
13,
4706,
396,
1583,
29889,
9294,
9843,
29898,
29945,
29892,
7431,
29898,
690,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29892,
620,
29961,
29900,
1822,
9057,
29918,
3859,
29897,
13,
13,
1678,
822,
1243,
29918,
3696,
29918,
816,
14952,
29898,
1311,
1125,
13,
4706,
1596,
29898,
9675,
3032,
657,
2557,
2141,
29888,
29918,
401,
29889,
1111,
29918,
978,
29897,
13,
4706,
27321,
353,
4321,
4504,
14952,
29889,
3258,
29918,
1287,
1731,
580,
13,
4706,
27321,
29889,
1287,
1731,
29918,
333,
353,
29871,
29896,
13,
4706,
1741,
29918,
816,
14952,
353,
6864,
4504,
14952,
29898,
4645,
29922,
4645,
29892,
13254,
29918,
12847,
29922,
3057,
4504,
14952,
29889,
3137,
29918,
12847,
29892,
27321,
29922,
1287,
1731,
29897,
13,
4706,
620,
353,
1741,
29918,
816,
14952,
29889,
816,
11272,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29900,
29892,
620,
29897,
13,
13,
1678,
822,
1243,
29918,
3696,
29918,
816,
14952,
29918,
650,
29918,
9057,
29898,
1311,
1125,
13,
4706,
1596,
29898,
9675,
3032,
657,
2557,
2141,
29888,
29918,
401,
29889,
1111,
29918,
978,
29897,
13,
4706,
27321,
353,
4321,
4504,
14952,
29889,
3258,
29918,
1287,
1731,
29918,
650,
29918,
9057,
580,
13,
4706,
27321,
29889,
1287,
1731,
29918,
333,
353,
29871,
29896,
13,
4706,
1741,
29918,
816,
14952,
353,
6864,
4504,
14952,
29898,
4645,
29922,
4645,
29892,
13254,
29918,
12847,
29922,
3057,
4504,
14952,
29889,
3137,
29918,
12847,
29892,
27321,
29922,
1287,
1731,
29897,
13,
4706,
620,
353,
1741,
29918,
816,
14952,
29889,
816,
11272,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29900,
29892,
620,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29918,
19145,
293,
29918,
9057,
29898,
2248,
29892,
8709,
29918,
2230,
29922,
29896,
29897,
1599,
7399,
11947,
29901,
13,
4706,
4982,
29901,
7399,
11947,
353,
9959,
29907,
5773,
11947,
29898,
4258,
29918,
9006,
2433,
8057,
376,
12199,
426,
1012,
29876,
29908,
2607,
8709,
6571,
4286,
4830,
29898,
710,
29898,
2248,
511,
851,
29898,
17059,
29918,
2230,
8243,
13,
462,
462,
259,
4982,
29918,
2917,
29922,
5160,
11947,
3991,
29898,
12120,
543,
2997,
613,
6012,
543,
9006,
29918,
1220,
5783,
13,
4706,
4982,
29889,
25118,
353,
2380,
13,
4706,
4982,
29889,
9057,
29918,
978,
353,
4982,
29889,
8758,
29918,
333,
13,
4706,
4982,
29889,
9057,
29918,
2917,
29889,
19145,
293,
29918,
2917,
353,
29498,
293,
3991,
29898,
19145,
293,
29918,
1853,
2433,
19207,
742,
6389,
3790,
29915,
23128,
2396,
29871,
29945,
1800,
13,
4706,
4982,
29889,
8758,
29918,
333,
353,
851,
29898,
2248,
29897,
718,
11119,
9057,
29908,
13,
4706,
4982,
29889,
9057,
29918,
4703,
353,
17163,
2677,
580,
13,
4706,
4982,
29889,
9057,
29918,
4703,
29889,
1287,
1731,
29918,
22256,
29918,
333,
353,
29871,
29896,
13,
4706,
736,
4982,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29918,
19145,
293,
29918,
1287,
1731,
580,
1599,
5244,
1731,
29901,
13,
4706,
27321,
353,
5244,
1731,
580,
13,
4706,
363,
474,
297,
3464,
29898,
29941,
1125,
13,
9651,
4982,
353,
4321,
4504,
14952,
29889,
3258,
29918,
19145,
293,
29918,
9057,
29898,
29875,
29892,
29871,
29896,
29897,
13,
9651,
565,
29871,
29906,
1275,
474,
29901,
13,
18884,
4982,
29889,
9057,
29918,
2917,
29889,
19145,
293,
29918,
2917,
353,
6213,
13,
9651,
27321,
29889,
1202,
29918,
9057,
29898,
9057,
29897,
13,
4706,
316,
567,
353,
5159,
13,
4706,
316,
567,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29900,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29906,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
29922,
17158,
29918,
9057,
29918,
4882,
29918,
1989,
877,
29900,
29918,
9057,
5477,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
29922,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29889,
1767,
4961,
13,
4706,
316,
567,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29896,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29906,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
29922,
17158,
29918,
9057,
29918,
4882,
29918,
1989,
877,
29896,
29918,
9057,
5477,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
29922,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29889,
1767,
4961,
13,
4706,
27321,
29889,
1202,
29918,
287,
2710,
703,
29906,
29918,
9057,
613,
316,
567,
29897,
13,
4706,
27321,
29889,
1287,
1731,
29918,
333,
353,
29871,
29896,
13,
4706,
736,
27321,
13,
13,
1678,
822,
1065,
29918,
19145,
293,
29918,
9057,
29898,
1311,
1125,
13,
4706,
1596,
29898,
9675,
3032,
657,
2557,
2141,
29888,
29918,
401,
29889,
1111,
29918,
978,
29897,
13,
4706,
27321,
353,
4321,
4504,
14952,
29889,
3258,
29918,
19145,
293,
29918,
1287,
1731,
580,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
816,
11272,
29918,
1287,
1731,
29898,
1287,
1731,
29922,
1287,
1731,
29897,
13,
4706,
931,
29889,
17059,
29898,
29896,
29941,
29897,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
9847,
29918,
816,
11272,
29918,
1287,
1731,
29898,
1287,
1731,
29918,
333,
29922,
1287,
1731,
29889,
1287,
1731,
29918,
333,
29897,
13,
4706,
620,
353,
3132,
29889,
1761,
29918,
9057,
29898,
3488,
29918,
2311,
29922,
29896,
29900,
29892,
9210,
29922,
29900,
29897,
13,
4706,
1583,
29889,
9294,
25120,
1008,
29898,
2435,
29898,
690,
511,
29871,
29941,
29897,
13,
4706,
1583,
29889,
9294,
9843,
877,
29906,
29918,
9057,
742,
620,
29961,
29906,
1822,
9057,
29918,
333,
29897,
13,
4706,
1583,
29889,
9294,
9843,
877,
29906,
29918,
9057,
742,
620,
29961,
29945,
1822,
9057,
29918,
333,
29897,
13,
13,
1678,
822,
1243,
29918,
16175,
29918,
19145,
293,
29918,
9057,
29898,
1311,
1125,
13,
4706,
1583,
29889,
3389,
29918,
19145,
293,
29918,
9057,
580,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29918,
5060,
442,
29918,
9057,
29918,
1287,
1731,
580,
1599,
5244,
1731,
29901,
13,
4706,
27321,
353,
5244,
1731,
580,
13,
4706,
363,
474,
297,
3464,
29898,
29906,
1125,
13,
9651,
4982,
353,
4321,
4504,
14952,
29889,
3258,
29918,
19145,
293,
29918,
9057,
29898,
29875,
29892,
29871,
29946,
29897,
13,
9651,
27321,
29889,
1202,
29918,
9057,
29898,
9057,
29897,
13,
13,
4706,
4982,
353,
4321,
4504,
14952,
29889,
3258,
29918,
19145,
293,
29918,
9057,
29898,
29906,
29892,
29871,
29906,
29900,
29897,
13,
4706,
4982,
29889,
9057,
29918,
2917,
29889,
19145,
293,
29918,
2917,
353,
6213,
13,
4706,
27321,
29889,
1202,
29918,
9057,
29898,
9057,
29897,
13,
4706,
316,
567,
353,
5159,
13,
4706,
316,
567,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29900,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29906,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
29922,
17158,
29918,
9057,
29918,
4882,
29918,
1989,
877,
29900,
29918,
9057,
5477,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
29922,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29889,
1767,
29892,
13,
462,
462,
462,
4706,
3158,
29922,
5398,
4276,
29889,
1525,
25826,
4961,
13,
4706,
316,
567,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29896,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29906,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
29922,
17158,
29918,
9057,
29918,
4882,
29918,
1989,
877,
29896,
29918,
9057,
5477,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
29922,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29889,
1767,
29892,
13,
462,
462,
462,
4706,
3158,
29922,
5398,
4276,
29889,
1525,
25826,
4961,
13,
4706,
27321,
29889,
1202,
29918,
287,
2710,
703,
29906,
29918,
9057,
613,
316,
567,
29897,
13,
4706,
27321,
29889,
1287,
1731,
29918,
333,
353,
29871,
29896,
13,
4706,
736,
27321,
13,
13,
1678,
822,
1243,
29918,
5060,
442,
29918,
9057,
29898,
1311,
1125,
13,
4706,
1596,
29898,
9675,
3032,
657,
2557,
2141,
29888,
29918,
401,
29889,
1111,
29918,
978,
29897,
13,
4706,
27321,
353,
4321,
4504,
14952,
29889,
3258,
29918,
5060,
442,
29918,
9057,
29918,
1287,
1731,
580,
13,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
816,
11272,
29918,
1287,
1731,
29898,
1287,
1731,
29922,
1287,
1731,
29897,
13,
4706,
931,
29889,
17059,
29898,
29906,
29900,
29897,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
9847,
29918,
816,
11272,
29918,
1287,
1731,
29898,
1287,
1731,
29918,
333,
29922,
1287,
1731,
29889,
1287,
1731,
29918,
333,
29897,
13,
4706,
620,
353,
3132,
29889,
1761,
29918,
9057,
29898,
3488,
29918,
2311,
29922,
29896,
29900,
29892,
9210,
29922,
29900,
29897,
13,
4706,
1596,
29898,
690,
29897,
13,
4706,
1583,
29889,
9294,
25120,
1008,
29898,
2435,
29898,
690,
511,
29871,
29941,
29897,
13,
13,
1678,
822,
1243,
29918,
3696,
29918,
816,
14952,
29918,
12847,
29898,
1311,
1125,
13,
4706,
1596,
29898,
9675,
3032,
657,
2557,
2141,
29888,
29918,
401,
29889,
1111,
29918,
978,
29897,
13,
4706,
27321,
353,
4321,
4504,
14952,
29889,
3258,
29918,
1287,
1731,
580,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
816,
11272,
29918,
1287,
1731,
29898,
1287,
1731,
29922,
1287,
1731,
29897,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
10685,
29918,
4951,
3276,
29898,
1287,
1731,
29889,
1287,
1731,
29918,
333,
29897,
13,
4706,
620,
353,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
657,
29918,
816,
11272,
29918,
2914,
29898,
1287,
1731,
29918,
333,
29922,
1287,
1731,
29889,
1287,
1731,
29918,
333,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29900,
29892,
620,
29897,
13,
4706,
620,
353,
3132,
29889,
1761,
29918,
9057,
29898,
3488,
29918,
2311,
29922,
29945,
29892,
9210,
29922,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29941,
29892,
7431,
29898,
690,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2792,
29889,
29943,
1177,
3235,
29950,
3352,
29892,
620,
29961,
29900,
1822,
9057,
29918,
3859,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29918,
5426,
3389,
29918,
1287,
1731,
580,
1599,
5244,
1731,
29901,
13,
4706,
27321,
353,
5244,
1731,
580,
13,
4706,
4982,
29918,
29900,
353,
4321,
4504,
14952,
29889,
3258,
29918,
9057,
29898,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
29900,
29897,
13,
4706,
27321,
29889,
1202,
29918,
9057,
29898,
9057,
29918,
29900,
29897,
13,
4706,
4982,
29918,
29896,
353,
4321,
4504,
14952,
29889,
3258,
29918,
9057,
29898,
29896,
29892,
29871,
29896,
29897,
13,
4706,
27321,
29889,
1202,
29918,
9057,
29898,
9057,
29918,
29896,
29897,
13,
4706,
316,
567,
353,
5159,
13,
4706,
316,
567,
29889,
4397,
29898,
11947,
4809,
23894,
29898,
5182,
29918,
3177,
29918,
333,
2433,
29896,
29918,
9057,
742,
2752,
29918,
3177,
29918,
333,
2433,
29900,
29918,
9057,
742,
13,
462,
462,
259,
1539,
29918,
2917,
29922,
10095,
3991,
29898,
3696,
29918,
1989,
2433,
1989,
29918,
29896,
742,
13,
462,
462,
462,
4706,
1741,
29918,
1767,
2433,
1767,
29918,
29896,
742,
13,
462,
462,
462,
4706,
1741,
29918,
1853,
2433,
9847,
742,
13,
462,
462,
462,
4706,
3158,
29922,
5398,
4276,
29889,
1254,
4590,
4961,
13,
13,
4706,
27321,
29889,
1202,
29918,
287,
2710,
703,
29900,
29918,
9057,
613,
316,
567,
29897,
13,
4706,
27321,
29889,
1287,
1731,
29918,
333,
353,
29871,
29896,
13,
4706,
736,
27321,
13,
13,
1678,
822,
1243,
29918,
9847,
29918,
9057,
29898,
1311,
1125,
13,
4706,
1596,
29898,
9675,
3032,
657,
2557,
2141,
29888,
29918,
401,
29889,
1111,
29918,
978,
29897,
13,
4706,
27321,
353,
4321,
4504,
14952,
29889,
3258,
29918,
5426,
3389,
29918,
1287,
1731,
580,
13,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
816,
11272,
29918,
1287,
1731,
29898,
1287,
1731,
29922,
1287,
1731,
29897,
13,
4706,
3132,
29889,
23679,
29918,
3696,
877,
1989,
29918,
29896,
742,
525,
1767,
29918,
29896,
742,
525,
9847,
1495,
13,
4706,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
10685,
29918,
4951,
3276,
29898,
1287,
1731,
29889,
1287,
1731,
29918,
333,
29897,
13,
4706,
620,
353,
4321,
4504,
14952,
29889,
1557,
29918,
12847,
29889,
657,
29918,
816,
11272,
29918,
2914,
29898,
1287,
1731,
29918,
333,
29922,
1287,
1731,
29889,
1287,
1731,
29918,
333,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29900,
29892,
620,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
src/ostorlab/agent/message/proto/v3/asset/ip/v4/geolocation/geolocation_pb2.py
|
bbhunter/ostorlab
| 113 |
49896
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: v3/asset/ip/v4/geolocation/geolocation.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='v3/asset/ip/v4/geolocation/geolocation.proto',
package='v3.asset.ip.v4.geolocation',
syntax='proto2',
serialized_options=None,
serialized_pb=_b('\n,v3/asset/ip/v4/geolocation/geolocation.proto\x12\x1av3.asset.ip.v4.geolocation\"\x94\x02\n\x07Message\x12\x0c\n\x04host\x18\x01 \x02(\t\x12\x0c\n\x04mask\x18\x02 \x01(\t\x12\x12\n\x07version\x18\x03 \x02(\x05:\x01\x34\x12\x11\n\tcontinent\x18\x05 \x01(\t\x12\x16\n\x0e\x63ontinent_code\x18\x06 \x01(\t\x12\x0f\n\x07\x63ountry\x18\x07 \x01(\t\x12\x14\n\x0c\x63ountry_code\x18\x08 \x01(\t\x12\x0e\n\x06region\x18\t \x01(\t\x12\x13\n\x0bregion_name\x18\n \x01(\t\x12\x0c\n\x04\x63ity\x18\x0b \x01(\t\x12\x0b\n\x03zip\x18\x0c \x01(\t\x12\x10\n\x08latitude\x18\r \x01(\x02\x12\x11\n\tlongitude\x18\x0e \x01(\x02\x12\x10\n\x08timezone\x18\x0f \x01(\t\x12\x10\n\x08\x64istrict\x18\x10 \x01(\t')
)
_MESSAGE = _descriptor.Descriptor(
name='Message',
full_name='v3.asset.ip.v4.geolocation.Message',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='host', full_name='v3.asset.ip.v4.geolocation.Message.host', index=0,
number=1, type=9, cpp_type=9, label=2,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='mask', full_name='v3.asset.ip.v4.geolocation.Message.mask', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='version', full_name='v3.asset.ip.v4.geolocation.Message.version', index=2,
number=3, type=5, cpp_type=1, label=2,
has_default_value=True, default_value=4,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='continent', full_name='v3.asset.ip.v4.geolocation.Message.continent', index=3,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='continent_code', full_name='v3.asset.ip.v4.geolocation.Message.continent_code', index=4,
number=6, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='country', full_name='v3.asset.ip.v4.geolocation.Message.country', index=5,
number=7, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='country_code', full_name='v3.asset.ip.v4.geolocation.Message.country_code', index=6,
number=8, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='region', full_name='v3.asset.ip.v4.geolocation.Message.region', index=7,
number=9, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='region_name', full_name='v3.asset.ip.v4.geolocation.Message.region_name', index=8,
number=10, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='city', full_name='v3.asset.ip.v4.geolocation.Message.city', index=9,
number=11, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='zip', full_name='v3.asset.ip.v4.geolocation.Message.zip', index=10,
number=12, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='latitude', full_name='v3.asset.ip.v4.geolocation.Message.latitude', index=11,
number=13, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='longitude', full_name='v3.asset.ip.v4.geolocation.Message.longitude', index=12,
number=14, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='timezone', full_name='v3.asset.ip.v4.geolocation.Message.timezone', index=13,
number=15, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='district', full_name='v3.asset.ip.v4.geolocation.Message.district', index=14,
number=16, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=77,
serialized_end=353,
)
DESCRIPTOR.message_types_by_name['Message'] = _MESSAGE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Message = _reflection.GeneratedProtocolMessageType('Message', (_message.Message,), dict(
DESCRIPTOR = _MESSAGE,
__module__ = 'v3.asset.ip.v4.geolocation.geolocation_pb2'
# @@protoc_insertion_point(class_scope:v3.asset.ip.v4.geolocation.Message)
))
_sym_db.RegisterMessage(Message)
# @@protoc_insertion_point(module_scope)
|
[
1,
396,
3251,
630,
491,
278,
9608,
6835,
6516,
29889,
29871,
11662,
6058,
11488,
29991,
13,
29937,
2752,
29901,
325,
29941,
29914,
24129,
29914,
666,
29914,
29894,
29946,
29914,
479,
324,
10610,
29914,
479,
324,
10610,
29889,
17529,
13,
13,
5215,
10876,
13,
29918,
29890,
29922,
9675,
29889,
3259,
29918,
3888,
29961,
29900,
29962,
29966,
29941,
322,
313,
2892,
921,
29901,
29916,
29897,
470,
313,
2892,
921,
29901,
29916,
29889,
12508,
877,
5066,
262,
29896,
8785,
13,
3166,
5386,
29889,
17529,
9721,
1053,
553,
11709,
408,
903,
2783,
11709,
13,
3166,
5386,
29889,
17529,
9721,
1053,
2643,
408,
903,
4906,
13,
3166,
5386,
29889,
17529,
9721,
1053,
17842,
408,
903,
999,
1464,
13,
3166,
5386,
29889,
17529,
9721,
1053,
5829,
29918,
9803,
408,
903,
18098,
29918,
9803,
13,
29937,
732,
29992,
17529,
29883,
29918,
7851,
291,
29918,
3149,
29898,
326,
4011,
29897,
13,
13,
29918,
11967,
29918,
2585,
353,
903,
18098,
29918,
9803,
29889,
4592,
580,
13,
13,
13,
13,
13,
2287,
7187,
24290,
1955,
353,
903,
2783,
11709,
29889,
2283,
19124,
29898,
13,
29871,
1024,
2433,
29894,
29941,
29914,
24129,
29914,
666,
29914,
29894,
29946,
29914,
479,
324,
10610,
29914,
479,
324,
10610,
29889,
17529,
742,
13,
29871,
3577,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
742,
13,
29871,
5877,
2433,
17529,
29906,
742,
13,
29871,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
13,
29871,
7797,
1891,
29918,
24381,
29922,
29918,
29890,
28909,
29876,
29892,
29894,
29941,
29914,
24129,
29914,
666,
29914,
29894,
29946,
29914,
479,
324,
10610,
29914,
479,
324,
10610,
29889,
17529,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
485,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
5931,
29905,
29916,
29929,
29946,
29905,
29916,
29900,
29906,
29905,
29876,
29905,
29916,
29900,
29955,
3728,
29905,
29916,
29896,
29906,
29905,
29916,
29900,
29883,
29905,
29876,
29905,
29916,
29900,
29946,
3069,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29896,
320,
29916,
29900,
29906,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29900,
29883,
29905,
29876,
29905,
29916,
29900,
29946,
13168,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29906,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
29906,
29905,
29876,
29905,
29916,
29900,
29955,
3259,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29941,
320,
29916,
29900,
29906,
1194,
29916,
29900,
29945,
3583,
29916,
29900,
29896,
29905,
29916,
29941,
29946,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
29896,
29905,
29876,
29905,
29873,
1285,
8946,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29945,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
29953,
29905,
29876,
29905,
29916,
29900,
29872,
29905,
29916,
29953,
29941,
609,
8946,
29918,
401,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29953,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29900,
29888,
29905,
29876,
29905,
29916,
29900,
29955,
29905,
29916,
29953,
29941,
9729,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29955,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
29946,
29905,
29876,
29905,
29916,
29900,
29883,
29905,
29916,
29953,
29941,
9729,
29918,
401,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29947,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29900,
29872,
29905,
29876,
29905,
29916,
29900,
29953,
12803,
29905,
29916,
29896,
29947,
29905,
29873,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
29941,
29905,
29876,
29905,
29916,
29900,
1030,
29887,
291,
29918,
978,
29905,
29916,
29896,
29947,
29905,
29876,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29900,
29883,
29905,
29876,
29905,
29916,
29900,
29946,
29905,
29916,
29953,
29941,
537,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29890,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29900,
29890,
29905,
29876,
29905,
29916,
29900,
29941,
7554,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29883,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
29900,
29905,
29876,
29905,
29916,
29900,
29947,
5066,
4279,
29905,
29916,
29896,
29947,
29905,
29878,
320,
29916,
29900,
29896,
1194,
29916,
29900,
29906,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
29896,
29905,
29876,
29905,
29873,
5426,
4279,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29872,
320,
29916,
29900,
29896,
1194,
29916,
29900,
29906,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
29900,
29905,
29876,
29905,
29916,
29900,
29947,
2230,
8028,
29905,
29916,
29896,
29947,
29905,
29916,
29900,
29888,
320,
29916,
29900,
29896,
1194,
29873,
29905,
29916,
29896,
29906,
29905,
29916,
29896,
29900,
29905,
29876,
29905,
29916,
29900,
29947,
29905,
29916,
29953,
29946,
6801,
29905,
29916,
29896,
29947,
29905,
29916,
29896,
29900,
320,
29916,
29900,
29896,
1194,
29873,
1495,
13,
29897,
13,
13,
13,
13,
13,
29918,
2303,
1799,
10461,
353,
903,
2783,
11709,
29889,
19124,
29898,
13,
29871,
1024,
2433,
3728,
742,
13,
29871,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
742,
13,
29871,
10422,
29922,
8516,
29892,
13,
29871,
934,
29922,
2287,
7187,
24290,
1955,
29892,
13,
29871,
6943,
29918,
1853,
29922,
8516,
29892,
13,
29871,
4235,
11759,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
3069,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
3069,
742,
2380,
29922,
29900,
29892,
13,
418,
1353,
29922,
29896,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29906,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
13168,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
13168,
742,
2380,
29922,
29896,
29892,
13,
418,
1353,
29922,
29906,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
3259,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
3259,
742,
2380,
29922,
29906,
29892,
13,
418,
1353,
29922,
29941,
29892,
1134,
29922,
29945,
29892,
274,
407,
29918,
1853,
29922,
29896,
29892,
3858,
29922,
29906,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
5574,
29892,
2322,
29918,
1767,
29922,
29946,
29892,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
1285,
8946,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
1285,
8946,
742,
2380,
29922,
29941,
29892,
13,
418,
1353,
29922,
29945,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
1285,
8946,
29918,
401,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
1285,
8946,
29918,
401,
742,
2380,
29922,
29946,
29892,
13,
418,
1353,
29922,
29953,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
13509,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
13509,
742,
2380,
29922,
29945,
29892,
13,
418,
1353,
29922,
29955,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
13509,
29918,
401,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
13509,
29918,
401,
742,
2380,
29922,
29953,
29892,
13,
418,
1353,
29922,
29947,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
12803,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
12803,
742,
2380,
29922,
29955,
29892,
13,
418,
1353,
29922,
29929,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
12803,
29918,
978,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
12803,
29918,
978,
742,
2380,
29922,
29947,
29892,
13,
418,
1353,
29922,
29896,
29900,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
12690,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
12690,
742,
2380,
29922,
29929,
29892,
13,
418,
1353,
29922,
29896,
29896,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
7554,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
7554,
742,
2380,
29922,
29896,
29900,
29892,
13,
418,
1353,
29922,
29896,
29906,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
5066,
4279,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
5066,
4279,
742,
2380,
29922,
29896,
29896,
29892,
13,
418,
1353,
29922,
29896,
29941,
29892,
1134,
29922,
29906,
29892,
274,
407,
29918,
1853,
29922,
29953,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
7411,
29898,
29900,
511,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
5426,
4279,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
5426,
4279,
742,
2380,
29922,
29896,
29906,
29892,
13,
418,
1353,
29922,
29896,
29946,
29892,
1134,
29922,
29906,
29892,
274,
407,
29918,
1853,
29922,
29953,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
7411,
29898,
29900,
511,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
2230,
8028,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
2230,
8028,
742,
2380,
29922,
29896,
29941,
29892,
13,
418,
1353,
29922,
29896,
29945,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
1678,
903,
2783,
11709,
29889,
3073,
19124,
29898,
13,
418,
1024,
2433,
29881,
6801,
742,
2989,
29918,
978,
2433,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29889,
29881,
6801,
742,
2380,
29922,
29896,
29946,
29892,
13,
418,
1353,
29922,
29896,
29953,
29892,
1134,
29922,
29929,
29892,
274,
407,
29918,
1853,
29922,
29929,
29892,
3858,
29922,
29896,
29892,
13,
418,
756,
29918,
4381,
29918,
1767,
29922,
8824,
29892,
2322,
29918,
1767,
29922,
29918,
29890,
703,
2564,
13808,
877,
9420,
29899,
29947,
5477,
13,
418,
2643,
29918,
1853,
29922,
8516,
29892,
14115,
29918,
1853,
29922,
8516,
29892,
6943,
29918,
1853,
29922,
8516,
29892,
13,
418,
338,
29918,
17588,
29922,
8824,
29892,
6081,
29918,
6078,
29922,
8516,
29892,
13,
418,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
934,
29922,
2287,
7187,
24290,
1955,
511,
13,
29871,
21251,
13,
29871,
17752,
11759,
13,
29871,
21251,
13,
29871,
9322,
29918,
8768,
11759,
1402,
13,
29871,
14115,
29918,
8768,
11759,
13,
29871,
21251,
13,
29871,
7797,
1891,
29918,
6768,
29922,
8516,
29892,
13,
29871,
338,
29918,
21843,
519,
29922,
8824,
29892,
13,
29871,
5877,
2433,
17529,
29906,
742,
13,
29871,
6081,
29918,
29878,
6916,
11759,
1402,
13,
29871,
697,
974,
29879,
11759,
13,
29871,
21251,
13,
29871,
7797,
1891,
29918,
2962,
29922,
29955,
29955,
29892,
13,
29871,
7797,
1891,
29918,
355,
29922,
29941,
29945,
29941,
29892,
13,
29897,
13,
13,
2287,
7187,
24290,
1955,
29889,
4906,
29918,
8768,
29918,
1609,
29918,
978,
1839,
3728,
2033,
353,
903,
2303,
1799,
10461,
13,
29918,
11967,
29918,
2585,
29889,
15213,
2283,
19124,
29898,
2287,
7187,
24290,
1955,
29897,
13,
13,
3728,
353,
903,
999,
1464,
29889,
24565,
17830,
3728,
1542,
877,
3728,
742,
9423,
4906,
29889,
3728,
29892,
511,
9657,
29898,
13,
29871,
23050,
24290,
1955,
353,
903,
2303,
1799,
10461,
29892,
13,
29871,
4770,
5453,
1649,
353,
525,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
479,
324,
10610,
29918,
24381,
29906,
29915,
13,
29871,
396,
732,
29992,
17529,
29883,
29918,
7851,
291,
29918,
3149,
29898,
1990,
29918,
6078,
29901,
29894,
29941,
29889,
24129,
29889,
666,
29889,
29894,
29946,
29889,
479,
324,
10610,
29889,
3728,
29897,
13,
259,
876,
13,
29918,
11967,
29918,
2585,
29889,
15213,
3728,
29898,
3728,
29897,
13,
13,
13,
29937,
732,
29992,
17529,
29883,
29918,
7851,
291,
29918,
3149,
29898,
5453,
29918,
6078,
29897,
13,
2
] |
processors/util/blockchain_state.py
|
Zvezdin/blockchain-predictor
| 35 |
1615568
|
import math
from time import time as now
from collections import deque
#from sorted_value_dict import SortedValueDict
SortedValueDict=dict #temp debug
from processors.properties.property import Property
class BlockchainState(Property):
def __init__(self):
super().__init__()
self.requires = ['trace']#, 'tx', 'log']
self.requiresHistoricalData = True
self.returnsData = False
self._init_state()
self._clear_state()
def _init_state(self):
self.recentLengthDays = 3
self.recentLength = self.recentLengthDays*86400 # 3 days in seconds
self.topXFraction = 0.000005
self.topUsedFraction = 0.000005
self.initialSupply = 72_000_000 * 1000000000000000000 #72M ETH in wei. The ETH created at genesis
#total ETH in existence
#we start at genesis and add every reward to the total supply
self.totalETH = self.initialSupply
#total amount of times where an account has been the initiator or receiver of an action
self.totalTimesUsed = 0
#contract lookup
self.isContract = {}
#balance lookup
self.balances = {}
#amount of transactions this acc participates in
self.timesUsed = {}
#total accs
self.totalAccountsAmount = 0
#recently active/created accounts.
#We push to the front the most recent accounts and pop from the back the older ones
#self.recentlyActive = deque()
#self.isRecentlyActive = {}
self.recentlyCreated = deque()
self.isRecentlyCreated = {}
#dicts to hold account timestamps. Used when calculating recently active/created
self.dateCreated = {}
#self.dateActive = {}
#in order ETHRecentlyExchanged to be calculated, we'll keep a list of the past x hours, each element being
#the amount of ETH exchanged within that hour. Then our variable will be the sum of that list
self.ETHRecentlyExchangedList = [0] * self.recentLengthDays
#clears everything that has to be cleared for every processTick call
def _clear_state(self):
#TOP IN BALANCE/USED GLOBAL/LOCAL CONTRACTS/ACCOUNTS LIST/MAP
#IS TOP X FROM THE ACTIVE ACCOUNTS
#THIS IS THE ONLY WAY
#top x% lookup (list & map)
self.isTopX = {}
self.topX = []
#for contracts
self.isContractTopX = {}
self.contractTopX = []
#local top X lookup
self.isLocalTopX = {}
self.localTopX = []
#for contracts
self.isContractLocalTopX = {}
self.contractLocalTopX = []
#top x% in usage (list & map)
self.isTopUsed = {}
self.topUsed = []
#for contracts
self.isContractTopUsed = {}
self.contractTopUsed = []
#local top X in usage lookup
self.isLocalTopUsed = {}
self.localTopUsed = []
#for contracts
self.isContractLocalTopUsed = {}
self.contractLocalTopUsed = []
#local structures to achieve local top scores
self.localBalances = SortedValueDict()
self.localTotalETH = 0
self.localTimesUsed = SortedValueDict()
self.localTotalTimesUsed = 0
#list of local accounts
self.isLocalAccount = {}
self.localAccounts = []
#list/map of local new accounts/contracts
self.isAccountNew = {}
self.newAccounts = []
self.isContractNew = {}
self.newContracts = []
#address -> list of transactions/traces/logs
self.localTransactionsOf = {}
self.localTracesOf = {}
self.localLogsOf = {}
# tx hash -> true/undefined whether this transaction exists
self.isTransaction = {}
#block N -> bool
self.isBlock = {}
#address -> gas used total in this period
self.gasUsedBy = {}
#address -> amount and list of sent/received in this period
self.amountSentBy = {}
self.senders = []
self.amountReceivedBy = {}
self.receivers = []
#active accs
self.localAccountsAmount = 0
#amount of ETH that has been recently exchanged
self.ETHRecentlyExchanged = 0
#time of last block
self.lastTimestamp = 0
#TODO: Avg bal of just created accs (avg value of first tx to acc?)
#TODO: when working with ETH, also have a USD version of the same property
def processTick(self, data):
t = now()
self._clear_state()
print("Clear state took %4fs" % (now() - t))
ethExchanged = 0
fromI = data['trace'].columns.get_loc('from')+1
if 'trace' in data:
t = now()
for trace in data['trace'].itertuples():
sender = getattr(trace, '_'+str(fromI))
receiver = trace.to
sender = self.noneIfInf(sender)
receiver = self.noneIfInf(receiver)
value = int(trace.value, 0)
gasUsed = self.noneIfInf(trace.gasUsed)
if gasUsed is not None:
gasUsed = int(trace.gasUsed, 0)
timestamp = trace.Index.value // 10**9 #EPOCH time
ethExchanged += value
self.isTransaction[trace.transactionHash] = True
self.isBlock[trace.blockNumber] = True
if gasUsed is not None:
self.gasUsedBy[sender] = self.gasUsedBy.get(sender, 0) + gasUsed
if trace.type == 'create':
assert(receiver not in self.isContract)
self.isContract[receiver] = True
self.isContractNew[receiver] = True
self.newContracts.append(receiver)
elif trace.type == 'reward':
#rewards can be either block or uncle, each of which is increasing the total supply of Ethereum
self.totalETH += value
for acc in [sender, receiver]:
if acc is None:
continue
if acc not in self.balances:
self.totalAccountsAmount += 1
self.dateCreated[acc] = timestamp
self.recentlyCreated.appendleft(acc)
self.balances[acc] = 0
self.timesUsed[acc] = 0
self.isAccountNew[acc] = True
self.newAccounts.append(acc)
if acc == sender:
currBal = self.balances[acc]
self.balances[acc] = 0 if currBal < value else currBal - value
#this case is possible because we don't have the genesis transfers
#TODO: Get the genesis transfers from Etherscan's API or make a web scrape
self.localTracesOf.setdefault(acc, [])
self.localTracesOf[acc].append(trace)
if acc not in self.amountSentBy:
self.amountSentBy[acc] = 0
self.senders.append(acc)
self.amountSentBy[acc] += value
if acc == receiver:
self.balances[receiver] += value
if acc not in self.amountReceivedBy:
self.amountReceivedBy[acc] = 0
self.receivers.append(acc)
self.amountReceivedBy[acc] += value
#update local accounts
if acc not in self.isLocalAccount:
self.isLocalAccount[acc] = True
self.localAccounts.append(acc)
#update usage info
self.totalTimesUsed += 1
self.timesUsed[acc] += 1
self.localTimesUsed.setdefault(acc, 0)
self.localTimesUsed[acc] += 1
#update active times
#lastActive = self.dateActive.get(acc, 0)
#assert(lastActive <= timestamp)
#if lastActive < timestamp:
# self.dateActive[acc] = timestamp
# self.recentlyActive.push_left(acc)
assert(self.lastTimestamp <= timestamp)
self.lastTimestamp = timestamp
print("Replaying traces took %4fs" % (now() - t))
if 'tx' in data:
t = now()
fromITX = data['tx'].columns.get_loc('from')+1
for tx in data['tx'].itertuples():
sender = self.noneIfInf(getattr(tx, '_'+str(fromITX)))
if sender is not None:
self.localTransactionsOf.setdefault(sender, [])
self.localTransactionsOf[sender].append(tx)
print("Iterating TXs took %4fs" % (now() - t))
if 'log' in data:
t = now()
for log in data['log'].itertuples():
adr = self.noneIfInf(log.address)
if adr is not None:
self.localLogsOf.setdefault(adr, [])
self.localLogsOf[adr].append(log)
print("Iterating logs took %4fs" % (now() - t))
t = now()
self.localAccountsAmount = len(self.localAccounts)
print("Getting recent records took %4fs" % (now() - t))
t = now()
#update local balances
for acc in self.localAccounts:
val = self.balances[acc]
self.localBalances[acc] = val
self.localTotalETH += val
#update top records
#TODO: Hold the previous top records and remove the no-longer top records before proceeding
#maybe by having a sorted dict and remove the last ones or just sort and remove?
if self.isTop(self.balances[acc], self.topXFraction, self.totalETH):
if self.isContract.get(acc, False):
self.isContractTopX[acc] = True
self.contractTopX.append(acc)
else:
self.isTopX[acc] = True
self.topX.append(acc)
if self.isTop(self.balances[acc], self.topXFraction, self.localTotalETH):
if self.isContract.get(acc, False):
self.isContractLocalTopX[acc] = True
self.contractLocalTopX.append(acc)
else:
self.isLocalTopX[acc] = True
self.localTopX.append(acc)
if self.isTop(self.timesUsed[acc], self.topUsedFraction, self.totalTimesUsed):
if self.isContract.get(acc, False):
self.isContractTopUsed[acc] = True
self.contractTopUsed.append(acc)
else:
self.isTopUsed[acc] = True
self.topUsed.append(acc)
if self.isTop(self.timesUsed[acc], self.topUsedFraction, self.localTotalTimesUsed):
if self.isContract.get(acc, False):
self.isContractLocalTopUsed[acc] = True
self.contractLocalTopUsed.append(acc)
else:
self.isLocalTopUsed[acc] = True
self.localTopUsed.append(acc)
print("Local balance iteration took %4fs" % (now() - t))
t = now()
#update recently created by removing the last part of accounts
self.recentlyCreated = self.removeOldDequeRecords(self.recentlyCreated, self.lastTimestamp - self.recentLength, self.dateCreated)
self.isRecentlyCreated = self.listToTrueDict(self.recentlyCreated)
#updated recent ETH exchanged
# remove the oldest tick and append the latest one
self.ETHRecentlyExchangedList.pop()
self.ETHRecentlyExchangedList.insert(0, ethExchanged)
self.ETHRecentlyExchanged = sum(self.ETHRecentlyExchangedList)
self.printDebug()
print("Debug & recently exchanged took %4fs" % (now() - t))
def noneIfInf(self, a):
if isinstance(a, float) and math.isnan(a):
return None
return a
def removeOldDequeRecords(self, dq, minVal, valDict=None):
#the dq should be ordered largest -> smallest values
while dq:
val = dq.pop()
if valDict is not None:
valCmp = valDict[val]
else:
valCmp = val
if valCmp >= minVal:
dq.append(val)
return dq
def getRecentRecords(self, dct, interval, currentTime=None):
target = None
if currentTime is not None:
target = currentTime - interval
res = []
prevVal = None
for key in dct:
val = dct[key]
if currentTime is None:
currentTime = val
target = currentTime - interval
res.append(key)
assert(prevVal is None or val <= prevVal)
prevVal = val
if val < target:
break
return res
def isTop(self, value, fraction, total):
minTarget = total * fraction
return value >= minTarget
def getTopRecords(self, dct, fraction, total, restrictorDict=None, inverseRestriction=False):
#we should return all records with values higher than min target
minTarget = total * fraction
res = []
prevVal = None
for key in dct:
val = dct[key]
if val >= minTarget and (restrictorDict is None or restrictorDict.get(key, False) is not inverseRestriction):
res.append(key)
else:
break
#assert(prevVal is None or val <= prevVal)
prevVal = val
return res
def listToTrueDict(self, lst, dct=None):
if dct is None:
dct = {}
for el in lst:
dct[el] = True
return dct
def printDebug(self):
print("Amount of topX: %d" % len(self.topX))
print("Amount of topX contracts: %d" % len(self.contractTopX))
print("Amount of local topX: %d" % len(self.localTopX))
print("Amount of local topX contracts: %d" % len(self.contractLocalTopX))
print("Amount of top used: %d" % len(self.topUsed))
print("Amount of contract top used: %d" % len(self.contractTopUsed))
print("Amount of local top used: %d" % len(self.localTopUsed))
print("Amount of contract local top used: %d" % len(self.contractLocalTopUsed))
print("ETH recently exchanged: %d" % self.ETHRecentlyExchanged)
#print("Recently active accounts: %d" % len(self.recentlyActive))
print("Recently created accounts: %d" % len(self.recentlyCreated))
if self.localAccountsAmount > 0:
print("Senders %d, with sent val of first being %d" % (len(self.senders), self.amountSentBy[self.senders[0]]))
print("Receivers %d, with received val of first being %d" % (len(self.receivers), self.amountReceivedBy[self.receivers[0]]))
acc = self.localAccounts[0]
print("Local accounts %d, traces from first account %d, logs %d and TXs %d" % (len(self.localAccounts), len(self.localTracesOf.get(acc, [])), \
len(self.localLogsOf.get(acc, [])), len(self.localTransactionsOf.get(acc, [])) ))
print("%d new accounts and %d new contracts" % (len(self.newAccounts), len(self.newContracts)))
print("%d times locally used and %d total local balance" % (self.localTotalTimesUsed, self.localTotalETH))
print("%d total accounts, %d total times used and %d total ETH" % (self.totalAccountsAmount, self.totalTimesUsed, self.totalETH))
#singleton
state = BlockchainState()
|
[
1,
1053,
5844,
13,
13,
3166,
931,
1053,
931,
408,
1286,
13,
3166,
16250,
1053,
316,
802,
13,
13,
29937,
3166,
12705,
29918,
1767,
29918,
8977,
1053,
317,
18054,
1917,
21533,
13,
13685,
287,
1917,
21533,
29922,
8977,
396,
7382,
4744,
13,
13,
3166,
1889,
943,
29889,
11330,
29889,
6799,
1053,
9079,
13,
13,
1990,
15658,
14153,
2792,
29898,
4854,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
1125,
13,
12,
12,
9136,
2141,
1649,
2344,
1649,
580,
13,
13,
12,
12,
1311,
29889,
276,
339,
2658,
353,
6024,
15003,
2033,
6552,
525,
7508,
742,
525,
1188,
2033,
13,
12,
12,
1311,
29889,
276,
339,
2658,
29950,
2118,
936,
1469,
29871,
353,
5852,
13,
13,
12,
12,
1311,
29889,
18280,
1469,
353,
7700,
13,
13,
12,
12,
1311,
3032,
2344,
29918,
3859,
580,
13,
12,
12,
1311,
3032,
8551,
29918,
3859,
580,
13,
13,
12,
1753,
903,
2344,
29918,
3859,
29898,
1311,
1125,
13,
12,
12,
1311,
29889,
276,
1760,
6513,
25991,
353,
29871,
29941,
13,
12,
12,
1311,
29889,
276,
1760,
6513,
353,
1583,
29889,
276,
1760,
6513,
25991,
29930,
29947,
29953,
29946,
29900,
29900,
396,
29871,
29941,
3841,
297,
6923,
13,
12,
12,
1311,
29889,
3332,
29990,
29943,
13857,
353,
29871,
29900,
29889,
29900,
29900,
29900,
29900,
29900,
29945,
13,
12,
12,
1311,
29889,
3332,
29965,
8485,
29943,
13857,
353,
29871,
29900,
29889,
29900,
29900,
29900,
29900,
29900,
29945,
13,
13,
12,
12,
1311,
29889,
11228,
20182,
368,
353,
29871,
29955,
29906,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
334,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
396,
29955,
29906,
29924,
382,
4690,
297,
591,
29875,
29889,
450,
382,
4690,
2825,
472,
2531,
6656,
13,
13,
12,
12,
29937,
7827,
382,
4690,
297,
10379,
13,
12,
12,
29937,
705,
1369,
472,
2531,
6656,
322,
788,
1432,
20751,
304,
278,
3001,
11421,
13,
12,
12,
1311,
29889,
7827,
2544,
29950,
353,
1583,
29889,
11228,
20182,
368,
13,
13,
12,
12,
29937,
7827,
5253,
310,
3064,
988,
385,
3633,
756,
1063,
278,
14511,
1061,
470,
19870,
310,
385,
3158,
13,
12,
12,
1311,
29889,
7827,
29164,
29965,
8485,
353,
29871,
29900,
13,
13,
12,
12,
29937,
1285,
1461,
16280,
13,
12,
12,
1311,
29889,
275,
21263,
353,
6571,
13,
13,
12,
12,
29937,
5521,
749,
16280,
13,
12,
12,
1311,
29889,
5521,
2925,
353,
6571,
13,
13,
12,
12,
29937,
14506,
310,
22160,
445,
1035,
5221,
1078,
297,
13,
12,
12,
1311,
29889,
3706,
29965,
8485,
353,
6571,
13,
13,
12,
12,
29937,
7827,
1035,
29879,
13,
12,
12,
1311,
29889,
7827,
10601,
29879,
18087,
353,
29871,
29900,
13,
13,
12,
12,
29937,
276,
1760,
368,
6136,
29914,
11600,
15303,
29889,
13,
12,
12,
29937,
4806,
5503,
304,
278,
4565,
278,
1556,
7786,
15303,
322,
1835,
515,
278,
1250,
278,
9642,
6743,
13,
12,
12,
29937,
1311,
29889,
276,
1760,
368,
9966,
353,
316,
802,
580,
13,
12,
12,
29937,
1311,
29889,
275,
4789,
2705,
9966,
353,
6571,
13,
12,
12,
1311,
29889,
276,
1760,
368,
20399,
353,
316,
802,
580,
13,
12,
12,
1311,
29889,
275,
4789,
2705,
20399,
353,
6571,
13,
13,
12,
12,
29937,
8977,
29879,
304,
4808,
3633,
5335,
342,
15092,
29889,
501,
8485,
746,
25202,
10325,
6136,
29914,
11600,
13,
12,
12,
1311,
29889,
1256,
20399,
353,
6571,
13,
12,
12,
29937,
1311,
29889,
1256,
9966,
353,
6571,
13,
13,
12,
12,
29937,
262,
1797,
382,
4690,
4789,
2705,
1252,
15033,
304,
367,
12833,
29892,
591,
29915,
645,
3013,
263,
1051,
310,
278,
4940,
921,
6199,
29892,
1269,
1543,
1641,
13,
12,
12,
29937,
1552,
5253,
310,
382,
4690,
429,
15033,
2629,
393,
7234,
29889,
1987,
1749,
2286,
674,
367,
278,
2533,
310,
393,
1051,
13,
12,
12,
1311,
29889,
2544,
29950,
4789,
2705,
1252,
15033,
1293,
353,
518,
29900,
29962,
334,
1583,
29889,
276,
1760,
6513,
25991,
13,
13,
13,
12,
29937,
2841,
1503,
4129,
393,
756,
304,
367,
24639,
363,
1432,
1889,
29911,
860,
1246,
13,
12,
1753,
903,
8551,
29918,
3859,
29898,
1311,
1125,
13,
12,
12,
29937,
29911,
4590,
2672,
350,
1964,
23219,
29914,
17171,
29928,
402,
28902,
1964,
29914,
16652,
1964,
8707,
29911,
4717,
1783,
29903,
29914,
2477,
3217,
3904,
9375,
365,
9047,
29914,
23827,
13,
13,
13,
12,
12,
29937,
3235,
323,
4590,
1060,
3895,
6093,
319,
1783,
18474,
14614,
3217,
3904,
9375,
13,
12,
12,
29937,
4690,
3235,
8519,
6093,
6732,
16786,
399,
29909,
29979,
13,
13,
12,
12,
29937,
3332,
921,
29995,
16280,
313,
1761,
669,
2910,
29897,
13,
12,
12,
1311,
29889,
275,
7031,
29990,
353,
6571,
13,
12,
12,
1311,
29889,
3332,
29990,
353,
5159,
13,
13,
12,
12,
29937,
1454,
8078,
29879,
13,
12,
12,
1311,
29889,
275,
21263,
7031,
29990,
353,
6571,
13,
12,
12,
1311,
29889,
1285,
1461,
7031,
29990,
353,
5159,
13,
13,
12,
12,
29937,
2997,
2246,
1060,
16280,
13,
12,
12,
1311,
29889,
275,
7717,
7031,
29990,
353,
6571,
13,
12,
12,
1311,
29889,
2997,
7031,
29990,
353,
5159,
13,
13,
12,
12,
29937,
1454,
8078,
29879,
13,
12,
12,
1311,
29889,
275,
21263,
7717,
7031,
29990,
353,
6571,
13,
12,
12,
1311,
29889,
1285,
1461,
7717,
7031,
29990,
353,
5159,
13,
12,
12,
13,
12,
12,
29937,
3332,
921,
29995,
297,
8744,
313,
1761,
669,
2910,
29897,
13,
12,
12,
1311,
29889,
275,
7031,
29965,
8485,
353,
6571,
13,
12,
12,
1311,
29889,
3332,
29965,
8485,
353,
5159,
13,
13,
12,
12,
29937,
1454,
8078,
29879,
13,
12,
12,
1311,
29889,
275,
21263,
7031,
29965,
8485,
353,
6571,
13,
12,
12,
1311,
29889,
1285,
1461,
7031,
29965,
8485,
353,
5159,
13,
13,
12,
12,
29937,
2997,
2246,
1060,
297,
8744,
16280,
13,
12,
12,
1311,
29889,
275,
7717,
7031,
29965,
8485,
353,
6571,
13,
12,
12,
1311,
29889,
2997,
7031,
29965,
8485,
353,
5159,
13,
13,
12,
12,
29937,
1454,
8078,
29879,
13,
12,
12,
1311,
29889,
275,
21263,
7717,
7031,
29965,
8485,
353,
6571,
13,
12,
12,
1311,
29889,
1285,
1461,
7717,
7031,
29965,
8485,
353,
5159,
13,
13,
12,
12,
29937,
2997,
12286,
304,
6176,
1887,
2246,
19435,
13,
12,
12,
1311,
29889,
2997,
22031,
2925,
353,
317,
18054,
1917,
21533,
580,
13,
12,
12,
1311,
29889,
2997,
11536,
2544,
29950,
353,
29871,
29900,
13,
12,
12,
1311,
29889,
2997,
29164,
29965,
8485,
353,
317,
18054,
1917,
21533,
580,
13,
12,
12,
1311,
29889,
2997,
11536,
29164,
29965,
8485,
353,
29871,
29900,
13,
13,
12,
12,
29937,
1761,
310,
1887,
15303,
13,
12,
12,
1311,
29889,
275,
7717,
10601,
353,
6571,
13,
12,
12,
1311,
29889,
2997,
10601,
29879,
353,
5159,
13,
13,
12,
12,
29937,
1761,
29914,
1958,
310,
1887,
716,
15303,
29914,
1285,
1461,
29879,
13,
12,
12,
1311,
29889,
275,
10601,
4373,
353,
6571,
13,
12,
12,
1311,
29889,
1482,
10601,
29879,
353,
5159,
13,
12,
12,
1311,
29889,
275,
21263,
4373,
353,
6571,
13,
12,
12,
1311,
29889,
1482,
21263,
29879,
353,
5159,
13,
13,
12,
12,
29937,
7328,
1599,
1051,
310,
22160,
29914,
3018,
778,
29914,
20756,
13,
12,
12,
1311,
29889,
2997,
4300,
7387,
2776,
353,
6571,
13,
12,
12,
1311,
29889,
2997,
5323,
778,
2776,
353,
6571,
13,
12,
12,
1311,
29889,
2997,
3403,
29879,
2776,
353,
6571,
13,
13,
12,
12,
29937,
25568,
6608,
1599,
1565,
29914,
15955,
3692,
445,
10804,
4864,
13,
12,
12,
1311,
29889,
275,
12460,
353,
6571,
13,
13,
12,
12,
29937,
1271,
405,
1599,
6120,
13,
12,
12,
1311,
29889,
275,
7445,
353,
6571,
13,
13,
12,
12,
29937,
7328,
1599,
10489,
1304,
3001,
297,
445,
3785,
13,
12,
12,
1311,
29889,
25496,
29965,
8485,
2059,
353,
6571,
13,
13,
12,
12,
29937,
7328,
1599,
5253,
322,
1051,
310,
2665,
29914,
13556,
2347,
297,
445,
3785,
13,
12,
12,
1311,
29889,
14506,
29903,
296,
2059,
353,
6571,
13,
12,
12,
1311,
29889,
6717,
414,
353,
5159,
13,
12,
12,
1311,
29889,
14506,
29816,
2059,
353,
6571,
13,
12,
12,
1311,
29889,
13556,
1536,
353,
5159,
13,
13,
12,
12,
29937,
4925,
1035,
29879,
13,
12,
12,
1311,
29889,
2997,
10601,
29879,
18087,
353,
29871,
29900,
13,
13,
12,
12,
29937,
14506,
310,
382,
4690,
393,
756,
1063,
10325,
429,
15033,
13,
12,
12,
1311,
29889,
2544,
29950,
4789,
2705,
1252,
15033,
353,
29871,
29900,
13,
13,
12,
12,
29937,
2230,
310,
1833,
2908,
13,
12,
12,
1311,
29889,
4230,
27939,
353,
29871,
29900,
13,
13,
29937,
4986,
3970,
29901,
7740,
29887,
6411,
310,
925,
2825,
1035,
29879,
313,
485,
29887,
995,
310,
937,
25568,
304,
1035,
7897,
13,
29937,
4986,
3970,
29901,
746,
1985,
411,
382,
4690,
29892,
884,
505,
263,
3148,
29928,
1873,
310,
278,
1021,
2875,
13,
13,
12,
1753,
1889,
29911,
860,
29898,
1311,
29892,
848,
1125,
13,
12,
12,
29873,
353,
1286,
580,
13,
12,
12,
1311,
3032,
8551,
29918,
3859,
580,
13,
12,
12,
2158,
703,
18759,
2106,
3614,
1273,
29946,
5847,
29908,
1273,
313,
3707,
580,
448,
260,
876,
13,
13,
12,
12,
621,
1252,
15033,
353,
29871,
29900,
13,
13,
12,
12,
3166,
29902,
353,
848,
1839,
15003,
13359,
13099,
29889,
657,
29918,
2029,
877,
3166,
1495,
29974,
29896,
13,
13,
12,
12,
361,
525,
15003,
29915,
297,
848,
29901,
13,
12,
12,
12,
29873,
353,
1286,
580,
13,
12,
12,
12,
1454,
9637,
297,
848,
1839,
15003,
13359,
277,
814,
29884,
2701,
7295,
13,
12,
12,
12,
12,
15452,
353,
679,
5552,
29898,
15003,
29892,
22868,
18717,
710,
29898,
3166,
29902,
876,
13,
12,
12,
12,
12,
13556,
2147,
353,
9637,
29889,
517,
13,
13,
12,
12,
12,
12,
15452,
353,
1583,
29889,
9290,
3644,
25433,
29898,
15452,
29897,
13,
12,
12,
12,
12,
13556,
2147,
353,
1583,
29889,
9290,
3644,
25433,
29898,
13556,
2147,
29897,
13,
13,
12,
12,
12,
12,
1767,
353,
938,
29898,
15003,
29889,
1767,
29892,
29871,
29900,
29897,
13,
13,
12,
12,
12,
12,
25496,
29965,
8485,
353,
1583,
29889,
9290,
3644,
25433,
29898,
15003,
29889,
25496,
29965,
8485,
29897,
13,
12,
12,
12,
12,
361,
10489,
29965,
8485,
338,
451,
6213,
29901,
13,
12,
12,
12,
12,
12,
25496,
29965,
8485,
353,
938,
29898,
15003,
29889,
25496,
29965,
8485,
29892,
29871,
29900,
29897,
13,
12,
12,
12,
12,
16394,
353,
9637,
29889,
3220,
29889,
1767,
849,
29871,
29896,
29900,
1068,
29929,
396,
29923,
13152,
3210,
931,
13,
13,
12,
12,
12,
12,
621,
1252,
15033,
4619,
995,
13,
13,
12,
12,
12,
12,
1311,
29889,
275,
12460,
29961,
15003,
29889,
20736,
10438,
29962,
353,
5852,
13,
12,
12,
12,
12,
1311,
29889,
275,
7445,
29961,
15003,
29889,
1271,
4557,
29962,
353,
5852,
13,
13,
12,
12,
12,
12,
361,
10489,
29965,
8485,
338,
451,
6213,
29901,
13,
12,
12,
12,
12,
12,
1311,
29889,
25496,
29965,
8485,
2059,
29961,
15452,
29962,
353,
1583,
29889,
25496,
29965,
8485,
2059,
29889,
657,
29898,
15452,
29892,
29871,
29900,
29897,
718,
10489,
29965,
8485,
13,
13,
12,
12,
12,
12,
361,
9637,
29889,
1853,
1275,
525,
3258,
2396,
13,
12,
12,
12,
12,
12,
9294,
29898,
13556,
2147,
451,
297,
1583,
29889,
275,
21263,
29897,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
21263,
29961,
13556,
2147,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
21263,
4373,
29961,
13556,
2147,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
1482,
21263,
29879,
29889,
4397,
29898,
13556,
2147,
29897,
13,
12,
12,
12,
12,
23681,
9637,
29889,
1853,
1275,
525,
276,
1328,
2396,
13,
12,
12,
12,
12,
12,
29937,
276,
2935,
508,
367,
2845,
2908,
470,
22169,
29892,
1269,
310,
607,
338,
10231,
278,
3001,
11421,
310,
382,
12711,
398,
13,
12,
12,
12,
12,
12,
1311,
29889,
7827,
2544,
29950,
4619,
995,
13,
12,
12,
12,
12,
13,
12,
12,
12,
12,
1454,
1035,
297,
518,
15452,
29892,
19870,
5387,
13,
12,
12,
12,
12,
12,
361,
1035,
338,
6213,
29901,
13,
12,
12,
12,
12,
12,
12,
19878,
13,
13,
12,
12,
12,
12,
12,
361,
1035,
451,
297,
1583,
29889,
5521,
2925,
29901,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
7827,
10601,
29879,
18087,
4619,
29871,
29896,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
1256,
20399,
29961,
5753,
29962,
353,
14334,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
276,
1760,
368,
20399,
29889,
4397,
1563,
29898,
5753,
29897,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
5521,
2925,
29961,
5753,
29962,
353,
29871,
29900,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
3706,
29965,
8485,
29961,
5753,
29962,
353,
29871,
29900,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
275,
10601,
4373,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
1482,
10601,
29879,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
12,
12,
361,
1035,
1275,
10004,
29901,
13,
12,
12,
12,
12,
12,
12,
21962,
22031,
353,
1583,
29889,
5521,
2925,
29961,
5753,
29962,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
5521,
2925,
29961,
5753,
29962,
353,
29871,
29900,
565,
16256,
22031,
529,
995,
1683,
16256,
22031,
448,
995,
13,
12,
12,
12,
12,
12,
12,
29937,
1366,
1206,
338,
1950,
1363,
591,
1016,
29915,
29873,
505,
278,
2531,
6656,
1301,
25534,
13,
12,
12,
12,
12,
12,
12,
29937,
4986,
3970,
29901,
3617,
278,
2531,
6656,
1301,
25534,
515,
382,
3341,
3068,
29915,
29879,
3450,
470,
1207,
263,
1856,
24559,
412,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
2997,
5323,
778,
2776,
29889,
842,
4381,
29898,
5753,
29892,
518,
2314,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
2997,
5323,
778,
2776,
29961,
5753,
1822,
4397,
29898,
15003,
29897,
13,
13,
12,
12,
12,
12,
12,
12,
361,
1035,
451,
297,
1583,
29889,
14506,
29903,
296,
2059,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
1311,
29889,
14506,
29903,
296,
2059,
29961,
5753,
29962,
353,
29871,
29900,
13,
12,
12,
12,
12,
12,
12,
12,
1311,
29889,
6717,
414,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
14506,
29903,
296,
2059,
29961,
5753,
29962,
4619,
995,
13,
13,
12,
12,
12,
12,
12,
361,
1035,
1275,
19870,
29901,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
5521,
2925,
29961,
13556,
2147,
29962,
4619,
995,
13,
12,
12,
12,
12,
13,
12,
12,
12,
12,
12,
12,
361,
1035,
451,
297,
1583,
29889,
14506,
29816,
2059,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
1311,
29889,
14506,
29816,
2059,
29961,
5753,
29962,
353,
29871,
29900,
13,
12,
12,
12,
12,
12,
12,
12,
1311,
29889,
13556,
1536,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
14506,
29816,
2059,
29961,
5753,
29962,
4619,
995,
13,
13,
12,
12,
12,
12,
12,
29937,
5504,
1887,
15303,
13,
12,
12,
12,
12,
12,
361,
1035,
451,
297,
1583,
29889,
275,
7717,
10601,
29901,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
275,
7717,
10601,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
2997,
10601,
29879,
29889,
4397,
29898,
5753,
29897,
13,
13,
12,
12,
12,
12,
12,
29937,
5504,
8744,
5235,
13,
12,
12,
12,
12,
12,
1311,
29889,
7827,
29164,
29965,
8485,
4619,
29871,
29896,
13,
12,
12,
12,
12,
12,
1311,
29889,
3706,
29965,
8485,
29961,
5753,
29962,
4619,
29871,
29896,
13,
12,
12,
12,
12,
12,
1311,
29889,
2997,
29164,
29965,
8485,
29889,
842,
4381,
29898,
5753,
29892,
29871,
29900,
29897,
13,
12,
12,
12,
12,
12,
1311,
29889,
2997,
29164,
29965,
8485,
29961,
5753,
29962,
4619,
29871,
29896,
13,
13,
12,
12,
12,
12,
12,
29937,
5504,
6136,
3064,
13,
12,
12,
12,
12,
12,
29937,
4230,
9966,
353,
1583,
29889,
1256,
9966,
29889,
657,
29898,
5753,
29892,
29871,
29900,
29897,
13,
12,
12,
12,
12,
12,
29937,
9294,
29898,
4230,
9966,
5277,
14334,
29897,
13,
12,
12,
12,
12,
12,
29937,
361,
1833,
9966,
529,
14334,
29901,
13,
12,
12,
12,
12,
12,
29937,
12,
1311,
29889,
1256,
9966,
29961,
5753,
29962,
353,
14334,
13,
12,
12,
12,
12,
12,
29937,
12,
1311,
29889,
276,
1760,
368,
9966,
29889,
5910,
29918,
1563,
29898,
5753,
29897,
13,
13,
12,
12,
12,
12,
12,
9294,
29898,
1311,
29889,
4230,
27939,
5277,
14334,
29897,
13,
12,
12,
12,
12,
12,
1311,
29889,
4230,
27939,
353,
14334,
13,
13,
12,
12,
12,
2158,
703,
1123,
1456,
292,
26695,
3614,
1273,
29946,
5847,
29908,
1273,
313,
3707,
580,
448,
260,
876,
13,
13,
12,
12,
361,
525,
7508,
29915,
297,
848,
29901,
13,
12,
12,
12,
29873,
353,
1286,
580,
13,
12,
12,
12,
3166,
1806,
29990,
353,
848,
1839,
7508,
13359,
13099,
29889,
657,
29918,
2029,
877,
3166,
1495,
29974,
29896,
13,
12,
12,
12,
1454,
25568,
297,
848,
1839,
7508,
13359,
277,
814,
29884,
2701,
7295,
13,
12,
12,
12,
12,
15452,
353,
1583,
29889,
9290,
3644,
25433,
29898,
657,
5552,
29898,
7508,
29892,
22868,
18717,
710,
29898,
3166,
1806,
29990,
4961,
13,
13,
12,
12,
12,
12,
361,
10004,
338,
451,
6213,
29901,
13,
12,
12,
12,
12,
12,
1311,
29889,
2997,
4300,
7387,
2776,
29889,
842,
4381,
29898,
15452,
29892,
518,
2314,
13,
12,
12,
12,
12,
12,
1311,
29889,
2997,
4300,
7387,
2776,
29961,
15452,
1822,
4397,
29898,
7508,
29897,
13,
12,
12,
12,
2158,
703,
13463,
1218,
323,
29990,
29879,
3614,
1273,
29946,
5847,
29908,
1273,
313,
3707,
580,
448,
260,
876,
13,
12,
12,
361,
525,
1188,
29915,
297,
848,
29901,
13,
12,
12,
12,
29873,
353,
1286,
580,
13,
12,
12,
12,
1454,
1480,
297,
848,
1839,
1188,
13359,
277,
814,
29884,
2701,
7295,
13,
12,
12,
12,
12,
7887,
353,
1583,
29889,
9290,
3644,
25433,
29898,
1188,
29889,
7328,
29897,
13,
13,
12,
12,
12,
12,
361,
594,
29878,
338,
451,
6213,
29901,
13,
12,
12,
12,
12,
12,
1311,
29889,
2997,
3403,
29879,
2776,
29889,
842,
4381,
29898,
7887,
29892,
518,
2314,
13,
12,
12,
12,
12,
12,
1311,
29889,
2997,
3403,
29879,
2776,
29961,
7887,
1822,
4397,
29898,
1188,
29897,
13,
12,
12,
12,
2158,
703,
13463,
1218,
10748,
3614,
1273,
29946,
5847,
29908,
1273,
313,
3707,
580,
448,
260,
876,
13,
13,
12,
12,
29873,
353,
1286,
580,
13,
13,
12,
12,
1311,
29889,
2997,
10601,
29879,
18087,
353,
7431,
29898,
1311,
29889,
2997,
10601,
29879,
29897,
13,
12,
13,
12,
12,
2158,
703,
2577,
1259,
7786,
6475,
3614,
1273,
29946,
5847,
29908,
1273,
313,
3707,
580,
448,
260,
876,
13,
12,
12,
29873,
353,
1286,
580,
13,
13,
12,
12,
29937,
5504,
1887,
6411,
2925,
13,
12,
12,
1454,
1035,
297,
1583,
29889,
2997,
10601,
29879,
29901,
13,
12,
12,
12,
791,
353,
1583,
29889,
5521,
2925,
29961,
5753,
29962,
13,
12,
12,
12,
1311,
29889,
2997,
22031,
2925,
29961,
5753,
29962,
353,
659,
13,
12,
12,
12,
1311,
29889,
2997,
11536,
2544,
29950,
4619,
659,
13,
13,
12,
12,
12,
29937,
5504,
2246,
6475,
13,
12,
12,
12,
29937,
4986,
3970,
29901,
21771,
278,
3517,
2246,
6475,
322,
3349,
278,
694,
29899,
5426,
261,
2246,
6475,
1434,
8469,
292,
13,
12,
12,
12,
29937,
26026,
491,
2534,
263,
12705,
9657,
322,
3349,
278,
1833,
6743,
470,
925,
2656,
322,
3349,
29973,
13,
12,
12,
12,
361,
1583,
29889,
275,
7031,
29898,
1311,
29889,
5521,
2925,
29961,
5753,
1402,
1583,
29889,
3332,
29990,
29943,
13857,
29892,
1583,
29889,
7827,
2544,
29950,
1125,
13,
12,
12,
12,
12,
361,
1583,
29889,
275,
21263,
29889,
657,
29898,
5753,
29892,
7700,
1125,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
21263,
7031,
29990,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
1285,
1461,
7031,
29990,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
7031,
29990,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
3332,
29990,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
361,
1583,
29889,
275,
7031,
29898,
1311,
29889,
5521,
2925,
29961,
5753,
1402,
1583,
29889,
3332,
29990,
29943,
13857,
29892,
1583,
29889,
2997,
11536,
2544,
29950,
1125,
13,
12,
12,
12,
12,
361,
1583,
29889,
275,
21263,
29889,
657,
29898,
5753,
29892,
7700,
1125,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
21263,
7717,
7031,
29990,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
1285,
1461,
7717,
7031,
29990,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
7717,
7031,
29990,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
2997,
7031,
29990,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
361,
1583,
29889,
275,
7031,
29898,
1311,
29889,
3706,
29965,
8485,
29961,
5753,
1402,
1583,
29889,
3332,
29965,
8485,
29943,
13857,
29892,
1583,
29889,
7827,
29164,
29965,
8485,
1125,
13,
12,
12,
12,
12,
361,
1583,
29889,
275,
21263,
29889,
657,
29898,
5753,
29892,
7700,
1125,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
21263,
7031,
29965,
8485,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
1285,
1461,
7031,
29965,
8485,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
7031,
29965,
8485,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
3332,
29965,
8485,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
361,
1583,
29889,
275,
7031,
29898,
1311,
29889,
3706,
29965,
8485,
29961,
5753,
1402,
1583,
29889,
3332,
29965,
8485,
29943,
13857,
29892,
1583,
29889,
2997,
11536,
29164,
29965,
8485,
1125,
13,
12,
12,
12,
12,
361,
1583,
29889,
275,
21263,
29889,
657,
29898,
5753,
29892,
7700,
1125,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
21263,
7717,
7031,
29965,
8485,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
1285,
1461,
7717,
7031,
29965,
8485,
29889,
4397,
29898,
5753,
29897,
13,
12,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
12,
1311,
29889,
275,
7717,
7031,
29965,
8485,
29961,
5753,
29962,
353,
5852,
13,
12,
12,
12,
12,
12,
1311,
29889,
2997,
7031,
29965,
8485,
29889,
4397,
29898,
5753,
29897,
13,
13,
12,
12,
2158,
703,
7717,
17346,
12541,
3614,
1273,
29946,
5847,
29908,
1273,
313,
3707,
580,
448,
260,
876,
13,
13,
12,
12,
29873,
353,
1286,
580,
13,
13,
12,
12,
29937,
5504,
10325,
2825,
491,
11077,
278,
1833,
760,
310,
15303,
13,
12,
12,
1311,
29889,
276,
1760,
368,
20399,
353,
1583,
29889,
5992,
21648,
2772,
802,
4789,
4339,
29898,
1311,
29889,
276,
1760,
368,
20399,
29892,
1583,
29889,
4230,
27939,
448,
1583,
29889,
276,
1760,
6513,
29892,
1583,
29889,
1256,
20399,
29897,
13,
12,
12,
1311,
29889,
275,
4789,
2705,
20399,
353,
1583,
29889,
1761,
1762,
5574,
21533,
29898,
1311,
29889,
276,
1760,
368,
20399,
29897,
13,
13,
12,
12,
29937,
21402,
7786,
382,
4690,
429,
15033,
13,
12,
12,
29937,
3349,
278,
23947,
16892,
322,
9773,
278,
9281,
697,
13,
12,
12,
1311,
29889,
2544,
29950,
4789,
2705,
1252,
15033,
1293,
29889,
7323,
580,
13,
12,
12,
1311,
29889,
2544,
29950,
4789,
2705,
1252,
15033,
1293,
29889,
7851,
29898,
29900,
29892,
11314,
1252,
15033,
29897,
13,
12,
12,
1311,
29889,
2544,
29950,
4789,
2705,
1252,
15033,
353,
2533,
29898,
1311,
29889,
2544,
29950,
4789,
2705,
1252,
15033,
1293,
29897,
13,
13,
12,
12,
1311,
29889,
2158,
11862,
580,
13,
13,
12,
12,
2158,
703,
11862,
669,
10325,
429,
15033,
3614,
1273,
29946,
5847,
29908,
1273,
313,
3707,
580,
448,
260,
876,
13,
13,
12,
1753,
5642,
3644,
25433,
29898,
1311,
29892,
263,
1125,
13,
12,
12,
361,
338,
8758,
29898,
29874,
29892,
5785,
29897,
322,
5844,
29889,
275,
13707,
29898,
29874,
1125,
13,
12,
12,
12,
2457,
6213,
13,
12,
12,
2457,
263,
13,
13,
12,
1753,
3349,
21648,
2772,
802,
4789,
4339,
29898,
1311,
29892,
270,
29939,
29892,
1375,
1440,
29892,
659,
21533,
29922,
8516,
1125,
13,
12,
12,
29937,
1552,
270,
29939,
881,
367,
10372,
10150,
1599,
19087,
1819,
13,
12,
12,
8000,
270,
29939,
29901,
13,
12,
12,
12,
791,
353,
270,
29939,
29889,
7323,
580,
13,
12,
12,
12,
361,
659,
21533,
338,
451,
6213,
29901,
13,
12,
12,
12,
12,
791,
29907,
1526,
353,
659,
21533,
29961,
791,
29962,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
791,
29907,
1526,
353,
659,
13,
13,
12,
12,
12,
361,
659,
29907,
1526,
6736,
1375,
1440,
29901,
13,
12,
12,
12,
12,
29881,
29939,
29889,
4397,
29898,
791,
29897,
13,
12,
12,
12,
12,
2457,
270,
29939,
13,
13,
12,
1753,
679,
4789,
296,
4789,
4339,
29898,
1311,
29892,
270,
312,
29892,
7292,
29892,
1857,
2481,
29922,
8516,
1125,
13,
12,
12,
5182,
353,
6213,
13,
12,
12,
361,
1857,
2481,
338,
451,
6213,
29901,
13,
12,
12,
12,
5182,
353,
1857,
2481,
448,
7292,
13,
13,
12,
12,
690,
353,
5159,
13,
12,
12,
16304,
1440,
353,
6213,
13,
12,
12,
1454,
1820,
297,
270,
312,
29901,
13,
12,
12,
12,
791,
353,
270,
312,
29961,
1989,
29962,
13,
12,
12,
12,
361,
1857,
2481,
338,
6213,
29901,
13,
12,
12,
12,
12,
3784,
2481,
353,
659,
13,
12,
12,
12,
12,
5182,
353,
1857,
2481,
448,
7292,
13,
13,
12,
12,
12,
690,
29889,
4397,
29898,
1989,
29897,
13,
13,
12,
12,
12,
9294,
29898,
16304,
1440,
338,
6213,
470,
659,
5277,
12379,
1440,
29897,
13,
13,
12,
12,
12,
16304,
1440,
353,
659,
13,
12,
12,
12,
361,
659,
529,
3646,
29901,
13,
12,
12,
12,
12,
8690,
13,
13,
12,
12,
2457,
620,
13,
13,
12,
1753,
338,
7031,
29898,
1311,
29892,
995,
29892,
15958,
29892,
3001,
1125,
13,
12,
12,
1195,
8667,
353,
3001,
334,
15958,
13,
13,
12,
12,
2457,
995,
6736,
1375,
8667,
13,
13,
12,
1753,
679,
7031,
4789,
4339,
29898,
1311,
29892,
270,
312,
29892,
15958,
29892,
3001,
29892,
9250,
272,
21533,
29922,
8516,
29892,
16402,
15078,
19902,
29922,
8824,
1125,
13,
12,
12,
29937,
705,
881,
736,
599,
6475,
411,
1819,
6133,
1135,
1375,
3646,
13,
12,
12,
1195,
8667,
353,
3001,
334,
15958,
13,
13,
12,
12,
690,
353,
5159,
13,
13,
12,
12,
16304,
1440,
353,
6213,
13,
12,
12,
1454,
1820,
297,
270,
312,
29901,
13,
12,
12,
12,
791,
353,
270,
312,
29961,
1989,
29962,
13,
13,
12,
12,
12,
361,
659,
6736,
1375,
8667,
322,
313,
5060,
4146,
272,
21533,
338,
6213,
470,
9250,
272,
21533,
29889,
657,
29898,
1989,
29892,
7700,
29897,
338,
451,
16402,
15078,
19902,
1125,
13,
12,
12,
12,
12,
690,
29889,
4397,
29898,
1989,
29897,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
8690,
13,
13,
12,
12,
12,
29937,
9294,
29898,
16304,
1440,
338,
6213,
470,
659,
5277,
12379,
1440,
29897,
13,
12,
12,
12,
16304,
1440,
353,
659,
13,
13,
12,
12,
2457,
620,
13,
13,
12,
1753,
1051,
1762,
5574,
21533,
29898,
1311,
29892,
24471,
29892,
270,
312,
29922,
8516,
1125,
13,
12,
12,
361,
270,
312,
338,
6213,
29901,
13,
12,
12,
12,
29881,
312,
353,
6571,
13,
13,
12,
12,
1454,
560,
297,
24471,
29901,
13,
12,
12,
12,
29881,
312,
29961,
295,
29962,
353,
5852,
13,
12,
12,
13,
12,
12,
2457,
270,
312,
13,
13,
12,
1753,
1596,
11862,
29898,
1311,
1125,
13,
12,
12,
2158,
703,
18087,
310,
2246,
29990,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
3332,
29990,
876,
13,
12,
12,
2158,
703,
18087,
310,
2246,
29990,
8078,
29879,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
1285,
1461,
7031,
29990,
876,
13,
12,
12,
2158,
703,
18087,
310,
1887,
2246,
29990,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
2997,
7031,
29990,
876,
13,
12,
12,
2158,
703,
18087,
310,
1887,
2246,
29990,
8078,
29879,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
1285,
1461,
7717,
7031,
29990,
876,
13,
12,
12,
2158,
703,
18087,
310,
2246,
1304,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
3332,
29965,
8485,
876,
13,
12,
12,
2158,
703,
18087,
310,
8078,
2246,
1304,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
1285,
1461,
7031,
29965,
8485,
876,
13,
12,
12,
2158,
703,
18087,
310,
1887,
2246,
1304,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
2997,
7031,
29965,
8485,
876,
13,
12,
12,
2158,
703,
18087,
310,
8078,
1887,
2246,
1304,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
1285,
1461,
7717,
7031,
29965,
8485,
876,
13,
12,
12,
2158,
703,
2544,
29950,
10325,
429,
15033,
29901,
1273,
29881,
29908,
1273,
1583,
29889,
2544,
29950,
4789,
2705,
1252,
15033,
29897,
13,
12,
12,
29937,
2158,
703,
4789,
2705,
6136,
15303,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
276,
1760,
368,
9966,
876,
13,
12,
12,
2158,
703,
4789,
2705,
2825,
15303,
29901,
1273,
29881,
29908,
1273,
7431,
29898,
1311,
29889,
276,
1760,
368,
20399,
876,
13,
13,
12,
12,
361,
1583,
29889,
2997,
10601,
29879,
18087,
1405,
29871,
29900,
29901,
13,
12,
12,
12,
2158,
703,
12600,
414,
1273,
29881,
29892,
411,
2665,
659,
310,
937,
1641,
1273,
29881,
29908,
1273,
313,
2435,
29898,
1311,
29889,
6717,
414,
511,
1583,
29889,
14506,
29903,
296,
2059,
29961,
1311,
29889,
6717,
414,
29961,
29900,
5262,
876,
13,
12,
12,
12,
2158,
703,
10380,
1536,
1273,
29881,
29892,
411,
4520,
659,
310,
937,
1641,
1273,
29881,
29908,
1273,
313,
2435,
29898,
1311,
29889,
13556,
1536,
511,
1583,
29889,
14506,
29816,
2059,
29961,
1311,
29889,
13556,
1536,
29961,
29900,
5262,
876,
13,
12,
12,
12,
5753,
353,
1583,
29889,
2997,
10601,
29879,
29961,
29900,
29962,
13,
12,
12,
12,
2158,
703,
7717,
15303,
1273,
29881,
29892,
26695,
515,
937,
3633,
1273,
29881,
29892,
10748,
1273,
29881,
322,
323,
29990,
29879,
1273,
29881,
29908,
1273,
313,
2435,
29898,
1311,
29889,
2997,
10601,
29879,
511,
7431,
29898,
1311,
29889,
2997,
5323,
778,
2776,
29889,
657,
29898,
5753,
29892,
518,
2314,
511,
320,
13,
12,
12,
12,
2435,
29898,
1311,
29889,
2997,
3403,
29879,
2776,
29889,
657,
29898,
5753,
29892,
518,
2314,
511,
7431,
29898,
1311,
29889,
2997,
4300,
7387,
2776,
29889,
657,
29898,
5753,
29892,
5159,
876,
29871,
876,
13,
12,
12,
2158,
11702,
29881,
716,
15303,
322,
1273,
29881,
716,
8078,
29879,
29908,
1273,
313,
2435,
29898,
1311,
29889,
1482,
10601,
29879,
511,
7431,
29898,
1311,
29889,
1482,
21263,
29879,
4961,
13,
12,
12,
2158,
11702,
29881,
3064,
12430,
1304,
322,
1273,
29881,
3001,
1887,
17346,
29908,
1273,
313,
1311,
29889,
2997,
11536,
29164,
29965,
8485,
29892,
1583,
29889,
2997,
11536,
2544,
29950,
876,
13,
12,
12,
2158,
11702,
29881,
3001,
15303,
29892,
1273,
29881,
3001,
3064,
1304,
322,
1273,
29881,
3001,
382,
4690,
29908,
1273,
313,
1311,
29889,
7827,
10601,
29879,
18087,
29892,
1583,
29889,
7827,
29164,
29965,
8485,
29892,
1583,
29889,
7827,
2544,
29950,
876,
13,
13,
29937,
2976,
11285,
13,
3859,
353,
15658,
14153,
2792,
580,
13,
2
] |
dbc_federated/applications/defect_detection_ddm2/Client_stage_2_modelling.py
|
DDLcdz1130/DBC-FederatedLearning-Client-VNX
| 0 |
159344
|
from torch.autograd import Variable
from tqdm import tqdm
from torchvision import datasets, models, transforms
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import numpy as np
import time
import os
import argparse
import torchvision
import copy
import sys
sys.path.append("../..")
from utils.data_processing import get_data_transforms, load_data, feature_eval_prep
from modules.learning import train_model, eval_model
from modules.model_config import model_take_lower_layers
### This script is to complete the whole process of extracting features from a set of labeled image data.
## Loading the dataloaders -- Make sure that the data is saved in following way
"""
- data/
- class_1 folder/
- img1.png
- img2.png
- class_2 folder/
.....
- class_n folder/
"""
parser = argparse.ArgumentParser(description='PyTorch inception Training')
parser.add_argument('--img_dir', default='./train/', type=str, help='')
parser.add_argument('--output_dir', default='./features/', type=str, help='')
parser.add_argument('--restore', default=1, type=int, help='whether restore the stored model or not')
parser.add_argument('--final_output', default=2, type=int, help='the number of the output of the final layer')
parser.add_argument('--batch_size', default=1, type=int)
parser.add_argument('--epochs', default=30, type=int)
args = parser.parse_args()
data_dir = args.img_dir
restore=args.restore
n_class=args.final_output
batch_size=args.batch_size
epochs=args.epochs
output_dir=args.output_dir
input_shape = 299
mean = [0.485, 0.456, 0.406]
std = [0.229, 0.224, 0.225]
scale = 299
input_shape = 299
use_parallel = True
use_gpu = True
print('lets start')
data_transforms = get_data_transforms(mode="eval", model_origin="Inception V3",
mean=None, std=None, scale=None, input_shape=299)
print('data_transform ends')
print(data_transforms)
dataloaders, dataset_sizes, class_names, class_2_idx = load_data(data_dir, data_transforms, mode = 'eval', batch_size=batch_size, num_workers=1)
print('load finished')
# Get model
if(restore):
print('==> Resuming from checkpoint..')
assert os.path.isdir('checkpoint'), 'Error: no checkpoint directory found!'
model_conv=torch.load('checkpoint/ckpt_led.t7')
model_conv=model_conv.module
else:
model_conv = torchvision.models.inception_v3(pretrained=True)
# Take model with only first ? layers
model_conv = model_take_lower_layers(model_conv, layer_number=3)
if use_parallel and use_gpu:
print("[Using all the available GPUs]")
model_conv.cuda()
model_conv = nn.DataParallel(model_conv, device_ids=[0, 1, 2, 3])
model_conv.cuda()
# Set up feature extraction classes and folders
idx_2_class=feature_eval_prep(class_2_idx, feat_path=output_dir)
print(model_conv)
eval_model(model_conv, dataloaders, dataset_sizes, use_gpu, batch_size,
idx_2_class, feat_path=output_dir)
# Then send feature data to the server
|
[
1,
515,
4842,
305,
29889,
1300,
468,
3665,
1053,
28736,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
3166,
4842,
305,
4924,
1053,
20035,
29892,
4733,
29892,
4327,
29879,
13,
5215,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
5215,
4842,
305,
29889,
20640,
408,
5994,
13,
3166,
4842,
305,
29889,
20640,
1053,
301,
29878,
29918,
816,
14952,
13,
5215,
12655,
408,
7442,
13,
5215,
931,
13,
5215,
2897,
13,
5215,
1852,
5510,
13,
5215,
4842,
305,
4924,
13,
5215,
3509,
13,
5215,
10876,
13,
9675,
29889,
2084,
29889,
4397,
703,
6995,
636,
1159,
13,
3166,
3667,
29879,
29889,
1272,
29918,
19170,
1053,
679,
29918,
1272,
29918,
9067,
29879,
29892,
2254,
29918,
1272,
29892,
4682,
29918,
14513,
29918,
15287,
13,
3166,
10585,
29889,
21891,
1053,
7945,
29918,
4299,
29892,
19745,
29918,
4299,
13,
3166,
10585,
29889,
4299,
29918,
2917,
1053,
1904,
29918,
19730,
29918,
13609,
29918,
29277,
13,
13,
2277,
29937,
910,
2471,
338,
304,
4866,
278,
3353,
1889,
310,
6597,
292,
5680,
515,
263,
731,
310,
301,
24025,
1967,
848,
29889,
13,
2277,
4309,
9382,
278,
1418,
7003,
24574,
1192,
8561,
1854,
393,
278,
848,
338,
7160,
297,
1494,
982,
13,
15945,
29908,
13,
13,
29871,
448,
848,
29914,
13,
418,
448,
770,
29918,
29896,
4138,
29914,
13,
3986,
448,
10153,
29896,
29889,
2732,
13,
3986,
448,
10153,
29906,
29889,
2732,
13,
418,
448,
770,
29918,
29906,
4138,
29914,
13,
418,
6317,
856,
13,
418,
448,
770,
29918,
29876,
4138,
29914,
13,
259,
13,
15945,
29908,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
19737,
29911,
25350,
297,
1441,
26101,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
2492,
29918,
3972,
742,
2322,
2433,
6904,
14968,
29914,
742,
1134,
29922,
710,
29892,
1371,
2433,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
4905,
29918,
3972,
742,
2322,
2433,
6904,
22100,
29914,
742,
1134,
29922,
710,
29892,
1371,
2433,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
5060,
487,
742,
2322,
29922,
29896,
29892,
1134,
29922,
524,
29892,
1371,
2433,
1332,
1979,
17749,
278,
6087,
1904,
470,
451,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
8394,
29918,
4905,
742,
2322,
29922,
29906,
29892,
1134,
29922,
524,
29892,
1371,
2433,
1552,
1353,
310,
278,
1962,
310,
278,
2186,
7546,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
16175,
29918,
2311,
742,
2322,
29922,
29896,
29892,
1134,
29922,
524,
29897,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
1022,
2878,
29879,
742,
2322,
29922,
29941,
29900,
29892,
1134,
29922,
524,
29897,
13,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1272,
29918,
3972,
353,
6389,
29889,
2492,
29918,
3972,
13,
5060,
487,
29922,
5085,
29889,
5060,
487,
13,
29876,
29918,
1990,
29922,
5085,
29889,
8394,
29918,
4905,
13,
16175,
29918,
2311,
29922,
5085,
29889,
16175,
29918,
2311,
13,
1022,
2878,
29879,
29922,
5085,
29889,
1022,
2878,
29879,
13,
4905,
29918,
3972,
29922,
5085,
29889,
4905,
29918,
3972,
13,
13,
2080,
29918,
12181,
353,
29871,
29906,
29929,
29929,
13,
12676,
353,
518,
29900,
29889,
29946,
29947,
29945,
29892,
29871,
29900,
29889,
29946,
29945,
29953,
29892,
29871,
29900,
29889,
29946,
29900,
29953,
29962,
13,
4172,
353,
518,
29900,
29889,
29906,
29906,
29929,
29892,
29871,
29900,
29889,
29906,
29906,
29946,
29892,
29871,
29900,
29889,
29906,
29906,
29945,
29962,
13,
7052,
353,
29871,
29906,
29929,
29929,
13,
2080,
29918,
12181,
353,
29871,
29906,
29929,
29929,
29871,
13,
1509,
29918,
23482,
353,
5852,
13,
1509,
29918,
29887,
3746,
353,
5852,
13,
13,
2158,
877,
10376,
1369,
1495,
13,
1272,
29918,
9067,
29879,
353,
679,
29918,
1272,
29918,
9067,
29879,
29898,
8513,
543,
14513,
613,
1904,
29918,
12574,
543,
797,
1441,
478,
29941,
613,
29871,
13,
462,
3986,
2099,
29922,
8516,
29892,
3659,
29922,
8516,
29892,
6287,
29922,
8516,
29892,
1881,
29918,
12181,
29922,
29906,
29929,
29929,
29897,
13,
2158,
877,
1272,
29918,
9067,
10614,
1495,
13,
2158,
29898,
1272,
29918,
9067,
29879,
29897,
13,
29881,
2075,
29877,
24574,
29892,
8783,
29918,
29879,
7093,
29892,
770,
29918,
7039,
29892,
770,
29918,
29906,
29918,
13140,
353,
2254,
29918,
1272,
29898,
1272,
29918,
3972,
29892,
848,
29918,
9067,
29879,
29892,
4464,
353,
525,
14513,
742,
9853,
29918,
2311,
29922,
16175,
29918,
2311,
29892,
954,
29918,
1287,
414,
29922,
29896,
29897,
13,
2158,
877,
1359,
7743,
1495,
13,
29937,
3617,
1904,
13,
13,
361,
29898,
5060,
487,
1125,
13,
1678,
1596,
877,
1360,
29958,
2538,
9929,
515,
1423,
3149,
636,
1495,
13,
1678,
4974,
2897,
29889,
2084,
29889,
275,
3972,
877,
3198,
3149,
5477,
525,
2392,
29901,
694,
1423,
3149,
3884,
1476,
20714,
13,
1678,
1904,
29918,
20580,
29922,
7345,
305,
29889,
1359,
877,
3198,
3149,
29914,
384,
415,
29918,
839,
29889,
29873,
29955,
1495,
13,
1678,
1904,
29918,
20580,
29922,
4299,
29918,
20580,
29889,
5453,
13,
2870,
29901,
13,
1678,
1904,
29918,
20580,
353,
4842,
305,
4924,
29889,
9794,
29889,
1239,
683,
29918,
29894,
29941,
29898,
1457,
3018,
1312,
29922,
5574,
29897,
13,
13,
29937,
11190,
1904,
411,
871,
937,
1577,
15359,
13,
4299,
29918,
20580,
353,
1904,
29918,
19730,
29918,
13609,
29918,
29277,
29898,
4299,
29918,
20580,
29892,
7546,
29918,
4537,
29922,
29941,
29897,
13,
13,
361,
671,
29918,
23482,
322,
671,
29918,
29887,
3746,
29901,
13,
1678,
1596,
703,
29961,
15156,
599,
278,
3625,
22796,
29879,
29962,
1159,
13,
1678,
1904,
29918,
20580,
29889,
29883,
6191,
580,
13,
1678,
1904,
29918,
20580,
353,
302,
29876,
29889,
1469,
2177,
6553,
29898,
4299,
29918,
20580,
29892,
4742,
29918,
4841,
11759,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
2314,
13,
1678,
1904,
29918,
20580,
29889,
29883,
6191,
580,
13,
268,
13,
13,
29937,
3789,
701,
4682,
4805,
428,
4413,
322,
16495,
13,
13140,
29918,
29906,
29918,
1990,
29922,
14394,
29918,
14513,
29918,
15287,
29898,
1990,
29918,
29906,
29918,
13140,
29892,
1238,
271,
29918,
2084,
29922,
4905,
29918,
3972,
29897,
13,
2158,
29898,
4299,
29918,
20580,
29897,
13,
14513,
29918,
4299,
29898,
4299,
29918,
20580,
29892,
1418,
7003,
24574,
29892,
8783,
29918,
29879,
7093,
29892,
29871,
671,
29918,
29887,
3746,
29892,
9853,
29918,
2311,
29892,
29871,
13,
965,
22645,
29918,
29906,
29918,
1990,
29892,
1238,
271,
29918,
2084,
29922,
4905,
29918,
3972,
29897,
13,
13,
29937,
1987,
3638,
4682,
848,
304,
278,
1923,
13,
13,
2
] |
bender/evaluator/factory_method.py
|
otovo/bender
| 2 |
123762
|
from typing import Generic, TypeVar
from bender.evaluator.interface import Evaluator
EvaluableType = TypeVar('EvaluableType')
class Evaluable(Generic[EvaluableType]):
def evaluate(self, evaluators: list[Evaluator]) -> EvaluableType:
raise NotImplementedError()
|
[
1,
515,
19229,
1053,
3251,
293,
29892,
5167,
9037,
13,
13,
3166,
289,
1581,
29889,
24219,
1061,
29889,
13248,
1053,
382,
4387,
1061,
13,
13,
29923,
4387,
519,
1542,
353,
5167,
9037,
877,
29923,
4387,
519,
1542,
1495,
13,
13,
13,
1990,
382,
4387,
519,
29898,
15809,
29961,
29923,
4387,
519,
1542,
29962,
1125,
13,
1678,
822,
14707,
29898,
1311,
29892,
6161,
4097,
29901,
1051,
29961,
29923,
4387,
1061,
2314,
1599,
382,
4387,
519,
1542,
29901,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
580,
13,
2
] |
Fairness_attack/data_utils.py
|
Ninarehm/attack
| 8 |
22929
|
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import json
import numpy as np
import scipy.sparse as sparse
import defenses
import upper_bounds
class NumpyEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.ndarray):
assert len(np.shape(obj)) == 1 # Can only handle 1D ndarrays
return obj.tolist()
elif isinstance(obj, np.floating):
return float(obj)
elif isinstance(obj, np.int16):
return str(obj)
else:
return super(NumpyEncoder, self).default(obj)
def get_class_map():
return {-1: 0, 1: 1}
def get_centroids(X, Y, class_map):
num_classes = len(set(Y))
num_features = X.shape[1]
centroids = np.zeros((num_classes, num_features))
for y in set(Y):
centroids[class_map[y], :] = np.mean(X[Y == y, :], axis=0)
return centroids
def get_centroid_vec(centroids):
assert centroids.shape[0] == 2
centroid_vec = centroids[0, :] - centroids[1, :]
centroid_vec /= np.linalg.norm(centroid_vec)
centroid_vec = np.reshape(centroid_vec, (1, -1))
return centroid_vec
# Can speed this up if necessary
def get_sqrt_inv_cov(X, Y, class_map):
num_classes = len(set(Y))
num_features = X.shape[1]
sqrt_inv_covs = np.zeros((num_classes, num_features, num_features))
for y in set(Y):
cov = np.cov(X[Y == y, :], rowvar=False)
U_cov, S_cov, _ = np.linalg.svd(cov + 1e-6 * np.eye(num_features))
print(' min eigenvalue of cov after 1e-6 reg is %s' % np.min(S_cov))
sqrt_inv_covs[class_map[y], ...] = U_cov.dot(np.diag(1 / np.sqrt(S_cov)).dot(U_cov.T))
return sqrt_inv_covs
# Can speed this up if necessary
def get_data_params(X, Y, percentile):
num_classes = len(set(Y))
num_features = X.shape[1]
centroids = np.zeros((num_classes, num_features))
class_map = get_class_map()
centroids = get_centroids(X, Y, class_map)
# Get radii for sphere
sphere_radii = np.zeros(2)
dists = defenses.compute_dists_under_Q(
X, Y,
Q=None,
centroids=centroids,
class_map=class_map,
norm=2)
for y in set(Y):
sphere_radii[class_map[y]] = np.percentile(dists[Y == y], percentile)
# Get vector between centroids
centroid_vec = get_centroid_vec(centroids)
# Get radii for slab
slab_radii = np.zeros(2)
for y in set(Y):
dists = np.abs(
(X[Y == y, :].dot(centroid_vec.T) - centroids[class_map[y], :].dot(centroid_vec.T)))
slab_radii[class_map[y]] = np.percentile(dists, percentile)
return class_map, centroids, centroid_vec, sphere_radii, slab_radii
def vstack(A, B):
if (sparse.issparse(A) or sparse.issparse(B)):
return sparse.vstack((A, B), format='csr')
else:
return np.concatenate((A, B), axis=0)
def add_points(x, y, X, Y, num_copies=1):
if num_copies == 0:
return X, Y
x = np.array(x).reshape(-1)
if sparse.issparse(X):
X_modified = sparse.vstack((
X,
sparse.csr_matrix(
np.tile(x, num_copies).reshape(-1, len(x)))))
else:
X_modified = np.append(
X,
np.tile(x, num_copies).reshape(-1, len(x)),
axis=0)
Y_modified = np.append(Y, np.tile(y, num_copies))
return X_modified, Y_modified
def copy_random_points(X, Y, mask_to_choose_from=None, target_class=1, num_copies=1,
random_seed=18, replace=False):
# Only copy from points where mask_to_choose_from == True
np.random.seed(random_seed)
combined_mask = (np.array(Y, dtype=int) == target_class)
if mask_to_choose_from is not None:
combined_mask = combined_mask & mask_to_choose_from
idx_to_copy = np.random.choice(
np.where(combined_mask)[0],
size=num_copies,
replace=replace)
if sparse.issparse(X):
X_modified = sparse.vstack((X, X[idx_to_copy, :]))
else:
X_modified = np.append(X, X[idx_to_copy, :], axis=0)
Y_modified = np.append(Y, Y[idx_to_copy])
return X_modified, Y_modified
def threshold(X):
return np.clip(X, 0, np.max(X))
def rround(X, random_seed=3, return_sparse=True):
if sparse.issparse(X):
X = X.toarray()
X_frac, X_int = np.modf(X)
X_round = X_int + (np.random.random_sample(X.shape) < X_frac)
if return_sparse:
return sparse.csr_matrix(X_round)
else:
return X_round
def rround_with_repeats(X, Y, repeat_points, random_seed=3, return_sparse=True):
X_round = rround(X, random_seed=random_seed, return_sparse=return_sparse)
assert Y.shape[0] == X.shape[0]
if repeat_points > 1:
pos_idx = 0
neg_idx = 0
for i in range(X_round.shape[0]):
if Y[i] == 1:
if pos_idx % repeat_points == 0:
last_pos_x = X_round[i, :]
else:
X_round[i, :] = last_pos_x
pos_idx += 1
else:
if neg_idx % repeat_points == 0:
last_neg_x = X_round[i, :]
else:
X_round[i, :] = last_neg_x
neg_idx += 1
return X_round
def project_onto_sphere(X, Y, radii, centroids, class_map):
for y in set(Y):
idx = class_map[y]
radius = radii[idx]
centroid = centroids[idx, :]
shifts_from_center = X[Y == y, :] - centroid
dists_from_center = np.linalg.norm(shifts_from_center, axis=1)
shifts_from_center[dists_from_center > radius, :] *= radius / np.reshape(dists_from_center[dists_from_center > radius], (-1, 1))
X[Y == y, :] = shifts_from_center + centroid
print("Number of (%s) points projected onto sphere: %s" % (y, np.sum(dists_from_center > radius)))
return X
def project_onto_slab(X, Y, v, radii, centroids, class_map):
"""
v^T x needs to be within radius of v^T centroid.
v is 1 x d and normalized.
"""
v = np.reshape(v / np.linalg.norm(v), (1, -1))
for y in set(Y):
idx = class_map[y]
radius = radii[idx]
centroid = centroids[idx, :]
# If v^T x is too large, then dists_along_v is positive
# If it's too small, then dists_along_v is negative
dists_along_v = (X[Y == y, :] - centroid).dot(v.T)
shifts_along_v = np.reshape(
dists_along_v - np.clip(dists_along_v, -radius, radius),
(1, -1))
X[Y == y, :] -= shifts_along_v.T.dot(v)
print("Number of (%s) points projected onto slab: %s" % (y, np.sum(np.abs(dists_along_v) > radius)))
return X
def get_projection_fn(
X_clean,
Y_clean,
sphere=True,
slab=True,
non_negative=False,
less_than_one=False,
use_lp_rounding=False,
percentile=90):
print(X_clean)
goal = 'find_nearest_point'
class_map, centroids, centroid_vec, sphere_radii, slab_radii = get_data_params(X_clean, Y_clean, percentile)
if use_lp_rounding or non_negative or less_than_one or (sphere and slab):
if use_lp_rounding:
projector = upper_bounds.Minimizer(
d=X_clean.shape[1],
use_sphere=sphere,
use_slab=slab,
non_negative=non_negative,
less_than_one=less_than_one,
constrain_max_loss=False,
goal=goal,
X=X_clean
)
projector = upper_bounds.Minimizer(
d=X_clean.shape[1],
use_sphere=sphere,
use_slab=slab,
non_negative=non_negative,
less_than_one=less_than_one,
constrain_max_loss=False,
goal=goal,
X=X_clean
)
else:
projector = upper_bounds.Minimizer(
d=X_clean.shape[1],
use_sphere=sphere,
use_slab=slab,
non_negative=non_negative,
less_than_one=less_than_one,
constrain_max_loss=False,
goal=goal
)
# Add back low-rank projection if we move back to just sphere+slab
def project_onto_feasible_set(
X, Y,
theta=None,
bias=None,
):
num_examples = X.shape[0]
proj_X = np.zeros_like(X)
for idx in range(num_examples):
x = X[idx, :]
y = Y[idx]
class_idx = class_map[y]
centroid = centroids[class_idx, :]
sphere_radius = sphere_radii[class_idx]
slab_radius = slab_radii[class_idx]
proj_X[idx, :] = projector.minimize_over_feasible_set(
None,
x,
centroid,
centroid_vec,
sphere_radius,
slab_radius)
num_projected = np.sum(np.max(X - proj_X, axis=1) > 1e-6)
print('Projected %s examples.' % num_projected)
return proj_X
else:
def project_onto_feasible_set(X, Y, theta=None, bias=None):
if sphere:
X = project_onto_sphere(X, Y, sphere_radii, centroids, class_map)
elif slab:
X = project_onto_slab(X, Y, centroid_vec, slab_radii, centroids, class_map)
return X
return project_onto_feasible_set
def filter_points_outside_feasible_set(X, Y,
centroids, centroid_vec,
sphere_radii, slab_radii,
class_map):
sphere_dists = defenses.compute_dists_under_Q(
X,
Y,
Q=None,
centroids=centroids,
class_map=class_map)
slab_dists = defenses.compute_dists_under_Q(
X,
Y,
Q=centroid_vec,
centroids=centroids,
class_map=class_map)
idx_to_keep = np.array([True] * X.shape[0])
for y in set(Y):
idx_to_keep[np.where(Y == y)[0][sphere_dists[Y == y] > sphere_radii[class_map[y]]]] = False
idx_to_keep[np.where(Y == y)[0][slab_dists[Y == y] > slab_radii[class_map[y]]]] = False
print(np.sum(idx_to_keep))
return X[idx_to_keep, :], Y[idx_to_keep]
|
[
1,
515,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
5215,
4390,
13,
5215,
12655,
408,
7442,
13,
5215,
4560,
2272,
29889,
29879,
5510,
408,
29234,
13,
13,
5215,
822,
11259,
13,
5215,
7568,
29918,
23687,
13,
13,
1990,
11848,
2272,
8566,
6119,
29898,
3126,
29889,
7249,
8566,
6119,
1125,
13,
1678,
822,
2322,
29898,
1311,
29892,
5446,
1125,
13,
4706,
565,
338,
8758,
29898,
5415,
29892,
7442,
29889,
299,
2378,
1125,
13,
9651,
4974,
7431,
29898,
9302,
29889,
12181,
29898,
5415,
876,
1275,
29871,
29896,
396,
1815,
871,
4386,
29871,
29896,
29928,
29871,
299,
2378,
29879,
13,
9651,
736,
5446,
29889,
25027,
391,
580,
13,
4706,
25342,
338,
8758,
29898,
5415,
29892,
7442,
29889,
29888,
417,
1218,
1125,
13,
9651,
736,
5785,
29898,
5415,
29897,
13,
4706,
25342,
338,
8758,
29898,
5415,
29892,
7442,
29889,
524,
29896,
29953,
1125,
13,
9651,
736,
851,
29898,
5415,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
2428,
29898,
8009,
2272,
8566,
6119,
29892,
1583,
467,
4381,
29898,
5415,
29897,
13,
13,
1753,
679,
29918,
1990,
29918,
1958,
7295,
13,
1678,
736,
21389,
29896,
29901,
29871,
29900,
29892,
29871,
29896,
29901,
29871,
29896,
29913,
13,
13,
1753,
679,
29918,
1760,
1007,
29879,
29898,
29990,
29892,
612,
29892,
770,
29918,
1958,
1125,
13,
1678,
954,
29918,
13203,
353,
7431,
29898,
842,
29898,
29979,
876,
13,
1678,
954,
29918,
22100,
353,
1060,
29889,
12181,
29961,
29896,
29962,
13,
1678,
1644,
1007,
29879,
353,
7442,
29889,
3298,
359,
3552,
1949,
29918,
13203,
29892,
954,
29918,
22100,
876,
13,
1678,
363,
343,
297,
731,
29898,
29979,
1125,
13,
4706,
1644,
1007,
29879,
29961,
1990,
29918,
1958,
29961,
29891,
1402,
584,
29962,
353,
7442,
29889,
12676,
29898,
29990,
29961,
29979,
1275,
343,
29892,
584,
1402,
9685,
29922,
29900,
29897,
13,
1678,
736,
1644,
1007,
29879,
13,
13,
1753,
679,
29918,
1760,
1007,
29918,
2003,
29898,
1760,
1007,
29879,
1125,
13,
1678,
4974,
1644,
1007,
29879,
29889,
12181,
29961,
29900,
29962,
1275,
29871,
29906,
13,
1678,
1644,
1007,
29918,
2003,
353,
1644,
1007,
29879,
29961,
29900,
29892,
584,
29962,
448,
1644,
1007,
29879,
29961,
29896,
29892,
584,
29962,
13,
1678,
1644,
1007,
29918,
2003,
847,
29922,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
1760,
1007,
29918,
2003,
29897,
13,
1678,
1644,
1007,
29918,
2003,
353,
7442,
29889,
690,
14443,
29898,
1760,
1007,
29918,
2003,
29892,
313,
29896,
29892,
448,
29896,
876,
13,
1678,
736,
1644,
1007,
29918,
2003,
13,
13,
29937,
1815,
6210,
445,
701,
565,
5181,
13,
1753,
679,
29918,
3676,
29918,
11569,
29918,
24542,
29898,
29990,
29892,
612,
29892,
770,
29918,
1958,
1125,
13,
1678,
954,
29918,
13203,
353,
7431,
29898,
842,
29898,
29979,
876,
13,
1678,
954,
29918,
22100,
353,
1060,
29889,
12181,
29961,
29896,
29962,
13,
1678,
18074,
2273,
29918,
11569,
29918,
24542,
29879,
353,
7442,
29889,
3298,
359,
3552,
1949,
29918,
13203,
29892,
954,
29918,
22100,
29892,
954,
29918,
22100,
876,
13,
13,
1678,
363,
343,
297,
731,
29898,
29979,
1125,
13,
4706,
18838,
353,
7442,
29889,
24542,
29898,
29990,
29961,
29979,
1275,
343,
29892,
584,
1402,
1948,
1707,
29922,
8824,
29897,
13,
4706,
501,
29918,
24542,
29892,
317,
29918,
24542,
29892,
903,
353,
7442,
29889,
29880,
979,
29887,
29889,
4501,
29881,
29898,
24542,
718,
29871,
29896,
29872,
29899,
29953,
334,
7442,
29889,
1032,
29872,
29898,
1949,
29918,
22100,
876,
13,
4706,
1596,
877,
1678,
1375,
7388,
1767,
310,
18838,
1156,
29871,
29896,
29872,
29899,
29953,
1072,
338,
1273,
29879,
29915,
1273,
7442,
29889,
1195,
29898,
29903,
29918,
24542,
876,
13,
4706,
18074,
2273,
29918,
11569,
29918,
24542,
29879,
29961,
1990,
29918,
1958,
29961,
29891,
1402,
2023,
29962,
353,
501,
29918,
24542,
29889,
6333,
29898,
9302,
29889,
6051,
351,
29898,
29896,
847,
7442,
29889,
3676,
29898,
29903,
29918,
24542,
8106,
6333,
29898,
29965,
29918,
24542,
29889,
29911,
876,
13,
13,
1678,
736,
18074,
2273,
29918,
11569,
29918,
24542,
29879,
13,
13,
29937,
1815,
6210,
445,
701,
565,
5181,
13,
1753,
679,
29918,
1272,
29918,
7529,
29898,
29990,
29892,
612,
29892,
10151,
488,
1125,
13,
1678,
954,
29918,
13203,
353,
7431,
29898,
842,
29898,
29979,
876,
13,
1678,
954,
29918,
22100,
353,
1060,
29889,
12181,
29961,
29896,
29962,
13,
1678,
1644,
1007,
29879,
353,
7442,
29889,
3298,
359,
3552,
1949,
29918,
13203,
29892,
954,
29918,
22100,
876,
13,
1678,
770,
29918,
1958,
353,
679,
29918,
1990,
29918,
1958,
580,
13,
1678,
1644,
1007,
29879,
353,
679,
29918,
1760,
1007,
29879,
29898,
29990,
29892,
612,
29892,
770,
29918,
1958,
29897,
13,
13,
1678,
396,
3617,
2971,
2236,
363,
20745,
13,
1678,
20745,
29918,
3665,
2236,
353,
7442,
29889,
3298,
359,
29898,
29906,
29897,
13,
1678,
1320,
29879,
353,
822,
11259,
29889,
26017,
29918,
29881,
2879,
29918,
5062,
29918,
29984,
29898,
13,
4706,
1060,
29892,
612,
29892,
13,
4706,
660,
29922,
8516,
29892,
13,
4706,
1644,
1007,
29879,
29922,
1760,
1007,
29879,
29892,
13,
4706,
770,
29918,
1958,
29922,
1990,
29918,
1958,
29892,
13,
4706,
6056,
29922,
29906,
29897,
13,
1678,
363,
343,
297,
731,
29898,
29979,
1125,
13,
4706,
20745,
29918,
3665,
2236,
29961,
1990,
29918,
1958,
29961,
29891,
5262,
353,
7442,
29889,
25376,
488,
29898,
29881,
2879,
29961,
29979,
1275,
343,
1402,
10151,
488,
29897,
13,
13,
1678,
396,
3617,
4608,
1546,
1644,
1007,
29879,
13,
1678,
1644,
1007,
29918,
2003,
353,
679,
29918,
1760,
1007,
29918,
2003,
29898,
1760,
1007,
29879,
29897,
13,
13,
1678,
396,
3617,
2971,
2236,
363,
2243,
370,
13,
1678,
2243,
370,
29918,
3665,
2236,
353,
7442,
29889,
3298,
359,
29898,
29906,
29897,
13,
1678,
363,
343,
297,
731,
29898,
29979,
1125,
13,
4706,
1320,
29879,
353,
7442,
29889,
6897,
29898,
13,
9651,
313,
29990,
29961,
29979,
1275,
343,
29892,
584,
1822,
6333,
29898,
1760,
1007,
29918,
2003,
29889,
29911,
29897,
448,
1644,
1007,
29879,
29961,
1990,
29918,
1958,
29961,
29891,
1402,
584,
1822,
6333,
29898,
1760,
1007,
29918,
2003,
29889,
29911,
4961,
13,
4706,
2243,
370,
29918,
3665,
2236,
29961,
1990,
29918,
1958,
29961,
29891,
5262,
353,
7442,
29889,
25376,
488,
29898,
29881,
2879,
29892,
10151,
488,
29897,
13,
13,
1678,
736,
770,
29918,
1958,
29892,
1644,
1007,
29879,
29892,
1644,
1007,
29918,
2003,
29892,
20745,
29918,
3665,
2236,
29892,
2243,
370,
29918,
3665,
2236,
13,
13,
13,
1753,
325,
1429,
29898,
29909,
29892,
350,
1125,
13,
1678,
565,
313,
29879,
5510,
29889,
790,
5510,
29898,
29909,
29897,
470,
29234,
29889,
790,
5510,
29898,
29933,
22164,
13,
4706,
736,
29234,
29889,
29894,
1429,
3552,
29909,
29892,
350,
511,
3402,
2433,
2395,
29878,
1495,
13,
1678,
1683,
29901,
13,
4706,
736,
7442,
29889,
535,
29883,
2579,
403,
3552,
29909,
29892,
350,
511,
9685,
29922,
29900,
29897,
13,
13,
13,
1753,
788,
29918,
9748,
29898,
29916,
29892,
343,
29892,
1060,
29892,
612,
29892,
954,
29918,
9708,
583,
29922,
29896,
1125,
13,
1678,
565,
954,
29918,
9708,
583,
1275,
29871,
29900,
29901,
13,
4706,
736,
1060,
29892,
612,
13,
1678,
921,
353,
7442,
29889,
2378,
29898,
29916,
467,
690,
14443,
6278,
29896,
29897,
13,
13,
1678,
565,
29234,
29889,
790,
5510,
29898,
29990,
1125,
13,
4706,
1060,
29918,
1545,
2164,
353,
29234,
29889,
29894,
1429,
3552,
13,
9651,
1060,
29892,
13,
9651,
29234,
29889,
2395,
29878,
29918,
5344,
29898,
13,
18884,
7442,
29889,
29873,
488,
29898,
29916,
29892,
954,
29918,
9708,
583,
467,
690,
14443,
6278,
29896,
29892,
7431,
29898,
29916,
876,
4961,
13,
1678,
1683,
29901,
13,
4706,
1060,
29918,
1545,
2164,
353,
7442,
29889,
4397,
29898,
13,
9651,
1060,
29892,
13,
9651,
7442,
29889,
29873,
488,
29898,
29916,
29892,
954,
29918,
9708,
583,
467,
690,
14443,
6278,
29896,
29892,
7431,
29898,
29916,
8243,
13,
9651,
9685,
29922,
29900,
29897,
13,
1678,
612,
29918,
1545,
2164,
353,
7442,
29889,
4397,
29898,
29979,
29892,
7442,
29889,
29873,
488,
29898,
29891,
29892,
954,
29918,
9708,
583,
876,
13,
1678,
736,
1060,
29918,
1545,
2164,
29892,
612,
29918,
1545,
2164,
13,
13,
13,
1753,
3509,
29918,
8172,
29918,
9748,
29898,
29990,
29892,
612,
29892,
11105,
29918,
517,
29918,
21803,
29918,
3166,
29922,
8516,
29892,
3646,
29918,
1990,
29922,
29896,
29892,
954,
29918,
9708,
583,
29922,
29896,
29892,
13,
462,
539,
4036,
29918,
26776,
29922,
29896,
29947,
29892,
5191,
29922,
8824,
1125,
13,
1678,
396,
9333,
3509,
515,
3291,
988,
11105,
29918,
517,
29918,
21803,
29918,
3166,
1275,
5852,
13,
13,
1678,
7442,
29889,
8172,
29889,
26776,
29898,
8172,
29918,
26776,
29897,
13,
1678,
12420,
29918,
13168,
353,
313,
9302,
29889,
2378,
29898,
29979,
29892,
26688,
29922,
524,
29897,
1275,
3646,
29918,
1990,
29897,
13,
1678,
565,
11105,
29918,
517,
29918,
21803,
29918,
3166,
338,
451,
6213,
29901,
13,
4706,
12420,
29918,
13168,
353,
12420,
29918,
13168,
669,
11105,
29918,
517,
29918,
21803,
29918,
3166,
13,
13,
1678,
22645,
29918,
517,
29918,
8552,
353,
7442,
29889,
8172,
29889,
16957,
29898,
13,
4706,
7442,
29889,
3062,
29898,
17743,
1312,
29918,
13168,
9601,
29900,
1402,
13,
4706,
2159,
29922,
1949,
29918,
9708,
583,
29892,
13,
4706,
5191,
29922,
6506,
29897,
13,
13,
1678,
565,
29234,
29889,
790,
5510,
29898,
29990,
1125,
13,
4706,
1060,
29918,
1545,
2164,
353,
29234,
29889,
29894,
1429,
3552,
29990,
29892,
1060,
29961,
13140,
29918,
517,
29918,
8552,
29892,
584,
12622,
13,
1678,
1683,
29901,
13,
4706,
1060,
29918,
1545,
2164,
353,
7442,
29889,
4397,
29898,
29990,
29892,
1060,
29961,
13140,
29918,
517,
29918,
8552,
29892,
584,
1402,
9685,
29922,
29900,
29897,
13,
1678,
612,
29918,
1545,
2164,
353,
7442,
29889,
4397,
29898,
29979,
29892,
612,
29961,
13140,
29918,
517,
29918,
8552,
2314,
13,
1678,
736,
1060,
29918,
1545,
2164,
29892,
612,
29918,
1545,
2164,
13,
13,
13,
1753,
16897,
29898,
29990,
1125,
13,
1678,
736,
7442,
29889,
24049,
29898,
29990,
29892,
29871,
29900,
29892,
7442,
29889,
3317,
29898,
29990,
876,
13,
13,
13,
1753,
364,
14486,
29898,
29990,
29892,
4036,
29918,
26776,
29922,
29941,
29892,
736,
29918,
29879,
5510,
29922,
5574,
1125,
13,
1678,
565,
29234,
29889,
790,
5510,
29898,
29990,
1125,
13,
4706,
1060,
353,
1060,
29889,
517,
2378,
580,
13,
13,
1678,
1060,
29918,
1154,
29892,
1060,
29918,
524,
353,
7442,
29889,
1545,
29888,
29898,
29990,
29897,
13,
1678,
1060,
29918,
14486,
353,
1060,
29918,
524,
718,
313,
9302,
29889,
8172,
29889,
8172,
29918,
11249,
29898,
29990,
29889,
12181,
29897,
529,
1060,
29918,
1154,
29897,
13,
1678,
565,
736,
29918,
29879,
5510,
29901,
13,
4706,
736,
29234,
29889,
2395,
29878,
29918,
5344,
29898,
29990,
29918,
14486,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
1060,
29918,
14486,
13,
13,
13,
1753,
364,
14486,
29918,
2541,
29918,
276,
412,
1446,
29898,
29990,
29892,
612,
29892,
12312,
29918,
9748,
29892,
4036,
29918,
26776,
29922,
29941,
29892,
736,
29918,
29879,
5510,
29922,
5574,
1125,
13,
13,
1678,
1060,
29918,
14486,
353,
364,
14486,
29898,
29990,
29892,
4036,
29918,
26776,
29922,
8172,
29918,
26776,
29892,
736,
29918,
29879,
5510,
29922,
2457,
29918,
29879,
5510,
29897,
13,
13,
1678,
4974,
612,
29889,
12181,
29961,
29900,
29962,
1275,
1060,
29889,
12181,
29961,
29900,
29962,
13,
13,
1678,
565,
12312,
29918,
9748,
1405,
29871,
29896,
29901,
13,
4706,
926,
29918,
13140,
353,
29871,
29900,
13,
4706,
3480,
29918,
13140,
353,
29871,
29900,
13,
4706,
363,
474,
297,
3464,
29898,
29990,
29918,
14486,
29889,
12181,
29961,
29900,
29962,
1125,
13,
9651,
565,
612,
29961,
29875,
29962,
1275,
29871,
29896,
29901,
13,
18884,
565,
926,
29918,
13140,
1273,
12312,
29918,
9748,
1275,
29871,
29900,
29901,
13,
462,
1678,
1833,
29918,
1066,
29918,
29916,
353,
1060,
29918,
14486,
29961,
29875,
29892,
584,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
1060,
29918,
14486,
29961,
29875,
29892,
584,
29962,
353,
1833,
29918,
1066,
29918,
29916,
13,
18884,
926,
29918,
13140,
4619,
29871,
29896,
13,
9651,
1683,
29901,
13,
18884,
565,
3480,
29918,
13140,
1273,
12312,
29918,
9748,
1275,
29871,
29900,
29901,
13,
462,
1678,
1833,
29918,
10052,
29918,
29916,
353,
1060,
29918,
14486,
29961,
29875,
29892,
584,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
1060,
29918,
14486,
29961,
29875,
29892,
584,
29962,
353,
1833,
29918,
10052,
29918,
29916,
13,
18884,
3480,
29918,
13140,
4619,
29871,
29896,
13,
13,
1678,
736,
1060,
29918,
14486,
13,
13,
13,
1753,
2060,
29918,
10268,
29918,
29879,
9085,
29898,
29990,
29892,
612,
29892,
2971,
2236,
29892,
1644,
1007,
29879,
29892,
770,
29918,
1958,
1125,
13,
13,
1678,
363,
343,
297,
731,
29898,
29979,
1125,
13,
4706,
22645,
353,
770,
29918,
1958,
29961,
29891,
29962,
13,
4706,
11855,
353,
2971,
2236,
29961,
13140,
29962,
13,
4706,
1644,
1007,
353,
1644,
1007,
29879,
29961,
13140,
29892,
584,
29962,
13,
13,
4706,
528,
17741,
29918,
3166,
29918,
5064,
353,
1060,
29961,
29979,
1275,
343,
29892,
584,
29962,
448,
1644,
1007,
13,
4706,
1320,
29879,
29918,
3166,
29918,
5064,
353,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
845,
17741,
29918,
3166,
29918,
5064,
29892,
9685,
29922,
29896,
29897,
13,
13,
4706,
528,
17741,
29918,
3166,
29918,
5064,
29961,
29881,
2879,
29918,
3166,
29918,
5064,
1405,
11855,
29892,
584,
29962,
334,
29922,
11855,
847,
7442,
29889,
690,
14443,
29898,
29881,
2879,
29918,
3166,
29918,
5064,
29961,
29881,
2879,
29918,
3166,
29918,
5064,
1405,
11855,
1402,
8521,
29896,
29892,
29871,
29896,
876,
13,
4706,
1060,
29961,
29979,
1275,
343,
29892,
584,
29962,
353,
528,
17741,
29918,
3166,
29918,
5064,
718,
1644,
1007,
13,
13,
4706,
1596,
703,
4557,
310,
313,
29995,
29879,
29897,
3291,
2060,
287,
11480,
20745,
29901,
1273,
29879,
29908,
1273,
313,
29891,
29892,
7442,
29889,
2083,
29898,
29881,
2879,
29918,
3166,
29918,
5064,
1405,
11855,
4961,
13,
13,
1678,
736,
1060,
13,
13,
13,
1753,
2060,
29918,
10268,
29918,
2536,
370,
29898,
29990,
29892,
612,
29892,
325,
29892,
2971,
2236,
29892,
1644,
1007,
29879,
29892,
770,
29918,
1958,
1125,
13,
1678,
9995,
13,
1678,
325,
29985,
29911,
921,
4225,
304,
367,
2629,
11855,
310,
325,
29985,
29911,
1644,
1007,
29889,
13,
1678,
325,
338,
29871,
29896,
921,
270,
322,
4226,
1891,
29889,
13,
1678,
9995,
13,
1678,
325,
353,
7442,
29889,
690,
14443,
29898,
29894,
847,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
29894,
511,
313,
29896,
29892,
448,
29896,
876,
13,
13,
1678,
363,
343,
297,
731,
29898,
29979,
1125,
13,
4706,
22645,
353,
770,
29918,
1958,
29961,
29891,
29962,
13,
4706,
11855,
353,
2971,
2236,
29961,
13140,
29962,
13,
4706,
1644,
1007,
353,
1644,
1007,
29879,
29961,
13140,
29892,
584,
29962,
13,
13,
4706,
396,
960,
325,
29985,
29911,
921,
338,
2086,
2919,
29892,
769,
1320,
29879,
29918,
284,
549,
29918,
29894,
338,
6374,
13,
4706,
396,
960,
372,
29915,
29879,
2086,
2319,
29892,
769,
1320,
29879,
29918,
284,
549,
29918,
29894,
338,
8178,
13,
4706,
1320,
29879,
29918,
284,
549,
29918,
29894,
353,
313,
29990,
29961,
29979,
1275,
343,
29892,
584,
29962,
448,
1644,
1007,
467,
6333,
29898,
29894,
29889,
29911,
29897,
13,
4706,
528,
17741,
29918,
284,
549,
29918,
29894,
353,
7442,
29889,
690,
14443,
29898,
13,
9651,
1320,
29879,
29918,
284,
549,
29918,
29894,
448,
7442,
29889,
24049,
29898,
29881,
2879,
29918,
284,
549,
29918,
29894,
29892,
448,
13471,
29892,
11855,
511,
13,
9651,
313,
29896,
29892,
448,
29896,
876,
13,
4706,
1060,
29961,
29979,
1275,
343,
29892,
584,
29962,
22361,
528,
17741,
29918,
284,
549,
29918,
29894,
29889,
29911,
29889,
6333,
29898,
29894,
29897,
13,
13,
4706,
1596,
703,
4557,
310,
313,
29995,
29879,
29897,
3291,
2060,
287,
11480,
2243,
370,
29901,
1273,
29879,
29908,
1273,
313,
29891,
29892,
7442,
29889,
2083,
29898,
9302,
29889,
6897,
29898,
29881,
2879,
29918,
284,
549,
29918,
29894,
29897,
1405,
11855,
4961,
13,
13,
1678,
736,
1060,
13,
13,
1753,
679,
29918,
771,
6929,
29918,
9144,
29898,
13,
1678,
1060,
29918,
14941,
29892,
13,
1678,
612,
29918,
14941,
29892,
13,
1678,
20745,
29922,
5574,
29892,
13,
1678,
2243,
370,
29922,
5574,
29892,
13,
1678,
1661,
29918,
22198,
29922,
8824,
29892,
13,
1678,
3109,
29918,
27603,
29918,
650,
29922,
8824,
29892,
13,
1678,
671,
29918,
22833,
29918,
29878,
12449,
29922,
8824,
29892,
13,
1678,
10151,
488,
29922,
29929,
29900,
1125,
13,
1678,
1596,
29898,
29990,
29918,
14941,
29897,
13,
1678,
7306,
353,
525,
2886,
29918,
28502,
342,
29918,
3149,
29915,
13,
1678,
770,
29918,
1958,
29892,
1644,
1007,
29879,
29892,
1644,
1007,
29918,
2003,
29892,
20745,
29918,
3665,
2236,
29892,
2243,
370,
29918,
3665,
2236,
353,
679,
29918,
1272,
29918,
7529,
29898,
29990,
29918,
14941,
29892,
612,
29918,
14941,
29892,
10151,
488,
29897,
13,
1678,
565,
671,
29918,
22833,
29918,
29878,
12449,
470,
1661,
29918,
22198,
470,
3109,
29918,
27603,
29918,
650,
470,
313,
29879,
9085,
322,
2243,
370,
1125,
13,
4706,
565,
671,
29918,
22833,
29918,
29878,
12449,
29901,
13,
9651,
2060,
272,
353,
7568,
29918,
23687,
29889,
8140,
326,
3950,
29898,
13,
18884,
270,
29922,
29990,
29918,
14941,
29889,
12181,
29961,
29896,
1402,
13,
18884,
671,
29918,
29879,
9085,
29922,
29879,
9085,
29892,
13,
18884,
671,
29918,
2536,
370,
29922,
2536,
370,
29892,
13,
18884,
1661,
29918,
22198,
29922,
5464,
29918,
22198,
29892,
13,
18884,
3109,
29918,
27603,
29918,
650,
29922,
2222,
29918,
27603,
29918,
650,
29892,
13,
18884,
1040,
6038,
29918,
3317,
29918,
6758,
29922,
8824,
29892,
13,
18884,
7306,
29922,
28111,
29892,
13,
18884,
1060,
29922,
29990,
29918,
14941,
13,
18884,
1723,
13,
9651,
2060,
272,
353,
7568,
29918,
23687,
29889,
8140,
326,
3950,
29898,
13,
18884,
270,
29922,
29990,
29918,
14941,
29889,
12181,
29961,
29896,
1402,
13,
18884,
671,
29918,
29879,
9085,
29922,
29879,
9085,
29892,
13,
18884,
671,
29918,
2536,
370,
29922,
2536,
370,
29892,
13,
18884,
1661,
29918,
22198,
29922,
5464,
29918,
22198,
29892,
13,
18884,
3109,
29918,
27603,
29918,
650,
29922,
2222,
29918,
27603,
29918,
650,
29892,
13,
18884,
1040,
6038,
29918,
3317,
29918,
6758,
29922,
8824,
29892,
13,
18884,
7306,
29922,
28111,
29892,
13,
18884,
1060,
29922,
29990,
29918,
14941,
13,
18884,
1723,
13,
4706,
1683,
29901,
13,
9651,
2060,
272,
353,
7568,
29918,
23687,
29889,
8140,
326,
3950,
29898,
13,
18884,
270,
29922,
29990,
29918,
14941,
29889,
12181,
29961,
29896,
1402,
13,
18884,
671,
29918,
29879,
9085,
29922,
29879,
9085,
29892,
13,
18884,
671,
29918,
2536,
370,
29922,
2536,
370,
29892,
13,
18884,
1661,
29918,
22198,
29922,
5464,
29918,
22198,
29892,
13,
18884,
3109,
29918,
27603,
29918,
650,
29922,
2222,
29918,
27603,
29918,
650,
29892,
13,
18884,
1040,
6038,
29918,
3317,
29918,
6758,
29922,
8824,
29892,
13,
18884,
7306,
29922,
28111,
13,
18884,
1723,
13,
13,
4706,
396,
3462,
1250,
4482,
29899,
10003,
18246,
565,
591,
4337,
1250,
304,
925,
20745,
29974,
2536,
370,
13,
4706,
822,
2060,
29918,
10268,
29918,
1725,
294,
1821,
29918,
842,
29898,
13,
9651,
1060,
29892,
612,
29892,
13,
9651,
278,
941,
29922,
8516,
29892,
13,
9651,
24003,
29922,
8516,
29892,
13,
632,
1125,
13,
9651,
954,
29918,
19057,
353,
1060,
29889,
12181,
29961,
29900,
29962,
13,
9651,
410,
29926,
29918,
29990,
353,
7442,
29889,
3298,
359,
29918,
4561,
29898,
29990,
29897,
13,
13,
9651,
363,
22645,
297,
3464,
29898,
1949,
29918,
19057,
1125,
13,
18884,
921,
353,
1060,
29961,
13140,
29892,
584,
29962,
13,
18884,
343,
353,
612,
29961,
13140,
29962,
13,
18884,
770,
29918,
13140,
353,
770,
29918,
1958,
29961,
29891,
29962,
13,
13,
18884,
1644,
1007,
353,
1644,
1007,
29879,
29961,
1990,
29918,
13140,
29892,
584,
29962,
13,
18884,
20745,
29918,
13471,
353,
20745,
29918,
3665,
2236,
29961,
1990,
29918,
13140,
29962,
13,
18884,
2243,
370,
29918,
13471,
353,
2243,
370,
29918,
3665,
2236,
29961,
1990,
29918,
13140,
29962,
13,
18884,
410,
29926,
29918,
29990,
29961,
13140,
29892,
584,
29962,
353,
2060,
272,
29889,
1195,
326,
675,
29918,
957,
29918,
1725,
294,
1821,
29918,
842,
29898,
13,
462,
1678,
6213,
29892,
13,
462,
1678,
921,
29892,
13,
462,
1678,
1644,
1007,
29892,
13,
462,
1678,
1644,
1007,
29918,
2003,
29892,
13,
462,
1678,
20745,
29918,
13471,
29892,
13,
462,
1678,
2243,
370,
29918,
13471,
29897,
13,
13,
9651,
954,
29918,
4836,
287,
353,
7442,
29889,
2083,
29898,
9302,
29889,
3317,
29898,
29990,
448,
410,
29926,
29918,
29990,
29892,
9685,
29922,
29896,
29897,
1405,
29871,
29896,
29872,
29899,
29953,
29897,
13,
9651,
1596,
877,
7653,
287,
1273,
29879,
6455,
6169,
1273,
954,
29918,
4836,
287,
29897,
13,
9651,
736,
410,
29926,
29918,
29990,
13,
13,
1678,
1683,
29901,
13,
4706,
822,
2060,
29918,
10268,
29918,
1725,
294,
1821,
29918,
842,
29898,
29990,
29892,
612,
29892,
278,
941,
29922,
8516,
29892,
24003,
29922,
8516,
1125,
13,
9651,
565,
20745,
29901,
13,
18884,
1060,
353,
2060,
29918,
10268,
29918,
29879,
9085,
29898,
29990,
29892,
612,
29892,
20745,
29918,
3665,
2236,
29892,
1644,
1007,
29879,
29892,
770,
29918,
1958,
29897,
13,
13,
9651,
25342,
2243,
370,
29901,
13,
18884,
1060,
353,
2060,
29918,
10268,
29918,
2536,
370,
29898,
29990,
29892,
612,
29892,
1644,
1007,
29918,
2003,
29892,
2243,
370,
29918,
3665,
2236,
29892,
1644,
1007,
29879,
29892,
770,
29918,
1958,
29897,
13,
9651,
736,
1060,
13,
13,
1678,
736,
2060,
29918,
10268,
29918,
1725,
294,
1821,
29918,
842,
13,
13,
13,
1753,
4175,
29918,
9748,
29918,
449,
2975,
29918,
1725,
294,
1821,
29918,
842,
29898,
29990,
29892,
612,
29892,
13,
462,
462,
539,
1644,
1007,
29879,
29892,
1644,
1007,
29918,
2003,
29892,
13,
462,
462,
539,
20745,
29918,
3665,
2236,
29892,
2243,
370,
29918,
3665,
2236,
29892,
13,
462,
462,
539,
770,
29918,
1958,
1125,
13,
1678,
20745,
29918,
29881,
2879,
353,
822,
11259,
29889,
26017,
29918,
29881,
2879,
29918,
5062,
29918,
29984,
29898,
13,
4706,
1060,
29892,
13,
4706,
612,
29892,
13,
4706,
660,
29922,
8516,
29892,
13,
4706,
1644,
1007,
29879,
29922,
1760,
1007,
29879,
29892,
13,
4706,
770,
29918,
1958,
29922,
1990,
29918,
1958,
29897,
13,
1678,
2243,
370,
29918,
29881,
2879,
353,
822,
11259,
29889,
26017,
29918,
29881,
2879,
29918,
5062,
29918,
29984,
29898,
13,
4706,
1060,
29892,
13,
4706,
612,
29892,
13,
4706,
660,
29922,
1760,
1007,
29918,
2003,
29892,
13,
4706,
1644,
1007,
29879,
29922,
1760,
1007,
29879,
29892,
13,
4706,
770,
29918,
1958,
29922,
1990,
29918,
1958,
29897,
13,
13,
1678,
22645,
29918,
517,
29918,
17462,
353,
7442,
29889,
2378,
4197,
5574,
29962,
334,
1060,
29889,
12181,
29961,
29900,
2314,
13,
1678,
363,
343,
297,
731,
29898,
29979,
1125,
13,
4706,
22645,
29918,
517,
29918,
17462,
29961,
9302,
29889,
3062,
29898,
29979,
1275,
343,
9601,
29900,
3816,
29879,
9085,
29918,
29881,
2879,
29961,
29979,
1275,
343,
29962,
1405,
20745,
29918,
3665,
2236,
29961,
1990,
29918,
1958,
29961,
29891,
5262,
5262,
353,
7700,
13,
4706,
22645,
29918,
517,
29918,
17462,
29961,
9302,
29889,
3062,
29898,
29979,
1275,
343,
9601,
29900,
3816,
2536,
370,
29918,
29881,
2879,
29961,
29979,
1275,
343,
29962,
1405,
2243,
370,
29918,
3665,
2236,
29961,
1990,
29918,
1958,
29961,
29891,
5262,
5262,
353,
7700,
13,
13,
1678,
1596,
29898,
9302,
29889,
2083,
29898,
13140,
29918,
517,
29918,
17462,
876,
13,
1678,
736,
1060,
29961,
13140,
29918,
517,
29918,
17462,
29892,
584,
1402,
612,
29961,
13140,
29918,
517,
29918,
17462,
29962,
13,
2
] |
hw/hw02/tests/q5.py
|
surajrampure/data-94-sp21
| 1 |
42559
|
<gh_stars>1-10
test = { 'name': 'q5',
'points': 3,
'suites': [ { 'cases': [ {'code': ">>> big_tippers(['suraj', 15, 'isaac', 9, 'angela', 19]) == ['suraj', 'angela']\nTrue", 'hidden': False, 'locked': False},
{ 'code': ">>> big_tippers(['suraj', 15, 'isaac', 25, 'angela', 19, 'anna', 21, 'aayush', 14, 'sukrit', 8]) == ['isaac', 'angela', 'anna']\nTrue",
'hidden': False,
'locked': False},
{ 'code': '>>> # If you fail this, note that we want the names of those who tipped MORE than the average,;\n'
'>>> # not equal to or more than;\n'
">>> big_tippers(['a', 2, 'b', 2, 'c', 2]) == []\n"
'True',
'hidden': False,
'locked': False}],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'}]}
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
1688,
353,
426,
259,
525,
978,
2396,
525,
29939,
29945,
742,
13,
1678,
525,
9748,
2396,
29871,
29941,
29892,
13,
1678,
525,
2146,
3246,
2396,
518,
259,
426,
259,
525,
11436,
2396,
518,
259,
11117,
401,
2396,
376,
6778,
29958,
4802,
29918,
2034,
22437,
18959,
7610,
1175,
742,
29871,
29896,
29945,
29892,
525,
8069,
562,
742,
29871,
29929,
29892,
525,
574,
3100,
742,
29871,
29896,
29929,
2314,
1275,
6024,
7610,
1175,
742,
525,
574,
3100,
2033,
29905,
29876,
5574,
613,
525,
10892,
2396,
7700,
29892,
525,
29113,
2396,
7700,
1118,
13,
462,
462,
259,
426,
259,
525,
401,
2396,
376,
6778,
29958,
4802,
29918,
2034,
22437,
18959,
7610,
1175,
742,
29871,
29896,
29945,
29892,
525,
8069,
562,
742,
29871,
29906,
29945,
29892,
525,
574,
3100,
742,
29871,
29896,
29929,
29892,
525,
9713,
742,
29871,
29906,
29896,
29892,
525,
29874,
388,
1878,
742,
29871,
29896,
29946,
29892,
525,
2146,
29895,
768,
742,
29871,
29947,
2314,
1275,
6024,
8069,
562,
742,
525,
574,
3100,
742,
525,
9713,
2033,
29905,
29876,
5574,
613,
13,
462,
462,
539,
525,
10892,
2396,
7700,
29892,
13,
462,
462,
539,
525,
29113,
2396,
7700,
1118,
13,
462,
462,
259,
426,
259,
525,
401,
2396,
525,
6778,
29958,
396,
960,
366,
4418,
445,
29892,
4443,
393,
591,
864,
278,
2983,
310,
1906,
1058,
260,
16242,
16999,
1525,
1135,
278,
6588,
29892,
10436,
29876,
29915,
13,
462,
462,
1669,
525,
6778,
29958,
396,
451,
5186,
304,
470,
901,
1135,
10436,
29876,
29915,
13,
462,
462,
1669,
376,
6778,
29958,
4802,
29918,
2034,
22437,
18959,
29874,
742,
29871,
29906,
29892,
525,
29890,
742,
29871,
29906,
29892,
525,
29883,
742,
29871,
29906,
2314,
1275,
5159,
29905,
29876,
29908,
13,
462,
462,
1669,
525,
5574,
742,
13,
462,
462,
539,
525,
10892,
2396,
7700,
29892,
13,
462,
462,
539,
525,
29113,
2396,
7700,
29913,
1402,
13,
462,
418,
525,
1557,
4395,
2396,
5852,
29892,
13,
462,
418,
525,
14669,
2396,
15516,
13,
462,
418,
525,
371,
538,
776,
2396,
15516,
13,
462,
418,
525,
1853,
2396,
525,
1867,
312,
342,
29915,
6525,
29913,
13,
2
] |
timemachines/skaters/nproph/nprophetiskaterfactory.py
|
iklasky/timemachines
| 253 |
25385
|
<filename>timemachines/skaters/nproph/nprophetiskaterfactory.py
from timemachines.skaters.nproph.nprophetinclusion import using_neuralprophet, NeuralProphet
if using_neuralprophet:
import pandas as pd
from typing import List, Tuple, Any
from timemachines.skatertools.utilities.conventions import wrap
from timemachines.skaters.nproph.nprophparams import NPROPHET_MODEL, NPROPHET_META
def nprophet_iskater_factory(y: [[float]], k: int, a: List = None, t: List = None, e=None, freq: str = None, n_max=1000,
recursive: bool = False, model_params: dict = None, return_forecast=True):
# For now we keep it simple. Will add to this over time
y0s = [wrap(yi)[0] for yi in y]
x, x_std, forecast,m = nprophet_fit_and_predict_simple(y=y0s,k=k,freq=freq,model_params=model_params)
return (x, x_std, forecast, m) if return_forecast else (x, x_std)
def nprophet_fit_and_predict_simple(y: [float], k: int, freq: str = None, model_params: dict = None) -> Tuple[
List, List, Any, Any]:
""" Simpler wrapper for offlinetesting - univariate only """
assert isinstance(y[0],float)
freq = freq or NPROPHET_META['freq']
used_params = NPROPHET_MODEL
used_params.update({'n_forecasts':k})
if model_params:
used_params.update(model_params)
if len(y)<used_params['n_lags']:
x = [wrap(y)[0]]*k
x_std = [1.0]*k
return x, x_std, None, None
else:
model = NeuralProphet(**used_params)
df = pd.DataFrame(columns=['y'], data=y)
df['ds'] = pd.date_range(start='2021-01-01', periods=len(y), freq=freq)
metrics = model.fit(df, freq=freq, epochs=40, progress_bar=False)
future = model.make_future_dataframe(df)
forecast = model.predict(future)
x = [ forecast['yhat'+str(j+1)].values[-k+j] for j in range(k) ]
x_std = [1.0]*k
return x, x_std, forecast, model
if __name__=='__main__':
assert using_neuralprophet,'pip install neuralprophet'
from timemachines.skatertools.data.real import hospital
k = 3
n = 500
y = hospital(n=n)[-200:]
x, x_std, forecast, m = nprophet_iskater_factory(y=y, k=k)
print(x)
assert len(x) == k
x1, x_std1, forecast1, m1 = nprophet_fit_and_predict_simple(y=y, k=k)
if True:
m.plot(forecast)
m1.plot(forecast1)
import matplotlib.pyplot as plt
plt.show()
|
[
1,
529,
9507,
29958,
9346,
331,
496,
1475,
29914,
808,
10412,
29914,
29876,
771,
561,
29914,
29876,
771,
561,
300,
3873,
1008,
14399,
29889,
2272,
13,
3166,
5335,
331,
496,
1475,
29889,
808,
10412,
29889,
29876,
771,
561,
29889,
29876,
771,
561,
300,
262,
10085,
1053,
773,
29918,
484,
3631,
771,
561,
300,
29892,
2448,
3631,
1184,
561,
300,
13,
361,
773,
29918,
484,
3631,
771,
561,
300,
29901,
13,
1678,
1053,
11701,
408,
10518,
13,
1678,
515,
19229,
1053,
2391,
29892,
12603,
552,
29892,
3139,
13,
1678,
515,
5335,
331,
496,
1475,
29889,
808,
1008,
8504,
29889,
4422,
1907,
29889,
535,
794,
1080,
1053,
12244,
13,
1678,
515,
5335,
331,
496,
1475,
29889,
808,
10412,
29889,
29876,
771,
561,
29889,
29876,
771,
561,
7529,
1053,
405,
8618,
19689,
2544,
29918,
20387,
29931,
29892,
405,
8618,
19689,
2544,
29918,
2303,
6040,
13,
13,
1678,
822,
302,
771,
561,
300,
29918,
3873,
1008,
29918,
14399,
29898,
29891,
29901,
5519,
7411,
20526,
413,
29901,
938,
29892,
263,
29901,
2391,
353,
6213,
29892,
260,
29901,
2391,
353,
6213,
29892,
321,
29922,
8516,
29892,
3005,
29939,
29901,
851,
353,
6213,
29892,
302,
29918,
3317,
29922,
29896,
29900,
29900,
29900,
29892,
13,
462,
18884,
16732,
29901,
6120,
353,
7700,
29892,
1904,
29918,
7529,
29901,
9657,
353,
6213,
29892,
736,
29918,
1079,
4384,
29922,
5574,
1125,
13,
4706,
396,
1152,
1286,
591,
3013,
372,
2560,
29889,
2811,
788,
304,
445,
975,
931,
13,
4706,
343,
29900,
29879,
353,
518,
6312,
29898,
25675,
9601,
29900,
29962,
363,
343,
29875,
297,
343,
29962,
13,
4706,
921,
29892,
921,
29918,
4172,
29892,
29821,
579,
29892,
29885,
353,
302,
771,
561,
300,
29918,
9202,
29918,
392,
29918,
27711,
29918,
12857,
29898,
29891,
29922,
29891,
29900,
29879,
29892,
29895,
29922,
29895,
29892,
29888,
7971,
29922,
29888,
7971,
29892,
4299,
29918,
7529,
29922,
4299,
29918,
7529,
29897,
13,
4706,
736,
313,
29916,
29892,
921,
29918,
4172,
29892,
29821,
579,
29892,
286,
29897,
565,
736,
29918,
1079,
4384,
1683,
313,
29916,
29892,
921,
29918,
4172,
29897,
13,
13,
13,
1678,
822,
302,
771,
561,
300,
29918,
9202,
29918,
392,
29918,
27711,
29918,
12857,
29898,
29891,
29901,
518,
7411,
1402,
413,
29901,
938,
29892,
3005,
29939,
29901,
851,
353,
6213,
29892,
1904,
29918,
7529,
29901,
9657,
353,
6213,
29897,
1599,
12603,
552,
29961,
13,
4706,
2391,
29892,
2391,
29892,
3139,
29892,
3139,
5387,
13,
4706,
9995,
3439,
20069,
14476,
363,
1283,
1915,
300,
342,
292,
448,
443,
27432,
403,
871,
9995,
13,
4706,
4974,
338,
8758,
29898,
29891,
29961,
29900,
1402,
7411,
29897,
13,
4706,
3005,
29939,
353,
3005,
29939,
470,
405,
8618,
19689,
2544,
29918,
2303,
6040,
1839,
29888,
7971,
2033,
13,
4706,
1304,
29918,
7529,
353,
405,
8618,
19689,
2544,
29918,
20387,
29931,
13,
4706,
1304,
29918,
7529,
29889,
5504,
3319,
29915,
29876,
29918,
1079,
4384,
29879,
2396,
29895,
1800,
13,
4706,
565,
1904,
29918,
7529,
29901,
13,
9651,
1304,
29918,
7529,
29889,
5504,
29898,
4299,
29918,
7529,
29897,
13,
13,
4706,
565,
7431,
29898,
29891,
29897,
29966,
3880,
29918,
7529,
1839,
29876,
29918,
29880,
810,
2033,
29901,
13,
9651,
921,
353,
518,
6312,
29898,
29891,
9601,
29900,
5262,
29930,
29895,
13,
9651,
921,
29918,
4172,
353,
518,
29896,
29889,
29900,
14178,
29895,
13,
9651,
736,
921,
29892,
921,
29918,
4172,
29892,
6213,
29892,
6213,
13,
4706,
1683,
29901,
13,
9651,
1904,
353,
2448,
3631,
1184,
561,
300,
29898,
1068,
3880,
29918,
7529,
29897,
13,
9651,
4489,
353,
10518,
29889,
17271,
29898,
13099,
29922,
1839,
29891,
7464,
848,
29922,
29891,
29897,
13,
9651,
4489,
1839,
6289,
2033,
353,
10518,
29889,
1256,
29918,
3881,
29898,
2962,
2433,
29906,
29900,
29906,
29896,
29899,
29900,
29896,
29899,
29900,
29896,
742,
23704,
29922,
2435,
29898,
29891,
511,
3005,
29939,
29922,
29888,
7971,
29897,
13,
9651,
21556,
353,
1904,
29889,
9202,
29898,
2176,
29892,
3005,
29939,
29922,
29888,
7971,
29892,
21502,
12168,
29922,
29946,
29900,
29892,
6728,
29918,
1646,
29922,
8824,
29897,
13,
9651,
5434,
353,
1904,
29889,
5675,
29918,
29888,
9130,
29918,
1272,
2557,
29898,
2176,
29897,
13,
9651,
29821,
579,
353,
1904,
29889,
27711,
29898,
29888,
9130,
29897,
13,
9651,
921,
353,
518,
29821,
579,
1839,
29891,
2455,
18717,
710,
29898,
29926,
29974,
29896,
29897,
1822,
5975,
14352,
29895,
29974,
29926,
29962,
363,
432,
297,
3464,
29898,
29895,
29897,
4514,
13,
9651,
921,
29918,
4172,
353,
518,
29896,
29889,
29900,
14178,
29895,
13,
9651,
736,
921,
29892,
921,
29918,
4172,
29892,
29821,
579,
29892,
1904,
13,
13,
13,
361,
4770,
978,
1649,
1360,
29915,
1649,
3396,
1649,
2396,
13,
1678,
4974,
773,
29918,
484,
3631,
771,
561,
300,
5501,
13096,
2601,
19677,
771,
561,
300,
29915,
13,
1678,
515,
5335,
331,
496,
1475,
29889,
808,
1008,
8504,
29889,
1272,
29889,
6370,
1053,
13457,
13,
13,
1678,
413,
353,
29871,
29941,
13,
1678,
302,
353,
29871,
29945,
29900,
29900,
13,
1678,
343,
353,
13457,
29898,
29876,
29922,
29876,
9601,
29899,
29906,
29900,
29900,
17531,
13,
1678,
921,
29892,
921,
29918,
4172,
29892,
29821,
579,
29892,
286,
353,
302,
771,
561,
300,
29918,
3873,
1008,
29918,
14399,
29898,
29891,
29922,
29891,
29892,
413,
29922,
29895,
29897,
13,
1678,
1596,
29898,
29916,
29897,
13,
1678,
4974,
7431,
29898,
29916,
29897,
1275,
413,
13,
1678,
921,
29896,
29892,
921,
29918,
4172,
29896,
29892,
29821,
579,
29896,
29892,
286,
29896,
353,
302,
771,
561,
300,
29918,
9202,
29918,
392,
29918,
27711,
29918,
12857,
29898,
29891,
29922,
29891,
29892,
413,
29922,
29895,
29897,
13,
1678,
565,
5852,
29901,
13,
4706,
286,
29889,
5317,
29898,
1079,
4384,
29897,
13,
4706,
286,
29896,
29889,
5317,
29898,
1079,
4384,
29896,
29897,
13,
4706,
1053,
22889,
29889,
2272,
5317,
408,
14770,
13,
4706,
14770,
29889,
4294,
580,
2
] |
common/pagination.py
|
pannkotsky/musicworks
| 0 |
99706
|
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class PaginationWithCountHeader(LimitOffsetPagination):
def get_paginated_response(self, data):
headers = {
'X-Total-Count': self.count,
'X-Limit': self.limit
}
return Response(data, headers=headers)
def get_paginated_response_schema(self, schema):
return schema
|
[
1,
515,
1791,
29918,
4468,
29889,
13573,
3381,
1053,
9628,
277,
10302,
29925,
351,
3381,
13,
3166,
1791,
29918,
4468,
29889,
5327,
1053,
13291,
13,
13,
13,
1990,
349,
351,
3381,
3047,
3981,
7850,
29898,
24445,
10302,
29925,
351,
3381,
1125,
13,
1678,
822,
679,
29918,
13573,
262,
630,
29918,
5327,
29898,
1311,
29892,
848,
1125,
13,
4706,
9066,
353,
426,
13,
9651,
525,
29990,
29899,
11536,
29899,
3981,
2396,
1583,
29889,
2798,
29892,
13,
9651,
525,
29990,
29899,
24445,
2396,
1583,
29889,
13400,
13,
4706,
500,
13,
4706,
736,
13291,
29898,
1272,
29892,
9066,
29922,
13662,
29897,
13,
13,
1678,
822,
679,
29918,
13573,
262,
630,
29918,
5327,
29918,
11010,
29898,
1311,
29892,
10938,
1125,
13,
4706,
736,
10938,
13,
2
] |
sample/delete_all_dm.py
|
techno/python-twoauth
| 2 |
103979
|
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
import twoauth
if __name__ == "__main__":
ckey = sys.argv[1]
csecret = sys.argv[2]
atoken = sys.argv[3]
asecret = sys.argv[4]
api = twoauth.api(
ckey, csecret, atoken, asecret)
while True:
dml = api.dm_list()
if not dml:
break
for dm in dml:
print dm["id"]
api.dm_destroy(dm["id"])
|
[
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
29899,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
5215,
10876,
13,
5215,
1023,
5150,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
274,
1989,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
1678,
274,
19024,
353,
10876,
29889,
19218,
29961,
29906,
29962,
13,
1678,
472,
4476,
353,
10876,
29889,
19218,
29961,
29941,
29962,
13,
1678,
263,
19024,
353,
10876,
29889,
19218,
29961,
29946,
29962,
13,
268,
13,
1678,
7882,
353,
1023,
5150,
29889,
2754,
29898,
13,
4706,
274,
1989,
29892,
274,
19024,
29892,
472,
4476,
29892,
263,
19024,
29897,
13,
268,
13,
1678,
1550,
5852,
29901,
13,
4706,
270,
828,
353,
7882,
29889,
18933,
29918,
1761,
580,
13,
4706,
565,
451,
270,
828,
29901,
13,
9651,
2867,
13,
13,
4706,
363,
270,
29885,
297,
270,
828,
29901,
13,
9651,
1596,
270,
29885,
3366,
333,
3108,
13,
9651,
7882,
29889,
18933,
29918,
20524,
29898,
18933,
3366,
333,
20068,
13,
2
] |
python-2/beginner/1001-extremely-basic.py
|
Adriandpr/uri-online-solutions
| 16 |
1601099
|
n1 = int(input())
n2 = int(input())
total = n1 + n2
print "X =", total
|
[
1,
302,
29896,
353,
938,
29898,
2080,
3101,
13,
29876,
29906,
353,
938,
29898,
2080,
3101,
13,
13,
7827,
353,
302,
29896,
718,
302,
29906,
13,
13,
2158,
376,
29990,
353,
613,
3001,
13,
2
] |
util/get_weather_icons_map.py
|
multipolygon/esphome-configs
| 0 |
28990
|
from urllib.request import urlopen
import json
import re
url = urlopen("https://raw.githubusercontent.com/Templarian/MaterialDesign/master/meta.json")
meta = [(i['name'], i['codepoint']) for i in json.loads(url.read()) if re.search('^weather-', i['name'])]
print('''---
esphome:
# ...
includes:
- weather_icon_map.h
# ...
font:
- file: fonts/materialdesignicons-webfont.ttf
id: ...
size: ...
glyphs:''')
for name, codepoint in meta:
print(' - "\\U000%s" # %s' % (codepoint, name))
with open('weather_icon_map.h', 'w') as h:
h.write('#include <map>\nstd::map<std::string, std::string> weather_icon_map\n')
h.write(' {\n')
for name, codepoint in meta:
h.write(' {"%s", "\\U000%s"},\n' % (name.replace('weather-', ''), codepoint))
h.write(' };\n')
print('---')
for name, codepoint in meta:
print(' "%s",' % (name.replace('weather-', '')))
|
[
1,
515,
3142,
1982,
29889,
3827,
1053,
5065,
417,
2238,
13,
5215,
4390,
13,
5215,
337,
13,
13,
2271,
353,
5065,
417,
2238,
703,
991,
597,
1610,
29889,
3292,
1792,
3051,
29889,
510,
29914,
5776,
572,
13956,
29914,
24095,
4002,
647,
29914,
6207,
29914,
7299,
29889,
3126,
1159,
13,
7299,
353,
17288,
29875,
1839,
978,
7464,
474,
1839,
401,
3149,
11287,
363,
474,
297,
4390,
29889,
18132,
29898,
2271,
29889,
949,
3101,
565,
337,
29889,
4478,
877,
29985,
705,
1624,
29899,
742,
474,
1839,
978,
2033,
4638,
13,
13,
2158,
877,
4907,
5634,
13,
267,
561,
608,
29901,
13,
29871,
396,
2023,
13,
29871,
7805,
29901,
13,
1678,
448,
14826,
29918,
4144,
29918,
1958,
29889,
29882,
13,
13,
29937,
2023,
13,
13,
5657,
29901,
13,
29871,
448,
934,
29901,
23849,
29914,
15388,
13892,
27078,
29899,
705,
1635,
609,
29889,
698,
29888,
13,
1678,
1178,
29901,
2023,
13,
1678,
2159,
29901,
2023,
13,
1678,
330,
27026,
29879,
29901,
4907,
1495,
13,
13,
1454,
1024,
29892,
775,
3149,
297,
12700,
29901,
13,
1678,
1596,
877,
418,
448,
376,
1966,
29965,
29900,
29900,
29900,
29995,
29879,
29908,
396,
1273,
29879,
29915,
1273,
313,
401,
3149,
29892,
1024,
876,
13,
13,
2541,
1722,
877,
705,
1624,
29918,
4144,
29918,
1958,
29889,
29882,
742,
525,
29893,
1495,
408,
298,
29901,
13,
1678,
298,
29889,
3539,
14237,
2856,
529,
1958,
14247,
29876,
4172,
1057,
1958,
29966,
4172,
1057,
1807,
29892,
3659,
1057,
1807,
29958,
14826,
29918,
4144,
29918,
1958,
29905,
29876,
1495,
13,
1678,
298,
29889,
3539,
877,
29871,
2802,
29876,
1495,
13,
1678,
363,
1024,
29892,
775,
3149,
297,
12700,
29901,
13,
4706,
298,
29889,
3539,
877,
1678,
8853,
29995,
29879,
613,
376,
1966,
29965,
29900,
29900,
29900,
29995,
29879,
29908,
7570,
29876,
29915,
1273,
313,
978,
29889,
6506,
877,
705,
1624,
29899,
742,
525,
5477,
775,
3149,
876,
13,
1678,
298,
29889,
3539,
877,
29871,
3980,
29905,
29876,
1495,
13,
13,
2158,
877,
5634,
1495,
13,
1454,
1024,
29892,
775,
3149,
297,
12700,
29901,
13,
1678,
1596,
877,
1678,
11860,
29879,
613,
29915,
1273,
313,
978,
29889,
6506,
877,
705,
1624,
29899,
742,
6629,
4961,
13,
2
] |
picture-edit-test.py
|
scripsi/picture
| 0 |
113617
|
<filename>picture-edit-test.py
import cv2 as cv
import numpy as np
#img=cv.imread("image.jpg",cv.IMREAD_GRAYSCALE)
img=cv.imread("image.jpg")
#ret,oimg = cv.threshold(img, 0, 255, cv.THRESH_BINARY + cv.THRESH_OTSU)
#gimg = cv.adaptiveThreshold(img,255,cv.ADAPTIVE_THRESH_GAUSSIAN_C,cv.THRESH_BINARY,11,2)
date_img = img[20:50, 1151:1441]
meter_a_img = img[730:780,525:815]
meter_b_img = img[1160:1200,1455:1745]
cv.imwrite("datestamp.png",date_img)
cv.imwrite("heating-meter.png",meter_a_img)
cv.imwrite("standard-meter.png",meter_b_img)
all_img = cv.vconcat([date_img,meter_a_img,meter_b_img])
cv.imwrite("all-meter.jpg",all_img)
|
[
1,
529,
9507,
29958,
12095,
29899,
5628,
29899,
1688,
29889,
2272,
13,
5215,
13850,
29906,
408,
13850,
13,
5215,
12655,
408,
7442,
13,
13,
29937,
2492,
29922,
11023,
29889,
326,
949,
703,
3027,
29889,
6173,
613,
11023,
29889,
7833,
16310,
29918,
29954,
4717,
21554,
5454,
1307,
29897,
13,
2492,
29922,
11023,
29889,
326,
949,
703,
3027,
29889,
6173,
1159,
13,
29937,
2267,
29892,
29877,
2492,
353,
13850,
29889,
386,
12268,
29898,
2492,
29892,
29871,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
13850,
29889,
4690,
1525,
7068,
29918,
29933,
1177,
19926,
718,
13850,
29889,
4690,
1525,
7068,
29918,
2891,
14605,
29897,
13,
29937,
29887,
2492,
353,
13850,
29889,
1114,
415,
573,
1349,
12268,
29898,
2492,
29892,
29906,
29945,
29945,
29892,
11023,
29889,
3035,
3301,
29911,
18474,
29918,
4690,
1525,
7068,
29918,
12739,
29965,
1799,
29902,
2190,
29918,
29907,
29892,
11023,
29889,
4690,
1525,
7068,
29918,
29933,
1177,
19926,
29892,
29896,
29896,
29892,
29906,
29897,
13,
1256,
29918,
2492,
353,
10153,
29961,
29906,
29900,
29901,
29945,
29900,
29892,
29871,
29896,
29896,
29945,
29896,
29901,
29896,
29946,
29946,
29896,
29962,
13,
29391,
29918,
29874,
29918,
2492,
353,
10153,
29961,
29955,
29941,
29900,
29901,
29955,
29947,
29900,
29892,
29945,
29906,
29945,
29901,
29947,
29896,
29945,
29962,
13,
29391,
29918,
29890,
29918,
2492,
353,
10153,
29961,
29896,
29896,
29953,
29900,
29901,
29896,
29906,
29900,
29900,
29892,
29896,
29946,
29945,
29945,
29901,
29896,
29955,
29946,
29945,
29962,
13,
11023,
29889,
326,
3539,
703,
4130,
7416,
29889,
2732,
613,
1256,
29918,
2492,
29897,
13,
11023,
29889,
326,
3539,
703,
354,
1218,
29899,
29391,
29889,
2732,
613,
29391,
29918,
29874,
29918,
2492,
29897,
13,
11023,
29889,
326,
3539,
703,
15770,
29899,
29391,
29889,
2732,
613,
29391,
29918,
29890,
29918,
2492,
29897,
13,
497,
29918,
2492,
353,
13850,
29889,
29894,
17685,
4197,
1256,
29918,
2492,
29892,
29391,
29918,
29874,
29918,
2492,
29892,
29391,
29918,
29890,
29918,
2492,
2314,
13,
11023,
29889,
326,
3539,
703,
497,
29899,
29391,
29889,
6173,
613,
497,
29918,
2492,
29897,
13,
2
] |
skimage/__init__.py
|
jjhelmus/scikit-image
| 0 |
1607978
|
<filename>skimage/__init__.py
"""Image Processing SciKit (Toolbox for SciPy)
``scikit-image`` (a.k.a. ``skimage``) is a collection of algorithms for image
processing and computer vision.
The main package of ``skimage`` only provides a few utilities for converting
between image data types; for most features, you need to import one of the
following subpackages:
Subpackages
-----------
color
Color space conversion.
data
Test images and example data.
draw
Drawing primitives (lines, text, etc.) that operate on NumPy arrays.
exposure
Image intensity adjustment, e.g., histogram equalization, etc.
feature
Feature detection and extraction, e.g., texture analysis corners, etc.
filters
Sharpening, edge finding, rank filters, thresholding, etc.
graph
Graph-theoretic operations, e.g., shortest paths.
io
Reading, saving, and displaying images and video.
measure
Measurement of image properties, e.g., similarity and contours.
morphology
Morphological operations, e.g., opening or skeletonization.
novice
Simplified interface for teaching purposes.
restoration
Restoration algorithms, e.g., deconvolution algorithms, denoising, etc.
segmentation
Partitioning an image into multiple regions.
transform
Geometric and other transforms, e.g., rotation or the Radon transform.
util
Generic utilities.
viewer
A simple graphical user interface for visualizing results and exploring
parameters.
Utility Functions
-----------------
img_as_float
Convert an image to floating point format, with values in [0, 1].
img_as_uint
Convert an image to unsigned integer format, with values in [0, 65535].
img_as_int
Convert an image to signed integer format, with values in [-32768, 32767].
img_as_ubyte
Convert an image to unsigned byte format, with values in [0, 255].
"""
import os.path as osp
import imp
import functools
import warnings
import sys
pkg_dir = osp.abspath(osp.dirname(__file__))
data_dir = osp.join(pkg_dir, 'data')
__version__ = '0.13dev'
try:
imp.find_module('nose')
except ImportError:
def _test(doctest=False, verbose=False):
"""This would run all unit tests, but nose couldn't be
imported so the test suite can not run.
"""
raise ImportError("Could not load nose. Unit tests not available.")
else:
def _test(doctest=False, verbose=False):
"""Run all unit tests."""
import nose
args = ['', pkg_dir, '--exe', '--ignore-files=^_test']
if verbose:
args.extend(['-v', '-s'])
if doctest:
args.extend(['--with-doctest', '--ignore-files=^\.',
'--ignore-files=^setup\.py$$', '--ignore-files=test'])
# Make sure warnings do not break the doc tests
with warnings.catch_warnings():
warnings.simplefilter("ignore")
success = nose.run('skimage', argv=args)
else:
success = nose.run('skimage', argv=args)
# Return sys.exit code
if success:
return 0
else:
return 1
# do not use `test` as function name as this leads to a recursion problem with
# the nose test suite
test = _test
test_verbose = functools.partial(test, verbose=True)
test_verbose.__doc__ = test.__doc__
doctest = functools.partial(test, doctest=True)
doctest.__doc__ = doctest.__doc__
doctest_verbose = functools.partial(test, doctest=True, verbose=True)
doctest_verbose.__doc__ = doctest.__doc__
# Logic for checking for improper install and importing while in the source
# tree when package has not been installed inplace.
# Code adapted from scikit-learn's __check_build module.
_INPLACE_MSG = """
It appears that you are importing a local scikit-image source tree. For
this, you need to have an inplace install. Maybe you are in the source
directory and you need to try from another location."""
_STANDARD_MSG = """
Your install of scikit-image appears to be broken.
Try re-installing the package following the instructions at:
http://scikit-image.org/docs/stable/install.html """
def _raise_build_error(e):
# Raise a comprehensible error
local_dir = osp.split(__file__)[0]
msg = _STANDARD_MSG
if local_dir == "skimage":
# Picking up the local install: this will work only if the
# install is an 'inplace build'
msg = _INPLACE_MSG
raise ImportError("""%s
It seems that scikit-image has not been built correctly.
%s""" % (e, msg))
try:
# This variable is injected in the __builtins__ by the build
# process. It used to enable importing subpackages of skimage when
# the binaries are not built
__SKIMAGE_SETUP__
except NameError:
__SKIMAGE_SETUP__ = False
if __SKIMAGE_SETUP__:
sys.stderr.write('Partial import of skimage during the build process.\n')
# We are not importing the rest of the scikit during the build
# process, as it may not be compiled yet
else:
try:
from ._shared import geometry
del geometry
except ImportError as e:
_raise_build_error(e)
from .util.dtype import *
if sys.version.startswith('2.6'):
msg = ("Python 2.6 is deprecated and will not be supported in "
"scikit-image 0.13+")
warnings.warn(msg, stacklevel=2)
del warnings, functools, osp, imp, sys
|
[
1,
529,
9507,
29958,
808,
3027,
29914,
1649,
2344,
26914,
2272,
13,
15945,
29908,
2940,
10554,
292,
5636,
13117,
313,
12229,
1884,
363,
5636,
19737,
29897,
13,
13,
16159,
26167,
7354,
29899,
3027,
16159,
313,
29874,
29889,
29895,
29889,
29874,
29889,
4954,
808,
3027,
29952,
6348,
338,
263,
4333,
310,
14009,
363,
1967,
13,
19170,
322,
6601,
18551,
29889,
13,
13,
1576,
1667,
3577,
310,
4954,
808,
3027,
16159,
871,
8128,
263,
2846,
3667,
1907,
363,
17415,
13,
14811,
1967,
848,
4072,
29936,
363,
1556,
5680,
29892,
366,
817,
304,
1053,
697,
310,
278,
13,
23031,
292,
1014,
8318,
29901,
13,
13,
4035,
8318,
13,
1378,
5634,
13,
2780,
13,
1678,
9159,
2913,
11301,
29889,
13,
1272,
13,
1678,
4321,
4558,
322,
1342,
848,
29889,
13,
4012,
13,
1678,
18492,
292,
28147,
3145,
313,
9012,
29892,
1426,
29892,
2992,
1846,
393,
21994,
373,
11848,
19737,
7049,
29889,
13,
735,
1066,
545,
13,
1678,
7084,
26171,
10365,
358,
29892,
321,
29889,
29887,
1696,
9825,
13342,
5186,
2133,
29892,
2992,
29889,
13,
14394,
13,
1678,
5169,
1535,
15326,
322,
4805,
428,
29892,
321,
29889,
29887,
1696,
18459,
7418,
26995,
29892,
2992,
29889,
13,
26705,
13,
1678,
1383,
279,
2238,
292,
29892,
7636,
9138,
29892,
7115,
18094,
29892,
16897,
292,
29892,
2992,
29889,
13,
4262,
13,
1678,
12367,
29899,
1552,
272,
7492,
6931,
29892,
321,
29889,
29887,
1696,
3273,
342,
10898,
29889,
13,
601,
13,
1678,
21439,
29892,
14238,
29892,
322,
16384,
4558,
322,
4863,
29889,
13,
26658,
13,
1678,
2191,
3745,
358,
310,
1967,
4426,
29892,
321,
29889,
29887,
1696,
29501,
322,
640,
2470,
29889,
13,
29885,
5676,
3002,
13,
1678,
3879,
561,
5996,
6931,
29892,
321,
29889,
29887,
1696,
8718,
470,
18109,
11285,
2133,
29889,
13,
13715,
625,
13,
1678,
3439,
572,
2164,
5067,
363,
18819,
11976,
29889,
13,
5060,
12418,
13,
1678,
11654,
12418,
14009,
29892,
321,
29889,
29887,
1696,
316,
535,
4068,
14009,
29892,
972,
29877,
5921,
29892,
2992,
29889,
13,
28192,
362,
13,
1678,
3455,
654,
292,
385,
1967,
964,
2999,
12786,
29889,
13,
9067,
13,
1678,
1879,
14066,
322,
916,
4327,
29879,
29892,
321,
29889,
29887,
1696,
13733,
470,
278,
4957,
265,
4327,
29889,
13,
4422,
13,
1678,
3251,
293,
3667,
1907,
29889,
13,
29894,
15580,
13,
1678,
319,
2560,
3983,
936,
1404,
5067,
363,
7604,
5281,
2582,
322,
3902,
8253,
13,
1678,
4128,
29889,
13,
13,
7270,
537,
6680,
29879,
13,
2683,
29899,
13,
2492,
29918,
294,
29918,
7411,
13,
1678,
14806,
385,
1967,
304,
16526,
1298,
3402,
29892,
411,
1819,
297,
518,
29900,
29892,
29871,
29896,
1822,
13,
2492,
29918,
294,
29918,
13470,
13,
1678,
14806,
385,
1967,
304,
12780,
6043,
3402,
29892,
411,
1819,
297,
518,
29900,
29892,
29871,
29953,
29945,
29945,
29941,
29945,
1822,
13,
2492,
29918,
294,
29918,
524,
13,
1678,
14806,
385,
1967,
304,
8794,
6043,
3402,
29892,
411,
1819,
297,
21069,
29941,
29906,
29955,
29953,
29947,
29892,
29871,
29941,
29906,
29955,
29953,
29955,
1822,
13,
2492,
29918,
294,
29918,
4471,
371,
13,
1678,
14806,
385,
1967,
304,
12780,
7023,
3402,
29892,
411,
1819,
297,
518,
29900,
29892,
29871,
29906,
29945,
29945,
1822,
13,
13,
15945,
29908,
13,
13,
5215,
2897,
29889,
2084,
408,
288,
1028,
13,
5215,
2411,
13,
5215,
2090,
312,
8789,
13,
5215,
18116,
13,
5215,
10876,
13,
13,
15865,
29918,
3972,
353,
288,
1028,
29889,
370,
1028,
493,
29898,
4705,
29889,
25721,
22168,
1445,
1649,
876,
13,
1272,
29918,
3972,
353,
288,
1028,
29889,
7122,
29898,
15865,
29918,
3972,
29892,
525,
1272,
1495,
13,
13,
1649,
3259,
1649,
353,
525,
29900,
29889,
29896,
29941,
3359,
29915,
13,
13,
2202,
29901,
13,
1678,
2411,
29889,
2886,
29918,
5453,
877,
29876,
852,
1495,
13,
19499,
16032,
2392,
29901,
13,
1678,
822,
903,
1688,
29898,
1867,
312,
342,
29922,
8824,
29892,
26952,
29922,
8824,
1125,
13,
4706,
9995,
4013,
723,
1065,
599,
5190,
6987,
29892,
541,
26414,
8496,
29915,
29873,
367,
13,
4706,
19673,
577,
278,
1243,
9460,
508,
451,
1065,
29889,
13,
4706,
9995,
13,
4706,
12020,
16032,
2392,
703,
23323,
451,
2254,
26414,
29889,
13223,
6987,
451,
3625,
23157,
13,
13,
2870,
29901,
13,
1678,
822,
903,
1688,
29898,
1867,
312,
342,
29922,
8824,
29892,
26952,
29922,
8824,
1125,
13,
4706,
9995,
6558,
599,
5190,
6987,
1213,
15945,
13,
4706,
1053,
26414,
13,
4706,
6389,
353,
6024,
742,
282,
9415,
29918,
3972,
29892,
525,
489,
8097,
742,
525,
489,
17281,
29899,
5325,
29922,
29985,
29918,
1688,
2033,
13,
4706,
565,
26952,
29901,
13,
9651,
6389,
29889,
21843,
18959,
29899,
29894,
742,
17411,
29879,
11287,
13,
4706,
565,
437,
312,
342,
29901,
13,
9651,
6389,
29889,
21843,
18959,
489,
2541,
29899,
1867,
312,
342,
742,
525,
489,
17281,
29899,
5325,
29922,
3823,
29889,
742,
13,
462,
308,
525,
489,
17281,
29899,
5325,
29922,
29985,
14669,
23301,
2272,
3997,
742,
525,
489,
17281,
29899,
5325,
29922,
1688,
11287,
13,
9651,
396,
8561,
1854,
18116,
437,
451,
2867,
278,
1574,
6987,
13,
9651,
411,
18116,
29889,
12510,
29918,
25442,
886,
7295,
13,
18884,
18116,
29889,
12857,
4572,
703,
17281,
1159,
13,
18884,
2551,
353,
26414,
29889,
3389,
877,
808,
3027,
742,
1852,
29894,
29922,
5085,
29897,
13,
4706,
1683,
29901,
13,
9651,
2551,
353,
26414,
29889,
3389,
877,
808,
3027,
742,
1852,
29894,
29922,
5085,
29897,
13,
4706,
396,
7106,
10876,
29889,
13322,
775,
13,
4706,
565,
2551,
29901,
13,
9651,
736,
29871,
29900,
13,
4706,
1683,
29901,
13,
9651,
736,
29871,
29896,
13,
13,
13,
29937,
437,
451,
671,
421,
1688,
29952,
408,
740,
1024,
408,
445,
11981,
304,
263,
20437,
1108,
411,
13,
29937,
278,
26414,
1243,
9460,
13,
1688,
353,
903,
1688,
13,
1688,
29918,
369,
15828,
353,
2090,
312,
8789,
29889,
3846,
29898,
1688,
29892,
26952,
29922,
5574,
29897,
13,
1688,
29918,
369,
15828,
17255,
1514,
1649,
353,
1243,
17255,
1514,
1649,
13,
1867,
312,
342,
353,
2090,
312,
8789,
29889,
3846,
29898,
1688,
29892,
437,
312,
342,
29922,
5574,
29897,
13,
1867,
312,
342,
17255,
1514,
1649,
353,
437,
312,
342,
17255,
1514,
1649,
13,
1867,
312,
342,
29918,
369,
15828,
353,
2090,
312,
8789,
29889,
3846,
29898,
1688,
29892,
437,
312,
342,
29922,
5574,
29892,
26952,
29922,
5574,
29897,
13,
1867,
312,
342,
29918,
369,
15828,
17255,
1514,
1649,
353,
437,
312,
342,
17255,
1514,
1649,
13,
13,
13,
29937,
4522,
293,
363,
8454,
363,
4857,
546,
2601,
322,
28348,
1550,
297,
278,
2752,
13,
29937,
5447,
746,
3577,
756,
451,
1063,
5130,
297,
6689,
29889,
13,
29937,
5920,
23430,
515,
4560,
7354,
29899,
19668,
29915,
29879,
4770,
3198,
29918,
4282,
3883,
29889,
13,
29918,
1177,
7390,
11538,
29918,
4345,
29954,
353,
9995,
13,
3112,
5692,
393,
366,
526,
28348,
263,
1887,
4560,
7354,
29899,
3027,
2752,
5447,
29889,
1152,
13,
1366,
29892,
366,
817,
304,
505,
385,
297,
6689,
2601,
29889,
7198,
366,
526,
297,
278,
2752,
13,
12322,
322,
366,
817,
304,
1018,
515,
1790,
4423,
1213,
15945,
13,
13,
29918,
1254,
9468,
17011,
29918,
4345,
29954,
353,
9995,
13,
10858,
2601,
310,
4560,
7354,
29899,
3027,
5692,
304,
367,
9391,
29889,
13,
15870,
337,
29899,
6252,
292,
278,
3577,
1494,
278,
11994,
472,
29901,
13,
1124,
597,
26167,
7354,
29899,
3027,
29889,
990,
29914,
2640,
29914,
13844,
29914,
6252,
29889,
1420,
9995,
13,
13,
13,
1753,
903,
22692,
29918,
4282,
29918,
2704,
29898,
29872,
1125,
13,
1678,
396,
6981,
895,
263,
15171,
575,
1821,
1059,
13,
1678,
1887,
29918,
3972,
353,
288,
1028,
29889,
5451,
22168,
1445,
1649,
9601,
29900,
29962,
13,
1678,
10191,
353,
903,
1254,
9468,
17011,
29918,
4345,
29954,
13,
1678,
565,
1887,
29918,
3972,
1275,
376,
808,
3027,
1115,
13,
4706,
396,
23868,
292,
701,
278,
1887,
2601,
29901,
445,
674,
664,
871,
565,
278,
13,
4706,
396,
2601,
338,
385,
525,
262,
6689,
2048,
29915,
13,
4706,
10191,
353,
903,
1177,
7390,
11538,
29918,
4345,
29954,
13,
1678,
12020,
16032,
2392,
703,
15945,
29995,
29879,
13,
3112,
2444,
393,
4560,
7354,
29899,
3027,
756,
451,
1063,
4240,
5149,
29889,
13,
29995,
29879,
15945,
29908,
1273,
313,
29872,
29892,
10191,
876,
13,
13,
2202,
29901,
13,
1678,
396,
910,
2286,
338,
11658,
287,
297,
278,
4770,
16145,
1144,
1649,
491,
278,
2048,
13,
1678,
396,
1889,
29889,
739,
1304,
304,
9025,
28348,
1014,
8318,
310,
2071,
3027,
746,
13,
1678,
396,
278,
9016,
4314,
526,
451,
4240,
13,
1678,
4770,
16033,
2382,
29918,
10490,
4897,
1649,
13,
19499,
4408,
2392,
29901,
13,
1678,
4770,
16033,
2382,
29918,
10490,
4897,
1649,
353,
7700,
13,
13,
361,
4770,
16033,
2382,
29918,
10490,
4897,
1649,
29901,
13,
1678,
10876,
29889,
303,
20405,
29889,
3539,
877,
7439,
616,
1053,
310,
2071,
3027,
2645,
278,
2048,
1889,
7790,
29876,
1495,
13,
1678,
396,
1334,
526,
451,
28348,
278,
1791,
310,
278,
4560,
7354,
2645,
278,
2048,
13,
1678,
396,
1889,
29892,
408,
372,
1122,
451,
367,
13126,
3447,
13,
2870,
29901,
13,
1678,
1018,
29901,
13,
4706,
515,
869,
29918,
12366,
1053,
16303,
13,
4706,
628,
16303,
13,
1678,
5174,
16032,
2392,
408,
321,
29901,
13,
4706,
903,
22692,
29918,
4282,
29918,
2704,
29898,
29872,
29897,
13,
1678,
515,
869,
4422,
29889,
29881,
1853,
1053,
334,
13,
13,
13,
361,
10876,
29889,
3259,
29889,
27382,
2541,
877,
29906,
29889,
29953,
29374,
13,
1678,
10191,
353,
4852,
11980,
29871,
29906,
29889,
29953,
338,
18164,
322,
674,
451,
367,
6969,
297,
376,
13,
965,
376,
26167,
7354,
29899,
3027,
29871,
29900,
29889,
29896,
29941,
29974,
1159,
13,
1678,
18116,
29889,
25442,
29898,
7645,
29892,
5096,
5563,
29922,
29906,
29897,
13,
13,
13,
6144,
18116,
29892,
2090,
312,
8789,
29892,
288,
1028,
29892,
2411,
29892,
10876,
13,
2
] |
hugs/__init__.py
|
Bogdanp/hugs
| 22 |
14564
|
from .repository import Repository
from .manager import Manager
__all__ = ["Manager", "Repository", "__version__"]
__version__ = "0.2.0"
|
[
1,
515,
869,
19033,
1053,
830,
7036,
13,
3166,
869,
12847,
1053,
15629,
13,
13,
1649,
497,
1649,
353,
6796,
3260,
613,
376,
11481,
613,
376,
1649,
3259,
1649,
3108,
13,
1649,
3259,
1649,
353,
376,
29900,
29889,
29906,
29889,
29900,
29908,
13,
2
] |
netlist.py
|
phdbreak/netlist_parser.py
| 11 |
41186
|
<gh_stars>10-100
# Parent tree
# design
# |---> module
# |-----> port/wire
# |-----> instance
# |-----> pin
class design_t:
def __init__(self):
self.modules = dict()
def add_module(self, module_name):
if (module_name in self.modules.keys()):
print 'Error: module (%s) already exisits' % module_name
return None
m = module_t(module_name)
self.modules(m.name) = m
return m
class module_t:
def __init__(self, name):
self.name = name
self.ports = dict()
self.ls_port = list() # port in order
self.wires = dict()
self.instances = dict()
self.params = dict()
self.is_hierarchical = True
self.full_name = self.name
def add_port(self, port_name, direction):
if (port_name in self.ports.keys()):
print 'Error: port (%s) in module (%s) already exists' % (port_name, self.full_name)
return None
p = port_t(port_name, self, direction)
self.ports(p.name) = p
self.ls_port.append(p)
return p
def add_wire(self, wire_name):
if (wire_name in self.wires.keys()):
print 'Error: wire (%s) in module (%s) already exists' % (wire_name, self.full_name)
return None
w = wire_t(wire_name, self)
self.wires(w.name) = w
return w
def add_instance(self, instance_name):
if (instance_name in self.instances.keys()):
print 'Error: instance (%s) in module (%s) already exists' % (instance_name, self.full_name)
return None
n = instance_t(instance_name, self)
self.instances(n.name) = n
return n
def add_param(self, param, default_value):
if (param in self.params.keys()):
print 'Error: param (%s) in module (%s) already exists' % (param, self.full_name)
return 0
self.params(param) = default_value
return 1
# def __eq__(self, other):
# equal = True
# if not (self.name == other.name):
# equal = False
# if not __eq_dict__(self.ports, other.ports):
# equal = False
# if not __eq_dict__(self.instances, other.instances):
# equal = False
# if not __eq_dict__(self.wires, other.wires):
# equal = False
#
# if not equal:
# print 'Error: modules (%s != %s) donot match' % (self, other)
#
# return equal
class instance_t:
'instance of module'
def __init__(self, name, parent_module):
self.name = name
self.parent_module = parent_module
self.pins = dict()
self.master_module = None
self.params = dict()
self.full_name = '%s.%s' % (self.parent_module.name, self.name)
for master_port in self.parent_module.ports.values():
p = pin_t(master_port, self)
self.pins[p.name] = p
def connect_pin(self, pin_name, connect_name):
# find connect
m = self.parent_module
if (connect_name in m.ports.keys()):
connect = m.ports(connect_name)
elif (connect_name in m.wires.keys()):
connect = m.wires(connect_name)
else:
print 'Error: cannot find connect (%s) in module (%s) for instance (%s)' % (connect_name, m.name, self.name)
self.pins[pin_name].ls_connect.append(connect)
connect.ls_connect.append(self)
def add_param(self, param, value):
assert param in self.parent_module.params.keys(), 'Error: param (%s) doesnot exist in module (%s)' % (param, self.parent_module.name)
self.params(param) = value
# def __eq__(self, other):
# equal = True
# if (not self.name == other.name) or (not self.parent_module.name == other.parent_module.name) or (not self.master_module.name == other.master_module.name):
# equal = False
# if not __eq_dict__(self.pins, other.pins):
# equal = False
#
# if not equal:
# print 'Error: instances (%s != %s) donot match' % (self, other)
#
# return equal
class net_t:
'basic class for wire/port/pin'
def __init__(self, name):
self.name = name
self.ls_connect = list()
class wire_t(net_t):
'wire in module, connect to internal pin'
def __init__(self, name, parent_module):
net_t.__init__(self, name)
self.parent_module = parent_module
self.ls_fanin = list()
self.ls_fanout = list()
class port_t(net_t):
'port of module, connect to internal pin'
def __init__(self, name, parent_module, direction):
net_t.__init__(self, name)
self.parent_module = parent_module
assert direction in 'input output bidirection', direction
self.direction = direction
self.full_name = '%s.%s' % (self.parent_module.name, self.name)
# def __eq__(self, other):
# if (not self.name == other.name) or (not self.parent_module.name == other.parent_module.name) or (not self.direction == other.direction):
# print 'Error: ports (%s != %s) donot match' % (self, other)
# return False
# else:
# return True
class pin_t(port_t):
'pin of instance, connect to external port/wire'
def __init__(self, master_port, parent_instance):
net_t.__init__(self, master_port.name)
self.master_port = master_port
self.parent_instance = parent_instance
self.full_name = '%s.%s.%s' % (self.parent_instance.parent_module.name, self.parent_instance.name, self.name)
# def __eq__(self, other):
# if (not self.name == other.name) or (not self.master_port.name == other.master_port.name) or (not self.parent_instance.name == other.parent_instance.name):
# print 'Error: pins (%s != %s) donot match' % (self, other)
# return False
# else:
# return true
################################################################
# compare 2 design/module
################################################################
def __eq_dict__(dict1, dict2):
if (len(set(dict1.keys()) ^ set(dict2.keys())) > 0):
return False
for key in dict1.keys():
if not (dict1[key] == dict2[port_name]):
return False
return True
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
30004,
13,
29937,
22280,
5447,
30004,
13,
29937,
2874,
30004,
13,
29937,
891,
489,
976,
3883,
30004,
13,
29937,
539,
891,
807,
976,
2011,
29914,
22376,
30004,
13,
29937,
539,
891,
807,
976,
2777,
30004,
13,
29937,
1669,
891,
807,
976,
12534,
30004,
13,
30004,
13,
1990,
2874,
29918,
29873,
29901,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
30004,
13,
4706,
1583,
29889,
7576,
353,
9657,
26471,
13,
30004,
13,
1678,
822,
788,
29918,
5453,
29898,
1311,
29892,
3883,
29918,
978,
1125,
30004,
13,
4706,
565,
313,
5453,
29918,
978,
297,
1583,
29889,
7576,
29889,
8149,
580,
1125,
30004,
13,
9651,
1596,
525,
2392,
29901,
3883,
313,
29995,
29879,
29897,
2307,
429,
275,
1169,
29915,
1273,
3883,
29918,
978,
30004,
13,
9651,
736,
6213,
30004,
13,
4706,
286,
353,
3883,
29918,
29873,
29898,
5453,
29918,
978,
8443,
13,
4706,
1583,
29889,
7576,
29898,
29885,
29889,
978,
29897,
353,
286,
30004,
13,
4706,
736,
286,
30004,
13,
30004,
13,
1990,
3883,
29918,
29873,
29901,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
1125,
30004,
13,
4706,
1583,
29889,
978,
353,
1024,
30004,
13,
30004,
13,
4706,
1583,
29889,
4011,
353,
9657,
26471,
13,
4706,
1583,
29889,
3137,
29918,
637,
353,
1051,
580,
396,
2011,
297,
1797,
30004,
13,
4706,
1583,
29889,
29893,
2658,
353,
9657,
26471,
13,
4706,
1583,
29889,
2611,
2925,
353,
9657,
26471,
13,
30004,
13,
4706,
1583,
29889,
7529,
353,
9657,
26471,
13,
30004,
13,
4706,
1583,
29889,
275,
29918,
29882,
631,
1279,
936,
353,
5852,
30004,
13,
30004,
13,
4706,
1583,
29889,
8159,
29918,
978,
353,
1583,
29889,
978,
30004,
13,
30004,
13,
1678,
822,
788,
29918,
637,
29898,
1311,
29892,
2011,
29918,
978,
29892,
5305,
1125,
30004,
13,
4706,
565,
313,
637,
29918,
978,
297,
1583,
29889,
4011,
29889,
8149,
580,
1125,
30004,
13,
9651,
1596,
525,
2392,
29901,
2011,
313,
29995,
29879,
29897,
297,
3883,
313,
29995,
29879,
29897,
2307,
4864,
29915,
1273,
313,
637,
29918,
978,
29892,
1583,
29889,
8159,
29918,
978,
8443,
13,
9651,
736,
6213,
30004,
13,
4706,
282,
353,
2011,
29918,
29873,
29898,
637,
29918,
978,
29892,
1583,
29892,
5305,
8443,
13,
4706,
1583,
29889,
4011,
29898,
29886,
29889,
978,
29897,
353,
282,
30004,
13,
4706,
1583,
29889,
3137,
29918,
637,
29889,
4397,
29898,
29886,
8443,
13,
4706,
736,
282,
30004,
13,
30004,
13,
1678,
822,
788,
29918,
22376,
29898,
1311,
29892,
8014,
29918,
978,
1125,
30004,
13,
4706,
565,
313,
22376,
29918,
978,
297,
1583,
29889,
29893,
2658,
29889,
8149,
580,
1125,
30004,
13,
9651,
1596,
525,
2392,
29901,
8014,
313,
29995,
29879,
29897,
297,
3883,
313,
29995,
29879,
29897,
2307,
4864,
29915,
1273,
313,
22376,
29918,
978,
29892,
1583,
29889,
8159,
29918,
978,
8443,
13,
9651,
736,
6213,
30004,
13,
4706,
281,
353,
8014,
29918,
29873,
29898,
22376,
29918,
978,
29892,
1583,
8443,
13,
4706,
1583,
29889,
29893,
2658,
29898,
29893,
29889,
978,
29897,
353,
281,
30004,
13,
4706,
736,
281,
30004,
13,
30004,
13,
1678,
822,
788,
29918,
8758,
29898,
1311,
29892,
2777,
29918,
978,
1125,
30004,
13,
4706,
565,
313,
8758,
29918,
978,
297,
1583,
29889,
2611,
2925,
29889,
8149,
580,
1125,
30004,
13,
9651,
1596,
525,
2392,
29901,
2777,
313,
29995,
29879,
29897,
297,
3883,
313,
29995,
29879,
29897,
2307,
4864,
29915,
1273,
313,
8758,
29918,
978,
29892,
1583,
29889,
8159,
29918,
978,
8443,
13,
9651,
736,
6213,
30004,
13,
4706,
302,
353,
2777,
29918,
29873,
29898,
8758,
29918,
978,
29892,
1583,
8443,
13,
4706,
1583,
29889,
2611,
2925,
29898,
29876,
29889,
978,
29897,
353,
302,
30004,
13,
4706,
736,
302,
30004,
13,
30004,
13,
1678,
822,
788,
29918,
3207,
29898,
1311,
29892,
1828,
29892,
2322,
29918,
1767,
1125,
30004,
13,
4706,
565,
313,
3207,
297,
1583,
29889,
7529,
29889,
8149,
580,
1125,
30004,
13,
9651,
1596,
525,
2392,
29901,
1828,
313,
29995,
29879,
29897,
297,
3883,
313,
29995,
29879,
29897,
2307,
4864,
29915,
1273,
313,
3207,
29892,
1583,
29889,
8159,
29918,
978,
8443,
13,
9651,
736,
29871,
29900,
30004,
13,
4706,
1583,
29889,
7529,
29898,
3207,
29897,
353,
2322,
29918,
1767,
30004,
13,
4706,
736,
29871,
29896,
30004,
13,
30004,
13,
29937,
268,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
30004,
13,
29937,
308,
5186,
353,
5852,
30004,
13,
29937,
308,
565,
451,
313,
1311,
29889,
978,
1275,
916,
29889,
978,
1125,
30004,
13,
29937,
632,
5186,
353,
7700,
30004,
13,
29937,
308,
565,
451,
4770,
1837,
29918,
8977,
12035,
1311,
29889,
4011,
29892,
916,
29889,
4011,
1125,
30004,
13,
29937,
632,
5186,
353,
7700,
30004,
13,
29937,
308,
565,
451,
4770,
1837,
29918,
8977,
12035,
1311,
29889,
2611,
2925,
29892,
916,
29889,
2611,
2925,
1125,
30004,
13,
29937,
632,
5186,
353,
7700,
30004,
13,
29937,
308,
565,
451,
4770,
1837,
29918,
8977,
12035,
1311,
29889,
29893,
2658,
29892,
916,
29889,
29893,
2658,
1125,
30004,
13,
29937,
632,
5186,
353,
7700,
30004,
13,
29937,
6756,
13,
29937,
308,
565,
451,
5186,
29901,
30004,
13,
29937,
632,
1596,
525,
2392,
29901,
10585,
313,
29995,
29879,
2804,
1273,
29879,
29897,
1016,
327,
1993,
29915,
1273,
313,
1311,
29892,
916,
8443,
13,
29937,
6756,
13,
29937,
308,
736,
5186,
30004,
13,
30004,
13,
1990,
2777,
29918,
29873,
29901,
30004,
13,
1678,
525,
8758,
310,
3883,
29915,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29892,
3847,
29918,
5453,
1125,
30004,
13,
4706,
1583,
29889,
978,
353,
1024,
30004,
13,
4706,
1583,
29889,
3560,
29918,
5453,
353,
3847,
29918,
5453,
30004,
13,
4706,
1583,
29889,
29886,
1144,
353,
9657,
26471,
13,
30004,
13,
4706,
1583,
29889,
6207,
29918,
5453,
353,
6213,
30004,
13,
4706,
1583,
29889,
7529,
353,
9657,
26471,
13,
30004,
13,
4706,
1583,
29889,
8159,
29918,
978,
353,
29871,
14210,
29879,
29889,
29995,
29879,
29915,
1273,
313,
1311,
29889,
3560,
29918,
5453,
29889,
978,
29892,
1583,
29889,
978,
8443,
13,
30004,
13,
4706,
363,
5835,
29918,
637,
297,
1583,
29889,
3560,
29918,
5453,
29889,
4011,
29889,
5975,
7295,
30004,
13,
9651,
282,
353,
12534,
29918,
29873,
29898,
6207,
29918,
637,
29892,
1583,
8443,
13,
9651,
1583,
29889,
29886,
1144,
29961,
29886,
29889,
978,
29962,
353,
282,
30004,
13,
30004,
13,
1678,
822,
4511,
29918,
12687,
29898,
1311,
29892,
12534,
29918,
978,
29892,
4511,
29918,
978,
1125,
30004,
13,
4706,
396,
1284,
4511,
30004,
13,
4706,
286,
353,
1583,
29889,
3560,
29918,
5453,
30004,
13,
4706,
565,
313,
6915,
29918,
978,
297,
286,
29889,
4011,
29889,
8149,
580,
1125,
30004,
13,
9651,
4511,
353,
286,
29889,
4011,
29898,
6915,
29918,
978,
8443,
13,
4706,
25342,
313,
6915,
29918,
978,
297,
286,
29889,
29893,
2658,
29889,
8149,
580,
1125,
30004,
13,
9651,
4511,
353,
286,
29889,
29893,
2658,
29898,
6915,
29918,
978,
8443,
13,
4706,
1683,
29901,
30004,
13,
9651,
1596,
525,
2392,
29901,
2609,
1284,
4511,
313,
29995,
29879,
29897,
297,
3883,
313,
29995,
29879,
29897,
363,
2777,
313,
29995,
29879,
16029,
1273,
313,
6915,
29918,
978,
29892,
286,
29889,
978,
29892,
1583,
29889,
978,
8443,
13,
30004,
13,
4706,
1583,
29889,
29886,
1144,
29961,
12687,
29918,
978,
1822,
3137,
29918,
6915,
29889,
4397,
29898,
6915,
8443,
13,
4706,
4511,
29889,
3137,
29918,
6915,
29889,
4397,
29898,
1311,
8443,
13,
30004,
13,
1678,
822,
788,
29918,
3207,
29898,
1311,
29892,
1828,
29892,
995,
1125,
30004,
13,
4706,
4974,
1828,
297,
1583,
29889,
3560,
29918,
5453,
29889,
7529,
29889,
8149,
3285,
525,
2392,
29901,
1828,
313,
29995,
29879,
29897,
947,
1333,
1863,
297,
3883,
313,
29995,
29879,
16029,
1273,
313,
3207,
29892,
1583,
29889,
3560,
29918,
5453,
29889,
978,
8443,
13,
4706,
1583,
29889,
7529,
29898,
3207,
29897,
353,
995,
30004,
13,
30004,
13,
29937,
268,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
30004,
13,
29937,
308,
5186,
353,
5852,
30004,
13,
29937,
308,
565,
313,
1333,
1583,
29889,
978,
1275,
916,
29889,
978,
29897,
470,
313,
1333,
1583,
29889,
3560,
29918,
5453,
29889,
978,
1275,
916,
29889,
3560,
29918,
5453,
29889,
978,
29897,
470,
313,
1333,
1583,
29889,
6207,
29918,
5453,
29889,
978,
1275,
916,
29889,
6207,
29918,
5453,
29889,
978,
1125,
30004,
13,
29937,
632,
5186,
353,
7700,
30004,
13,
29937,
308,
565,
451,
4770,
1837,
29918,
8977,
12035,
1311,
29889,
29886,
1144,
29892,
916,
29889,
29886,
1144,
1125,
30004,
13,
29937,
632,
5186,
353,
7700,
30004,
13,
29937,
6756,
13,
29937,
308,
565,
451,
5186,
29901,
30004,
13,
29937,
632,
1596,
525,
2392,
29901,
8871,
313,
29995,
29879,
2804,
1273,
29879,
29897,
1016,
327,
1993,
29915,
1273,
313,
1311,
29892,
916,
8443,
13,
29937,
6756,
13,
29937,
308,
736,
5186,
30004,
13,
30004,
13,
1990,
7787,
29918,
29873,
29901,
30004,
13,
1678,
525,
16121,
770,
363,
8014,
29914,
637,
29914,
12687,
29915,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
1125,
30004,
13,
4706,
1583,
29889,
978,
353,
1024,
30004,
13,
4706,
1583,
29889,
3137,
29918,
6915,
353,
1051,
26471,
13,
30004,
13,
1990,
8014,
29918,
29873,
29898,
1212,
29918,
29873,
1125,
30004,
13,
1678,
525,
22376,
297,
3883,
29892,
4511,
304,
7463,
12534,
29915,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29892,
3847,
29918,
5453,
1125,
30004,
13,
4706,
7787,
29918,
29873,
17255,
2344,
12035,
1311,
29892,
1024,
8443,
13,
4706,
1583,
29889,
3560,
29918,
5453,
353,
3847,
29918,
5453,
30004,
13,
4706,
1583,
29889,
3137,
29918,
12963,
262,
353,
1051,
26471,
13,
4706,
1583,
29889,
3137,
29918,
12963,
449,
353,
1051,
26471,
13,
30004,
13,
1990,
2011,
29918,
29873,
29898,
1212,
29918,
29873,
1125,
30004,
13,
1678,
525,
637,
310,
3883,
29892,
4511,
304,
7463,
12534,
29915,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29892,
3847,
29918,
5453,
29892,
5305,
1125,
30004,
13,
4706,
7787,
29918,
29873,
17255,
2344,
12035,
1311,
29892,
1024,
8443,
13,
4706,
1583,
29889,
3560,
29918,
5453,
353,
3847,
29918,
5453,
30004,
13,
4706,
4974,
5305,
297,
525,
2080,
1962,
21000,
8684,
742,
5305,
30004,
13,
4706,
1583,
29889,
20845,
353,
5305,
30004,
13,
4706,
1583,
29889,
8159,
29918,
978,
353,
14210,
29879,
29889,
29995,
29879,
29915,
1273,
313,
1311,
29889,
3560,
29918,
5453,
29889,
978,
29892,
1583,
29889,
978,
8443,
13,
30004,
13,
29937,
268,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
30004,
13,
29937,
308,
565,
313,
1333,
1583,
29889,
978,
1275,
916,
29889,
978,
29897,
470,
313,
1333,
1583,
29889,
3560,
29918,
5453,
29889,
978,
1275,
916,
29889,
3560,
29918,
5453,
29889,
978,
29897,
470,
313,
1333,
1583,
29889,
20845,
1275,
916,
29889,
20845,
1125,
30004,
13,
29937,
632,
1596,
525,
2392,
29901,
16169,
313,
29995,
29879,
2804,
1273,
29879,
29897,
1016,
327,
1993,
29915,
1273,
313,
1311,
29892,
916,
8443,
13,
29937,
632,
736,
7700,
30004,
13,
29937,
308,
1683,
29901,
30004,
13,
29937,
632,
736,
5852,
30004,
13,
30004,
13,
1990,
12534,
29918,
29873,
29898,
637,
29918,
29873,
1125,
30004,
13,
1678,
525,
12687,
310,
2777,
29892,
4511,
304,
7029,
2011,
29914,
22376,
29915,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
5835,
29918,
637,
29892,
3847,
29918,
8758,
1125,
30004,
13,
4706,
7787,
29918,
29873,
17255,
2344,
12035,
1311,
29892,
5835,
29918,
637,
29889,
978,
8443,
13,
4706,
1583,
29889,
6207,
29918,
637,
353,
5835,
29918,
637,
30004,
13,
4706,
1583,
29889,
3560,
29918,
8758,
353,
3847,
29918,
8758,
30004,
13,
30004,
13,
4706,
1583,
29889,
8159,
29918,
978,
353,
14210,
29879,
29889,
29995,
29879,
29889,
29995,
29879,
29915,
1273,
313,
1311,
29889,
3560,
29918,
8758,
29889,
3560,
29918,
5453,
29889,
978,
29892,
1583,
29889,
3560,
29918,
8758,
29889,
978,
29892,
1583,
29889,
978,
8443,
13,
30004,
13,
29937,
268,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
30004,
13,
29937,
308,
565,
313,
1333,
1583,
29889,
978,
1275,
916,
29889,
978,
29897,
470,
313,
1333,
1583,
29889,
6207,
29918,
637,
29889,
978,
1275,
916,
29889,
6207,
29918,
637,
29889,
978,
29897,
470,
313,
1333,
1583,
29889,
3560,
29918,
8758,
29889,
978,
1275,
916,
29889,
3560,
29918,
8758,
29889,
978,
1125,
30004,
13,
29937,
632,
1596,
525,
2392,
29901,
282,
1144,
313,
29995,
29879,
2804,
1273,
29879,
29897,
1016,
327,
1993,
29915,
1273,
313,
1311,
29892,
916,
8443,
13,
29937,
632,
736,
7700,
30004,
13,
29937,
308,
1683,
29901,
30004,
13,
29937,
632,
736,
1565,
30004,
13,
30004,
13,
13383,
13383,
13383,
13383,
30004,
13,
29937,
7252,
29871,
29906,
2874,
29914,
5453,
30004,
13,
13383,
13383,
13383,
13383,
30004,
13,
30004,
13,
1753,
4770,
1837,
29918,
8977,
12035,
8977,
29896,
29892,
9657,
29906,
1125,
30004,
13,
1678,
565,
313,
2435,
29898,
842,
29898,
8977,
29896,
29889,
8149,
3101,
6228,
731,
29898,
8977,
29906,
29889,
8149,
22130,
1405,
29871,
29900,
1125,
30004,
13,
4706,
736,
7700,
30004,
13,
30004,
13,
1678,
363,
1820,
297,
9657,
29896,
29889,
8149,
7295,
30004,
13,
4706,
565,
451,
313,
8977,
29896,
29961,
1989,
29962,
1275,
9657,
29906,
29961,
637,
29918,
978,
29962,
1125,
30004,
13,
9651,
736,
7700,
30004,
13,
30004,
13,
1678,
736,
5852,
30004,
13,
2
] |
src/mcedit2/widgets/infopanel.py
|
elcarrion06/mcedit2
| 673 |
34617
|
"""
${NAME}
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import time
import weakref
from PySide import QtGui
from mcedit2.widgets.layout import Column
log = logging.getLogger(__name__)
class InfoPanel(QtGui.QWidget):
def __init__(self, attrs, signals, **kwargs):
"""
Create a widget that displays a list of an object's selected attributes, named in `attrs`.
The widget updates itself whenever one of the object's signals named in `signals` is emitted.
If an attribute named in `attrs` is not found on `object`, the InfoPanel instance is checked for
an attribute of the same name and it is used instead if found.
:type attrs: list of attribute names to display
:type signals: list of signals to monitor
:param kwargs: args for QWidget
:type kwargs:
"""
QtGui.QWidget.__init__(self, **kwargs)
self.attrs = attrs
self.signals = signals
self.lastUpdate = time.time()
self.labels = [QtGui.QLabel() for _ in attrs]
self.setLayout(Column(*self.labels))
def updateLabels(self):
now = time.time()
if now < self.lastUpdate + 0.25:
return
self.lastUpdate = now
if self.object:
for attr, label in zip(self.attrs, self.labels):
try:
value = getattr(self.object, attr)
except AttributeError: # catches unrelated AttributeErrors in property getters...
try:
value = getattr(self, attr)
except AttributeError:
log.exception("Error updating info panel.")
value = getattr(self, attr, "Attribute not found")
label.setText("%s: %s" % (attr, value))
_object = None
@property
def object(self):
return self._object()
@object.setter
def object(self, value):
self._object = weakref.ref(value)
self.updateLabels()
for signal in self.signals:
signal = getattr(self.object, signal, None)
if signal:
signal.connect(self.updateLabels)
setObject = object.setter
|
[
1,
9995,
13,
1678,
6435,
5813,
29913,
13,
15945,
29908,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
29892,
8542,
29892,
1596,
29918,
2220,
29892,
29104,
29918,
20889,
1338,
13,
5215,
12183,
13,
5215,
931,
13,
5215,
8062,
999,
13,
13,
3166,
10772,
23908,
1053,
14705,
28707,
13,
13,
3166,
286,
1133,
277,
29906,
29889,
8030,
29879,
29889,
2680,
1053,
12481,
13,
13,
13,
1188,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
1990,
22140,
7490,
29898,
17303,
28707,
29889,
29984,
8801,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
12421,
29879,
29892,
18470,
29892,
3579,
19290,
1125,
13,
4706,
9995,
13,
4706,
6204,
263,
11109,
393,
14423,
263,
1051,
310,
385,
1203,
29915,
29879,
4629,
8393,
29892,
4257,
297,
421,
5552,
29879,
1412,
13,
4706,
450,
11109,
11217,
3528,
10940,
697,
310,
278,
1203,
29915,
29879,
18470,
4257,
297,
421,
4530,
1338,
29952,
338,
953,
4430,
29889,
13,
13,
4706,
960,
385,
5352,
4257,
297,
421,
5552,
29879,
29952,
338,
451,
1476,
373,
421,
3318,
1673,
278,
22140,
7490,
2777,
338,
7120,
363,
13,
4706,
385,
5352,
310,
278,
1021,
1024,
322,
372,
338,
1304,
2012,
565,
1476,
29889,
13,
13,
4706,
584,
1853,
12421,
29879,
29901,
1051,
310,
5352,
2983,
304,
2479,
13,
4706,
584,
1853,
18470,
29901,
1051,
310,
18470,
304,
11819,
13,
4706,
584,
3207,
9049,
5085,
29901,
6389,
363,
660,
8801,
13,
4706,
584,
1853,
9049,
5085,
29901,
13,
4706,
9995,
13,
4706,
14705,
28707,
29889,
29984,
8801,
17255,
2344,
12035,
1311,
29892,
3579,
19290,
29897,
13,
4706,
1583,
29889,
5552,
29879,
353,
12421,
29879,
13,
4706,
1583,
29889,
4530,
1338,
353,
18470,
13,
4706,
1583,
29889,
4230,
6422,
353,
931,
29889,
2230,
580,
13,
4706,
1583,
29889,
21134,
353,
518,
17303,
28707,
29889,
2239,
1107,
580,
363,
903,
297,
12421,
29879,
29962,
13,
13,
4706,
1583,
29889,
842,
3453,
29898,
4409,
10456,
1311,
29889,
21134,
876,
13,
13,
1678,
822,
2767,
4775,
29879,
29898,
1311,
1125,
13,
4706,
1286,
353,
931,
29889,
2230,
580,
13,
4706,
565,
1286,
529,
1583,
29889,
4230,
6422,
718,
29871,
29900,
29889,
29906,
29945,
29901,
13,
9651,
736,
13,
4706,
1583,
29889,
4230,
6422,
353,
1286,
13,
4706,
565,
1583,
29889,
3318,
29901,
13,
9651,
363,
12421,
29892,
3858,
297,
14319,
29898,
1311,
29889,
5552,
29879,
29892,
1583,
29889,
21134,
1125,
13,
18884,
1018,
29901,
13,
462,
1678,
995,
353,
679,
5552,
29898,
1311,
29889,
3318,
29892,
12421,
29897,
13,
18884,
5174,
23833,
2392,
29901,
29871,
396,
4380,
267,
443,
12817,
23833,
22463,
297,
2875,
679,
2153,
856,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
995,
353,
679,
5552,
29898,
1311,
29892,
12421,
29897,
13,
462,
1678,
5174,
23833,
2392,
29901,
13,
462,
4706,
1480,
29889,
11739,
703,
2392,
13271,
5235,
9451,
23157,
13,
462,
4706,
995,
353,
679,
5552,
29898,
1311,
29892,
12421,
29892,
376,
6708,
451,
1476,
1159,
13,
18884,
3858,
29889,
12038,
11702,
29879,
29901,
1273,
29879,
29908,
1273,
313,
5552,
29892,
995,
876,
13,
13,
1678,
903,
3318,
353,
6213,
13,
1678,
732,
6799,
13,
1678,
822,
1203,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
3318,
580,
13,
13,
1678,
732,
3318,
29889,
842,
357,
13,
1678,
822,
1203,
29898,
1311,
29892,
995,
1125,
13,
4706,
1583,
3032,
3318,
353,
8062,
999,
29889,
999,
29898,
1767,
29897,
13,
4706,
1583,
29889,
5504,
4775,
29879,
580,
13,
13,
4706,
363,
7182,
297,
1583,
29889,
4530,
1338,
29901,
13,
9651,
7182,
353,
679,
5552,
29898,
1311,
29889,
3318,
29892,
7182,
29892,
6213,
29897,
13,
9651,
565,
7182,
29901,
13,
18884,
7182,
29889,
6915,
29898,
1311,
29889,
5504,
4775,
29879,
29897,
13,
13,
1678,
731,
2061,
353,
1203,
29889,
842,
357,
13,
2
] |
tests/test_monitor_sys.py
|
CFMTech/monitor-server-api
| 3 |
177446
|
<gh_stars>1-10
# SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
from http import HTTPStatus
from monitor_server import SERVER
import json
def test_index(monitor, gen):
c = gen.new_context()
monitor.post_contexts_v1(c)
s1, s2, s3 = gen.new_session(), gen.new_session(), gen.new_session()
for s in (s1, s2, s3):
monitor.post_sessions_v1(s)
for i in range(100):
m = gen.new_metric(c, s)
monitor.post_metrics_v1(m)
index = monitor.client.get('/index.html')
assert index.status_code == HTTPStatus.OK
# Strip parts, and remove '</p>' at the end
tmp = index.data.decode().split('\n')
s = ' '.join([i.strip() for i in index.data.decode().split('\n')[100:115]])[:-4]
assert '>300<' in s
assert '>3<' in s
assert '>1<' in s
def test_pager_get_last(monitor, gen):
c = gen.new_context()
monitor.post_contexts_v1(c)
s1, s2, s3 = gen.new_session(), gen.new_session(), gen.new_session()
for s in (s1, s2, s3):
monitor.post_sessions_v1(s)
for i in range(100):
m = gen.new_metric(c, s)
monitor.post_metrics_v1(m)
resp = monitor.client.get('/api/v1/metrics/?page=-1')
assert resp.status_code == HTTPStatus.OK
assert 'next_url' not in resp.json
assert 'prev_url' in resp.json
resp = monitor.client.get('/api/v1/metrics/', json=dict(page=-1))
assert resp.status_code == HTTPStatus.OK
assert 'next_url' not in resp.json
assert 'prev_url' in resp.json
def test_pager_page_info(monitor, gen):
c = gen.new_context()
monitor.post_contexts_v1(c)
s1, s2, s3 = gen.new_session(), gen.new_session(), gen.new_session()
for s in (s1, s2, s3):
monitor.post_sessions_v1(s)
for i in range(100):
m = gen.new_metric(c, s)
monitor.post_metrics_v1(m)
resp = monitor.client.get('/api/v1/metrics/?page=-1')
assert resp.status_code == HTTPStatus.OK
assert 'next_url' not in resp.json
assert 'prev_url' in resp.json
resp = monitor.client.get('/api/v1/metrics/?page=-2')
assert resp.status_code == HTTPStatus.OK
assert 'next_url' in resp.json
assert 'prev_url' in resp.json
resp = monitor.client.get('/api/v1/metrics/')
assert resp.status_code == HTTPStatus.OK
assert 'next_url' in resp.json
assert 'prev_url' not in resp.json
def test_docs_are_valid():
assert dict(error="Unable to render schema") != SERVER.API_V1.__schema__
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
10937,
29928,
29990,
29899,
2283,
11882,
1266,
1626,
29901,
29871,
29906,
29900,
29906,
29896,
529,
5813,
29958,
3532,
26862,
6227,
6778,
13,
29937,
13,
29937,
10937,
29928,
29990,
29899,
29931,
293,
1947,
29899,
12889,
29901,
341,
1806,
13,
13,
3166,
1732,
1053,
7331,
5709,
13,
3166,
11819,
29918,
2974,
1053,
26996,
5348,
13,
5215,
4390,
13,
13,
13,
1753,
1243,
29918,
2248,
29898,
3712,
2105,
29892,
2531,
1125,
13,
1678,
274,
353,
2531,
29889,
1482,
29918,
4703,
580,
13,
1678,
11819,
29889,
2490,
29918,
4703,
29879,
29918,
29894,
29896,
29898,
29883,
29897,
13,
1678,
269,
29896,
29892,
269,
29906,
29892,
269,
29941,
353,
2531,
29889,
1482,
29918,
7924,
3285,
2531,
29889,
1482,
29918,
7924,
3285,
2531,
29889,
1482,
29918,
7924,
580,
13,
1678,
363,
269,
297,
313,
29879,
29896,
29892,
269,
29906,
29892,
269,
29941,
1125,
13,
4706,
11819,
29889,
2490,
29918,
29879,
10964,
29918,
29894,
29896,
29898,
29879,
29897,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29900,
29900,
1125,
13,
9651,
286,
353,
2531,
29889,
1482,
29918,
16414,
29898,
29883,
29892,
269,
29897,
13,
9651,
11819,
29889,
2490,
29918,
2527,
10817,
29918,
29894,
29896,
29898,
29885,
29897,
13,
1678,
2380,
353,
11819,
29889,
4645,
29889,
657,
11219,
2248,
29889,
1420,
1495,
13,
1678,
4974,
2380,
29889,
4882,
29918,
401,
1275,
7331,
5709,
29889,
8949,
13,
1678,
396,
624,
6472,
5633,
29892,
322,
3349,
525,
829,
29886,
16299,
472,
278,
1095,
13,
1678,
13128,
353,
2380,
29889,
1272,
29889,
13808,
2141,
5451,
28909,
29876,
1495,
13,
1678,
269,
353,
525,
15300,
7122,
4197,
29875,
29889,
17010,
580,
363,
474,
297,
2380,
29889,
1272,
29889,
13808,
2141,
5451,
28909,
29876,
29861,
29896,
29900,
29900,
29901,
29896,
29896,
29945,
24960,
7503,
29899,
29946,
29962,
13,
1678,
4974,
525,
29958,
29941,
29900,
29900,
26717,
297,
269,
13,
1678,
4974,
525,
29958,
29941,
26717,
297,
269,
13,
1678,
4974,
525,
29958,
29896,
26717,
297,
269,
13,
13,
13,
1753,
1243,
29918,
29886,
1875,
29918,
657,
29918,
4230,
29898,
3712,
2105,
29892,
2531,
1125,
13,
1678,
274,
353,
2531,
29889,
1482,
29918,
4703,
580,
13,
1678,
11819,
29889,
2490,
29918,
4703,
29879,
29918,
29894,
29896,
29898,
29883,
29897,
13,
1678,
269,
29896,
29892,
269,
29906,
29892,
269,
29941,
353,
2531,
29889,
1482,
29918,
7924,
3285,
2531,
29889,
1482,
29918,
7924,
3285,
2531,
29889,
1482,
29918,
7924,
580,
13,
1678,
363,
269,
297,
313,
29879,
29896,
29892,
269,
29906,
29892,
269,
29941,
1125,
13,
4706,
11819,
29889,
2490,
29918,
29879,
10964,
29918,
29894,
29896,
29898,
29879,
29897,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29900,
29900,
1125,
13,
9651,
286,
353,
2531,
29889,
1482,
29918,
16414,
29898,
29883,
29892,
269,
29897,
13,
9651,
11819,
29889,
2490,
29918,
2527,
10817,
29918,
29894,
29896,
29898,
29885,
29897,
13,
1678,
4613,
353,
11819,
29889,
4645,
29889,
657,
11219,
2754,
29914,
29894,
29896,
29914,
2527,
10817,
13401,
3488,
10457,
29896,
1495,
13,
1678,
4974,
4613,
29889,
4882,
29918,
401,
1275,
7331,
5709,
29889,
8949,
13,
1678,
4974,
525,
4622,
29918,
2271,
29915,
451,
297,
4613,
29889,
3126,
13,
1678,
4974,
525,
16304,
29918,
2271,
29915,
297,
4613,
29889,
3126,
13,
1678,
4613,
353,
11819,
29889,
4645,
29889,
657,
11219,
2754,
29914,
29894,
29896,
29914,
2527,
10817,
29914,
742,
4390,
29922,
8977,
29898,
3488,
10457,
29896,
876,
13,
1678,
4974,
4613,
29889,
4882,
29918,
401,
1275,
7331,
5709,
29889,
8949,
13,
1678,
4974,
525,
4622,
29918,
2271,
29915,
451,
297,
4613,
29889,
3126,
13,
1678,
4974,
525,
16304,
29918,
2271,
29915,
297,
4613,
29889,
3126,
13,
13,
13,
1753,
1243,
29918,
29886,
1875,
29918,
3488,
29918,
3888,
29898,
3712,
2105,
29892,
2531,
1125,
13,
1678,
274,
353,
2531,
29889,
1482,
29918,
4703,
580,
13,
1678,
11819,
29889,
2490,
29918,
4703,
29879,
29918,
29894,
29896,
29898,
29883,
29897,
13,
1678,
269,
29896,
29892,
269,
29906,
29892,
269,
29941,
353,
2531,
29889,
1482,
29918,
7924,
3285,
2531,
29889,
1482,
29918,
7924,
3285,
2531,
29889,
1482,
29918,
7924,
580,
13,
1678,
363,
269,
297,
313,
29879,
29896,
29892,
269,
29906,
29892,
269,
29941,
1125,
13,
4706,
11819,
29889,
2490,
29918,
29879,
10964,
29918,
29894,
29896,
29898,
29879,
29897,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29900,
29900,
1125,
13,
9651,
286,
353,
2531,
29889,
1482,
29918,
16414,
29898,
29883,
29892,
269,
29897,
13,
9651,
11819,
29889,
2490,
29918,
2527,
10817,
29918,
29894,
29896,
29898,
29885,
29897,
13,
1678,
4613,
353,
11819,
29889,
4645,
29889,
657,
11219,
2754,
29914,
29894,
29896,
29914,
2527,
10817,
13401,
3488,
10457,
29896,
1495,
13,
1678,
4974,
4613,
29889,
4882,
29918,
401,
1275,
7331,
5709,
29889,
8949,
13,
1678,
4974,
525,
4622,
29918,
2271,
29915,
451,
297,
4613,
29889,
3126,
13,
1678,
4974,
525,
16304,
29918,
2271,
29915,
297,
4613,
29889,
3126,
13,
1678,
4613,
353,
11819,
29889,
4645,
29889,
657,
11219,
2754,
29914,
29894,
29896,
29914,
2527,
10817,
13401,
3488,
10457,
29906,
1495,
13,
1678,
4974,
4613,
29889,
4882,
29918,
401,
1275,
7331,
5709,
29889,
8949,
13,
1678,
4974,
525,
4622,
29918,
2271,
29915,
297,
4613,
29889,
3126,
13,
1678,
4974,
525,
16304,
29918,
2271,
29915,
297,
4613,
29889,
3126,
13,
1678,
4613,
353,
11819,
29889,
4645,
29889,
657,
11219,
2754,
29914,
29894,
29896,
29914,
2527,
10817,
29914,
1495,
13,
1678,
4974,
4613,
29889,
4882,
29918,
401,
1275,
7331,
5709,
29889,
8949,
13,
1678,
4974,
525,
4622,
29918,
2271,
29915,
297,
4613,
29889,
3126,
13,
1678,
4974,
525,
16304,
29918,
2271,
29915,
451,
297,
4613,
29889,
3126,
13,
13,
13,
1753,
1243,
29918,
2640,
29918,
598,
29918,
3084,
7295,
13,
1678,
4974,
9657,
29898,
2704,
543,
2525,
519,
304,
4050,
10938,
1159,
2804,
26996,
5348,
29889,
8787,
29918,
29963,
29896,
17255,
11010,
1649,
13,
2
] |
config.py
|
alcaras/mplus.subcreation.net
| 31 |
105563
|
# raider.io api configuration
RIO_MAX_PAGE = 5
# need to update in templates/stats_table.html
# need to update in templates/compositions.html
# need to update in templates/navbar.html
RIO_SEASON = "season-sl-2"
WCL_SEASON = 2
WCL_PARTITION = 1
# config
RAID_NAME = "Sanctum of Domination"
# late in the season, set this at 16
# early in the seaseon, set this at 10
MIN_KEY_LEVEL = 16
# to generate a tier list based on heroic week data
MAX_RAID_DIFFICULTY = "Mythic"
|
[
1,
29871,
13,
13,
29937,
1153,
1241,
29889,
601,
7882,
5285,
13,
3960,
29949,
29918,
12648,
29918,
7228,
1692,
353,
29871,
29945,
13,
13,
29937,
817,
304,
2767,
297,
17475,
29914,
16202,
29918,
2371,
29889,
1420,
13,
29937,
817,
304,
2767,
297,
17475,
29914,
22410,
2187,
29889,
1420,
13,
29937,
817,
304,
2767,
297,
17475,
29914,
21890,
29889,
1420,
13,
3960,
29949,
29918,
1660,
29909,
3094,
353,
376,
25682,
29899,
2536,
29899,
29906,
29908,
29871,
13,
13,
29956,
6154,
29918,
1660,
29909,
3094,
353,
29871,
29906,
13,
29956,
6154,
29918,
26092,
22122,
353,
29871,
29896,
13,
13,
29937,
2295,
13,
4717,
1367,
29918,
5813,
353,
376,
22509,
312,
398,
310,
7809,
3381,
29908,
13,
13,
29937,
5683,
297,
278,
4259,
29892,
731,
445,
472,
29871,
29896,
29953,
13,
29937,
4688,
297,
278,
409,
559,
265,
29892,
731,
445,
472,
29871,
29896,
29900,
13,
16173,
29918,
10818,
29918,
1307,
29963,
6670,
353,
29871,
29896,
29953,
13,
13,
13,
29937,
304,
5706,
263,
26485,
1051,
2729,
373,
13444,
293,
4723,
848,
13,
12648,
29918,
4717,
1367,
29918,
4571,
4198,
2965,
8647,
29979,
353,
376,
29924,
1541,
293,
29908,
13,
2
] |
Image Segmtation on COCO Dataset/keras_segmentation/data_utils/data_loader.py
|
joykour/COCO-Dataset-2018-Stuff-Segmentation-Challenge
| 1 |
37322
|
import numpy as np
import cv2
import glob
import itertools
import os
from tqdm import tqdm
from ..models.config import IMAGE_ORDERING
from .augmentation import augment_seg
import random
random.seed(0)
class_colors = [ ( random.randint(0,255),random.randint(0,255),random.randint(0,255) ) for _ in range(5000) ]
def get_pairs_from_paths( images_path , segs_path ):
images = glob.glob( os.path.join(images_path,"*.png") ) + glob.glob( os.path.join(images_path,"*.jpg") ) + glob.glob( os.path.join(images_path,"*.jpeg") )
segmentations = glob.glob( os.path.join(segs_path,"*.png") )
segmentations_d = dict( zip(segmentations,segmentations ))
ret = []
for im in images:
seg_bnme = os.path.basename(im).replace(".jpg" , ".png").replace(".jpeg" , ".png")
seg = os.path.join( segs_path , seg_bnme )
#this line i have commented as error was showing
#assert ( seg in segmentations_d ), (im + " is present in "+images_path +" but "+seg_bnme+" is not found in "+segs_path + " . Make sure annotation image are in .png" )
ret.append((im , seg) )
return ret
def get_image_arr( path , width , height , imgNorm="sub_mean" , odering='channels_first' ):
if type( path ) is np.ndarray:
img = path
else:
img = cv2.imread(path, 1)
if imgNorm == "sub_and_divide":
img = np.float32(cv2.resize(img, ( width , height ))) / 127.5 - 1
elif imgNorm == "sub_mean":
img = cv2.resize(img, ( width , height ))
img = img.astype(np.float32)
img[:,:,0] -= 103.939
img[:,:,1] -= 116.779
img[:,:,2] -= 123.68
img = img[ : , : , ::-1 ]
elif imgNorm == "divide":
img = cv2.resize(img, ( width , height ))
img = img.astype(np.float32)
img = img/255.0
if odering == 'channels_first':
img = np.rollaxis(img, 2, 0)
return img
def get_segmentation_arr( path , nClasses , width , height , no_reshape=False ):
seg_labels = np.zeros(( height , width , nClasses ))
if type( path ) is np.ndarray:
img = path
else:
img = cv2.imread(path, 1)
img = cv2.resize(img, ( width , height ) , interpolation=cv2.INTER_NEAREST )
img = img[:, : , 0]
for c in range(nClasses):
seg_labels[: , : , c ] = (img == c ).astype(int)
if no_reshape:
return seg_labels
seg_labels = np.reshape(seg_labels, ( width*height , nClasses ))
return seg_labels
def verify_segmentation_dataset( images_path , segs_path , n_classes ):
img_seg_pairs = get_pairs_from_paths( images_path , segs_path )
assert len(img_seg_pairs)>0 , "Dataset looks empty or path is wrong "
for im_fn , seg_fn in tqdm(img_seg_pairs) :
img = cv2.imread( im_fn )
seg = cv2.imread( seg_fn )
assert ( img.shape[0]==seg.shape[0] and img.shape[1]==seg.shape[1] ) , "The size of image and the annotation does not match or they are corrupt "+ im_fn + " " + seg_fn
assert ( np.max(seg[:,:,0]) < n_classes) , "The pixel values of seg image should be from 0 to "+str(n_classes-1) + " . Found pixel value "+str(np.max(seg[:,:,0]))
print("Dataset verified! ")
def image_segmentation_generator( images_path , segs_path , batch_size, n_classes , input_height , input_width , output_height , output_width , do_augment=False ):
img_seg_pairs = get_pairs_from_paths( images_path , segs_path )
random.shuffle( img_seg_pairs )
zipped = itertools.cycle( img_seg_pairs )
while True:
X = []
Y = []
for _ in range( batch_size) :
im , seg = next(zipped)
im = cv2.imread(im , 1 )
seg = cv2.imread(seg , 1 )
if do_augment:
img , seg[:,:,0] = augment_seg( img , seg[:,:,0] )
X.append( get_image_arr(im , input_width , input_height ,odering=IMAGE_ORDERING ) )
Y.append( get_segmentation_arr( seg , n_classes , output_width , output_height ) )
yield np.array(X) , np.array(Y)
|
[
1,
29871,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
13,
5215,
13149,
13,
5215,
4256,
8504,
13,
5215,
2897,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
13,
3166,
6317,
9794,
29889,
2917,
1053,
306,
1529,
1692,
29918,
22364,
4214,
13,
3166,
869,
2987,
358,
362,
1053,
18765,
29918,
10199,
13,
5215,
4036,
13,
13,
8172,
29889,
26776,
29898,
29900,
29897,
13,
1990,
29918,
27703,
353,
518,
29871,
313,
4036,
29889,
9502,
524,
29898,
29900,
29892,
29906,
29945,
29945,
511,
8172,
29889,
9502,
524,
29898,
29900,
29892,
29906,
29945,
29945,
511,
8172,
29889,
9502,
524,
29898,
29900,
29892,
29906,
29945,
29945,
29897,
259,
1723,
363,
903,
297,
3464,
29898,
29945,
29900,
29900,
29900,
29897,
29871,
4514,
13,
13,
13,
13,
13,
1753,
679,
29918,
29886,
7121,
29918,
3166,
29918,
24772,
29898,
4558,
29918,
2084,
1919,
2377,
29879,
29918,
2084,
29871,
1125,
13,
12,
8346,
353,
13149,
29889,
23705,
29898,
2897,
29889,
2084,
29889,
7122,
29898,
8346,
29918,
2084,
1699,
10521,
2732,
1159,
29871,
1723,
718,
13149,
29889,
23705,
29898,
2897,
29889,
2084,
29889,
7122,
29898,
8346,
29918,
2084,
1699,
10521,
6173,
1159,
29871,
1723,
718,
29871,
13149,
29889,
23705,
29898,
2897,
29889,
2084,
29889,
7122,
29898,
8346,
29918,
2084,
1699,
10521,
26568,
1159,
29871,
1723,
13,
12,
28192,
800,
29871,
353,
29871,
13149,
29889,
23705,
29898,
2897,
29889,
2084,
29889,
7122,
29898,
344,
3174,
29918,
2084,
1699,
10521,
2732,
1159,
29871,
1723,
1678,
13,
12,
13,
13,
12,
28192,
800,
29918,
29881,
353,
9657,
29898,
14319,
29898,
28192,
800,
29892,
28192,
800,
29871,
876,
13,
13,
12,
2267,
353,
5159,
13,
13,
12,
1454,
527,
297,
4558,
29901,
13,
12,
12,
10199,
29918,
11197,
1004,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
326,
467,
6506,
17350,
6173,
29908,
1919,
11393,
2732,
2564,
6506,
17350,
26568,
29908,
1919,
11393,
2732,
1159,
13,
12,
12,
10199,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2377,
29879,
29918,
2084,
1919,
2377,
29918,
11197,
1004,
29871,
1723,
13,
18884,
396,
1366,
1196,
474,
505,
19952,
408,
1059,
471,
6445,
13,
12,
12,
29937,
9294,
313,
2377,
297,
10768,
800,
29918,
29881,
10353,
29871,
313,
326,
718,
376,
338,
2198,
297,
15691,
8346,
29918,
2084,
718,
29908,
541,
15691,
10199,
29918,
11197,
1004,
13578,
338,
451,
1476,
297,
15691,
344,
3174,
29918,
2084,
718,
376,
869,
8561,
1854,
17195,
1967,
526,
297,
869,
2732,
29908,
29871,
1723,
13,
12,
12,
2267,
29889,
4397,
3552,
326,
1919,
2377,
29897,
1723,
13,
13,
12,
2457,
3240,
13,
13,
13,
13,
13,
1753,
679,
29918,
3027,
29918,
2749,
29898,
2224,
1919,
2920,
1919,
3171,
1919,
10153,
29940,
555,
543,
1491,
29918,
12676,
29908,
1919,
4461,
292,
2433,
305,
12629,
29918,
4102,
29915,
29871,
1125,
13,
13,
13,
12,
361,
1134,
29898,
2224,
1723,
338,
7442,
29889,
299,
2378,
29901,
13,
12,
12,
2492,
353,
2224,
13,
12,
2870,
29901,
13,
12,
12,
2492,
353,
13850,
29906,
29889,
326,
949,
29898,
2084,
29892,
29871,
29896,
29897,
13,
13,
12,
361,
10153,
29940,
555,
1275,
376,
1491,
29918,
392,
29918,
4563,
680,
1115,
13,
12,
12,
2492,
353,
7442,
29889,
7411,
29941,
29906,
29898,
11023,
29906,
29889,
21476,
29898,
2492,
29892,
313,
2920,
1919,
3171,
29871,
4961,
847,
29871,
29896,
29906,
29955,
29889,
29945,
448,
29871,
29896,
13,
12,
23681,
10153,
29940,
555,
1275,
376,
1491,
29918,
12676,
1115,
13,
12,
12,
2492,
353,
13850,
29906,
29889,
21476,
29898,
2492,
29892,
313,
2920,
1919,
3171,
29871,
876,
13,
12,
12,
2492,
353,
10153,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
12,
12,
2492,
7503,
29892,
29901,
29892,
29900,
29962,
22361,
29871,
29896,
29900,
29941,
29889,
29929,
29941,
29929,
13,
12,
12,
2492,
7503,
29892,
29901,
29892,
29896,
29962,
22361,
29871,
29896,
29896,
29953,
29889,
29955,
29955,
29929,
13,
12,
12,
2492,
7503,
29892,
29901,
29892,
29906,
29962,
22361,
29871,
29896,
29906,
29941,
29889,
29953,
29947,
13,
12,
12,
2492,
353,
10153,
29961,
584,
1919,
584,
1919,
4761,
29899,
29896,
4514,
13,
12,
23681,
10153,
29940,
555,
1275,
376,
4563,
680,
1115,
13,
12,
12,
2492,
353,
13850,
29906,
29889,
21476,
29898,
2492,
29892,
313,
2920,
1919,
3171,
29871,
876,
13,
12,
12,
2492,
353,
10153,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
12,
12,
2492,
353,
10153,
29914,
29906,
29945,
29945,
29889,
29900,
13,
13,
12,
361,
4461,
292,
1275,
525,
305,
12629,
29918,
4102,
2396,
13,
12,
12,
2492,
353,
7442,
29889,
1467,
433,
11497,
29898,
2492,
29892,
29871,
29906,
29892,
29871,
29900,
29897,
13,
12,
2457,
10153,
13,
13,
13,
13,
13,
13,
13,
1753,
679,
29918,
28192,
362,
29918,
2749,
29898,
2224,
1919,
302,
27403,
1919,
29871,
2920,
1919,
3171,
1919,
694,
29918,
690,
14443,
29922,
8824,
29871,
1125,
13,
13,
12,
10199,
29918,
21134,
353,
7442,
29889,
3298,
359,
3552,
29871,
3171,
1919,
2920,
29871,
1919,
302,
27403,
29871,
876,
13,
12,
12,
13,
12,
361,
1134,
29898,
2224,
1723,
338,
7442,
29889,
299,
2378,
29901,
13,
12,
12,
2492,
353,
2224,
13,
12,
2870,
29901,
13,
12,
12,
2492,
353,
13850,
29906,
29889,
326,
949,
29898,
2084,
29892,
29871,
29896,
29897,
13,
13,
12,
2492,
353,
13850,
29906,
29889,
21476,
29898,
2492,
29892,
313,
2920,
1919,
3171,
1723,
1919,
29694,
29922,
11023,
29906,
29889,
23845,
29918,
8186,
29909,
1525,
1254,
1723,
13,
12,
2492,
353,
10153,
7503,
29892,
584,
1919,
29871,
29900,
29962,
13,
13,
12,
1454,
274,
297,
3464,
29898,
29876,
27403,
1125,
13,
12,
12,
10199,
29918,
21134,
7503,
1919,
584,
1919,
274,
4514,
353,
313,
2492,
1275,
274,
13742,
579,
668,
29898,
524,
29897,
13,
13,
13,
12,
13,
12,
361,
694,
29918,
690,
14443,
29901,
13,
12,
12,
2457,
2377,
29918,
21134,
13,
13,
12,
10199,
29918,
21134,
353,
7442,
29889,
690,
14443,
29898,
10199,
29918,
21134,
29892,
313,
2920,
29930,
3545,
1919,
302,
27403,
29871,
876,
13,
12,
2457,
2377,
29918,
21134,
13,
13,
29871,
13,
13,
13,
1753,
11539,
29918,
28192,
362,
29918,
24713,
29898,
4558,
29918,
2084,
1919,
2377,
29879,
29918,
2084,
1919,
302,
29918,
13203,
29871,
1125,
13,
12,
13,
12,
2492,
29918,
10199,
29918,
29886,
7121,
353,
679,
29918,
29886,
7121,
29918,
3166,
29918,
24772,
29898,
4558,
29918,
2084,
1919,
2377,
29879,
29918,
2084,
1723,
13,
13,
12,
9294,
7431,
29898,
2492,
29918,
10199,
29918,
29886,
7121,
15410,
29900,
1919,
376,
16390,
24541,
3430,
4069,
470,
2224,
338,
2743,
376,
13,
12,
13,
12,
1454,
527,
29918,
9144,
1919,
2377,
29918,
9144,
297,
260,
29939,
18933,
29898,
2492,
29918,
10199,
29918,
29886,
7121,
29897,
584,
13,
12,
12,
2492,
353,
13850,
29906,
29889,
326,
949,
29898,
527,
29918,
9144,
1723,
13,
12,
12,
10199,
353,
13850,
29906,
29889,
326,
949,
29898,
2377,
29918,
9144,
1723,
13,
13,
12,
12,
9294,
313,
10153,
29889,
12181,
29961,
29900,
29962,
1360,
10199,
29889,
12181,
29961,
29900,
29962,
322,
10153,
29889,
12181,
29961,
29896,
29962,
1360,
10199,
29889,
12181,
29961,
29896,
29962,
1723,
1919,
376,
1576,
2159,
310,
1967,
322,
278,
17195,
947,
451,
1993,
470,
896,
526,
1034,
6685,
15691,
527,
29918,
9144,
718,
376,
376,
718,
2377,
29918,
9144,
13,
12,
12,
9294,
313,
7442,
29889,
3317,
29898,
10199,
7503,
29892,
29901,
29892,
29900,
2314,
529,
302,
29918,
13203,
29897,
1919,
376,
1576,
15526,
1819,
310,
2377,
1967,
881,
367,
515,
29871,
29900,
304,
15691,
710,
29898,
29876,
29918,
13203,
29899,
29896,
29897,
718,
376,
869,
7460,
15526,
995,
15691,
710,
29898,
9302,
29889,
3317,
29898,
10199,
7503,
29892,
29901,
29892,
29900,
12622,
13,
13,
12,
2158,
703,
16390,
24541,
26834,
29991,
16521,
13,
13,
13,
1753,
1967,
29918,
28192,
362,
29918,
27959,
29898,
4558,
29918,
2084,
1919,
2377,
29879,
29918,
2084,
1919,
29871,
9853,
29918,
2311,
29892,
29871,
302,
29918,
13203,
1919,
1881,
29918,
3545,
1919,
1881,
29918,
2103,
1919,
1962,
29918,
3545,
1919,
1962,
29918,
2103,
29871,
1919,
437,
29918,
2987,
358,
29922,
8824,
29871,
1125,
13,
12,
13,
13,
12,
2492,
29918,
10199,
29918,
29886,
7121,
353,
679,
29918,
29886,
7121,
29918,
3166,
29918,
24772,
29898,
4558,
29918,
2084,
1919,
2377,
29879,
29918,
2084,
1723,
13,
12,
8172,
29889,
845,
21897,
29898,
10153,
29918,
10199,
29918,
29886,
7121,
1723,
13,
12,
2526,
2986,
353,
4256,
8504,
29889,
23090,
29898,
10153,
29918,
10199,
29918,
29886,
7121,
29871,
1723,
13,
13,
12,
8000,
5852,
29901,
13,
12,
12,
29990,
353,
5159,
13,
12,
12,
29979,
353,
5159,
13,
12,
12,
1454,
903,
297,
3464,
29898,
9853,
29918,
2311,
29897,
584,
13,
12,
12,
12,
326,
1919,
2377,
353,
2446,
29898,
2526,
2986,
29897,
29871,
13,
13,
12,
12,
12,
326,
353,
13850,
29906,
29889,
326,
949,
29898,
326,
1919,
29871,
29896,
1723,
13,
12,
12,
12,
10199,
353,
13850,
29906,
29889,
326,
949,
29898,
10199,
1919,
29871,
29896,
1723,
13,
13,
12,
12,
12,
361,
437,
29918,
2987,
358,
29901,
13,
12,
12,
12,
12,
2492,
1919,
2377,
7503,
29892,
29901,
29892,
29900,
29962,
353,
18765,
29918,
10199,
29898,
10153,
1919,
2377,
7503,
29892,
29901,
29892,
29900,
29962,
1723,
13,
13,
12,
12,
12,
29990,
29889,
4397,
29898,
679,
29918,
3027,
29918,
2749,
29898,
326,
1919,
1881,
29918,
2103,
1919,
1881,
29918,
3545,
1919,
397,
3241,
29922,
2382,
29918,
22364,
4214,
1723,
29871,
1723,
13,
12,
12,
12,
29979,
29889,
4397,
29898,
679,
29918,
28192,
362,
29918,
2749,
29898,
2377,
1919,
302,
29918,
13203,
1919,
1962,
29918,
2103,
1919,
1962,
29918,
3545,
1723,
29871,
1723,
13,
13,
12,
12,
29891,
969,
7442,
29889,
2378,
29898,
29990,
29897,
1919,
7442,
29889,
2378,
29898,
29979,
29897,
13,
13,
2
] |
Array_ReverseInteger.py
|
clintbugsdev/binary-tree
| 0 |
137515
|
<filename>Array_ReverseInteger.py
def reverse_integer(n):
reversed = 0
remainder = 0
while n > 0:
remainder = n % 10
reversed = reversed * 10 + remainder
n = n // 10
return reversed
if __name__ == "__main__":
print(reverse_integer(12345))
|
[
1,
529,
9507,
29958,
2588,
29918,
1123,
3901,
7798,
29889,
2272,
13,
1753,
11837,
29918,
16031,
29898,
29876,
1125,
13,
1678,
18764,
287,
353,
29871,
29900,
13,
1678,
21162,
353,
29871,
29900,
13,
13,
1678,
1550,
302,
1405,
29871,
29900,
29901,
13,
4706,
21162,
353,
302,
1273,
29871,
29896,
29900,
13,
4706,
18764,
287,
353,
18764,
287,
334,
29871,
29896,
29900,
718,
21162,
13,
4706,
302,
353,
302,
849,
29871,
29896,
29900,
13,
13,
1678,
736,
18764,
287,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1596,
29898,
24244,
29918,
16031,
29898,
29896,
29906,
29941,
29946,
29945,
876,
13,
2
] |
schematizer/views/consumer_groups.py
|
Yelp/schematizer
| 86 |
114038
|
# -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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.
from __future__ import absolute_import
from __future__ import unicode_literals
from pyramid.view import view_config
from schematizer import models
from schematizer.api.decorators import log_api
from schematizer.api.decorators import transform_api_response
from schematizer.api.exceptions import exceptions_v1 as exc_v1
from schematizer.api.requests import requests_v1
from schematizer.api.responses import responses_v1 as resp_v1
from schematizer.logic import registration_repository as reg_repo
from schematizer.models import exceptions as sch_exc
@view_config(
route_name='api.v1.get_consumer_groups',
request_method='GET',
renderer='json'
)
@transform_api_response()
def get_consumer_groups(request):
return [resp_v1.get_consumer_group_response_from_consumer_group(group)
for group in models.ConsumerGroup.get_all()]
@view_config(
route_name='api.v1.get_consumer_group_by_id',
request_method='GET',
renderer='json'
)
@transform_api_response()
def get_consumer_group_by_id(request):
consumer_group_id = int(request.matchdict.get('consumer_group_id'))
try:
group = models.ConsumerGroup.get_by_id(consumer_group_id)
return resp_v1.get_consumer_group_response_from_consumer_group(group)
except sch_exc.EntityNotFoundError as e:
raise exc_v1.entity_not_found_exception(e.message)
@view_config(
route_name='api.v1.get_data_sources_by_consumer_group_id',
request_method='GET',
renderer='json'
)
@transform_api_response()
def get_data_sources_by_consumer_group_id(request):
consumer_group_id = int(request.matchdict.get('consumer_group_id'))
try:
data_sources = reg_repo.get_data_sources_by_consumer_group_id(
consumer_group_id
)
return [
resp_v1.get_response_from_consumer_group_data_source(src)
for src in data_sources
]
except sch_exc.EntityNotFoundError as e:
raise exc_v1.entity_not_found_exception(e.message)
@view_config(
route_name='api.v1.create_consumer_group_data_source',
request_method='POST',
renderer='json'
)
@transform_api_response()
@log_api()
def create_consumer_group_data_source(request):
consumer_group_id = int(request.matchdict.get('consumer_group_id'))
req = requests_v1.CreateConsumerGroupDataSourceRequest(**request.json_body)
try:
data_src = reg_repo.register_consumer_group_data_source(
consumer_group_id=consumer_group_id,
data_source_type=req.data_source_type,
data_source_id=req.data_source_id
)
return resp_v1.get_response_from_consumer_group_data_source(
data_src
)
except ValueError as value_ex:
raise exc_v1.invalid_request_exception(value_ex.message)
except sch_exc.EntityNotFoundError as not_found_ex:
raise exc_v1.entity_not_found_exception(not_found_ex.message)
|
[
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29953,
612,
295,
29886,
9266,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
259,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
13,
29937,
7047,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
13,
29937,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
13,
29937,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
29871,
2823,
278,
19245,
363,
278,
13,
29937,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1090,
278,
19245,
29889,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
11451,
2572,
333,
29889,
1493,
1053,
1776,
29918,
2917,
13,
13,
3166,
1364,
4579,
3950,
1053,
4733,
13,
3166,
1364,
4579,
3950,
29889,
2754,
29889,
19557,
4097,
1053,
1480,
29918,
2754,
13,
3166,
1364,
4579,
3950,
29889,
2754,
29889,
19557,
4097,
1053,
4327,
29918,
2754,
29918,
5327,
13,
3166,
1364,
4579,
3950,
29889,
2754,
29889,
11739,
29879,
1053,
15283,
29918,
29894,
29896,
408,
5566,
29918,
29894,
29896,
13,
3166,
1364,
4579,
3950,
29889,
2754,
29889,
24830,
1053,
7274,
29918,
29894,
29896,
13,
3166,
1364,
4579,
3950,
29889,
2754,
29889,
26679,
267,
1053,
20890,
29918,
29894,
29896,
408,
4613,
29918,
29894,
29896,
13,
3166,
1364,
4579,
3950,
29889,
19227,
1053,
22583,
29918,
19033,
408,
1072,
29918,
20095,
13,
3166,
1364,
4579,
3950,
29889,
9794,
1053,
15283,
408,
1364,
29918,
735,
29883,
13,
13,
13,
29992,
1493,
29918,
2917,
29898,
13,
1678,
5782,
29918,
978,
2433,
2754,
29889,
29894,
29896,
29889,
657,
29918,
25978,
261,
29918,
13155,
742,
13,
1678,
2009,
29918,
5696,
2433,
7194,
742,
13,
1678,
4050,
261,
2433,
3126,
29915,
13,
29897,
13,
29992,
9067,
29918,
2754,
29918,
5327,
580,
13,
1753,
679,
29918,
25978,
261,
29918,
13155,
29898,
3827,
1125,
13,
1678,
736,
518,
13713,
29918,
29894,
29896,
29889,
657,
29918,
25978,
261,
29918,
2972,
29918,
5327,
29918,
3166,
29918,
25978,
261,
29918,
2972,
29898,
2972,
29897,
13,
9651,
363,
2318,
297,
4733,
29889,
13696,
4680,
4782,
29889,
657,
29918,
497,
580,
29962,
13,
13,
13,
29992,
1493,
29918,
2917,
29898,
13,
1678,
5782,
29918,
978,
2433,
2754,
29889,
29894,
29896,
29889,
657,
29918,
25978,
261,
29918,
2972,
29918,
1609,
29918,
333,
742,
13,
1678,
2009,
29918,
5696,
2433,
7194,
742,
13,
1678,
4050,
261,
2433,
3126,
29915,
13,
29897,
13,
29992,
9067,
29918,
2754,
29918,
5327,
580,
13,
1753,
679,
29918,
25978,
261,
29918,
2972,
29918,
1609,
29918,
333,
29898,
3827,
1125,
13,
1678,
21691,
29918,
2972,
29918,
333,
353,
938,
29898,
3827,
29889,
4352,
8977,
29889,
657,
877,
25978,
261,
29918,
2972,
29918,
333,
8785,
13,
1678,
1018,
29901,
13,
4706,
2318,
353,
4733,
29889,
13696,
4680,
4782,
29889,
657,
29918,
1609,
29918,
333,
29898,
25978,
261,
29918,
2972,
29918,
333,
29897,
13,
4706,
736,
4613,
29918,
29894,
29896,
29889,
657,
29918,
25978,
261,
29918,
2972,
29918,
5327,
29918,
3166,
29918,
25978,
261,
29918,
2972,
29898,
2972,
29897,
13,
1678,
5174,
1364,
29918,
735,
29883,
29889,
6691,
17413,
2392,
408,
321,
29901,
13,
4706,
12020,
5566,
29918,
29894,
29896,
29889,
10041,
29918,
1333,
29918,
11940,
29918,
11739,
29898,
29872,
29889,
4906,
29897,
13,
13,
13,
29992,
1493,
29918,
2917,
29898,
13,
1678,
5782,
29918,
978,
2433,
2754,
29889,
29894,
29896,
29889,
657,
29918,
1272,
29918,
29879,
2863,
29918,
1609,
29918,
25978,
261,
29918,
2972,
29918,
333,
742,
13,
1678,
2009,
29918,
5696,
2433,
7194,
742,
13,
1678,
4050,
261,
2433,
3126,
29915,
13,
29897,
13,
29992,
9067,
29918,
2754,
29918,
5327,
580,
13,
1753,
679,
29918,
1272,
29918,
29879,
2863,
29918,
1609,
29918,
25978,
261,
29918,
2972,
29918,
333,
29898,
3827,
1125,
13,
1678,
21691,
29918,
2972,
29918,
333,
353,
938,
29898,
3827,
29889,
4352,
8977,
29889,
657,
877,
25978,
261,
29918,
2972,
29918,
333,
8785,
13,
1678,
1018,
29901,
13,
4706,
848,
29918,
29879,
2863,
353,
1072,
29918,
20095,
29889,
657,
29918,
1272,
29918,
29879,
2863,
29918,
1609,
29918,
25978,
261,
29918,
2972,
29918,
333,
29898,
13,
9651,
21691,
29918,
2972,
29918,
333,
13,
4706,
1723,
13,
4706,
736,
518,
13,
9651,
4613,
29918,
29894,
29896,
29889,
657,
29918,
5327,
29918,
3166,
29918,
25978,
261,
29918,
2972,
29918,
1272,
29918,
4993,
29898,
4351,
29897,
13,
9651,
363,
4765,
297,
848,
29918,
29879,
2863,
13,
4706,
4514,
13,
1678,
5174,
1364,
29918,
735,
29883,
29889,
6691,
17413,
2392,
408,
321,
29901,
13,
4706,
12020,
5566,
29918,
29894,
29896,
29889,
10041,
29918,
1333,
29918,
11940,
29918,
11739,
29898,
29872,
29889,
4906,
29897,
13,
13,
13,
29992,
1493,
29918,
2917,
29898,
13,
1678,
5782,
29918,
978,
2433,
2754,
29889,
29894,
29896,
29889,
3258,
29918,
25978,
261,
29918,
2972,
29918,
1272,
29918,
4993,
742,
13,
1678,
2009,
29918,
5696,
2433,
5438,
742,
13,
1678,
4050,
261,
2433,
3126,
29915,
13,
29897,
13,
29992,
9067,
29918,
2754,
29918,
5327,
580,
13,
29992,
1188,
29918,
2754,
580,
13,
1753,
1653,
29918,
25978,
261,
29918,
2972,
29918,
1272,
29918,
4993,
29898,
3827,
1125,
13,
1678,
21691,
29918,
2972,
29918,
333,
353,
938,
29898,
3827,
29889,
4352,
8977,
29889,
657,
877,
25978,
261,
29918,
2972,
29918,
333,
8785,
13,
1678,
12428,
353,
7274,
29918,
29894,
29896,
29889,
4391,
13696,
4680,
4782,
15559,
3089,
29898,
1068,
3827,
29889,
3126,
29918,
2587,
29897,
13,
1678,
1018,
29901,
13,
4706,
848,
29918,
4351,
353,
1072,
29918,
20095,
29889,
9573,
29918,
25978,
261,
29918,
2972,
29918,
1272,
29918,
4993,
29898,
13,
9651,
21691,
29918,
2972,
29918,
333,
29922,
25978,
261,
29918,
2972,
29918,
333,
29892,
13,
9651,
848,
29918,
4993,
29918,
1853,
29922,
7971,
29889,
1272,
29918,
4993,
29918,
1853,
29892,
13,
9651,
848,
29918,
4993,
29918,
333,
29922,
7971,
29889,
1272,
29918,
4993,
29918,
333,
13,
4706,
1723,
13,
4706,
736,
4613,
29918,
29894,
29896,
29889,
657,
29918,
5327,
29918,
3166,
29918,
25978,
261,
29918,
2972,
29918,
1272,
29918,
4993,
29898,
13,
9651,
848,
29918,
4351,
13,
4706,
1723,
13,
1678,
5174,
7865,
2392,
408,
995,
29918,
735,
29901,
13,
4706,
12020,
5566,
29918,
29894,
29896,
29889,
20965,
29918,
3827,
29918,
11739,
29898,
1767,
29918,
735,
29889,
4906,
29897,
13,
1678,
5174,
1364,
29918,
735,
29883,
29889,
6691,
17413,
2392,
408,
451,
29918,
11940,
29918,
735,
29901,
13,
4706,
12020,
5566,
29918,
29894,
29896,
29889,
10041,
29918,
1333,
29918,
11940,
29918,
11739,
29898,
1333,
29918,
11940,
29918,
735,
29889,
4906,
29897,
13,
2
] |
basenef/tools/api/instance_dict_parser.py
|
bill52547/NEF
| 0 |
79895
|
<filename>basenef/tools/api/instance_dict_parser.py
# encoding: utf-8
'''
@author: <NAME>
@contact: <EMAIL>
@software: srf_ct
@file: instance_dict_parser.py
@date: 4/9/2019
@desc:
'''
from basenef.typings import BASIC_TYPE_DICT_REVERT, BASIC_TYPE_CONVERTER
from basenef.base import NefClass
def _convert_single_instance_to_dict(obj: NefClass = None, *, verbose = True):
if obj is None:
raise ValueError('valid instance are needed.')
kwargs = {'classname': obj.__class__.__name__}
for key, _type in obj.__class__.__annotations__():
if not verbose and key.startswith('_'):
continue
if key == 'data':
from basenef.tools.file_io import data_saver
res_path = data_saver(getattr(obj, key))
kwargs.update({'data': res_path}) # should be file_io here
elif _type in BASIC_TYPE_DICT_REVERT:
kwargs.update({key: getattr(obj, key)})
else:
kwargs.update(
{key: _convert_single_instance_to_dict(getattr(obj, key), verbose = verbose)})
return kwargs
def convert_instance_to_dict(objs_dct: dict, *, verbose = True):
if isinstance(objs_dct, NefClass):
objs_dct = {str(0): objs_dct}
elif isinstance(objs_dct, list):
objs_dct = {str(ind): obj for ind, obj in enumerate(objs_dct)}
kwargs = {}
for key, obj in objs_dct.items():
kwargs.update({key: _convert_single_instance_to_dict(obj, verbose = verbose)})
return kwargs
def convert_dict_to_instance(dct: dict, *, schema: dict):
if schema is None:
raise ValueError('A valid schema is needed.')
if isinstance(schema, str):
import json as json_
try:
schema = json_.loads(schema)
except ValueError('Can not parse schema: ', schema):
pass
out = {}
for key, val in dct.items():
if 'classname' in val:
classname = val['classname']
if classname not in schema:
raise ValueError(f'can not find valid class assigned for {key} in the first arg')
cls = schema[classname]
print(1, cls)
if isinstance(cls, dict):
from .class_schema_parser import convert_schema_to_class
cls = convert_schema_to_class(schema)[classname]
print(2, convert_schema_to_class(schema))
else:
raise ValueError(f"can not find valid classname in dct.['{key}']")
kwargs = {}
print(cls)
for field, type_ in cls.fields():
sub_ = val[field]
if field.startswith('_'):
continue
elif field == 'data':
from basenef.tools.file_io import data_loader
kwargs.update({field: data_loader(sub_)})
elif isinstance(sub_, dict):
kwargs.update(
{field: convert_dict_to_instance({field: sub_}, schema = schema)[field]})
else:
kwargs.update({field: BASIC_TYPE_CONVERTER[type_.__name__](sub_)})
out.update({key: cls(**kwargs)})
return out
|
[
1,
529,
9507,
29958,
6500,
264,
1389,
29914,
8504,
29914,
2754,
29914,
8758,
29918,
8977,
29918,
16680,
29889,
2272,
13,
29937,
8025,
29901,
23616,
29899,
29947,
13,
12008,
13,
29992,
8921,
29901,
529,
5813,
29958,
13,
29992,
12346,
29901,
529,
26862,
6227,
29958,
13,
29992,
20415,
29901,
269,
9600,
29918,
312,
13,
29992,
1445,
29901,
2777,
29918,
8977,
29918,
16680,
29889,
2272,
13,
29992,
1256,
29901,
29871,
29946,
29914,
29929,
29914,
29906,
29900,
29896,
29929,
13,
29992,
14273,
29901,
13,
12008,
13,
3166,
2362,
264,
1389,
29889,
22449,
886,
1053,
350,
3289,
2965,
29918,
11116,
29918,
4571,
1783,
29918,
1525,
5348,
29911,
29892,
350,
3289,
2965,
29918,
11116,
29918,
6007,
5348,
4945,
13,
3166,
2362,
264,
1389,
29889,
3188,
1053,
405,
1389,
2385,
13,
13,
13,
1753,
903,
13441,
29918,
14369,
29918,
8758,
29918,
517,
29918,
8977,
29898,
5415,
29901,
405,
1389,
2385,
353,
6213,
29892,
334,
29892,
26952,
353,
5852,
1125,
13,
1678,
565,
5446,
338,
6213,
29901,
13,
4706,
12020,
7865,
2392,
877,
3084,
2777,
526,
4312,
29889,
1495,
13,
13,
1678,
9049,
5085,
353,
11117,
1990,
978,
2396,
5446,
17255,
1990,
1649,
17255,
978,
1649,
29913,
13,
1678,
363,
1820,
29892,
903,
1853,
297,
5446,
17255,
1990,
1649,
17255,
6735,
800,
1649,
7295,
13,
4706,
565,
451,
26952,
322,
1820,
29889,
27382,
2541,
877,
29918,
29374,
13,
9651,
6773,
13,
4706,
565,
1820,
1275,
525,
1272,
2396,
13,
9651,
515,
2362,
264,
1389,
29889,
8504,
29889,
1445,
29918,
601,
1053,
848,
29918,
4977,
369,
13,
9651,
620,
29918,
2084,
353,
848,
29918,
4977,
369,
29898,
657,
5552,
29898,
5415,
29892,
1820,
876,
13,
9651,
9049,
5085,
29889,
5504,
3319,
29915,
1272,
2396,
620,
29918,
2084,
1800,
29871,
396,
881,
367,
934,
29918,
601,
1244,
13,
4706,
25342,
903,
1853,
297,
350,
3289,
2965,
29918,
11116,
29918,
4571,
1783,
29918,
1525,
5348,
29911,
29901,
13,
9651,
9049,
5085,
29889,
5504,
3319,
1989,
29901,
679,
5552,
29898,
5415,
29892,
1820,
26972,
13,
4706,
1683,
29901,
13,
9651,
9049,
5085,
29889,
5504,
29898,
13,
18884,
426,
1989,
29901,
903,
13441,
29918,
14369,
29918,
8758,
29918,
517,
29918,
8977,
29898,
657,
5552,
29898,
5415,
29892,
1820,
511,
26952,
353,
26952,
26972,
13,
13,
1678,
736,
9049,
5085,
13,
13,
13,
1753,
3588,
29918,
8758,
29918,
517,
29918,
8977,
29898,
711,
1315,
29918,
29881,
312,
29901,
9657,
29892,
334,
29892,
26952,
353,
5852,
1125,
13,
1678,
565,
338,
8758,
29898,
711,
1315,
29918,
29881,
312,
29892,
405,
1389,
2385,
1125,
13,
4706,
704,
1315,
29918,
29881,
312,
353,
426,
710,
29898,
29900,
1125,
704,
1315,
29918,
29881,
312,
29913,
13,
1678,
25342,
338,
8758,
29898,
711,
1315,
29918,
29881,
312,
29892,
1051,
1125,
13,
4706,
704,
1315,
29918,
29881,
312,
353,
426,
710,
29898,
513,
1125,
5446,
363,
1399,
29892,
5446,
297,
26985,
29898,
711,
1315,
29918,
29881,
312,
2915,
13,
13,
1678,
9049,
5085,
353,
6571,
13,
1678,
363,
1820,
29892,
5446,
297,
704,
1315,
29918,
29881,
312,
29889,
7076,
7295,
13,
4706,
9049,
5085,
29889,
5504,
3319,
1989,
29901,
903,
13441,
29918,
14369,
29918,
8758,
29918,
517,
29918,
8977,
29898,
5415,
29892,
26952,
353,
26952,
26972,
13,
1678,
736,
9049,
5085,
13,
13,
13,
1753,
3588,
29918,
8977,
29918,
517,
29918,
8758,
29898,
29881,
312,
29901,
9657,
29892,
334,
29892,
10938,
29901,
9657,
1125,
13,
1678,
565,
10938,
338,
6213,
29901,
13,
4706,
12020,
7865,
2392,
877,
29909,
2854,
10938,
338,
4312,
29889,
1495,
13,
1678,
565,
338,
8758,
29898,
11010,
29892,
851,
1125,
13,
4706,
1053,
4390,
408,
4390,
29918,
13,
4706,
1018,
29901,
13,
9651,
10938,
353,
4390,
5396,
18132,
29898,
11010,
29897,
13,
4706,
5174,
7865,
2392,
877,
6028,
451,
6088,
10938,
29901,
13420,
10938,
1125,
13,
9651,
1209,
13,
1678,
714,
353,
6571,
13,
1678,
363,
1820,
29892,
659,
297,
270,
312,
29889,
7076,
7295,
13,
4706,
565,
525,
1990,
978,
29915,
297,
659,
29901,
13,
9651,
770,
978,
353,
659,
1839,
1990,
978,
2033,
13,
9651,
565,
770,
978,
451,
297,
10938,
29901,
13,
18884,
12020,
7865,
2392,
29898,
29888,
29915,
3068,
451,
1284,
2854,
770,
9859,
363,
426,
1989,
29913,
297,
278,
937,
1852,
1495,
13,
9651,
1067,
29879,
353,
10938,
29961,
1990,
978,
29962,
13,
9651,
1596,
29898,
29896,
29892,
1067,
29879,
29897,
13,
9651,
565,
338,
8758,
29898,
25932,
29892,
9657,
1125,
13,
18884,
515,
869,
1990,
29918,
11010,
29918,
16680,
1053,
3588,
29918,
11010,
29918,
517,
29918,
1990,
13,
18884,
1067,
29879,
353,
3588,
29918,
11010,
29918,
517,
29918,
1990,
29898,
11010,
9601,
1990,
978,
29962,
13,
18884,
1596,
29898,
29906,
29892,
3588,
29918,
11010,
29918,
517,
29918,
1990,
29898,
11010,
876,
13,
4706,
1683,
29901,
13,
9651,
12020,
7865,
2392,
29898,
29888,
29908,
3068,
451,
1284,
2854,
770,
978,
297,
270,
312,
29889,
1839,
29912,
1989,
29913,
2033,
1159,
13,
13,
4706,
9049,
5085,
353,
6571,
13,
4706,
1596,
29898,
25932,
29897,
13,
4706,
363,
1746,
29892,
1134,
29918,
297,
1067,
29879,
29889,
9621,
7295,
13,
9651,
1014,
29918,
353,
659,
29961,
2671,
29962,
13,
9651,
565,
1746,
29889,
27382,
2541,
877,
29918,
29374,
13,
18884,
6773,
13,
9651,
25342,
1746,
1275,
525,
1272,
2396,
13,
18884,
515,
2362,
264,
1389,
29889,
8504,
29889,
1445,
29918,
601,
1053,
848,
29918,
12657,
13,
18884,
9049,
5085,
29889,
5504,
3319,
2671,
29901,
848,
29918,
12657,
29898,
1491,
19925,
1800,
13,
9651,
25342,
338,
8758,
29898,
1491,
3383,
9657,
1125,
13,
18884,
9049,
5085,
29889,
5504,
29898,
13,
462,
1678,
426,
2671,
29901,
3588,
29918,
8977,
29918,
517,
29918,
8758,
3319,
2671,
29901,
1014,
29918,
1118,
10938,
353,
10938,
9601,
2671,
29962,
1800,
13,
9651,
1683,
29901,
13,
18884,
9049,
5085,
29889,
5504,
3319,
2671,
29901,
350,
3289,
2965,
29918,
11116,
29918,
6007,
5348,
4945,
29961,
1853,
5396,
1649,
978,
1649,
850,
1491,
19925,
1800,
13,
4706,
714,
29889,
5504,
3319,
1989,
29901,
1067,
29879,
29898,
1068,
19290,
26972,
13,
1678,
736,
714,
13,
2
] |
src/past/types/oldstr.py
|
kianmeng/python-future
| 908 |
22899
|
"""
Pure-Python implementation of a Python 2-like str object for Python 3.
"""
from numbers import Integral
from past.utils import PY2, with_metaclass
if PY2:
from collections import Iterable
else:
from collections.abc import Iterable
_builtin_bytes = bytes
class BaseOldStr(type):
def __instancecheck__(cls, instance):
return isinstance(instance, _builtin_bytes)
def unescape(s):
r"""
Interprets strings with escape sequences
Example:
>>> s = unescape(r'abc\\def') # i.e. 'abc\\\\def'
>>> print(s)
'abc\def'
>>> s2 = unescape('abc\\ndef')
>>> len(s2)
8
>>> print(s2)
abc
def
"""
return s.encode().decode('unicode_escape')
class oldstr(with_metaclass(BaseOldStr, _builtin_bytes)):
"""
A forward port of the Python 2 8-bit string object to Py3
"""
# Python 2 strings have no __iter__ method:
@property
def __iter__(self):
raise AttributeError
def __dir__(self):
return [thing for thing in dir(_builtin_bytes) if thing != '__iter__']
# def __new__(cls, *args, **kwargs):
# """
# From the Py3 bytes docstring:
# bytes(iterable_of_ints) -> bytes
# bytes(string, encoding[, errors]) -> bytes
# bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer
# bytes(int) -> bytes object of size given by the parameter initialized with null bytes
# bytes() -> empty bytes object
#
# Construct an immutable array of bytes from:
# - an iterable yielding integers in range(256)
# - a text string encoded using the specified encoding
# - any object implementing the buffer API.
# - an integer
# """
#
# if len(args) == 0:
# return super(newbytes, cls).__new__(cls)
# # Was: elif isinstance(args[0], newbytes):
# # We use type() instead of the above because we're redefining
# # this to be True for all unicode string subclasses. Warning:
# # This may render newstr un-subclassable.
# elif type(args[0]) == newbytes:
# return args[0]
# elif isinstance(args[0], _builtin_bytes):
# value = args[0]
# elif isinstance(args[0], unicode):
# if 'encoding' not in kwargs:
# raise TypeError('unicode string argument without an encoding')
# ###
# # Was: value = args[0].encode(**kwargs)
# # Python 2.6 string encode() method doesn't take kwargs:
# # Use this instead:
# newargs = [kwargs['encoding']]
# if 'errors' in kwargs:
# newargs.append(kwargs['errors'])
# value = args[0].encode(*newargs)
# ###
# elif isinstance(args[0], Iterable):
# if len(args[0]) == 0:
# # What is this?
# raise ValueError('unknown argument type')
# elif len(args[0]) > 0 and isinstance(args[0][0], Integral):
# # It's a list of integers
# value = b''.join([chr(x) for x in args[0]])
# else:
# raise ValueError('item cannot be interpreted as an integer')
# elif isinstance(args[0], Integral):
# if args[0] < 0:
# raise ValueError('negative count')
# value = b'\x00' * args[0]
# else:
# value = args[0]
# return super(newbytes, cls).__new__(cls, value)
def __repr__(self):
s = super(oldstr, self).__repr__() # e.g. b'abc' on Py3, b'abc' on Py3
return s[1:]
def __str__(self):
s = super(oldstr, self).__str__() # e.g. "b'abc'" or "b'abc\\ndef'
# TODO: fix this:
assert s[:2] == "b'" and s[-1] == "'"
return unescape(s[2:-1]) # e.g. 'abc' or 'abc\ndef'
def __getitem__(self, y):
if isinstance(y, Integral):
return super(oldstr, self).__getitem__(slice(y, y+1))
else:
return super(oldstr, self).__getitem__(y)
def __getslice__(self, *args):
return self.__getitem__(slice(*args))
def __contains__(self, key):
if isinstance(key, int):
return False
def __native__(self):
return bytes(self)
__all__ = ['oldstr']
|
[
1,
9995,
13,
29925,
545,
29899,
11980,
5314,
310,
263,
5132,
29871,
29906,
29899,
4561,
851,
1203,
363,
5132,
29871,
29941,
29889,
13,
15945,
29908,
13,
13,
3166,
3694,
1053,
17100,
284,
13,
13,
3166,
4940,
29889,
13239,
1053,
349,
29979,
29906,
29892,
411,
29918,
2527,
562,
605,
13,
13,
361,
349,
29979,
29906,
29901,
13,
1678,
515,
16250,
1053,
20504,
519,
13,
2870,
29901,
13,
1678,
515,
16250,
29889,
10736,
1053,
20504,
519,
13,
13,
29918,
16145,
262,
29918,
13193,
353,
6262,
13,
13,
13,
1990,
7399,
21648,
5015,
29898,
1853,
1125,
13,
1678,
822,
4770,
8758,
3198,
12035,
25932,
29892,
2777,
1125,
13,
4706,
736,
338,
8758,
29898,
8758,
29892,
903,
16145,
262,
29918,
13193,
29897,
13,
13,
13,
1753,
443,
21587,
29898,
29879,
1125,
13,
1678,
364,
15945,
29908,
13,
1678,
4124,
1457,
1372,
6031,
411,
10169,
15602,
13,
13,
1678,
8741,
29901,
13,
1678,
8653,
269,
353,
443,
21587,
29898,
29878,
29915,
10736,
1966,
1753,
1495,
259,
396,
474,
29889,
29872,
29889,
525,
10736,
1966,
1966,
1753,
29915,
13,
1678,
8653,
1596,
29898,
29879,
29897,
13,
1678,
525,
10736,
29905,
1753,
29915,
13,
1678,
8653,
269,
29906,
353,
443,
21587,
877,
10736,
1966,
299,
1389,
1495,
13,
1678,
8653,
7431,
29898,
29879,
29906,
29897,
13,
268,
29947,
13,
1678,
8653,
1596,
29898,
29879,
29906,
29897,
13,
1678,
25638,
13,
1678,
822,
13,
1678,
9995,
13,
1678,
736,
269,
29889,
12508,
2141,
13808,
877,
2523,
356,
29918,
21587,
1495,
13,
13,
13,
1990,
2030,
710,
29898,
2541,
29918,
2527,
562,
605,
29898,
5160,
21648,
5015,
29892,
903,
16145,
262,
29918,
13193,
22164,
13,
1678,
9995,
13,
1678,
319,
6375,
2011,
310,
278,
5132,
29871,
29906,
29871,
29947,
29899,
2966,
1347,
1203,
304,
10772,
29941,
13,
1678,
9995,
13,
1678,
396,
5132,
29871,
29906,
6031,
505,
694,
4770,
1524,
1649,
1158,
29901,
13,
1678,
732,
6799,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
12020,
23833,
2392,
13,
13,
1678,
822,
4770,
3972,
12035,
1311,
1125,
13,
4706,
736,
518,
1918,
363,
2655,
297,
4516,
7373,
16145,
262,
29918,
13193,
29897,
565,
2655,
2804,
525,
1649,
1524,
1649,
2033,
13,
13,
1678,
396,
822,
4770,
1482,
12035,
25932,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
1678,
396,
268,
9995,
13,
1678,
396,
268,
3645,
278,
10772,
29941,
6262,
1574,
1807,
29901,
13,
13,
1678,
396,
268,
6262,
29898,
1524,
519,
29918,
974,
29918,
9466,
29897,
1599,
6262,
13,
1678,
396,
268,
6262,
29898,
1807,
29892,
8025,
21939,
4436,
2314,
1599,
6262,
13,
1678,
396,
268,
6262,
29898,
13193,
29918,
272,
29918,
9040,
29897,
1599,
5198,
9246,
3509,
310,
6262,
29918,
272,
29918,
9040,
13,
1678,
396,
268,
6262,
29898,
524,
29897,
1599,
6262,
1203,
310,
2159,
2183,
491,
278,
3443,
16601,
411,
1870,
6262,
13,
1678,
396,
268,
6262,
580,
1599,
4069,
6262,
1203,
13,
1678,
396,
13,
1678,
396,
268,
1281,
4984,
385,
5198,
9246,
1409,
310,
6262,
515,
29901,
13,
1678,
396,
539,
448,
385,
4256,
519,
7709,
292,
11920,
297,
3464,
29898,
29906,
29945,
29953,
29897,
13,
1678,
396,
539,
448,
263,
1426,
1347,
18511,
773,
278,
6790,
8025,
13,
1678,
396,
539,
448,
738,
1203,
16049,
278,
6835,
3450,
29889,
13,
1678,
396,
539,
448,
385,
6043,
13,
1678,
396,
268,
9995,
13,
1678,
396,
13,
1678,
396,
268,
565,
7431,
29898,
5085,
29897,
1275,
29871,
29900,
29901,
13,
1678,
396,
308,
736,
2428,
29898,
1482,
13193,
29892,
1067,
29879,
467,
1649,
1482,
12035,
25932,
29897,
13,
1678,
396,
268,
396,
12547,
29901,
25342,
338,
8758,
29898,
5085,
29961,
29900,
1402,
716,
13193,
1125,
13,
1678,
396,
268,
396,
1334,
671,
1134,
580,
2012,
310,
278,
2038,
1363,
591,
29915,
276,
337,
1753,
2827,
13,
1678,
396,
268,
396,
445,
304,
367,
5852,
363,
599,
29104,
1347,
1014,
13203,
29889,
24412,
29901,
13,
1678,
396,
268,
396,
910,
1122,
4050,
716,
710,
443,
29899,
1491,
1990,
519,
29889,
13,
1678,
396,
268,
25342,
1134,
29898,
5085,
29961,
29900,
2314,
1275,
716,
13193,
29901,
13,
1678,
396,
308,
736,
6389,
29961,
29900,
29962,
13,
1678,
396,
268,
25342,
338,
8758,
29898,
5085,
29961,
29900,
1402,
903,
16145,
262,
29918,
13193,
1125,
13,
1678,
396,
308,
995,
353,
6389,
29961,
29900,
29962,
13,
1678,
396,
268,
25342,
338,
8758,
29898,
5085,
29961,
29900,
1402,
29104,
1125,
13,
1678,
396,
308,
565,
525,
22331,
29915,
451,
297,
9049,
5085,
29901,
13,
1678,
396,
632,
12020,
20948,
877,
2523,
356,
1347,
2980,
1728,
385,
8025,
1495,
13,
1678,
396,
308,
835,
13,
1678,
396,
308,
396,
12547,
29901,
259,
995,
353,
6389,
29961,
29900,
1822,
12508,
29898,
1068,
19290,
29897,
13,
1678,
396,
308,
396,
5132,
29871,
29906,
29889,
29953,
1347,
19750,
580,
1158,
1838,
29915,
29873,
2125,
9049,
5085,
29901,
13,
1678,
396,
308,
396,
4803,
445,
2012,
29901,
13,
1678,
396,
308,
716,
5085,
353,
518,
19290,
1839,
22331,
2033,
29962,
13,
1678,
396,
308,
565,
525,
12523,
29915,
297,
9049,
5085,
29901,
13,
1678,
396,
632,
716,
5085,
29889,
4397,
29898,
19290,
1839,
12523,
11287,
13,
1678,
396,
308,
995,
353,
6389,
29961,
29900,
1822,
12508,
10456,
1482,
5085,
29897,
13,
1678,
396,
308,
835,
13,
1678,
396,
268,
25342,
338,
8758,
29898,
5085,
29961,
29900,
1402,
20504,
519,
1125,
13,
1678,
396,
308,
565,
7431,
29898,
5085,
29961,
29900,
2314,
1275,
29871,
29900,
29901,
13,
1678,
396,
632,
396,
1724,
338,
445,
29973,
13,
1678,
396,
632,
12020,
7865,
2392,
877,
26690,
2980,
1134,
1495,
13,
1678,
396,
308,
25342,
7431,
29898,
5085,
29961,
29900,
2314,
1405,
29871,
29900,
322,
338,
8758,
29898,
5085,
29961,
29900,
3816,
29900,
1402,
17100,
284,
1125,
13,
1678,
396,
632,
396,
739,
29915,
29879,
263,
1051,
310,
11920,
13,
1678,
396,
632,
995,
353,
289,
29915,
4286,
7122,
4197,
22495,
29898,
29916,
29897,
363,
921,
297,
6389,
29961,
29900,
24960,
13,
1678,
396,
308,
1683,
29901,
13,
1678,
396,
632,
12020,
7865,
2392,
877,
667,
2609,
367,
21551,
408,
385,
6043,
1495,
13,
1678,
396,
268,
25342,
338,
8758,
29898,
5085,
29961,
29900,
1402,
17100,
284,
1125,
13,
1678,
396,
308,
565,
6389,
29961,
29900,
29962,
529,
29871,
29900,
29901,
13,
1678,
396,
632,
12020,
7865,
2392,
877,
22198,
2302,
1495,
13,
1678,
396,
308,
995,
353,
289,
12764,
29916,
29900,
29900,
29915,
334,
6389,
29961,
29900,
29962,
13,
1678,
396,
268,
1683,
29901,
13,
1678,
396,
308,
995,
353,
6389,
29961,
29900,
29962,
13,
1678,
396,
268,
736,
2428,
29898,
1482,
13193,
29892,
1067,
29879,
467,
1649,
1482,
12035,
25932,
29892,
995,
29897,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
269,
353,
2428,
29898,
1025,
710,
29892,
1583,
467,
1649,
276,
558,
1649,
580,
259,
396,
321,
29889,
29887,
29889,
289,
29915,
10736,
29915,
373,
10772,
29941,
29892,
289,
29915,
10736,
29915,
373,
10772,
29941,
13,
4706,
736,
269,
29961,
29896,
17531,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
269,
353,
2428,
29898,
1025,
710,
29892,
1583,
467,
1649,
710,
1649,
580,
259,
396,
321,
29889,
29887,
29889,
376,
29890,
29915,
10736,
11838,
470,
376,
29890,
29915,
10736,
1966,
299,
1389,
29915,
13,
4706,
396,
14402,
29901,
2329,
445,
29901,
13,
4706,
4974,
269,
7503,
29906,
29962,
1275,
376,
29890,
11838,
322,
269,
14352,
29896,
29962,
1275,
376,
11838,
13,
4706,
736,
443,
21587,
29898,
29879,
29961,
29906,
13018,
29896,
2314,
9651,
396,
321,
29889,
29887,
29889,
525,
10736,
29915,
1678,
470,
525,
10736,
29905,
299,
1389,
29915,
13,
13,
1678,
822,
4770,
657,
667,
12035,
1311,
29892,
343,
1125,
13,
4706,
565,
338,
8758,
29898,
29891,
29892,
17100,
284,
1125,
13,
9651,
736,
2428,
29898,
1025,
710,
29892,
1583,
467,
1649,
657,
667,
12035,
18337,
29898,
29891,
29892,
343,
29974,
29896,
876,
13,
4706,
1683,
29901,
13,
9651,
736,
2428,
29898,
1025,
710,
29892,
1583,
467,
1649,
657,
667,
12035,
29891,
29897,
13,
13,
1678,
822,
4770,
657,
18337,
12035,
1311,
29892,
334,
5085,
1125,
13,
4706,
736,
1583,
17255,
657,
667,
12035,
18337,
10456,
5085,
876,
13,
13,
1678,
822,
4770,
11516,
12035,
1311,
29892,
1820,
1125,
13,
4706,
565,
338,
8758,
29898,
1989,
29892,
938,
1125,
13,
9651,
736,
7700,
13,
13,
1678,
822,
4770,
11487,
12035,
1311,
1125,
13,
4706,
736,
6262,
29898,
1311,
29897,
13,
13,
13,
1649,
497,
1649,
353,
6024,
1025,
710,
2033,
13,
2
] |
flopy/mf6/utils/lakpak_utils.py
|
jtwhite79/flopy
| 1 |
134970
|
<gh_stars>1-10
import numpy as np
def get_lak_connections(modelgrid, lake_map, idomain=None, bedleak=0.1):
"""
Function to create lake package connection data from a zero-based
integer array of lake numbers. If the shape of lake number array is
equal to (nrow, ncol) or (ncpl) then the lakes are on top of the model
and are vertically connected to cells at the top of the model. Otherwise
the lakes are embedded in the grid.
TODO: implement embedded lakes for VertexGrid
TODO: add support for UnstructuredGrid
Parameters
----------
modelgrid : StructuredGrid, VertexGrid
model grid
lake_map : MaskedArray, ndarray, list, tuple
location and zero-based lake number for lakes in the model domain.
If lake_map is of size (nrow, ncol) or (ncpl) lakes are located on
top of the model and vertically connected to cells in model layer 1.
If lake_map is of size (nlay, nrow, ncol) or (nlay, ncpl) lakes
are embedded in the model domain and horizontal and vertical lake
connections are defined.
idomain : int or ndarray
location of inactive cells, which are defined with a zero value. If a
ndarray is passed it must be of size (nlay, nrow, ncol) or
(nlay, ncpl).
bedleak : ndarray, list, tuple, float
bed leakance for lakes in the model domain. If bedleak is a float the
same bed leakance is applied to each lake connection in the model.
If bedleak is of size (nrow, ncol) or (ncpl) then all lake
connections for the cellid are given the same bed leakance value.
Returns
-------
idomain : ndarry
idomain adjusted to inactivate cells with lakes
connection_dict : dict
dictionary with the zero-based lake number keys and number of
connections in a lake values
connectiondata : list of lists
connectiondata block for the lake package
"""
if modelgrid.grid_type in ("unstructured",):
raise ValueError(
"unstructured grids not supported in get_lak_connections()"
)
embedded = True
shape3d = modelgrid.shape
shape2d = shape3d[1:]
# convert to numpy array if necessary
if isinstance(lake_map, (list, tuple)):
lake_map = np.array(lake_map, dtype=np.int32)
elif isinstance(lake_map, (int, float)):
raise TypeError(
"lake_map must be a Masked Array, ndarray, list, or tuple"
)
# evaluate lake_map shape
shape_map = lake_map.shape
if shape_map != shape3d:
if shape_map != shape2d:
raise ValueError(
"lake_map shape ({}) must be equal to the grid shape for "
"each layer ({})".format(shape_map, shape2d)
)
else:
embedded = False
# process idomain
if idomain is None:
idomain = np.ones(shape3d, dtype=np.int32)
elif isinstance(idomain, int):
idomain = np.ones(shape3d, dtype=np.int32) * idomain
elif isinstance(idomain, (float, bool)):
raise ValueError("idomain must be a integer")
# check dimensions of idomain
if idomain.shape != shape3d:
raise ValueError(
"shape of idomain "
"({}) not equal to {}".format(idomain.shape, shape3d)
)
# convert bedleak to numpy array if necessary
if isinstance(bedleak, (float, int)):
bedleak = np.ones(shape2d, dtype=float) * float(bedleak)
elif isinstance(bedleak, (list, tuple)):
bedleak = np.array(bedleak, dtype=float)
# get the model grid elevations and reset lake_map using idomain
# if lake is embedded and in an inactive cell
if embedded:
elevations = modelgrid.top_botm
lake_map[idomain < 1] = -1
else:
elevations = None
# determine if masked array, in not convert to masked array
if not np.ma.is_masked(lake_map):
lake_map = np.ma.masked_where(lake_map < 0, lake_map)
connection_dict = {}
connectiondata = []
# find unique lake numbers
unique = np.unique(lake_map)
# exclude lakes with lake numbers less than 0
idx = np.where(unique > -1)
unique = unique[idx]
dx, dy = None, None
# embedded lakes
for lake_number in unique:
iconn = 0
indices = np.argwhere(lake_map == lake_number)
for index in indices:
cell_index = tuple(index.tolist())
if embedded:
leak_value = bedleak[cell_index[1:]]
if modelgrid.grid_type == "structured":
if dx is None:
xv, yv = modelgrid.xvertices, modelgrid.yvertices
dx = xv[0, 1:] - xv[0, :-1]
dy = yv[:-1, 0] - yv[1:, 0]
(
cellids,
claktypes,
belevs,
televs,
connlens,
connwidths,
) = __structured_lake_connections(
lake_map, idomain, cell_index, dx, dy, elevations
)
elif modelgrid.grid_type == "vertex":
raise NotImplementedError(
"embedded lakes have not been implemented"
)
else:
cellid = (0,) + cell_index
leak_value = bedleak[cell_index]
if idomain[cellid] > 0:
cellids = [cellid]
claktypes = ["vertical"]
belevs = [0.0]
televs = [0.0]
connlens = [0.0]
connwidths = [0.0]
else:
cellids = []
claktypes = []
belevs = []
televs = []
connlens = []
connwidths = []
# iterate through each cellid
for (cellid, claktype, belev, telev, connlen, connwidth) in zip(
cellids, claktypes, belevs, televs, connlens, connwidths
):
connectiondata.append(
[
lake_number,
iconn,
cellid[:],
claktype,
leak_value,
belev,
telev,
connlen,
connwidth,
]
)
iconn += 1
# set number of connections for lake
connection_dict[lake_number] = iconn
# reset idomain for lake
if iconn > 0:
idx = np.where((lake_map == lake_number) & (idomain > 0))
idomain[idx] = 0
return idomain, connection_dict, connectiondata
def __structured_lake_connections(
lake_map, idomain, cell_index, dx, dy, elevations
):
nlay, nrow, ncol = lake_map.shape
cellids = []
claktypes = []
belevs = []
televs = []
connlens = []
connwidths = []
k, i, j = cell_index
if idomain[cell_index] > 0:
# back face
if i > 0:
ci = (k, i - 1, j)
cit = (k + 1, i - 1, j)
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
cellids.append(ci)
claktypes.append("horizontal")
belevs.append(elevations[cit])
televs.append(elevations[ci])
connlens.append(0.5 * dy[i - 1])
connwidths.append(dx[j])
# left face
if j > 0:
ci = (k, i, j - 1)
cit = (k + 1, i, j - 1)
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
cellids.append(ci)
claktypes.append("horizontal")
belevs.append(elevations[cit])
televs.append(elevations[ci])
connlens.append(0.5 * dx[j - 1])
connwidths.append(dy[i])
# right face
if j < ncol - 1:
ci = (k, i, j + 1)
cit = (k + 1, i, j + 1)
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
cellids.append(ci)
claktypes.append("horizontal")
belevs.append(elevations[cit])
televs.append(elevations[ci])
connlens.append(0.5 * dx[j + 1])
connwidths.append(dy[i])
# front face
if i < nrow - 1:
ci = (k, i + 1, j)
cit = (k + 1, i + 1, j)
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
cellids.append(ci)
claktypes.append("horizontal")
belevs.append(elevations[cit])
televs.append(elevations[ci])
connlens.append(0.5 * dy[i + 1])
connwidths.append(dx[j])
# lower face
if k < nlay - 1:
ci = (k + 1, i, j)
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
cellids.append(ci)
claktypes.append("vertical")
belevs.append(0.0)
televs.append(0.0)
connlens.append(0.0)
connwidths.append(0.0)
return cellids, claktypes, belevs, televs, connlens, connwidths
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
12655,
408,
7442,
13,
13,
13,
1753,
679,
29918,
18170,
29918,
11958,
1953,
29898,
4299,
7720,
29892,
19437,
29918,
1958,
29892,
1178,
290,
475,
29922,
8516,
29892,
6592,
280,
557,
29922,
29900,
29889,
29896,
1125,
13,
1678,
9995,
13,
1678,
6680,
304,
1653,
19437,
3577,
3957,
848,
515,
263,
5225,
29899,
6707,
13,
1678,
6043,
1409,
310,
19437,
3694,
29889,
960,
278,
8267,
310,
19437,
1353,
1409,
338,
13,
1678,
5186,
304,
313,
29876,
798,
29892,
302,
1054,
29897,
470,
313,
17608,
572,
29897,
769,
278,
425,
10794,
526,
373,
2246,
310,
278,
1904,
13,
1678,
322,
526,
4837,
1711,
6631,
304,
9101,
472,
278,
2246,
310,
278,
1904,
29889,
13466,
13,
1678,
278,
425,
10794,
526,
15685,
297,
278,
6856,
29889,
13,
13,
1678,
14402,
29901,
2334,
15685,
425,
10794,
363,
1798,
4776,
5756,
13,
13,
1678,
14402,
29901,
788,
2304,
363,
853,
4984,
2955,
5756,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
1904,
7720,
584,
28771,
2955,
5756,
29892,
1798,
4776,
5756,
13,
4706,
1904,
6856,
13,
1678,
19437,
29918,
1958,
584,
341,
1278,
287,
2588,
29892,
29871,
299,
2378,
29892,
1051,
29892,
18761,
13,
4706,
4423,
322,
5225,
29899,
6707,
19437,
1353,
363,
425,
10794,
297,
278,
1904,
5354,
29889,
13,
4706,
960,
19437,
29918,
1958,
338,
310,
2159,
313,
29876,
798,
29892,
302,
1054,
29897,
470,
313,
17608,
572,
29897,
425,
10794,
526,
5982,
373,
13,
4706,
2246,
310,
278,
1904,
322,
4837,
1711,
6631,
304,
9101,
297,
1904,
7546,
29871,
29896,
29889,
13,
4706,
960,
19437,
29918,
1958,
338,
310,
2159,
313,
29876,
8387,
29892,
302,
798,
29892,
302,
1054,
29897,
470,
313,
29876,
8387,
29892,
302,
29883,
572,
29897,
425,
10794,
13,
4706,
526,
15685,
297,
278,
1904,
5354,
322,
14698,
322,
11408,
19437,
13,
4706,
12368,
526,
3342,
29889,
13,
1678,
1178,
290,
475,
584,
938,
470,
29871,
299,
2378,
13,
4706,
4423,
310,
297,
4925,
9101,
29892,
607,
526,
3342,
411,
263,
5225,
995,
29889,
960,
263,
13,
308,
299,
2378,
338,
4502,
372,
1818,
367,
310,
2159,
313,
29876,
8387,
29892,
302,
798,
29892,
302,
1054,
29897,
470,
13,
4706,
313,
29876,
8387,
29892,
302,
29883,
572,
467,
13,
1678,
6592,
280,
557,
584,
29871,
299,
2378,
29892,
1051,
29892,
18761,
29892,
5785,
13,
4706,
6592,
24993,
749,
363,
425,
10794,
297,
278,
1904,
5354,
29889,
960,
6592,
280,
557,
338,
263,
5785,
278,
13,
4706,
1021,
6592,
24993,
749,
338,
7436,
304,
1269,
19437,
3957,
297,
278,
1904,
29889,
13,
4706,
960,
6592,
280,
557,
338,
310,
2159,
313,
29876,
798,
29892,
302,
1054,
29897,
470,
313,
17608,
572,
29897,
769,
599,
19437,
13,
4706,
12368,
363,
278,
3038,
333,
526,
2183,
278,
1021,
6592,
24993,
749,
995,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
1178,
290,
475,
584,
29871,
299,
279,
719,
13,
4706,
1178,
290,
475,
10365,
287,
304,
297,
11236,
403,
9101,
411,
425,
10794,
13,
1678,
3957,
29918,
8977,
584,
9657,
13,
4706,
8600,
411,
278,
5225,
29899,
6707,
19437,
1353,
6611,
322,
1353,
310,
13,
4706,
12368,
297,
263,
19437,
1819,
13,
1678,
3957,
1272,
584,
1051,
310,
8857,
13,
4706,
3957,
1272,
2908,
363,
278,
19437,
3577,
13,
13,
1678,
9995,
13,
13,
1678,
565,
1904,
7720,
29889,
7720,
29918,
1853,
297,
4852,
348,
4984,
2955,
613,
1125,
13,
4706,
12020,
7865,
2392,
29898,
13,
9651,
376,
348,
4984,
2955,
867,
4841,
451,
6969,
297,
679,
29918,
18170,
29918,
11958,
1953,
25318,
13,
4706,
1723,
13,
13,
1678,
15685,
353,
5852,
13,
1678,
8267,
29941,
29881,
353,
1904,
7720,
29889,
12181,
13,
1678,
8267,
29906,
29881,
353,
8267,
29941,
29881,
29961,
29896,
17531,
13,
13,
1678,
396,
3588,
304,
12655,
1409,
565,
5181,
13,
1678,
565,
338,
8758,
29898,
433,
446,
29918,
1958,
29892,
313,
1761,
29892,
18761,
22164,
13,
4706,
19437,
29918,
1958,
353,
7442,
29889,
2378,
29898,
433,
446,
29918,
1958,
29892,
26688,
29922,
9302,
29889,
524,
29941,
29906,
29897,
13,
1678,
25342,
338,
8758,
29898,
433,
446,
29918,
1958,
29892,
313,
524,
29892,
5785,
22164,
13,
4706,
12020,
20948,
29898,
13,
9651,
376,
433,
446,
29918,
1958,
1818,
367,
263,
341,
1278,
287,
4398,
29892,
29871,
299,
2378,
29892,
1051,
29892,
470,
18761,
29908,
13,
4706,
1723,
13,
13,
1678,
396,
14707,
19437,
29918,
1958,
8267,
13,
1678,
8267,
29918,
1958,
353,
19437,
29918,
1958,
29889,
12181,
13,
1678,
565,
8267,
29918,
1958,
2804,
8267,
29941,
29881,
29901,
13,
4706,
565,
8267,
29918,
1958,
2804,
8267,
29906,
29881,
29901,
13,
9651,
12020,
7865,
2392,
29898,
13,
18884,
376,
433,
446,
29918,
1958,
8267,
21313,
1800,
1818,
367,
5186,
304,
278,
6856,
8267,
363,
376,
13,
18884,
376,
4204,
7546,
21313,
1800,
1642,
4830,
29898,
12181,
29918,
1958,
29892,
8267,
29906,
29881,
29897,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
15685,
353,
7700,
13,
13,
1678,
396,
1889,
1178,
290,
475,
13,
1678,
565,
1178,
290,
475,
338,
6213,
29901,
13,
4706,
1178,
290,
475,
353,
7442,
29889,
2873,
29898,
12181,
29941,
29881,
29892,
26688,
29922,
9302,
29889,
524,
29941,
29906,
29897,
13,
1678,
25342,
338,
8758,
29898,
333,
290,
475,
29892,
938,
1125,
13,
4706,
1178,
290,
475,
353,
7442,
29889,
2873,
29898,
12181,
29941,
29881,
29892,
26688,
29922,
9302,
29889,
524,
29941,
29906,
29897,
334,
1178,
290,
475,
13,
1678,
25342,
338,
8758,
29898,
333,
290,
475,
29892,
313,
7411,
29892,
6120,
22164,
13,
4706,
12020,
7865,
2392,
703,
333,
290,
475,
1818,
367,
263,
6043,
1159,
13,
13,
1678,
396,
1423,
13391,
310,
1178,
290,
475,
13,
1678,
565,
1178,
290,
475,
29889,
12181,
2804,
8267,
29941,
29881,
29901,
13,
4706,
12020,
7865,
2392,
29898,
13,
9651,
376,
12181,
310,
1178,
290,
475,
376,
13,
9651,
376,
3319,
1800,
451,
5186,
304,
6571,
1642,
4830,
29898,
333,
290,
475,
29889,
12181,
29892,
8267,
29941,
29881,
29897,
13,
4706,
1723,
13,
13,
1678,
396,
3588,
6592,
280,
557,
304,
12655,
1409,
565,
5181,
13,
1678,
565,
338,
8758,
29898,
2580,
280,
557,
29892,
313,
7411,
29892,
938,
22164,
13,
4706,
6592,
280,
557,
353,
7442,
29889,
2873,
29898,
12181,
29906,
29881,
29892,
26688,
29922,
7411,
29897,
334,
5785,
29898,
2580,
280,
557,
29897,
13,
1678,
25342,
338,
8758,
29898,
2580,
280,
557,
29892,
313,
1761,
29892,
18761,
22164,
13,
4706,
6592,
280,
557,
353,
7442,
29889,
2378,
29898,
2580,
280,
557,
29892,
26688,
29922,
7411,
29897,
13,
13,
1678,
396,
679,
278,
1904,
6856,
11858,
800,
322,
10092,
19437,
29918,
1958,
773,
1178,
290,
475,
13,
1678,
396,
565,
19437,
338,
15685,
322,
297,
385,
297,
4925,
3038,
13,
1678,
565,
15685,
29901,
13,
4706,
11858,
800,
353,
1904,
7720,
29889,
3332,
29918,
7451,
29885,
13,
4706,
19437,
29918,
1958,
29961,
333,
290,
475,
529,
29871,
29896,
29962,
353,
448,
29896,
13,
1678,
1683,
29901,
13,
4706,
11858,
800,
353,
6213,
13,
13,
1678,
396,
8161,
565,
11105,
287,
1409,
29892,
297,
451,
3588,
304,
11105,
287,
1409,
13,
1678,
565,
451,
7442,
29889,
655,
29889,
275,
29918,
13168,
287,
29898,
433,
446,
29918,
1958,
1125,
13,
4706,
19437,
29918,
1958,
353,
7442,
29889,
655,
29889,
13168,
287,
29918,
3062,
29898,
433,
446,
29918,
1958,
529,
29871,
29900,
29892,
19437,
29918,
1958,
29897,
13,
13,
1678,
3957,
29918,
8977,
353,
6571,
13,
1678,
3957,
1272,
353,
5159,
13,
13,
1678,
396,
1284,
5412,
19437,
3694,
13,
1678,
5412,
353,
7442,
29889,
13092,
29898,
433,
446,
29918,
1958,
29897,
13,
13,
1678,
396,
19060,
425,
10794,
411,
19437,
3694,
3109,
1135,
29871,
29900,
13,
1678,
22645,
353,
7442,
29889,
3062,
29898,
13092,
1405,
448,
29896,
29897,
13,
1678,
5412,
353,
5412,
29961,
13140,
29962,
13,
13,
1678,
15414,
29892,
13475,
353,
6213,
29892,
6213,
13,
13,
1678,
396,
15685,
425,
10794,
13,
1678,
363,
19437,
29918,
4537,
297,
5412,
29901,
13,
4706,
16077,
3409,
353,
29871,
29900,
13,
4706,
16285,
353,
7442,
29889,
1191,
3062,
29898,
433,
446,
29918,
1958,
1275,
19437,
29918,
4537,
29897,
13,
4706,
363,
2380,
297,
16285,
29901,
13,
9651,
3038,
29918,
2248,
353,
18761,
29898,
2248,
29889,
25027,
391,
3101,
13,
9651,
565,
15685,
29901,
13,
18884,
24993,
29918,
1767,
353,
6592,
280,
557,
29961,
3729,
29918,
2248,
29961,
29896,
29901,
5262,
13,
18884,
565,
1904,
7720,
29889,
7720,
29918,
1853,
1275,
376,
4984,
2955,
1115,
13,
462,
1678,
565,
15414,
338,
6213,
29901,
13,
462,
4706,
921,
29894,
29892,
343,
29894,
353,
1904,
7720,
29889,
29916,
1765,
1575,
29892,
1904,
7720,
29889,
29891,
1765,
1575,
13,
462,
4706,
15414,
353,
921,
29894,
29961,
29900,
29892,
29871,
29896,
17531,
448,
921,
29894,
29961,
29900,
29892,
8956,
29896,
29962,
13,
462,
4706,
13475,
353,
343,
29894,
7503,
29899,
29896,
29892,
29871,
29900,
29962,
448,
343,
29894,
29961,
29896,
29901,
29892,
29871,
29900,
29962,
13,
462,
1678,
313,
13,
462,
4706,
3038,
4841,
29892,
13,
462,
4706,
3711,
29895,
8768,
29892,
13,
462,
4706,
367,
2608,
29879,
29892,
13,
462,
4706,
734,
2608,
29879,
29892,
13,
462,
4706,
11009,
29880,
575,
29892,
13,
462,
4706,
11009,
2103,
29879,
29892,
13,
462,
1678,
1723,
353,
4770,
4984,
2955,
29918,
433,
446,
29918,
11958,
1953,
29898,
13,
462,
4706,
19437,
29918,
1958,
29892,
1178,
290,
475,
29892,
3038,
29918,
2248,
29892,
15414,
29892,
13475,
29892,
11858,
800,
13,
462,
1678,
1723,
13,
18884,
25342,
1904,
7720,
29889,
7720,
29918,
1853,
1275,
376,
369,
4776,
1115,
13,
462,
1678,
12020,
2216,
1888,
2037,
287,
2392,
29898,
13,
462,
4706,
376,
17987,
7176,
425,
10794,
505,
451,
1063,
8762,
29908,
13,
462,
1678,
1723,
13,
9651,
1683,
29901,
13,
18884,
3038,
333,
353,
313,
29900,
29892,
29897,
718,
3038,
29918,
2248,
13,
18884,
24993,
29918,
1767,
353,
6592,
280,
557,
29961,
3729,
29918,
2248,
29962,
13,
18884,
565,
1178,
290,
475,
29961,
3729,
333,
29962,
1405,
29871,
29900,
29901,
13,
462,
1678,
3038,
4841,
353,
518,
3729,
333,
29962,
13,
462,
1678,
3711,
29895,
8768,
353,
6796,
18575,
3108,
13,
462,
1678,
367,
2608,
29879,
353,
518,
29900,
29889,
29900,
29962,
13,
462,
1678,
734,
2608,
29879,
353,
518,
29900,
29889,
29900,
29962,
13,
462,
1678,
11009,
29880,
575,
353,
518,
29900,
29889,
29900,
29962,
13,
462,
1678,
11009,
2103,
29879,
353,
518,
29900,
29889,
29900,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
3038,
4841,
353,
5159,
13,
462,
1678,
3711,
29895,
8768,
353,
5159,
13,
462,
1678,
367,
2608,
29879,
353,
5159,
13,
462,
1678,
734,
2608,
29879,
353,
5159,
13,
462,
1678,
11009,
29880,
575,
353,
5159,
13,
462,
1678,
11009,
2103,
29879,
353,
5159,
13,
13,
9651,
396,
13649,
1549,
1269,
3038,
333,
13,
9651,
363,
313,
3729,
333,
29892,
3711,
1193,
668,
29892,
367,
2608,
29892,
734,
2608,
29892,
11009,
2435,
29892,
11009,
2103,
29897,
297,
14319,
29898,
13,
18884,
3038,
4841,
29892,
3711,
29895,
8768,
29892,
367,
2608,
29879,
29892,
734,
2608,
29879,
29892,
11009,
29880,
575,
29892,
11009,
2103,
29879,
13,
632,
1125,
13,
18884,
3957,
1272,
29889,
4397,
29898,
13,
462,
1678,
518,
13,
462,
4706,
19437,
29918,
4537,
29892,
13,
462,
4706,
16077,
3409,
29892,
13,
462,
4706,
3038,
333,
7503,
1402,
13,
462,
4706,
3711,
1193,
668,
29892,
13,
462,
4706,
24993,
29918,
1767,
29892,
13,
462,
4706,
367,
2608,
29892,
13,
462,
4706,
734,
2608,
29892,
13,
462,
4706,
11009,
2435,
29892,
13,
462,
4706,
11009,
2103,
29892,
13,
462,
1678,
4514,
13,
18884,
1723,
13,
18884,
16077,
3409,
4619,
29871,
29896,
13,
13,
4706,
396,
731,
1353,
310,
12368,
363,
19437,
13,
4706,
3957,
29918,
8977,
29961,
433,
446,
29918,
4537,
29962,
353,
16077,
3409,
13,
13,
4706,
396,
10092,
1178,
290,
475,
363,
19437,
13,
4706,
565,
16077,
3409,
1405,
29871,
29900,
29901,
13,
9651,
22645,
353,
7442,
29889,
3062,
3552,
433,
446,
29918,
1958,
1275,
19437,
29918,
4537,
29897,
669,
313,
333,
290,
475,
1405,
29871,
29900,
876,
13,
9651,
1178,
290,
475,
29961,
13140,
29962,
353,
29871,
29900,
13,
13,
1678,
736,
1178,
290,
475,
29892,
3957,
29918,
8977,
29892,
3957,
1272,
13,
13,
13,
1753,
4770,
4984,
2955,
29918,
433,
446,
29918,
11958,
1953,
29898,
13,
1678,
19437,
29918,
1958,
29892,
1178,
290,
475,
29892,
3038,
29918,
2248,
29892,
15414,
29892,
13475,
29892,
11858,
800,
13,
1125,
13,
1678,
302,
8387,
29892,
302,
798,
29892,
302,
1054,
353,
19437,
29918,
1958,
29889,
12181,
13,
1678,
3038,
4841,
353,
5159,
13,
1678,
3711,
29895,
8768,
353,
5159,
13,
1678,
367,
2608,
29879,
353,
5159,
13,
1678,
734,
2608,
29879,
353,
5159,
13,
1678,
11009,
29880,
575,
353,
5159,
13,
1678,
11009,
2103,
29879,
353,
5159,
13,
13,
1678,
413,
29892,
474,
29892,
432,
353,
3038,
29918,
2248,
13,
13,
1678,
565,
1178,
290,
475,
29961,
3729,
29918,
2248,
29962,
1405,
29871,
29900,
29901,
13,
4706,
396,
1250,
3700,
13,
4706,
565,
474,
1405,
29871,
29900,
29901,
13,
9651,
4583,
353,
313,
29895,
29892,
474,
448,
29871,
29896,
29892,
432,
29897,
13,
9651,
7537,
353,
313,
29895,
718,
29871,
29896,
29892,
474,
448,
29871,
29896,
29892,
432,
29897,
13,
9651,
565,
7442,
29889,
655,
29889,
275,
29918,
13168,
287,
29898,
433,
446,
29918,
1958,
29961,
455,
2314,
322,
1178,
290,
475,
29961,
455,
29962,
1405,
29871,
29900,
29901,
13,
18884,
3038,
4841,
29889,
4397,
29898,
455,
29897,
13,
18884,
3711,
29895,
8768,
29889,
4397,
703,
22672,
1159,
13,
18884,
367,
2608,
29879,
29889,
4397,
29898,
29872,
2608,
800,
29961,
20752,
2314,
13,
18884,
734,
2608,
29879,
29889,
4397,
29898,
29872,
2608,
800,
29961,
455,
2314,
13,
18884,
11009,
29880,
575,
29889,
4397,
29898,
29900,
29889,
29945,
334,
13475,
29961,
29875,
448,
29871,
29896,
2314,
13,
18884,
11009,
2103,
29879,
29889,
4397,
29898,
8235,
29961,
29926,
2314,
13,
13,
4706,
396,
2175,
3700,
13,
4706,
565,
432,
1405,
29871,
29900,
29901,
13,
9651,
4583,
353,
313,
29895,
29892,
474,
29892,
432,
448,
29871,
29896,
29897,
13,
9651,
7537,
353,
313,
29895,
718,
29871,
29896,
29892,
474,
29892,
432,
448,
29871,
29896,
29897,
13,
9651,
565,
7442,
29889,
655,
29889,
275,
29918,
13168,
287,
29898,
433,
446,
29918,
1958,
29961,
455,
2314,
322,
1178,
290,
475,
29961,
455,
29962,
1405,
29871,
29900,
29901,
13,
18884,
3038,
4841,
29889,
4397,
29898,
455,
29897,
13,
18884,
3711,
29895,
8768,
29889,
4397,
703,
22672,
1159,
13,
18884,
367,
2608,
29879,
29889,
4397,
29898,
29872,
2608,
800,
29961,
20752,
2314,
13,
18884,
734,
2608,
29879,
29889,
4397,
29898,
29872,
2608,
800,
29961,
455,
2314,
13,
18884,
11009,
29880,
575,
29889,
4397,
29898,
29900,
29889,
29945,
334,
15414,
29961,
29926,
448,
29871,
29896,
2314,
13,
18884,
11009,
2103,
29879,
29889,
4397,
29898,
4518,
29961,
29875,
2314,
13,
13,
4706,
396,
1492,
3700,
13,
4706,
565,
432,
529,
302,
1054,
448,
29871,
29896,
29901,
13,
9651,
4583,
353,
313,
29895,
29892,
474,
29892,
432,
718,
29871,
29896,
29897,
13,
9651,
7537,
353,
313,
29895,
718,
29871,
29896,
29892,
474,
29892,
432,
718,
29871,
29896,
29897,
13,
9651,
565,
7442,
29889,
655,
29889,
275,
29918,
13168,
287,
29898,
433,
446,
29918,
1958,
29961,
455,
2314,
322,
1178,
290,
475,
29961,
455,
29962,
1405,
29871,
29900,
29901,
13,
18884,
3038,
4841,
29889,
4397,
29898,
455,
29897,
13,
18884,
3711,
29895,
8768,
29889,
4397,
703,
22672,
1159,
13,
18884,
367,
2608,
29879,
29889,
4397,
29898,
29872,
2608,
800,
29961,
20752,
2314,
13,
18884,
734,
2608,
29879,
29889,
4397,
29898,
29872,
2608,
800,
29961,
455,
2314,
13,
18884,
11009,
29880,
575,
29889,
4397,
29898,
29900,
29889,
29945,
334,
15414,
29961,
29926,
718,
29871,
29896,
2314,
13,
18884,
11009,
2103,
29879,
29889,
4397,
29898,
4518,
29961,
29875,
2314,
13,
13,
4706,
396,
4565,
3700,
13,
4706,
565,
474,
529,
302,
798,
448,
29871,
29896,
29901,
13,
9651,
4583,
353,
313,
29895,
29892,
474,
718,
29871,
29896,
29892,
432,
29897,
13,
9651,
7537,
353,
313,
29895,
718,
29871,
29896,
29892,
474,
718,
29871,
29896,
29892,
432,
29897,
13,
9651,
565,
7442,
29889,
655,
29889,
275,
29918,
13168,
287,
29898,
433,
446,
29918,
1958,
29961,
455,
2314,
322,
1178,
290,
475,
29961,
455,
29962,
1405,
29871,
29900,
29901,
13,
18884,
3038,
4841,
29889,
4397,
29898,
455,
29897,
13,
18884,
3711,
29895,
8768,
29889,
4397,
703,
22672,
1159,
13,
18884,
367,
2608,
29879,
29889,
4397,
29898,
29872,
2608,
800,
29961,
20752,
2314,
13,
18884,
734,
2608,
29879,
29889,
4397,
29898,
29872,
2608,
800,
29961,
455,
2314,
13,
18884,
11009,
29880,
575,
29889,
4397,
29898,
29900,
29889,
29945,
334,
13475,
29961,
29875,
718,
29871,
29896,
2314,
13,
18884,
11009,
2103,
29879,
29889,
4397,
29898,
8235,
29961,
29926,
2314,
13,
13,
4706,
396,
5224,
3700,
13,
4706,
565,
413,
529,
302,
8387,
448,
29871,
29896,
29901,
13,
9651,
4583,
353,
313,
29895,
718,
29871,
29896,
29892,
474,
29892,
432,
29897,
13,
9651,
565,
7442,
29889,
655,
29889,
275,
29918,
13168,
287,
29898,
433,
446,
29918,
1958,
29961,
455,
2314,
322,
1178,
290,
475,
29961,
455,
29962,
1405,
29871,
29900,
29901,
13,
18884,
3038,
4841,
29889,
4397,
29898,
455,
29897,
13,
18884,
3711,
29895,
8768,
29889,
4397,
703,
18575,
1159,
13,
18884,
367,
2608,
29879,
29889,
4397,
29898,
29900,
29889,
29900,
29897,
13,
18884,
734,
2608,
29879,
29889,
4397,
29898,
29900,
29889,
29900,
29897,
13,
18884,
11009,
29880,
575,
29889,
4397,
29898,
29900,
29889,
29900,
29897,
13,
18884,
11009,
2103,
29879,
29889,
4397,
29898,
29900,
29889,
29900,
29897,
13,
13,
1678,
736,
3038,
4841,
29892,
3711,
29895,
8768,
29892,
367,
2608,
29879,
29892,
734,
2608,
29879,
29892,
11009,
29880,
575,
29892,
11009,
2103,
29879,
13,
2
] |
SVMmodel_withSKF.py
|
tameney22/DCI-Capstone
| 0 |
3901
|
"""
This script is where the preprocessed data is used to train the SVM model to
perform the classification. I am using Stratified K-Fold Cross Validation to
prevent bias and/or any imbalance that could affect the model's accuracy.
REFERENCE: https://medium.com/@bedigunjit/simple-guide-to-text-classification-nlp-using-svm-and-naive-bayes-with-python-421db3a72d34
"""
import numpy as np
import pandas as pd
from sklearn import model_selection, svm
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import StratifiedKFold
# Open preproccessed csv
df = pd.read_csv("preprocessed.csv", index_col=0)
print(df.head())
print("SPLITTING TRAIN-TEST")
x = df["Text"]
y = df["PublicationTitle"]
train_x, test_x, train_y, test_y = model_selection.train_test_split(
df["Text"], df["PublicationTitle"], test_size=0.3)
# Label encode the target variable to transform categorical data of string
# type into numerical values the model can understand
encoder = LabelEncoder()
# train_y = encoder.fit_transform(train_y)
# test_y = encoder.fit_transform(test_y)
# Word vectorization
# turning a collection of text documents into numerical feature vectors
# We are using Term Frequency - Inverse Document
tfidf_vect = TfidfVectorizer(max_features=5000)
tfidf_vect.fit(df["Text"])
# train_x_tfidf = tfidf_vect.transform(train_x)
# test_x_tfidf = tfidf_vect.transform(test_x)
x_tfidf = tfidf_vect.transform(df["Text"])
y = encoder.fit_transform(y)
# print(tfidf_vect.vocabulary_)
# Fit the training dataset to the classifier
print("TRAINING THE MODEL")
SVM = svm.SVC(C=1.0, kernel='linear', degree=3, gamma='auto')
skf = StratifiedKFold(n_splits=10, shuffle=True, random_state=1)
accuracies = []
fold = 1
for train_idx, test_idx in skf.split(x, y):
print("Working on fold", fold)
x_train_fold, x_test_fold = x_tfidf[train_idx], x_tfidf[test_idx]
y_train_fold, y_test_fold = y[train_idx], y[test_idx]
SVM.fit(x_train_fold, y_train_fold)
acc = SVM.score(x_test_fold, y_test_fold)
print("Acc", fold, ":", acc)
accuracies.append(acc)
fold += 1
print("ACCURACIES:", accuracies)
print("Max Accuracy:", np.max(accuracies))
print("Min Accuracy:", np.min(accuracies))
print("Mean of Accuracies:", np.mean(accuracies))
print("STD of Accuracies:", np.std(accuracies))
# print("RUNNING TEST PREDICTIONS")
# predictions = SVM.predict(test_x_tfidf)
# # Calculate accuracy score
# accuracy = accuracy_score(test_y, predictions)
# print("Accuracy:", str(accuracy * 100) + "%")
|
[
1,
9995,
13,
4013,
2471,
338,
988,
278,
758,
5014,
287,
848,
338,
1304,
304,
7945,
278,
317,
9219,
1904,
304,
13,
19826,
278,
12965,
29889,
306,
626,
773,
3767,
271,
2164,
476,
29899,
29943,
1025,
11189,
15758,
362,
304,
29871,
13,
18921,
24003,
322,
29914,
272,
738,
527,
5521,
749,
393,
1033,
6602,
278,
1904,
29915,
29879,
13600,
29889,
13,
13,
25866,
1001,
1430,
4741,
29901,
2045,
597,
27891,
29889,
510,
29368,
2580,
335,
348,
29926,
277,
29914,
12857,
29899,
13075,
29899,
517,
29899,
726,
29899,
1990,
2450,
29899,
12938,
29886,
29899,
4746,
29899,
4501,
29885,
29899,
392,
29899,
1056,
573,
29899,
27495,
267,
29899,
2541,
29899,
4691,
29899,
29946,
29906,
29896,
2585,
29941,
29874,
29955,
29906,
29881,
29941,
29946,
13,
15945,
29908,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
11701,
408,
10518,
13,
3166,
2071,
19668,
1053,
1904,
29918,
21731,
29892,
3731,
29885,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
13600,
29918,
13628,
13,
3166,
2071,
19668,
29889,
1457,
19170,
1053,
15796,
8566,
6119,
13,
3166,
2071,
19668,
29889,
14394,
29918,
1062,
13857,
29889,
726,
1053,
323,
29888,
333,
29888,
12877,
3950,
13,
3166,
2071,
19668,
29889,
4299,
29918,
21731,
1053,
3767,
271,
2164,
29968,
29943,
1025,
13,
13,
13,
29937,
4673,
758,
771,
1676,
287,
11799,
13,
2176,
353,
10518,
29889,
949,
29918,
7638,
703,
1457,
5014,
287,
29889,
7638,
613,
2380,
29918,
1054,
29922,
29900,
29897,
13,
2158,
29898,
2176,
29889,
2813,
3101,
13,
13,
2158,
703,
5550,
29931,
1806,
29911,
4214,
323,
4717,
1177,
29899,
18267,
1159,
13,
29916,
353,
4489,
3366,
1626,
3108,
13,
29891,
353,
4489,
3366,
19858,
362,
7030,
3108,
13,
13,
14968,
29918,
29916,
29892,
1243,
29918,
29916,
29892,
7945,
29918,
29891,
29892,
1243,
29918,
29891,
353,
1904,
29918,
21731,
29889,
14968,
29918,
1688,
29918,
5451,
29898,
13,
1678,
4489,
3366,
1626,
12436,
4489,
3366,
19858,
362,
7030,
12436,
1243,
29918,
2311,
29922,
29900,
29889,
29941,
29897,
13,
13,
29937,
15796,
19750,
278,
3646,
2286,
304,
4327,
11608,
936,
848,
310,
1347,
13,
29937,
1134,
964,
16259,
1819,
278,
1904,
508,
2274,
13,
13,
3977,
6119,
353,
15796,
8566,
6119,
580,
13,
29937,
7945,
29918,
29891,
353,
2094,
6119,
29889,
9202,
29918,
9067,
29898,
14968,
29918,
29891,
29897,
13,
29937,
1243,
29918,
29891,
353,
2094,
6119,
29889,
9202,
29918,
9067,
29898,
1688,
29918,
29891,
29897,
13,
13,
29937,
10803,
4608,
2133,
13,
29937,
14712,
263,
4333,
310,
1426,
10701,
964,
16259,
4682,
12047,
13,
29937,
1334,
526,
773,
11814,
3878,
23860,
448,
512,
3901,
10854,
13,
13264,
333,
29888,
29918,
345,
312,
353,
323,
29888,
333,
29888,
12877,
3950,
29898,
3317,
29918,
22100,
29922,
29945,
29900,
29900,
29900,
29897,
13,
13264,
333,
29888,
29918,
345,
312,
29889,
9202,
29898,
2176,
3366,
1626,
20068,
13,
13,
29937,
7945,
29918,
29916,
29918,
13264,
333,
29888,
353,
15886,
333,
29888,
29918,
345,
312,
29889,
9067,
29898,
14968,
29918,
29916,
29897,
13,
29937,
1243,
29918,
29916,
29918,
13264,
333,
29888,
353,
15886,
333,
29888,
29918,
345,
312,
29889,
9067,
29898,
1688,
29918,
29916,
29897,
13,
13,
29916,
29918,
13264,
333,
29888,
353,
15886,
333,
29888,
29918,
345,
312,
29889,
9067,
29898,
2176,
3366,
1626,
20068,
13,
29891,
353,
2094,
6119,
29889,
9202,
29918,
9067,
29898,
29891,
29897,
13,
13,
13,
29937,
1596,
29898,
13264,
333,
29888,
29918,
345,
312,
29889,
29894,
542,
370,
352,
653,
19925,
13,
13,
29937,
383,
277,
278,
6694,
8783,
304,
278,
770,
3709,
13,
2158,
703,
29911,
4717,
1177,
4214,
6093,
16999,
2287,
29931,
1159,
13,
7597,
29924,
353,
3731,
29885,
29889,
7597,
29907,
29898,
29907,
29922,
29896,
29889,
29900,
29892,
8466,
2433,
10660,
742,
7426,
29922,
29941,
29892,
330,
2735,
2433,
6921,
1495,
13,
13,
808,
29888,
353,
3767,
271,
2164,
29968,
29943,
1025,
29898,
29876,
29918,
23579,
1169,
29922,
29896,
29900,
29892,
528,
21897,
29922,
5574,
29892,
4036,
29918,
3859,
29922,
29896,
29897,
13,
5753,
2002,
2478,
353,
5159,
13,
13,
8771,
353,
29871,
29896,
13,
1454,
7945,
29918,
13140,
29892,
1243,
29918,
13140,
297,
2071,
29888,
29889,
5451,
29898,
29916,
29892,
343,
1125,
13,
1678,
1596,
703,
5531,
292,
373,
900,
29881,
613,
900,
29881,
29897,
13,
1678,
921,
29918,
14968,
29918,
8771,
29892,
921,
29918,
1688,
29918,
8771,
353,
921,
29918,
13264,
333,
29888,
29961,
14968,
29918,
13140,
1402,
921,
29918,
13264,
333,
29888,
29961,
1688,
29918,
13140,
29962,
13,
1678,
343,
29918,
14968,
29918,
8771,
29892,
343,
29918,
1688,
29918,
8771,
353,
343,
29961,
14968,
29918,
13140,
1402,
343,
29961,
1688,
29918,
13140,
29962,
13,
13,
1678,
317,
9219,
29889,
9202,
29898,
29916,
29918,
14968,
29918,
8771,
29892,
343,
29918,
14968,
29918,
8771,
29897,
13,
1678,
1035,
353,
317,
9219,
29889,
13628,
29898,
29916,
29918,
1688,
29918,
8771,
29892,
343,
29918,
1688,
29918,
8771,
29897,
13,
1678,
1596,
703,
7504,
613,
900,
29881,
29892,
29242,
613,
1035,
29897,
13,
1678,
1035,
2002,
2478,
29889,
4397,
29898,
5753,
29897,
13,
1678,
900,
29881,
4619,
29871,
29896,
13,
13,
13,
2158,
703,
2477,
22484,
2477,
29059,
29901,
613,
1035,
2002,
2478,
29897,
13,
2158,
703,
7976,
4831,
332,
4135,
29901,
613,
7442,
29889,
3317,
29898,
5753,
2002,
2478,
876,
13,
2158,
703,
8140,
4831,
332,
4135,
29901,
613,
7442,
29889,
1195,
29898,
5753,
2002,
2478,
876,
13,
2158,
703,
6816,
273,
310,
4831,
2002,
2478,
29901,
613,
7442,
29889,
12676,
29898,
5753,
2002,
2478,
876,
13,
2158,
703,
1254,
29928,
310,
4831,
2002,
2478,
29901,
613,
7442,
29889,
4172,
29898,
5753,
2002,
2478,
876,
13,
13,
29937,
1596,
703,
29934,
3904,
29940,
4214,
17067,
1254,
349,
1525,
4571,
9838,
29903,
1159,
13,
29937,
27303,
353,
317,
9219,
29889,
27711,
29898,
1688,
29918,
29916,
29918,
13264,
333,
29888,
29897,
13,
13,
29937,
396,
20535,
403,
13600,
8158,
13,
29937,
13600,
353,
13600,
29918,
13628,
29898,
1688,
29918,
29891,
29892,
27303,
29897,
13,
29937,
1596,
703,
7504,
332,
4135,
29901,
613,
851,
29898,
562,
2764,
4135,
334,
29871,
29896,
29900,
29900,
29897,
718,
11860,
1159,
13,
2
] |
src/Server.py
|
blyspyder/tf-fed-demo
| 5 |
165228
|
<gh_stars>1-10
import tensorflow as tf
from tqdm import tqdm
from Client import Clients
import xlwt
import numpy as np
def gaussian_noise(input,std,client_id,sheet,j):
length = len(input)
sum=0
for i in range(length):
source = input[i].copy()
#noise= tf.random_normal(shape=tf.shape(input[i]),mean=0.0,stddev=std,dtype=tf.float32)
noise = np.random.normal(loc=0.0,scale=std,size=input[i].shape)
input[i] += noise
dist = np.linalg.norm(source-input[i])
sum+=dist
average = sum/length
sheet.write(j,client_id,average)
return input
def buildClients(num):
learning_rate = 0.0005#0.0002
num_input = 32 # image shape: 32*32
num_input_channel = 3 # image channel: 3
num_classes = 10 # Cifar-10 total classes (0-9 digits)
#返回一定数量的clients
return Clients(input_shape=[None, num_input, num_input, num_input_channel],
num_classes=num_classes,
learning_rate=learning_rate,
clients_num=num)
def run_global_test(client, global_vars, test_num, i, save=False,sheet=None):
#测试输出acc和loss
client.set_global_vars(global_vars)
acc, loss = client.run_test(test_num,save)
sheet.write(i,0,float(acc))
sheet.write(i,1,float(loss))
print("[epoch {}, {} inst] Testing ACC: {:.4f}, Loss: {:.4f}".format(
ep + 1, test_num, acc, loss))
scales = [0.0005,0.05,0.2]
for scale in scales:
CLIENT_NUMBER = 4 #客户端数量
'''可尝试更高比例的客户端'''
CLIENT_RATIO_PER_ROUND = 0.5 #每轮挑选的clients的比例
epoch = 260
#### CREATE CLIENT AND LOAD DATASET ####
client = buildClients(CLIENT_NUMBER)
workbook = xlwt.Workbook()
sheet=workbook.add_sheet('0.0002')
#### BEGIN TRAINING ####
sheet2 = workbook.add_sheet('欧式距离')
global_vars = client.get_client_vars()
for ep in range(epoch):
#收集client端的参数
client_vars_sum = None
# 随机挑选client训练
random_clients = client.choose_clients(CLIENT_RATIO_PER_ROUND)
# tqdm显示进度条
for client_id in tqdm(random_clients, ascii=True):
#将sever端模型加载到tqdm上
client.set_global_vars(global_vars)
# 训练这个下表的client
client.train_epoch(cid=client_id)
# 获取当前client的变量值
current_client_vars_norm = client.get_client_vars()
#获得参数后如高斯白噪声
current_client_vars=gaussian_noise(current_client_vars_norm,scale,client_id,sheet2,ep)
# 叠加各层参数
if client_vars_sum is None:
client_vars_sum = current_client_vars
else:
for cv, ccv in zip(client_vars_sum, current_client_vars):
cv += ccv
# obtain the avg vars as global vars
global_vars = []
for var in client_vars_sum:
global_vars.append(var / len(random_clients))
# 测试集进行测试
run_global_test(client, global_vars, test_num=600,i=ep,sheet=sheet)#将结果写入到excel中
workbook.save('加噪scale={}结果.xls'.format(scale))
#### FINAL TEST ####
#run_global_test(client, global_vars, test_num=10000)
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
26110,
408,
15886,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
3166,
12477,
1053,
315,
492,
1237,
13,
5215,
921,
29880,
14554,
13,
5215,
12655,
408,
7442,
13,
13,
13,
1753,
330,
17019,
29918,
1217,
895,
29898,
2080,
29892,
4172,
29892,
4645,
29918,
333,
29892,
9855,
29892,
29926,
1125,
13,
1678,
3309,
353,
7431,
29898,
2080,
29897,
13,
1678,
2533,
29922,
29900,
13,
1678,
363,
474,
297,
3464,
29898,
2848,
1125,
13,
4706,
2752,
353,
1881,
29961,
29875,
1822,
8552,
580,
13,
4706,
396,
1217,
895,
29922,
15886,
29889,
8172,
29918,
8945,
29898,
12181,
29922,
13264,
29889,
12181,
29898,
2080,
29961,
29875,
11724,
12676,
29922,
29900,
29889,
29900,
29892,
4172,
3359,
29922,
4172,
29892,
29881,
1853,
29922,
13264,
29889,
7411,
29941,
29906,
29897,
13,
4706,
11462,
353,
7442,
29889,
8172,
29889,
8945,
29898,
2029,
29922,
29900,
29889,
29900,
29892,
7052,
29922,
4172,
29892,
2311,
29922,
2080,
29961,
29875,
1822,
12181,
29897,
13,
4706,
1881,
29961,
29875,
29962,
4619,
11462,
13,
4706,
1320,
353,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
4993,
29899,
2080,
29961,
29875,
2314,
13,
4706,
2533,
23661,
5721,
13,
1678,
6588,
353,
2533,
29914,
2848,
13,
1678,
9869,
29889,
3539,
29898,
29926,
29892,
4645,
29918,
333,
29892,
12483,
482,
29897,
13,
1678,
736,
1881,
13,
13,
1753,
2048,
29907,
492,
1237,
29898,
1949,
1125,
13,
1678,
6509,
29918,
10492,
353,
29871,
29900,
29889,
29900,
29900,
29900,
29945,
29937,
29900,
29889,
29900,
29900,
29900,
29906,
13,
1678,
954,
29918,
2080,
353,
29871,
29941,
29906,
29871,
396,
1967,
8267,
29901,
29871,
29941,
29906,
29930,
29941,
29906,
13,
1678,
954,
29918,
2080,
29918,
12719,
353,
29871,
29941,
29871,
396,
1967,
8242,
29901,
29871,
29941,
13,
1678,
954,
29918,
13203,
353,
29871,
29896,
29900,
29871,
396,
315,
361,
279,
29899,
29896,
29900,
3001,
4413,
313,
29900,
29899,
29929,
13340,
29897,
13,
13,
1678,
396,
31086,
30742,
30287,
30495,
30354,
31180,
30210,
11303,
1237,
13,
1678,
736,
315,
492,
1237,
29898,
2080,
29918,
12181,
11759,
8516,
29892,
954,
29918,
2080,
29892,
954,
29918,
2080,
29892,
954,
29918,
2080,
29918,
12719,
1402,
13,
462,
29871,
954,
29918,
13203,
29922,
1949,
29918,
13203,
29892,
13,
462,
29871,
6509,
29918,
10492,
29922,
21891,
29918,
10492,
29892,
13,
462,
29871,
13154,
29918,
1949,
29922,
1949,
29897,
13,
13,
1753,
1065,
29918,
10945,
29918,
1688,
29898,
4645,
29892,
5534,
29918,
16908,
29892,
1243,
29918,
1949,
29892,
474,
29892,
4078,
29922,
8824,
29892,
9855,
29922,
8516,
1125,
13,
1678,
396,
31851,
31787,
31573,
30544,
5753,
30503,
6758,
13,
1678,
3132,
29889,
842,
29918,
10945,
29918,
16908,
29898,
10945,
29918,
16908,
29897,
13,
1678,
1035,
29892,
6410,
353,
3132,
29889,
3389,
29918,
1688,
29898,
1688,
29918,
1949,
29892,
7620,
29897,
13,
1678,
9869,
29889,
3539,
29898,
29875,
29892,
29900,
29892,
7411,
29898,
5753,
876,
13,
1678,
9869,
29889,
3539,
29898,
29875,
29892,
29896,
29892,
7411,
29898,
6758,
876,
13,
1678,
1596,
703,
29961,
1022,
2878,
24335,
6571,
832,
29962,
4321,
292,
319,
4174,
29901,
12365,
29889,
29946,
29888,
1118,
365,
2209,
29901,
12365,
29889,
29946,
29888,
29913,
1642,
4830,
29898,
13,
4706,
9358,
718,
29871,
29896,
29892,
1243,
29918,
1949,
29892,
1035,
29892,
6410,
876,
13,
13,
19529,
267,
353,
518,
29900,
29889,
29900,
29900,
29900,
29945,
29892,
29900,
29889,
29900,
29945,
29892,
29900,
29889,
29906,
29962,
13,
1454,
6287,
297,
23431,
29901,
13,
1678,
24492,
3919,
29918,
23207,
353,
29871,
29946,
396,
31915,
31229,
234,
174,
178,
30354,
31180,
13,
1678,
14550,
30682,
232,
179,
160,
31787,
31100,
30528,
31419,
31507,
30210,
31915,
31229,
234,
174,
178,
12008,
13,
1678,
24492,
3919,
29918,
29934,
1299,
5971,
29918,
13171,
29918,
1672,
18783,
353,
29871,
29900,
29889,
29945,
396,
31951,
235,
192,
177,
233,
143,
148,
31333,
30210,
11303,
1237,
30210,
31419,
31507,
13,
1678,
21502,
305,
353,
29871,
29906,
29953,
29900,
13,
13,
1678,
3191,
14602,
24492,
3919,
5300,
11247,
3035,
27640,
8127,
29911,
3191,
13,
1678,
3132,
353,
2048,
29907,
492,
1237,
29898,
27205,
3919,
29918,
23207,
29897,
13,
13,
1678,
664,
2909,
353,
921,
29880,
14554,
29889,
26501,
580,
13,
1678,
9869,
29922,
1287,
2909,
29889,
1202,
29918,
9855,
877,
29900,
29889,
29900,
29900,
29900,
29906,
1495,
13,
1678,
3191,
22815,
323,
4717,
1177,
4214,
3191,
13,
1678,
9869,
29906,
353,
664,
2909,
29889,
1202,
29918,
9855,
877,
233,
175,
170,
30607,
235,
186,
160,
234,
169,
190,
1495,
13,
13,
1678,
5534,
29918,
16908,
353,
3132,
29889,
657,
29918,
4645,
29918,
16908,
580,
13,
1678,
363,
9358,
297,
3464,
29898,
1022,
2878,
1125,
13,
4706,
396,
31997,
30893,
4645,
234,
174,
178,
30210,
31125,
30354,
13,
4706,
3132,
29918,
16908,
29918,
2083,
353,
6213,
13,
13,
4706,
396,
29871,
236,
157,
146,
31429,
233,
143,
148,
31333,
4645,
235,
177,
176,
234,
190,
134,
13,
4706,
4036,
29918,
11303,
1237,
353,
3132,
29889,
21803,
29918,
11303,
1237,
29898,
27205,
3919,
29918,
29934,
1299,
5971,
29918,
13171,
29918,
1672,
18783,
29897,
13,
13,
4706,
396,
260,
29939,
18933,
31542,
30858,
31174,
30898,
31217,
13,
4706,
363,
3132,
29918,
333,
297,
260,
29939,
18933,
29898,
8172,
29918,
11303,
1237,
29892,
408,
18869,
29922,
5574,
1125,
13,
9651,
396,
30998,
344,
369,
234,
174,
178,
31382,
30883,
30666,
31526,
30780,
29873,
29939,
18933,
30429,
13,
9651,
3132,
29889,
842,
29918,
10945,
29918,
16908,
29898,
10945,
29918,
16908,
29897,
13,
13,
9651,
396,
29871,
235,
177,
176,
234,
190,
134,
30810,
30502,
30557,
30746,
30210,
4645,
13,
9651,
3132,
29889,
14968,
29918,
1022,
2878,
29898,
25232,
29922,
4645,
29918,
333,
29897,
13,
13,
9651,
396,
29871,
31024,
30683,
30948,
30658,
4645,
30210,
31462,
31180,
30959,
13,
9651,
1857,
29918,
4645,
29918,
16908,
29918,
12324,
353,
3132,
29889,
657,
29918,
4645,
29918,
16908,
580,
13,
13,
9651,
396,
31024,
31050,
31125,
30354,
30822,
30847,
30528,
31824,
30868,
232,
156,
173,
232,
166,
179,
13,
9651,
1857,
29918,
4645,
29918,
16908,
29922,
29887,
17019,
29918,
1217,
895,
29898,
3784,
29918,
4645,
29918,
16908,
29918,
12324,
29892,
7052,
29892,
4645,
29918,
333,
29892,
9855,
29906,
29892,
1022,
29897,
13,
13,
9651,
396,
29871,
232,
146,
163,
30666,
232,
147,
135,
232,
180,
133,
31125,
30354,
13,
9651,
565,
3132,
29918,
16908,
29918,
2083,
338,
6213,
29901,
13,
18884,
3132,
29918,
16908,
29918,
2083,
353,
1857,
29918,
4645,
29918,
16908,
13,
9651,
1683,
29901,
13,
18884,
363,
13850,
29892,
274,
11023,
297,
14319,
29898,
4645,
29918,
16908,
29918,
2083,
29892,
1857,
29918,
4645,
29918,
16908,
1125,
13,
462,
1678,
13850,
4619,
274,
11023,
13,
13,
4706,
396,
4017,
278,
1029,
29887,
24987,
408,
5534,
24987,
13,
4706,
5534,
29918,
16908,
353,
5159,
13,
4706,
363,
722,
297,
3132,
29918,
16908,
29918,
2083,
29901,
13,
9651,
5534,
29918,
16908,
29889,
4397,
29898,
1707,
847,
7431,
29898,
8172,
29918,
11303,
1237,
876,
13,
13,
4706,
396,
29871,
31851,
31787,
30893,
31174,
30448,
31851,
31787,
13,
4706,
1065,
29918,
10945,
29918,
1688,
29898,
4645,
29892,
5534,
29918,
16908,
29892,
1243,
29918,
1949,
29922,
29953,
29900,
29900,
29892,
29875,
29922,
1022,
29892,
9855,
29922,
9855,
29897,
29937,
30998,
31320,
30801,
31479,
30752,
30780,
24633,
30275,
13,
1678,
664,
2909,
29889,
7620,
877,
30666,
232,
156,
173,
7052,
3790,
29913,
31320,
30801,
29889,
20267,
4286,
4830,
29898,
7052,
876,
13,
1678,
3191,
383,
1177,
1964,
17067,
1254,
3191,
13,
1678,
396,
3389,
29918,
10945,
29918,
1688,
29898,
4645,
29892,
5534,
29918,
16908,
29892,
1243,
29918,
1949,
29922,
29896,
29900,
29900,
29900,
29900,
29897,
13,
2
] |
split_image_4_quad.py
|
Karthik-Suresh93/fpn_visdrone
| 11 |
66619
|
<gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 1 19:34:51 2018
@author: karthik
"""
import cv2
import os
import csv
PATH_IMAGE = "./JPEGImages/"
PATH_annot = "./annotations_car_only_txt/"
PATH_IMAGE_4 = "./JPEGImages_split_5000_0.15/"
PATH_ANNOT_4 = "./Annotations_split_5000_0.15/"
def divide_img_into_two_vertically(img, overlap_w):
"""
overlap_w: amount of overlap expressed as fraction of half the width of the image. or width of half a horizontally cut portion
"""
height, width = img.shape[:2]
# Let's get the starting pixel coordiantes (top left of cropped top)
start_row, start_col = int(0), int(0)
# Let's get the ending pixel coordinates (bottom right of cropped top)
end_row, end_col = int(height), int(width*0.5 + overlap_w*width*0.5)
cropped_left = img[start_row:end_row , start_col:end_col]
# Let's get the starting pixel coordiantes (top left of cropped bottom)
start_row, start_col = int(0), int(width*0.5) #next half is not affected by overlap
# Let's get the ending pixel coordinates (bottom right of cropped bottom)
end_row, end_col = int(height), int(width)
cropped_right = img[start_row:end_row , start_col:end_col]
return(cropped_left, cropped_right)
def divide_img_into_two_horizontally(img, overlap_h):
height, width = img.shape[:2]
# Let's get the starting pixel coordiantes (top left of cropped top)
start_row, start_col = int(0), int(0)
# Let's get the ending pixel coordinates (bottom right of cropped top)
end_row, end_col = int(height*0.5 + overlap_h*0.5*height), int(width)
cropped_left = img[start_row:end_row , start_col:end_col]
# Let's get the starting pixel coordiantes (top left of cropped bottom)
start_row, start_col = int(height*0.5), int(0)
# Let's get the ending pixel coordinates (bottom right of cropped bottom)
end_row, end_col = int(height), int(width)
cropped_right = img[start_row:end_row , start_col:end_col]
return(cropped_left, cropped_right)
count_separated_anno=0
count_all_anno=0
def divide_img_into_four_overlap(img, overlap_w = 0.15, overlap_h = 0.15):
l,r = divide_img_into_two_vertically(img, overlap_w)
q1, q2 = divide_img_into_two_horizontally(l, overlap_h)
q3, q4 = divide_img_into_two_horizontally(r, overlap_h)
return q1,q2,q3,q4
# image_name = (str(os.listdir(PATH_IMAGE)[1]))
# image = cv2.imread(PATH_IMAGE+ image_name)
# q1,q2,q3,q4 = divide_img_into_four_overlap(image, overlap_w = 0, overlap_h = 0)
# cv2.imwrite("./q1.jpg", q1)
# cv2.imwrite("./q2.jpg", q2)
# cv2.imwrite("./q3.jpg", q3)
# cv2.imwrite("./q4.jpg", q4)
def adjust_annotations(image_name, img, overlap_h=0.15, overlap_w=0.15):
with open(PATH_annot + image_name.split(".")[0]+".txt") as f:
lines = f.readlines()
for line in lines:
bbox = line.split(",")[0:4]
[score, category, truncation, occlusion] = line.split(",")[4:8]
assert int(category)<10, image_name
xmin = int(bbox[0])
ymin = int(bbox[1])
xmax = int(bbox[2]) +xmin
ymax = int(bbox[3]) +ymin
assert xmin<xmax, "xmin>xmax!"
assert ymin<ymax, "ymin>ymax!"
h,w = img.shape[:2]
overlap_adjust_w = 0.5*overlap_w*w
overlap_adjust_h = 0.5*overlap_h*h
#quadrant 1: left, top
#annotations remain the same
if ymax < h/2+overlap_adjust_h and xmax < w/2+overlap_adjust_w:
full_line = [xmin, ymin, xmax-xmin, ymax-ymin, int(score), int(category),int(truncation), int(occlusion)]
with open(PATH_ANNOT_4+image_name.split(".")[0]+"_1"+".txt", "a+") as f1:
wr = csv.writer(f1)
wr.writerow(full_line)
#quadrant 2: left, bottom
elif xmax < w/2+overlap_adjust_w and ymin >h/2:
ymax = ymax - h/2
ymin = ymin - h/2
full_line = [xmin, ymin, xmax-xmin, ymax-ymin, int(score), int(category),int(truncation), int(occlusion)]
with open(PATH_ANNOT_4+image_name.split(".")[0]+"_2"+".txt", "a+") as f2:
wr = csv.writer(f2)
wr.writerow(full_line)
#quadrant 3: right, top
elif xmin >w/2 and ymax < h/2 +overlap_adjust_h:
xmin = xmin - w/2
xmax = xmax - w/2
full_line = [xmin, ymin, xmax-xmin, ymax-ymin, int(score), int(category),int(truncation), int(occlusion)]
with open(PATH_ANNOT_4+image_name.split(".")[0]+"_3"+".txt", "a+") as f3:
wr = csv.writer(f3)
wr.writerow(full_line)
#quadrant 4: right, bottom
elif ymin > h/2 and xmin > w/2:
ymin = ymin - h/2
ymax = ymax - h/2
xmin = xmin - w/2
xmax = xmax - w/2
full_line = [xmin, ymin, xmax-xmin, ymax-ymin, int(score), int(category),int(truncation), int(occlusion)]
with open(PATH_ANNOT_4+image_name.split(".")[0]+"_4"+".txt", "a+") as f4:
wr = csv.writer(f4)
wr.writerow(full_line)
else:
#print ("bb is in none of the quadrants!")
pass
if __name__ == "__main__":
for image_name in os.listdir(PATH_IMAGE):
image = cv2.imread(PATH_IMAGE+image_name)
#print(image.shape)
# cs, ca= adjust_annotations(image_name, image,overlap=0.40)
# l,r = divide_img_into_two(image)
# one, two = divide_img_into_two(l)
# three, four = divide_img_into_two(r)
# one,two,three,four = divide_img_into_four_with_overlap(image, overlap_amount = 0.40)
o_h = 0.15; o_w = 0.15 #SET OVERLAPS ALONG HEIGHT AND WIDTH RESPECTIVELY...
q1,q2,q3,q4 = divide_img_into_four_overlap(image, overlap_h = o_h, overlap_w = o_w)
cv2.imwrite(PATH_IMAGE_4+image_name.split(".")[0]+"_1"+".jpg", q1)
cv2.imwrite(PATH_IMAGE_4+image_name.split(".")[0]+"_2"+".jpg", q2)
cv2.imwrite(PATH_IMAGE_4+image_name.split(".")[0]+"_3"+".jpg", q3)
cv2.imwrite(PATH_IMAGE_4+image_name.split(".")[0]+"_4"+".jpg", q4)
adjust_annotations(image_name, image, overlap_h = o_h, overlap_w = o_w)
#import matplotlib.pyplot as plt
#plt.plot(list(range(12)), [class_list_original.count(i) for i in range(12)], color="b")
#plt.plot(list(range(12)), [class_list_40.count(i) for i in range(12)], color="g")
#
#plt.show()
|
[
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
30004,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
30004,
13,
15945,
19451,
13,
20399,
373,
11169,
8378,
259,
29896,
29871,
29896,
29929,
29901,
29941,
29946,
29901,
29945,
29896,
29871,
29906,
29900,
29896,
29947,
30004,
13,
29992,
8921,
29901,
10856,
386,
638,
30004,
13,
15945,
19451,
13,
5215,
13850,
29906,
30004,
13,
5215,
2897,
30004,
13,
5215,
11799,
30004,
13,
10145,
29918,
2382,
353,
376,
6904,
29967,
4162,
29954,
20163,
12975,
30004,
13,
10145,
29918,
6735,
353,
376,
6904,
6735,
800,
29918,
4287,
29918,
6194,
29918,
3945,
12975,
30004,
13,
10145,
29918,
2382,
29918,
29946,
353,
376,
6904,
29967,
4162,
29954,
20163,
29918,
5451,
29918,
29945,
29900,
29900,
29900,
29918,
29900,
29889,
29896,
29945,
12975,
30004,
13,
30004,
13,
30004,
13,
10145,
29918,
2190,
12256,
29918,
29946,
353,
376,
6904,
2744,
1333,
800,
29918,
5451,
29918,
29945,
29900,
29900,
29900,
29918,
29900,
29889,
29896,
29945,
12975,
30004,
13,
30004,
13,
1753,
16429,
29918,
2492,
29918,
8941,
29918,
10184,
29918,
1765,
1711,
29898,
2492,
29892,
25457,
29918,
29893,
1125,
30004,
13,
30004,
13,
1678,
9995,
30004,
13,
1678,
25457,
29918,
29893,
29901,
5253,
310,
25457,
13384,
408,
15958,
310,
4203,
278,
2920,
310,
278,
1967,
29889,
470,
2920,
310,
4203,
263,
4029,
6753,
635,
5700,
11910,
30004,
13,
1678,
9995,
30004,
13,
1678,
3171,
29892,
2920,
353,
10153,
29889,
12181,
7503,
29906,
29962,
1678,
6756,
13,
1678,
396,
2803,
29915,
29879,
679,
278,
6257,
15526,
29311,
29875,
3794,
313,
3332,
2175,
310,
8182,
2986,
2246,
8443,
13,
1678,
1369,
29918,
798,
29892,
1369,
29918,
1054,
353,
938,
29898,
29900,
511,
938,
29898,
29900,
8443,
13,
1678,
396,
2803,
29915,
29879,
679,
278,
17140,
15526,
10350,
313,
8968,
1492,
310,
8182,
2986,
2246,
8443,
13,
1678,
1095,
29918,
798,
29892,
1095,
29918,
1054,
353,
938,
29898,
3545,
511,
938,
29898,
2103,
29930,
29900,
29889,
29945,
718,
25457,
29918,
29893,
29930,
2103,
29930,
29900,
29889,
29945,
8443,
13,
1678,
8182,
2986,
29918,
1563,
353,
10153,
29961,
2962,
29918,
798,
29901,
355,
29918,
798,
1919,
1369,
29918,
1054,
29901,
355,
29918,
1054,
29962,
539,
6756,
13,
1678,
396,
2803,
29915,
29879,
679,
278,
6257,
15526,
29311,
29875,
3794,
313,
3332,
2175,
310,
8182,
2986,
5970,
8443,
13,
1678,
1369,
29918,
798,
29892,
1369,
29918,
1054,
353,
938,
29898,
29900,
511,
938,
29898,
2103,
29930,
29900,
29889,
29945,
29897,
259,
396,
4622,
4203,
338,
451,
15201,
491,
25457,
30004,
13,
1678,
396,
2803,
29915,
29879,
679,
278,
17140,
15526,
10350,
313,
8968,
1492,
310,
8182,
2986,
5970,
8443,
13,
1678,
1095,
29918,
798,
29892,
1095,
29918,
1054,
353,
938,
29898,
3545,
511,
938,
29898,
2103,
8443,
13,
1678,
8182,
2986,
29918,
1266,
353,
10153,
29961,
2962,
29918,
798,
29901,
355,
29918,
798,
1919,
1369,
29918,
1054,
29901,
355,
29918,
1054,
29962,
1678,
6756,
13,
1678,
736,
29898,
24077,
2986,
29918,
1563,
29892,
8182,
2986,
29918,
1266,
8443,
13,
30004,
13,
1753,
16429,
29918,
2492,
29918,
8941,
29918,
10184,
29918,
2015,
6753,
635,
29898,
2492,
29892,
25457,
29918,
29882,
1125,
30004,
13,
1678,
6756,
13,
1678,
3171,
29892,
2920,
353,
10153,
29889,
12181,
7503,
29906,
29962,
259,
6756,
13,
1678,
396,
2803,
29915,
29879,
679,
278,
6257,
15526,
29311,
29875,
3794,
313,
3332,
2175,
310,
8182,
2986,
2246,
8443,
13,
1678,
1369,
29918,
798,
29892,
1369,
29918,
1054,
353,
938,
29898,
29900,
511,
938,
29898,
29900,
8443,
13,
1678,
396,
2803,
29915,
29879,
679,
278,
17140,
15526,
10350,
313,
8968,
1492,
310,
8182,
2986,
2246,
8443,
13,
1678,
1095,
29918,
798,
29892,
1095,
29918,
1054,
353,
938,
29898,
3545,
29930,
29900,
29889,
29945,
718,
25457,
29918,
29882,
29930,
29900,
29889,
29945,
29930,
3545,
511,
938,
29898,
2103,
8443,
13,
1678,
8182,
2986,
29918,
1563,
353,
10153,
29961,
2962,
29918,
798,
29901,
355,
29918,
798,
1919,
1369,
29918,
1054,
29901,
355,
29918,
1054,
29962,
1678,
6756,
13,
1678,
6756,
13,
1678,
396,
2803,
29915,
29879,
679,
278,
6257,
15526,
29311,
29875,
3794,
313,
3332,
2175,
310,
8182,
2986,
5970,
8443,
13,
1678,
1369,
29918,
798,
29892,
1369,
29918,
1054,
353,
938,
29898,
3545,
29930,
29900,
29889,
29945,
511,
938,
29898,
29900,
8443,
13,
1678,
396,
2803,
29915,
29879,
679,
278,
17140,
15526,
10350,
313,
8968,
1492,
310,
8182,
2986,
5970,
8443,
13,
1678,
1095,
29918,
798,
29892,
1095,
29918,
1054,
353,
938,
29898,
3545,
511,
938,
29898,
2103,
8443,
13,
1678,
8182,
2986,
29918,
1266,
353,
10153,
29961,
2962,
29918,
798,
29901,
355,
29918,
798,
1919,
1369,
29918,
1054,
29901,
355,
29918,
1054,
29962,
1678,
6756,
13,
1678,
736,
29898,
24077,
2986,
29918,
1563,
29892,
8182,
2986,
29918,
1266,
8443,
13,
1678,
6756,
13,
2798,
29918,
25048,
630,
29918,
7665,
29922,
29900,
30004,
13,
2798,
29918,
497,
29918,
7665,
29922,
29900,
30004,
13,
30004,
13,
1753,
16429,
29918,
2492,
29918,
8941,
29918,
17823,
29918,
957,
6984,
29898,
2492,
29892,
25457,
29918,
29893,
353,
29871,
29900,
29889,
29896,
29945,
29892,
25457,
29918,
29882,
353,
29871,
29900,
29889,
29896,
29945,
1125,
30004,
13,
30004,
13,
1678,
301,
29892,
29878,
353,
16429,
29918,
2492,
29918,
8941,
29918,
10184,
29918,
1765,
1711,
29898,
2492,
29892,
25457,
29918,
29893,
8443,
13,
1678,
3855,
29896,
29892,
3855,
29906,
353,
16429,
29918,
2492,
29918,
8941,
29918,
10184,
29918,
2015,
6753,
635,
29898,
29880,
29892,
25457,
29918,
29882,
8443,
13,
1678,
3855,
29941,
29892,
3855,
29946,
353,
16429,
29918,
2492,
29918,
8941,
29918,
10184,
29918,
2015,
6753,
635,
29898,
29878,
29892,
25457,
29918,
29882,
8443,
13,
30004,
13,
1678,
736,
3855,
29896,
29892,
29939,
29906,
29892,
29939,
29941,
29892,
29939,
29946,
30004,
13,
30004,
13,
29937,
1967,
29918,
978,
353,
29871,
313,
710,
29898,
359,
29889,
1761,
3972,
29898,
10145,
29918,
2382,
9601,
29896,
12622,
30004,
13,
29937,
1967,
353,
29871,
13850,
29906,
29889,
326,
949,
29898,
10145,
29918,
2382,
29974,
1967,
29918,
978,
8443,
13,
29937,
3855,
29896,
29892,
29939,
29906,
29892,
29939,
29941,
29892,
29939,
29946,
353,
16429,
29918,
2492,
29918,
8941,
29918,
17823,
29918,
957,
6984,
29898,
3027,
29892,
25457,
29918,
29893,
353,
29871,
29900,
29892,
25457,
29918,
29882,
353,
29871,
29900,
8443,
13,
29937,
13850,
29906,
29889,
326,
3539,
703,
6904,
29939,
29896,
29889,
6173,
613,
3855,
29896,
8443,
13,
29937,
13850,
29906,
29889,
326,
3539,
703,
6904,
29939,
29906,
29889,
6173,
613,
3855,
29906,
8443,
13,
29937,
13850,
29906,
29889,
326,
3539,
703,
6904,
29939,
29941,
29889,
6173,
613,
3855,
29941,
8443,
13,
29937,
13850,
29906,
29889,
326,
3539,
703,
6904,
29939,
29946,
29889,
6173,
613,
3855,
29946,
8443,
13,
30004,
13,
1753,
10365,
29918,
6735,
800,
29898,
3027,
29918,
978,
29892,
10153,
29892,
25457,
29918,
29882,
29922,
29900,
29889,
29896,
29945,
29892,
25457,
29918,
29893,
29922,
29900,
29889,
29896,
29945,
1125,
30004,
13,
1678,
6756,
13,
1678,
411,
1722,
29898,
10145,
29918,
6735,
718,
1967,
29918,
978,
29889,
5451,
17350,
1159,
29961,
29900,
10062,
1642,
3945,
1159,
408,
285,
29901,
30004,
13,
4706,
3454,
353,
285,
29889,
949,
9012,
26471,
13,
4706,
363,
1196,
297,
3454,
29901,
30004,
13,
9651,
289,
1884,
353,
1196,
29889,
5451,
28165,
1159,
29961,
29900,
29901,
29946,
29962,
30004,
13,
9651,
518,
13628,
29892,
7663,
29892,
21022,
362,
29892,
2179,
29880,
3958,
29962,
353,
1196,
29889,
5451,
28165,
1159,
29961,
29946,
29901,
29947,
29962,
30004,
13,
9651,
4974,
938,
29898,
7320,
29897,
29966,
29896,
29900,
29892,
1967,
29918,
978,
30004,
13,
9651,
921,
1195,
353,
938,
29898,
29890,
1884,
29961,
29900,
2314,
30004,
13,
9651,
343,
1195,
353,
938,
29898,
29890,
1884,
29961,
29896,
2314,
30004,
13,
9651,
921,
3317,
353,
938,
29898,
29890,
1884,
29961,
29906,
2314,
718,
29916,
1195,
30004,
13,
9651,
343,
3317,
353,
938,
29898,
29890,
1884,
29961,
29941,
2314,
718,
962,
262,
30004,
13,
30004,
13,
9651,
4974,
921,
1195,
29966,
29916,
3317,
29892,
376,
29916,
1195,
29958,
29916,
3317,
3850,
30004,
13,
9651,
4974,
343,
1195,
29966,
29891,
3317,
29892,
376,
962,
262,
29958,
29891,
3317,
3850,
30004,
13,
30004,
13,
9651,
298,
29892,
29893,
353,
10153,
29889,
12181,
7503,
29906,
29962,
30004,
13,
9651,
25457,
29918,
328,
5143,
29918,
29893,
353,
29871,
29900,
29889,
29945,
29930,
957,
6984,
29918,
29893,
29930,
29893,
30004,
13,
9651,
25457,
29918,
328,
5143,
29918,
29882,
353,
29871,
29900,
29889,
29945,
29930,
957,
6984,
29918,
29882,
29930,
29882,
30004,
13,
9651,
396,
3425,
21867,
29871,
29896,
29901,
2175,
29892,
2246,
30004,
13,
9651,
396,
6735,
800,
3933,
278,
1021,
30004,
13,
9651,
565,
343,
3317,
529,
298,
29914,
29906,
29974,
957,
6984,
29918,
328,
5143,
29918,
29882,
322,
921,
3317,
529,
281,
29914,
29906,
29974,
957,
6984,
29918,
328,
5143,
29918,
29893,
29901,
30004,
13,
18884,
6756,
13,
18884,
2989,
29918,
1220,
353,
518,
29916,
1195,
29892,
343,
1195,
29892,
921,
3317,
29899,
29916,
1195,
29892,
343,
3317,
29899,
962,
262,
29892,
938,
29898,
13628,
511,
938,
29898,
7320,
511,
524,
29898,
509,
4661,
362,
511,
938,
29898,
542,
10085,
4638,
30004,
13,
18884,
411,
1722,
29898,
10145,
29918,
2190,
12256,
29918,
29946,
29974,
3027,
29918,
978,
29889,
5451,
17350,
1159,
29961,
29900,
10062,
29908,
29918,
29896,
17969,
1642,
3945,
613,
376,
29874,
29974,
1159,
408,
285,
29896,
29901,
30004,
13,
462,
1678,
2358,
353,
11799,
29889,
13236,
29898,
29888,
29896,
8443,
13,
462,
1678,
2358,
29889,
13236,
340,
29898,
8159,
29918,
1220,
8443,
13,
30004,
13,
9651,
396,
3425,
21867,
29871,
29906,
29901,
2175,
29892,
5970,
30004,
13,
30004,
13,
9651,
25342,
921,
3317,
529,
281,
29914,
29906,
29974,
957,
6984,
29918,
328,
5143,
29918,
29893,
322,
343,
1195,
1405,
29882,
29914,
29906,
29901,
30004,
13,
18884,
343,
3317,
353,
343,
3317,
448,
298,
29914,
29906,
30004,
13,
18884,
343,
1195,
353,
343,
1195,
448,
298,
29914,
29906,
30004,
13,
18884,
2989,
29918,
1220,
353,
518,
29916,
1195,
29892,
343,
1195,
29892,
921,
3317,
29899,
29916,
1195,
29892,
343,
3317,
29899,
962,
262,
29892,
938,
29898,
13628,
511,
938,
29898,
7320,
511,
524,
29898,
509,
4661,
362,
511,
938,
29898,
542,
10085,
4638,
30004,
13,
18884,
411,
1722,
29898,
10145,
29918,
2190,
12256,
29918,
29946,
29974,
3027,
29918,
978,
29889,
5451,
17350,
1159,
29961,
29900,
10062,
29908,
29918,
29906,
17969,
1642,
3945,
613,
376,
29874,
29974,
1159,
408,
285,
29906,
29901,
30004,
13,
462,
1678,
2358,
353,
11799,
29889,
13236,
29898,
29888,
29906,
8443,
13,
462,
1678,
2358,
29889,
13236,
340,
29898,
8159,
29918,
1220,
8443,
13,
9651,
396,
3425,
21867,
29871,
29941,
29901,
1492,
29892,
2246,
30004,
13,
30004,
13,
9651,
25342,
921,
1195,
1405,
29893,
29914,
29906,
322,
343,
3317,
529,
298,
29914,
29906,
718,
957,
6984,
29918,
328,
5143,
29918,
29882,
29901,
30004,
13,
18884,
921,
1195,
353,
921,
1195,
448,
281,
29914,
29906,
30004,
13,
18884,
921,
3317,
353,
921,
3317,
448,
281,
29914,
29906,
30004,
13,
18884,
2989,
29918,
1220,
353,
518,
29916,
1195,
29892,
343,
1195,
29892,
921,
3317,
29899,
29916,
1195,
29892,
343,
3317,
29899,
962,
262,
29892,
938,
29898,
13628,
511,
938,
29898,
7320,
511,
524,
29898,
509,
4661,
362,
511,
938,
29898,
542,
10085,
4638,
30004,
13,
18884,
411,
1722,
29898,
10145,
29918,
2190,
12256,
29918,
29946,
29974,
3027,
29918,
978,
29889,
5451,
17350,
1159,
29961,
29900,
10062,
29908,
29918,
29941,
17969,
1642,
3945,
613,
376,
29874,
29974,
1159,
408,
285,
29941,
29901,
30004,
13,
462,
1678,
2358,
353,
11799,
29889,
13236,
29898,
29888,
29941,
8443,
13,
462,
1678,
2358,
29889,
13236,
340,
29898,
8159,
29918,
1220,
8443,
13,
30004,
13,
9651,
396,
3425,
21867,
29871,
29946,
29901,
1492,
29892,
5970,
30004,
13,
9651,
25342,
343,
1195,
1405,
298,
29914,
29906,
322,
921,
1195,
1405,
281,
29914,
29906,
29901,
30004,
13,
18884,
343,
1195,
353,
343,
1195,
448,
298,
29914,
29906,
30004,
13,
18884,
343,
3317,
353,
343,
3317,
448,
298,
29914,
29906,
30004,
13,
18884,
921,
1195,
353,
921,
1195,
448,
281,
29914,
29906,
30004,
13,
18884,
921,
3317,
353,
921,
3317,
448,
281,
29914,
29906,
30004,
13,
18884,
2989,
29918,
1220,
353,
518,
29916,
1195,
29892,
343,
1195,
29892,
921,
3317,
29899,
29916,
1195,
29892,
343,
3317,
29899,
962,
262,
29892,
938,
29898,
13628,
511,
938,
29898,
7320,
511,
524,
29898,
509,
4661,
362,
511,
938,
29898,
542,
10085,
4638,
30004,
13,
18884,
411,
1722,
29898,
10145,
29918,
2190,
12256,
29918,
29946,
29974,
3027,
29918,
978,
29889,
5451,
17350,
1159,
29961,
29900,
10062,
29908,
29918,
29946,
17969,
1642,
3945,
613,
376,
29874,
29974,
1159,
408,
285,
29946,
29901,
30004,
13,
462,
1678,
2358,
353,
11799,
29889,
13236,
29898,
29888,
29946,
8443,
13,
462,
1678,
2358,
29889,
13236,
340,
29898,
8159,
29918,
1220,
8443,
13,
30004,
13,
9651,
1683,
29901,
30004,
13,
18884,
396,
2158,
4852,
1327,
338,
297,
5642,
310,
278,
15448,
1934,
29991,
1159,
30004,
13,
18884,
1209,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
30004,
13,
1678,
363,
1967,
29918,
978,
297,
2897,
29889,
1761,
3972,
29898,
10145,
29918,
2382,
1125,
30004,
13,
4706,
1967,
353,
13850,
29906,
29889,
326,
949,
29898,
10145,
29918,
2382,
29974,
3027,
29918,
978,
8443,
13,
4706,
396,
2158,
29898,
3027,
29889,
12181,
8443,
13,
4706,
396,
5939,
29892,
5777,
29922,
10365,
29918,
6735,
800,
29898,
3027,
29918,
978,
29892,
1967,
29892,
957,
6984,
29922,
29900,
29889,
29946,
29900,
8443,
13,
1678,
396,
1678,
301,
29892,
29878,
353,
16429,
29918,
2492,
29918,
8941,
29918,
10184,
29898,
3027,
8443,
13,
1678,
396,
1678,
697,
29892,
1023,
353,
16429,
29918,
2492,
29918,
8941,
29918,
10184,
29898,
29880,
8443,
13,
1678,
396,
1678,
2211,
29892,
3023,
353,
16429,
29918,
2492,
29918,
8941,
29918,
10184,
29898,
29878,
8443,
13,
1678,
396,
697,
29892,
10184,
29892,
17536,
29892,
17823,
353,
16429,
29918,
2492,
29918,
8941,
29918,
17823,
29918,
2541,
29918,
957,
6984,
29898,
3027,
29892,
25457,
29918,
14506,
353,
29871,
29900,
29889,
29946,
29900,
8443,
13,
4706,
288,
29918,
29882,
353,
29871,
29900,
29889,
29896,
29945,
29936,
288,
29918,
29893,
353,
29871,
29900,
29889,
29896,
29945,
396,
10490,
438,
5348,
29931,
3301,
29903,
14445,
20614,
17714,
22530,
5300,
399,
1367,
4690,
390,
2890,
4162,
1783,
5667,
6670,
29979,
856,
30004,
13,
4706,
3855,
29896,
29892,
29939,
29906,
29892,
29939,
29941,
29892,
29939,
29946,
353,
16429,
29918,
2492,
29918,
8941,
29918,
17823,
29918,
957,
6984,
29898,
3027,
29892,
25457,
29918,
29882,
353,
288,
29918,
29882,
29892,
25457,
29918,
29893,
353,
288,
29918,
29893,
8443,
13,
4706,
13850,
29906,
29889,
326,
3539,
29898,
10145,
29918,
2382,
29918,
29946,
29974,
3027,
29918,
978,
29889,
5451,
17350,
1159,
29961,
29900,
10062,
29908,
29918,
29896,
17969,
1642,
6173,
613,
3855,
29896,
8443,
13,
4706,
13850,
29906,
29889,
326,
3539,
29898,
10145,
29918,
2382,
29918,
29946,
29974,
3027,
29918,
978,
29889,
5451,
17350,
1159,
29961,
29900,
10062,
29908,
29918,
29906,
17969,
1642,
6173,
613,
3855,
29906,
8443,
13,
4706,
13850,
29906,
29889,
326,
3539,
29898,
10145,
29918,
2382,
29918,
29946,
29974,
3027,
29918,
978,
29889,
5451,
17350,
1159,
29961,
29900,
10062,
29908,
29918,
29941,
17969,
1642,
6173,
613,
3855,
29941,
8443,
13,
4706,
13850,
29906,
29889,
326,
3539,
29898,
10145,
29918,
2382,
29918,
29946,
29974,
3027,
29918,
978,
29889,
5451,
17350,
1159,
29961,
29900,
10062,
29908,
29918,
29946,
17969,
1642,
6173,
613,
3855,
29946,
8443,
13,
4706,
10365,
29918,
6735,
800,
29898,
3027,
29918,
978,
29892,
1967,
29892,
25457,
29918,
29882,
353,
288,
29918,
29882,
29892,
25457,
29918,
29893,
353,
288,
29918,
29893,
8443,
13,
1678,
6756,
13,
29937,
5215,
22889,
29889,
2272,
5317,
408,
14770,
30004,
13,
29937,
572,
29873,
29889,
5317,
29898,
1761,
29898,
3881,
29898,
29896,
29906,
8243,
518,
1990,
29918,
1761,
29918,
13492,
29889,
2798,
29898,
29875,
29897,
363,
474,
297,
3464,
29898,
29896,
29906,
29897,
1402,
2927,
543,
29890,
1159,
30004,
13,
29937,
572,
29873,
29889,
5317,
29898,
1761,
29898,
3881,
29898,
29896,
29906,
8243,
518,
1990,
29918,
1761,
29918,
29946,
29900,
29889,
2798,
29898,
29875,
29897,
363,
474,
297,
3464,
29898,
29896,
29906,
29897,
1402,
2927,
543,
29887,
1159,
30004,
13,
29937,
30004,
13,
29937,
572,
29873,
29889,
4294,
26471,
13,
2
] |
pyeem/instruments/horiba/__init__.py
|
drewmee/PyEEM
| 4 |
36675
|
<reponame>drewmee/PyEEM<filename>pyeem/instruments/horiba/__init__.py<gh_stars>1-10
from .aqualog import Aqualog
from .fluorolog import Fluorolog
name = "Horiba"
instruments = [Aqualog, Fluorolog]
|
[
1,
529,
276,
1112,
420,
29958,
29881,
3973,
17897,
29914,
19737,
29923,
12665,
29966,
9507,
29958,
2272,
29872,
331,
29914,
2611,
582,
1860,
29914,
2015,
16912,
29914,
1649,
2344,
26914,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
869,
29874,
15380,
468,
1053,
319,
15380,
468,
13,
3166,
869,
25044,
272,
1189,
1053,
2379,
29884,
272,
1189,
13,
13,
978,
353,
376,
17241,
16912,
29908,
13,
2611,
582,
1860,
353,
518,
29909,
15380,
468,
29892,
2379,
29884,
272,
1189,
29962,
13,
2
] |
Weather_Trends.py
|
dsllt/Udacity_DA_P1
| 0 |
113704
|
import pandas as pd
import matplotlib.pyplot as plt
import os
# Set working directory
os.chdir('/Users/dayanesallet/Documents/_Educação/Data Analyst Nanodegree/Weather Project/Data')
# Import data
PortoAlegre_temp = pd.read_csv('./PortoAlegre_Temperature_Data.csv')
World_temp = pd.read_csv('./World_Temperature_Data.csv')
Perth_temp = pd.read_csv('./Perth_Temperature_Data.csv')
NY_temp = pd.read_csv('./NovaYORK_Temperature_Data.csv')
Paris_temp = pd.read_csv('./Paris_Temperature_Data.csv')
# Compute moving avarage
PortoAlegre_temp_ma = PortoAlegre_temp['avg_temp'].rolling(window=7).mean()
World_temp_ma = World_temp['avg_temp'].rolling(window=7).mean()
Perth_temp_ma = Perth_temp['avg_temp'].rolling(window=7).mean()
NY_temp_ma = NY_temp['avg_temp'].rolling(window=7).mean()
Paris_temp_ma = Paris_temp['avg_temp'].rolling(window=7).mean()
# Insert new column in the dataframe with the computed moving avareges
PortoAlegre_temp.insert(4,'7-year Moving Avarage', PortoAlegre_temp_ma)
World_temp.insert(2,'7-year Moving Avarage', World_temp_ma)
Perth_temp.insert(2,'7-year Moving Avarage', Perth_temp_ma)
NY_temp.insert(2,'7-year Moving Avarage', NY_temp_ma)
Paris_temp.insert(2,'7-year Moving Avarage', Paris_temp_ma)
# Verify NaN values
PortoAlegre_temp['7-year Moving Avarage'].isnull().any()
PortoAlegre_temp['7-year Moving Avarage'].isnull().sum()
World_temp['7-year Moving Avarage'].isnull().any()
World_temp['7-year Moving Avarage'].isnull().sum()
# Plot the data
# Moving Avarage Comparisson
plt.plot(World_temp['year'],World_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1, label = 'World')
plt.plot(PortoAlegre_temp['year'],PortoAlegre_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1, label = 'Porto Alegre')
plt.xlabel('Year')
plt.ylabel('Moving Avarege Temperature (ºC) \n 7-year window')
plt.title("Comparison of Porto Alegre and the world's \n temperature (ºC) over the years", fontweight = 'bold')
plt.axis([1838,2013,7,19.5])
plt.legend()
plt.grid(True)
plt.savefig('Moving Avarage Comparisson',dpi = 300,bbox_inches='tight')
plt.show()
# Porto Alegre mean temperature variation
plt.plot(PortoAlegre_temp['year'],PortoAlegre_temp['avg_temp'],
linestyle='-', marker='o',linewidth=2, markersize=1)
plt.xlabel('Year')
plt.ylabel('Mean Temperature (ºC)')
plt.title("Mean temperature (ºC) variation in\n Porto Alegre over the years", fontweight = 'bold')
plt.axis([1832,2013,16.5,20])
plt.grid(True)
plt.savefig('Porto Alegre mean temperature variation',dpi = 300,bbox_inches='tight')
plt.show()
# Porto Alegre moving avarage temperature variation
plt.plot(PortoAlegre_temp['year'],PortoAlegre_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1)
plt.xlabel('Year')
plt.ylabel('Moving Avarege Temperature (ºC) \n 7-year window')
plt.title("Moving avarage temperature (ºC) variation in\n Porto Alegre over the years", fontweight = 'bold')
plt.axis([1832,2013,16.5,20])
plt.grid(True)
plt.savefig('Porto Alegre moving avarage temperature variation',dpi = 300,bbox_inches='tight')
plt.show()
# World mean temperature variation
plt.plot(World_temp['year'],World_temp['avg_temp'],
linestyle='-', marker='o',linewidth=2, markersize=1)
plt.xlabel('Year')
plt.ylabel('Mean Temperature (ºC)')
plt.title("Mean temperature (ºC) variation in\n the world over the years", fontweight = 'bold')
plt.axis([1750,2013,5.5,10])
plt.grid(True)
plt.savefig('World mean temperature variation',dpi = 300,bbox_inches='tight')
plt.show()
# World moving avarage temperature variation
plt.plot(World_temp['year'],World_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1)
plt.xlabel('Year')
plt.ylabel('Moving Avarege Temperature (ºC) \n 7-year window')
plt.title("Moving avarage temperature (ºC) variation in\n the world over the years", fontweight = 'bold')
plt.axis([1750,2013,6.5,10])
plt.grid(True)
plt.savefig('World moving avarage temperature variation',dpi = 300,bbox_inches='tight')
plt.show()
# Subplot
plt.figure(figsize=(6, 4))
plt.subplot(2, 1, 1)
plt.plot(PortoAlegre_temp['year'],PortoAlegre_temp['avg_temp'],
linestyle='-', marker='o',linewidth=2, markersize=1)
plt.title("Porto Alegre mean temperature variation", fontweight = 'bold')
plt.xlabel('Year')
plt.ylabel('Avarege \n Temperature (ºC)')
plt.grid(True)
plt.subplot(2, 1, 2)
plt.plot(World_temp['year'],World_temp['avg_temp'],
linestyle='-', marker='o',linewidth=2, markersize=1)
plt.title("World mean temperature variation", fontweight = 'bold')
plt.xlabel('Year')
plt.ylabel('Avarege \n Temperature (ºC)')
plt.grid(True)
plt.tight_layout()
plt.savefig('Mean_Temp_POA_W',dpi = 300,bbox_inches='tight')
plt.show()
plt.figure(figsize=(6, 4))
plt.subplot(2, 1, 1)
plt.plot(PortoAlegre_temp['year'],PortoAlegre_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1)
plt.title("Porto Alegre moving average temperature variation", fontweight = 'bold')
plt.xlabel('Year')
plt.ylabel('Moving Avarege \n Temperature (ºC)')
plt.grid(True)
plt.subplot(2, 1, 2)
plt.plot(World_temp['year'],World_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1)
plt.title("World moving average temperature variation", fontweight = 'bold')
plt.xlabel('Year')
plt.ylabel('Moving Avarege \n Temperature (ºC)')
plt.grid(True)
plt.tight_layout()
plt.savefig('Moving_Temp_POA_W',dpi = 300,bbox_inches='tight')
plt.show()
# Additional computations for comparisson
#
avg_temp_POA = PortoAlegre_temp['avg_temp'].mean()
avg_temp_World = World_temp['avg_temp'][-len(PortoAlegre_temp['year'])-2:-2].mean()
diff_avg_temp = avg_temp_POA - avg_temp_World
PortoAlegre_temp.corrwith(World_temp[-len(PortoAlegre_temp['year'])-2:-2])
plt.plot(PortoAlegre_temp['year'],PortoAlegre_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1, label = 'Porto Alegre')
plt.plot(Perth_temp['year'],Perth_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1, label = 'Perth')
plt.plot(Paris_temp['year'],Paris_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1, label = 'Paris')
plt.plot(NY_temp['year'],NY_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1, label = 'New York')
plt.plot(World_temp['year'],World_temp['7-year Moving Avarage'],
linestyle='-', marker='o',linewidth=2, markersize=1, label = 'World')
plt.xlabel('Year')
plt.ylabel('Moving Avarege Temperature (ºC) \n 7-year window')
plt.title("Comparison of different cities and the world's \n temperature (ºC) over the years", fontweight = 'bold')
plt.axis([1838,2013,7,19.5])
plt.legend()
plt.grid(True)
plt.savefig('Multiple Cities Moving Avarage Comparisson',dpi = 300,bbox_inches='tight')
plt.show()
|
[
1,
1053,
11701,
408,
10518,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
2897,
13,
29937,
3789,
1985,
3884,
13,
359,
29889,
305,
3972,
11219,
5959,
29914,
3250,
17297,
284,
1026,
29914,
20128,
19891,
29923,
700,
29883,
562,
207,
170,
29874,
30478,
29877,
29914,
1469,
11597,
858,
25701,
356,
29887,
929,
29914,
4806,
1624,
8010,
29914,
1469,
1495,
13,
13,
29937,
16032,
848,
13,
2290,
29877,
29909,
1397,
276,
29918,
7382,
353,
10518,
29889,
949,
29918,
7638,
877,
6904,
2290,
29877,
29909,
1397,
276,
29918,
5776,
546,
1535,
29918,
1469,
29889,
7638,
1495,
13,
14058,
29918,
7382,
353,
10518,
29889,
949,
29918,
7638,
877,
6904,
14058,
29918,
5776,
546,
1535,
29918,
1469,
29889,
7638,
1495,
13,
5894,
386,
29918,
7382,
353,
10518,
29889,
949,
29918,
7638,
877,
6904,
5894,
386,
29918,
5776,
546,
1535,
29918,
1469,
29889,
7638,
1495,
13,
29940,
29979,
29918,
7382,
353,
10518,
29889,
949,
29918,
7638,
877,
6904,
29940,
4273,
29979,
1955,
29968,
29918,
5776,
546,
1535,
29918,
1469,
29889,
7638,
1495,
13,
2177,
275,
29918,
7382,
353,
10518,
29889,
949,
29918,
7638,
877,
6904,
2177,
275,
29918,
5776,
546,
1535,
29918,
1469,
29889,
7638,
1495,
13,
13,
29937,
11796,
29872,
8401,
1029,
279,
482,
13,
2290,
29877,
29909,
1397,
276,
29918,
7382,
29918,
655,
353,
24804,
29909,
1397,
276,
29918,
7382,
1839,
485,
29887,
29918,
7382,
13359,
22155,
29898,
7165,
29922,
29955,
467,
12676,
580,
13,
14058,
29918,
7382,
29918,
655,
353,
2787,
29918,
7382,
1839,
485,
29887,
29918,
7382,
13359,
22155,
29898,
7165,
29922,
29955,
467,
12676,
580,
13,
5894,
386,
29918,
7382,
29918,
655,
353,
2431,
386,
29918,
7382,
1839,
485,
29887,
29918,
7382,
13359,
22155,
29898,
7165,
29922,
29955,
467,
12676,
580,
13,
29940,
29979,
29918,
7382,
29918,
655,
353,
23526,
29918,
7382,
1839,
485,
29887,
29918,
7382,
13359,
22155,
29898,
7165,
29922,
29955,
467,
12676,
580,
13,
2177,
275,
29918,
7382,
29918,
655,
353,
3681,
29918,
7382,
1839,
485,
29887,
29918,
7382,
13359,
22155,
29898,
7165,
29922,
29955,
467,
12676,
580,
13,
13,
29937,
24505,
716,
1897,
297,
278,
12205,
411,
278,
15712,
8401,
1029,
598,
2710,
13,
2290,
29877,
29909,
1397,
276,
29918,
7382,
29889,
7851,
29898,
29946,
5501,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
742,
24804,
29909,
1397,
276,
29918,
7382,
29918,
655,
29897,
13,
14058,
29918,
7382,
29889,
7851,
29898,
29906,
5501,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
742,
2787,
29918,
7382,
29918,
655,
29897,
13,
5894,
386,
29918,
7382,
29889,
7851,
29898,
29906,
5501,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
742,
2431,
386,
29918,
7382,
29918,
655,
29897,
13,
29940,
29979,
29918,
7382,
29889,
7851,
29898,
29906,
5501,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
742,
23526,
29918,
7382,
29918,
655,
29897,
13,
2177,
275,
29918,
7382,
29889,
7851,
29898,
29906,
5501,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
742,
3681,
29918,
7382,
29918,
655,
29897,
13,
13,
29937,
1798,
1598,
18780,
1819,
13,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
13359,
275,
4304,
2141,
1384,
580,
13,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
13359,
275,
4304,
2141,
2083,
580,
13,
14058,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
13359,
275,
4304,
2141,
1384,
580,
13,
14058,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
13359,
275,
4304,
2141,
2083,
580,
13,
13,
29937,
18399,
278,
848,
13,
29937,
14104,
292,
319,
1707,
482,
28663,
17387,
13,
572,
29873,
29889,
5317,
29898,
14058,
29918,
7382,
1839,
6360,
7464,
14058,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29892,
3858,
353,
525,
14058,
1495,
13,
572,
29873,
29889,
5317,
29898,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
6360,
7464,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29892,
3858,
353,
525,
2290,
29877,
319,
1397,
276,
1495,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
29924,
21081,
319,
5280,
479,
6789,
546,
1535,
313,
30105,
29907,
29897,
320,
29876,
29871,
29955,
29899,
6360,
3474,
1495,
13,
572,
29873,
29889,
3257,
703,
1523,
20941,
310,
24804,
319,
1397,
276,
322,
278,
3186,
29915,
29879,
320,
29876,
10430,
313,
30105,
29907,
29897,
975,
278,
2440,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
8990,
4197,
29896,
29947,
29941,
29947,
29892,
29906,
29900,
29896,
29941,
29892,
29955,
29892,
29896,
29929,
29889,
29945,
2314,
13,
572,
29873,
29889,
26172,
580,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
572,
29873,
29889,
7620,
1003,
877,
29924,
21081,
319,
1707,
482,
28663,
17387,
742,
29881,
1631,
353,
29871,
29941,
29900,
29900,
29892,
29890,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
572,
29873,
29889,
4294,
580,
13,
13,
29937,
24804,
319,
1397,
276,
2099,
10430,
19262,
13,
572,
29873,
29889,
5317,
29898,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
6360,
7464,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
485,
29887,
29918,
7382,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29897,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
6816,
273,
6789,
546,
1535,
313,
30105,
29907,
29897,
1495,
13,
572,
29873,
29889,
3257,
703,
6816,
273,
10430,
313,
30105,
29907,
29897,
19262,
297,
29905,
29876,
24804,
319,
1397,
276,
29871,
975,
278,
2440,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
8990,
4197,
29896,
29947,
29941,
29906,
29892,
29906,
29900,
29896,
29941,
29892,
29896,
29953,
29889,
29945,
29892,
29906,
29900,
2314,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
572,
29873,
29889,
7620,
1003,
877,
2290,
29877,
319,
1397,
276,
2099,
10430,
19262,
742,
29881,
1631,
353,
29871,
29941,
29900,
29900,
29892,
29890,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
572,
29873,
29889,
4294,
580,
13,
13,
29937,
24804,
319,
1397,
276,
8401,
1029,
279,
482,
10430,
19262,
13,
572,
29873,
29889,
5317,
29898,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
6360,
7464,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29897,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
29924,
21081,
319,
5280,
479,
6789,
546,
1535,
313,
30105,
29907,
29897,
320,
29876,
29871,
29955,
29899,
6360,
3474,
1495,
13,
572,
29873,
29889,
3257,
703,
29924,
21081,
1029,
279,
482,
10430,
313,
30105,
29907,
29897,
19262,
297,
29905,
29876,
24804,
319,
1397,
276,
975,
278,
2440,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
8990,
4197,
29896,
29947,
29941,
29906,
29892,
29906,
29900,
29896,
29941,
29892,
29896,
29953,
29889,
29945,
29892,
29906,
29900,
2314,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
572,
29873,
29889,
7620,
1003,
877,
2290,
29877,
319,
1397,
276,
8401,
1029,
279,
482,
10430,
19262,
742,
29881,
1631,
353,
29871,
29941,
29900,
29900,
29892,
29890,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
572,
29873,
29889,
4294,
580,
13,
13,
29937,
2787,
2099,
10430,
19262,
13,
572,
29873,
29889,
5317,
29898,
14058,
29918,
7382,
1839,
6360,
7464,
14058,
29918,
7382,
1839,
485,
29887,
29918,
7382,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29897,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
6816,
273,
6789,
546,
1535,
313,
30105,
29907,
29897,
1495,
13,
572,
29873,
29889,
3257,
703,
6816,
273,
10430,
313,
30105,
29907,
29897,
19262,
297,
29905,
29876,
278,
3186,
975,
278,
2440,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
8990,
4197,
29896,
29955,
29945,
29900,
29892,
29906,
29900,
29896,
29941,
29892,
29945,
29889,
29945,
29892,
29896,
29900,
2314,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
572,
29873,
29889,
7620,
1003,
877,
14058,
2099,
10430,
19262,
742,
29881,
1631,
353,
29871,
29941,
29900,
29900,
29892,
29890,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
572,
29873,
29889,
4294,
580,
13,
13,
13,
29937,
2787,
8401,
1029,
279,
482,
10430,
19262,
13,
572,
29873,
29889,
5317,
29898,
14058,
29918,
7382,
1839,
6360,
7464,
14058,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29897,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
29924,
21081,
319,
5280,
479,
6789,
546,
1535,
313,
30105,
29907,
29897,
320,
29876,
29871,
29955,
29899,
6360,
3474,
1495,
13,
572,
29873,
29889,
3257,
703,
29924,
21081,
1029,
279,
482,
10430,
313,
30105,
29907,
29897,
19262,
297,
29905,
29876,
278,
3186,
975,
278,
2440,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
8990,
4197,
29896,
29955,
29945,
29900,
29892,
29906,
29900,
29896,
29941,
29892,
29953,
29889,
29945,
29892,
29896,
29900,
2314,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
572,
29873,
29889,
7620,
1003,
877,
14058,
8401,
1029,
279,
482,
10430,
19262,
742,
29881,
1631,
353,
29871,
29941,
29900,
29900,
29892,
29890,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
572,
29873,
29889,
4294,
580,
13,
13,
13,
29937,
3323,
5317,
13,
572,
29873,
29889,
4532,
29898,
1003,
2311,
7607,
29953,
29892,
29871,
29946,
876,
13,
572,
29873,
29889,
1491,
5317,
29898,
29906,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
572,
29873,
29889,
5317,
29898,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
6360,
7464,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
485,
29887,
29918,
7382,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29897,
13,
572,
29873,
29889,
3257,
703,
2290,
29877,
319,
1397,
276,
2099,
10430,
19262,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
29909,
5280,
479,
320,
29876,
6789,
546,
1535,
313,
30105,
29907,
29897,
1495,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
13,
572,
29873,
29889,
1491,
5317,
29898,
29906,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
572,
29873,
29889,
5317,
29898,
14058,
29918,
7382,
1839,
6360,
7464,
14058,
29918,
7382,
1839,
485,
29887,
29918,
7382,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29897,
13,
572,
29873,
29889,
3257,
703,
14058,
2099,
10430,
19262,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
29909,
5280,
479,
320,
29876,
6789,
546,
1535,
313,
30105,
29907,
29897,
1495,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
13,
572,
29873,
29889,
29873,
523,
29918,
2680,
580,
13,
572,
29873,
29889,
7620,
1003,
877,
6816,
273,
29918,
15637,
29918,
13152,
29909,
29918,
29956,
742,
29881,
1631,
353,
29871,
29941,
29900,
29900,
29892,
29890,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
572,
29873,
29889,
4294,
580,
13,
13,
13,
13,
572,
29873,
29889,
4532,
29898,
1003,
2311,
7607,
29953,
29892,
29871,
29946,
876,
13,
572,
29873,
29889,
1491,
5317,
29898,
29906,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
572,
29873,
29889,
5317,
29898,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
6360,
7464,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29897,
13,
572,
29873,
29889,
3257,
703,
2290,
29877,
319,
1397,
276,
8401,
6588,
10430,
19262,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
29924,
21081,
319,
5280,
479,
320,
29876,
6789,
546,
1535,
313,
30105,
29907,
29897,
1495,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
13,
572,
29873,
29889,
1491,
5317,
29898,
29906,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
572,
29873,
29889,
5317,
29898,
14058,
29918,
7382,
1839,
6360,
7464,
14058,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29897,
13,
572,
29873,
29889,
3257,
703,
14058,
8401,
6588,
10430,
19262,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
29924,
21081,
319,
5280,
479,
320,
29876,
6789,
546,
1535,
313,
30105,
29907,
29897,
1495,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
13,
572,
29873,
29889,
29873,
523,
29918,
2680,
580,
13,
572,
29873,
29889,
7620,
1003,
877,
29924,
21081,
29918,
15637,
29918,
13152,
29909,
29918,
29956,
742,
29881,
1631,
353,
29871,
29941,
29900,
29900,
29892,
29890,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
572,
29873,
29889,
4294,
580,
13,
13,
13,
13,
29937,
3462,
3245,
2912,
800,
363,
5734,
17387,
13,
29937,
13,
485,
29887,
29918,
7382,
29918,
13152,
29909,
353,
24804,
29909,
1397,
276,
29918,
7382,
1839,
485,
29887,
29918,
7382,
13359,
12676,
580,
13,
485,
29887,
29918,
7382,
29918,
14058,
353,
2787,
29918,
7382,
1839,
485,
29887,
29918,
7382,
2033,
14352,
2435,
29898,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
6360,
2033,
6817,
29906,
13018,
29906,
1822,
12676,
580,
13,
12765,
29918,
485,
29887,
29918,
7382,
353,
1029,
29887,
29918,
7382,
29918,
13152,
29909,
448,
1029,
29887,
29918,
7382,
29918,
14058,
13,
13,
2290,
29877,
29909,
1397,
276,
29918,
7382,
29889,
29725,
2541,
29898,
14058,
29918,
7382,
14352,
2435,
29898,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
6360,
2033,
6817,
29906,
13018,
29906,
2314,
13,
13,
13,
13,
13,
13,
13,
13,
13,
572,
29873,
29889,
5317,
29898,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
6360,
7464,
2290,
29877,
29909,
1397,
276,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29892,
3858,
353,
525,
2290,
29877,
319,
1397,
276,
1495,
13,
572,
29873,
29889,
5317,
29898,
5894,
386,
29918,
7382,
1839,
6360,
7464,
5894,
386,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29892,
3858,
353,
525,
5894,
386,
1495,
13,
572,
29873,
29889,
5317,
29898,
2177,
275,
29918,
7382,
1839,
6360,
7464,
2177,
275,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29892,
3858,
353,
525,
2177,
275,
1495,
13,
572,
29873,
29889,
5317,
29898,
29940,
29979,
29918,
7382,
1839,
6360,
7464,
29940,
29979,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29892,
3858,
353,
525,
4373,
3088,
1495,
13,
572,
29873,
29889,
5317,
29898,
14058,
29918,
7382,
1839,
6360,
7464,
14058,
29918,
7382,
1839,
29955,
29899,
6360,
14104,
292,
319,
1707,
482,
7464,
13,
308,
6276,
342,
1508,
2433,
29899,
742,
17456,
2433,
29877,
742,
16292,
29922,
29906,
29892,
29320,
675,
29922,
29896,
29892,
3858,
353,
525,
14058,
1495,
13,
572,
29873,
29889,
29916,
1643,
877,
12883,
1495,
13,
572,
29873,
29889,
29891,
1643,
877,
29924,
21081,
319,
5280,
479,
6789,
546,
1535,
313,
30105,
29907,
29897,
320,
29876,
29871,
29955,
29899,
6360,
3474,
1495,
13,
572,
29873,
29889,
3257,
703,
1523,
20941,
310,
1422,
14368,
322,
278,
3186,
29915,
29879,
320,
29876,
10430,
313,
30105,
29907,
29897,
975,
278,
2440,
613,
4079,
7915,
353,
525,
8934,
1495,
13,
572,
29873,
29889,
8990,
4197,
29896,
29947,
29941,
29947,
29892,
29906,
29900,
29896,
29941,
29892,
29955,
29892,
29896,
29929,
29889,
29945,
2314,
13,
572,
29873,
29889,
26172,
580,
13,
572,
29873,
29889,
7720,
29898,
5574,
29897,
13,
572,
29873,
29889,
7620,
1003,
877,
15329,
552,
315,
1907,
14104,
292,
319,
1707,
482,
28663,
17387,
742,
29881,
1631,
353,
29871,
29941,
29900,
29900,
29892,
29890,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
572,
29873,
29889,
4294,
580,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
2
] |
Server/test/__init__.py
|
devArtoria/-Awesome-GraphQL-
| 27 |
106947
|
<filename>Server/test/__init__.py<gh_stars>10-100
import unittest
from config import dev
from Server import create_app
import json
app = create_app(dev.DevConfig)
class BasicTestCase(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
app.testing = True
self.tester = app.test_client(self)
def request(self, type, call, body):
query = type + " {" + call + "{" + body + "}" + "}"
response = self.tester.post('/graphql',
data=json.dumps({"query": query}),
content_type='application/json'
)
print(response.json)
return dict(response.json)['data']
def _create_fake_data(self):
# Create fake data
pass
def _get_tokens(self):
response = self.request(type="mutation",
call='auth(id:"{0}", password:"{1}")'.format("fake user's id", "fake user's pw"),
body='''
result{
... on AuthField{
refreshToken
accessToken
message
}
}
''')
response = response['auth']
self.access_token = response['result']['accessToken']
self.refresh_token = response['result']['refreshToken']
def setUp(self):
self._create_fake_data()
self._get_tokens()
def tearDown(self):
# teardown code ex. drop tables
pass
|
[
1,
529,
9507,
29958,
6004,
29914,
1688,
29914,
1649,
2344,
26914,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
5215,
443,
27958,
13,
3166,
2295,
1053,
2906,
13,
3166,
5656,
1053,
1653,
29918,
932,
13,
5215,
4390,
13,
13,
932,
353,
1653,
29918,
932,
29898,
3359,
29889,
16618,
3991,
29897,
13,
13,
13,
1990,
19219,
3057,
8259,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
443,
27958,
29889,
3057,
8259,
17255,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
4706,
623,
29889,
13424,
353,
5852,
13,
4706,
1583,
29889,
1688,
261,
353,
623,
29889,
1688,
29918,
4645,
29898,
1311,
29897,
13,
13,
1678,
822,
2009,
29898,
1311,
29892,
1134,
29892,
1246,
29892,
3573,
1125,
13,
4706,
2346,
353,
1134,
718,
376,
8853,
718,
1246,
718,
376,
6377,
718,
3573,
718,
376,
5038,
718,
376,
5038,
13,
13,
4706,
2933,
353,
1583,
29889,
1688,
261,
29889,
2490,
11219,
4262,
1519,
742,
13,
462,
462,
1678,
848,
29922,
3126,
29889,
29881,
17204,
3319,
29908,
1972,
1115,
2346,
9594,
13,
462,
462,
1678,
2793,
29918,
1853,
2433,
6214,
29914,
3126,
29915,
13,
462,
462,
1678,
1723,
13,
13,
4706,
1596,
29898,
5327,
29889,
3126,
29897,
13,
4706,
736,
9657,
29898,
5327,
29889,
3126,
29897,
1839,
1272,
2033,
13,
13,
1678,
822,
903,
3258,
29918,
29888,
1296,
29918,
1272,
29898,
1311,
1125,
13,
4706,
396,
6204,
25713,
848,
13,
4706,
1209,
13,
13,
1678,
822,
903,
657,
29918,
517,
12360,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
3827,
29898,
1853,
543,
6149,
362,
613,
13,
462,
18884,
1246,
2433,
5150,
29898,
333,
6160,
29912,
29900,
17671,
4800,
6160,
29912,
29896,
27195,
4286,
4830,
703,
29888,
1296,
1404,
29915,
29879,
1178,
613,
376,
29888,
1296,
1404,
29915,
29879,
282,
29893,
4968,
13,
462,
18884,
3573,
2433,
4907,
13,
462,
462,
268,
1121,
29912,
13,
462,
462,
268,
2023,
373,
13189,
3073,
29912,
13,
462,
462,
268,
11086,
6066,
13,
462,
462,
268,
2130,
6066,
13,
462,
462,
268,
2643,
13,
462,
462,
268,
500,
13,
462,
462,
268,
500,
13,
462,
462,
268,
6629,
1495,
13,
13,
4706,
2933,
353,
2933,
1839,
5150,
2033,
13,
4706,
1583,
29889,
5943,
29918,
6979,
353,
2933,
1839,
2914,
16215,
5943,
6066,
2033,
13,
4706,
1583,
29889,
22379,
29918,
6979,
353,
2933,
1839,
2914,
16215,
22379,
6066,
2033,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
3032,
3258,
29918,
29888,
1296,
29918,
1272,
580,
13,
4706,
1583,
3032,
657,
29918,
517,
12360,
580,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
396,
734,
538,
776,
775,
429,
29889,
5768,
6131,
13,
4706,
1209,
13,
2
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.